Softdevice Interrupt Priority 4

Somewhat related to this:

 SoftDevice S113 interrupt priority levels: 0, 1 and 4 or 6?

I'm wishing to optimise code (removing a load of volatiles) by ensuring most of my application code runs at the same interrupt as the NRF_SDH_BLE_OBSERVER hander.

The documentation (https://docs.nordicsemi.com/bundle/sds_s112/page/SDS/s1xx/processor_avail_interrupt_latency/exception_mgmt_sd.html) indicates the handler runs at priority 4 but the thread above suggests it is 6 by default.

When I set my application interrupts at level 5 everything works normally. When I set it to 4 there's a watchdog reset. It suggests the softdevice API's are not available at priority 4 which appears to be at odds with the documentation which says priorities above (so lower numbers) won't have access.

I suppose if the thread above is correct I just set my int priorities to 6 and I get to where I need to be, but it would be good to understand it.

Cheers, Andrew



  • I can see the event is using SWI2 so that aspect is clear. 6 is the default, make mine 6 and good to go.

    So this statement: "Handlers running at a priority level higher than 4 (lower numerical priority value) have neither access to SoftDevice functions nor to application specific SVCs or RTOS functions running at lower priority levels (higher numerical priority values)."

    Appears incorrect in that it should be "higher than or equal to 4", unless my code is causing such delays that these "non time critical functions" do have some timing requirements after all.

  • Hi!

    The SD API function calls run at priority 4, so you cannot use that for your application.

    snoopy20 said:
    Appears incorrect in that it should be "higher than or equal to 4", unless my code is causing such delays that these "non time critical functions" do have some timing requirements after all.

    It's written that, "application can use the remaining interrupt priority levels", so handlers cannot run at level 4. So "higher than or equal to 4" would be wrong, since 4 is not a valid option. 

  • I missed that! They cnl leave that in but should still change the text:

    "Handlers running at a priority level higher than 4 (lower numerical priority value) have neither access to SoftDevice functions nor to application "

    to be "higher or equal to" ... :)





Related