AnsweredAssumed Answered

BF533: Retain memory contents after restart

Question asked by Stefanos on Feb 20, 2015
Latest reply on Mar 11, 2015 by jobo23

Hi all,


I am working on a project with a BF533 and I have a little problem that I hope you can help me with.


So I have created an init code as described in EE-240, a booloader dxe and my_application dxe.

On startup, the init code is executed and then it loads the booloader. The bootloader then will load my_application.

I also have a variable called "flag" which is placed by the linker in address 0xff900000 (I have made a section in the LDF in address 0xff900000)

What I want to do is be able to set flag to a value in my_application, let the watchdog reset the processor and have the flag read by the bootloader. Unfortunately this doesn't work cause I can see that the whole memory bank B is initialized to 0 before the bootloader is loaded.


I checked with the debugger step by step what happens and I can see that after I set the flag to the desired value and the watchdog resets the processor, the value is still unchanged. Even during the init code execution, the value is unchanged. But right after that, after the init code returns and right before bootloader is starts execution (breakpoint at bootloader's main) the whole memory bank is initialized to 0, including my flag variable.


How can prevent this? My guess is that I need to put some instruction in the ldf file but i can't figure out what.