Using BLE and lv_timer timer simultaneously

In the peripheral_with_ota project, I added compass sensor functionality and used lv_timer_create() to create a timer for periodically collecting sensor data. Why does the timer only trigger right after power-up and then stop triggering afterward? If I disable the BLE functionality, the timer callback function can be triggered normally.

Then we need to check whether the while loop containing lv_task_handler() gets stuck somewhere and stops looping after BLE is enabled.

There is a permanent waiting receive mailbox message on the third line inside the while loop, which might be where it’s getting stuck. Try inserting a log statement before and after this line to verify.

Yes, moving the Bluetooth-related processing outside the while loop allows the program to run properly.