cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WB cannot connect to the phone using code from cubemx

LZi.1
Associate

I am using STM32WB50 to build a sensor which can be connected by the Android app via BLE. The code is generated by cubemx, and advertise works fine. But it will not work when the phone request a connection with the MCU.

I captured the BLE packages with a BLE analyzer and it shows that the MCU did not answer to "LL_FEATURE_REQ" send from my phone.

0693W00000APJbLQAX.jpgThe app debug messeges are as follows:0693W00000APJbpQAH.jpgThen I tried to download the example for Nucleo(STM32WB55) to my MCU and the problem remains the same.

Thank you for helping me and if anything is not clear please let me know.

2 REPLIES 2
Remi QUINTIN
ST Employee

I think the WB device did not accept the connection.

You have to check the status of this request with the HCI_LE_CONNECTION_COMPLETE_EVENT event.

The LE Connection Complete event indicates to both of the Hosts forming the connection that a new connection has been created. Upon the creation of the connection a Connection_Handle shall be assigned by the Controller, and passed to the Host in this event. If the connection establishment fails this event shall be provided to the Host that had issued the LE_Create_Connection command.

This event indicates to the Host which issued a LE_Create_Connection command and received a Command Status event if the connection establishment failed or was successful.

Remi QUINTIN
ST Employee

So you should check the status of your connection request before sending packets to the server.