I am using SDK12.3 and the Flash Storage module to store some data in Flash. I frequently need to update some of these data basing on received commands.
When I use "fs_erase", it has been cycling at "power_manage ();"
fs_callback_flag = 1;
ret = fs_erase(&fs_config, fs_config.p_start_addr, NUM_PAGES, NULL);
if (ret != FS_SUCCESS)
{
bsp_indication_set(BSP_INDICATE_FATAL_ERROR);
}
while(fs_callback_flag == 1)
{
power_manage();
}
static void fs_evt_handler(fs_evt_t const * const evt, fs_ret_t result)
{
if (result != FS_SUCCESS)
{
bsp_indication_set(BSP_INDICATE_USER_STATE_1);
}
else
{
NRF_LOG_INFO("fstorage command successfully completed\n\r");
fs_callback_flag = 0;
}
}