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

S210 no store or update callbacks from pstorage

I'm following the SDK 8.1 example from here with S210 v4 but I never seem to get a PSTORAGE_STORE_OP_CODE or PSTORAGE_UPDATE_OP_CODE.

I do however get the PSTORAGE_LOAD_OP_CODE with result == 0 when reading from a registered block. Does this have anything to do with not using the scheduler? That seems to be the only major difference. I don't have any active ANT+ scans when I'm writing to the flash either.

  • Hi, the ant example doesn't pass the SOC events to the pstorage_sys_event_handler() which could explain why you're not receiving the callback.

    You can poll the events in the main loop like this:

            err_code = sd_evt_get(&sys_evt);
            if(err_code == NRF_SUCCESS)
            {
                pstorage_sys_event_handler(sys_evt);
            }
    

    Or use the softdevice_handler.c and set softdevice_sys_evt_handler_set(sys_dispatch); to create a system event callback where you can place pstorage_sys_event_handler(sys_evt);. See ANT examples in SDK 10.0.0 for reference on how to implement it.

Related