1. Introduction
STM32WB SOC is a Dual-core, multi-protocol wireless microcontroller. STM32WB55 microcontrollers support Bluetooth™ 5 and IEEE 802.15.4 wireless standards. In the internal architecture, BLE and 802.15.4 protocols shares the same radio IP. At a specific moment, the radio IP is configured in either 802.15.4 mode or BLE mode, but not both simultaneously.
Radio Peripheral |
---|
2. Dynamic mode use case
A typical use case is an on/off switch Light to control the lighting in a room or a group of rooms. The mobile app would likely use BLE to communicate with the central hub or controller, while the LED light would use Zigbee to communicate with the hub or controller.
This use case requires a dynamic mode, with the ability to control its Zigbee network through a BLE connection and thus require a device able to handle both protocols at a time, using a Radio time sharing scheme.
Dynamic Mode Use Case |
---|
3. Concurrency Architecture
3.1. RTSM Description
The Radio Time Sharing Manager (RTSM) implementation enables radio switching between BLE and 802.15.4, which allows the BLE and Zigbee stacks to operate in parallel on the same radio.
- On Zigbee side, the RTSM is integrated at SimpleMAC level that interfaces between the MAC layer and the 802.15.4/ radio LLD.
- On BLE side, the RTSM is integrated between the link layer and the radio LLD.
RTSM Block Diagram |
---|
For more information, please see the Getting started with Dynamic-concurrent mode[1]
3.2. BLE and Zigbee Stack Behavior
Despite the radio switching between BLE and Zigbee, both stacks are not aware of the switching mechanism and operate under the assumption that the radio is exclusively dedicated to their respective stacks.
Due to its tighter time constraints, BLE requires higher priority on radio access compared to 802.15.4 based protocols such as Zigbee.
3.2.1. BLE Stack
On BLE side, the Connection Event must be scheduled exactly at the expected Connection Interval (CI) . The RTSM takes care of this precise timing.
- Connection Interval: time between 2 Connection Events (from 7,5 ms to 4 s).
- Connection Events: consecutive Rx/Tx switch between master and slave in a Connection Interval.
- Radio Idle slot: assigned by RTSM to 802.15.4 allowing Zigbee operation.
BLE connection events and connection intervals |
---|
3.2.2. Zigbee Stack
On Zigbee side, Tx and Rx occur at any time depending on the local and remote Zigbee device needs.
- For Zigbee/MAC Tx requests:
- If the radio is granted to the 802.15.4, it transmit as usual.
- If the radio is granted to BLE, all radio commands (including Tx) are stored in the cmd_pipe.
- When the radio is back to 802.15.4, all pending commands (including Tx) are sent.
- For Zigbee/MAC Rx events:
- All Rx events are managed under Rx interrupt. Such an interrupt is disabled while radio is in BLE mode. Thanks to the CSMA/CA retry mechanism (up to 3 retries), these Rx events are rescheduled few milliseconds later.
- Internal investigations have shown that the max time without radio (assigned to BLE) must be less than 16 ms to prevent packet loss.
Zigbee Rx/Tx Behavior |
---|
4. STM32WB Dynamic Application Design
In the STM32CubeWB MCU Package[2], several dynamic mode applications are available:
- BLE/Zigbee dynamic application
- BLE/Zigbee dynamic SED application
- BLE/Zigbee dynamic BLE throughput application
- BLE/Zigbee dynamic NVM application
In this wiki page, we will focus on BLE/Zigbee dynamic application.
4.1. BLE/Zigbee Dynamic firmware supported
The Dynamic mode firmware includes both BLE and Zigbee stacks:
- The BLE stack is BLE 5.0 certified.
- Two flavors of the Zigbee® stacks are supported on the STM32WB Series device, FFD (Full Feature Device) and RFD (Reduced Feature Device). These stacks are Zigbee PRO 2017 (revision 22) certified and are detailed in the table below.
Stacks supported | Firmware associated |
---|---|
Zigbee FFD + Bluetooth Low Energy 5.0 | stm32wb5x_BLE_ZigBee_FFD_dynamic_fw.bin |
Zigbee RFD + Bluetooth Low Energy 5.0 | stm32wb5x_BLE_ZigBee_RFD_dynamic_fw.bin |
4.2. BLE/Zigbee dynamic application framework
All projects are built using the same framework. the main App features are defined under:
Projects/Board_X/Applications/BLE_ZigBee/BLE_ZigBee_Dyn/STM32_WPAN/App
BLE/Zigbee Dynamic Application |
---|
4.3. BLE/Zigbee Dynamic Application
This application illustrates the simultaneous BLE and Zigbee connections on the same device, with a BLE P2P app execution and a Zigbee toggle On/Off application running simultaneously on the same device.
This application requests having the STM32WB5x_BLE_Zigbee_FFD_dynamic_fw.bin binary flashed on the M0 Wireless Coprocessor.
Minimum requirements for the demo:
- 1 STM32WB55xx-Nucleo board in BLE Zigbee Dynamic Concurrent mode
- 1 STM32WB55xx-Nucleo board or more for creating Zigbee Network (refer to the Readme of the example Zigbee_OnOff_Server_Coord and Zigbee_OnOff_Client_Router for more details on how to use it)
- 1 STM32WB55xx-Nucleo board running a BLE_p2pClient application
OR
- 1 Smartphone (Android/IOS) with "ST BLE Sensor" Phone Application (available on App Store and Google Play)
Install the "ST BLE Sensor" application on the android/ [1] device.
BLE-Zigbee Dynamic Mode Application Demo |
---|
Start the Dynamic mode application. Zigbee radio is running on channel 13.
5. Acronyms and definitions
Term | Definition |
---|---|
GATT | Generic Attribute Profile |
P2P | Peer to Peer |
6. References
[[Category:Zigbee-BLE_concurrent_mode|20]]