This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

NRF_ERROR_NO_MEM

Hi,

I'm developing a FW with a lot of services and characteristics. Since I added the ANCS service, I have the "NRF_ERROR_NO_MEM".

Configuration : NRF51822_XXAC / S130 V2 / custom secure bootloader + DFU / Segger embedded studio / bootloader setting file to allow programing without DFU.

Section placement macro (Embedded studio) : FLASH_START=0x1b000 SRAM_START=0x20002008

I read a lot of things about this error : increase the size of the gatt table, adding "BLE_GATTS_VLOC_USER"...

Like explained on the migration guide, I checked the expected RAM size. The debug result is described below :

SDH:DEBUG:sd_ble_enable: RAM start at 0x20002008 SDH:DEBUG:RAM size should be adjusted to 0x5ff8 SDH:DEBUG:sd_ble_enable: RAM start should be adjusted to 0x20002008 :INFO:running nrf_dfu_settings_init APP:INFO:app_error_fault_handler : id=0x00004001, pc=0x00000000, info=0x20007f64 APP:INFO:err_code 00000004 in line 298 of XXXANCS/ble/ble_services.c APP:INFO:-> NRF_ERROR_BASE_NUM

I changed the SRAM size and attr_tab_size but after that, the application doesn't start like if the bootloader doesn't know where to find the application start address. Do I have to change something in the bootloader or something else that I missed?

Thank you

  • Which SDK version are you using, is it SDK v12.x.x? Which function returns NRF_ERROR_NO_MEM? Is it sd_ble_gatts_service_add() or sd_ble_gatts_characteristic_add()?

    If it is one of those two functions then you need to increase the size of the GATT table by setting the .attr_tab_size field of ble_enable_params.gatts_enable_params in ble_stack_init(), e.g.

    ble_enable_params.gatts_enable_params.attr_tab_size = 0x1000;
    

    Otherwise if will be set equal to SOFTDEVICE_GATTS_ATTR_TAB_SIZE == BLE_GATTS_ATTR_TAB_SIZE_DEFAULT == 0x000 which causes the SoftDevice to use the default GATT table size which is 0x580 bytes for S130 v2.x.x.

  • We are using SDK 12.3.0.

    I already change the size of the GATTT table but after that, the application doesn't start. Like if the bootloader was lost or with the wrong starting address. Any idea of what could be the problem?

  • Could you post the ROM and RAM settings for the application? Are you able to debug the bootloader, i.e. see that it reaches nrf_bootloader_app_start(MAIN_APPLICATION_START_ADDR) in nrf_dfu_init() in nrf_dfu.c? If this is the case then you should be able to debug the application.

  • More details about the NRF_ERROR_NO_MEM error source. This one is happening when the sd_ble_uuid_vs_add(&ble_ancs_cp_base_uuid128, &p_ancs->service.control_point_char.uuid.type) is called. I saw some topics about modifying the VS_UUID count.

    If I change SRAM_START, attribute table size or VS_UUID count, it seems that the App doesn't start. The actual bootloader is a release and there is no debug function. I have to activate NRF_LOG to debug. I'm on it but I have some compiling issues with the makefile that I have to fix...

    The placement macro in Segger embedded studio is : FLASH_START=0x1b000 SRAM_START=0x20002008

    Do you need more information ?

  • So you're able to debug the application since you have identified sd_ble_uuid_vs_add as the source of the error code? What is the VS_UUID count and what is the attribute table size?

Related