How to maintain the data in some SRAM area, not intialized?

cancel
Showing results for 
Search instead for 
Did you mean: 

How to maintain the data in some SRAM area, not intialized?

796 Views
q_zhang
Contributor I

When the system jumps from application program to boot, it needs to read the data in SRAM in boot, so it is hoped that the data in SRAM in this part will not be initialized. I have tried to disable BIST,but in vain. 

S32R274 is used and the memrory allocation shows as follow:

捕获.PNG

0 Kudos
12 Replies

699 Views
petervlna
NXP Employee
NXP Employee

Hello,

Accroding to the datasheet, this reset causes a system reset equivalent to assertion of the RESET pin,which means external reset. So, the ram content should have been preserved, however, the fact is that the data was destroyed. I don't know why.

External reset destroys RAM if BIST is enabled.

I recommend you to perform functional reset by SW instead of watchdog (just doesn't give me any sense):

pastedImage_3.png

I also tried Mode Entry Module, like this (In this picature, the variable mode is equal to 0,which means it triggers a 'functional' reset event):

Yes, this is the way how it should be done.

regards,

Peter

0 Kudos

699 Views
q_zhang
Contributor I

I have tried Mode Entry Module, like this (In this picature, the mode is equal to 0):.

however, after reset, the startup.s was executed and the data in address 0x4001c004 was destroyed too.I don't know why.

1.png

2.png

0 Kudos

699 Views
petervlna
NXP Employee
NXP Employee

Hi,
looks like your stratup is not written well. So, you do RAM init on any kind of reset?

In real application customers do SW branching based on reset type ( RGM [FES/DES] registers.)

It will also save you initialization time and prevent loss of data in RAM.

Make sure your startup is properly written fro your application needs and it will work as you expect.

regards,

Peter

0 Kudos

699 Views
q_zhang
Contributor I

my startup was generated automatically and I didn't modify it. So, how to modify startup to prevent loss of data in RAM? I really have no knowledge of assembly language.

Thanks

0 Kudos

702 Views
petervlna
NXP Employee
NXP Employee

Hello,

Well, that could be a little issue.

Since you want custom startup which will fit to you bootloader needs, it would require assembly knowledge. (if the startup is assembly - which I guess is ,to save boot time)

regards,

Peter

0 Kudos

702 Views
q_zhang
Contributor I

I just want to prevent loss of data in RAM,if modifying startup can solve this problem, I think  there is no difference whether  there is bootloader or not.

In fact, according to the annotation in startup, I can't see the process of  Initializing SRAM,just the process of  Initializing SRAM ECC. Could you give me a example where some data in RAM is preserved?

Thanks

0 Kudos

702 Views
petervlna
NXP Employee
NXP Employee

Sure,

Comment our ECC initialization.

That is what is causing RAM content to be destroyed after functional reset.

as the RAM data and ECC syndrome must fit together. Therefore you doing RAM initialization.

regards,

Peter

0 Kudos

702 Views
q_zhang
Contributor I

Could you give me a project demo where some data in RAM is preserved?

Thanks

0 Kudos

702 Views
petervlna
NXP Employee
NXP Employee

Hello,

system jumps from application program to boot, it needs to read the data in SRAM in boot,

I guess you are talking about reset after boot loader. Otherwise I see no issue for RAM to preserve its data.

What destroys RAM content is:

Power ON reset

Destructive resetr

and BIST - if started on reset.

RAM content is preserved in functional reset even if BIST is enabled.

Please specify what you want to achieve.

regards,

Peter

0 Kudos

702 Views
q_zhang
Contributor I

I think hardware reset is executed in my code.In application, Software Watchdog Timer(SWT) is used, and SWT time-out register is set to 20ms, waiting the reset. like this:

捕获.PNG

Then, the chip runs from boot, and I need to read the RAM, where data is wrote in application. 

0 Kudos

702 Views
petervlna
NXP Employee
NXP Employee

Hi,

then only way is to execute functional reset in your application otherwise the RAM content will be destroyed.

I have no idea what do you mean by hardware reset as such reset source does not Mode entry module implement.

regards,

Peter

0 Kudos

702 Views
q_zhang
Contributor I

I need to jump to boot from application, so I used SWT module, waiting for the watchdog timer to expire and assert a reset.

Accroding to the datasheet, this reset causes a system reset equivalent to assertion of the RESET pin,which means external reset. So, the ram content should have been preserved, however, the fact is that the data was destroyed. I don't know why.

I also tried Mode Entry Module, like this (In this picature, the variable mode is equal to 0,which means it triggers a 'functional' reset event):

1.PNG

however, after reset, the startup.s was executed and the data in address 0x4001c004 was destroyed too.

2.PNG

0 Kudos