STM32WB Bluetooth® LE – wireless stack information

1. STM32WB - Bluetooth® LE coprocessor binaries

This article gives a description of the Bluetooth® LE wireless stack available for the secure CM0+ coprocessor of the STM32WB.
Most of the information can be found within the release note for STM32WBxx Copro Wireless Binaries.
For more information on how to bring up the hardware to run simple Bluetooth® LE application check the Bluetooth® LE hardware setup page.

1.1. Link between wireless coprocessor binaries and Bluetooth® LE stack variant

STM32WB_BLE_Wireless_Interface.html [1] file and AN5270 [2] show which application commands interface (ACI) and host commands interface (HCI) are supported according to Bluetooth® LE stack variant. The following table shows the correspondence between the wireless coprocessor binaries and Bluetooth® LE stack variant:

Link between wireless coprocessor binaries and Bluetooth® LE stack variant
Wireless coprocessor binary Variant of the Bluetooth® LE stack Binary size v1.16.0
stm32wb5x_BLE_Stack_full_extended_fw.bin - 184 KB
stm32wb5x_BLE_Stack_full_fw.bin BF = Basic Features 148 KB
stm32wb5x_BLE_Stack_light_fw.bin PO = Peripheral Only 112 KB
stm32wb5x_BLE_HCILayer_extended_fw.bin LO = Link Layer Only 100 KB
stm32wb5x_BLE_HCILayer_fw.bin LB = Link Layer Only Basic 78 KB
stm32wb5x_BLE_HCI_AdvScan_fw.bin BO = Beacon Only 35 KB

The following wireless coprocessor binaries for concurrent mode are based on Bluetooth® LE full Stack:

  • stm32wb5x_BLE_Mac_802_15_4_fw.bin
  • stm32wb5x_BLE_Thread_dynamic_fw.bin
  • stm32wb5x_BLE_Thread_static_fw.bin
  • stm32wb5x_BLE_Zigbee_FFD_dynamic_fw.bin
  • stm32wb5x_BLE_Zigbee_FFD_static_fw.bin
  • stm32wb5x_BLE_Zigbee_RFD_dynamic_fw.bin
  • stm32wb5x_BLE_Zigbee_RFD_static_fw.bin

1.2. STM32CubeWB v1.18.0 - Bluetooth® LE wireless stack summary

For Bluetooth® LE applications, 6 binaries are available and certified BLE 5.4. According to the type of application, the size of the flash, it is up to the developer to load the right binary:

BLE Stack 5.4 Certified GAP Peripheral GAP Central GATT Server GATT Client PHY 2M Data Length Extension Legacy Pairing, LE secure connection Privacy Filter Accept List HCI Interface Direct Test Mode L2CAP Connection Oriented channels support Channel Selection #2 Extended Advertising Scanning BT SIG Declaration QDID
Full Extended 216169
Full Reduced 160724
Light Reduced 160724
HCI Extended 216169
HCI 160726
AdvScan Reduced 160726
  • stm32wbxx_BLE_Stack_full_extended_fw.bin - Link Layer, HCI, L2CAP, ATT, SM, GAP and GATT database
    • To be used for Adverting/Scanning Extension - Full HCI/ACI/DTM commands/Event support
    • To be used for GAP Central/Peripheral & GATT Server/Client applications
    • support up to 8 links as central/peripheral and all combinations in between.
  • stm32wbxx_BLE_Stack_full_fw.bin - Link Layer, HCI reduced, L2CAP, ATT, SM, GAP and GATT database
    • To be used for GAP Central/Peripheral & GATT Server/Client applications
    • support up to 8 links as central/peripheral and all combinations in between.
  • stm32wbxx_BLE_Stack_light_fw.bin - Link Layer, HCI reduced, L2CAP, ATT, SM, GAP(limited) and GATT(limited) database
    • To be used for GAP Peripheral & GATT Server applications
    • support up to 4 links as Slave
  • stm32wbxx_BLE_HCILayer_fw.bin - Link Layer, HCI, DTM
    • To be used for BLE Host Stack running on CM4 application processor (Arduino, Zephyr,..)
  • stm32wbxx_BLE_HCILayer_extended_fw.bin - Link Layer, HCI, DTM, Extended Advertising/Scanning
    • To be used for BLE Host Stack running on CM4 application processor (Arduino, Zephyr,..)
  • stm32wbxx_BLE_HCI_AdvScan_fw.bin - Link Layer, HCI reduced
    • To be used for advertising and scanning through HCI interface

