Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
6 years, 10 months ago.
flashIAP Question!!
Hello :) Recently, I'm Happy to using MBED Compiler. Nowadays, I develop some program with Hexiwear (Core MCU : ARM CORTEX M4)
I'd like to save some init data in MK64 internal Flash Memory. So, I found FlashIAP that is save internal flash memory and used this API.
1. What is mean the Return value of get_sector_size() Method? Bit or Byte?
2. I was read 1 Sector Size Memory Value. Why the Value is not 0x00 or 0xff ? Is this value program code ?
1 Answer
6 years, 10 months ago.
See the documentation, which apparently is still not properly formatted: https://docs.mbed.com/docs/mbed-os-api-reference/en/latest/APIs/storage/flashiap/
So the size is in bytes. And purely based on the values I guess you read the first page? The flash memory also contains your program code indeed, so if you erase that everything stops working ;). Easiest way is to use the last sector(s) for your storage needs. If your program uses close to all flash memory you still need to watch out though.