Hello,
In my current project, I'm using a non-volatile battery backed SRAM, and now, I would like to declare variables that will be placed in that memory but that will not be initialized to zero at init.
In my lcf I added a memory section like that:
MEMORY{... saved_ram: org = 0x20000000, len = 0x00020000...}SECTIONS{GROUP : { .dataSavedRam : {} } >}
and in my code:
#pragma push#pragma section data_type ".dataSavedRam" ".dataSavedRam"#pragma pop__declspec(section ".dataSavedRam") int savedVarExample;
But during startup my variable is initialized to 0 in the function __init_data (in __start.c).
So, what is the best solution to avoid that?
thank you.
Solved! Go to Solution.
Hello
In fact you need to modify the function init_data.
Look for FAQ-27500 on www.freescale.com. This should provide you some insight on how to implement that.
CrasyCat
Hello
In fact you need to modify the function init_data.
Look for FAQ-27500 on www.freescale.com. This should provide you some insight on how to implement that.
CrasyCat
Hello,
Thank you, it works fine now.