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

Eclipse GCC: Unable to run two custom services (experimental buttonless DFU and experimental app ble blinky) on SDK 12

We are able to run both these services (experimental buttonless DFU and experimental app ble blinky) individually in Eclipse GCC, SDK 12. However, when both of the services are combined, nrf is stuck at softdevice_enable(&ble_enable_params) function.

We have already modified the p_ble_enable_params->common_enable_params.vs_uuid_count to 2. We are unable to decide the next steps to resolve this. Any help would be great. :)

  • We found that the exact error is at:

    err_code = sd_ble_enable(p_ble_enable_params, &app_ram_base);

    if (app_ram_base != ram_start)
    {
        NRF_LOG_WARNING("sd_ble_enable: app_ram_base 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);
    }
    
    return err_code;
    

    Thus, in main.c, APP_ERROR_CHECK(err_code) is causing the nrf to restart. How do we resolve this? Thank you.

  • well look up the error code and find out what it's telling you the error is, then fix the error.

  • Thanks for your response. Could you suggest how to read error code? However, the effect of the error is that nrf restarts constantly, after the command APP_ERROR_CHECK(err_code).

  • stop it with a debugger, look at the error code before APP_ERROR_CHECK() checks it.

  • err_code = 5 from the function 'softdevice_enable(&ble_enable_params);' and its same err_code from function sd_ble_enable(p_ble_enable_params, &app_ram_base) in softdevice_handler.c.

    At the end it resets the nrf from function NVIC_SystemReset(); in __WEAK void app_error_fault_handler(uint32_t id, uint32_t pc, uint32_t info) in app_error_weak.c.

    I think its related to RAM , here is my linker script

    /* Linker script to configure memory regions. */

    SEARCH_DIR(.) GROUP(-lgcc -lc -lnosys)

    MEMORY { FLASH (rx) : ORIGIN = 0x1b000, LENGTH = 0x25000 /RAM (rwx) : ORIGIN = 0x20001fe8, LENGTH = 0x6018/ RAM (rwx) : ORIGIN = 0x20001fe8, LENGTH = 0x6018 /** Location of bootloader setting in flash. */ BOOTLOADER_SETTINGS (rw) : ORIGIN = 0x0003FC00, LENGTH = 0x1000

    }

    SECTIONS { /* Place the bootloader settings page in flash. */ .bootloaderSettings(NOLOAD) : {

    } > BOOTLOADER_SETTINGS

    .fs_data : { PROVIDE(__start_fs_data = .); KEEP(*(.fs_data)) PROVIDE(__stop_fs_data = .); } > RAM } INSERT AFTER .data;

    INCLUDE "nrf5x_common.ld"

    Thank you

Related