cancel
Showing results for 
Search instead for 
Did you mean: 

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

JKlei.6
Associate

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.

2 REPLIES 2
JKlei.6
Associate

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 Employee

Hello,

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

Best Regards