fatal error: zephyr.h: No such file or directory - Developing Bluetooth Low Energy products using nRF Connect SDK

Hi,

I am trying to build the "bluetooth remote" example from https://webinars.nordicsemi.com/developing-bluetooth-low-energy-6

Using nRF SDK 2.4.

I have downloaded the "Webinar_projects" zip and added folder "bluetooth remote" in my workspace directory.

When I build the program I get the error "fatal error: zephyr.h: No such file or directory"

I have not edited any of the files provided in the example.

What I have done so far in attempt to recify:

- Updated 2.4 SKD using the nRF connect for desktop toolchain manager

- Updated 2.4 toolchain using the nRF connect for desktop toolchain manager

- Updated west via directory C:\ncs\v2.4.0\nrf

- Also updated zephyr files to recify other issue of " No SOURCES give to Zephyr library: lib_libc_common" using links below found at devzone.nordicsemi.com/.../peripheral-lbs-example-policy-cmp0010-is-not-set-and-no-sources-given-to-zephyr-library-lib__libc__common

https://github.com/zephyrproject-rtos/zephyr/pull/57886

https://github.com/zephyrproject-rtos/zephyr/pull/56309/commits/2094e19a3c58297125c1289ea0ddec89db317f96

Is there something else I need to update? Any help is appreciated!

I would like to flash this onto a nrf52833dk but just trying to build exactly as the webinar example currently.

Log:

Building bluetooth_remote
C:\WINDOWS\system32\cmd.exe /d /s /c "west build --build-dir c:/Users/Connor/Documents/bluetooth_remote/build c:/Users/Connor/Documents/bluetooth_remote --pristine --board nrf52840dk_nrf52840 --no-sysbuild -- -DNCS_TOOLCHAIN_VERSION:STRING="NONE" -DCONF_FILE:STRING="c:/Users/Connor/Documents/bluetooth_remote/prj.conf""

-- west build: generating a build system
Loading Zephyr default modules (Zephyr base).
-- Application: C:/Users/Connor/Documents/bluetooth_remote
-- CMake version: 3.20.5
-- 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.0/zephyr/.cache
-- Zephyr version: 3.3.99 (C:/ncs/v2.4.0/zephyr)
-- Found west (found suitable version "1.0.0", minimum required is "0.7.1")
-- Board: nrf52840dk_nrf52840
-- 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.0/zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840.dts
-- Generated zephyr.dts: C:/Users/Connor/Documents/bluetooth_remote/build/zephyr/zephyr.dts
-- Generated devicetree_generated.h: C:/Users/Connor/Documents/bluetooth_remote/build/zephyr/include/generated/devicetree_generated.h
-- Including generated dts.cmake file: C:/Users/Connor/Documents/bluetooth_remote/build/zephyr/dts.cmake
Parsing C:/ncs/v2.4.0/zephyr/Kconfig
Loaded configuration 'C:/ncs/v2.4.0/zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840_defconfig'
Merged configuration 'c:/Users/Connor/Documents/bluetooth_remote/prj.conf'
Configuration saved to 'C:/Users/Connor/Documents/bluetooth_remote/build/zephyr/.config'
Kconfig header saved to 'C:/Users/Connor/Documents/bluetooth_remote/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.0/zephyr/CMakeLists.txt:1864 (message):
  __ASSERT() statements are globally ENABLED


