Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs

Does the SoftDevice interfere with SPI and I2C ports usage?

Hi all,

We use nRF52840, nRF5 SDK 17.1.0 and SoftDevice S140 7.3.0

I have a couple of questions:

1) I know the SoftDevice gives priority to keeping the BLE connection alive, but we have a CRITICAL functionality that uses the SPI & I2C ports (both interrupt driven). 

  1. Would the SoftDevice restrict the application from freely accessing the SPI & I2C ports? 
  2. Or does the SoftDevice manage (time slice?) things so both BLE and SPI/I2C functionalities run smoothly without restrictions?
  3. Does it matter if we use an RTOS like FreeRTOS (SafeRTOS, really)?

Thanks!

Regards,

Gil

  • Hi,

    Would the SoftDevice restrict the application from freely accessing the SPI & I2C ports? 

    No, the SoftDevice will only restrict/block access to peripherals listed in Hardware peripherals. The limiting factor here will be the availability of the CPU to process interrupts/events from the peripherals. Critical SoftDevice events will always have highest priority, and will run at highest interrupt priority. Both SPIM and TWIM peripherals supports EasyDMA, which allows transfer of data directly to/from RAM, without CPU intervention. This allows full transfers to complete even during SoftDevice/radio operations, but you might not be able to setup a new transfer or handle received data until the radio event is done. It is event possible to use the PPI peripheral to trigger transfer based on other HW events (for instance TIMER or GPIOTE) if you have strict timing requirements for when the transfers needs to start.

    Or does the SoftDevice manage (time slice?) things so both BLE and SPI/I2C functionalities run smoothly without restrictions?

    The SoftDevice provides a Radio Timeslot API that can be used to grant application access to restricted/blocked peripheral during a limited period, by scheduling the timeslot between other BLE operations. This is primarily required for multiprotocol radio applications, but could also be useful for other tasks if you require non-interrupted access resources.

    Does it matter if we use an RTOS like FreeRTOS (SafeRTOS, really)?

    No, the SoftDevice works in interrupt context, at highest priority, so the RTOS would not affect the CPU time available to the application. 

    Best regards,
    Jørgen

Related