This project is based on the BLE_HeartRateFreeRTOS
example from the STM32Cube_FW_WBA_V1.6.0 package. It demonstrates the performance of the STM32WBA6 family, highlighting:
- The low CPU load required to run a Bluetooth LE application.
- The peripheral flexibility of the STM32WBA, enabling many tasks without core intervention.
The application is controlled using three software buttons on the STM32WBA65 Nucleo board.
- B1: Press to start CoreMark computations.
- Note: CoreMark calculation task priority is just above idle task - any other task preempts CoreMark task and start execution once ready
- B2:
- First press: Start BLE advertising.
- Subsequent presses: Toggle advertising interval between fast (20 ms) and slow (100 ms).
- B3: Press to request different BLE connection parameters when connected:
- Toggles between 7.5 ms and 50 ms intervals.
- Note: The client application may not accept the requested interval and used different value instead.
- Primary VCP (Virtual COM Port): Prints application logs via the onboard STLink-V3 debugger.
- Secondary VCP: Prints application statistics.
- Display stats using the
performance_visualisation.py
script. - Make sure to set the correct COM port in the script.
- Display stats using the
python performance_visualisation.py
The application toggles GPIO pins to indicate active tasks:
Task Name | GPIO Pin | Pin Number |
---|---|---|
COREMARK_TASK | PE0 | GPIO52 |
STATISTIC_TASK | PB11 | GPIO39 |
RNG_TASK | PB0 | GPIO44 |
HRSAPP_MEAS_TASK | PB14 | GPIO47 |
HIGH_PRIOR_TASK | PA7 | GPIO43 |
Radio-related Tasks | PB13 | GPIO50 |
Note: The Radio_TASK_GPIO_PIN
represents multiple tasks related to radio handling.
Measured using IAR 9.60.4 with high-speed compiler optimizations:
Condition | CoreMark Score |
---|---|
Without RTOS | 413.9 |
With RTOS (only CoreMark task) | 409.8 |
100 ms advertising | 406.5 |
20 ms advertising | 396.8 |
Connected, HR notification, 50 ms interval | 401.6 |
Connected, HR notification, 11.25 ms interval | 373.1 |
The code includes a USE_HIGH_PRIORITY_TASK
macro (default: 0
). When enabled:
- A new FreeRTOS task
HighPriorityTask
is created. - It runs with the highest priority and can block other tasks.
- Demonstrates that STM32WBA’s BLE controller can maintain the RF link even under low RF task priority.
Note: RF performance/throughput will drop, but for applications without strict throughput requirements, the user experience remains unaffected. The time without RF handling must remain below the supervision timeout negotiated with the BLE client.