cancel
Showing results for 
Search instead for 
Did you mean: 

Adding characteristic descriptor and characteristics manually to BLE profile ERROR

MSuva.1
Associate III

HI,

I'm currently struggling to add new characteristics and characteristic descriptors to my BLE profile. Unfortunately it seems that CubeMX does not support adding more than five characteristics and has no support for adding descriptors.

This is the main code where I am trying implement a new descriptor (all in custom_stm.c file generated by CubeMX):

0693W00000WKYy3QAH.png 

0693W00000WKYxUQAX.png 

And here is the return value I get (72) from the aci_gatt_add_char_desc():

0693W00000WKYx0QAH.png 

Unfortunately I can't find any definition for what this value means. I found the following in a document online for another ST board (I am using an STM32WB5MM):

0693W00000WKYywQAH.png 

Unfortunately none of these fit the bill. There is also no definition for this particular return value in "ble_defs.h", this is where the other BLE return values are defined.

Apologies for the messy code, I have been trying everything I can to get rid of this error but haven't been able to figure anything out.

Greatly appreciate any input on this issue. Thanks very much!

1 REPLY 1
Remy ISSALYS
ST Employee

Hello,

The limitation to 5 characteristics for 1 service comes from STM32CubeMX tool, indeed you can add more characteristics or descriptors with the aci_gatt_add_char()/aci_gatt_add_char_desc() functions, to do this you should increase the Max_Attribute_Records parameter used in aci_gatt_add_service() function. To calculate this parameter follows this formula:

Max_Attribute_Records = 1

+ 2*no_of_char

+ 1*no_of_char_with_notify_or_indicate_property

+ 1*no_of_char_with_broadcast_property

The error code 0x48 means Out of memory.

Best Regards