zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.77k stars 6.57k forks source link

Concurrent Multi-Protocol Support NRF52840 #18896

Closed thomasthep closed 3 years ago

thomasthep commented 5 years ago

Zephyr should support multi-protocol handling on NRF52840 chipsets. This would allow the use of Bluetooth LE/5 and IEEE802.15.4 PHY radios simultaneously, possibly also others such as 2.4GHz proprietary and ANT.

This would allow communication with multiple devices enabling easier configuration and possibly also provide a backup network.

Scenarios include but are not limited to:

NordicSemiconductors' SoftDevice within the SDK 3.1.0 supports concurrent multiprotocol. https://www.nordicsemi.com/Software-and-Tools/Software/nRF5-SDK-for-Thread-and-Zigbee

There's more documentation on how this works. nRF 802.15.4 Radio Driver Wiki - Multiprotocol Support Nordic Infocenter - SDK - Multiprotocol support with BLE/Bluetooth Nordic Infocenter - nRF52 - SoftDevice Radio Session Manager nRF 802.15.4 Radio Driver - Radio Scheduler

After some digging, I found that the Zephyr Bluetooth driver for Nrf uses the radio directly via the hal abstractions. Zephyr Bluetooth Controller

Nordic's SoftDevice includes a Radio Event Manager (REM) which provides a Timeslot API. This is then used within the SoftDevice implementation of the Radio Arbiter Abstraction Layer (RAAL) which allows the software to request radio time slots.

Concluding from the given information, I guess the bluetooth driver will have to be abstracted, a REM implemented (possibly with a custom Timeslot API) to allow concurrent multi-protocol to be used within Zephyr on the NRF52840.

Any additions, clarifications, alternative solutions and possibly even pull requests are welcome.

Initially filed a bug ticket https://github.com/zephyrproject-rtos/zephyr/issues/18865

aescolar commented 5 years ago

CC @carlescufi

teburd commented 5 years ago

Being able to use thread and ble or ant and ble at the same time would be really interesting for me as well for some future product ideas I have

thomasthep commented 5 years ago

@bfrog I'm working on a small proof of concept. As soon as I get anywhere near some usability, I'll create a branch.

I've been busy with work lately and work on this when I get some free time on my hands.

carlescufi commented 4 years ago

@thomasthep on the Nordic side there are no plans to support this in the near future.

thomasthep commented 4 years ago

A shame but guess there aren't so many use cases out there requiring both anyways. If there are, you could always add another SoC.

I myself have been messing around with implementing a scheduler as described in the SDK. It would require a whole lot work to change the driver layer and possibly major changes in the architecture.

The hacked up version of mine works to some degree, but timing as well as race conditions are a pain.

Let's see what the future beholds.

farhangj commented 3 years ago

Any movement on this ticket? it would be really helpful for my use-case to have Thread+BLE and a FEM support.

carlescufi commented 3 years ago

Nordic has multiprotocol and FEM support in nRF Connect SDK, which is based on Zephyr. Take a look at that.

farhangj commented 3 years ago

@carlescufi which version? 1.4.2 or 1.5.0? I don't see it in the release notes or any commits specifying FEM with Multiprotocol support. I'd be interested to see the actual commit for this feature. Thanks!

carlescufi commented 3 years ago

@carlescufi which version? 1.4.2 or 1.5.0? I don't see it in the release notes or any commits specifying FEM with Multiprotocol support. I'd be interested to see the actual commit for this feature. Thanks!

Sorry, I should've been more specific. It's in 1.5.0, which will be released in the next few days.

markus-becker-tridonic-com commented 3 years ago

@carlescufi i believe this issue can be closed now.