Assert Tracker Build Failure (Building for the First Time)

Can someone help me with the best way to fix my build failure? I am building this (as is) for the first time, and I cant find the ld or implementation for "z_impl_k_sem_give" called from the kernel. 

[160/170] Linking C executable zephyr/zephyr_pre0.elf
FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map 
: && ccache /opt/nordic/ncs/toolchains/v2.2.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc  -gdwarf-4 zephyr/CMakeFiles/zephyr_pre0.dir/misc/empty_file.c.obj -o zephyr/zephyr_pre0.elf  -fuse-ld=bfd  -Wl,-T  zephyr/linker_zephyr_pre0.cmd  -Wl,-Map=/Users/mrnwiyi/Projects/nRF91/asset_tracker_v2/build/b0/zephyr/zephyr_pre0.map  -Wl,--whole-archive  app/libapp.a  zephyr/libzephyr.a  zephyr/arch/common/libarch__common.a  zephyr/arch/arch/arm/core/aarch32/libarch__arm__core__aarch32.a  zephyr/arch/arch/arm/core/aarch32/cortex_m/libarch__arm__core__aarch32__cortex_m.a  zephyr/arch/arch/arm/core/aarch32/cortex_m/cmse/libarch__arm__core__aarch32__cortex_m__cmse.a  zephyr/lib/libc/minimal/liblib__libc__minimal.a  zephyr/boards/boards/arm/thingy91_nrf9160/lib..__nrf__boards__arm__thingy91_nrf9160.a  zephyr/drivers/clock_control/libdrivers__clock_control.a  zephyr/drivers/console/libdrivers__console.a  zephyr/drivers/i2c/libdrivers__i2c.a  zephyr/drivers/serial/libdrivers__serial.a  zephyr/drivers/timer/libdrivers__timer.a  zephyr/drivers/pinctrl/libdrivers__pinctrl.a  modules/nrf/lib/fprotect/lib..__nrf__lib__fprotect.a  modules/nrf/lib/fatal_error/lib..__nrf__lib__fatal_error.a  modules/nrf/subsys/bootloader/bl_boot/lib..__nrf__subsys__bootloader__bl_boot.a  modules/nrf/subsys/bootloader/bl_crypto/lib..__nrf__subsys__bootloader__bl_crypto.a  modules/nrf/subsys/bootloader/bl_validation/lib..__nrf__subsys__bootloader__bl_validation.a  modules/nrf/subsys/bootloader/bl_storage/lib..__nrf__subsys__bootloader__bl_storage.a  modules/nrf/subsys/fw_info/lib..__nrf__subsys__fw_info.a  modules/nrf/drivers/hw_cc310/lib..__nrf__drivers__hw_cc310.a  modules/hal_nordic/nrfx/libmodules__hal_nordic__nrfx.a  -Wl,--no-whole-archive  zephyr/kernel/libkernel.a  zephyr/CMakeFiles/offsets.dir/./arch/arm/core/offsets/offsets.c.obj  -L"/opt/nordic/ncs/toolchains/v2.2.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/thumb/v8-m.main+fp/hard"  -L/Users/mrnwiyi/Projects/nRF91/asset_tracker_v2/build/b0/zephyr  -lgcc  zephyr/arch/common/libisr_tables.a  /opt/nordic/ncs/v2.2.0/nrfxlib/crypto/nrf_oberon/lib/cortex-m33/hard-float/liboberon_3.0.12.a  /opt/nordic/ncs/v2.2.0/nrfxlib/crypto/nrf_cc310_bl/lib/cortex-m33/hard-float/no-interrupts/libnrf_cc310_bl_0.9.12.a  -no-pie  -mcpu=cortex-m33  -mthumb  -mabi=aapcs  -mfpu=fpv5-sp-d16  -mfloat-abi=hard  -mfp16-format=ieee  -Wl,--gc-sections  -Wl,--build-id=none  -Wl,--sort-common=descending  -Wl,--sort-section=alignment  -Wl,-u,_OffsetAbsSyms  -Wl,-u,_ConfigAbsSyms  -nostdlib  -static  -Wl,-X  -Wl,-N  -Wl,--orphan-handling=warn  /opt/nordic/ncs/v2.2.0/nrfxlib/crypto/nrf_cc310_platform/lib/cortex-m33/hard-float/no-interrupts/libnrf_cc310_platform_0.9.16.a && cd /Users/mrnwiyi/Projects/nRF91/asset_tracker_v2/build/b0/zephyr && /opt/nordic/ncs/toolchains/v2.2.0/Cellar/cmake/3.20.5/bin/cmake -E echo
/opt/nordic/ncs/toolchains/v2.2.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/drivers/i2c/libdrivers__i2c.a(i2c_nrfx_twim.c.obj): in function `k_sem_give':
/Users/mrnwiyi/Projects/nRF91/asset_tracker_v2/build/b0/zephyr/include/generated/syscalls/kernel.h:1062: undefined reference to `z_impl_k_sem_give'
/opt/nordic/ncs/toolchains/v2.2.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/drivers/i2c/libdrivers__i2c.a(i2c_nrfx_twim.c.obj): in function `k_sem_take':
/Users/mrnwiyi/Projects/nRF91/asset_tracker_v2/build/b0/zephyr/include/generated/syscalls/kernel.h:1045: undefined reference to `z_impl_k_sem_take'
/opt/nordic/ncs/toolchains/v2.2.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/../../../../arm-zephyr-eabi/bin/ld.bfd: /Users/mrnwiyi/Projects/nRF91/asset_tracker_v2/build/b0/zephyr/include/generated/syscalls/kernel.h:1045: undefined reference to `z_impl_k_sem_take'
/opt/nordic/ncs/toolchains/v2.2.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/../../../../arm-zephyr-eabi/bin/ld.bfd: /Users/mrnwiyi/Projects/nRF91/asset_tracker_v2/build/b0/zephyr/include/generated/syscalls/kernel.h:1045: undefined reference to `z_impl_k_sem_take'
/opt/nordic/ncs/toolchains/v2.2.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/drivers/i2c/libdrivers__i2c.a(i2c_nrfx_twim.c.obj): in function `k_sem_give':
/Users/mrnwiyi/Projects/nRF91/asset_tracker_v2/build/b0/zephyr/include/generated/syscalls/kernel.h:1062: undefined reference to `z_impl_k_sem_give'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
[73/472] Generating include/generated/syscall_dispatch.c, include/generated/syscall_list.h
FAILED: modules/nrf/samples/b0_subimage-prefix/src/b0_subimage-stamp/b0_subimage-build b0/zephyr/zephyr.hex b0/zephyr/zephyr.elf 
cd /Users/mrnwiyi/Projects/nRF91/asset_tracker_v2/build/b0 && /opt/nordic/ncs/toolchains/v2.2.0/Cellar/cmake/3.20.5/bin/cmake --build . --
[75/472] Generating ../../tfm/CMakeCache.txt
-- The C compiler identification is GNU 12.1.0
-- The ASM compiler identification is GNU
-- Found assembler: /opt/nordic/ncs/toolchains/v2.2.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
-- Found Python3: /opt/nordic/ncs/toolchains/v2.2.0/bin/python3.9 (found version "3.9.6") found components: Interpreter 
-- Found Python3: /opt/nordic/ncs/toolchains/v2.2.0/bin/python3.9 (found suitable exact version "3.9.6") found components: Interpreter 
-- Cache files will be written to: /Users/mrnwiyi/Library/Caches/zephyr
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/mrnwiyi/Projects/nRF91/asset_tracker_v2/build/tfm
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: /opt/nordic/ncs/toolchains/v2.2.0/bin/cmake --build /Users/mrnwiyi/Projects/nRF91/asset_tracker_v2/build


