cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WB55 Issues with Advertising BLE Name Length Longer Than 9 Characters

Dub Bartolec
Associate III

We have encountered issue with WB55 BLE firmware where it doesn't accept AD_TYPE_COMPLETE_LOCAL_NAME longer than 9 characters

We have reproduced that issue on p2pServer example where we've modified local_name to be "123456789" all is OK.

static const char local_name[] = { AD_TYPE_COMPLETE_LOCAL_NAME  , '1', '2', '3', '4', '5', '6', '7', '8' , '9' };

If we add one character so local name is now "1234567890"

static const char local_name[] = { AD_TYPE_COMPLETE_LOCAL_NAME  , '1', '2', '3', '4', '5', '6', '7', '8' , '9' , '0'};

Following happens in file app_ble.c

ret = aci_gap_set_discoverable(
        ADV_IND,
        Min_Inter,
        Max_Inter,
        PUBLIC_ADDR,
        NO_WHITE_LIST_USE, /* use white list */
        sizeof(local_name),
        (uint8_t*) &local_name,
        BleApplicationContext.BleApplicationContext_legacy.advtServUUIDlen,
        BleApplicationContext.BleApplicationContext_legacy.advtServUUID,
        0,
        0);
 
    /* Update Advertising data */
    ret = aci_gap_update_adv_data(sizeof(manuf_data), (uint8_t*) manuf_data);
 
// If local_name string is longer than 9 characters the above will fail with 
// returned value being 0x41 indicating BLE_STATUS_FAILED.
// Document UM1865 does not explain why that would be the case for aci_gap_update_adv_data call.
 
    if (ret == BLE_STATUS_SUCCESS)
    {
      if (New_Status == APP_BLE_FAST_ADV)

Basically returned value is 0x41 (BLE_STATUS_FAILED).

Can someone from STM check BLE firmware full sources and perhaps clarify why that is the case ?

I did not find any specification limiting BLE name to be 9 characters or less.

8 REPLIES 8
Dub Bartolec
Associate III

Anyone from STM to comment on this ?

YBOUV.1
Senior

Hi,

This is a STM32WB topic,

I'll forward this to STM32WB experts,

Best regards

Eason WANG
ST Employee

Hi,

Use the ACI_GAP_UPDATE_ADV_DATA with AD_TYPE_COMPLETE_LOCAL_NAME to update the locol name.

Hi,

That does not fix the problem. The call to aci_gap_update_adv_data() fails with 0x41 whenever the name has more than 9 characters.

Please advise.

jro
Associate III

Sigh. 8 months and no useful answer from ST, when it's actually very simple.

There's no specific limit on the name length, but there is on the advertising data as a whole. That limit is 31 bytes: 6 bytes are taken up by the Tx power and flags fields (3 bytes each), a further 14 by the manuf_data[] array, and the remaining 11 are what's left for the name. As there's a 2-byte overhead on that (one for field length, one for field type), you've got a limit of 9 characters for the name itself.

If you don't need the manuf_data[] to be advertised in your application, you can safely omit it and get those 14 bytes back.

RAdel
Associate II

Brilliant! I was already suspecting something like that, but did not manage to find the proper documentation, verifying my assumption! Your answer helped a lot! :D

jro
Associate III

No worries, just disappointed that ST employees come on, give a useless answer, then never follow up when you point out it doesn't work. I have a query of my own outstanding for some months, which AFAIK no-one but ST can answer. But they don't.

RAdel
Associate II

I have made similar experiences on multiple occasions where I figured out a working solution, but never got final confirmation either through communication or by specs sheets. Luckily, the community works as you have just proved :)