[MPC5644A] After reset, SRAM data retention.

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

[MPC5644A] After reset, SRAM data retention.

Jump to solution
2,598 Views
youngguekim
Contributor III

Hi. I am using MPC5644A.

 

I want to retain a specific data in SRAM region after soft reset.

is there any function of MPC5644A to do that?? (ex. Standby mode)

or can you recommend another reset(ex. Software External Reset)

 

the reason to do

- I should reset the MPC5644A to go back bootloader(Low address) with previoud SRAM data

 

Thank you for your help.

Labels (1)
1 Solution
1,885 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Uninitialized SRAM space should be displays similarly as below, thus typically debuggers shows '????????'. In case it is NOT software reset, you software must initialize this area as well.

pastedImage_0.png

View solution in original post

13 Replies
1,885 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Pay attention to section 1.2 in my document:

http://cache.nxp.com/files/microcontrollers/doc/app_note/AN5200.pdf

You can omit SRAM initialization for software reset that is synchronous, other sources are asynchronous and so there is certain risk of ECC error if device has been reset during SRAM write (MPC5644A Microcontroller Reference Manual, Rev. 6, section 11.8.2 Reset effects on SRAM accesses).

To sum it up:

1) generate software reset by bit SIU_SRCR[SSR] asserting.

2) modify your SRAM initialization code to check SIU_RSR[SSRS] whether it was software reset or not. If yes, SRAM initialization code may omit specified SRAM portion, otherwise all SRAM content must be deleted.

0 Kudos
1,885 Views
youngguekim
Contributor III

Thank you for your help

but I don't understand  "modify your SRAM initialization code"

I don't have a hand code of SRAM initialization. 

SRAM initialization code is crt0.s ?? and How can i modify the code to uninitialize a specific region ??

----------------------------------------------------------------------------------------------------------------------

::reference

When I generated software reset by bit SIU_SRCR[SSR] asserting.

Bit SIU_RSR[SSRS] became 1. and it means that A Software System Reset has occurred.

0 Kudos
1,885 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Every startup code must initialize internal SRAM as described in AN5200, section 1.1.

For instance CodeWarrior 2.10 have it defined in module MPC5644A_HWInit.c, function below. This code you will have to modify according to your needs. Other compilers may have it done differently, but it must be somewhere in startup code as well.

__asm void INIT_Derivative(void)

{

nofralloc

    /* MPC5644A L2SRAM initialization code */

    lis r11,L2SRAM_LOCATION@h

    ori r11,r11,L2SRAM_LOCATION@l

    li r12,1536  /* Loop counter to get all of L2SRAM; 192k/4 bytes/32 GPRs = 1536 */

    mtctr r12

    init_l2sram_loop:

        stmw r0,0(r11)        /* Write all 32 GPRs to L2SRAM */

        addi r11,r11,128      /* Inc the ram ptr; 32 GPRs * 4 bytes = 128 */

        bdnz init_l2sram_loop /* Loop for 192k of L2SRAM */

    blr

}

0 Kudos
1,885 Views
youngguekim
Contributor III

Thank you. I found code to initialize internal SRAM in ecc_init.s

and I want to use SRAM size of 0x1000 to save some data(nonvolatile) (0x4002F000~0x4002FFFF)

is there any restriction of using SRAM area for Another purpose?

0 Kudos
1,885 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

For storing of nonvolatile data you should apparently use internal flash memory. Otherwise the restrictions we have already discussed.

0 Kudos
1,885 Views
youngguekim
Contributor III

Hi. David

I edited ecc_init.s

initialize 0x4000_0000 ~ 0x4002_6FFF

no initialize 0x4002_7000~0x4002_7FFF

after I save some data in 0x4002_7000~0x4002_7FFF and I assert soft reset, I can use the data.

but I have problem lately

After Cold reset, data in 0x4002_7000~0x4002_7FFF can't be read without writing.

when i tried to read some data without writing, the code that read the date in 0x4002_7000~0x4002_7FFF cause malfunction.

What's is the problem?

0 Kudos
1,885 Views
alexvinchev
Contributor V

What do you mean by "cold reset"? If it is asynchronous reset or power cycle, your SRAM content is or may be gone, so ECC check most probably fails and you get error, which is completely expected behavior.

0 Kudos
1,885 Views
youngguekim
Contributor III

Hi.

Cold reset means Hard reset.

if I did not initialize 0x4000_0000 ~ 0x4002_6FFF in ecc_init.s

after Hard reset, There are No values( even trash values) so I couldn't access data in  0x4000_0000 ~ 0x4002_6FFF

Thanks

0 Kudos
1,886 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Uninitialized SRAM space should be displays similarly as below, thus typically debuggers shows '????????'. In case it is NOT software reset, you software must initialize this area as well.

pastedImage_0.png

1,885 Views
rehabmansour
Contributor III

Hi David ,

I am using MPC5606B ,and I am facing the same problem ,but I can't write to this section it causes an exception if I try to write to it after a POR .

How can I "unlock  it" to rewrite  ?

0 Kudos
1,885 Views
rehabmansour
Contributor III

pic. of SRAM after POR reset to:

SBL_SRAM.png

0 Kudos
1,885 Views
rehabmansour
Contributor III

OK,I fixed the problem by Modifying file MPC560xB_HWInit.c function INIT_Derivative to initialize 64 KB of SRAM instead of 32KB .

Still would like to understand why this should happen 

0 Kudos
1,885 Views
youngguekim
Contributor III

Thank you.

it is a great help to me.

0 Kudos