Bluetooth Low Energy peripheral connection processor usage

This section describes the processor availability and interrupt processing time for the SoftDevice in a peripheral connection event.

Figure 1. Peripheral connection events (some priority levels left out for clarity)
Peripheral connection events (some priority levels left out for clarity)

In a peripheral connection event, the pattern of SoftDevice processing activity at interrupt priority level 0 is typically as follows:

  1. An interrupt (Radio prepare) sets up and prepares the software and hardware for the connection event.
  2. A short interrupt occurs when the Radio starts listening for the first packet.
  3. When the reception is complete, there is a radio processing interrupt that processes the received packet and switches the Radio to transmission.
  4. When the transmission is complete, there is either a radio processing interrupt that switches the Radio back to reception (and possibly a new transmission after that), or the event ends with post processing.
  5. After the radio and post processing in priority level 0, the SoftDevice processes any received data packets, executes any Generic Attribute Protocol (GATT), Attribute Protocol (ATT), or Security Manager Protocol (SMP) operations, and generates events to the application as required in priority level 4. The interrupt at this priority level is therefore highly variable based on the stack operations executed.

SoftDevice processing activity for different priority levels during peripheral connection events is outlined in Processor usage when connected. The typical case is seen when sending GATT write commands writing 20 bytes. The max case can be seen when sending and receiving maximum length packets while having a maximum number of connections and utilizing the Radio Timeslot API and Flash memory API at the same time.

Table 1. Processor usage when connected
Parameter Description Min Typical Max
tISR(0),RadioPrepare Processing when preparing the radio for a connection event   51 μs 65 μs
tISR(0),RadioStart Processing when starting the connection event   18 μs 24 μs
tISR(0),RadioProcessing Processing after sending or receiving a packet   60 μs 67 μs
tISR(0),PostProcessing Processing at the end of a connection event   90 μs 250 μs
tnISR(0) Distance between interrupts during a connection event 183 μs > 190 μs  
tISR(4) Priority level 4 interrupt after a packet is sent or received   40 μs  

From the table we can calculate a typical processing time for a peripheral connection event where one packet is sent and received to be:

tISR(0),RadioPrepare + tISR(0),RadioStart + tISR(0),RadioProcessing + tISR(0),PostProcessing + 2 * tISR(4) = 299 μs

That means typically more than 99% of the processor time is available to the application when one peripheral link is established and one packet is sent in each direction with a 100 ms connection interval.