2025-09-12 6:30 AM
Hello,
I am using P-Nucleo-WB55. I have made a simple BLE server example that receives data from a client and it's working well. But whenever I add sequencer tasks, while these tasks are running, if I send any data from the client (ST BLE App), the nucleo doesn't receive it immediately. I have to wait until the tasks are finished.
I try to minimize the task time so that the sequencer can run whatever is related to the events, but it also doesn't work. I have to wait until all the tasks are finished and there are no set tasks, so that the event handler is called and the action that happens when I send data happens.
I am trying now with this example mahmoudahmedibrahim5/BLE_Receive_example, so that I can add that to a real application, so this is just an example.
This example has 1 service with 1 characteristic. When the client sends data, the event handler calls Custom_STM_App_Notification and it checks the data and blinks different LEDs based on that data. It has only one task that blinks the LED 50 times.
I want it to be able to receive the data while the task is repeated.
Thanks in advance.
2025-09-14 5:31 AM
Can you help me, please?
2025-09-15 12:43 AM
Hello,
I don't recommend using HAL_Delay() function since this function is blocking.
Instead, you could use a timer server for running the tasks periodically.
Please read section 4.5 in How to build wireless applications with STM32WB MCUs - Application note.
Also, I recommend reading this article on our Wiki page.
Best regards,
Filip Kremen
2025-09-20 5:08 AM
Hello @FilipKremen
Yes, it's better to use the timer server, but this doesn't solve the problem.
The STM doesn't receive data until all tasks are finished, not just complete a certain task. If it finishes a task and there is another task is set, even though the sequencer function will be called first, it doesn't detect the sent message.
I have tested the example without delay, and the same problem is there.