I am looking for a comparison of the Zephyr vs SoftDevice for BLE applications. There is a lot of talk on the internet about it, but nothing concrete. Has anyone used both stacks on the same SOC for the same app and can talk about the differences?
I am not sure if you mean the differnce between Zephyr and nRF Connect SDK (i.e. network core) or if you mean Zephyr vs Nordic SDK (i.e. Writing applications in Zephyr RTOS vs normal C applications) but I'll try to cover all scenarios. I've been using nordic devices for over a decade now and this is my input regarding the difference:-
Nordic SDK with SoftDevice
This is Nordic Semiconductor's proprietary software development kit (SDK) that includes a SoftDevice (a pre-compiled binary that implements the Bluetooth Low Energy stack) and a set of libraries for programming the nRF devices. The Nordic SDK with SoftDevice provides a high-level, easy-to-use API for Bluetooth development on the a variety of nordic devices including the nRF51 and nRF52. It also includes additional features, such as power management, security, and device management. The SDK + SoftDevice is what Nordic first released with their chips all the way back when they started BLE development. You can find out more about Nordic's SDK and softdevice in this very comprehensive guide by Nordic.
Pure Zephyr RTOS
Zephyr is an open-source RTOS that supports a wide range of hardware platforms (including Nordic's nRF devices). It is based on a small kernel that is designed for embedded systems. The beauty of the Zephyr OS is that it is open source and also includes all the modern-day RTOS functionalities such as multi-threading, interrupt servicing, memory allocation and more. Furthermore it has numerous libraries and applications for many embedded chips and external hardware (full list of supported HW can be found here). You can find out more in Zephyr's documentation here.
Some nordic devices such as the nRF51 and nRF52 now allow you to write applications in either Zephyr RTOS or using the previously mentioned SDK+softdevice. However, active development on the SDK+softdevice has stopped and Nordic have fully migrated to using Zephyr RTOS + nRF Connect SDK (the final option below).
When using Zephyr with nRF devices, you have one of two options: 1) Softdevice Controller, and 2) Zephyr BLE controller. Option (1) will be described in the section below. Option (2) is a full open source BLE controller which includes both the upper and lower implementation to make it possible to support multiple HW platforms. In other words, one of the main advantages of using this option is that you can switch from an nordic device to another BLE device with minimal changes to your application. You can find more about this here.
nRF Connect SDK based on Zephyr and using Nordic's SoftDevice
Finally, the nRF Connect SDK is a software development kit based on the open-source Zephyr RTOS (described above), but with some additions from Nordic. These additions include more documentation, libraries (e.g. Firmware Over the Air Upgrade - FOTA, and CryptoCell libraries), and generally more support from Nordic. This SDK also includes Nordic's own softdevice, which is tried and tested and qualified via Nordic. You can find more about nordic's nRF Connect SDK here.
To conclude, if I had to give a final recommendation, I would say go for nRF Connect SDK (especially if you are sure that you will use nRF for the lifetime of your product) - as this way you'll end up getting all of the advantages of using the Zephyr RTOS plus the advantages of having Nordic's reliable software and libraries. On the other hand if your goal is to have your application fully open sourced or if you think you might migrate to another HW platform in the future, "pure" Zephyr RTOS is the better option. The old Nordic SDK + softdevice isn't a consideration given that it is now outdated and support for it has effectively stopped.
Some other useful links:-
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With