-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/Connor/Documents/bluetooth_remote/build
-- west build: building application
[1/225] Generating include/generated/version.h
-- Zephyr version: 3.3.99 (C:/ncs/v2.4.0/zephyr), build: v3.3.99-ncs1
[2/225] Generating misc/generated/syscalls.json, misc/generated/struct_tags.json
[3/225] Generating include/generated/syscall_dispatch.c, include/generated/syscall_list.h
[4/225] Generating include/generated/kobj-types-enum.h, include/generated/otype-to-str.h, include/generated/otype-to-size.h
[5/225] Generating include/generated/driver-validation.h
[6/225] Building C object zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj
[7/225] Generating include/generated/offsets.h
[8/225] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/net/lib/utils/addr_utils.c.obj
[9/225] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/tracing/tracing_none.c.obj
[10/225] Building C object zephyr/CMakeFiles/zephyr.dir/C_/ncs/v2.4.0/modules/crypto/tinycrypt/lib/source/utils.c.obj
[11/225] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/pm/state.c.obj
[12/225] Building C object zephyr/CMakeFiles/zephyr.dir/C_/ncs/v2.4.0/modules/crypto/tinycrypt/lib/source/aes_encrypt.c.obj
[13/225] Building C object zephyr/CMakeFiles/zephyr.dir/C_/ncs/v2.4.0/modules/crypto/tinycrypt/lib/source/aes_decrypt.c.obj
[14/225] Building C object zephyr/CMakeFiles/zephyr.dir/C_/ncs/v2.4.0/modules/crypto/tinycrypt/lib/source/cmac_mode.c.obj
[15/225] Building C object zephyr/CMakeFiles/zephyr.dir/C_/ncs/v2.4.0/nrfxlib/crypto/nrf_cc310_platform/src/nrf_cc3xx_platform_abort_zephyr.c.obj
[16/225] Building ASM object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/isr_wrapper.S.obj
[17/225] Building ASM object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/swap_helper.S.obj
[18/225] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/pm/policy.c.obj
[19/225] Building C object zephyr/CMakeFiles/zephyr.dir/C_/ncs/v2.4.0/nrfxlib/crypto/nrf_cc310_platform/src/nrf_cc3xx_platform_mutex_zephyr.c.obj
[20/225] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/prep_c.c.obj
[21/225] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/swap.c.obj
[22/225] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/thread.c.obj
[23/225] Generating linker_zephyr_pre1.cmd
[24/225] Building C object zephyr/arch/common/CMakeFiles/isr_tables.dir/isr_tables.c.obj
[25/225] Building C object zephyr/arch/common/CMakeFiles/arch__common.dir/sw_isr_common.c.obj
[26/225] Building ASM object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/cpu_idle.S.obj
[27/225] Building C object CMakeFiles/app.dir/src/remote_service/remote.c.obj
FAILED: CMakeFiles/app.dir/src/remote_service/remote.c.obj
C:\ncs\toolchains\31f4403e35\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe -DKERNEL -DNRF52840_XXAA -DUSE_PARTITION_MANAGER=0 -D__PROGRAM_START -D__ZEPHYR__=1 -I../src/remote_service -IC:/ncs/v2.4.0/nrf/drivers/mpsl/clock_control -IC:/ncs/v2.4.0/zephyr/include -Izephyr/include/generated -IC:/ncs/v2.4.0/zephyr/soc/arm/nordic_nrf/nrf52 -IC:/ncs/v2.4.0/zephyr/soc/arm/nordic_nrf/common/. -IC:/ncs/v2.4.0/zephyr/subsys/bluetooth -IC:/ncs/v2.4.0/nrf/include -IC:/ncs/v2.4.0/nrf/lib/multithreading_lock/. -IC:/ncs/v2.4.0/nrf/subsys/bluetooth/controller/. -IC:/ncs/v2.4.0/nrf/tests/include -IC:/ncs/v2.4.0/modules/hal/cmsis/CMSIS/Core/Include -IC:/ncs/v2.4.0/modules/hal/nordic/nrfx -IC:/ncs/v2.4.0/modules/hal/nordic/nrfx/drivers/include -IC:/ncs/v2.4.0/modules/hal/nordic/nrfx/mdk -IC:/ncs/v2.4.0/zephyr/modules/hal_nordic/nrfx/. -IC:/ncs/v2.4.0/modules/debug/segger/SEGGER -IC:/ncs/v2.4.0/modules/debug/segger/Config -IC:/ncs/v2.4.0/zephyr/modules/segger/. -IC:/ncs/v2.4.0/modules/crypto/tinycrypt/lib/include -IC:/ncs/v2.4.0/nrfxlib/mpsl/include -IC:/ncs/v2.4.0/nrfxlib/mpsl/include/protocol -IC:/ncs/v2.4.0/nrfxlib/softdevice_controller/include -isystem C:/ncs/v2.4.0/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.0/nrfxlib/crypto/nrf_cc310_platform/include -fno-strict-aliasing -Os -imacros C:/Users/Connor/Documents/bluetooth_remote/build/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m4 -mthumb -mabi=aapcs --sysroot=C:/ncs/toolchains/31f4403e35/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi -imacros C:/ncs/v2.4.0/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:/Users/Connor/Documents/bluetooth_remote=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/ncs/v2.4.0/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:/ncs/v2.4.0=WEST_TOPDIR -ffunction-sections -fdata-sections -std=c99 -nostdinc -MD -MT CMakeFiles/app.dir/src/remote_service/remote.c.obj -MF CMakeFiles\app.dir\src\remote_service\remote.c.obj.d -o CMakeFiles/app.dir/src/remote_service/remote.c.obj -c ../src/remote_service/remote.c
In file included from c:\Users\Connor\Documents\bluetooth_remote\src\remote_service\remote.c:2:
c:\Users\Connor\Documents\bluetooth_remote\src\remote_service\remote.h:2:10: fatal error: zephyr.h: No such file or directory
    2 | #include <zephyr.h>
      |          ^~~~~~~~~~
