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

Error while linking, trapped in sdk_config hell right now.

Hi,

I am using the SDK to develop a BLE application, I tried to merge two different projects and and I build the project, I have linking issues :

1> Linking ble_app_uart_pca10056_s140.elf
1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.50b/gcc/arm-none-eabi/bin/ld: Output/Debug/Obj/ble_app_uart_pca10056_s140/nrf_log_frontend.o: in function `nrf_cli_backend_cmd_execute':
1> C:\Users\GIT\components\libraries\log\src/nrf_log_frontend.c:1156: undefined reference to `nrf_cli_fprintf'
1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.50b/gcc/arm-none-eabi/bin/ld: Output/Debug/Obj/ble_app_uart_pca10056_s140/nrf_log_frontend.o: in function `log_status':
1> C:\Users\GIT\components\libraries\log\src/nrf_log_frontend.c:1175: undefined reference to `nrf_cli_fprintf'
1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.50b/gcc/arm-none-eabi/bin/ld: C:\Users\GIT\components\libraries\log\src/nrf_log_frontend.c:1177: undefined reference to `nrf_cli_fprintf'
1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.50b/gcc/arm-none-eabi/bin/ld: C:\Users\GIT\components\libraries\log\src/nrf_log_frontend.c:1178: undefined reference to `nrf_cli_fprintf'
1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.50b/gcc/arm-none-eabi/bin/ld: C:\Users\GIT\components\libraries\log\src/nrf_log_frontend.c:1189: undefined reference to `nrf_cli_fprintf'
1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.50b/gcc/arm-none-eabi/bin/ld: Output/Debug/Obj/ble_app_uart_pca10056_s140/nrf_log_frontend.o:C:\Users\GIT\components\libraries\log\src/nrf_log_frontend.c:1262: more undefined references to `nrf_cli_fprintf' follow
1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.50b/gcc/arm-none-eabi/bin/ld: Output/Debug/Obj/ble_app_uart_pca10056_s140/nrf_log_frontend.o: in function `log_cmd_backends_list':
1> C:\Users\GIT\components\libraries\log\src/nrf_log_frontend.c:1429: undefined reference to `nrf_cli_help_print'
1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.50b/gcc/arm-none-eabi/bin/ld: C:\Users\GIT\components\libraries\log\src/nrf_log_frontend.c:1442: undefined reference to `nrf_cli_fprintf'
1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.50b/gcc/arm-none-eabi/bin/ld: C:\Users\GIT\components\libraries\log\src/nrf_log_frontend.c:1449: undefined reference to `nrf_cli_fprintf'
1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.50b/gcc/arm-none-eabi/bin/ld: Output/Debug/Obj/ble_app_uart_pca10056_s140/nrf_log_frontend.o: in function `log_config_load_cmd':
1> C:\Users\GIT\components\libraries\log\src/nrf_log_frontend.c:1515: undefined reference to `nrf_cli_help_print'
1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.50b/gcc/arm-none-eabi/bin/ld: C:\UsersGIT\components\libraries\log\src/nrf_log_frontend.c:1529: undefined reference to `nrf_cli_fprintf'
1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.50b/gcc/arm-none-eabi/bin/ld: Output/Debug/Obj/ble_app_uart_pca10056_s140/nrf_log_frontend.o: in function `log_config_store_cmd':
1> C:\Users\GIT\components\libraries\log\src/nrf_log_frontend.c:1540: undefined reference to `nrf_cli_help_print'
1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.50b/gcc/arm-none-eabi/bin/ld: C:\Users\GIT\components\libraries\log\src/nrf_log_frontend.c:1554: undefined reference to `nrf_cli_fprintf'
1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.50b/gcc/arm-none-eabi/bin/ld: Output/Debug/Obj/ble_app_uart_pca10056_s140/nrf_log_frontend.o: in function `log_cmd':
1> C:\Users\GIT\components\libraries\log\src/nrf_log_frontend.c:1588: undefined reference to `nrf_cli_help_print'
1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.50b/gcc/arm-none-eabi/bin/ld: C:\Users\GIT\components\libraries\log\src/nrf_log_frontend.c:1592: undefined reference to `nrf_cli_fprintf'
1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.50b/gcc/arm-none-eabi/bin/ld: Output/Debug/Obj/ble_app_uart_pca10056_s140/nrf_balloc.o: in function `nrf_balloc_status':
1> C:\Users\GIT\components\libraries\balloc/nrf_balloc.c:81: undefined reference to `nrf_cli_help_print'
1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.50b/gcc/arm-none-eabi/bin/ld: C:\Users\GIT\components\libraries\balloc/nrf_balloc.c:87: undefined reference to `nrf_cli_fprintf'
1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.50b/gcc/arm-none-eabi/bin/ld: C:\Users\GIT\components\libraries\balloc/nrf_balloc.c:104: undefined reference to `nrf_cli_fprintf'
Build failed

I understand that it is probably my sdk configuration that is wrong but I tried many things and I don't really understand which configuration I have to enable.

EDIT : 

I think I can boil down things to : 

1> Linking ble_app_uart_pca10056_s140.elf
1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.50b/gcc/arm-none-eabi/bin/ld: Output/Debug/Obj/ble_app_uart_pca10056_s140/nrf_balloc.o: in function `nrf_balloc_status':
1> C:\Users\GIT\components\libraries\balloc/nrf_balloc.c:81: undefined reference to `nrf_cli_help_print'
1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.50b/gcc/arm-none-eabi/bin/ld: C:\Users\GIT\components\libraries\balloc/nrf_balloc.c:87: undefined reference to `nrf_cli_fprintf'
1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.50b/gcc/arm-none-eabi/bin/ld: C:\Users\GIT\components\libraries\balloc/nrf_balloc.c:104: undefined reference to `nrf_cli_fprintf'
Build failed

Now the question is "What config do I have to enable to activate nrf_cli_help_fprintf ?"

Thank you.

  • NRF_CLI_ENABLED should be set to 1 in sdk_config.h and nrf_cli.c should be in your project in the compile list.
  • Thank you for your response.

    I managed to solve my problem by painstackingly searching more and more functions to add to the project and the enable them in the sdk.

    I have another problem though, it is related to Asserts in the Softdevice. I am merging two programs : one which uses the softdevice to manage BLE services and a Firmware Application that was developped without the softdevice. I am encountering this function :

    #ifdef SOFTDEVICE_PRESENT
        NRFX_ASSERT(p_instance->p_reg != NRF_TIMER0);
    #endif

    And the brief documentation state that if the softdevice is enabled, the device cannot leave this function until reset. It seems weird because the function is entered when the softdevice is enabled ?

    /**@brief Function for assert macro callback.
    *
    * @details This function will be called in case of an assert in the SoftDevice.
    *
    * @warning This handler is an example only and does not fit a final product. You need to analyse
    * how your product is supposed to react in case of Assert.
    * @warning On assert from the SoftDevice, the system can only recover on reset.
    *
    * @param[in] line_num Line number of the failing ASSERT call.
    * @param[in] p_file_name File name of the failing ASSERT call.
    */
    void assert_nrf_callback(uint16_t line_num, const uint8_t * p_file_name)
    {
        app_error_handler(DEAD_BEEF, line_num, p_file_name);
    }

  • c.tessierpiart said:

    I have another problem though, it is related to Asserts in the Softdevice. I am merging two programs : one which uses the softdevice to manage BLE services and a Firmware Application that was developped without the softdevice. I am encountering this function :

    #ifdef SOFTDEVICE_PRESENT
        NRFX_ASSERT(p_instance->p_reg != NRF_TIMER0);
    #endif

    When you have enabled the softdevice, these peripherals are unavailable to the application for the direct access. In your case, you should use a different timer instance other than timer 0 (Use Timer 1 for example).

  • Thank you. It solved the issue concerning the timer.

Related