Skip to main content
Giatto
Associate
April 1, 2022
Question

Maximum number of services and/or characteristics in BLE GATT

  • April 1, 2022
  • 3 replies
  • 1961 views

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

This topic has been closed for replies.

3 replies

AndyR1
Senior
April 4, 2022

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 ?

Giatto
GiattoAuthor
Associate
April 5, 2022

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
April 5, 2022

@Giatto​ could you post your init function ?

Giatto
GiattoAuthor
Associate
April 5, 2022

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

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

AndyR1
Senior
April 5, 2022

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 ?