cancel
Showing results for 
Search instead for 
Did you mean: 

Device fails to find any nearby BLE devices during a scan

I am using an STM32WB30 MCU and am using a modified version of the BLE P2P example where my device is a client connecting to a BLE server that is always advertising. My device goes into a scanning procedure when a button is pressed, connects to the BLE server, discovers its services and characteristics, and subscribes to the desired characteristics.

After successfully calling the below function when a button is pressed, the system goes into the scanning procedure.

aci_gap_start_general_discovery_proc(0x4000, 0x4000, PUBLIC_ADDR, 0);

Then, in the SVCCTL_App_Notification callback function, the ACI_GAP_PROC_COMPLETE_VSEVT_CODE case is executed within ~10 seconds once the scanning procedure is complete.

As shown in the P2P example, if devices are discovered, the HCI_LE_META_EVT_CODE case within the SVCCTL_App_Notification callback is executed which then has several other sub-cases within it, including AD_TYPE_COMPLETE_LOCAL_NAME which I use to do a strncmp to find my BLE server by name. If found, I then start the connection procedure. However, what I am noticing is that sometimes, there is no HCI_LE_META_EVT_CODE case executed for a given scanning procedure but ACI_GAP_PROC_COMPLETE_VSEVT_CODE case does get called once a scanning procedure completes.

I'm not sure why no HCI_LE_META_EVT_CODE case is called for some of the scanning procedure. I'm curious to see if anyone has any idea of what's going on. As a workaround, I have a timer that re-executes the scanning procedure every ~30 seconds until a successful connection is created.

For additonal context, this is running on a custom board where I have tuned the RF circuit and the radio is set to 0 dBm.

0 REPLIES 0