[SOLVED] Keil MDK v5.25 Project Import Fails - RelLinkerScriptPath

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] Keil MDK v5.25 Project Import Fails - RelLinkerScriptPath

    After importing a Keil MDK v5.25 Project (for Nordic nRF52832) and then trying to build the 'External' configuration.

    In fact, there were a couple of other failures:
    1. The path to the CMSIS headers - core_cm4.h etc - was not added;
    2. The --c99 option was not added.
    But, having fixed them, I am stuck with the Link failing:

    The Linker wrote:

    L6031U: Could not open scatter description file $(RelLinkerScriptPath): No such file or directory

    So 2 questions:
    1. Where can I see what RelLinkerScriptPath is actually set to?
    2. How can I edit that to correct it?


    Help > About wrote:

    SEGGER Embedded Studio for ARM
    Release 3.40 Build 2018052200.36079
    Windows x64

    © 2014-2018 SEGGER Microcontroller GmbH
    © 1997-2018 Rowley Associates Ltd.

    GCC/BINUTILS: Built using the GNU ARM Embedded Toolchain version 7-2017-q4-major source distribution


    Clang/LLVM: Built using the version 6.0.0 source distributio
  • If I do 'Open Solution in Editor', I see:
    external_link_command=""$(KEIL_TOOLKIT_DIR)/ARMCC/bin/armlink" $(LinkOptions) --scatter="$(RelLinkerScriptPath)" $(Objects) -o "$(RelTargetPath)" --list "$(RelMapPath)" --map"

    In the build output, I see:
    Linking ‘nrf52832_xxaa.axf’



    C:/bin/Keil/MDK/525/ARM/ARMCC/bin/armlink --cpu cortex-m4 --fpu fpv4-sp --diag_suppress 6330 --scatter=$(RelLinkerScriptPath) ./_build/main.o ./_build/host_comms.o ./_build/peripherals.o ./_build/timestamp.o ./_build/persist.o ./_build/boards.o ./_build/bsp.o ./_build/bsp_btn_ble.o ./_build/ble_advdata.o ./_build/ble_db_discovery.o ./_build/ble_srv_common.o ./_build/nrf_ble_gatt.o ./_build/ble_conn_state.o ./_build/ble_nus_c.o ./_build/nrf_drv_clock.o ./_build/nrf_drv_uart.o ./_build/nrfx_clock.o ./_build/nrfx_gpiote.o ./_build/nrfx_power_clock.o ./_build/nrfx_prs.o ./_build/nrfx_uart.o ./_build/nrfx_uarte.o ./_build/app_button.o ./_build/app_error.o ./_build/app_error_handler_keil.o ./_build/app_error_weak.o ./_build/app_fifo.o ./_build/app_scheduler.o ./_build/app_timer.o ./_build/app_uart_fifo.o ./_build/app_util_platform.o ./_build/hardfault_implementation.o ./_build/nrf_assert.o ./_build/nrf_atfifo.o ./_build/nrf_atomic.o ./_build/nrf_balloc.o ./_build/nrf_fprintf.o ./_build/nrf_fprintf_format.o ./_build/nrf_memobj.o ./_build/nrf_pwr_mgmt.o ./_build/nrf_section_iter.o ./_build/nrf_strerror.o ./_build/retarget.o ./_build/nrf_atflags.o ./_build/nrf_fstorage.o ./_build/nrf_fstorage_sd.o ./_build/nrf_log_backend_rtt.o ./_build/nrf_log_backend_serial.o ./_build/nrf_log_default_backends.o ./_build/nrf_log_frontend.o ./_build/nrf_log_str_formatter.o ./_build/SEGGER_RTT.o ./_build/SEGGER_RTT_Syscalls_KEIL.o ./_build/SEGGER_RTT_printf.o ./_build/nrf_sdh.o ./_build/nrf_sdh_ble.o ./_build/nrf_sdh_soc.o -o ./_build/nrf52832_xxaa.axf --list _build/nrf52832_xxaa.map --map

    L6031U: Could not open scatter description file $(RelLinkerScriptPath): No such file or directory

    So it looks like it has just passed "$(RelLinkerScriptPath)" literally - instead of expanding it to the required path ?

    ?(
  • If I replace the "$(RelLinkerScriptPath)" macro with the literal scatter file path, the link now fails with
    L6236E: No section matches selector - no section to be FIRST/LAST.
    This seems to be because the import has not imported the original startup file - arm_startup_nrf52.s - but has instead used its own Cortex_M_Startup.s

    But the Scatter file has not been updated to match this change - hence the link error.

    So it would seem that this "import" is fatally flawed and not usable.

    :cursing: :thumbdown:
  • Hello,

    Thank you for your inquiry.
    When importing to Embedded Studio using the import wizard only files will be copied over that are directly referenced in the Keil project.
    All additional files like CMSIS and RTOS files that you have enabled through the package manager in Keil will most likely not be referenced directly so Embedded Studio can't copy them automatically over. Same goes for Keil specific files that are linked from the Keil installation folder.
    This needs to be done manually in such cases.
    A guide on how to port from a third party IDE to ES can be found here: wiki.segger.com/How_to_port_pr…to_SEGGER_Embedded_Studio
    The guide shows an example for IAR but the troubleshooting points and general procedure apply to Keil as well.

    Are you porting a custom project or one from the Nordic SDK? In the latter case we partnered up with Nordic so you have all SDK examples with a Embedded Studio project, so no porting required.

    awneil wrote:

    This seems to be because the import has not imported the original startup file - arm_startup_nrf52.s - but has instead used its own Cortex_M_Startup.s
    In that case simply add the arm_startup_nrf52 to your project instead of the Cortex_M_Startup.s.

    Best regards,
    Nino
    Please read the forum rules before posting: Forum Rules

    Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support contact us per e-mail.
    Alternatively our support ticketing system can be used as well: segger.com/ticket/
  • Hello,

    awneil wrote:

    Even an unmodified SES project from the Nordic SDK does not work:
    It does not work with 3.40, but Nordic clearly states to use 3.34 with their current SDK. Do that and you are good to go. Future Nordic SDK updates will probably be made available to 3.40 as well.

    awneil wrote:

    What about the "$(RelLinkerScriptPath)" issue?
    Such an issue is not known to us. We will try to reproduce this behaviour and fix it if reproducible.

    Best regards,
    Nino
    Please read the forum rules before posting: Forum Rules

    Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support contact us per e-mail.
    Alternatively our support ticketing system can be used as well: segger.com/ticket/