cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F446: Flash memory

tst
Associate II

I want write only some bytes but before that I have to erase a full sector.

If I don´t want to loss data from that sector I will need save them.

If sector size is 128Kb, how can I save all data? 

Thank you !

11 REPLIES 11
tst
Associate II

Thank you.

I will used a sector of 128Kb to save user code o bootloader and smaller sector to save user data with other to backup. 

turboscrew
Senior III

Sectors 0-3 are 16 kB. Leave sector 0 for boot code and use sectors 1 and 2 for storing data.

Note that you need to fix the linker script too, if you leave "data holes" in the middle of code.

You can define 4 flash-regions: boot, data1, data2 and code and allocate the code in boot and code.

Then you need to decide what goes into boot and what goes into code. Maybe initializations into boot and application itself into code.