Closed JacksonLv closed 8 years ago
Hi,
There is a bit of friction between pstorage and the Softdevice timeslot system. The pstorage module calls the flash API through the Softdevice, as the Softdevice "owns" that peripheral. The Softdevice can only use the flash API when there is no timeslot running, but unfortunately, the mesh attempts to allocate as much time as possible from the Softdevice. Each time you call the flash API (this happens a lot in pstorage, of course:) ), it has to wait for the current timeslot to finish. This can take up to 10 seconds, and by that time, the Softdevice has freaked out, and your flash-operation fails. This gives you your clear-error in the callback.
To fix this, you should attempt to restart the timeslot after each successful call to an sd_flash_*
function. There are several in pstorage.c, and each call will wait for an available timeslot. To restart the timeslot, call timeslot_restart()
in timeslothandler.h in /nRF51/rbcmesh/include.
ok,thanks,I will try it
Hi there,I am using the 8.1.0 SDK and I want to send data to nrf51 then save them into flash so that it can "Power down save".I test the pstorage library(Update 22.1.2016) here worked fine . So I add mesh function to it ,Here is my code. `int main(void) {
uint32_t err_code;`
// Initialize timers_init(); uart_config(); ble_stack_init(); scheduler_init(); rbc_mesh_init_params_t init_params;
}`
`static void ble_stack_init(void) { uint32_t err_code;
if defined(S110) || defined(S130)
ifdef S130
endif
endif
}`
`static void sys_evt_dispatch(uint32_t sys_evt) {
}`
I test the mesh worked fine but the pstorage get error
pstorage CLEAR ERROR callback received