AWS IoT WiFi MQTT with nRF7002DK

I am having trouble getting a sample application to compile using the nRF7002DK and AWS IoT core. I am using nRF Connect 2.3.0.

I followed the getting started with MQTT guide and was able to verify connection using the default settings and a desktop MQTT client.

However, I know based on this answer, I will need to use the AWS IoT library to provision my device.
Adding the following three lines to the MQTT sample application results in a build failure. The relevant build log and the prj.conf file is attached.

CONFIG_AWS_IOT=y
CONFIG_AWS_IOT_CLIENT_ID_STATIC="test-client"
CONFIG_AWS_IOT_BROKER_HOST_NAME="example.endpoint.com"


3630.prj.conf
FAILED: zephyr/CMakeFiles/zephyr.dir/misc/generated/configs.c.obj 
ccache /opt/nordic/ncs/toolchains/v2.3.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc -DCONFIG_ZEPHYR -DKERNEL -DMBEDTLS_CONFIG_FILE=\"nrf-config.h\" -DMBEDTLS_USER_CONFIG_FILE=\"nrf-config-user.h\" -DNRF5340_XXAA_APPLICATION -DNRF_SKIP_FICR_NS_COPY_TO_RAM -DPB_MAX_REQUIRED_FIELDS=64 -DUSE_PARTITION_MANAGER=1 -D_ANSI_SOURCE -D_FORTIFY_SOURCE=1 -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR__=1 -I/opt/nordic/ncs/v2.3.0/zephyr/kernel/include -I/opt/nordic/ncs/v2.3.0/zephyr/arch/arm/include -I/opt/nordic/ncs/v2.3.0/zephyr/include -Izephyr/include/generated -I/opt/nordic/ncs/v2.3.0/zephyr/soc/arm/nordic_nrf/nrf53 -I/opt/nordic/ncs/v2.3.0/zephyr/lib/libc/newlib/include -I/opt/nordic/ncs/v2.3.0/zephyr/soc/arm/nordic_nrf/common/. -I/opt/nordic/ncs/v2.3.0/zephyr/subsys/bluetooth -I/opt/nordic/ncs/v2.3.0/zephyr/subsys/net/l2 -I/opt/nordic/ncs/v2.3.0/zephyr/subsys/net/lib/sockets/. -I/opt/nordic/ncs/v2.3.0/zephyr/subsys/net/lib/tls_credentials/. -I/opt/nordic/ncs/v2.3.0/zephyr/subsys/net/lib/dns/. -I/opt/nordic/ncs/v2.3.0/zephyr/subsys/settings/include -I/opt/nordic/ncs/v2.3.0/nrf/include -I/opt/nordic/ncs/v2.3.0/nrf/drivers/wifi/nrf700x/zephyr/inc -I/opt/nordic/ncs/v2.3.0/nrf/drivers/wifi/nrf700x/osal/utils/inc -I/opt/nordic/ncs/v2.3.0/nrf/drivers/wifi/nrf700x/osal/os_if/inc -I/opt/nordic/ncs/v2.3.0/nrf/drivers/wifi/nrf700x/osal/bus_if/bus/qspi/inc -I/opt/nordic/ncs/v2.3.0/nrf/drivers/wifi/nrf700x/osal/bus_if/bal/inc -I/opt/nordic/ncs/v2.3.0/nrf/drivers/wifi/nrf700x/osal/fw_if/umac_if/inc -I/opt/nordic/ncs/v2.3.0/nrf/drivers/wifi/nrf700x/osal/fw_load/mips/fw/inc -I/opt/nordic/ncs/v2.3.0/nrf/drivers/wifi/nrf700x/osal/hw_if/hal/inc -I/opt/nordic/ncs/v2.3.0/nrf/drivers/wifi/nrf700x/zephyr/src/qspi/inc -I/opt/nordic/ncs/v2.3.0/zephyr/subsys/net/ip -I/opt/nordic/ncs/v2.3.0/nrf/drivers/wifi/nrf700x/osal/hw_if/hal/inc/fw -I/opt/nordic/ncs/v2.3.0/nrf/drivers/wifi/nrf700x/osal/fw_if/umac_if/inc/fw -I/opt/nordic/ncs/v2.3.0/nrf/tests/include -I/opt/nordic/ncs/v2.3.0/modules/lib/hostap/zephyr/src -I/opt/nordic/ncs/v2.3.0/modules/lib/hostap/zephyr/.. -I/opt/nordic/ncs/v2.3.0/modules/lib/hostap/zephyr/../wpa_supplicant -I/opt/nordic/ncs/v2.3.0/modules/lib/hostap/zephyr/../src -I/opt/nordic/ncs/v2.3.0/modules/hal/cmsis/CMSIS/Core/Include -I/opt/nordic/ncs/v2.3.0/modules/hal/nordic/nrfx -I/opt/nordic/ncs/v2.3.0/modules/hal/nordic/nrfx/drivers/include -I/opt/nordic/ncs/v2.3.0/modules/hal/nordic/nrfx/mdk -I/opt/nordic/ncs/v2.3.0/zephyr/modules/hal_nordic/nrfx/. -Imodules/libmetal/libmetal/lib/include -I/opt/nordic/ncs/v2.3.0/modules/lib/nanopb -I/opt/nordic/ncs/v2.3.0/modules/lib/open-amp/open-amp/lib/include -I/opt/nordic/ncs/v2.3.0/modules/crypto/tinycrypt/lib/include -I/opt/nordic/ncs/v2.3.0/nrfxlib/softdevice_controller/include -Imodules/nrfxlib/nrfxlib/nrf_security/src/include/generated -I/opt/nordic/ncs/v2.3.0/nrfxlib/nrf_security/include -I/opt/nordic/ncs/v2.3.0/nrfxlib/nrf_security/include/mbedtls -I/opt/nordic/ncs/v2.3.0/nrfxlib/nrf_security/include/psa -I/opt/nordic/ncs/v2.3.0/modules/crypto/mbedtls/include -I/opt/nordic/ncs/v2.3.0/modules/crypto/mbedtls/include/mbedtls -I/opt/nordic/ncs/v2.3.0/modules/crypto/mbedtls/include/psa -I/opt/nordic/ncs/v2.3.0/modules/crypto/mbedtls/library -I/opt/nordic/ncs/v2.3.0/nrfxlib/nrf_security/../crypto/nrf_oberon/include -I/opt/nordic/ncs/v2.3.0/nrfxlib/nrf_security/../crypto/nrf_oberon/include/mbedtls -I/opt/nordic/ncs/v2.3.0/nrfxlib/nrf_security/../crypto/nrf_oberon/include/psa -I/opt/nordic/ncs/v2.3.0/nrfxlib/crypto/nrf_oberon/include/mbedtls -I/opt/nordic/ncs/v2.3.0/nrfxlib/crypto/nrf_oberon/include -isystem /opt/nordic/ncs/v2.3.0/nrfxlib/crypto/nrf_cc312_platform/include -fno-strict-aliasing -Os -imacros /Users/ericpietrowicz/firmware/mqtt_over_wifi_nrf7002DK/build/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m33 -mthumb -mabi=aapcs -mfp16-format=ieee --sysroot=/opt/nordic/ncs/toolchains/v2.3.0/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi -imacros /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -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=/Users/ericpietrowicz/firmware/mqtt_over_wifi_nrf7002DK=CMAKE_SOURCE_DIR -fmacro-prefix-map=/opt/nordic/ncs/v2.3.0/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/opt/nordic/ncs/v2.3.0=WEST_TOPDIR -ffunction-sections -fdata-sections -std=c99 -MD -MT zephyr/CMakeFiles/zephyr.dir/misc/generated/configs.c.obj -MF zephyr/CMakeFiles/zephyr.dir/misc/generated/configs.c.obj.d -o zephyr/CMakeFiles/zephyr.dir/misc/generated/configs.c.obj -c zephyr/misc/generated/configs.c
/var/folders/yr/7bpmrr314hjd3612g2vxngr40000gn/T//ccka8LLb.s: Assembler messages:
/var/folders/yr/7bpmrr314hjd3612g2vxngr40000gn/T/ccka8LLb.s:1682: Error: missing expression
[178/521] Building C object zephyr/subsys/net/ip/CMakeFiles/subsys__net__ip.dir/tcp.c.obj
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: /opt/nordic/ncs/toolchains/v2.3.0/bin/cmake --build /Users/ericpietrowicz/firmware/mqtt_over_wifi_nrf7002DK/build

  • Hi Epietro and Amanda, I tried checking out the PR and building the new aws_iot sample but couldn't get it to work. I have a nrf7002dk and am on v2.4.0. What I did was git remote add the pull request's branch to /opt/nordic/ncs/v2.4.0/nrf, checked out the branch, and opened the newly added ./samples/net/aws_iot sample. When I build using nrf7002dk board file (with its KConfig fragments), I get these errors: 

    -- Including generated dts.cmake file: /Users/looki/Desktop/aws_iot_dev/build/zephyr/dts.cmake
    
    warning: Experimental symbol NET_SOCKETS_SOCKOPT_TLS is enabled.
    
    
    warning: Experimental symbol NET_CONNECTION_MANAGER is enabled.
    
    
    warning: the choice symbol CHOICE_PSA_EITS_BACKEND_ZEPHYR_SETTINGS (defined at /opt/nordic/ncs/v2.4.0/nrf/subsys/nrf_security/Kconfig.psa:112, /opt/nordic/ncs/v2.4.0/nrfxlib/nrf_security/Kconfig.psa:105) is defined with a prompt outside the choice
    
    warning: the choice symbol CHOICE_PSA_EITS_BACKEND_ZEPHYR_SETTINGS (defined at /opt/nordic/ncs/v2.4.0/nrf/subsys/nrf_security/Kconfig.psa:112, /opt/nordic/ncs/v2.4.0/nrfxlib/nrf_security/Kconfig.psa:105) is defined with a prompt outside the choice
    
    warning: MBEDTLS_ENTROPY_C (defined at /opt/nordic/ncs/v2.4.0/nrf/subsys/net/openthread/Kconfig.defconfig:89, /opt/nordic/ncs/v2.4.0/nrf/subsys/nrf_security/Kconfig.legacy:357, /opt/nordic/ncs/v2.4.0/nrfxlib/nrf_security/Kconfig.legacy:359) has direct dependencies NET_L2_OPENTHREAD || (!MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG && MBEDTLS_LEGACY_CRYPTO_C && NRF_SECURITY) || (!MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG && MBEDTLS_LEGACY_CRYPTO_C && NRF_SECURITY) with value n, but is currently being y-selected by the following symbols:
     - WPA_SUPP_CRYPTO (defined at /opt/nordic/ncs/v2.4.0/modules/lib/hostap/zephyr/Kconfig:66), with value y, direct dependencies WPA_SUPP (value: y), and select condition WPA_SUPP (value: y)
    
    error: Aborting due to Kconfig warnings
    
    Parsing /Users/looki/Desktop/aws_iot_dev/Kconfig
    Loaded configuration '/opt/nordic/ncs/v2.4.0/nrf/boards/arm/nrf7002dk_nrf5340/nrf7002dk_nrf5340_cpuapp_defconfig'
    Merged configuration '/Users/looki/Desktop/aws_iot_dev/prj.conf'
    Merged configuration '/Users/looki/Desktop/aws_iot_dev/boards/nrf7002dk_nrf5340_cpuapp.conf'
    Merged configuration '/Users/looki/Desktop/aws_iot_dev/boards/nrf7002dk_nrf5340_cpuapp.conf'
    CMake Error at /opt/nordic/ncs/v2.4.0/zephyr/cmake/modules/kconfig.cmake:339 (message):
      command failed with return code: 1
    Call Stack (most recent call first):
      /opt/nordic/ncs/v2.4.0/nrf/cmake/modules/kconfig.cmake:29 (include)
      /opt/nordic/ncs/v2.4.0/zephyr/cmake/modules/zephyr_default.cmake:115 (include)
      /opt/nordic/ncs/v2.4.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
      /opt/nordic/ncs/v2.4.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
      CMakeLists.txt:9 (find_package)

    I've tried debugging them today and had no luck. I checked out this post  Kconfig selection error in lwm2m client project but didn't fully understand what the problem was. I'm wondering if it's because 1. I made some error while checking out the upstream branch or 2. some internal dependency problem in my zephyr. It sounds like both of you were able to make the sample work, so it'd be great if I can get some help on the issue!

    P.S.: After checking out the nrf branch, building other existing projects fail for me too.

    -Best,

    Eric

Related