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

NRF_ERROR_NO_MEM

Hi, I have created up to 5 custom services with several characteristics (4 at maximum) each one. They all use the same base UUID. The problem I'm facing now is that when I execute 'services_init' function, the function 'sd_ble_gatts_service_add' gives error 0x000004 (NRF_ERROR_NO_MEM). I have changed services ordes inside 'services_init' function and then the same error is given but now by the 'sd_ble_gatts_characteristic_add' function. (This is maybe due to the fact that not all the services have the same number of characteristics). Do you know which is the reason of this problem? Best regards, Dani.

Parents
  • There is also an additional solution that has not been mentioned yet, and that is to place services or characteristics in user-space. This is done by setting the VLOC field to BLE_GATTS_VLOC_USER where applicable. The documentation has this comment:

    "Attribute Value is located in user memory. This requires the user to maintain a valid buffer through the lifetime of the attribute, since the stack will read and write directly to the memory using the pointer provided in the APIs. (...)"

    Remember that this must be done for any user_desc/CCCDs/SCCDs as well, or you will eventually run out of stack-reserved RAM. In S110 8.0.0 you can, as mentioned earlier, reduce or increase reserved space dynamically on start-up.

Reply
  • There is also an additional solution that has not been mentioned yet, and that is to place services or characteristics in user-space. This is done by setting the VLOC field to BLE_GATTS_VLOC_USER where applicable. The documentation has this comment:

    "Attribute Value is located in user memory. This requires the user to maintain a valid buffer through the lifetime of the attribute, since the stack will read and write directly to the memory using the pointer provided in the APIs. (...)"

    Remember that this must be done for any user_desc/CCCDs/SCCDs as well, or you will eventually run out of stack-reserved RAM. In S110 8.0.0 you can, as mentioned earlier, reduce or increase reserved space dynamically on start-up.

Children
No Data
Related