nrf5340 build fail

I have an nRF5340 and am trying to build the ZSWatch-Zephyr Smartwatch sample for it in VS Code with the nRF Connect extension pack. I've created a new application from the sample and have added a build configuration that looks like so:

I've selected the right target, optimized for debugging, and enabled sysbuild. I have not changed any of the sample files. When I try to build this, I get:

Building app
west build --build-dir f:/ZSwatch/ZSWatch-main/app/build f:/ZSwatch/ZSWatch-main/app --pristine --board nrf5340dk_nrf5340_cpuapp --sysbuild -- -DNCS_TOOLCHAIN_VERSION=NONE -DCONF_FILE=f:/ZSwatch/ZSWatch-main/app/prj.conf -DEXTRA_CONF_FILE=boards/nrf5340dk_nrf5340_cpuapp.conf -DEXTRA_DTC_OVERLAY_FILE=boards/nrf5340dk_nrf5340_cpuapp.overlay -DBOARD_ROOT=f:/zswatch/zswatch-main/app

-- west build: generating a build system
Loading Zephyr module(s) (Zephyr base): extensions sysbuild_extensions python west root zephyr_module boards shields sysbuild_kconfig
-- Found Python3: C:/ncs/V2.5.0/toolchains/c57af46cb7/opt/bin/python.exe (found suitable version "3.8.2", minimum required is "3.8") found components: Interpreter
-- Cache files will be written to: C:/ncs/V2.5.0/v2.5.0/zephyr/.cache
-- Found west (found suitable version "1.1.0", minimum required is "0.14.0")
-- Board: nrf5340dk_nrf5340_cpuapp
Parsing C:/ncs/V2.5.0/v2.5.0/zephyr/share/sysbuild/Kconfig
Loaded configuration 'F:/ZSwatch/ZSWatch-main/app/build/empty.conf'
Merged configuration 'F:/ZSwatch/ZSWatch-main/app/build/empty.conf'
Merged configuration 'F:/ZSwatch/ZSWatch-main/app/build/empty.conf'
Configuration saved to 'F:/ZSwatch/ZSWatch-main/app/build/zephyr/.config'
Kconfig header saved to 'F:/ZSwatch/ZSWatch-main/app/build/autoconf.h'
--
*************************
* Running CMake for app *
*************************

Loading Zephyr default modules (Zephyr base).
-- Application: F:/ZSwatch/ZSWatch-main/app
-- CMake version: 3.20.5
-- Using NCS Toolchain 2.5.20231017.848171396279 for building. (C:/ncs/V2.5.0/toolchains/c57af46cb7/cmake)
CMake Deprecation Warning at C:/ncs/V2.5.0/v2.5.0/zephyr/cmake/modules/FindDeprecated.cmake:121 (message):
'PYTHON_PREFER' variable is deprecated. Please use Python3_EXECUTABLE
instead.
Call Stack (most recent call first):
C:/ncs/V2.5.0/v2.5.0/zephyr/cmake/modules/python.cmake:16 (find_package)
C:/ncs/V2.5.0/v2.5.0/zephyr/cmake/modules/zephyr_default.cmake:129 (include)
C:/ncs/V2.5.0/v2.5.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
C:/ncs/V2.5.0/v2.5.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
CMakeLists.txt:30 (find_package)


