Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

NRF_ERROR_NO_MEM during call to sd_ble_uuid_vs_add

I can use standard UUIDs and successfully add a Service and several characteristics, so I think the error message above is a red herring. When I attempt to create a custom UUID (since none of the BLE-standardized UUIDs actually fit my application), I get the above error returned from the call to  sd_ble_uuid_vs_add. I have plenty of memory, and indeed the linker offers that it has more than enough:

<warning> nrf_sdh_ble: RAM starts at 0x20005668, can be adjusted to 0x200020E0.
<warning> nrf_sdh_ble: RAM size can be adjusted to 0xDF20.
<error> app: ERROR 4 [NRF_ERROR_NO_MEM] at GlucoseControl.c:170

The above function call traces to an SVCALL macro and there the trail goes cold, so I can't even see what's really happening inside the function. Surely I'm not the only one who has tried following the tutorial at https://devzone.nordicsemi.com/tutorials/b/bluetooth-low-energy/posts/ble-characteristics-a-beginners-tutorial. What am i missing?

  • Have you tried to change the RAM settings, according to the warnings from the log? It is done a bit differently in different IDEs. What do you use? Keil, SES, IAR or gcc with the plain makefile?

     

    It is usually found inside the IDEs project settings for your project. For armgcc you will change these settings in the .ld file located in the same folder as your makefile.

     

    The reason for this return is that when you use custom UUIDs, which are longer than the BLE SIG UUIDs, you must reserve more space for the softdevice. 

    In keil, you change these settings in the project settings, as you can see in the attached screenshot.

     

    Best regards,

    Edvin

  • I have previously tried changing the RAM settings as suggested, to no avail. I am leaving the office now for the rest of the day, but can try that again tomorrow morning or possibly late tonight. Any other suggestions?

  • Well, it looks like it is the root of the issue. I don't know how much other you have changed in the example, but the RAM settings works dynamically, and will let you know if you should change these settings.

     

    If this doesn't solve the issue, check what function you call right before line 170 (probably 169) in GlucoseControl.c (This is a file you created yourself, right?)

     

    If it is an sd_... call, check infocenter what different values this call may return, and what they mean. You will find this information in the SDK as well, if you do a "find all" and search for this sd_ call. It should be described around a line where it says "SVCALL(SD_..."

     

    Best regards,

    Edvin

  • That is, you must find out what function that returned the err_code that is used in APP_ERROR_CHECK(err_code) on line 170 in GlucoseControl.c.

  • I had a similar issue when going through this tutorial:
    devzone.nordicsemi.com/.../ble-services-a-beginners-tutorial

    Even after increasing the Ram ORIGIN and LENGTH in my .ld file, I still got the error.  In the end, I found that it was adding another custom base UUID (it was buried in NUS_BASE_UUID in ble_nus.c, which is the example I was adapting for my program), so then when I tried to add my own custom base UUID, it was running out of memory.

    In the end, I changed NUS_BASE_UUID to match BLE_UUID_OUR_BASE_UUID, and that fixed the issue.

Related