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

Interrupt priority

Hi,

While the softdevice is active (nRF51822) available interrupt priorities are:

typedef enum { NRF_APP_PRIORITY_HIGH = 1, NRF_APP_PRIORITY_LOW = 3 } nrf_app_irq_priority_t;

  1. Can I use interrupt priority = 2?
  2. SVC priority is 2, is it true? So I could't use Softdevice api-functions in interrupt handlers with NRF_APP_PRIORITY_HIGH priority?
  3. What does define "#define NRF_APP_PRIORITY_THREAD 4" in app_util.h mean?

Artem Z. Best Regards

Parents
  • Hi Artem,

    to answer your questions

    • 1. Can I use interrupt priority = 2? No, not while the SoftDevice is active. If you try to set this priority level using sd_nvic_SetPriority() you will get an error.
    • 2. SVC priority is 2, is it true? So I could't use Softdevice api-functions in interrupt handlers with NRF_APP_PRIORITY_HIGH priority? Correct. You would need to pass execution to a lower priority level, for example by using a software interrupt (SWIRQ) with NRF_APP_PRIORITY_LOW.
    • 3. What does define "#define NRF_APP_PRIORITY_THREAD 4" in app_util.h mean? It's used in "current_int_priority_get()" to indicate if the CPU is running in thread mode (main context), as opposed to running in interrupt mode with interrupt priority 0-3.
  • "My question is in what handler (SWI2, Radio or somewhere else) really attribute will be written in GATT table?"

    The SoftDevice operates on GATT table at the same priority as the SVC API, hence access to GATT table is context-safe.

Reply Children
No Data
Related