I'm working on a NRF52832 project with SDK V15.2, using S132 Softdevice. before connecting, nrf_fstorage_write/nrf_fstorage_erase/sd_flash_write/sd_flash_page_erase all are work perfectly. But once connected with a device, all the operations to flash can't work. it'll stuck in wait_for_flash_ready, return of nrf_fstorage_write & nrf_fstorage_erase are NRF_SUCCESS. If I call nrf_sdh_disable_request() before nrf_fstorage_write & nrf_fstorage_erase, the operations can be done correctly. Never goes into fstorage_evt_handler() after connected to a device.
Please help me figure out this issue, thanks in advanced.
What connection parameters are using in the BLE link? As you can see from Flash API timing in the SoftDevice specification:
Flash timing-activity may not get a timing-event at all if other timing-events occupy most of the time and use priority higher than flash timing-activity.
If this is the problem, which seems likely, then it could be fixed by for instance using longer connection intervals.
I used below parameters, let me try to use a longer interval and then get back to you.
#define MIN_CONN_INTERVAL MSEC_TO_UNITS(20, UNIT_1_25_MS) #define MAX_CONN_INTERVAL MSEC_TO_UNITS(75, UNIT_1_25_MS)