Skip to main content
Associate II
November 12, 2024
Question

Issue with BLE Central Mode Scanning on STM32WB55CG in BLE_p2pClient Example

  • November 12, 2024
  • 1 reply
  • 1789 views

Hello STM32 Community,

I am currently working with the STM32WB55CG microcontroller and am using the BLE_p2pClient example from the STM32 SDK. My goal is to configure the device in central mode, start scanning, and retrieve the MAC address of the nearest BLE device.

Issue Description:
I followed the setup instructions in the example, including uploading the BLE stack specified in the README file.

To initiate scanning, I used the following function call:


status = aci_gap_start_general_discovery_proc(0x4000, 0x4000, 0x00, 0);
However, I am not receiving any data or MAC addresses from nearby devices. The scan seems to start, but I do not see any output with device information.

Questions:
Is it possible to use the STM32WB55CG to scan and retrieve MAC addresses of nearby BLE devices in central mode using this SDK and example?
Could there be an issue with my setup or BLE stack configuration that might prevent the scan from returning results?
Additional Information:
I am new to STM32 development, so if there are specific APIs or configuration steps required to ensure central mode scanning works, I would greatly appreciate any guidance or documentation references.

Thank you in advance for your help!

1 reply

STTwo-32
Technical Moderator
November 12, 2024

Hello @brahmananda 

I think this post have a very good discutient on the MAC address. It contains what should answer your question.

Best Regards.

STTwo-32

Associate II
November 13, 2024

Hello @STTwo-32 ,

Thank you for your reply.

I want to know the MAC or BD address of nearby devices, not my own. I have configured my device in central mode and want to scan for nearby devices and retrieve their MAC or BD addresses.

So please help me in this regard.

Thank you 

STTwo-32
Technical Moderator
November 13, 2024

You can get your BD address when you receive a CONNECT_REQ packet.

See in attachment a description of this packet format:

STTwo32_0-1731481226618.jpeg

You just have to analyze the received packed to extract your BD address depending on the role of your device: Initiator = Client or Advertiser = Server.

One the connection is accepted by the advertiser. The connection is identified by the  AccessAddress field that reflects the value of the AA (AccessAddress) field which is the first item of the Link Layer field of the PDU.

Best Regards.

STTwo-32