2022-02-25 01:25 PM
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.
2022-03-02 07:39 PM
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
2022-03-18 07:18 AM
Hello,
Normally this issue has been fixed, which stack did you used ?
Best Regards