about nrf 5 softdevice

Hello, I am currently debugging with nRF52833 and nRF5 SDK, and I have a few questions to ask:

  1. I want to time-share the BLE function and the ESB function on a single MCU to suit different scenarios. Is it possible to switch to ESB mode after the SoftDevice has been enabled? The intended method is: disable the SoftDevice, reconfigure the RADIO and Timer 0, as well as the PPI channels reserved for the protocol stack, and then start ESB. Will the ESB function work correctly under these circumstances?
  2. Building on the first step, is it possible to switch back to BLE mode again? The intended method is: clear the PPI channels and Timer 0 configurations used by ESB, and then re-enable the SoftDevice. In this case, will the SoftDevice reconfigure the peripherals like the timer and PPI? Will BLE be able to function normally again?
  3. If I want to enable service discovery on a peripheral device to check if a service similar to ANCS exists on the connected central device, is it mandatory to use a protocol stack with central capabilities (such as S140 or S132)? Can a peripheral-only protocol stack (like S113) not accomplish this?
  4. Can the S140 SoftDevice be used with the nRF52833? If I want to support BLE 5 features, is using S140 the minimum requirement?
  • Hi,

    First of all, I want to mention that the nRF5 SDK and SoftDevices are old, so I would recommend considering the nRF Connect SDK. There is an unofficial example demonstrating ESB and BLE SDKs and SoftDevices
    here.

    I want to time-share the BLE function and the ESB function on a single MCU to suit different scenarios. Is it possible to switch to ESB mode after the SoftDevice has been enabled? The intended method is: disable the SoftDevice, reconfigure the RADIO and Timer 0, as well as the PPI channels reserved for the protocol stack, and then start ESB. Will the ESB function work correctly under these circumstances?

    Yes, it is possible to disable the SoftDevice and use the reserved peripherals directly, for instance for ESB. (It is also possible to use timeslots, where ESB runs between BLE events. This is more complex though, and also typically gives reduced performance). Using the approach you suggest, you need to make sure you uninitialized the SoftDevice (and any BLE libraries like the SDH), before configuring ESB.

    Building on the first step, is it possible to switch back to BLE mode again? The intended method is: clear the PPI channels and Timer 0 configurations used by ESB, and then re-enable the SoftDevice. In this case, will the SoftDevice reconfigure the peripherals like the timer and PPI? Will BLE be able to function normally again?

    Yes, thi sis possible. But also here, you must make sure to disable ESB and clean up/stop TIMER1, Radio etc before starting the SoftDevice again so that the Bluetooth stack starts at a known state.

    If I want to enable service discovery on a peripheral device to check if a service similar to ANCS exists on the connected central device, is it mandatory to use a protocol stack with central capabilities (such as S140 or S132)? Can a peripheral-only protocol stack (like S113) not accomplish this?

    GATT roles (client/sever) is independent, and there is no problem performing service discovery from a peripheral. (The ANCS example in nRF5 SDK has an example project using S112, which is a peripheral only SoftDevice, though this is not for nRF52833).

    Can the S140 SoftDevice be used with the nRF52833? If I want to support BLE 5 features, is using S140 the minimum requirement?

    Yes. See SDKs and SoftDevices for compatible SoftDevice with nRF52833, which includes S140. Note that S140 is not the minimum for BLE 5. Other SoftDevice are also qualified for BLE5, but various SoCs and SoftDevices support different subsets of the specification. The relevant here is which BLE features you need.

  • Crystal clear now. Thank you for breaking it down!

Related