STM32WBA Bluetooth® LE – Transparent Mode

Revision as of 15:30, 22 February 2023 by Registered User (→‎Software and system requirements)

1. Introduction

Transparent Mode application is used to:

  • Receive commands on UART RX and propagate it to the BLE Stack.
  • Transmit events from BLA stack on UART TX.

A set of commands/events has to go through the STM32WBA UART to control BLE stack via Transparent mode application.

Level shifter, VCP ST-LINK or applicative VCP can be used to manage the TX and RX.

Transparent mode with P-NUCLEO-WBA5 board and ST-LINK VCP
Connectivity WBA TM connection.png

2. Requirements

2.1. Software and system requirements

The software required are the following (minimum IDEs version):

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

Programmer:

  • STM32CubeProgrammer[2] : To flash the board with an already generated binary

To interface with Transparent Mode Application, STM32CubeMonitor-RF software is also required:

  • STM32CubeMonitor-RF V2.11.0 [3]

2.2. Hardware requirements

NUCLEO-WBA5 [4] is necessary to install the application.

Hardware platform illustration
Nucleo-WBA5



3. Transparent Mode example description

3.1. Project directory

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

Heart Rate project directory
Connectivity WBA TM dir.png

3.2. Project description

3.2.1. Structure

Software project structure with the most important parts:

Heart Rate project structure
Connectivity WBA TM Archi.png
Connectivity yellow box.png
Main applicative part files
Connectivity dark blue box.png
Services 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. Application initialization

The different steps of the application initialization are described below:

Heart Rate 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 for initialization done
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, applying them for STM32WBA BLE_TransparentMode project.

3.4. How to use

Once the BLE Transparent Mode application is installed on the STM32WBA platform, launch STM32CubeMonitor-RF [3] application on the computer connected to the WBA platform via USB.

3.4.1. STM32CubeMonitor-RF interface

On STM32CubeMonitor-RF interface, select the COM port of the WBA nucleo platform and click on CONNECT button:

STM32CubeMonitor-RF connection with Transparent Mode
Connectivity WBA TM CubeMonRF 1.png

Platform and SW information can be found in VS_HCI_C1_DEVICE_INFORMATION answer:

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

ACI Utilities allows user to easily launch Advertising or 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 device information, Read and Write registers from 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

No categories assignedEdit