1.3. Stack extended information

To use extended binaries, it is necessary to adapt the scatter file in the BLE applications:

1.3.1. STM32WB5x/STM32WB3x

1.3.1.1. IAR Systems® IAR Embedded Workbench® for Arm® (EWARM)

For IAR Systems® IAR Embedded Workbench® for Arm® (EWARM) IDE, modify stm32wb55xx_flash_cm4.icf[3] file by following these steps:

  • The RAM_A shared range must be reduced to memory range [0x20030000:0x200307FF] instead of [0x20030000:0x200327FF]:
- Replace these symbols:
define symbol __ICFEDIT_region_RAM_SHARED_start__ = 0x20030000;
define symbol __ICFEDIT_region_RAM_SHARED_end__   = 0x200327FF;
- By:
define symbol __ICFEDIT_region_RAM_SHARED_start__ = 0x20030000;
define symbol __ICFEDIT_region_RAM_SHARED_end__   = 0x200307FF;
  • Create RAM_B shared region in memory range [0x20038000:0x2003A7FF]:
- Add the RAM_B shared region:
define symbol __ICFEDIT_region_RAM_B_SHARED_start__ = 0x20038000;
define symbol __ICFEDIT_region_RAM_B_SHARED_end__   = 0x2003A7FF;
define region RAM_B_SHARED_region = mem:[from __ICFEDIT_region_RAM_B_SHARED_start__   to __ICFEDIT_region_RAM_B_SHARED_end__];
  • The RAM_B shared must be added to Total_RAM_region:
- Replace this line:
define region Total_RAM_region  = RAM_region | RAM_SHARED_region;
- By:
define region Total_RAM_region  = RAM_region | RAM_SHARED_region | RAM_B_SHARED_region;
  • The Mail-box buffers(MB_MEM1, MB_MEM2) must be located in RAM_B shared region:
- Replace these lines:
place in RAM_SHARED_region { section MB_MEM1};
place in RAM_SHARED_region { section MB_MEM2};
- By (RAM_B_SHARED_region instead of RAM_SHARED_region) :
place in RAM_B_SHARED_region { section MB_MEM1};
place in RAM_B_SHARED_region { section MB_MEM2};
1.3.1.2. STMicroelectronics integrated development environment for STM32 products (STM32CubeIDE)

For STMicroelectronics integrated development environment for STM32 products (STM32CubeIDE) IDE, modify STM32WB55RGVX_FLASH.ld[4] file by following these steps:

  • The RAM_A shared range must be reduced to 2 KB instead of 10KB:
- Replace this line:
RAM_SHARED (xrw)           : ORIGIN = 0x20030000, LENGTH = 10K
- By:
RAM_SHARED (xrw)           : ORIGIN = 0x20030000, LENGTH = 2K
  • Create RAM_B shared region of 10 KB starting from 0x20038000:
- Add the RAM_B shared region:
RAMB_SHARED (xrw)          : ORIGIN = 0x20038000, LENGTH = 10K
  • The Mail-box buffers(MB_MEM1, MB_MEM2) must be located in RAM_B shared region:
- Replace these lines:
MB_MEM1 (NOLOAD)       : { *(MB_MEM1) } >RAM_SHARED
MB_MEM2 (NOLOAD)       : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
- By (RAMB_SHARED instead of RAM_SHARED):
MB_MEM1 (NOLOAD)       : { *(MB_MEM1) } >RAMB_SHARED
MB_MEM2 (NOLOAD)       : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAMB_SHARED
1.3.1.3. Keil® Microcontroller Development Kit (MDK-ARM)

