Cmake Errors while building code in nrf5340dk

when I try to build a code for integrating sensor in nRF 5340 dk, this error comes, I tried even after installing cmake manually from the cmake website https://cmake.org/, but unable to solve these errors , kindly help with a suitable solution.

SDK version 3.0.2

Parents
  • Hi,

    Check the "terminal" tab. In there you should find a more complete log. 
    Are you able to see from that log what is wrong?

    If not, can you copy it into Insert->Code here?

    Regards,
    Sigurd Hellesvik

  • Loading Zephyr default modules (Zephyr base (cached)).
    -- Application: C:/ncs/v3.0.2/nordictutorials/sensor
    -- CMake version: 3.21.0
    -- Cache files will be written to: C:/ncs/v3.0.2/zephyr/.cache
    -- Zephyr version: 4.0.99 (C:/ncs/v3.0.2/zephyr)
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: nrf5340dk, qualifiers: nrf5340/cpuapp
    -- Found host-tools: zephyr 0.17.0 (C:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.17.0 (C:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk)
    -- Found BOARD.dts: C:/ncs/v3.0.2/zephyr/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpuapp.dts
    -- Generated zephyr.dts: C:/ncs/v3.0.2/nordictutorials/sensor/build/sensor/zephyr/zephyr.dts
    -- Generated pickled edt: C:/ncs/v3.0.2/nordictutorials/sensor/build/sensor/zephyr/edt.pickle
    -- Generated zephyr.dts: C:/ncs/v3.0.2/nordictutorials/sensor/build/sensor/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: C:/ncs/v3.0.2/nordictutorials/sensor/build/sensor/zephyr/include/generated/zephyr/devicetree_generated.h
    -- Including generated dts.cmake file: C:/ncs/v3.0.2/nordictutorials/sensor/build/sensor/zephyr/dts.cmake
    Parsing C:/ncs/v3.0.2/zephyr/Kconfig
    Loaded configuration 'C:/ncs/v3.0.2/nordictutorials/sensor/build/sensor/zephyr/.config'
    Merged configuration 'C:/ncs/v3.0.2/nordictutorials/sensor/build/sensor/zephyr/.config.sysbuild'
    No change to configuration in 'C:/ncs/v3.0.2/nordictutorials/sensor/build/sensor/zephyr/.config'
    No change to Kconfig header in 'C:/ncs/v3.0.2/nordictutorials/sensor/build/sensor/zephyr/include/generated/zephyr/autoconf.h'
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/ncs/v3.0.2/nordictutorials/sensor/build/sensor
    [2/25] Building C object zephyr/soc/soc/nrf5340/CMakeFiles/soc__nordic.dir/validate_enabled_instances.c.obj
    FAILED: zephyr/soc/soc/nrf5340/CMakeFiles/soc__nordic.dir/validate_enabled_instances.c.obj 
    C:\ncs\toolchains\0b393f9e1b\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe -DKERNEL -DK_HEAP_MEM_POOL_SIZE=0 -DNRF5340_XXAA_APPLICATION -DNRF_SKIP_FICR_NS_COPY_TO_RAM -DPICOLIBC_DOUBLE_PRINTF_SCANF -DUSE_PARTITION_MANAGER=1 -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR__=1 -IC:/ncs/v3.0.2/nordictutorials/sensor/build/sensor/zephyr/include/generated/zephyr -IC:/ncs/v3.0.2/zephyr/include -IC:/ncs/v3.0.2/nordictutorials/sensor/build/sensor/zephyr/include/generated -IC:/ncs/v3.0.2/zephyr/soc/nordic -IC:/ncs/v3.0.2/zephyr/soc/nordic/nrf53/. -IC:/ncs/v3.0.2/zephyr/soc/nordic/common/. -IC:/ncs/v3.0.2/nrf/include -IC:/ncs/v3.0.2/nrf/tests/include -IC:/ncs/v3.0.2/modules/hal/cmsis/CMSIS/Core/Include -IC:/ncs/v3.0.2/zephyr/modules/cmsis/. -IC:/ncs/v3.0.2/nrf/modules/hal_nordic/. -IC:/ncs/v3.0.2/modules/hal/nordic/nrfx -IC:/ncs/v3.0.2/modules/hal/nordic/nrfx/drivers/include -IC:/ncs/v3.0.2/modules/hal/nordic/nrfx/mdk -IC:/ncs/v3.0.2/zephyr/modules/hal_nordic/nrfx/. -isystem C:/ncs/v3.0.2/zephyr/lib/libc/common/include -isystem C:/ncs/v3.0.2/nrfxlib/crypto/nrf_cc312_platform/include -fno-strict-aliasing -Os -imacros C:/ncs/v3.0.2/nordictutorials/sensor/build/sensor/zephyr/include/generated/zephyr/autoconf.h -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m33 -mthumb -mabi=aapcs -mfp16-format=ieee -mtp=soft --sysroot=C:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi -imacros C:/ncs/v3.0.2/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wdouble-promotion -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-pic -fno-pie -fno-asynchronous-unwind-tables -ftls-model=local-exec -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop -fmacro-prefix-map=C:/ncs/v3.0.2/nordictutorials/sensor=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/ncs/v3.0.2/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:/ncs/v3.0.2=WEST_TOPDIR -ffunction-sections -fdata-sections -specs=picolibc.specs -std=c99 -MD -MT zephyr/soc/soc/nrf5340/CMakeFiles/soc__nordic.dir/validate_enabled_instances.c.obj -MF zephyr\soc\soc\nrf5340\CMakeFiles\soc__nordic.dir\validate_enabled_instances.c.obj.d -o zephyr/soc/soc/nrf5340/CMakeFiles/soc__nordic.dir/validate_enabled_instances.c.obj -c C:/ncs/v3.0.2/zephyr/soc/nordic/validate_enabled_instances.c
    In file included from C:/ncs/v3.0.2/zephyr/include/zephyr/toolchain.h:50,
                     from C:/ncs/v3.0.2/zephyr/include/zephyr/kernel_includes.h:23,
                     from C:/ncs/v3.0.2/zephyr/include/zephyr/kernel.h:17,
                     from C:/ncs/v3.0.2/zephyr/soc/nordic/validate_enabled_instances.c:7:
    C:/ncs/v3.0.2/zephyr/include/zephyr/toolchain/gcc.h:87:36: error: static assertion failed: "Only one of the following peripherals can be enabled: SPI0, SPIM0, SPIS0, TWI0, TWIM0, TWIS0, UARTE0. Check nodes with status \"okay\" in zephyr.dts."
       87 | #define BUILD_ASSERT(EXPR, MSG...) _Static_assert((EXPR), "" MSG)
          |                                    ^~~~~~~~~~~~~~
    C:/ncs/v3.0.2/zephyr/soc/nordic/validate_enabled_instances.c:50:1: note: in expansion of macro 'BUILD_ASSERT'
       50 | BUILD_ASSERT(CHECK(0), MSG(0));
          | ^~~~~~~~~~~~
    [15/25] Building C object zephyr/kernel/CMakeFiles/kernel.dir/sched.c.obj
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\0b393f9e1b\opt\bin\cmake.EXE' --build C:/ncs/v3.0.2/nordictutorials/sensor/build/sensor
    
     *  The terminal process terminated with exit code: 1. 
     *  Terminal will be reused by tasks, press any key to close i
    Thank you , now when I'm trying to interface sensor,First time it was built but displayed  sensor not detected,but from second time build error is happening, shall I share my .overlay and .dts files 

    Regards

    Gouri.K 

  • From the log:

     error: static assertion failed: "Only one of the following peripherals can be enabled: SPI0, SPIM0, SPIS0, TWI0, TWIM0, TWIS0, UARTE0. Check nodes with status \"okay\" in zephyr.dts." 

    Looks like you enabled two of these?

Reply Children
No Data
Related