I am using STM32F401CE with Platformio and the Arduino framework. I would like to reserve a block of 16K Flash memory as a EEPROM replacement for occasional settings written by my app.
How can I cleanly reserve a 16K flash block such that the linker will not place any code there and in a way that doesn't require manual editing of platformio managed files?
I saw examples when the address of a block is just used without the linker being aware of it or examples when the linker script that is managed by platform io is manually edited but can easily be lost if updating or replicating the project on another machine. Another example I found was AN2594 which emulates a EEPROM using two flash blocks and is an overkill to what I need.
I am thinking, maybe adding to my project an assembly file that will reserve a flash section at a fixed address but not sure if this is a good idea or how to implement it.
This question is not on how to read/write to flash but just how to safely reserve a block of it.