2023-10-31 01:15 PM
At system reset, static memory is zeroed. I want static memory to be entirely left alone by the system. I want the memory to have what I put in it, not clobbered. Granted, I have to retain power to the device, but static memory should be able to retain data across any number of system resets. This reset happens in an assembler module supplied by ST in the Raisonance development kit I am using for F4 and L4 devices. I tried changing the source module, and deleting the old object file, but the Raisonance kit does not reassemble that module. When I try to look at that module in the debugger, it seems the linker omitted the object code, but the resets to zero are still happening. The module is startup_stm32f429xx.s
2023-10-31 02:34 PM
Set a breakpoint in the startup before it touches any RAM (or clear the checkbox Resume in debugger settings). Then the debugger will stop early and you can see whether the SRAM is preserved or already erased. In the latter case this is a power issue, not solvable in software.
2023-10-31 03:44 PM
The MCU doesn't do this. Code in startup.s is entirely responsible for clearing and copying data sections, as usually expected by C runtime code.
Can also have sections set as NOLOAD or NOINIT depending on the tools chain.
You can carve out sections of memory so they are not used by the Linker, see .LD file.
2023-11-17 11:27 AM
The problem is certainly caused by software. Changed the initialization software to skip zeroing my memory block, problem goes away. Now my static memory values are preserved across system resets for that particular memory block.