- Silicon Labs Community
- Welcome and Announcements
- Silicon Labs Knowledge Base
- 8-bit MCU
- 32-bit MCU
- Bluetooth / Wi-Fi
- Other Products Category
- Optical/RH/Temp Sensor
- Other Products
- Hardware and Software Tools
- Simplicity Studio and Software
- General Discussions and Suggestions
- Chinese Forum
- Software Libraries
- Development Kits
- Reference Designs
- Third Party Tools
- White Papers
- Official Blog of Silicon Labs
- Chinese Blog
07-27-2017 12:39 PM
I have an EFM32WG940 and use arm-none-eabi-gcc to compile and link my program. The application requires that I store some data in the MCU's non-volatile flash memory, which is the same memory that the application program code is in.
How do I make sure that a few flash pages are NOT used by my program, but instead are reserved for the data?
My first bet would be to somehow edit the linker script, but I'm not sure how to do that. Could someone please help me out?
Solved! Go to Solution.
07-27-2017 03:56 PM
Any reason you cannot use the USERDATA page? That's 2 KB in its own address space apart from the main flash array.
Are you using Simplicity Studio? Changing the memory regions in Studio is easy:
08-03-2017 09:29 AM
Hey John, thanks! The USERDATA page seems exactly like what I need. If I want to use it, do I need to change memory regions?
One more question: when I don't use Simplicity Studio, how can I edit the linker script to change the flash layout?
08-03-2017 11:44 AM
You'd need to read up on creating sections in a custom GCC linker script if you specifically want to allocate constants in the user data page.
Of course, you can just manage it directly, without modifying the linker behavior. I've provided some ideas about how to do this in this Knowledge Base article.