2025-05-20 12:20 AM
Hi, I want to send data and receive commands through BLE. For that, I followed some tutorials where I learned how to generate code using STM32CubeIDE. I can now see my device name in the BLE scanner, but I also want to send data and receive commands. I need to write some code for this. Can someone help me with where to write the code? For now, I just want to send some random data like 0x9944. I am using stm32wb55cgu6 board
2025-05-20 5:14 AM
Hello,
you could start with BLE_Custom example.
Once you're connected with your phone (ST BLE Toolbox app), you can send "0001" to turn on the LED and "0000" to turn it off (P2P WRITE). Please check the custom_app.c file where you can find how the LED toggling is done.
Also, this material below could be helpful.
How to build wireless applications with STM32WB MCUs - Application note
Please don't hesitate to ask further if you have any question.
Best regards,
ST support