2017-10-29 06:39 AM
Hello,
I use STM32F401RE Nucleo board and Keil MDK5 IDE. In my application I need to store user data in flash memory.The sectors implementation in STM32f401 is as following:
Sector 0 0x0800 0000 - 0x0800 3FFF 16 Kbytes
Sector 1 0x0800 4000 - 0x0800 7FFF 16 KbytesSector 2 0x0800 8000 - 0x0800 BFFF 16 KbytesSector 3 0x0800 C000 - 0x0800 FFFF 16 KbytesSector 4 0x0801 0000 - 0x0801 FFFF 64 KbytesSector 5 0x0802 0000 - 0x0803 FFFF 128 KbytesSector 6 0x0804 0000 - 0x0805 FFFF 128 KbytesSector 7 0x0806 0000 - 0x0807 FFFF 128 KbytesI need only 32KB for user data. when I used sector 7 in my code, it worked well.
But it is wasting of the memory.I want to use the smaller first sectors (sectors 0 and 1) for user data and the next sectors for the application.I edited the scatter file as following but it does not work.
After rebuilding and running, the application does not run from the address 0x8008000. it runs from another addresses and run an old code. Any Advice???This is the scatter file
I also edited the programming algorithm as following:
#stm32-f #stm32f401re #stm32f4-flash-mem2017-10-30 12:29 AM
Find the linker spec to edit the STM32 memory segments addresses and shrink the code one, add your specific sector area for your own use. Otherwise, the linker will fillup the flash area from bottom to top with global constants and code.