Cheers.

Parents
  • Hi Cnwiyi,

    cnwiyi said:

    Toolchain v1.2.1 and nRF Connect SDK v2.2.0

    What do you mean by this? Are you not using the same toolchain as the SDK version?

    1) Can you update SDK and toolchain and start by building other samples first?

    2) Next, build the sample by first choosing SDK and Toolchain from the welcome page and then "create a new application" and selecting asset tracker from samples. For the time being, do not select "enable debug options" in the "edit build configuration".

    If it is still not successful, can you try repeating the step 2 for ncs v2.0.0 for example.

  • Hello,

    Thanks for your help. 

    I tried downgrading to v2.0.0 and built for both thingy91_nrf9160 and thingy91_nrf9160_ns. Both failed based on configuration errors:

    -- Configuring incomplete, errors occurred!
    CMake Error at /opt/nordic/ncs/v2.0.0/nrf/cmake/multi_image.cmake:409 (message):
      CMake generation for spm failed, aborting.  Command: 1
    Call Stack (most recent call first):
      /opt/nordic/ncs/v2.0.0/nrf/cmake/multi_image.cmake:150 (add_child_image_from_source)
      /opt/nordic/ncs/v2.0.0/nrf/samples/CMakeLists.txt:41 (add_child_image)
    
    
    -- Configuring incomplete, errors occurred!
    See also "/Users/mrnwiyi/Projects/nRF91/asset_tracker_v2/build/CMakeFiles/CMakeOutput.log".
    See also "/Users/mrnwiyi/Projects/nRF91/asset_tracker_v2/build/CMakeFiles/CMakeError.log".
    FATAL ERROR: command exited with status 1: /opt/nordic/ncs/toolchains/v2.0.0/bin/cmake -DWEST_PYTHON=/opt/nordic/ncs/toolchains/v2.0.0/bin/python3 -B/Users/mrnwiyi/Projects/nRF91/asset_tracker_v2/build -S/Users/mrnwiyi/Projects/nRF91/asset_tracker_v2 -GNinja -DBOARD=thingy91_nrf9160_ns -DNCS_TOOLCHAIN_VERSION:STRING=NONE -DBOARD_ROOT:STRING=/Users/mrnwiyi/Projects/nRF91/asset_tracker_v2
    
     

    In regards to the version I provided, they were from the app but to answer your question they are both the same. See below:

    I also did try updating the SDK and toolchain, but still got the first error. 

