2026-05-04 10:25 PM
Hello, I’m working on a low-power BLE peripheral design on an STM32WBA63 and I’ve hit a timing issue that I’m hoping someone can help me with.
Advertising is stable until I add some application-side work in the FreeRTOS tickless idle pre-sleep / post-sleep hooks. After that, advertising becomes intermittent and sometimes appears to stop completely.
It looks like the device wakes from STOP, but then misses the BLE Link Layer scheduling point for the next advertising event.
I instrumented the post-sleep hook and measured the time spent in post-sleep processing, which resulted in a 0.477ms delay.
We started from the CubeMX-generated tickless idle implementation and added calls to:
around the low-power entry/exit in vPortSuppressTicksAndSleep() (in the project this is in app_entry.c as generated by STM32CubeMX).
In our current integration, the post-sleep hook is executed before interrupts are re-enabled. We realize this may be relevant for radio/LL timing, but we are unsure what the recommended ordering is for STM32WBA + STM32_WPAN.
Relevant STM32CubeWBA code we found:
We noticed a “wake-up offset” mechanism in the STM32_WPAN glue code that appears to wake the Link Layer early relative to the next scheduled radio event (for LL deep sleep use cases):
However, since our system is using STOP 1, it is unclear whether an equivalent “early wake margin” is supported/needed for STOP mode.
Questions for ST:
1) For STOP1 mode + FreeRTOS tickless, is there an ST-recommended mechanism to ensure the system/stack wakes up with enough margin to meet LL radio event timing (e.g., advertising), similar to the `wakeup_offset` used in `APP_SYS_BLE_EnterDeepSleep()`?
2) In a recommended integration, should FreeRTOS' `configPOST_SLEEP_PROCESSING()` run after interrupts are re-enabled to avoid delaying radio IRQ servicing? If yes, is there a reference project in STM32CubeWBA that demonstrates the expected ordering?