Question 1 :
I write 512 words to flash but only can get some value right .and some value was wrong.
I used fs_store( &one_min_data,
(uint32_t *)(FLASH_DATA_ADRR),
(uint32_t *)(&buffer),
512,
NULL);
The value should be 0 -511 .but the value in the flash is not like that .
By the way my sdk is 12.3.And with ble app uart demo.
What I have done and init light this
err_code = softdevice_sys_evt_handler_set(sys_evt_dispatch);//添加系统事件派发
APP_ERROR_CHECK(err_code);
void sys_evt_dispatch(uint32_t sys_evt)
{
//这函数在fstorage.c中实现
ble_advertising_on_sys_evt(sys_evt);
fs_sys_event_handler(sys_evt);
}
FS_REGISTER_CFG(fs_config_t one_min_data) =
{
.callback = one_min_data_flash_ok_event,// Function for event callbacks.
.num_pages = 6, // Number of physical flash pages required.
.priority = 0xFE // Priority for flash usage.
};
void one_min_data_flash_ok_event(fs_evt_t const * const evt, fs_ret_t result)
{
if(evt->id==FS_EVT_STORE && result==FS_SUCCESS)
MI_LOG_INFO("one_min_data_flash_ok_event\r\n");
}
Question 2 :
I have tried another way I write three times Continuously. Also use fs_store()
But the second time always get 00000000.
1st value 0x55555555 address :122*4096 ok
2nd value whatever address :121*4096 wrong get 0x00000000
3rd value 0x5a5a5a5a address:120*4096 ok
And I found that no matter which one is the second to write it always wrong .