This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Waking the nRF51 / 52 from SD_APP_EVT_WAIT

We have an ISR parsing incoming serial data from the UART. When a valid packet arrives, I'd like to be able to wake the core from whatever low-power state is entered when the sd_app_evt_wait() function is called within the main loop.

Is there an SOC event or app event that can be manually triggered through the API to wake the core and start processing? Can custom events be added that wake the core and cause custom handlers to be executed?

Parents
  • You don't have to do anything. The interrupt request will automatically wake the processor so that your interrupt handler can run. And, regarding can custom events be added... Yes, essentially anything that generates an interrupt (timers, gpio, comms, etc.) will wake the processor so that they will be serviced. The only caveat is that your interrupts will wait to be serviced until the SD is done handling TX or RX activity.

    See here: developer.nordicsemi.com/.../a01075.html

  • Of course the ISR runs. But when it exits, does execution begin immediately after sd_app_evt_wait(), or does the processor go back to sleep and wait for an app or SOC event to continue operation?

    Regarding events, I found the app_scheduler in the SDK, and it should do nicely. We just want to make sure that the main loop continues operation right away after the ISR returns, even if the core was sleeping due to a call to sd_app_evt_wait().

Reply
  • Of course the ISR runs. But when it exits, does execution begin immediately after sd_app_evt_wait(), or does the processor go back to sleep and wait for an app or SOC event to continue operation?

    Regarding events, I found the app_scheduler in the SDK, and it should do nicely. We just want to make sure that the main loop continues operation right away after the ISR returns, even if the core was sleeping due to a call to sd_app_evt_wait().

Children
No Data
Related