-- Found Python3: C:/ncs/V2.5.0/toolchains/c57af46cb7/opt/bin/python.exe (found suitable version "3.8.2", minimum required is "3.8") found components: Interpreter
-- Cache files will be written to: C:/ncs/V2.5.0/v2.5.0/zephyr/.cache
-- Zephyr version: 3.4.99 (C:/ncs/V2.5.0/v2.5.0/zephyr)
-- Found west (found suitable version "1.1.0", minimum required is "0.14.0")
-- Board: nrf5340dk_nrf5340_cpuapp
-- Found host-tools: zephyr 0.16.1 (C:/ncs/V2.5.0/toolchains/c57af46cb7/opt/zephyr-sdk)
-- Found toolchain: zephyr 0.16.1 (C:/ncs/V2.5.0/toolchains/c57af46cb7/opt/zephyr-sdk)
-- Found Dtc: C:/ncs/V2.5.0/toolchains/c57af46cb7/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
-- Found BOARD.dts: C:/ncs/V2.5.0/v2.5.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp.dts
-- Found devicetree overlay: F:/ZSwatch/ZSWatch-main/app/boards/nrf5340dk_nrf5340_cpuapp.overlay
-- Found devicetree overlay: boards/nrf5340dk_nrf5340_cpuapp.overlay
-- Generated zephyr.dts: F:/ZSwatch/ZSWatch-main/app/build/app/zephyr/zephyr.dts
-- Generated devicetree_generated.h: F:/ZSwatch/ZSWatch-main/app/build/app/zephyr/include/generated/devicetree_generated.h
-- Including generated dts.cmake file: F:/ZSwatch/ZSWatch-main/app/build/app/zephyr/dts.cmake
Parsing F:/ZSwatch/ZSWatch-main/app/Kconfig
Loaded configuration 'C:/ncs/V2.5.0/v2.5.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp_defconfig'
Merged configuration 'f:/ZSwatch/ZSWatch-main/app/prj.conf'
Merged configuration 'F:/ZSwatch/ZSWatch-main/app/boards/nrf5340dk_nrf5340_cpuapp.conf'
Merged configuration 'F:/ZSwatch/ZSWatch-main/app/build/app/zephyr/.config.sysbuild'

warning: LV_Z_POINTER_INPUT (defined at modules/lvgl\Kconfig.input:45,
modules\lvgl\Kconfig.input:45) was assigned the value 'y' but got the value 'n'. Check these
unsatisfied dependencies: ((INPUT && DT_HAS_ZEPHYR_LVGL_POINTER_INPUT_ENABLED && LVGL) || (INPUT &&
DT_HAS_ZEPHYR_LVGL_POINTER_INPUT_ENABLED && LVGL && 0)) (=n). See
docs.zephyrproject.org/.../kconfig.html and/or look up
LV_Z_POINTER_INPUT in the menuconfig/guiconfig interface. The Application Development Primer,
Setting Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be
helpful too.


warning: LV_Z_POINTER_INPUT_MSGQ_COUNT (defined at modules/lvgl\Kconfig.input:51,
modules\lvgl\Kconfig.input:51) was assigned the value '200' but got the value ''. Check these
unsatisfied dependencies: ((LV_Z_POINTER_INPUT && LVGL) || (LV_Z_POINTER_INPUT && LVGL && 0)) (=n).
See docs.zephyrproject.org/.../kconfig.html and/or
Configuration saved to 'F:/ZSwatch/ZSWatch-main/app/build/app/zephyr/.config'
Kconfig header saved to 'F:/ZSwatch/ZSWatch-main/app/build/app/zephyr/include/generated/autoconf.h'
look up LV_Z_POINTER_INPUT_MSGQ_COUNT in the menuconfig/guiconfig interface. The Application
Development Primer, Setting Configuration Values, and Kconfig - Tips and Best Practices sections of
the manual might be helpful too.


warning: REGULATOR_FIXED (defined at drivers/regulator/Kconfig.fixed:4) was assigned the value 'y'
but got the value 'n'. Check these unsatisfied dependencies: DT_HAS_REGULATOR_FIXED_ENABLED (=n).
See docs.zephyrproject.org/.../kconfig.html and/or look up
REGULATOR_FIXED in the menuconfig/guiconfig interface. The Application Development Primer, Setting
Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be helpful
too.


warning: Experimental symbol BT_DF is enabled.

-- Found GnuLd: c:/ncs/v2.5.0/toolchains/c57af46cb7/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe (found version "2.38")
-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- The ASM compiler identification is GNU
-- Found assembler: C:/ncs/V2.5.0/toolchains/c57af46cb7/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
-- libmetal version: 1.4.0 (F:/ZSwatch/ZSWatch-main/app)
-- Build type:
-- Host: Windows/AMD64
-- Target: Generic/arm
-- Machine: arm
-- Looking for include file stdatomic.h
-- Looking for include file stdatomic.h - found
-- Host: Windows/AMD64
-- Target: Generic/arm
-- Machine: arm
-- open-amp version: 1.4.0 (C:/ncs/V2.5.0/v2.5.0/modules/lib/open-amp/open-amp)
-- C_FLAGS : -Wall -Wextra
-- Looking for include file fcntl.h
-- Looking for include file fcntl.h - found
CMake Warning at C:/ncs/V2.5.0/v2.5.0/zephyr/CMakeLists.txt:893 (message):
No SOURCES given to Zephyr library: drivers__display

