Skip to main content
JKlei.6
Associate
Feb 25, 2022 9:25 PM UTC
Question

Is there an example for STM32WB55 of how to configure BLE Resolvable Private Address?

When I configure (with cubeMX) my BLE peripheral project to use Static Random Address or Public Address, the device is able to successfully connect and pair with a mobile device.

When I change the configuration to use Resolvable Private Address, device is able to connect with a mobile device, but pairing fails. I receive an ACI_GAP_PAIRING_COMPLETE_VSEVT_CODE with pairing_complete->Status = 2.

Thank you in advanced.

This topic has been closed for replies.

2 replies

JKlei.6
JKlei.6Author
Associate
Mar 3, 2022 3:39 AM UTC

I figured out the issue.

The code generated by cubeMX uses the #define CFG_BLE_ADDRESS_TYPE in multiple function calls:

aci_gap_set_authentication_requirement()

aci_gap_set_discoverable()

It is also used to determine the privacy_enabled parameter in aci_gap_init()

When setting CFG_BLE_ADDRESS_TYPE to RESOLVABLE_PRIVATE_ADDR (0x02), this results in passing in RESOLVABLE_PRIVATE_ADDR as Identity_Address_Type param in aci_gap_set_authentication_requirement(). This is not a valid value for this parameter, thus, the generated code is incorrect.

The Identity_Address_Type should either be 0x00 or 0x01 corresponding to PUBLIC_ADDR and STATIC_RANDOM_ADDR.

I fixed by writing my own app_ble.c and setting the parameters appropriately.

One recommendation is ST should have two #defines for ble address type:

CFG_BLE_ADV_ADDRESS_TYPE

and

CFG_BLE_AUTH_ADDRESS_TYPE

Remy ISSALYS
ST Technical Moderator
Mar 18, 2022 2:18 PM UTC

Hello,

Normally this issue has been fixed, which stack did you used ?

Best Regards