S32K311_noinit_ram

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

S32K311_noinit_ram

2,342 Views
nirmal_masilamani
Contributor IV

I have a project with S32K311 device and I tried to add a variable to the .noinit section, but the variable didn't keep its value after a software reset.

See my linker file below with the definition of the .noinit section.

nirmal_masilamani_0-1750844763201.png

nirmal_masilamani_1-1750844920794.png

 

 

Tags (2)
0 Kudos
Reply
9 Replies

2,315 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @nirmal_masilamani,

I imagine you are trying to configure the standby RAM to retain its state after low power exit or SW reset, correct?

You can refer to the following community posts, where some example projects where shared for RTC wakeup and Standby RAM configuration:

Best regards,
Julián

0 Kudos
Reply

2,254 Views
nirmal_masilamani
Contributor IV

Hi,

I have followed the instructions as per the example you provided.

.ld file .

nirmal_masilamani_0-1751377342862.png

nirmal_masilamani_1-1751377368306.png

 

initialization : 

__attribute__ ((section (".sram_standby_bss"))) volatile BootStatus_t g_boot_status;

Still, g_boot_status value resetting after restart.

 

Tags (2)
0 Kudos
Reply

2,242 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @nirmal_masilamani,

Could you show your project? Also, are you reading the variable by connecting a debugger, or printing it out?

You need to add the Standby RAM section to the memory section:

Julin_AragnM_0-1751406265460.png

You also need to initialize the ECC if the reset was destructive, along with disabling the cache. I've sent you a private message through the community for a document explaining these steps.

Best regards,
Julián 

0 Kudos
Reply

2,228 Views
nirmal_masilamani
Contributor IV

Hello @Junjun ,

Thanks for your reply.

Please find my project in the attachment.

I trying to read the data in debug mode, also whenever i give debug system go to Hardfault

Tags (2)
0 Kudos
Reply

2,211 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @nirmal_masilamani,

I can see in the project you are not going into standby nor performing a reset through SW. Could you share how are you triggering the reset? You can refer to these posts for performing reset through the MC_ME (power) driver: How to invoke software reset in s32k3xx? - NXP Community & S32K344 How to manually trigger one Function Reset - NXP Community.

Also, when connecting with the debugger, please ensure you are selecting the "Attach to running target" to ensure you are not triggering a reset. In PEmicro debugger, this is the option:

Julin_AragnM_1-1751479790041.png

Best regards,
Julián

 

 

0 Kudos
Reply

2,201 Views
nirmal_masilamani
Contributor IV

Hello @Julián_AragónM ,

Thanks for the response.

Is it possible to keep the data in noinit ram, even after hardware reset or power off?

Tags (2)
0 Kudos
Reply

2,199 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @nirmal_masilamani,

No, RAM retention is only across functional reset:

Julin_AragnM_3-1751480945889.png

Julin_AragnM_2-1751480942672.png

Best regards,
Julián

0 Kudos
Reply

2,176 Views
nirmal_masilamani
Contributor IV

Hello @Julián_AragónM ,

Thanks for your reply, is it possible to use any other memory section for noinit_ram?

Also in the attached project, i am getting hardfault after using int_sram block for standby RAM.

Tags (2)
0 Kudos
Reply

2,163 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @nirmal_masilamani,

No, only SRAM0 has 32KB (depending on the derivative you chose):

Julin_AragnM_0-1751558936522.png

Also, where exactly are you entering hard fault? Please use the example provided in the low power community post (S32K3 Low Power Management) firstly as a base, and then you can try to implement it in your project.

Best regards,
Julián 

 

0 Kudos
Reply