5 years, 6 months ago.

Flash IAP do not work

Which boards support Flash IAP ?

include the mbed library with this snippet

#include "mbed.h"



DigitalOut  myled(LED1);
FlashIAP flash;

int main() {
    flash.init();
    
    RawSerial  pc(PA_2,PA_3);

    pc.puts ("Hello world!");
  
    
    while(1) {
        myled = !myled;
         pc.putc (flash.get_flash_size());            
        wait_ms(1000);
    }
}

this example do not works with nucleo F411RE

1 Answer

5 years, 6 months ago.

Hello Nik,

  • I'm not sure but think it supports all the mbed enabled boards.
  • Since the get_flash_size() method returns uint32_t, try:

#include "mbed.h"
 
FlashIAP  flash;
 
int main() {
    flash.init();
    
    Serial pc(PA_2,PA_3);
    pc.printf("Hello world!\r\n");
    pc.printf("flash_size = 0x%.8x\r\n", flash.get_flash_size());  
          
    flash.deinit();
}

For additional example have a look also at https://os.mbed.com/questions/82732/EEProm-Emulation-on-STM32L432KC .

Accepted Answer

Thank you very much!

posted by Nik Fedorov 13 Oct 2018