Reply
  • Hello,

    Thanks for your help. 

    I tried downgrading to v2.0.0 and built for both thingy91_nrf9160 and thingy91_nrf9160_ns. Both failed based on configuration errors:

    -- Configuring incomplete, errors occurred!
    CMake Error at /opt/nordic/ncs/v2.0.0/nrf/cmake/multi_image.cmake:409 (message):
      CMake generation for spm failed, aborting.  Command: 1
    Call Stack (most recent call first):
      /opt/nordic/ncs/v2.0.0/nrf/cmake/multi_image.cmake:150 (add_child_image_from_source)
      /opt/nordic/ncs/v2.0.0/nrf/samples/CMakeLists.txt:41 (add_child_image)
    
    
    -- Configuring incomplete, errors occurred!
    See also "/Users/mrnwiyi/Projects/nRF91/asset_tracker_v2/build/CMakeFiles/CMakeOutput.log".
    See also "/Users/mrnwiyi/Projects/nRF91/asset_tracker_v2/build/CMakeFiles/CMakeError.log".
    FATAL ERROR: command exited with status 1: /opt/nordic/ncs/toolchains/v2.0.0/bin/cmake -DWEST_PYTHON=/opt/nordic/ncs/toolchains/v2.0.0/bin/python3 -B/Users/mrnwiyi/Projects/nRF91/asset_tracker_v2/build -S/Users/mrnwiyi/Projects/nRF91/asset_tracker_v2 -GNinja -DBOARD=thingy91_nrf9160_ns -DNCS_TOOLCHAIN_VERSION:STRING=NONE -DBOARD_ROOT:STRING=/Users/mrnwiyi/Projects/nRF91/asset_tracker_v2
    
     

    In regards to the version I provided, they were from the app but to answer your question they are both the same. See below:

    I also did try updating the SDK and toolchain, but still got the first error. 

Children
Related