How to build a STM32WB0 Bluetooth® Low Energy project

1. Presentation

This page describes how to build easily and install STM32WB0 Bluetooth® Low Energy example applications.
Project examples can be found on STM32CubeWB0 MCU Package[1], and are available for different platforms.

STMicroelectronics Bluetooth® Low Energy example project directory


2. Requirements

2.1. Software and system requirements

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

  • IAR Embedded Workbench for Arm (EWARM) toolchain V9.30.1, plus a patch available in the WB0 firmware package: STM32Cube_FW_WB0_Vx.y.z/Utilities/PC_Software/EWARMv9_STM32WB0x_V1.0.0.zip
  • RealView Microcontroller Development Kit (MDK-ARM) toolchain V5.37, plus a patch available in the WB0 firmware package: STM32Cube_FW_WB0_Vx.y.z/Utilities/PC_Software/Keil.STM32WB0x_DFP.1.0.0.zip
  • STM32CubeIDE toolchain V1.16.0 [2].

The required programmer is the following:

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

2.2. Hardware requirements

The board NUCLEO-WB05KZ[4], NUCLEO-WB07CC[5] or NUCLEO-WB09KE[6], is necessary to install the application.

NUCLEO-WB05KZ NUCLEO-WB07CC NUCLEO-WB09KE


3. Bluetooth® Low Energy Host Stack and Controller Only libraries

In order to use Bluetooth® Low Energy connectivity in STM32WB0 projects, two libraries are available:

  • One single library for the Bluetooth® Low Energy Host + Controller Stack.
  • One single library for the Bluetooth® Low Energy Controller Only Stack.
Bluetooth® Low Energy Stack interface
Host + Controller Stack Solution (stm32wb0x_ble_stack.a) Controller Only Solution (stm32wb0x_ble_stack_controller_only.a)


Bluetooth® Low Energy stack v4.x provides the capability to enable/disable, at compile time, some Bluetooth® Low Energy stack features based on the user application scenario.
The following modular options are available for the Bluetooth® Low Energy stack v4.x binary images:

Bluetooth® LE stack v4.x library modular options



It is possible to interact directly at HCI + ACI interface (or HCI in LL only case) level by using STM32CubeMonitor-RF and the Transparent Mode application.

Information about the Bluetooth® Low Energy STM32_BLE middleware and related Bluetooth LE stack libraries are available in: STM32Cube_FW_WB0_Vx.x.x/Middlewares/ST/STM32_BLE/Release_Notes.html

For detailed information about Bluetooth® Low Energy stack v4.x modular options please refer to STM32WB0 Bluetooth® LE Stack Modularity and Integration wiki page.

4. Build and install the application

This section describes the build process using IAR Embedded Workbench, MDK-ARM or STM32CubeIDE.

4.1. Build with IAR Embedded Workbench IDE

Select the application to be built. Open the IAR (EWARM) dedicated directory and launch the project.eww IAR file to open the demonstration project on IDE.

IAR project directory


Ensure that the project is correctly visible into the Project explorer view.

Build the project by reproducing the following steps:

IAR: build


It is possible to build and flash the project on your board by clicking on the button illustrated below:

IAR: build and flash memory

4.2. Buid with STM32CubeIDE

Select the application to be built. Open the STM32CubeIDE dedicated directory and launch the Cube IDE.project of the demonstration.

STM32CubeIDE project folder


Ensure that the project is correctly visible into the Project explorer view.
Build the project by reproducing the following steps:

STM32CubeIDE: build


Flash it on the board:

STM32CubeIDE: Flash memory

4.3. Build with MDK-ARM IDE

Select the application to be built, open the Keil (MDK-ARM) dedicated directory and launch the .uvprojx file to open the demonstration project on IDE.

MDK-ARM project folder


Ensure that the project is correctly visible into the Project Explorer view.
Build the project by reproducing the following steps:

MDK-ARM: build


It is possible to flash the project and launch a debug session on the board by clicking on the button as illustrated below:

MDK-ARM: build and flash

4.4. Install from STM32CubeProgrammer

It is possible to flash the binary built following the IAR Embedded Workbench IDE or STM32CubeIDE section using the STM32CubeProgrammer software[3].

Select the device and connect to it:

STM32CubeProgrammer: platform connection


Once connected, the device information is displayed on the STM32CubeProgrammer interface. Click on the programming icon, in the left column, and select the project binary to flash:

  • STM32Cube_FW_WB0_V[...]\Projects\[...]\Applications\BLE\BLE_p2pServer\[...]\ BLE_p2pServer.bin

Set the start address to 0x10040000.

Information
The Start address is different for Firmware Update Over The Air application.


Then, click ok on the Start Programming button:

STM32CubeProgrammer: flash project


When the programming is complete, the following logs are displayed:

STM32CubeProgrammer: logs

5. References