Coming soon |
Click here for Bluetooth® LE overview
1. STM32WB Dual Core
The STM32WB combines a well-known ARM Cortex-M4 for the application, plus, a 2.4 GHz radio subsystem and a ARM Cortex-M0+ processor running the Firmware Upgrade Service (FUS) and the Wireless Stack .
STM32WB Dual Core |
---|
All the code running on ARM Cortex-M0+ (CPU2) is delivered as encrypted binary and it is necessary to upgrade the wireless stack before developing a project on the application side.
- Black box for customer perspective
All the code running on ARM Cortex-M4 (CPU1) is delivered as source code.
The STM32WB will be pre-loaded with so-called Root Security System (FUS) firmware necessary to authenticate the selected Wireless stack (binary encrypted format) loaded by the customer on st.com.
STM32WB memory mapping |
---|
Cortex-M0+ security protects upper parts of Flash and SRAM2 memories. Size of each areas are automatically set during wireless stack install or update.
- Secure Flash Start Address (SFSA) is the lower boundary of protected Flash memory. It is aligned on 4KBytes(WB5x) or 2KBytes(WB1x) granularity.
- Secure Backup Ram Start Address (SBRSA) and Secure Non-Backup Ram Start Address (SNBRSA) are respective lower address of protected parts of SRAM2a and SRAM2b memories. Size can be set with a granularity of 1KBytes.
However settings of these option bytes are under the responsibility of FUS. They are set during a first install or an update of the wireless stack. They cannot be modified by the user.
This wiki article contains information to help users how to use STM32Cubeprogrammer[1] to upgrade the secure area of the STM32WB.
2. Hardware Platform Configuration
2.1. P-NUCLEO-WB55[2] and STM32WB5MM-DK Discovery kit[3]
2.1.1. Boards and ST-LINK USB cable connections
Nucleo | Discovery Kit |
---|---|
The USB cable from the PC is used to power and interact with the STM32.
3. FUS and Wireless Stack Update
Firmware Upgrade Service (FUS) and Bluetooth® Low Energy Stack can be updated using STM32CubeProgrammer software[1]
Regarding FUS, more information can be found on the dedicated Firmware Upgrade Services wiki article or within the Firmware Upgrade Service for STM32WB series Application Note[4].
3.1. How to Update the FUS
FUS (firmware upgrade services) is a firmware running on STM32WB Cortex®-M0+ and offering following features:
- Install, upgrade or delete STM32WB Cortex®-M0+ wireless stack
- FUS self-upgrade
- Customer authentication key management
- User key management
- Communication with Cortex®-M4 (user code or bootloader)
Below are described the different steps to update the FUS of P-NUCLEO-WB55 and STM32WB5MM-DK Discovery platforms.
Connect your platform using STM32Cubeprogrammer[1].
CubeProgrammer: connection |
---|
3.1.1. Start FUS
When connected, go to Firmware Upgrade Services interface, and start the actual FUS, clicking on the associated button.
CubeProgrammer: start FUS |
---|
Once the FUS is correctly started, the following logs should be visible on the CubeProgrammer logs interface.
CubeProgrammer: FUS started logs |
---|
3.1.2. Read FUS
Once the FUS is started read its value.
CubeProgrammer: read FUS |
---|
3.1.3. Update Firmware Upgrade Service binary
The latest version of the FUS can be found in STM32CubeWB MCU Package[5].
Check the Releases Notes to know what is the latest FUS version and the FUS Start Address.
FUS information |
---|
If the FUS version of your platform is different than the version specified in Release Notes, proceed to FUS update by following the below steps:
- If the platform FUS version is 0.5.3, use the binary dedicated:
STM32Cube_FW_WB_V[...]\Projects\STM32WB_Copro_Wireless_Binaries\STM32WB5x\stm32wb5x_FUS_fw_for_fus_0_5_3.bin
.
CubeProgrammer: FUS 0.5.3 |
---|
- If the platform FUS version is different from 0.5.3, then use the other binary:
STM32Cube_FW_WB_V[...]\Projects\STM32WB_Copro_Wireless_Binaries\STM32WB5x\stm32wb5x_FUS_fw.bin
.
Complete the file path with the right file and add start address (see release notes).
Click on Firmware Upgrade.
CubeProgrammer: update FUS |
---|
A popup occurs to confirm the correct upgrade.
3.1.4. Check new FUS version
Check the new FUS version by clicking on Read FUS info button.
CubeProgrammer: read new FUS |
---|
3.2. How to update the Bluetooth® LE Wireless Stack
The Bluetooth® LE Stack can be updated on the same way as the FUS.
Firstly, check the start address of the stack in the Release Notes.
Stack start address |
---|
Select the type of stack to be loaded in STM32CubeWB package[5].
For P-NUCLEO-WB55 and STM32WB5MM-DK Discovery platforms, the Bluetooth® LE stack recommended is:
STM32Cube_FW_WB_V[...]\Projects\STM32WB_Copro_Wireless_Binaries\STM32WB5x\stm32wb5x_BLE_Stack_full_fw.bin.
Check First Install checkbox if it is the first time you install the stack on your platform.
CubeProgrammer: stack installation |
---|
3.3. How to check Bluetooth LE Application is up and running
To ensure FUS and Bluetooth® LE stack are fully functional, it is necessary to load an application on the ARM Cortex-M4. The STM32CubeWB package[5] provides different applications
Example project binaries are provided in STM32CubeWB package[5] for P-NUCLEO-WB55 board:
STM32Cube_FW_WB_V[...]\Projects\P-NUCLEO-WB55.Nucleo\Applications\BLE\[...].
Below steps explain how to install and launch BLE_p2pServer project on P-NUCLEO-WB55 board.
Go to Erasing & programming interface.
Select the path to the application binary, for example:
STM32Cube_FW_WB_V[...]\Projects\P-NUCLEO-WB55.Nucleo\Applications\BLE\BLE_p2pServer\Binary\BLE_p2pServer_reference.hex.
Then, click on Start Programming button.
CubeProgrammer: install application |
---|
Once the application correctly flashed on the platform, open a terminal as describe below and reset the platform.
Once the board is connected and the terminal window setup, press the reset button of the board. The following messages are printed to the virtual COM window when the firmware starts successfully: At this point the FUS and Bluetooth® LE Stack are correctly installed on your platforms, BLE_p2pServer application prints the following messages to the virtual COM window when the firmware starts successfully:
- FUS and Bluetooth® LE stack version are displayed on terminal log:
application startup logs |
---|
- More information how to Build & Install Bluetooth® LE Application .
- To play with BLE_p2pServer application more information available with the UM2551 - STM32CubeWB Nucleo demonstration firmware
3.4. Debug Log via UART Interface
The P-NUCLEO-WB55 and STM32WB5MM-DK platforms embed the ST-LINK/V2 in-circuit debugger and programmer for STM32 microcontrollers. The single-wire interface module (SWIM) and JTAG/serial wire debugging (SWD) interfaces are used to communicate with the STM32WB microcontroller. It supports as well the STM32 Virtual COM Port Driver to be able to communication between a PC and the application processor via a serial interface.
Use any convenient software terminal to open the serial communication port of the PC to check the messages from the board. Select your Serial port and setup your connection as follow (example done with Tera Term software).
Set a new serial connection to the ST platform:
Tera Term setup (1/2) |
---|
Setup your serial connection as below:
Tera Term setup (2/2) |
---|
4. Related Video
Further information can be found on the following videos:
Getting Started: Stack loading
Getting Started: STM32WB USB Dongle
Stack and FUS Update over USB bootloader
5. Going Further
- Create your own Bluetooth® LE example Using CubeMX : STM32CubeMX article
- Build and Flash an existing example : Build Bluetooth® LE Project article
6. References