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

NRF_ERROR_NO_MEM on ble_nus_init

Using SDK15.2 example ble_app_hrs, i need to transfer custom messages and values to the phone app so i want to use ble_nus service, i did everything as in the example ble_app_uart also provided in the SDK, builds fine but when i start the NRF52 DK board i get this error:

<error> app: ERROR 4 [NRF_ERROR_NO_MEM] at C:\nRF5_SDK\examples\ble_peripheral\ble_app_hrs - Copy\main.c:573
PC at: 0x000350E5
<error> app: End of error report

line 573 is:

    err_code = ble_nus_init(&m_nus, &nus_init);
    APP_ERROR_CHECK(err_code);

reading thru the devzone's other similar questions i see that i need to adjust the memory positions or something like that but i dont get which memory positions i should use...

Any help appreciated... Thanks in advance.

Parents Reply Children
  • for further reference for others that will get stuck on this, here is detailed info how to do it...

    edit sdk_config.h and change the NRF_SDH_BLE_VS_UUID_COUNT from 0 to 1

    then when you build and run the application on your board in the serial monitor you will get info to what you should change the memory.

    example:

    <warning> nrf_sdh_ble: Insufficient RAM allocated for the SoftDevice.
    <warning> nrf_sdh_ble: Change the RAM start location from 0x20002B90 to 0x20002B             98.
    <warning> nrf_sdh_ble: Maximum RAM size for application is 0xD468.
    <error> nrf_sdh_ble: sd_ble_enable() returned NRF_ERROR_NO_MEM.
    <error> app: ERROR 4 [NRF_ERROR_NO_MEM] at C:\nRF5_SDK\examples\ble_peripheral\b             le_app_hrs - Copy\main.c:876
    PC at: 0x0003576F
    <error> app: End of error report
    

    right click on the project in the project explorer and choose Options, then choose Common from the left top configurations select drop down menu. In the linker section double click the Section Placement Macros. change the RAM_START and RAM_SIZE to the ones reported in the serial monitor. rebuild your application.

Related