X-CUBE-WB05N SW package for STM32WB05xN Bluetooth® LE network coprocessor


This document provides general information about the X-CUBE-WB05N expansion software package for STM32Cube, which runs on the STM32 and includes drivers for STM32WB05xN Bluetooth® Low Energy Network/Radio Coprocessor device.

1. Introduction

The STM32WB05xN device is an ultra-low-power Bluetooth® LE wireless Network Coprocessor addressing standard Bluetooth® LE protocol.
The STM32WB05xN provides a hardware interface to an external microcontroller based on two protocols:

  • SPI slave protocol with interrupt signal (proprietary protocol)
  • UART (based on standard UART transport layer)

The pins dedicated to the UART interface are:

  • PB0 (UART RX)
  • PA1 (UART TX)

The pins dedicated to the SPI interface are:

  • PB3 (SPI CLOCK)
  • PA11 (SPI MOSI)
  • PA8 (SPI MISO)
  • PA9 (SPI CS)
  • PA10 (SPI IRQ)

Refer to DS14620: STM32WB05xN datasheet[1] document for detailed information about the STM32WB05xN devices.

Refer to UM3406: Getting started with the X-CUBE-WB05N Bluetooth LE software expansion for STM32Cube[2] document for a description of the proprietary SPI protocol.

Refer to AN6142: Introduction to STM32WB0 Bluetooth® LE wireless interface[3] document for a description of the STM32WB0 Bluetooth LE stack commands, events.

The STM32WB05xN device supports the following network coprocessor options:

  • Network coprocessor controller-only (also called Radio Coprocessor RCP)
  • Network coprocessor host and controller (NCP)

In a network coprocessor controller-only approach, the LE controller and the host reside in two separate microcontrollers. Communication between the two microcontrollers is carried out through a standard serial interface, e.g. UART or SPI. The host can send HCI commands to communicate with the LE controller. The HCI interface and the HCI commands are standardized by the Bluetooth Core Specification. The Zephyr framework is tailored for a radio controller (controller-only) approach.

Bluetooth LE radio coprocessor controller
NCP Controller Only.png

In a network coprocessor host + controller approach, the LE controller and the host reside in a single microcontroller. User application is implemented on an external microcontroller, and communication between the two microcontrollers is done through a standard serial interface, e.g. UART or SPI. A specific application interface is provided for accessing the Bluetooth LE host and controller.

Bluetooth LE network coprocessor host and controller
NCP Host Controller.png

2. X-CUBE-WB05N: Bluetooth LE software expansion for STM32Cube

The X-CUBE-WB05N SW package is a fully compliant expansion for STM32Cube enabling development of applications using the Bluetooth LE connectivity provided on STM32WB05xN device. It provides a reference SW framework for the STM32U5 external microcontroller hosted on a NUCLEO-U575ZI-Q board connected to a X-NUCLEO-WB05KN1 including a STM32WB05KN device, but it can be easily portable across different MCU families, thanks to STM32Cube.

The following hardware components are required in order to run the X-CUBE-WB05N examples:

  • One STM32 Nucleo development platform (suggested order code: NUCLEO-U575ZI-Q).
  • One STM32WB05xN module expansion board (order code: X-NUCLEO-WB05KN1).
  • One USB type A to micro-B USB cable to connect the STM32 Nucleo to a PC.

The X-NUCLEO-WB05KN1 expansion board must be plugged into the NUCLEO-U575ZI-Q through its ARDUINO® Uno V3 connectors.

X-NUCLEO-WB05KN1 board
Connectivity X-NUCLEO-WB05KN1 board.png
NUCLEO-U575ZI-Q board
Connectivity NUCLEO-U575ZI-Q board.png

X-NUCLEO-WB05KN1 interfaces with the STM32 Nucleo microcontroller (as the STM32U5 on NUCLEO-U575ZI-Q board) via UART or full duplex SPI with an interrupt line interfaces. The firmware loaded on the module defines the host interface and, to modify it, user can simply change the firmware without modifying the hardware.

The X-CUBE-WB05N SW package is based on the hardware abstraction layer for the STM32 microcontroller, STM32CubeHAL. The package extends STM32Cube by providing complete middleware for the Bluetooth LE expansion board and several sample applications.

X-CUBE-WB05N SW package architecture
Connectivity X-CUBE WB05N Architecture.png

The X-CUBE-WB05N SW package contains the following folders:

  • Documentation: contains a compiled HTML file (X_CUBE_WB05N.chm generated from the source code with detailed documentation regarding the software components and APIs)
  • Drivers: contains the HAL drivers, the board-specific drivers for each supported board or hardware platform, including those for the on-board components and the CMSIS layer, which is a vendor independent hardware abstraction layer for the Cortex-M processor series.
  • Middlewares: libraries and protocols related to host software and applications to interface the STM32WB05xN Controller.
  • Projects: contains some sample applications with readme files, showing how to use the STM32WB05xN devices, for the NUCLEO-U575ZI-Q platform with three development environments, IAR Embedded Workbench for ARM, RealView Microcontroller Development Kit (MDK-ARM) and STM32CubeIDE.
X-CUBE-WB05N SW package structure
Connectivity X-CUBE WB05N Structure.png

The SW package allows easy portability across different MCU families, thanks to STM32Cube. It is also compatible with STM32CubeMX and it can be downloaded from and installed directly into STM32CubeMX.

2.1. X-CUBE-WB05N: Bluetooth LE stack images and supported features

The X-CUBE-WB05N provides the binary images required for configuring the STM32WB05KN device as:

  • a network coprocessor host + controller device (location + essential configuration; UART and SPI mode binary images).
  • a controller-only device (HCI controller-only configuration; UART and SPI mode binary images).

