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

MacOS SDK 1.1 linking problems

Hi,

All was working on SDK 1.0. Now I have SDK 1.1 and new Segger and new nRF Connect and gnuarmbemb (I had a new computer, so did set up everything from scratch)

2> Compiling ‘isr_tables.c’
1> Remove /Users/slava/work/nordic/ncs/nrf/samples/nrf9160/gps/build_nrf9160_pca10090ns/spm/zephyr/zephyr.elf
1> Linking ‘zephyr.elf’
1> Post-link command 
Build failed

However, using west directly is working fine:

➜  gps git:(d3130d77) ✗ west build --board=nrf9160_pca10090ns -d build_nrf9160_pca10090ns
-- west build: build configuration:
       source directory: /Users/slava/work/nordic/ncs/nrf/samples/nrf9160/gps
       build directory: /Users/slava/work/nordic/ncs/nrf/samples/nrf9160/gps/build_nrf9160_pca10090ns
       BOARD: nrf9160_pca10090ns (origin: CMakeCache.txt)
-- west build: building application
[0/1] Re-running CMake...
-- Using application from '/Users/slava/work/nordic/ncs/nrf/samples/nrf9160/gps'
Zephyr version: 2.0.99
...
...
-- Build files have been written to: /Users/slava/work/nordic/ncs/nrf/samples/nrf9160/gps/build_nrf9160_pca10090ns
[167/295] Linking C executable spm/zephyr/spm_zephyr_prebuilt.elf
Memory region         Used Size  Region Size  %age Used
           FLASH:         32 KB        48 KB     66.67%
            SRAM:        5424 B        64 KB      8.28%
        IDT_LIST:          40 B         2 KB      1.95%
[289/295] Linking C executable zephyr/zephyr_prebuilt.elf
Memory region         Used Size  Region Size  %age Used
           FLASH:      113980 B       976 KB     11.40%
            SRAM:       19644 B       128 KB     14.99%
        IDT_LIST:         120 B         2 KB      5.86%
[295/295] Generating zephyr/merged.hex
Merged /Users/slava/work/nordic/ncs/nrf/samples/nrf9160/gps/build_nrf9160_pca10090ns/spm/zephyr/zephyr.hex
Merged /Users/slava/work/nordic/ncs/nrf/samples/nrf9160/gps/build_nrf9160_pca10090ns/zephyr/zephyr.hex

Not sure where to look anymore or how to get more precise and details error mesage...

