how safe is it to rely on MPC5777C SRAM data retention under software reset?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how safe is it to rely on MPC5777C SRAM data retention under software reset?

Jump to solution
576 Views
ajmerijaimin
Contributor III

I want to set a few "flags or strings" before the reset event and read it back in the next boot up.

As per the reference manual, I felt using System RAM (SRAM) for this purpose is better as data written to SRAM before the reset event will be retained on software reset.

ajmerijaimin_0-1652329416635.png

I have modified the LD file to reduce the SRAM size by reserving last 128 bytes for my purpose. That's because the startup code (init.asm) would initialize entire SRAM with 32 GP register values. Which would lead to losing the data that was written right before the reset event.

Below is the screenshot from my LD file:

ajmerijaimin_1-1652329914944.pngajmerijaimin_2-1652329939063.png


I'm aware of the C55FMC flash controller to use flash memory for storage purposes. How safe is it to rely on SRAM data retention under software reset?

0 Kudos
1 Solution
537 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

in case of software reset there's no problem at all, it's safe and you can rely on that. Software reset is triggered by user, so you can ensure that there's no SRAM access at that moment.

Notice that except linker file, you should modify also startup file. The SRAM needs to be initialized due to ECC. It's necessary to check content of SIU_RSR register. If it was software reset and flag SSRS is set, skip the initialization of your SRAM segment for data retention. If it was any other reset, initialize whole SRAM.

Regards,

Lukas

View solution in original post

1 Reply
538 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

in case of software reset there's no problem at all, it's safe and you can rely on that. Software reset is triggered by user, so you can ensure that there's no SRAM access at that moment.

Notice that except linker file, you should modify also startup file. The SRAM needs to be initialized due to ECC. It's necessary to check content of SIU_RSR register. If it was software reset and flag SSRS is set, skip the initialization of your SRAM segment for data retention. If it was any other reset, initialize whole SRAM.

Regards,

Lukas