compilation terminated.
[28/225] 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 -DNRF52840_XXAA -DUSE_PARTITION_MANAGER=0 -D__PROGRAM_START -D__ZEPHYR__=1 -I../src/remote_service -IC:/ncs/v2.4.0/nrf/drivers/mpsl/clock_control -IC:/ncs/v2.4.0/zephyr/include -Izephyr/include/generated -IC:/ncs/v2.4.0/zephyr/soc/arm/nordic_nrf/nrf52 -IC:/ncs/v2.4.0/zephyr/soc/arm/nordic_nrf/common/. -IC:/ncs/v2.4.0/zephyr/subsys/bluetooth -IC:/ncs/v2.4.0/nrf/include -IC:/ncs/v2.4.0/nrf/lib/multithreading_lock/. -IC:/ncs/v2.4.0/nrf/subsys/bluetooth/controller/. -IC:/ncs/v2.4.0/nrf/tests/include -IC:/ncs/v2.4.0/modules/hal/cmsis/CMSIS/Core/Include -IC:/ncs/v2.4.0/modules/hal/nordic/nrfx -IC:/ncs/v2.4.0/modules/hal/nordic/nrfx/drivers/include -IC:/ncs/v2.4.0/modules/hal/nordic/nrfx/mdk -IC:/ncs/v2.4.0/zephyr/modules/hal_nordic/nrfx/. -IC:/ncs/v2.4.0/modules/debug/segger/SEGGER -IC:/ncs/v2.4.0/modules/debug/segger/Config -IC:/ncs/v2.4.0/zephyr/modules/segger/. -IC:/ncs/v2.4.0/modules/crypto/tinycrypt/lib/include -IC:/ncs/v2.4.0/nrfxlib/mpsl/include -IC:/ncs/v2.4.0/nrfxlib/mpsl/include/protocol -IC:/ncs/v2.4.0/nrfxlib/softdevice_controller/include -isystem C:/ncs/v2.4.0/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.0/nrfxlib/crypto/nrf_cc310_platform/include -fno-strict-aliasing -Os -imacros C:/Users/Connor/Documents/bluetooth_remote/build/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m4 -mthumb -mabi=aapcs --sysroot=C:/ncs/toolchains/31f4403e35/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi -imacros C:/ncs/v2.4.0/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:/Users/Connor/Documents/bluetooth_remote=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/ncs/v2.4.0/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:/ncs/v2.4.0=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
c:\Users\Connor\Documents\bluetooth_remote\src\main.c:7:10: fatal error: zephyr.h: No such file or directory
    7 | #include <zephyr.h>
      |          ^~~~~~~~~~
compilation terminated.
[29/225] Building ASM object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/nmi_on_reset.S.obj
[30/225] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/irq_manage.c.obj
[31/225] Generating linker_zephyr_pre0.cmd
[32/225] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/nmi.c.obj
[33/225] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/fatal.c.obj
[34/225] Linking C static library zephyr\arch\common\libisr_tables.a
[35/225] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/fdtable.c.obj
[36/225] 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:\Users\Connor\Documents\bluetooth_remote\build'

 *  The terminal process terminated with exit code: 1.
 *  Terminal will be reused by tasks, press any key to close it.

Related