For Keil® Microcontroller Development Kit (MDK-ARM) IDE, modify stm32wb55xx_flash_cm4.sct[5] file by following these steps:

  • The RAM_A shared range must be reduced to memory range [0x20030000:0x200307FF] instead of [0x20030000:0x200327FF]
  • Create RAM_B shared region in memory range [0x20038000:0x2003A7FF]
  • The Mail-box buffers(MB_MEM1, MB_MEM2) must be located in RAM_B shared region
- Replace these lines:
RW_RAM_SHARED2 0x20030028 0x27D8  { ; RW data      
  *(MB_MEM1)
  *(MB_MEM2)
  .ANY (+RW +ZI)
}
- By:
RW_RAM_SHARED2 0x20030028 0x07D8  { ; RW data      
  .ANY (+RW +ZI)
}
RW_RAM_SHARED3 0x20038000 0x27FF { ; RW data      
  *(MB_MEM1)
  *(MB_MEM2)
  .ANY (+RW +ZI)
 }

1.3.2. STM32WB1x

1.3.2.1. IAR Systems® IAR Embedded Workbench® for Arm® (EWARM)

For IAR Systems® IAR Embedded Workbench® for Arm® (EWARM) IDE, modify stm32wb15xx_flash_cm4.icf [6] file by following these steps:

  • The RAM_A shared range must be reduced to memory range [0x20030000:0x20030FFF] instead of [0x20030000:0x200327FF]:
- Replace these symbols:
define symbol __ICFEDIT_region_RAM_SHARED_start__ = 0x20030000;
define symbol __ICFEDIT_region_RAM_SHARED_end__   = 0x200327FF;
- By:
define symbol __ICFEDIT_region_RAM_SHARED_start__ = 0x20030000;
define symbol __ICFEDIT_region_RAM_SHARED_end__   = 0x20030FFF;
1.3.2.2. STMicroelectronics integrated development environment for STM32 products (STM32CubeIDE)

For STMicroelectronics integrated development environment for STM32 products (STM32CubeIDE) IDE, modify STM32WB15CCUX_FLASH.ld[7] file by following these steps:

  • The RAM_A shared range must be reduced to 4 KB instead of 10KB:
- Replace this line:
RAM_SHARED (xrw)           : ORIGIN = 0x20030000, LENGTH = 10K
- By:
RAM_SHARED (xrw)           : ORIGIN = 0x20030000, LENGTH = 4K
1.3.2.3. Keil® Microcontroller Development Kit (MDK-ARM)

For Keil® Microcontroller Development Kit (MDK-ARM) IDE, modify stm32wb15xx_flash_cm4.sct[8] file by following these steps:

  • The RAM_A shared range must be reduced to memory range [0x20030000:0x20030FFF] instead of [0x20030000:0x200327FF]
- Replace these lines:
   RW_RAM_SHARED2 0x20030028 0x27D8  { ; RW data      
    *(MB_MEM1)
    *(MB_MEM2)
    .ANY (+RW +ZI)
   }
- By:
   RW_RAM_SHARED2 0x20030028 0xFD8  { ; RW data      
    *(MB_MEM1)
    *(MB_MEM2)
    ANY (+RW +ZI)
   }

1.4. STM32CubeWB application and Bluetooth® LE stacks association

The following table shows the Bluetooth® LE stack to be used for the different applications available within the STM32CubeWB package:

Bluetooth® LE stack and Application compatibility
Applications / Stack Full Extended Full Light HCI Extended
BLE_AT_Server
BLE_Beacon
BLE_BloodPressure
BLE_CableReplacement
BLE_DataThroughput
BLE_HealthTermometer
BLE_HeartRate - All
BLE_Hid
BLE_Ota
BLE_P2P_Client
BLE_p2pClient_Ext
BLE_p2pRouter
BLE_p2pServer
BLE_p2pServer_Ext
BLE_Peripheral_Lite
BLE_Proximity
BLE_RfWithFlash
BLE_Sensor
BLE_MeshLightingLPN
BLE_MeshLightingPRFNode
BLE_MeshLightingProvisioner
BLE_Mesh_Model_Sensor
BLE_Mesh_Thermometer_Sensor
BLE_TransparentMode

2. References