These images are provided within the X-CUBE-WB05N installation folder, under Utilities folder with associated readme files.

The following Bluetooth LE stack features are supported, respectively, on Location + Essential configuration and HCI Controller-only configurations:

X-CUBE_WB05N images Bluetooth LE stack features
Connectivity X-CUBE WB05N Images Configurations.png

The following Bluetooth LE maximum number of simultaneously radio tasks are supported, respectively, on Location + Essential configuration and HCI Controller-only configurations:

X-CUBE_WB05N images Bluetooth LE stack radio tasks
Connectivity X-CUBE WB05N Radio Tasks.png

The X-NUCLEO-WB05KN1 kit is pre-programmed with the Location + Essential, UART mode binary image.

If the user wants to load any of available binary images on the STM32WB05xN device mounted on the X-NUCLEO-WB05KN1 expansion board, the following procedure should be followed:

  • Connect the X-NUCLEO-WB05KN1 CN8 pins and the ST-LINK/V3 pins as described on following figure:
Jumper connection between X-NUCLEO-WB05KN1 and ST-LINK/V3
STLINK Jumper connection.png
  • Download and unpack the X-CUBE-WB05N containing the STM32WB05xN firmware image.
  • Download and install the STM32CubeProgrammer (v2.17.0 or later only).
  • Connect the ST-LINK/V3 debugger to your PC.
  • Open the STM32CubeProgrammer and follow these steps:
    • Select the STlink-V3 SWD probe and select Connect icon.
    • Erase the STM32WB05xN flash memory from [Erase Flash Memory]>[Full Chip Erase].
    • Load the selected firmware contained in the X-CUBE-WB05N/Utilities folder and press the [Start Programming] button on STM32CubeProgrammer tool
    • The image flashed on the STM32WB05xN device can be used with the X-CUBE-WB05N software package.
STM32CubeProgrammer
Connectivity STM32CubeProgrammer-Connect.png

3. X-CUBE-WB05N application examples

The following application examples are provided within the X-CUBE-WB05N SW package on folder Projects\NUCLEO-U575ZI\Applications:

  • Beacon application: it is a smart Bluetooth LE device that transmits a small data payload over-the-air using Bluetooth advertising packets configured with specific manufacturing data. It is used to locate place and objects. To locate the beacon, it is necessary to have a beacon scanner application running on a Bluetooth LE smartphone.
  • BLE_FOTA application: it shows how to use the dual bank flash features to allow firmware-over-the-air update of a running program without using the bootloader. The BLE_FOTA receives the new firmware from the "ST BLE Sensor" application running on a Bluetooth LE smartphone.
  • Stack_Updater application: it allows updating the STM32WB05xN firmware stack to the latest version using the updater capability provided within the BLE_TransparentMode with updater binary images.
  • SampleApp application: it shows how to simply use the Bluetooth LE stack creating a client and server connection. It also provides the user with a complete example on how to perform an ATT MTU exchange procedure, so that the server and the client can agree on the supported max MTU.
  • SensorDemo_BLESensor-App application: it shows how to implement a peripheral device tailored for interacting with the "ST BLE Sensor" application for Android/iOS devices.
  • Virtual_COM_Port application: it allows to interact with the STM32CubeMonitor-RF tool and any RF tool allowing to get access to the STM32WB0 devices Bluetooth LE stack capabilities.

Refer to the application readme.html/md files available on each application example folder for detailed description about how the application works.

3.1. How to build a new X-CUBE-WB05N project using STM32CubeMX

Refer to UM3406: Getting started with the X-CUBE-WB05N Bluetooth Low Energy software expansion for STM32Cube[2] for detailed information about how to build a new X-CUBE-WB05N project using STM32CubeMX.

3.2. How to build a new X-CUBE-WB05N project without using STM32CubeMX

If the user needs to start with a new IDE project without using STM32CubeMX, refer to the below guide as a reference:

  • Create a new project in the selected IDE EWARM/MDK-ARM/STM32CubeIDE
  • Select the STM32 device part number on which the application runs
  • Add required files at the project location:
    • Drivers
      • CMSIS
      • STM32xx_HAL_Driver
    • Add IDE startup file – startup_stm32xx.s
    • Add Middleware files
    • Add Application files

Based on IDE properties, on C/C++ Compiler preprocessor tab add the folders paths and defined symbols For more details, refer to the respective IDE’s user manual. In the context of EWARM IDE the following folders paths should be added on Projects, Options, C/C++ Compiler, Preprocessor, Additional include path:

  • $PROJ_DIR$/../STM32WB05N/App
  • $PROJ_DIR$/../STM32WB05N/Target
  • $PROJ_DIR$/../Core/Inc
  • $PROJ_DIR$/../../../../../Drivers/STM32U5xx_HAL_Driver/Inc
  • $PROJ_DIR$/../../../../../Drivers/STM32U5xx_HAL_Driver/Inc/Legacy
  • $PROJ_DIR$/../../../../../Drivers/CMSIS/Device/ST/STM32U5xx/Include
  • $PROJ_DIR$/../../../../../Drivers/CMSIS/Include
  • $PROJ_DIR$/../../../../../Middlewares/ST/STM32WB05N/includes
  • $PROJ_DIR$/../../../../../Middlewares/ST/STM32WB05N/utils
  • $PROJ_DIR$/../../../../../Middlewares/ST/STM32WB05N/hci/hci_tl_patterns/Basic

In the context of EWARM IDE the following symbols should be added on Projects, Options, C/C++ Compiler, Preprocessor, Defined symbols

  • USE_HAL_DRIVER
  • STM32U575xx

At this stage user could be in the position to compile and test the project.

X-CUBE_WB05N IDE project structure: EWARM example
Connectivity X-CUBE WB05N Project Structure.png

4. References