0

I want to emulate EEPROM in sectors 2 and 3 to keep erase time low (small 16kb sectors). My question is how to go about reserving this flash space to prevent compiler from placing program code in these sectors?

Can anyone point me to info on this I haven't found anything that makes sense so far?

Thanks

Bruce Duncan
  • 169
  • 6
  • 15

1 Answers1

0

From Application Note AN3969, the best approach would be, as you have said is to use Sectors 0-3 since they are only 16kB.

My question is how to go about reserving this flash space to prevent compiler from placing program code in these sectors?

In your linker file (*.ld) declare the start of your Flash to be at the beginning of Sector 4 so that the Linker places your code beginning at that address eg.

Galaxy
  • 210
  • 4
  • 15
  • The problem with the end of flash on the F4 is that the sector sizes are very large so you have to dedicate a significant chunk to the emulation. For who knows what reason ST decided to bunch up small sectors at the beginning and progressively get larger towards the end. – Andy Brown Aug 10 '15 at 15:35