EFM32 flash_api.c

18 Jan 2018

I recently used or try to use the FLASH IAP on a EFM32 Pearl Gecko (EFM32PG12_STK3402) and found a "bug" in the flash_api.c. The flash_init() function should be changed from:

flash_api.c init actual

int32_t flash_init(flash_t *obj)
{
    (void)obj;
    return 0;
}

to

flash_api.c init should be

int32_t flash_init(flash_t *obj)
{
    (void)obj;
    MSC_Init();
    return 0;
}

and flash_free() function from:

flash_api.c deinit actual

int32_t flash_free(flash_t *obj)
{
    (void)obj;
    return 0;
}

to

flash_api.c deinit should be

int32_t flash_free(flash_t *obj)
{
    (void)obj;
    return 0;
}

With this changes you can use in your program the FLASH IAP without using the direct EFM32 Flash HAL init & deinit functions and the program portability should increase.

18 Jan 2018

Hi DBS 06,

can you send a patch via github pull request with the proposal? https://github.com/ARMmbed/mbed-os/pulls

23 Jan 2018

Of course! I would be happy to give something back to the community! :-)