cancel
Showing results for 
Search instead for 
Did you mean: 

BLE : Start fast advertising failed

audrey38
Associate II

The following function aci_gap_update_adv_data returns the error 0x91 which means "Failed". We don't understand why we have this error and the startup of the device. Do you have any idea ?

image.png

Best regards,

Audrey

1 ACCEPTED SOLUTION

Accepted Solutions
Remy ISSALYS
ST Employee

The aci_gap_update_adv_data command is used to update the advertising data for a particular AD type. If the AD type specified does not exist, then it is added to the advertising data. If the overall advertising data length is more than 31 octets after the update, then the command is rejected and the old data is retained.

As you see on your screenshot, in your case before call the command, the advertising data size is 19 bytes, when you call aci_gap_update_adv_data command you will add 14 bytes, so advertising data size will be 33 bytes which is greater than max allowed (e.g 31 bytes), that's why the command is rejected. 

To solve your issue, you can reduce the local name or the manufacturer data, or you can remove a specific AD type like TX Power using aci_gap_delete_ad_type command for example.

View solution in original post

8 REPLIES 8
Remy ISSALYS
ST Employee

Hello,

The aci_gap_update_adv_data command returns the error 0x91 when the advertising data size is greater than the maximum authorized (31 bytes for legacy pairing).

Best Regards

Viniciuspsc
Associate III

Hello,
Could you fixed it? Facing same problem... But my data size is 14bytes

Remy ISSALYS
ST Employee

Hello,

You can check the size of your advertising data easily using ST BLE Toolbox smartphone application. I think you are trying to update manufacturer data but the advertising data is composed of different data type like local name, TX power, flags...

Best Regards,

Viniciuspsc
Associate III

Viniciuspsc_0-1699538755502.pngViniciuspsc_1-1699538800007.png

Here is how my manuf_data is defined and filled in the debug. Its size is 14.

Remy ISSALYS
ST Employee

On your screenshot everything seems to be good and based on example available in STM32CubeWB package. Can you share a screenshot of advertisement panel in ST BLE ToolBox, if possible? 

Viniciuspsc
Associate III

Viniciuspsc_0-1699543689400.png

 

Remy ISSALYS
ST Employee

The aci_gap_update_adv_data command is used to update the advertising data for a particular AD type. If the AD type specified does not exist, then it is added to the advertising data. If the overall advertising data length is more than 31 octets after the update, then the command is rejected and the old data is retained.

As you see on your screenshot, in your case before call the command, the advertising data size is 19 bytes, when you call aci_gap_update_adv_data command you will add 14 bytes, so advertising data size will be 33 bytes which is greater than max allowed (e.g 31 bytes), that's why the command is rejected. 

To solve your issue, you can reduce the local name or the manufacturer data, or you can remove a specific AD type like TX Power using aci_gap_delete_ad_type command for example.

Viniciuspsc
Associate III

Excellent explanation, thank you very much!