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

does UART is interrupted by BLE SEQUENCE?

Q0. What IRQ Priority does BLE Has? and also what IRQ Priority does UART can have?

I'm guessing that from s130's document P65, Exception Model, It says,
Softdevice Timing Critical has Cortex M0 priority 0,
Application Interrupt priority is 1,
Softdevice API Calls and Deferrable handling has priority 2,
and application interrupts has 3 and lastly Main has other priority.

At this point, ble_evt_dispatch has which priority level? and also, Priority 1 and 3 is Application Interrupts, and that means, I can use 1 and 3 priority by dedicating Interrupts priority to any Peripheral such as UART, TWI or etc.. by setting at <SDK_config.h> file?

Q1. Does ble_evt_dispatch run as an RTOS ? or does it just run as an scheduled process when having a role with Central and Peripheral?
(where can I found this, whether Softdevice Radio is running as RTOS based or not?)

Q2. while processing UART Sequence EVT handler, If BLE EVT occurs, It stops processing UART Sequence and jump over to ble_evt_dispatch? or does it finish it's evt handler sequence and process ble_evt_dispatch?
(This Question is from the thought that Does 'evt_handler` is interrrupted by other sequences?)

Radio's IRQ is higher than almost Everything, so I thought ble_evt_dispatch would not be interrupted by any other sequences. But, UART's IRQ is lower than Radio so UART's EVT Handler might be interrupted by Radio sequence. Is my thought is correct? or not? Does evt handler are totally safe from interrupt?

Q3. If evt sequence is interrupted by other, does interrupted evt sequence is safe from running correctly? How could i know if interrupted sequence will work correctly?

  • Your question is rather confused. However the IRQ number only matters if the IRQs have the same priority. In the case of the softdevice the radio and any softdevice operation has a higher priority than any user code (like UART) and will interrupt whenever it wants. Again that's not to do with the IRQ number, that's to do with the IRQ priority set for that interrupt.

    Interrupts work correctly because they save the full stack state ready for return from interrupt, so it doesn't matter how many times you're interrupted, your code will work correctly, as long as your code isn't realtime and can tolerate interrupts being delayed by ms at a time.

  • oh, I might be confused with IRQ number and IRQ Priority.

    Where can I found RADIO's (or ble_evt_dispatch) IRQ Priority?
    I'm guessing that from s130's document P65, Exception Model, It says,

    Softdevice Timing Critical has Cortex M0 priority 0,
    Application Interrupt priority is 1,
    Softdevice API Calls and Deferrable handling has priority 2,
    and application interrupts has 3 and lastly Main has other priority.

    At this point, ble_evt_dispatch has which priority level?

    and also, Priority 1 and 3 is Application Interrupts, and that means, I can use 1 and 3 priority by dedicating Interrupts priority to any Peripheral such as UART, TWI or etc.. by setting at <SDK_config.h> file?

  • FormerMember
    0 FormerMember in reply to RK

    The application BLE events (ble_evt_dispatch) have priority APP_IRQ_PRIORITY_MID. Other peripherals can use the interrupt levels not used by the softdevice. I would however recommend the other peripherals to use a interrupt priority lower than ble_evt_dispatch, in order to not block any BLE events.

Related