This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

SDK12.3 use fs_erase and fs_store

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;
    	}
    }
Parents Reply
  • I am sure,

        err_code = softdevice_sys_evt_handler_set(sys_evt_dispatch);
    APP_ERROR_CHECK(err_code);
    
    static void sys_evt_dispatch(uint32_t sys_evt)
    {
    	fs_sys_event_handler(sys_evt);
    	ble_advertising_on_sys_evt(sys_evt);
    }
    
Children
No Data