2024-06-11 03:30 AM
Hi,
For my application I need the following,
I want to store variables in Flash memory, in order to preserve the data after a Hardware reset.
My approach is as follows:
1.) Modify the linker script to keep a page of flash memory outside of the program memory.
-> Outcome, This I did correctly as seen below,
My flash memory boundaries in the RM and Datasheet for my MCU is shown below:
So, we can see that I have 2 pages free (4 K), where the program will not be stored.
[The RAM is in the SRAM, which is not in the flash segment of the memory , so this is leaved as is].
2.) Modify the Variable which loads the vector table into flash.
-> Outcome: This is shown below ,found in the system_stm32g0xx.c file.
The questions:
With the above facts in mind. Without even touching the empty blank flash pages.
My application after a hardware reset does not run, my code does not run after the controller experienced a hardware reset.
Why is this happening, it does not make sense to me ?.
With the default memory layout the code runs after a hardware reset.
Thanks
Solved! Go to Solution.
2024-06-11 03:41 AM
The reset expects there to be a table at 0x08000000 not some place else. Put your user data slack pages at the END of FLASH by making the size visible to the Linker smaller.
2024-06-11 03:41 AM
The reset expects there to be a table at 0x08000000 not some place else. Put your user data slack pages at the END of FLASH by making the size visible to the Linker smaller.