cancel
Showing results for 
Search instead for 
Did you mean: 

stm32wb55 firmware hangs if I add more than 5 services.

Dhananjay Khairnar
Associate II

I have a requirement for 10 services and each service contains 4 charecteristics.

-currently, I have defined 10 services and characteristics. in code.

-firmware starts, but when I try to connect from the app it gets stuck in

void hci_cmd_resp_wait(uint32_t timeout)
{
  UTIL_SEQ_WaitEvt(1 << CFG_IDLEEVT_HCI_CMD_EVT_RSP_ID);
  return;
}

this code.

-I have also modified required definitions according

#define CFG_BLE_NUM_GATT_ATTRIBUTES (129+9)

#define BLE_CFG_SVC_MAX_NBR_CB                         10

1 REPLY 1
Remi QUINTIN
ST Employee

The size of the SRAM area dedicated to the memory allocation for services and characteristics is limited.

it is never sure that the services you define will fit in that area.

The process to check if it is OK is:

  • Define the number of services you need : CFG_BLE_NUM_GATT_SERVICES ( you must add 2 regarding additional mandatory services used by the application)
  • Define the total number of characteristics you need : CFG_BLE_NUM_GATT_ATTRIBUTES ( you must add 9 regarding characteristics used by the application)
  • Update the CFG_BLE_ATT_VALUE_ARRAY_SIZE parameter according to the configuration ( the calculation method is described in app_conf.h file and in the application note AN5289)

Then check the return value of the SHCI_C2_BLE_Init() function. If it is not zero, the configuration is too big for the available memory space.