STM32G0x linker script Flash memory modification, dead after hardware reset
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-06-11 3: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.
- Labels:
-
STM32Cube MCU Packages
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-06-11 3: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.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-06-11 3: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.
Up vote any posts that you find helpful, it shows what's working..
