I'm trying to compile the lsm6dso example for a nrf5340. I also tried the nrf52832, but I get the same error.
v2.4.2\zephyr\samples\sensor\lsm6dso
prj.conf:
PS C:\nrf\lsm6dso> west build -b nrf5340dk_nrf5340_cpuapp
-- west build: generating a build system
Loading Zephyr default modules (Zephyr base).
-- Application: C:/nrf/lsm6dso
-- CMake version: 3.20.5
-- Using NCS Toolchain 2.4.0 for building. (C:/ncs/toolchains/31f4403e35/cmake)
-- Found Python3: C:/ncs/toolchains/31f4403e35/opt/bin/python.exe (found suitable exact version "3.8.2") found components: Interpreter
-- Cache files will be written to: C:/ncs/v2.4.2/zephyr/.cache
-- Zephyr version: 3.3.99 (C:/ncs/v2.4.2/zephyr)
-- Found west (found suitable version "1.0.0", minimum required is "0.7.1")
-- Board: nrf5340dk_nrf5340_cpuapp
-- Found host-tools: zephyr 0.16.0 (C:/ncs/toolchains/31f4403e35/opt/zephyr-sdk)
-- Found toolchain: zephyr 0.16.0 (C:/ncs/toolchains/31f4403e35/opt/zephyr-sdk)
-- Found Dtc: C:/ncs/toolchains/31f4403e35/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
-- Found BOARD.dts: C:/ncs/v2.4.2/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp.dts
-- Generated zephyr.dts: C:/nrf/lsm6dso/build/zephyr/zephyr.dts
-- Generated devicetree_generated.h: C:/nrf/lsm6dso/build/zephyr/include/generated/devicetree_generated.h
-- Including generated dts.cmake file: C:/nrf/lsm6dso/build/zephyr/dts.cmake
warning: The choice symbol LSM6DSO_TRIGGER_GLOBAL_THREAD (defined at
drivers/sensor/lsm6dso/Kconfig:28) was selected (set =y), but no symbol ended up as the choice
selection. See
docs.zephyrproject.org/.../kconfig.html and/or look
up LSM6DSO_TRIGGER_GLOBAL_THREAD 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.
Parsing C:/ncs/v2.4.2/zephyr/Kconfig
Loaded configuration 'C:/ncs/v2.4.2/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp_defconfig'
Merged configuration 'C:/nrf/lsm6dso/prj.conf'
Configuration saved to 'C:/nrf/lsm6dso/build/zephyr/.config'
Kconfig header saved to 'C:/nrf/lsm6dso/build/zephyr/include/generated/autoconf.h'
-- Found GnuLd: c:/ncs/toolchains/31f4403e35/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/toolchains/31f4403e35/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
CMake Warning at C:/ncs/v2.4.2/zephyr/CMakeLists.txt:839 (message):
No SOURCES given to Zephyr library: lib__libc__common
Excluding target from build.
-- Configuring done
-- Generating done
-- Build files have been written to: C:/nrf/lsm6dso/build
←[92m-- west build: building application
[1/171] Generating include/generated/version.h
-- Zephyr version: 3.3.99 (C:/ncs/v2.4.2/zephyr), build: v3.3.99-ncs1-1
[35/171] Building C object CMakeFiles/app.dir/src/main.c.obj
FAILED: CMakeFiles/app.dir/src/main.c.obj
C:\ncs\toolchains\31f4403e35\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe -DKERNEL -DNRF5340_XXAA_APPLICATION -DNRF_SKIP_FICR_NS_COPY_TO_RAM -DUSE_PARTITION_MANAGER=0 -D__PROGRAM_START -D__ZEPHYR__=1 -IC:/ncs/v2.4.2/zephyr/include -Izephyr/include/generated -IC:/ncs/v2.4.2/zephyr/soc/arm/nordic_nrf/nrf53 -IC:/ncs/v2.4.2/zephyr/soc/arm/nordic_nrf/common/. -IC:/ncs/v2.4.2/nrf/include -IC:/ncs/v2.4.2/nrf/tests/include -IC:/ncs/v2.4.2/modules/hal/cmsis/CMSIS/Core/Include -IC:/ncs/v2.4.2/modules/hal/nordic/nrfx -IC:/ncs/v2.4.2/modules/hal/nordic/nrfx/drivers/include -IC:/ncs/v2.4.2/modules/hal/nordic/nrfx/mdk -IC:/ncs/v2.4.2/zephyr/modules/hal_nordic/nrfx/. -isystem C:/ncs/v2.4.2/zephyr/lib/libc/minimal/include -isystem c:/ncs/toolchains/31f4403e35/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/include -isystem c:/ncs/toolchains/31f4403e35/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/include-fixed -isystem C:/ncs/v2.4.2/nrfxlib/crypto/nrf_cc312_platform/include -fno-strict-aliasing -Os -imacros C:/nrf/lsm6dso/build/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m33 -mthumb -mabi=aapcs --sysroot=C:/ncs/toolchains/31f4403e35/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi -imacros C:/ncs/v2.4.2/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-pic -fno-pie -fno-asynchronous-unwind-tables -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop -fmacro-prefix-map=C:/nrf/lsm6dso=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/ncs/v2.4.2/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:/ncs/v2.4.2=WEST_TOPDIR -ffunction-sections -fdata-sections -std=c99 -nostdinc -MD -MT CMakeFiles/app.dir/src/main.c.obj -MF CMakeFiles\app.dir\src\main.c.obj.d -o CMakeFiles/app.dir/src/main.c.obj -c ../src/main.c
In file included from C:/ncs/v2.4.2/zephyr/include/zephyr/sys/util_macro.h:34,
from C:/ncs/v2.4.2/zephyr/include/zephyr/sys/atomic.h:16,
from C:/ncs/v2.4.2/zephyr/include/zephyr/kernel_includes.h:21,
from C:/ncs/v2.4.2/zephyr/include/zephyr/kernel.h:17,
from ../src/main.c:8:
../src/main.c: In function 'main':
C:/ncs/v2.4.2/zephyr/include/zephyr/sys/util.h:91:55: error: size of unnamed array is negative
91 | #define ZERO_OR_COMPILE_ERROR(cond) ((int) sizeof(char[1 - 2 * !(cond)]) - 1)
| ^
C:/ncs/v2.4.2/zephyr/include/zephyr/sys/util_internal.h:72:26: note: in definition of macro '__DEBRACKET'
72 | #define __DEBRACKET(...) __VA_ARGS__
| ^~~~~~~~~~~
C:/ncs/v2.4.2/zephyr/include/zephyr/sys/util_internal.h:64:9: note: in expansion of macro '__GET_ARG2_DEBRACKET'
64 | __GET_ARG2_DEBRACKET(one_or_two_args _if_code, _else_code)
| ^~~~~~~~~~~~~~~~~~~~
C:/ncs/v2.4.2/zephyr/include/zephyr/sys/util_internal.h:59:9: note: in expansion of macro '__COND_CODE'
59 | __COND_CODE(_XXXX##_flag, _if_1_code, _else_code)
| ^~~~~~~~~~~
C:/ncs/v2.4.2/zephyr/include/zephyr/sys/util_macro.h:180:9: note: in expansion of macro 'Z_COND_CODE_1'
180 | Z_COND_CODE_1(_flag, _if_1_code, _else_code)
| ^~~~~~~~~~~~~
C:/ncs/v2.4.2/zephyr/include/zephyr/device.h:278:9: note: in expansion of macro 'COND_CODE_1'
278 | COND_CODE_1(DT_HAS_COMPAT_STATUS_OKAY(compat), \
| ^~~~~~~~~~~
C:/ncs/v2.4.2/zephyr/include/zephyr/device.h:280:22: note: in expansion of macro 'ZERO_OR_COMPILE_ERROR'
280 | (ZERO_OR_COMPILE_ERROR(0)))
| ^~~~~~~~~~~~~~~~~~~~~
../src/main.c:110:42: note: in expansion of macro 'DEVICE_DT_GET_ONE'
110 | const struct device *const dev = DEVICE_DT_GET_ONE(st_lsm6dso);
| ^~~~~~~~~~~~~~~~~
[44/171] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/cbprintf_packaged.c.obj
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\31f4403e35\opt\bin\cmake.EXE' --build 'C:\nrf\lsm6dso\build'
PS C:\nrf\lsm6dso>