AnsweredAssumed Answered

RAM sections, map file, RAM memory filling

Question asked by Davide Michelis on May 18, 2018
Latest reply on May 22, 2018 by Davide Michelis

Good morning,


I am developing an application that uses STM32F3DISCO as board and FreeRTOS as OS. I want to keep some data in the RAM after some Software reset that I do under some conditions so I have used the notation


near the variables I want to preserve. Moreover in the linker script I have added a section just after .data and before .bss


.my_section (NOLOAD):
    . = ALIGN(4);
    _s_my_section = .;      
    . = ALIGN(4) ;
    _e_my_section = .;
  } > RAM


Now, the application works correctly and the values are preserved but I want to understand more:

when I do a reset pressing the button I get my values stored  -> OK

when I do a power on reset values are more or less random -> OK

To put a 0 in those locations again I have to upload a program without that section the SRAM reset to 0 when a new .bin is flashed? Because otherwise I cannot explain this behavior.


Sorry if the question could seem a bit naive.