Getting zephyr.h file error in sample git code given in AWS IOT document

Hi,
    Im working in nrf9160dk, I'm referring aws iot document    there they given a code 6278.aws_iot_tutorial.rar there im getting this error .what i  need to do?

Executing task: nRF Connect: Build [clean]: aws_iot_tutorial/build (active)

Building aws_iot_tutorial
C:\Windows\system32\cmd.exe /d /s /c "west build -t clean --build-dir c:/Users/pmariyappan/Downloads/aws_iot_tutorial/build"

-- west build: running target clean
[2/2] Cleaning all built files...
Cleaning... 140 files.
* Terminal will be reused by tasks, press any key to close it.

* Executing task: nRF Connect: Generate config [email protected] for c:\Users\pmariyappan\Downloads\aws_iot_tutorial

Building aws_iot_tutorial
C:\Windows\system32\cmd.exe /d /s /c "west build --build-dir c:/Users/pmariyappan/Downloads/aws_iot_tutorial/build c:/Users/pmariyappan/Downloads/aws_iot_tutorial --pristine --board [email protected] --no-sysbuild -- -DNCS_TOOLCHAIN_VERSION=NONE -DCONF_FILE=c:/Users/pmariyappan/Downloads/aws_iot_tutorial/prj.conf"

-- west build: generating a build system
Loading Zephyr default modules (Zephyr base).
-- Application: C:/Users/pmariyappan/Downloads/aws_iot_tutorial
-- CMake version: 3.20.5
-- Found Python3: C:/ncs/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:/Users/pmariyappan/ncs/v2.5.1/zephyr/.cache
-- Zephyr version: 3.4.99 (C:/Users/pmariyappan/ncs/v2.5.1/zephyr)
-- Found west (found suitable version "1.1.0", minimum required is "0.14.0")
-- Board: nrf9160dk_nrf9160_ns, Revision: 1.1.0 (Active: 0.14.0)
-- Found host-tools: zephyr 0.16.1 (C:/ncs/toolchains/c57af46cb7/opt/zephyr-sdk)
-- Found toolchain: zephyr 0.16.1 (C:/ncs/toolchains/c57af46cb7/opt/zephyr-sdk)
-- Found Dtc: C:/ncs/toolchains/c57af46cb7/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
-- Found BOARD.dts: C:/Users/pmariyappan/ncs/v2.5.1/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_ns.dts
-- Found devicetree overlay: C:/Users/pmariyappan/ncs/v2.5.1/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_ns_0_14_0.overlay
-- Generated zephyr.dts: C:/Users/pmariyappan/Downloads/aws_iot_tutorial/build/zephyr/zephyr.dts
-- Generated devicetree_generated.h: C:/Users/pmariyappan/Downloads/aws_iot_tutorial/build/zephyr/include/generated/devicetree_generated.h
-- Including generated dts.cmake file: C:/Users/pmariyappan/Downloads/aws_iot_tutorial/build/zephyr/dts.cmake
Parsing C:/Users/pmariyappan/Downloads/aws_iot_tutorial/Kconfig
Loaded configuration 'C:/Users/pmariyappan/ncs/v2.5.1/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_ns_defconfig'
Merged configuration 'c:/Users/pmariyappan/Downloads/aws_iot_tutorial/prj.conf'
Configuration saved to 'C:/Users/pmariyappan/Downloads/aws_iot_tutorial/build/zephyr/.config'
Kconfig header saved to 'C:/Users/pmariyappan/Downloads/aws_iot_tutorial/build/zephyr/include/generated/autoconf.h'
-- Found GnuLd: c:/ncs/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/toolchains/c57af46cb7/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
CMake Warning at C:/Users/pmariyappan/ncs/v2.5.1/zephyr/CMakeLists.txt:1958 (message):
__ASSERT() statements are globally ENABLED


