Software reset after PFlash sector write

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User21805
Level 1
Level 1
5 sign-ins First like given First like received

Using a TC277 - After I write a sector of PFlash (containing calibration data), then I issue a Software reset, I don't recover (without a hardware reset).

To add some context; as part of XCP, calibration data is in PFlash. It is copied to RAM and “overlayed” during the XCP session. The user has the option to push any calibration changes back to PFlash – that’s why I do a PFlash write.

I’m using the PFlash routines from the Infineon examples. 

https://www.infineon.com/dgdl/Infineon-AURIX_Flash_Programming_1_KIT_TC297_TFT-Training-v01_00-EN.pd...

So I can see that the correct data is written to PFlash.

Does anyone know why I can't Software reset successfully after this? (Note: my software reset works in all other contexts).

Thanks in advance

0 Likes
1 Solution

Hi Prudhvi,

I have a solution.
Ref. the image. If I try and run the write & verify inside the Safety endInit it fails. The write/erase PFLASH library functions seem to have their own clear/set Safety endinit function calls.

User21805_0-1663062008867.png

Regards

Richard

View solution in original post

4 Replies
Prudhvi_E
Moderator
Moderator
Moderator
250 replies posted 100 solutions authored 25 likes received

Hello,

Could you please clarify what do you mean by "I issue a Software reset, I don't recover". Is the SW got struck somewhere before or after issuing a reset ? I'm assuming that SW got restarted with the reset command and got struck in the Initialization code. Is it correct?

Did you get chance to monitor where the SW got struck using a debugger ? I understand that you're using code examples on FLASH programming. The example has writeXxFlash and verifyXxFlash funtions. Are those any errors detected in verifyXxFlash function ?

Regards,

Prudhvi.

0 Likes

Hi Prudhvi,

After the SW reset, cores 0 & 2 seem to have stopped. If I then do a HW reset, all run. The test data has been correctly written to PFlash.

Adding some more detail, my process is...
- Initiate the SW reset with a specific CAN message.

- Call a "power end" function, which does writeXxFlash, verifyXxFlash, then sets SWRSTREQ.

- SW reset occurs but cores 0 & 2 don't run.

I don’t think the sector I’m writing to contains executable code. I’m writing my test values to PFlash – PS0, S17 – which is at base address 0xA000,0000 + 0x0007,0000.

As I said, after HW reset, everything runs correctly and the sector S17 still contains the test data written to it.

Regards

Richard

0 Likes

Hi Prudhvi,

I have a solution.
Ref. the image. If I try and run the write & verify inside the Safety endInit it fails. The write/erase PFLASH library functions seem to have their own clear/set Safety endinit function calls.

User21805_0-1663062008867.png

Regards

Richard

Prudhvi_E
Moderator
Moderator
Moderator
250 replies posted 100 solutions authored 25 likes received

Hello Richard,

Thanks for posting the solution.

Regards,

Prudhvi.