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

nrf52833 NRF_ERROR_NO_MEM

Hello, 

I am using the UBLOX EVK-NINA-B406, which has the nrf52833. I have attempted to use Softdevice S140 and S113 (using the nrfConnect programmer. Soft device versions 7.0.1). Below is a minimal self contained example to demonstrate my issue, using the Softdevice S113 

If the main method in NRF5SDK  (version 16) /examples/ble_peripheral/ble_app_uart/pca10100/s113/ses/main.c. I have added the necessary includes and the fault handler. 

#include "assert.h"
#include "nrf_sdm.h"
static void sd_fault_handler(uint32_t id, uint32_t pc, uint32_t info)
{
  while (1){};
}
/**@brief Application main function.
 */
int main(void)
{
   SystemCoreClockUpdate();

  uint32_t err_code = 0;

  const nrf_clock_lf_cfg_t clk_cfg = {
    .source = NRF_CLOCK_LF_SRC_RC,
    .rc_ctiv = 16, // Interval in 0.25 s, 16 * 0.25 = 4 sec
    .rc_temp_ctiv = 2, // Check temperature every .rc_ctiv, but calibrate every .rc_temp_ctiv 
    .accuracy = 0,
  };

  err_code = sd_softdevice_enable(&clk_cfg, sd_fault_handler);
  assert(err_code == NRF_SUCCESS);

   // register for interrupts
  sd_nvic_EnableIRQ(SD_EVT_IRQn);

  uint32_t ram_base = 0x20000000;
  err_code = sd_ble_enable(&ram_base);
  assert(err_code == NRF_SUCCESS);

    // Enter main loop.
    for (;;)
    {
        idle_state_handle();
    }
}

Line 29 - sd_ble_enable, returns NRF_ERROR_NO_MEM and sets ram_base to some hex number (0x20001058). I changed to project configuration to use that number as RAM_START, and updated RAM_SIZE accordingly (0x1efa8). I run the example again and get the same error. What could be the problem and how to fix it?

I have attached my linker section data from the .emProject file for reference

 linker_section_placement_file="flash_placement.xml"
 linker_section_placement_macros="FLASH_PH_START=0x0;FLASH_PH_SIZE=0x80000;RAM_PH_START=0x20000000;RAM_PH_SIZE=0x20000;FLASH_START=0x1c000;FLASH_SIZE=0x64000;RAM_START=0x20001058;RAM_SIZE=0x1efa8"
 linker_section_placements_segments="FLASH RX 0x0 0x80000;RAM RWX 0x20000000 0x20000"

Related