Dropping partition 'nrf_modem_lib_trace' since its size is 0.
Dropping partition 'nonsecure_storage' since it is empty.
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/pmariyappan/Downloads/aws_iot_tutorial/build
-- west build: building application
[2/281] Generating include/generated/version.h
-- Zephyr version: 3.4.99 (C:/Users/pmariyappan/ncs/v2.5.1/zephyr), build: 83980fe16794
[7/281] Generating ../../tfm/CMakeCache.txt
CMake Warning at cmake/version.cmake:22 (message):
Actual TF-M version is not available from Git repository. Settled to
v1.8.0
Call Stack (most recent call first):
CMakeLists.txt:22 (include)


-- Found Git: C:/ncs/toolchains/c57af46cb7/mingw64/bin/git.exe (found version "2.37.3.windows.1")
-- 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/c57af46cb7/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
-- Found Python3: C:/ncs/toolchains/c57af46cb7/opt/bin/python.exe (found version "3.8.2") found components: Interpreter
CMake Deprecation Warning at C:/Users/pmariyappan/ncs/v2.5.1/zephyr/cmake/modules/FindDeprecated.cmake:121 (message):
'PYTHON_PREFER' variable is deprecated. Please use Python3_EXECUTABLE
instead.
Call Stack (most recent call first):
C:/Users/pmariyappan/ncs/v2.5.1/zephyr/cmake/modules/python.cmake:16 (find_package)
C:/Users/pmariyappan/ncs/v2.5.1/zephyr/cmake/modules/user_cache.cmake:30 (include)
C:/Users/pmariyappan/ncs/v2.5.1/zephyr/cmake/modules/extensions.cmake:5 (include)
C:/Users/pmariyappan/ncs/v2.5.1/nrf/subsys/nrf_security/tfm/CMakeLists.txt:36 (include)


