STM32WBA Bluetooth® LE – Transparent mode

1 Introduction

The transparent 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 STM32WBA 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 NUCLEO-WBA52CG board and ST-LINK VCP
Connectivity WBA TM connection.png

2 Requirements

2.1 Software and system requirements

Below the required software as well as the required minimum IDE version:

  • IAR Embedded Workbench for ARM (EWARM) toolchain V9.20.1, plus a patch available in STM32CubeWBA MCU package: STM32Cube_FW_WBA_Vx.x.x/Utilities/PC_Software/EWARMv8_STM32WBAx_V1.2.zip
  • RealView Microcontroller Development Kit (MDK-ARM) toolchain V5.37, plus a patch available in STM32CubeWBA MCU package: STM32Cube_FW_WBA_Vx.x.x/Utilities/PC_Software/Keil.STM32WBAx_DFP.1.0.0.zip
  • STM32CubeIDE toolchain V1.12.0 [1].

The following programmer software is required to flash the board with an already generated binary:

  • STM32CubeProgrammer[2]

The STM32CubeMonitor-RF software is also required to interface with the transparent mode application:

  • STM32CubeMonitor-RF V2.11.0 [3]

2.2 Hardware requirements

The application must be installed on the NUCLEO-WBA52CG [4].

Hardware platform illustration
Nucleo-WBA5


3 Transparent mode example description

3.1 Project directory

The "BLE_TransparentMode" application is available by downloading the STM32CubeWBA MCU Package[5].

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 Software project structure

Below the software project structure with its main parts:

Transparent Mode project structure
Connectivity WBA TM Archi.png
Connectivity yellow box.png
Main applicative part files
Connectivity dark blue box.png
Service management
Connectivity green box.png
BLE libraries
Connectivity pink box.png
Link layer system integration files

WARNING: Do not modify the files in Middlewares folder


3.2.2 Bluetooth® Low Energy host stack

The transparent mode application uses the Full host stack + ST LL controller library (stm32wba_ble_stack_full.a), which requires LinkLayer_BLE_Full_lib.a to work.
Refer to Bluetooth LE Host Stack and Link Layer Libraries compatibilities section.

This configuration supports all the available ACI and HCI commands, as well as Bluetooth® Low Energy features.

More information about the Bluetooth® Low Energy host stack library and the different Bluetooth® Low Energy stack configurations for STM32WBA projects are available in: Middlewares/ST/STM32_WPAN/ble/stack/doc/STM32WBA_BLE_Stack_User_Manual.html.

3.2.3 Application initialization

The different steps of the application initialization are described below:

Transparent mode project initialization
Connectivity WBA TM Initialization.png
puce1.png
  • Initialize the system (HAL, clocks, peripherals)
  • Infinite loop for run mode
puce2.png
  • Initialize the BSP, power mode, trace, memory manager, NVM
  • Wait until the initialization is complete
puce3.png
  • Initialize the Bluetooth® LE host stack
puce4.png
  • Initialize the UART to receive commands and transmit events

3.3 Build and install

Follow the steps described in Bluetooth® LE Build and Install Application page, and apply them to the STM32WBA 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 STM32WBA platform, launch the STM32CubeMonitor-RF [3] 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 NUCLEO-WBA52CG board, and click the CONNECT button:

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

Information on the platform and software can be found under VS_HCI_C1_DEVICE_INFORMATION:

STM32CubeMonitor-RF device information
Connectivity WBA 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 WBA TM CubeMonRF 3.png
Connectivity WBA 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:

  • VS_HCI_C1_DEVICE_INFORMATION
  • VS_HCI_C1_WRITE_REGISTER
  • VS_HCI_C1_READ_REGISTER
Transparent mode vendor-specific commands
Command name HCI packet indicator OCF Description Parameter
VS_HCI_C1_WRITE_REGISTER 0x20 0x160 Request core to write a register
(Atomic write)
1byte [0]: Bus size access
- 1 : 8bits
- 2 : 16bits
- 4 : 32bits
4bytes [1:4]: Mask
4byte [5:8]: Address
4byte [9:12]: Value
VS_HCI_C1_READ_REGISTER 0x20 0x161 Request core to read a register
(Atomic read)
1byte [0]: Bus size access
- 1 : 8bits
- 2 : 16bits
- 4 : 32bits
4bytes [1:4]: Address
VS_HCI_C1_DEVICE_INFORMATION 0x20 0x162 Return device information N/A

4 References