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

fs_erase couldn't erase flash on S140

Hi,

I'm using nRF5_SDK_13.0.0_04a0bfd on nRF52840.Basing on the ble_app_multilink_central example, I want to write some data to flash to save. So I use the fstorage. After calling the fs_init function, I erase the page which I want to write data to, but it wouldn't generate the FS_EVT_ERASE event. So the code would stop here and wouldn't run at all. fs_erase returns 0 and I have register the system event in the ble_stack_init function

static void sys_evt_dispatch(uint32_t sys_evt){
fs_sys_event_handler(sys_evt);
on_sys_evt(sys_evt);}

The fstorage setting as the attachment. Could you help me have a look? Thanks.

image description

erase_code.txt

Parents Reply
  • I have tried to remove power_manage() call before, but it still couldn't write data to flash. But now the code wouldn't stop at fs_erase function, I didn't remove power_manage() call . When I erase and write data to the flash, it could generate FS_EVT_ERASE and FS_EVT_STORE in the fs_evt_handler callback and no error return, but when I read data back, it all is 0xFF.

Children
No Data
Related