7 years, 4 months ago.

Nucleo FLash IAP

Is there any way of writing to NUCLEO (F091RC) FLash memory? Does anyone know a library for writing to flash? Can I use the FlashIAP from MBED-os (Mbed5)? I have tried that but It seems it is not supported. Am I doing someting wrong? Anyone have an example of using a FLash IAP on nucleo Boards?

There are quite a few NUCLEO devices that support the FlashIAP API but F091RC isn't currently one of them. The STM support is very modular in mbed OS so looking at a similar device may give a clear path forward to adding this support it you wanted to have a go.

posted by Sam Grove 26 Jul 2017

Do you know which ones are supported? Is there a list published?

posted by Bogdan Lazarescu 26 Jul 2017

1 Answer

7 years, 4 months ago.

No problem.
You can easily use the HAL library, which is a mbed library component for all Nucleos. Therefore, you do not need to include any libraries to simply write flash pages from the mbed program.
Actually, you only need these three functions:

HAL_FLASH_Unlock (),
HAL_FLASHEx_Erase (),
HAL_FLASH_Program ()

For a description of these functions, see the STM documentation.

The example (tested) for your Nucleo for using this flash writing method is also here:

https://developer.mbed.org/users/mega64/code/00_eeprom_emulation_f091/
There are also page flash definitions, etc.

Accepted Answer

Thank you very much! Very useful!

posted by Bogdan Lazarescu 27 Jul 2017