2 years, 8 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 ?

/media/uploads/i_am_kitsune/result.jpg

1 Answer

2 years, 8 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.

Accepted Answer

Thank you :) Erik Olieman

posted by PARK JAICHANG 18 Jan 2018