When does sd_ble_gatts_characteristic_add() return NRF_ERROR_NO_MEM?


I would like to understand the reason behind getting a error,(0x04) NRF_ERROR_NO_MEM, when calling the function

sd_ble_gatts_characteristic_add(p_service->service_handle,&char_md,&attr_char_value, &p_service->bsl_handles);

As far as I knew, the softdevice checks the memory available while calling to softdevice_enable_get_default_config() along with CHECK_RAM_START_ADDR(), but I am experiencing some difficulties while setting a 1 base 128 bits UUID + 5 characteristics whose UUID are as well 128 bits + 2 characteristics whose UUID are 16 bits on SDK12.2.

I have been reading some post (link,link2) regarding to setting uuid_count and attr_tab_size but I am not sure whether my problem is coming from that direction or not...

So I would like to know why the method sd_ble_gatts_characteristic_add() returns the NRF_ERROR_NO_MEM and how it may be solved.

Kind regards,