Excluding target from build.


CMake Warning at C:/ncs/V2.5.0/v2.5.0/zephyr/CMakeLists.txt:1958 (message):
__ASSERT() statements are globally ENABLED


-- 2048
-- about
-- accelerometer
-- battery
-- compass
-- iaq
-- info
-- music_control
-- notification
-- ppt_remote
-- qr_code
-- sensors_summary
-- settings
-- template
-- trivia
-- watchface
-- x_ray
-- zds
-- Configuring done
CMake Error at C:/ncs/V2.5.0/v2.5.0/zephyr/cmake/modules/extensions.cmake:424 (add_library):
Cannot find source file:

F:/ZSwatch/ZSWatch-main/app/src/ext_drivers/BMI270-Sensor-API/bmi2.c
Call Stack (most recent call first):
C:/ncs/V2.5.0/v2.5.0/zephyr/CMakeLists.txt:110 (zephyr_library_named)


-- Generating done
CMake Generate step failed. Build files cannot be regenerated correctly.
CMake Error at cmake/modules/sysbuild_extensions.cmake:455 (message):
CMake configure failed for Zephyr project: app

Location: F:/ZSwatch/ZSWatch-main/app
Call Stack (most recent call first):
CMakeLists.txt:38 (ExternalZephyrProject_Cmake)


-- Configuring incomplete, errors occurred!
See also "F:/ZSwatch/ZSWatch-main/app/build/CMakeFiles/CMakeOutput.log".
FATAL ERROR: command exited with status 1: 'C:\ncs\V2.5.0\toolchains\c57af46cb7\opt\bin\cmake.EXE' -DWEST_PYTHON=C:/ncs/V2.5.0/toolchains/c57af46cb7/opt/bin/python.exe '-Bf:\ZSwatch\ZSWatch-main\app\build' -GNinja -DBOARD=nrf5340dk_nrf5340_cpuapp -DNCS_TOOLCHAIN_VERSION=NONE -DCONF_FILE=f:/ZSwatch/ZSWatch-main/app/prj.conf -DEXTRA_CONF_FILE=boards/nrf5340dk_nrf5340_cpuapp.conf -DEXTRA_DTC_OVERLAY_FILE=boards/nrf5340dk_nrf5340_cpuapp.overlay -DBOARD_ROOT=f:/zswatch/zswatch-main/app '-SC:\ncs\V2.5.0\v2.5.0\zephyr\share\sysbuild' '-DAPP_DIR:PATH=f:\ZSwatch\ZSWatch-main\app'

Any thoughts on why the unmodified sample won't build?

