1. STM32WBA Bluetooth® Low Energy Long Range feature
The Long Range or Low Energy Coded PHY feature extends the Bluetooth® Low Energy to a range of 1,6 km or more.
By using the advertising extension feature, the Bluetooth® Low Energy coded advertising Primary (and secondary) PHY becomes active as Bluetooth® Low Energy coded.
The HCI and ACI commands define new parameter values.
Based on the BLE_p2pClient_Ext and BLE_p2pServer_Ext applications, two new applications have been developed to demonstrate the feature and to provide range measurements: BLE_App_Long_Range_Central and BLE_App_Long_Range_Peripheral[1].
Application functionalities are derived from the BLE_p2pClient and BLE_p2pServer applications:
Refer to the following page for the Peer to Peer project explanation.
1.1. Principles
The advertising extension feature is required.
Modified or new GAP commands have been implemented to enable the Bluetooth® Low Energy coded feature.
- To set the advertising parameters:
aci_gap_adv_set_configuration: Adv_Mode parameter is equal to 0x02 (use Bluetooth® Low Energy coded as primary advertising PHY)
Expandaci_gap_adv_set_configuration |
---|
- To set the scan procedure:
aci_gap_ext_start_scan: scanning_PHY parameter is equal to 0x04 (use of Bluetooth® Low Energy coded as scan PHY)
Expandaci_gap_ext_start_scan |
---|
- To set the connection:
aci_gap_ext_create_connection: initiating PHYs parameter is equal to 0x04 (use of LE coded as scan connectable PHY)
Expandaci_gap_ext_create_connection |
---|
1.2. Advertising data
At startup, Peer To Peer Server Long Range application starts advertising.
Data advertised are composed as follows:
P2P Server Long Range advertising packet | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Manufacturer data are encoded following STMicroelectronics BlueST SDK v2 as described below:
STMicroelectronics manufacturer advertising data | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
1.3. On-board buttons configuration
Button configuration for Bluetooth® Low Energy Long Range application on Nucleo-WBA55CG boards | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
1.4. STM32WBA Long Range central and peripheral application
Long Range central acts as a central device with the support of the GATT Client Layer.
At startup, by pressing the B1 button, the Long Range client application:
- Starts scanning to detect Long Range server application by filtering the firmware ID of the STMicroelectronics manufacturer advertising data.
- Stops Scanning once Long Range server detected.
- Connects to the Long Range server to establish the connection.
- Discovers the Long Range server GATT Service & Characteristics.
- Enables all GATT server notification characteristics.
Once connected, the Long Range client application:
- By pressing B1 button, writes a message to toggle the Blue LED of the Long Range server.
- Receives a notification to toggle the on board Blue LED from the remote Long Range server Application.
Long Range peripheral acts as a peripheral device with the support of the GATT Client Layer.
At reset, the Long Range peripheral application starts one extended advertising set at primary and secondary LE coded PHY.
Once connected, on both applications:
- By pressing the B2 button, the HCI_LE_SET_PHY command is sent. It allows to toggle Phy_options parameter S=8/2 (red led is ON/OFF).
- Payload can be coded using two different rates: 125 kb/s (S = 2), or 500 kb/s (S = 8)
Refer to Bluetooth®Programming Manual PM0271 [2]. See chapter 5.7 STM32WBA LE Coded PHY.
1.5. Collector applications compatibility
The BLE_App_Long_Range_Peripheral project is compatible with the following collector:
BLE_App_Long_Range_Central or a smartphone supporting the Bluetooth® Low Energy coded feature.
1.6. Code example
A STM32WBA Long Range code example has been shared on the STM32-Hotspot GitHub [1].
2. References