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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

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

跳至解决方案
615 次查看
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?

标记 (3)
0 项奖励
1 解答
576 次查看
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

在原帖中查看解决方案

1 回复
577 次查看
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