cancel
Showing results for 
Search instead for 
Did you mean: 

aci_gatt_add_service() returns BLE_STATUS_OUT_OF_MEMORY

TWood.4
Associate III

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?

 

 

1 REPLY 1
STTwo-32
ST Employee

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

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.