Parents
  • Hi!

    I don't understand what you're having issues with. Using west directly works fine, but what is it you're trying that doesn't work?

    Best regards,

    Heidi

  • Ok I found what's wrong.


    First I had to enable "Echo Build Command lines" in "Tools -> Options -> Building"

    Then you can see in the log:

    2> Compiling ‘isr_tables.c’
    2> /opt/gnuarmemb/bin/arm-none-eabi-gcc -DABI_INFO_MAGIC=0x281ee6de,0xb845acea,23297 -DBUILD_VERSION=v2.0.99-ncs1 -DFIRMWARE_INFO_MAGIC=0x281ee6de,0x8fcebb4c,23297 -DKERNEL -DMBEDTLS_CONFIG_FILE="nrf-config.h" -DNRF9160_XXAA -DUSE_PARTITION_MANAGER=1 -D_FORTIFY_SOURCE=2 -D__PROGRAM_START -D__ZEPHYR__=1 -I/Users/slava/work/nordic/ncs/zephyr/kernel/include -I/Users/slava/work/nordic/ncs/zephyr/arch/arm/include -I/Users/slava/work/nordic/ncs/zephyr/include -I/Users/slava/work/nordic/ncs/zephyr/include/drivers -Ispm/zephyr/include/generated -I/Users/slava/work/nordic/ncs/zephyr/soc/arm/nordic_nrf/nrf91 -I/Users/slava/work/nordic/ncs/zephyr/ext/hal/cmsis/Include -I/Users/slava/work/nordic/ncs/nrf/include -I/Users/slava/work/nordic/ncs/nrfxlib/crypto/nrf_cc310_mbedcrypto/include/mbedtls -I/Users/slava/work/nordic/ncs/nrfxlib/crypto/nrf_cc310_mbedcrypto/include -Ispm/zephyr/modules/nrfxlib/nrf_security/include -Ispm/zephyr/modules/nrfxlib/nrf_security/include/mbedtls_generated -I/Users/slava/work/nordic/ncs/mbedtls/include -I/Users/slava/work/nordic/ncs/mbedtls/include/mbedtls -I/Users/slava/work/nordic/ncs/modules/hal/nordic/nrfx -I/Users/slava/work/nordic/ncs/modules/hal/nordic/nrfx/drivers/include -I/Users/slava/work/nordic/ncs/modules/hal/nordic/nrfx/mdk -I/Users/slava/work/nordic/ncs/modules/hal/nordic/. -isystem /Users/slava/work/nordic/ncs/zephyr/lib/libc/minimal/include -isystem /opt/gnuarmemb/bin/../lib/gcc/arm-none-eabi/8.3.1/include -isystem /opt/gnuarmemb/bin/../lib/gcc/arm-none-eabi/8.3.1/include-fixed -isystem /Users/slava/work/nordic/ncs/nrfxlib/crypto/nrf_cc310_platform/include -Os -imacros/Users/slava/work/ozark-iot/ozark-mesh-gateway/build_nrf9160_pca10090ns/spm/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -mthumb -mcpu=cortex-m33 -mfpu=fpv5-sp-d16 -mfloat-abi=hard -imacros/Users/slava/work/nordic/ncs/zephyr/include/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -fno-pie -fno-pic -fno-strict-overflow -fno-reorder-functions -fno-defer-pop -fmacro-prefix-map=/Users/slava/work/ozark-iot/ozark-mesh-gateway=CMAKE_SOURCE_DIR -fmacro-prefix-map=/Users/slava/work/nordic/ncs/zephyr=ZEPHYR_BASE -ffunction-sections -fdata-sections -mabi=aapcs -march=armv8-m.main+dsp -mcmse -std=c99 -nostdinc -MD -MF /Users/slava/work/ozark-iot/ozark-mesh-gateway/build_nrf9160_pca10090ns/spm/zephyr/CMakeFiles/spm_zephyr_final.dir/isr_tables.c.obj.d -fno-diagnostics-show-caret -o spm/zephyr/CMakeFiles/spm_zephyr_final.dir/isr_tables.c.obj -c spm/zephyr/isr_tables.c
    1> spm/zephyr/zephyr.elf does not exist.
    Building ‘libspmsecureentries.a’ from solution ‘build’ in configuration ‘Common’
    1> Linking ‘zephyr.elf’
    1> /opt/gnuarmemb/bin/arm-none-eabi-gcc spm/zephyr/CMakeFiles/spm_zephyr_final.dir/misc/empty_file.c.obj spm/zephyr/CMakeFiles/spm_zephyr_final.dir/isr_tables.c.obj -Wl,-T spm/zephyr/linker_pass_final.cmd -Wl,-Map=/Users/slava/work/ozark-iot/ozark-mesh-gateway/build_nrf9160_pca10090ns/spm/zephyr/spm_zephyr_final.map -Wl,--whole-archive spm/spm_app/libspm_app.a spm/zephyr/libspm_zephyr.a spm/zephyr/arch/arch/arm/core/libspm_arch__arm__core.a spm/zephyr/arch/arch/arm/core/cortex_m/libspm_arch__arm__core__cortex_m.a spm/zephyr/arch/arch/arm/core/cortex_m/mpu/libspm_arch__arm__core__cortex_m__mpu.a spm/zephyr/lib/libc/minimal/libspm_lib__libc__minimal.a spm/zephyr/lib/posix/libspm_lib__posix.a spm/zephyr/drivers/serial/libspm_drivers__serial.a spm/zephyr/modules/nrf/subsys/fw_info/libspm_..__nrf__subsys__fw_info.a spm/zephyr/modules/nrf/drivers/hw_cc310/libspm_..__nrf__drivers__hw_cc310.a spm/zephyr/modules/nrfxlib/nrf_security/src/mbedtls/libspm_mbedtls_base_vanilla.a spm/zephyr/modules/nordic/libspm_..__modules__hal__nordic.a -Wl,--no-whole-archive spm/zephyr/kernel/libspm_kernel.a spm/zephyr/CMakeFiles/spm_offsets.dir/arch/arm/core/offsets/offsets.c.obj -L/opt/gnuarmemb/bin/../lib/gcc/arm-none-eabi/8.3.1/thumb/v8-m.main+fp/hard -L/Users/slava/work/ozark-iot/ozark-mesh-gateway/build_nrf9160_pca10090ns/spm/zephyr -lgcc /Users/slava/work/nordic/ncs/nrfxlib/crypto/nrf_cc310_mbedcrypto/lib/cortex-m33/hard-float/no-interrupts/libnrf_cc310_mbedcrypto_0.9.1.a /Users/slava/work/nordic/ncs/nrfxlib/crypto/nrf_cc310_platform/lib/cortex-m33/hard-float/no-interrupts/libnrf_cc310_platform_0.9.1.a -mthumb -mcpu=cortex-m33 -mfpu=fpv5-sp-d16 -Wl,--gc-sections -Wl,--build-id=none -Wl,--sort-common=descending -Wl,--sort-section=alignment -u_OffsetAbsSyms -u_ConfigAbsSyms -nostdlib -static -no-pie -Wl,-X -Wl,-N -Wl,--orphan-handling=warn -mabi=aapcs -march=armv8-m.main+dsp -Wl,--out-implib=/Users/slava/work/ozark-iot/ozark-mesh-gateway/build_nrf9160_pca10090ns/libspmsecureentries.a -Wl,--cmse-implib -o spm/zephyr/zephyr.elf
    1> Post-link command 
    1> cmake -E rename spm_zephyr_final.map zephyr.map
    Build failed
    

    I believe the working directory for all build commands is the "build_nrf9160_pca10090ns" directory for the project, so running the command in it from console gives me this:

    ➜  build_nrf9160_pca10090ns git:(master) ✗ cmake -E rename spm_zephyr_final.map zephyr.map
    Error renaming from "spm_zephyr_final.map" to "zephyr.map": No such file or directory

    Looking for a file:

    ➜  build_nrf9160_pca10090ns git:(master) ✗ find . -name "spm_zephyr_final.map"
    ./spm/zephyr/spm_zephyr_final.map

    I believe that the correct command should be:

    cmake -E rename spm/zephyr/spm_zephyr_final.map spm/zephyr/zephyr.map

  • I'm glad you found a solution! I have forwarded this to the developers so they can investigate if it's a general problem. 

    Otso Jousimaa, can you try the same solution and confirm that it fixes it for you as well?

    Best regards,

    Heidi

  • Hello Heidi,

    The "process" for building the binary with that command is a bit complicated. Apparently I need to build binary and let it fail in SES first, then run the CMAKE command and then build it again and it might succeed. Sometimes it doesn't (I don't know why) and I need to rerun the CMAKE and then rebuild again in SES.

Reply Children
No Data
Related