/STM32WB-BLE-PER-Testbench

Example demonstrates how to enable BLE Direct Test Mode (DTM) in the STM32WB from a firmware user application using HCI testing commands directly to perform a Packet Errror Rate (PER) measurement

Primary LanguageCOtherNOASSERTION

STM32-Hotspot/STM32WB-BLE-PER-Testbench MCU Firmware Package, based on STM32CubeWB Release v1.13.1

latest tag

Example

This Hotspot FW package includes:

  • Application example under "Projects\P-NUCLEO-WB55.Nucleo\Applications\BLE" called BLE_PER_Testbench.

    • This example aims to demonstrates how to enable BLE Direct Test Mode (DTM) in the STM32WB from a firmware user application using HCI testing commands directly to perform a Packet Errror Rate (PER) measurement without the need of an external software tool like STM32CubeMonitor-RF or physical cable connections to the DUT.
    • The Transmitter (packet generator) is set up to transmit test packets (i.e. PRBS9) continuously.
    • The Receiver DUT is set up to calculate PER on an interval expected to have received a set number of packets. For example, we can predetermine that it takes 938 ms for the packet generator (Tx) to transmit 1500 packets of 37 bytes, PRBS9, in 1M PHY, therefore, this time can then be applied on the receiver as a receive window and read the number of packets actually received, then compare it against the expected number of packets (1500) for this time window and calculate the PER from that. The receiver will also measure and report the RSSI level for that time window.

    UG_IMAGE_1

    • Two NUCLEO-WB55RG boards can be used for the Transmitter and Receiver, however, the firmware can be tailored to run on any other platform based on STM32WB. the firmware .hex image file is provided in this package.
    • A custom Android Smartphone app called "ST PER Testbench" is used to configure the radio mode and corresponding test parameters for the Transmitter and Receiver devices, respectively.
    • The PER and RSSI measurement results can be viewed from a PC's serial terminal connected to the NUCLEO-WB55RG/DTM Rx device or from the "ST PER Testbench" Android Smartphone since the DTM-Rx device also advertises its results for 1s after every Rx window.
    • Development tools, toolchains/compilers: IAR EWARM V9.20.x, STM32CubeIDE v1.8.0
    • Supported Devices and hardware boards: NUCLEO-WB55RG
    • Known limitations: None

Hardware Needed

  • Two NUCLEO-WB55RG

  • Android Smartphone with Bluetooth LE 4.2 support

Software Needed

  • Prebuilt firmware image, BLE_PER_Testbench.hex, provided under "STM32WB-BLE-PER-Testbench\Projects\P-NUCLEO-WB55.Nucleo\Applications\BLE\BLE_PER_Testbench\Binaries"

  • Android Smartphone app provided under "STM32WB-BLE-PER-Testbench\Utilities\Android_Software"

User's Guide

  • Install the PERTestBench v1.0.3.apk app, found under "\Utilities\Android_Software" on an Android Smarphone
  • Install the BLE_PER_Testbench.hex firmware image, found under "Projects\P-NUCLEO-WB55.Nucleo\Applications\BLE\BLE_PER_Testbench\Binaries" on both NUCLEO-WB55RG boards
  • Run the firmware on two NUCLEO-WB55RG boards
  • Connect a serial terminal (Tera Term) to the boards. (This step is optional, but used here for demonstrations purposes)

UG_IMAGE_0

  • [1] Launch BLE PER Testbench app. You should see two devices appear in scan window named DTM-ST. This is the name device name when they have not been configured.
  • [2] Use the RSSI indicator to identify the board that you want to configure as the Transmitter. Placing the phone in close proximity to the WB device will cause the RSSI for the respective device to go high.
  • [3] Once identified, you can tap the “CONNECT”

UG_IMAGE_1

  • [1] Configure the Transmitter using the parameters provided
  • [2] Tap “CONFIGURE”
  • [3] Tap the back arrow button to return to the scan window

UG_IMAGE_2

  • [1] Notice that the device just configured is now named “DTM-TX”.
  • [2] Configure the other device (DTM-ST) as the Receiver by tapping “CONNECT”

UG_IMAGE_3

  • [1] Configure the device as a Receiver by moving the switch to RX.
  • [2] Configure the Receiver using the parameters provided
  • [3] Tap “CONFIGURE”
  • [4] Tap the back arrow button to return to the scan window

UG_IMAGE_4

  • Now, user should see two devices named DTM-TX and DTM-RX

UG_IMAGE_5

  • [1] Start the Transmitter by pressing the SW1 button.
    • The Blue LED1 will turn on solid
    • The Green LED2 will blink; turning on when device radio is actively transmitting and turn off when it is not transmitting.
    • There’s also a trace on the serial terminal to indicate the start of the DTM Tx mode

Note: In the firmware, PB0 was configured in AF6 mode (EXT_PA_TX) to control CTX pin for Ext PA applications. Note that this configuration has no radio effect when running on the NUCLEO-WB55RG platform since there is no Ext PA in place, but since PB0 is used to drive the green LED2 on this board, the LED2 will blink according to the radio Tx/Rx state; hi for radio transmit and low for receive. However, the firmware setup is added here for flexiblity in case this firmware is ran on a platform that does have an Ext PA in place, such as the MB1586A reference board which includes the SKY66118-11 PA from Skyworks Solutions (max output power = +20 dBm)

UG_IMAGE_6

  • [1] Start the DTM Receiver by pressing the SW1 button.

    • The Blue LED1 will turn on solid
    • The Green LED2 will blink; turning on when device radio is actively transmitting and turn off when it is receiving.
  • [2] On the smartphone app’s scan window, a GRAPH button will appear in the place of the CONNECT button, this is because when the device is operating in DTM Receive mode, it is no longer connectable. Tap the GRAPH button.

UG_IMAGE_7

  • The GRAPH window is where the user can see the PER measurement results coming from the Receiver device. There’s an RSSI and a PER graph along with a results table displaying the current result values.

UG_IMAGE_8

  • [1] The app also includes a data entry feature that the user can use to log the distance between the Transmitter and the Receiver. This is useful if the user is using this for radio range measurements.

    • There’s a field to enter distance in meters and a SAVE DATA button to save the entered distance value in a .csv file on the phone’s filesystem. This .csv file can be found under the smartphones file system
  • [2] User can stop the DTM Transmitter and/or Receiver at any time by pressing SW2

UG_IMAGE_9

  • User can perform range performance measurement by setting up a Transmitter device in a field and walk away with the receiver DUT and view the PER results from their smartphone.

UG_IMAGE_10

Troubleshooting

Caution : Issues and the pull-requests are not supported to submit problems or suggestions related to the software delivered in this repository. The STM32WB-BLE-PER-Testbench example is being delivered as-is, and not necessarily supported by ST.

For any other question related to the product, the hardware performance or characteristics, the tools, the environment, you can submit it to the ST Community on the STM32 MCUs related page.