I have a problom about using nrf_fstorage_erase won't call nrf_fstorage_sys_evt_handler.
The project is on nrf52832 and using SDK 15.3, Softdevice s132 6.1.1.
When I use nrf_fstorage_nvmc to be backend, everything is fine, but change backend to nrf_fstorage_sd, the erase seem like only finish 1page and never entery
nrf_fstorage_sys_evt_handler to trigger NRF_EVT_FLASH_OPERATION_SUCCESS or NRF_EVT_FLASH_OPERATION_ERROR.
I'm sure I include all file needed to be include, include nrf_sdh_soc.h and I also enable the softdevice by using nrf_sdh_enable_request.
The function which I used to erase flash is down below.
void MemoryOperation_Erase1(void)
{
ret_code_t err_code;
err_code = nrf_fstorage_erase(&m_fs, 0x71000, 2, NULL);
if(err_code != NRF_SUCCESS)
{
NRF_LOG_ERROR("MemoryOperation_Erase1 Error : %d", err_code);
}
wait_for_flash_ready();
}
void MemoryOperation__Erase2(void)
{
ret_code_t err_code;
err_code = nrf_fstorage_erase(&m_fs, 0x73000, 11, NULL);
if(err_code != NRF_SUCCESS)
{
NRF_LOG_ERROR("MemoryOperation__Erase2 Error : %d", err_code);
}
wait_for_flash_ready();
}
void wait_for_flash_ready(void)
{
/* While fstorage is busy, sleep and wait for an event. */
while (nrf_fstorage_is_busy(&m_fs))
{
sd_app_evt_wait();
}
}
I also find a subject similar my problem : https://devzone.nordicsemi.com/f/nordic-q-a/63808/missing-softdevice-call-to-nrf_fstorage_sys_evt_handler
But I can't understand how to fix it.
Did I miss something to check?
if anyone know how to find the problem will be appreciated.
Many Thanks,
Marcus