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

Multiple custom service issue in SDK 12.2

I am running NUS and a custom service.

I have updated vs_uuid_count = 2 in softdevice_handler.c

Following other posts on the forum, I have stepped through the code using Eclipse debugger.

The error code returned by sd_ble_enable() is equal to 4.

app_ram_base = 536879416 [0x20002138]

ram_start = 536879400 [0x20002128]

By default, the RAM ORIGIN is 0x20002128 and LENGTH is 0xDED8 in .ld file.

I have changed the RAM ORIGIN to 0x20002138.

However, the error continues to be 4.

Also, how can I get ram_end_address_get() value to calculate the exact length to be allotted for softdevice in RAM?.

Parents
  • When sd_ble_enable() is called in the softdevice_enable() function, the correct RAM settings should be printed. From softdevice_enable() :

    app_ram_base = ram_start;
    NRF_LOG_DEBUG("sd_ble_enable: RAM start at 0x%x\r\n",
                    app_ram_base);
    err_code = sd_ble_enable(p_ble_enable_params, &app_ram_base);
    
    if (app_ram_base != ram_start)
    {
        NRF_LOG_WARNING("sd_ble_enable: RAM start should be adjusted to 0x%x\r\n",
                app_ram_base);
        NRF_LOG_WARNING("RAM size should be adjusted to 0x%x \r\n",
                ram_end_address_get() - app_ram_base);
    }
    else if (err_code != NRF_SUCCESS)
    {
        NRF_LOG_ERROR("sd_ble_enable: error 0x%x\r\n", err_code);
    }
    
Reply
  • When sd_ble_enable() is called in the softdevice_enable() function, the correct RAM settings should be printed. From softdevice_enable() :

    app_ram_base = ram_start;
    NRF_LOG_DEBUG("sd_ble_enable: RAM start at 0x%x\r\n",
                    app_ram_base);
    err_code = sd_ble_enable(p_ble_enable_params, &app_ram_base);
    
    if (app_ram_base != ram_start)
    {
        NRF_LOG_WARNING("sd_ble_enable: RAM start should be adjusted to 0x%x\r\n",
                app_ram_base);
        NRF_LOG_WARNING("RAM size should be adjusted to 0x%x \r\n",
                ram_end_address_get() - app_ram_base);
    }
    else if (err_code != NRF_SUCCESS)
    {
        NRF_LOG_ERROR("sd_ble_enable: error 0x%x\r\n", err_code);
    }
    
Children
No Data
Related