STM32WB0 Bluetooth® LE – Transparent mode

1. Introduction

The transparent mode or DTM (direct test mode) application is used to:

  • receive commands on UART RX and propagate them to the Bluetooth® Low Energy stack.
  • transmit events from Bluetooth®Low Energy stack on UART TX.

A set of commands/events are sent though the STM32WB0 UART to control the Bluetooth® Low Energy stack via the transparent mode application.

Level shifter, VCP ST-LINK or applicative VCP can be used to manage transmission and reception.

Transparent mode with STM32WB0 Nucleo boards and ST-LINK VCP
Connectivity WB0 TM connection.png

2. Requirements

2.1. Software and Hardware requirements

For software and hardware requirements refer to STM32WB0 Build BLE Project wiki page.

3. Transparent mode example description

3.1. Project directory

The "BLE_TransparentMode" and "BLE_TransparentMode_C_O" applications are available by downloading the STM32CubeWB0 MCU Package[1].

Refer to the How to Build a Bluetooth® LE project wiki page for information on the project directory.

3.2. Project description

3.2.1. Bluetooth® Low Energy host stack

The transparent mode application (BLE_TrasparentMode) uses the Bluetooth® LE Host + Controller Stack library (stm32wb0x_ble_stack.a). It also requires libcrypto.a binary library to work.
This configuration supports all the available ACI and HCI commands, as well as Bluetooth® Low Energy features.
There is also a variant of the transparent mode application (BLE_TrasparentMode_C_O) which uses the Bluetooth® LE Controller Only Stack library (stm32wb0x_ble_stack_controller_only.a).

This configuration supports all the available HCI commands.

For further information on the Bluetooth® Low Energy host stack library and the different Bluetooth® Low Energy stack configurations for STM32WB0 projects, refer to Bluetooth® Low Energy stack v4.x programming guidelines

3.2.2. Software project structure

Find below the software project structure and its main parts:

Transparent mode project structure
BLE_TrasparentMode BLE_TrasparentMode_C_O
Connectivity WB0 TM Archi.png
Connectivity WB0 TM C O Archi.png
Connectivity yellow box.png
Main applicative part files
Connectivity green box.png
Bluetooth® Low Energy libraries
Connectivity pink box.png
Bluetooth® Low Energy stack modular configuration options and event dispatcher files
WARNING: Do not modify the files in the Middlewares folder



3.2.3. Application initialization

Find below the different steps of the application initialization:

Transparent mode project initialization
Connectivity WB0 TM Initialization.png
puce1.png
Initialize the system (HAL, clocks, peripherals).
HAL_Init();
SystemClock_Config();
PeriphCommonClock_Config();
MX_GPIO_Init();
MX_RADIO_Init();
MX_RADIO_TIMER_Init();
MX_PKA_Init();
MX_APPE_Init();
puce2.png
Initialize the RNG, AES block, PKA:
HW_RNG_Init();
HW_AES_Init();
HW_PKA_Init();
APP_BLE_Init(); 
puce3.png
Initialize the Bluetooth® LE Host Stack
BLE_Init(); 
puce4.png
Initialize the transport layer.
transport_layer_init();

3.3. Build and install

Follow the steps described in Bluetooth® LE Build and Install Application page, and apply them to the STM32WB0 BLE_TransparentMode project.

3.4. How to use the Bluetooth® Low Energy transparent mode application

Once the Bluetooth® Low Energy transparent mode application is installed on the STM32WB0 platform, launch the STM32CubeMonitor-RF [2] application on the computer connected to the platform via USB.

3.4.1. STM32CubeMonitor-RF interface

From the STM32CubeMonitor-RF interface, select the COM port of the STM32WB0 Nucleo board, and click the CONNECT button:

STM32CubeMonitor-RF connection with transparent mode
Connectivity WB0 TM CubeMonRF 1.png

Information on the platform and software is available under HCI_READ_LOCAL_VERSION_INFORMATION and ACI_HAL_GET_FIRMWARE_DETAILS:

STM32CubeMonitor-RF device information
Connectivity WB0 TM CubeMonRF 2.png

ACI utilities allows the user to easily launch an advertising or a scan sequence:

STM32CubeMonitor-RF advertising and scan sequences
Connectivity WB0 TM CubeMonRF 3.png
Connectivity WB0 TM CubeMonRF 4.png

3.4.2. Vendor-specific commands

Vendor-specific commands have been developed to read the device information, and read/write registers from the command interface:

  • ACI_HAL_GET_FIRMWARE_DETAILS
Transparent mode vendor-specific commands
Command name HCI packet indicator OCF Description Parameter
ACI_HAL_GET_FIRMWARE_DETAILS 0x01 0xFC01 Return BLE_TransparentMode/DTM version & variant;
Return Bluetooth LE stack version & variant.
N/A


ACI_HAL_GET_FIRMWARE_DETAILS returned values
Connectivity ACI HAL GET FIRMWARE DETAILS.png

4. References