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

NRF_SDH_DISPATCH_MODEL_APPSH and sync access to flash results.

We are using NRF_SDH_DISPATCH_MODEL_APPSH, and are generally very happy with it (especially for BLE events). However, I'm trying to retrofit error handling around complex code that uses iflash_erase_page, iflash_write without ever checking the results (normally delivered via sys events), and which expects flash to be synchronous (our wrapper functions sleep long enough for operations to complete, and just assumes they worked).

Given that we use NRF_SDH_DISPATCH_MODEL_APPSH, is there any way to poll for the system events that deliver flash results in a busy loop? Or to get the flash operation results in an IRQ context that could be used to release a spin lock?

If I could have BLE events delivered via the APPSH model, and system events delivered via the INTERRUPT model, this would be straight forward for me.

Parents Reply Children
  • Hi,

    You could make a split between BLE events and SoC events since this has different queues in the SoftDevice. So you could use separate approaches for sd_evt_get() and sd_ble_evt_get(). But this is the only way. There is no other way to selectively pick events from the SoftDevice.

    I do not immediately see how this can be most easily done, but it is definitely possible. Either by modifying the SDH, or by writing something new.

Related