Mbed provides the incredibly useful FlashIAP class for programming an MCU's built-in flash, and the handy FlashIAPBlockDevice class which allows you to access that flash like a regular block device. However, one area where it falls short is determining the correct area for FlashIAPBlockDevice to work in. It's a bit silly -- the FlashIAP driver test works by going backward from the end of the flash address space, and the FlashIAP driver seems to rely on manual configuration.
I believe that the best way to do this would be for targets which support FLASH to define a linker script symbol indicating where the used region of flash memory ends. This way, FlashIAPBlockDevice would be able to automatically know where is a safe location to store data.
Mbed provides the incredibly useful FlashIAP class for programming an MCU's built-in flash, and the handy FlashIAPBlockDevice class which allows you to access that flash like a regular block device. However, one area where it falls short is determining the correct area for FlashIAPBlockDevice to work in. It's a bit silly -- the FlashIAP driver test works by going backward from the end of the flash address space, and the FlashIAP driver seems to rely on manual configuration.
I believe that the best way to do this would be for targets which support FLASH to define a linker script symbol indicating where the used region of flash memory ends. This way, FlashIAPBlockDevice would be able to automatically know where is a safe location to store data.