STM32F401 Using flash memory sector 0 as storage
Hello,
I'm searching for a way to use sector 0 as storage memory but no luck so far.
I'm using STM32F401CCU6 and I'm working on a firmware which have to save about 300 bytes in a no volatile memory. For this microcontroller family we have this memory map:
Sector - Address ini ~ Address end - Size
Sector 0 - 0x0800 0000 ~ 0x0800 3FFF - 16 Kbytes
Sector 1 - 0x0800 4000 ~ 0x0800 7FFF - 16 Kbytes
Sector 2 - 0x0800 8000 ~ 0x0800 BFFF - 16 Kbytes
Sector 3 - 0x0800 C000 ~ 0x0800 FFFF - 16 Kbytes
Sector 4 - 0x0801 0000 ~ 0x0801 FFFF - 64 Kbytes
Sector 5 - 0x0802 0000 ~ 0x0803 FFFF - 128 Kbytes
Sector 6 - 0x0804 0000 ~ 0x0805 FFFF - 128 Kbytes
Sector 7 - 0x0806 0000 ~ 0x0807 FFFF - 128 Kbytes
So far I already used a little bit more then 66kB, which means, my firmware is using sectors 0 to 4 and increasing.
Now, I'm already saving the data in flash memory, all good for the sector 5 using HAL. But it's only 500 bytes in a block of 128Kbytes, it's a waste of memory, and when the firmware reaches the block 5 I'll have to move the data to next sector.
So, the question is: is it possible to use sector 0 as storage and make the boot start from block 1?
The best information I found about it, was this post, but it's about STM32F7 and that solution is not available for F4:
https://stackoverflow.com/questions/56896375/how-can-i-change-the-start-address-on-flash/56902284#56902284
Thank you all.
