cancel
Showing results for 
Search instead for 
Did you mean: 

Maximum number of services and/or characteristics in BLE GATT

Giatto
Associate II

I'm struggling with an issue regarding the number of GATT services, characteristics and descriptors in BlueNRG by STM. I have currently set 6 services and 8 characteristics, minimizing the number of attributes for each service inside 

maximum_attr_records

 variable as input of GATT function 

aci_gatt_add_serv()

.

Everything works fine until I add the seventh service or the nineth characteristic: the GAP does not initialize and the communication is stopped.

I imagined that is something connected to the number of attributes/services/characteristics used in my application that require all the GATT stack memory, but it seems weird.

Is there a way to increase this maximum value using the BlueNRG protocol?

BlueNRG-2, STM32CUBEIDE 1.7.0, X-Cube-Ble 3.2.2

5 REPLIES 5
AndyR1
Senior

Hello @Giatto​,

Get a return variable of type tBleStatus from all your ble init function, do you get a 0x87 BLE_STATUS_OUT_OF_MEMORY ?

No, all the return variables are BLE​_STATUS_SUCCESS (0x00) except for gap_init() where the return variable is equal to 0x47 (BLE_STATUS_ERROR). That's where my code breaks

AndyR1
Senior

@Giatto​ could you post your init function ?

aci_gap_init( GAP_PERIPHERAL_ROLE, 0, 8, &serviceHandle, &devNameChar​Handle, &appearanceCharHandle);

The code breaks here when I add the 9th service​

AndyR1
Senior

could you post your entire init function with aci_gatt_init(), aci_gatt_add_service(), aci_gatt_add_char() ..., so I could try in my project ?