Parents
  • Hi

    You need to upload the full build log here for us to say anything about what exactly is wrong. There should be a message of what line throws the error in your sample.

    Best regards,

    Simon

  • Hi

    I have an nRF5340 and am trying to build the ZSWatch-Zephyr Smartwatch sample for it in VS Code with the nRF Connect extension pack.

    [642/653] Building C object zephyr/kernel/CMakeFiles/kernel.dir/poll.c.obj
    [643/653] Building C object zephyr/kernel/CMakeFiles/kernel.dir/sched.c.obj
    [644/653] Linking C static library zephyr\kernel\libkernel.a
    [645/653] Linking C static library modules\lvgl\libmodules__lvgl.a
    [646/653] Linking C executable zephyr\zephyr_pre0.elf
    FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map
    cmd.exe /C "cd . && C:\ncs\V2.5.0\toolchains\c57af46cb7\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe -gdwarf-4 @CMakeFiles\zephyr_pre0.rsp -o zephyr\zephyr_pre0.elf && cmd.exe /C "cd /D F:\ZSwatch\ZSWatch-main\app\build\zephyr && C:\ncs\V2.5.0\toolchains\c57af46cb7\opt\bin\cmake.exe -E true""
    c:/ncs/v2.5.0/toolchains/c57af46cb7/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: app/libapp.a(game_2048_ui.c.obj): in function `game_2048_event_cb':
    F:\ZSwatch\ZSWatch-main\app\build/../src/applications/2048/game_2048_ui.c:53: undefined reference to `lv_100ask_2048_get_best_tile'
    c:/ncs/v2.5.0/toolchains/c57af46cb7/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: F:\ZSwatch\ZSWatch-main\app\build/../src/applications/2048/game_2048_ui.c:55: undefined reference to `lv_100ask_2048_get_status'
    c:/ncs/v2.5.0/toolchains/c57af46cb7/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: F:\ZSwatch\ZSWatch-main\app\build/../src/applications/2048/game_2048_ui.c:58: undefined reference to `lv_100ask_2048_get_score'
    c:/ncs/v2.5.0/toolchains/c57af46cb7/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: app/libapp.a(game_2048_ui.c.obj): in function `game_2048_ui_show':
    F:\ZSwatch\ZSWatch-main\app\build/../src/applications/2048/game_2048_ui.c:27: undefined reference to `lv_100ask_2048_create'
    c:/ncs/v2.5.0/toolchains/c57af46cb7/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: F:\ZSwatch\ZSWatch-main\app\build/../src/applications/2048/game_2048_ui.c:35: undefined reference to `lv_100ask_2048_get_score'
    collect2.exe: error: ld returned 1 exit status
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: 'C:\ncs\V2.5.0\toolchains\c57af46cb7\opt\bin\cmake.EXE' --build 'f:\ZSwatch\ZSWatch-main\app\build'

  • [1/653] Generating include/generated/app_version.h
    -- git describe failed: fatal: not a git repository (or any of the parent directories): .git

  • Hi,

    Focus in this part of the error log:

    zkwei said:
    c:/ncs/v2.5.0/toolchains/c57af46cb7/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: F:\ZSwatch\ZSWatch-main\app\build/../src/applications/2048/game_2048_ui.c:35: undefined reference to `lv_100ask_2048_get_score'

    collect2.exe: error: ld returned 1 exit status
    ninja: build stopped: subcommand failed.

    FATAL ERROR: command exited with status 1: 'C:\ncs\V2.5.0\toolchains\c57af46cb7\opt\bin\cmake.EXE' --build 'f:\ZSwatch\ZSWatch-main\app\build'

    It says fairly clearly that the file that is having issue is a file in the ZSWatch, under the source code for the 2048 game application. There is a function named lv_100ask_2048_get_score() that is undefined.
    The function name once again heavily suggests that it is a function in the project itself.

    Investigating the ZSWatch project source code, we find that this function is most likely defined in the file named lv_100ask_2048.h, which is not in the ZSWatch project directly. However, we also see that the ZSWatch project has a git submodule here referring to a 2048_lib repository.

      

    Follow the link to the 2048_lib repository, we again find the lv_100ask_2048.h file, and also the lv_100ask_2048.c file where the function is defined.

    Your build has not picked up the files correctly. Have you even checkout the git submodule in the first place?

    Hieu

Reply
  • Hi,

    Focus in this part of the error log:

    zkwei said:
    c:/ncs/v2.5.0/toolchains/c57af46cb7/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: F:\ZSwatch\ZSWatch-main\app\build/../src/applications/2048/game_2048_ui.c:35: undefined reference to `lv_100ask_2048_get_score'

    collect2.exe: error: ld returned 1 exit status
    ninja: build stopped: subcommand failed.

    FATAL ERROR: command exited with status 1: 'C:\ncs\V2.5.0\toolchains\c57af46cb7\opt\bin\cmake.EXE' --build 'f:\ZSwatch\ZSWatch-main\app\build'

    It says fairly clearly that the file that is having issue is a file in the ZSWatch, under the source code for the 2048 game application. There is a function named lv_100ask_2048_get_score() that is undefined.
    The function name once again heavily suggests that it is a function in the project itself.

    Investigating the ZSWatch project source code, we find that this function is most likely defined in the file named lv_100ask_2048.h, which is not in the ZSWatch project directly. However, we also see that the ZSWatch project has a git submodule here referring to a 2048_lib repository.

      

    Follow the link to the 2048_lib repository, we again find the lv_100ask_2048.h file, and also the lv_100ask_2048.c file where the function is defined.

    Your build has not picked up the files correctly. Have you even checkout the git submodule in the first place?

    Hieu

Children
No Data
Related