This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

how to keep some RAM values after cortex m3 reset

Is there any way to keep some RAM or global variables values after clicking on reset button on the board or on Kiel

I am using STM32L152ZE

Parents
  • Place the variables in a UNINIT/NOINIT type section, or outside the memory arena described to the linker.

    Variables that get placed in with the normal statics will either be zeroed, or have values copied into them, by the C runtime code called by __main prior to your main() function.

    For Cortex-Mx code using CMSIS model, you may also be able to pull values out in SystemInit() because the memory has not been cleared/initialized yet.

Reply
  • Place the variables in a UNINIT/NOINIT type section, or outside the memory arena described to the linker.

    Variables that get placed in with the normal statics will either be zeroed, or have values copied into them, by the C runtime code called by __main prior to your main() function.

    For Cortex-Mx code using CMSIS model, you may also be able to pull values out in SystemInit() because the memory has not been cleared/initialized yet.

Children
No data