cancel
Showing results for 
Search instead for 
Did you mean: 

Unit-testing BLE features on STM32WB05KZ using Unity+mocking

vkosuri
Associate II

Dear all,

We are currently working with STM32WB05KZ MCU and developing unit tests for our BLE application utilizing the Unity test framework.

Specifically we are mocking scenarios such as, low-power mode pairing, and other related BLE functionalities enforcing real security measures.

We would greatly appreciate any advice or examples the following:

  1. Mocking BLE SDK functions for STM32 (e.g., ble_gap_ ble_gatts_*) using Unity or any other unit test libraries that have been successfully implemented.
  2. Injecting mocks for the STM32CubeWB BLE stack (e.g., stubs for CI, advertising, pairing testing low-power in a CI environment—any patterns practices using Unity and mock frameworks.
  3. Any repositories or reference code for unit testing for STM32WB0 series.

Thank you for support and guidance!

1 REPLY 1
OliM
Senior

If you already use Unity, I would advise you to add cmock by going to ceedling. 
Then you can happily mock away right in the specific testcases without having to explicitly build a harness
https://github.com/ThrowTheSwitch/CMock/blob/master/docs/CMock_Summary.md