Skip to main content
TWood.4
Associate II
November 27, 2024
Solved

aci_gatt_add_service() returns BLE_STATUS_OUT_OF_MEMORY

  • November 27, 2024
  • 1 reply
  • 769 views

I am adding services to an existing WB55 BLE project with a small number of services.

As I increase the number of services, aci_gatt_add_service() eventually returns 0x98, BLE_STATUS_OUT_OF_MEMORY. (I note that 0x98 is not shown as a valid return value in the manual)

 

I have tried adjusting CFG_BLE_NUM_GATT_SERVICES , allowing for the fact that the GAP and GATT services are included automatically, but it doesn't seem to make any difference. I've also tried  adjusting CFG_BLE_NUM_GATT_ATTRIBUTES and CFG_BLE_ATT_VALUE_ARRAY_SIZE.


Can anyone suggest what to look at next?

 

 

Best answer by STTwo-32

Hello @TWood.4 

The aci_gatt_add_service() function eventually returns 0x98 (Out of memory) if the GATT database size exceeds the GATT buffer size. This can happen if the number of services and attributes in the GATT database is greater than the allocated buffer size. For more details about how to calculate the buffer size are provided in this wiki: STM32WB-WBA GATT Data Base and bonded devices information storage - stm32mcu

Best Regards.

STTwo-32

 

1 reply

STTwo-32
STTwo-32Best answer
Technical Moderator
December 23, 2024

Hello @TWood.4 

The aci_gatt_add_service() function eventually returns 0x98 (Out of memory) if the GATT database size exceeds the GATT buffer size. This can happen if the number of services and attributes in the GATT database is greater than the allocated buffer size. For more details about how to calculate the buffer size are provided in this wiki: STM32WB-WBA GATT Data Base and bonded devices information storage - stm32mcu

Best Regards.

STTwo-32