-- Found Python3: C:/ncs/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:/Users/pmariyappan/ncs/v2.5.1/zephyr/.cache
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/pmariyappan/Downloads/aws_iot_tutorial/build/tfm
[152/156] Linking C executable bin\tfm_s.axf
Memory region Used Size Region Size %age Used
FLASH: 32056 B 32 KB 97.83%
RAM: 14736 B 32 KB 44.97%
[15/281] Performing install step for 'tfm'
-- Install configuration: "MinSizeRel"
[111/281] Building C object CMakeFiles/app.dir/src/main.c.obj
FAILED: CMakeFiles/app.dir/src/main.c.obj
C:\ncs\toolchains\c57af46cb7\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe -DAPP_VERSION=v2.5.1 -DKERNEL -DMBEDTLS_CONFIG_FILE=\"nrf-config.h\" -DMBEDTLS_USER_CONFIG_FILE=\"nrf-config-user.h\" -DNRF9160_XXAA -DNRF_SKIP_FICR_NS_COPY_TO_RAM -DNRF_TRUSTZONE_NONSECURE -DTFM_PSA_API -DUSE_PARTITION_MANAGER=1 -D_ANSI_SOURCE -D_FORTIFY_SOURCE=1 -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR__=1 -IC:/Users/pmariyappan/ncs/v2.5.1/zephyr/include -Izephyr/include/generated -IC:/Users/pmariyappan/ncs/v2.5.1/zephyr/soc/arm/nordic_nrf/nrf91 -IC:/Users/pmariyappan/ncs/v2.5.1/zephyr/lib/libc/newlib/include -IC:/Users/pmariyappan/ncs/v2.5.1/zephyr/soc/arm/nordic_nrf/common/. -IC:/Users/pmariyappan/ncs/v2.5.1/zephyr/subsys/net/lib/sockets/. -IC:/Users/pmariyappan/ncs/v2.5.1/nrf/include -IC:/Users/pmariyappan/ncs/v2.5.1/nrf/lib/at_cmd_parser/include -Itfm/install/interface/include -IC:/Users/pmariyappan/ncs/v2.5.1/nrf/include/tfm -IC:/Users/pmariyappan/ncs/v2.5.1/nrf/tests/include -Itfm/generated/interface/include -IC:/Users/pmariyappan/ncs/v2.5.1/modules/lib/cjson -IC:/Users/pmariyappan/ncs/v2.5.1/nrf/modules/cjson/include -IC:/Users/pmariyappan/ncs/v2.5.1/modules/hal/cmsis/CMSIS/Core/Include -IC:/Users/pmariyappan/ncs/v2.5.1/zephyr/modules/cmsis/. -IC:/Users/pmariyappan/ncs/v2.5.1/modules/hal/nordic/nrfx -IC:/Users/pmariyappan/ncs/v2.5.1/modules/hal/nordic/nrfx/drivers/include -IC:/Users/pmariyappan/ncs/v2.5.1/modules/hal/nordic/nrfx/mdk -IC:/Users/pmariyappan/ncs/v2.5.1/zephyr/modules/hal_nordic/nrfx/. -IC:/Users/pmariyappan/ncs/v2.5.1/nrfxlib/nrf_modem/include -I../src -Imodules/nrf/subsys/nrf_security/src/include/generated -IC:/Users/pmariyappan/ncs/v2.5.1/nrf/subsys/nrf_security/include -IC:/Users/pmariyappan/ncs/v2.5.1/nrf/ext/oberon/psa/core/include -IC:/Users/pmariyappan/ncs/v2.5.1/nrf/ext/oberon/psa/core/library -IC:/Users/pmariyappan/ncs/v2.5.1/modules/crypto/mbedtls/include -IC:/Users/pmariyappan/ncs/v2.5.1/modules/crypto/mbedtls/library -IC:/Users/pmariyappan/ncs/v2.5.1/nrfxlib/crypto/nrf_oberon/include/mbedtls -IC:/Users/pmariyappan/ncs/v2.5.1/nrfxlib/crypto/nrf_oberon/include -fno-strict-aliasing -Os -imacros C:/Users/pmariyappan/Downloads/aws_iot_tutorial/build/zephyr/include/generated/autoconf.h -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m33 -mthumb -mabi=aapcs -mfp16-format=ieee --sysroot=C:/ncs/toolchains/c57af46cb7/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi -imacros C:/Users/pmariyappan/ncs/v2.5.1/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/pmariyappan/Downloads/aws_iot_tutorial=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/Users/pmariyappan/ncs/v2.5.1/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:/Users/pmariyappan/ncs/v2.5.1=WEST_TOPDIR -ffunction-sections -fdata-sections -specs=nano.specs -D_POSIX_THREADS -std=c99 -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
../src/main.c:7:10: fatal error: zephyr.h: No such file or directory
7 | #include <zephyr.h>
| ^~~~~~~~~~
compilation terminated.
[124/281] Building C object modules/cjson/CMakeFiles/cjson.dir/C_/Users/pmariyappan/ncs/v2.5.1/modules/lib/cjson/cJSON.c.obj
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\c57af46cb7\opt\bin\cmake.EXE' --build 'c:\Users\pmariyappan\Downloads\aws_iot_tutorial\build'

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

  • Hello,

    it looks like you are building with a newer NCS release, where the zephyr.h fileand a lot of other files have been moved to a new sub directory. Try to replace

    #include <zephyr.h>

    with

    #include <zephyr/zephyr.h>

    and see if that works.

    When I have the time I will update the code so it works for newer releases. If you still have issues with this sample please let me know.

  • yeah i added this after im facing this issue

    Executing task: nRF Connect: Build [clean]: aws_iot_tutorial/build (active)

    Building aws_iot_tutorial
    C:\Windows\system32\cmd.exe /d /s /c "west build -t clean --build-dir c:/Users/pmariyappan/Downloads/aws_iot_tutorial/build"

    -- west build: running target clean
    [0/1] Re-running CMake...
    Loading Zephyr default modules (Zephyr base (cached)).
    -- Application: C:/Users/pmariyappan/Downloads/aws_iot_tutorial
    -- CMake version: 3.20.5
    -- Cache files will be written to: C:/Users/pmariyappan/ncs/v2.5.1/zephyr/.cache
    -- Zephyr version: 3.4.99 (C:/Users/pmariyappan/ncs/v2.5.1/zephyr)
    -- Found west (found suitable version "1.1.0", minimum required is "0.14.0")
    -- Board: nrf9160dk_nrf9160_ns, Revision: 1.1.0 (Active: 0.14.0)
    -- Found host-tools: zephyr 0.16.1 (C:/ncs/toolchains/c57af46cb7/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.16.1 (C:/ncs/toolchains/c57af46cb7/opt/zephyr-sdk)
    -- Found BOARD.dts: C:/Users/pmariyappan/ncs/v2.5.1/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_ns.dts
    -- Found devicetree overlay: C:/Users/pmariyappan/ncs/v2.5.1/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_ns_0_14_0.overlay
    -- Generated zephyr.dts: C:/Users/pmariyappan/Downloads/aws_iot_tutorial/build/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: C:/Users/pmariyappan/Downloads/aws_iot_tutorial/build/zephyr/include/generated/devicetree_generated.h
    -- Including generated dts.cmake file: C:/Users/pmariyappan/Downloads/aws_iot_tutorial/build/zephyr/dts.cmake
    Parsing C:/Users/pmariyappan/Downloads/aws_iot_tutorial/Kconfig
    Loaded configuration 'C:/Users/pmariyappan/Downloads/aws_iot_tutorial/build/zephyr/.config'
    No change to configuration in 'C:/Users/pmariyappan/Downloads/aws_iot_tutorial/build/zephyr/.config'
    No change to Kconfig header in 'C:/Users/pmariyappan/Downloads/aws_iot_tutorial/build/zephyr/include/generated/autoconf.h'
    CMake Warning at C:/Users/pmariyappan/ncs/v2.5.1/zephyr/CMakeLists.txt:1958 (message):
    __ASSERT() statements are globally ENABLED


    Dropping partition 'nrf_modem_lib_trace' since its size is 0.
    Dropping partition 'nonsecure_storage' since it is empty.
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/Users/pmariyappan/Downloads/aws_iot_tutorial/build
    [2/2] Cleaning all built files...
    Cleaning... 137 files.
    * Terminal will be reused by tasks, press any key to close it.

    * Executing task: nRF Connect: Build: aws_iot_tutorial/build (active)

    Building aws_iot_tutorial
    C:\Windows\system32\cmd.exe /d /s /c "west build --build-dir c:/Users/pmariyappan/Downloads/aws_iot_tutorial/build c:/Users/pmariyappan/Downloads/aws_iot_tutorial"

    [5/281] Generating include/generated/version.h
    -- Zephyr version: 3.4.99 (C:/Users/pmariyappan/ncs/v2.5.1/zephyr), build: 83980fe16794
    [7/281] Generating ../../tfm/CMakeCache.txt
    CMake Warning at cmake/version.cmake:22 (message):
    Actual TF-M version is not available from Git repository. Settled to
    v1.8.0
    Call Stack (most recent call first):
    CMakeLists.txt:22 (include)


    -- Found Git: C:/ncs/toolchains/c57af46cb7/mingw64/bin/git.exe (found version "2.37.3.windows.1")
    -- 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/c57af46cb7/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
    -- Found Python3: C:/ncs/toolchains/c57af46cb7/opt/bin/python.exe (found version "3.8.2") found components: Interpreter
    CMake Deprecation Warning at C:/Users/pmariyappan/ncs/v2.5.1/zephyr/cmake/modules/FindDeprecated.cmake:121 (message):
    'PYTHON_PREFER' variable is deprecated. Please use Python3_EXECUTABLE
    instead.
    Call Stack (most recent call first):
    C:/Users/pmariyappan/ncs/v2.5.1/zephyr/cmake/modules/python.cmake:16 (find_package)
    C:/Users/pmariyappan/ncs/v2.5.1/zephyr/cmake/modules/user_cache.cmake:30 (include)
    C:/Users/pmariyappan/ncs/v2.5.1/zephyr/cmake/modules/extensions.cmake:5 (include)
    C:/Users/pmariyappan/ncs/v2.5.1/nrf/subsys/nrf_security/tfm/CMakeLists.txt:36 (include)


    -- Found Python3: C:/ncs/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:/Users/pmariyappan/ncs/v2.5.1/zephyr/.cache
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/Users/pmariyappan/Downloads/aws_iot_tutorial/build/tfm
    [31/123] Building C object secure_fw/partitions/crypto/mbedcrypto/nrf_security_src/CMakeFiles/crypto_service_mbedcrypto.dir/C_/Users/pmariyappan/ncs/v2.5.1/modules/crypto/mbedtls/libra
    [119/123] Linking C executable bin\tfm_s.axf
    Memory region Used Size Region Size %age Used
    FLASH: 32056 B 32 KB 97.83%
    RAM: 14736 B 32 KB 44.97%
    [15/281] Performing install step for 'tfm'
    -- Install configuration: "MinSizeRel"
    [133/281] Building C object CMakeFiles/app.dir/src/main.c.obj
    FAILED: CMakeFiles/app.dir/src/main.c.obj
    C:\ncs\toolchains\c57af46cb7\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe -DAPP_VERSION=v2.5.1 -DKERNEL -DMBEDTLS_CONFIG_FILE=\"nrf-config.h\" -DMBEDTLS_USER_CONFIG_FILE=\"nrf-config-user.h\" -DNRF9160_XXAA -DNRF_SKIP_FICR_NS_COPY_TO_RAM -DNRF_TRUSTZONE_NONSECURE -DTFM_PSA_API -DUSE_PARTITION_MANAGER=1 -D_ANSI_SOURCE -D_FORTIFY_SOURCE=1 -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR__=1 -IC:/Users/pmariyappan/ncs/v2.5.1/zephyr/include -Izephyr/include/generated -IC:/Users/pmariyappan/ncs/v2.5.1/zephyr/soc/arm/nordic_nrf/nrf91 -IC:/Users/pmariyappan/ncs/v2.5.1/zephyr/lib/libc/newlib/include -IC:/Users/pmariyappan/ncs/v2.5.1/zephyr/soc/arm/nordic_nrf/common/. -IC:/Users/pmariyappan/ncs/v2.5.1/zephyr/subsys/net/lib/sockets/. -IC:/Users/pmariyappan/ncs/v2.5.1/nrf/include -IC:/Users/pmariyappan/ncs/v2.5.1/nrf/lib/at_cmd_parser/include -Itfm/install/interface/include -IC:/Users/pmariyappan/ncs/v2.5.1/nrf/include/tfm -IC:/Users/pmariyappan/ncs/v2.5.1/nrf/tests/include -Itfm/generated/interface/include -IC:/Users/pmariyappan/ncs/v2.5.1/modules/lib/cjson -IC:/Users/pmariyappan/ncs/v2.5.1/nrf/modules/cjson/include -IC:/Users/pmariyappan/ncs/v2.5.1/modules/hal/cmsis/CMSIS/Core/Include -IC:/Users/pmariyappan/ncs/v2.5.1/zephyr/modules/cmsis/. -IC:/Users/pmariyappan/ncs/v2.5.1/modules/hal/nordic/nrfx -IC:/Users/pmariyappan/ncs/v2.5.1/modules/hal/nordic/nrfx/drivers/include -IC:/Users/pmariyappan/ncs/v2.5.1/modules/hal/nordic/nrfx/mdk -IC:/Users/pmariyappan/ncs/v2.5.1/zephyr/modules/hal_nordic/nrfx/. -IC:/Users/pmariyappan/ncs/v2.5.1/nrfxlib/nrf_modem/include -I../src -Imodules/nrf/subsys/nrf_security/src/include/generated -IC:/Users/pmariyappan/ncs/v2.5.1/nrf/subsys/nrf_security/include -IC:/Users/pmariyappan/ncs/v2.5.1/nrf/ext/oberon/psa/core/include -IC:/Users/pmariyappan/ncs/v2.5.1/nrf/ext/oberon/psa/core/library -IC:/Users/pmariyappan/ncs/v2.5.1/modules/crypto/mbedtls/include -IC:/Users/pmariyappan/ncs/v2.5.1/modules/crypto/mbedtls/library -IC:/Users/pmariyappan/ncs/v2.5.1/nrfxlib/crypto/nrf_oberon/include/mbedtls -IC:/Users/pmariyappan/ncs/v2.5.1/nrfxlib/crypto/nrf_oberon/include -fno-strict-aliasing -Os -imacros C:/Users/pmariyappan/Downloads/aws_iot_tutorial/build/zephyr/include/generated/autoconf.h -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m33 -mthumb -mabi=aapcs -mfp16-format=ieee --sysroot=C:/ncs/toolchains/c57af46cb7/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi -imacros C:/Users/pmariyappan/ncs/v2.5.1/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/pmariyappan/Downloads/aws_iot_tutorial=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/Users/pmariyappan/ncs/v2.5.1/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:/Users/pmariyappan/ncs/v2.5.1=WEST_TOPDIR -ffunction-sections -fdata-sections -specs=nano.specs -D_POSIX_THREADS -std=c99 -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 ../src/main.c:7:
    C:/Users/pmariyappan/ncs/v2.5.1/zephyr/include/zephyr/zephyr.h:12:2: warning: #warning "<zephyr/zephyr.h> is deprecated, include <zephyr/kernel.h> instead" [-Wcpp]
    12 | #warning "<zephyr/zephyr.h> is deprecated, include <zephyr/kernel.h> instead"
    | ^~~~~~~
    ../src/main.c:13:10: fatal error: modem/at_cmd.h: No such file or directory
    13 | #include <modem/at_cmd.h>
    | ^~~~~~~~~~~~~~~~
    compilation terminated.
    [146/281] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/C_/Users/pmariyappan/ncs/v2.5.1/modules/hal/nordic/nrfx/drivers/src/nrfx_gpiote.c.obj
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\c57af46cb7\opt\bin\cmake.EXE' --build 'c:\Users\pmariyappan\Downloads\aws_iot_tutorial\build'

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

  • Yes, there seems to be a need to overhaul this sample. The problem you are seeing is that the at_cmd library is deprecated. You can try to remove everything that has to do with that library and the at_notif library in the code. I will take some time to update the sample, most probably after Easter.

  • Yes sure thank you and can you please look at aws_iot_mqtt sample code also im getting this build error

    Executing task: nRF Connect: Generate config [email protected] for c:\Users\pmariyappan\ncs\aws_iot\aws_iot_mqtt

    Building aws_iot_mqtt
    C:\Windows\system32\cmd.exe /d /s /c "west build --build-dir c:/Users/pmariyappan/ncs/aws_iot/aws_iot_mqtt/build c:/Users/pmariyappan/ncs/aws_iot/aws_iot_mqtt --pristine --board [email protected] --no-sysbuild -- -DNCS_TOOLCHAIN_VERSION=NONE -DCONF_FILE=c:/Users/pmariyappan/ncs/aws_iot/aws_iot_mqtt/prj.conf -DBOARD_ROOT=c:/users/pmariyappan/ncs/aws_iot/aws_iot_mqtt"

    -- west build: generating a build system
    Loading Zephyr default modules (Zephyr base).
    -- Application: C:/Users/pmariyappan/ncs/aws_iot/aws_iot_mqtt
    -- CMake version: 3.20.5
    -- Found Python3: C:/ncs/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:/Users/pmariyappan/ncs/v2.5.1/zephyr/.cache
    -- Zephyr version: 3.4.99 (C:/Users/pmariyappan/ncs/v2.5.1/zephyr)
    -- Found west (found suitable version "1.1.0", minimum required is "0.14.0")
    -- Board: nrf9160dk_nrf9160_ns, Revision: 1.1.0 (Active: 0.14.0)
    -- Found host-tools: zephyr 0.16.1 (C:/ncs/toolchains/c57af46cb7/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.16.1 (C:/ncs/toolchains/c57af46cb7/opt/zephyr-sdk)
    -- Found Dtc: C:/ncs/toolchains/c57af46cb7/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
    -- Found BOARD.dts: C:/Users/pmariyappan/ncs/v2.5.1/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_ns.dts
    -- Found devicetree overlay: C:/Users/pmariyappan/ncs/v2.5.1/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_ns_0_14_0.overlay
    -- Generated zephyr.dts: C:/Users/pmariyappan/ncs/aws_iot/aws_iot_mqtt/build/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: C:/Users/pmariyappan/ncs/aws_iot/aws_iot_mqtt/build/zephyr/include/generated/devicetree_generated.h
    -- Including generated dts.cmake file: C:/Users/pmariyappan/ncs/aws_iot/aws_iot_mqtt/build/zephyr/dts.cmake

    warning: MBEDTLS_MEMORY_DEBUG (defined at
    C:/Users/pmariyappan/ncs/v2.5.1/nrf\subsys\nrf_security\Kconfig.tls:167,
    C:/Users/pmariyappan/ncs/v2.5.1/zephyr/modules/mbedtls/Kconfig:163, modules\mbedtls\Kconfig:163) was
    assigned the value 'y' but got the value 'n'. Check these unsatisfied dependencies:
    ((MBEDTLS_TLS_LIBRARY && NRF_SECURITY) || (MBEDTLS_BUILTIN && MBEDTLS) || (MBEDTLS_BUILTIN &&
    MBEDTLS && 0)) (=n). See
    docs.zephyrproject.org/.../kconfig.html and/or look up
    MBEDTLS_MEMORY_DEBUG 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: MBEDTLS_AES_ROM_TABLES (defined at
    C:/Users/pmariyappan/ncs/v2.5.1/nrf\subsys\nrf_security\Kconfig.legacy:425,
    C:/Users/pmariyappan/ncs/v2.5.1/zephyr/modules/mbedtls\Kconfig.tls-generic:261,
    modules\mbedtls\Kconfig.tls-generic:261) was assigned the value 'y' but got the value 'n'. Check
    these unsatisfied dependencies: ((!(OBERON_BACKEND || CC3XX_BACKEND) && MBEDTLS_CIPHER_MODE_CBC &&
    MBEDTLS_AES_C && MBEDTLS_LEGACY_CRYPTO_C && NRF_SECURITY) || (MBEDTLS_CIPHER_AES_ENABLED &&
    !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) && MBEDTLS_BUILTIN && MBEDTLS_CFG_FILE = "config-tls-
    generic.h" && MBEDTLS) || (MBEDTLS_CIPHER_AES_ENABLED && !(NRF_SECURITY || NORDIC_SECURITY_BACKEND)
    && MBEDTLS_BUILTIN && MBEDTLS_CFG_FILE = "config-tls-generic.h" && MBEDTLS && 0)) (=n). See
    docs.zephyrproject.org/.../kconfig.html and/or look up
    MBEDTLS_AES_ROM_TABLES 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: MBEDTLS_PEM_CERTIFICATE_FORMAT (defined at
    C:/Users/pmariyappan/ncs/v2.5.1/zephyr/modules/mbedtls\Kconfig.tls-generic:403,
    modules\mbedtls\Kconfig.tls-generic:403) was assigned the value 'y' but got the value 'n'. Check
    these unsatisfied dependencies: ((MBEDTLS_BUILTIN && MBEDTLS_CFG_FILE = "config-tls-generic.h" &&
    MBEDTLS) || (MBEDTLS_BUILTIN && MBEDTLS_CFG_FILE = "config-tls-generic.h" && MBEDTLS && 0)) (=n).
    See docs.zephyrproject.org/.../kconfig.html and/or
    look up MBEDTLS_PEM_CERTIFICATE_FORMAT 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: MBEDTLS_SERVER_NAME_INDICATION (defined at
    C:/Users/pmariyappan/ncs/v2.5.1/zephyr/modules/mbedtls\Kconfig.tls-generic:448,
    modules\mbedtls\Kconfig.tls-generic:448) was assigned the value 'y' but got the value 'n'. Check
    these unsatisfied dependencies: ((MBEDTLS_BUILTIN && MBEDTLS_CFG_FILE = "config-tls-generic.h" &&
    MBEDTLS) || (MBEDTLS_BUILTIN && MBEDTLS_CFG_FILE = "config-tls-generic.h" && MBEDTLS && 0)) (=n).
    See docs.zephyrproject.org/.../kconfig.html and/or
    look up MBEDTLS_SERVER_NAME_INDICATION 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: MBEDTLS_HAVE_TIME_DATE (defined at
    C:/Users/pmariyappan/ncs/v2.5.1/zephyr/modules/mbedtls\Kconfig.tls-generic:460,
    modules\mbedtls\Kconfig.tls-generic:460) was assigned the value 'y' but got the value 'n'. Check
    these unsatisfied dependencies: ((MBEDTLS_BUILTIN && MBEDTLS_CFG_FILE = "config-tls-generic.h" &&
    MBEDTLS) || (MBEDTLS_BUILTIN && MBEDTLS_CFG_FILE = "config-tls-generic.h" && MBEDTLS && 0)) (=n).
    See docs.zephyrproject.org/.../kconfig.html and/or look up
    MBEDTLS_HAVE_TIME_DATE in the menuconfig/guiconfig interface. The Application Development Primer,
    Setting Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be
    Parsing C:/Users/pmariyappan/ncs/aws_iot/aws_iot_mqtt/Kconfig
    Loaded configuration 'C:/Users/pmariyappan/ncs/v2.5.1/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_ns_defconfig'
    Merged configuration 'c:/Users/pmariyappan/ncs/aws_iot/aws_iot_mqtt/prj.conf'
    Configuration saved to 'C:/Users/pmariyappan/ncs/aws_iot/aws_iot_mqtt/build/zephyr/.config'
    Kconfig header saved to 'C:/Users/pmariyappan/ncs/aws_iot/aws_iot_mqtt/build/zephyr/include/generated/autoconf.h'
    helpful too.


    warning: MBEDTLS_SSL_MAX_CONTENT_LEN (defined at
    C:/Users/pmariyappan/ncs/v2.5.1/zephyr/modules/mbedtls/Kconfig:70, modules\mbedtls\Kconfig:70) was
    assigned the value '16384' but got the value ''. Check these unsatisfied dependencies:
    ((MBEDTLS_BUILTIN && MBEDTLS) || (MBEDTLS_BUILTIN && MBEDTLS && 0)) (=n). See
    docs.zephyrproject.org/.../kconfig.html and/or look up
    MBEDTLS_SSL_MAX_CONTENT_LEN 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: The choice symbol MBEDTLS_BUILTIN (defined at
    C:/Users/pmariyappan/ncs/v2.5.1/zephyr/modules/mbedtls/Kconfig:28, modules\mbedtls\Kconfig:28) was
    selected (set =y), but MBEDTLS_LIBRARY_NRF_SECURITY (defined at
    C:/Users/pmariyappan/ncs/v2.5.1/nrf/Kconfig.nrf:49) ended up as the choice selection. See
    docs.zephyrproject.org/.../kconfig.html and/or look up
    MBEDTLS_BUILTIN 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 NET_SOCKETS_SOCKOPT_TLS is enabled.

    -- Found GnuLd: c:/ncs/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/toolchains/c57af46cb7/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
    Dropping partition 'nrf_modem_lib_trace' since its size is 0.
    Dropping partition 'nonsecure_storage' since it is empty.
    CMake Error at CMakeLists.txt:14 (message):
    Credentials not found. Please run 'python3 src/creds/convert_keys.py'
    before building


    -- Configuring incomplete, errors occurred!
    See also "C:/Users/pmariyappan/ncs/aws_iot/aws_iot_mqtt/build/CMakeFiles/CMakeOutput.log".
    See also "C:/Users/pmariyappan/ncs/aws_iot/aws_iot_mqtt/build/CMakeFiles/CMakeError.log".
    FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\c57af46cb7\opt\bin\cmake.EXE' -DWEST_PYTHON=C:/ncs/toolchains/c57af46cb7/opt/bin/python.exe '-Bc:\Users\pmariyappan\ncs\aws_iot\aws_iot_mqtt\build' -GNinja [email protected] -DNCS_TOOLCHAIN_VERSION=NONE -DCONF_FILE=c:/Users/pmariyappan/ncs/aws_iot/aws_iot_mqtt/prj.conf -DBOARD_ROOT=c:/users/pmariyappan/ncs/aws_iot/aws_iot_mqtt '-Sc:\Users\pmariyappan\ncs\aws_iot\aws_iot_mqtt'

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

  • purushothaman said:
    Yes sure thank you and can you please look at aws_iot_mqtt sample code also im getting this build error

    I can't find this sample in the SDK. Where did you get it from?

Related