cancel
Showing results for 
Search instead for 
Did you mean: 

BLE Events with sequencer

MahmoudAhmed11
Associate III

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.

3 REPLIES 3
MahmoudAhmed11
Associate III

@STTwo-32  @FilipKremen 

Can you help me, please?

FilipKremen
ST Employee

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.

Utility:Sequencer - stm32mcu

Best regards,

Filip Kremen

MahmoudAhmed11
Associate III

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.