This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

sd_ble_uuid_vs_add get error NRF_ERROR_NO_MEM from softdevice s132 v5.0.0

Hi everyone,

I am using nRF52832 kit (PC10040), eclipse and softdevice S132 V5.0.0 for developing a BLE service. I follow the service tutorial and I refer to the code from Github which uses softdevice S132 V2.0.0. I also refer to examples in the SDK v14.0.0 which content softdevice S132 V5.0.0 for initializing the softdevice. However, when I test my code, the function sd_ble_uuid_vs_add always return NRF_ERROR_NO_MEM error!!! I have search on the Internet, and I have fix the linker script as below

MEMORY
{
  FLASH (rx) : ORIGIN = 0x23000, LENGTH = 0x5d000
  RAM (rwx) :  ORIGIN = 0x200025f8, LENGTH = 0xda08
}

Could you please help me to fix the error? Thanks.

Parents
  • Documentation says that NRF_ERROR_NO_MEM is returned "If there are no more free slots for VS UUIDs."

    Two suggestions for things to try:

    (1) in your SDK config file, look at

    // <o> NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE - Attribute Table size in bytes. The size must be a multiple of 4.
    #ifndef NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE
    #define NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE 1408
    #endif
    
    // <o> NRF_SDH_BLE_VS_UUID_COUNT - The number of vendor-specific UUIDs.
    #ifndef NRF_SDH_BLE_VS_UUID_COUNT
    #define NRF_SDH_BLE_VS_UUID_COUNT 1
    #endif
    

    (2) change the vloc property of your characteristic attribute values to BLE_GATTS_VLOC_USER: infocenter.nordicsemi.com/index.jsp

  • Both 'NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE' and 'NRF_SDH_BLE_VS_UUID_COUNT' affects how much memory is reserved specifically for the Softdevice. By default only a certain amount of RAM is allocated for your attribute table, and when you start to fill it up with services and characteristics sooner or later everything will be used up. So by using these defines you have better control over your RAM. I should mention that how to calculate the exact size of your attribute table is not public information so you will have to rely on trial and error when choosing the optimal 'NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE' value.

Reply
  • Both 'NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE' and 'NRF_SDH_BLE_VS_UUID_COUNT' affects how much memory is reserved specifically for the Softdevice. By default only a certain amount of RAM is allocated for your attribute table, and when you start to fill it up with services and characteristics sooner or later everything will be used up. So by using these defines you have better control over your RAM. I should mention that how to calculate the exact size of your attribute table is not public information so you will have to rely on trial and error when choosing the optimal 'NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE' value.

Children
No Data
Related