Problem on nRF9160 making a modified lte_ble_gateway sample

Our application on a nRF9160 to act as intermediary between an AWS cloud and another nRF devicee over bluetooth.  So I attempted to merge the bluetooth IOT sample with the bluetooth portion lte_ble_gateway sample

When I tried running this I got this crash in the early portion of the bluetooth intialization, before any IOT code is running. 

[00:00:00.251,251] <inf> health_hub: The AWS IoT sample started, version: v1.0.0
[00:00:00.251,281] <inf> hp_ble: Initializing Bluetooth..
ASSERTION FAIL [err == 0] @ WEST_TOPDIR/zephyr/subsys/bluetooth/host/hci_core.c:338
command opcode 0x0c03 timeout with err -11
[00:00:10.251,617] <err> os: r0/a1: 0x00000003 r1/a2: 0x00000000 r2/a3: 0x00000002
[00:00:10.251,647] <err> os: r3/a4: 0x20011498 r12/ip: 0x00000010 r14/lr: 0x00020a35
[00:00:10.251,647] <err> os: xpsr: 0x41000000
[00:00:10.251,678] <err> os: Faulting instruction address (r15/pc): 0x00020a40
[00:00:10.251,708] <err> os: >>> ZEPHYR FATAL ERROR 3: Kernel oops on CPU 0
[00:00:10.251,739] <err> os: Current thread: 0x20014010 (unknown)
*** Booting nRF Connect SDK v2.5.1 ***Resetting system

    net_buf_put(&bt_dev.cmd_tx_queue, net_buf_ref(buf));

    err = k_sem_take(&sync_sem, HCI_CMD_TIMEOUT);
    BT_ASSERT_MSG(err == 0, "command opcode 0x%04x timeout with err %d", opcode, err);
Somewhere in the k_sem_take()  we get that error 11 but it isn't clear what it is looking for at that point and stepping in doesn't work well.
Any ideas of what sort of problem can give this error?

Here is the prj.conf in case this is a missing configuration problem or something

#
# Copyright (c) 2020 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#
#CONFIG_DEBUG=y

# General
CONFIG_LOG=y
CONFIG_LOG_BUFFER_SIZE=2048
CONFIG_HW_ID_LIBRARY=y
CONFIG_ASSERT=y
CONFIG_JSON_LIBRARY=y

# Heap and stacks
#CONFIG_HEAP_MEM_POOL_SIZE=8192
#CONFIG_MAIN_STACK_SIZE=4096
#CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048

#CONFIG_BOOTLOADER_MCUBOOT=y

# Network
CONFIG_NETWORKING=y
CONFIG_NET_NATIVE=y
CONFIG_NET_IPV4=y
CONFIG_NET_CONNECTION_MANAGER=y

# AWS IoT library
CONFIG_AWS_IOT=y
CONFIG_AWS_IOT_CLIENT_ID_STATIC="my-thing"
CONFIG_AWS_IOT_BROKER_HOST_NAME="xxx.amazonaws.com"
CONFIG_AWS_IOT_SEC_TAG=201
CONFIG_AWS_IOT_APP_SUBSCRIPTION_LIST_COUNT=2
CONFIG_AWS_IOT_TOPIC_UPDATE_DELTA_SUBSCRIBE=y
CONFIG_AWS_IOT_TOPIC_GET_ACCEPTED_SUBSCRIBE=y
CONFIG_AWS_IOT_TOPIC_GET_REJECTED_SUBSCRIBE=y
CONFIG_AWS_IOT_LAST_WILL=y

# MQTT - Maximum MQTT keepalive timeout specified by AWS IoT Core
CONFIG_MQTT_KEEPALIVE=1200
CONFIG_MQTT_CLEAN_SESSION=y

# Console for user association
CONFIG_CONSOLE_SUBSYS=y
CONFIG_CONSOLE_GETCHAR=y

# Enable Bluetooth stack and libraries
CONFIG_BT=y
CONFIG_BT_H4=y
CONFIG_BT_WAIT_NOP=y
CONFIG_BT_CENTRAL=y
CONFIG_BT_GATT_CLIENT=y
CONFIG_BT_GATT_DM=y
CONFIG_BT_SCAN=y
CONFIG_BT_SCAN_FILTER_ENABLE=y
CONFIG_BT_SCAN_UUID_CNT=1

CONFIG_UART_INTERRUPT_DRIVEN=y

# Heap and stacks
CONFIG_HEAP_MEM_POOL_SIZE=16384
CONFIG_MAIN_STACK_SIZE=8192
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096

# Update Data Length and MTU (BT_L2CAP_RX_MTU = CONFIG_BT_BUF_ACL_RX_SIZE - BT_L2CAP_HDR_SIZE)
CONFIG_BT_USER_DATA_LEN_UPDATE=y
CONFIG_BT_CTLR_DATA_LENGTH_MAX=251
CONFIG_BT_BUF_ACL_RX_SIZE=251
CONFIG_BT_BUF_ACL_TX_SIZE=251
CONFIG_BT_L2CAP_TX_MTU=247


#================================================
# Little FS
#
# Optionally force the file system to be recreated
# CONFIG_APP_WIPE_STORAGE=y


# Let __ASSERT do its job
CONFIG_DEBUG=n

#CONFIG_FLASH=n
#CONFIG_FLASH_MAP=n
#CONFIG_FLASH_PAGE_LAYOUT=n

CONFIG_FILE_SYSTEM=y
CONFIG_FILE_SYSTEM_LITTLEFS=y

# CONFIG_PM_PARTITION_REGION_LITTLEFS_EXTERNAL=y

CONFIG_NVS=y
CONFIG_SETTINGS=y

  • Hello @ minecraftle game, I think the crash occurred during the initialization of the Bluetooth stack in your modified nRF9160 application. The specific error message "ASSERTION FAIL [err == 0] @ WEST_TOPDIR/zephyr/subsys/bluetooth/host/hci_core.c:338" indicates that an assertion failed, causing the program to terminate.

    The error code -11 corresponds to a timeout error. It is possible that there is an issue with the Bluetooth initialization or a timeout occurred while waiting for a response from the Bluetooth stack.

    I think you can review the code modifications. Verify that the merging of the Bluetooth IoT sample with the LTE BLE gateway sample was done correctly. Check for any potential conflicts or issues that might have arisen during the merge process.

  • I ran the lte_gateway sample and got the same error, so it isn't part of the merge.  It is too early for it to be part of the bluetooth scanning or connection itself.

    We have used this dev board to do IOT and bluetooth on other samples using pre v2.5 versions.  Why is this sample not working?

    Is there another sample or app that I can model the code off of instead

    ASSERTION FAIL [err == 0] @ WEST_TOPDIR/zephyr/subsys/bluetooth/host/hci_core.c:338
    command opcode 0x0c03 timeout with err -11
    [00:00:10.261,932] <err> os: r0/a1: 0x00000003 r1/a2: 0x00000000 r2/a3: 0x00000002
    [00:00:10.261,962] <err> os: r3/a4: 0x2000d218 r12/ip: 0x00000010 r14/lr: 0x000102b5
    [00:00:10.261,962] <err> os: xpsr: 0x41000000
    [00:00:10.261,962] <err> os: Faulting instruction address (r15/pc): 0x000102c0
    [00:00:10.262,023] <err> os: >>> ZEPHYR FATAL ERROR 3: Kernel oops on CPU 0
    [00:00:10.262,054] <err> os: Current thread: 0x2000f7e0 (unknown)
    *** Booting nRF Connect SDK v2.5.0 ***Resetting system
    [00:00:00.251,129] <inf> lte_ble_gw: LTE Sensor Gateway sample started
    [00:00:00.251,312] <inf> lte_ble_gw: Initializing Bluetooth..
    [00:00:00.499,786] <inf> lte_ble_gw: Establishing LTE link (this may take some time) ...
    ASSERTION FAIL [err == 0] @ WEST_TOPDIR/zephyr/subsys/bluetooth/host/hci_core.c:338
    command opcode 0x0c03 timeout with err -11

  • Build of LPUART sample also fails.

    Building lpuart
    west build --build-dir c:/PhaseMargin/HealthPatch/HealthHub_Dev/HealthHub_NordicDev/lpuart/build c:/PhaseMargin/HealthPatch/HealthHub_Dev/HealthHub_NordicDev/lpuart --pristine --board [email protected] --no-sysbuild -- -DNCS_TOOLCHAIN_VERSION=NONE -DBOARD_ROOT=c:/phasemargin/healthpatch/healthhub_dev/healthhub_nordicdev/aws_iot;c:/phasemargin/healthpatch/healthhub_dev/healthhub_nordicdev/aws_iot_mqtt;c:/phasemargin/healthpatch/healthhub_dev/healthhub_nordicdev/lte_ble_gateway;c:/phasemargin/healthpatch/healthhub_dev/healthhub_nordicdev/healthhub;c:/phasemargin/healthpatch/healthhub_dev/healthhub_nordicdev/lpuart;. -DCONF_FILE=c:/PhaseMargin/HealthPatch/HealthHub_Dev/HealthHub_NordicDev/lpuart/prj.conf

    -- west build: generating a build system
    Loading Zephyr default modules (Zephyr base).
    -- Application: C:/PhaseMargin/HealthPatch/HealthHub_Dev/HealthHub_NordicDev/lpuart
    -- 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:/ncs/v2.5.1/zephyr/.cache
    -- Zephyr version: 3.4.99 (C:/ncs/v2.5.1/zephyr)
    -- Found west (found suitable version "1.1.0", minimum required is "0.14.0")
    -- Board: nrf9160dk_nrf52840, 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:/ncs/v2.5.1/zephyr/boards/arm/nrf9160dk_nrf52840/nrf9160dk_nrf52840.dts
    -- Found devicetree overlay: C:/ncs/v2.5.1/zephyr/boards/arm/nrf9160dk_nrf52840/nrf9160dk_nrf52840_0_14_0.overlay
    -- Generated zephyr.dts: C:/PhaseMargin/HealthPatch/HealthHub_Dev/HealthHub_NordicDev/lpuart/build/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: C:/PhaseMargin/HealthPatch/HealthHub_Dev/HealthHub_NordicDev/lpuart/build/zephyr/include/generated/devicetree_generated.h
    -- Including generated dts.cmake file: C:/PhaseMargin/HealthPatch/HealthHub_Dev/HealthHub_NordicDev/lpuart/build/zephyr/dts.cmake

    warning: UART_1_ASYNC (defined at drivers/serial/Kconfig.nrfx:122) was assigned the value 'y' but
    got the value 'n'. Check these unsatisfied dependencies: HAS_HW_NRF_UARTE1 (=n). See
    docs.zephyrproject.org/.../kconfig.html and/or look up UART_1_ASYNC 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: UART_1_NRF_HW_ASYNC (defined at drivers/serial/Kconfig.nrfx:151) was assigned the value 'y'
    but got the value 'n'. Check these unsatisfied dependencies: UART_1_ASYNC (=n), HAS_HW_NRF_UARTE1
    (=n). See docs.zephyrproject.org/.../kconfig.html and/or look
    up UART_1_NRF_HW_ASYNC 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: UART_1_NRF_ASYNC_LOW_POWER (defined at drivers/serial/Kconfig.nrfx:160) was assigned the
    value 'y' but got the value 'n'. Check these unsatisfied dependencies: HAS_HW_NRF_UARTE1 (=n). See
    docs.zephyrproject.org/.../kconfig.html and/or look up
    UART_1_NRF_ASYNC_LOW_POWER 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: UART_1_NRF_HW_ASYNC_TIMER (defined at drivers/serial/Kconfig.nrfx:168) was assigned the
    value '2' but got the value ''. Check these unsatisfied dependencies: UART_1_NRF_HW_ASYNC (=n),
    HAS_HW_NRF_UARTE1 (=n). See
    docs.zephyrproject.org/.../kconfig.html and/or look up
    UART_1_NRF_HW_ASYNC_TIMER 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.5.1/zephyr/Kconfig
    Loaded configuration 'C:/ncs/v2.5.1/zephyr/boards/arm/nrf9160dk_nrf52840/nrf9160dk_nrf52840_defconfig'
    Merged configuration 'c:/PhaseMargin/HealthPatch/HealthHub_Dev/HealthHub_NordicDev/lpuart/prj.conf'
    Configuration saved to 'C:/PhaseMargin/HealthPatch/HealthHub_Dev/HealthHub_NordicDev/lpuart/build/zephyr/.config'
    Kconfig header saved to 'C:/PhaseMargin/HealthPatch/HealthHub_Dev/HealthHub_NordicDev/lpuart/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
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/PhaseMargin/HealthPatch/HealthHub_Dev/HealthHub_NordicDev/lpuart/build
    -- west build: building application
    [1/139] Generating ../../zephyr/include/generated/ncs_version.h
    [2/139] Generating misc/generated/syscalls.json, misc/generated/struct_tags.json
    [3/139] Generating include/generated/version.h
    -- Zephyr version: 3.4.99 (C:/ncs/v2.5.1/zephyr), build: 83980fe16794
    [4/139] Generating include/generated/syscall_dispatch.c, include/generated/syscall_list.h
    [5/139] Generating include/generated/driver-validation.h
    [6/139] Generating include/generated/kobj-types-enum.h, include/generated/otype-to-str.h, include/generated/otype-to-size.h
    [7/139] Building C object zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj
    [8/139] Generating include/generated/offsets.h
    [9/139] Building ASM object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/cpu_idle.S.obj
    [10/139] Building ASM object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/nmi_on_reset.S.obj
    [11/139] Building C object zephyr/arch/common/CMakeFiles/isr_tables.dir/isr_tables.c.obj
    [12/139] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/nmi.c.obj
    [13/139] Building C object zephyr/arch/common/CMakeFiles/arch__common.dir/sw_isr_common.c.obj
    [14/139] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/swap.c.obj
    [15/139] Building ASM object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/swap_helper.S.obj
    [16/139] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/prep_c.c.obj
    [17/139] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/thread.c.obj
    [18/139] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/irq_manage.c.obj
    [19/139] Building ASM object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/isr_wrapper.S.obj
    [20/139] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/fatal.c.obj
    [21/139] Building ASM object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/exc_exit.S.obj
    [22/139] Building ASM object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/fault_s.S.obj
    [23/139] Building ASM object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/reset.S.obj
    [24/139] Building ASM object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/vector_table.S.obj
    [25/139] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/__/common/tls.c.obj
    [26/139] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/irq_init.c.obj
    [27/139] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/fpu.c.obj
    [28/139] Building ASM object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/__aeabi_read_tp.S.obj
    [29/139] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/thread_abort.c.obj
    [30/139] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/scb.c.obj
    [31/139] Linking C static library zephyr\arch\common\libisr_tables.a
    [32/139] Building C object zephyr/arch/arch/arm/core/aarch32/mpu/CMakeFiles/arch__arm__core__aarch32__mpu.dir/arm_core_mpu.c.obj
    [33/139] Building C object zephyr/lib/libc/common/CMakeFiles/lib__libc__common.dir/source/stdlib/abort.c.obj
    [34/139] Building C object zephyr/arch/arch/arm/core/aarch32/mpu/CMakeFiles/arch__arm__core__aarch32__mpu.dir/arm_mpu.c.obj
    [35/139] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/fault.c.obj
    [36/139] Building C object zephyr/lib/libc/picolibc/CMakeFiles/lib__libc__picolibc.dir/libc-hooks.c.obj
    [37/139] Building C object zephyr/soc/soc/arm/common/cortex_m/CMakeFiles/soc__arm__common__cortex_m.dir/arm_mpu_regions.c.obj
    [38/139] Building C object zephyr/lib/libc/common/CMakeFiles/lib__libc__common.dir/source/stdlib/malloc.c.obj
    [39/139] Linking C static library zephyr\arch\arch\arm\core\aarch32\libarch__arm__core__aarch32.a
    [40/139] Linking C static library zephyr\arch\common\libarch__common.a
    [41/139] Linking C static library zephyr\lib\libc\picolibc\liblib__libc__picolibc.a
    [42/139] Linking C static library zephyr\arch\arch\arm\core\aarch32\cortex_m\libarch__arm__core__aarch32__cortex_m.a
    [43/139] Building C object zephyr/soc/soc/arm/nordic_nrf/nrf52/CMakeFiles/soc__arm__nordic_nrf__nrf52.dir/soc.c.obj
    [44/139] Linking C static library zephyr\arch\arch\arm\core\aarch32\mpu\libarch__arm__core__aarch32__mpu.a
    [45/139] Linking C static library zephyr\soc\soc\arm\common\cortex_m\libsoc__arm__common__cortex_m.a
    [46/139] Linking C static library zephyr\lib\libc\common\liblib__libc__common.a
    [47/139] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/dec.c.obj
    [48/139] 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 -DKERNEL -DNRF52840_XXAA -DPICOLIBC_INTEGER_PRINTF_SCANF -D_FORTIFY_SOURCE=1 -D_POSIX_C_SOURCE=200809 -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR__=1 -IC:/ncs/v2.5.1/zephyr/include -Izephyr/include/generated -IC:/ncs/v2.5.1/zephyr/soc/arm/nordic_nrf/nrf52 -IC:/ncs/v2.5.1/zephyr/soc/arm/nordic_nrf/common/. -IC:/ncs/v2.5.1/nrf/include -IC:/ncs/v2.5.1/nrf/tests/include -IC:/ncs/v2.5.1/modules/hal/cmsis/CMSIS/Core/Include -IC:/ncs/v2.5.1/zephyr/modules/cmsis/. -IC:/ncs/v2.5.1/modules/hal/nordic/nrfx -IC:/ncs/v2.5.1/modules/hal/nordic/nrfx/drivers/include -IC:/ncs/v2.5.1/modules/hal/nordic/nrfx/mdk -IC:/ncs/v2.5.1/zephyr/modules/hal_nordic/nrfx/. -isystem C:/ncs/v2.5.1/nrfxlib/crypto/nrf_cc310_platform/include -fno-strict-aliasing -Os -imacros C:/PhaseMargin/HealthPatch/HealthHub_Dev/HealthHub_NordicDev/lpuart/build/zephyr/include/generated/autoconf.h -fno-printf-return-value -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfp16-format=ieee --sysroot=C:/ncs/toolchains/c57af46cb7/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi -imacros C:/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 -ftls-model=local-exec -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop -fmacro-prefix-map=C:/PhaseMargin/HealthPatch/HealthHub_Dev/HealthHub_NordicDev/lpuart=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/ncs/v2.5.1/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:/ncs/v2.5.1=WEST_TOPDIR -ffunction-sections -fdata-sections --specs=picolibc.specs -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 C:/ncs/v2.5.1/zephyr/include/zephyr/toolchain/gcc.h:92,
    from C:/ncs/v2.5.1/zephyr/include/zephyr/toolchain.h:50,
    from C:/ncs/v2.5.1/zephyr/include/zephyr/kernel_includes.h:19,
    from C:/ncs/v2.5.1/zephyr/include/zephyr/kernel.h:17,
    from ../src/main.c:7:
    ../src/main.c: In function 'main':
    C:/ncs/v2.5.1/zephyr/include/zephyr/device.h:85:41: error: '__device_dts_ord_DT_N_NODELABEL_lpuart_ORD' undeclared (first use in this function)
    85 | #define DEVICE_NAME_GET(dev_id) _CONCAT(__device_, dev_id)
    | ^~~~~~~~~
    C:/ncs/v2.5.1/zephyr/include/zephyr/toolchain/common.h:132:26: note: in definition of macro '_DO_CONCAT'
    132 | #define _DO_CONCAT(x, y) x ## y
    | ^
    C:/ncs/v2.5.1/zephyr/include/zephyr/device.h:85:33: note: in expansion of macro '_CONCAT'
    85 | #define DEVICE_NAME_GET(dev_id) _CONCAT(__device_, dev_id)
    | ^~~~~~~
    C:/ncs/v2.5.1/zephyr/include/zephyr/device.h:211:37: note: in expansion of macro 'DEVICE_NAME_GET'
    211 | #define DEVICE_DT_NAME_GET(node_id) DEVICE_NAME_GET(Z_DEVICE_DT_DEV_ID(node_id))
    | ^~~~~~~~~~~~~~~
    C:/ncs/v2.5.1/zephyr/include/zephyr/device.h:228:34: note: in expansion of macro 'DEVICE_DT_NAME_GET'
    228 | #define DEVICE_DT_GET(node_id) (&DEVICE_DT_NAME_GET(node_id))
    | ^~~~~~~~~~~~~~~~~~
    ../src/main.c:124:39: note: in expansion of macro 'DEVICE_DT_GET'
    124 | const struct device *lpuart = DEVICE_DT_GET(DT_NODELABEL(lpuart));
    | ^~~~~~~~~~~~~
    C:/ncs/v2.5.1/zephyr/include/zephyr/device.h:85:41: note: each undeclared identifier is reported only once for each function it appears in
    85 | #define DEVICE_NAME_GET(dev_id) _CONCAT(__device_, dev_id)
    | ^~~~~~~~~
    C:/ncs/v2.5.1/zephyr/include/zephyr/toolchain/common.h:132:26: note: in definition of macro '_DO_CONCAT'
    132 | #define _DO_CONCAT(x, y) x ## y
    | ^
    C:/ncs/v2.5.1/zephyr/include/zephyr/device.h:85:33: note: in expansion of macro '_CONCAT'
    85 | #define DEVICE_NAME_GET(dev_id) _CONCAT(__device_, dev_id)
    | ^~~~~~~
    C:/ncs/v2.5.1/zephyr/include/zephyr/device.h:211:37: note: in expansion of macro 'DEVICE_NAME_GET'
    211 | #define DEVICE_DT_NAME_GET(node_id) DEVICE_NAME_GET(Z_DEVICE_DT_DEV_ID(node_id))
    | ^~~~~~~~~~~~~~~
    C:/ncs/v2.5.1/zephyr/include/zephyr/device.h:228:34: note: in expansion of macro 'DEVICE_DT_NAME_GET'
    228 | #define DEVICE_DT_GET(node_id) (&DEVICE_DT_NAME_GET(node_id))
    | ^~~~~~~~~~~~~~~~~~
    ../src/main.c:124:39: note: in expansion of macro 'DEVICE_DT_GET'
    124 | const struct device *lpuart = DEVICE_DT_GET(DT_NODELABEL(lpuart));
    | ^~~~~~~~~~~~~
    [49/139] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/hex.c.obj
    [50/139] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/fdtable.c.obj
    [51/139] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/cbprintf_packaged.c.obj
    [52/139] Linking C static library zephyr\soc\soc\arm\nordic_nrf\nrf52\libsoc__arm__nordic_nrf__nrf52.a
    [53/139] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/printk.c.obj
    [54/139] Building C object zephyr/boards/arm/nrf9160dk_nrf52840/CMakeFiles/boards__arm__nrf9160dk_nrf52840.dir/board.c.obj
    [55/139] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/sem.c.obj
    [56/139] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/timeutil.c.obj
    [57/139] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/rb.c.obj
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\c57af46cb7\opt\bin\cmake.EXE' --build 'c:\PhaseMargin\HealthPatch\HealthHub_Dev\HealthHub_NordicDev\lpuart\build'

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

  • Seems to build well here:

    PS C:\ncs\v2.5.0\nrf> git checkout v2.5.1
    Previous HEAD position was 750a0eab9 version: Update VERSION to 2.5.2
    HEAD is now at 87355af59 version: Update VERSION to 2.5.1
    M       samples/cellular/sms/prj.conf
    PS C:\ncs\v2.5.0\nrf> west update
    === updating zephyr (zephyr):
    Previous HEAD position was 4b5ef27041 [nrf fromtree] wifi: shell: Fix default band value
    HEAD is now at 83980fe167 [nrf fromtree] boards: arm: nrf5340dk_nrf5340: Add SPI to supported peripherals
    M       boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_ns_defconfig
    === updating bsim (tools/bsim):
    HEAD is now at 384a091 west.yaml Update to 2.1.1
    === updating hostap (modules/lib/hostap):
    HEAD is now at eb6119524 [nrf fromlist] zephyr: Fix MBO build with GAS dependency
    === updating wfa-qt-control-app (modules/lib/wfa-qt-control-app):
    HEAD is now at 0e213ab [nrf noup]: zephyr: qt: Disconnect STA before reset
    === updating mcuboot (bootloader/mcuboot):
    HEAD is now at edfe1e14 [nrf noup] boards: thingy53: disable GPIO ISR support
    === updating qcbor (modules/tee/tf-m/qcbor):
    HEAD is now at 751d365 restore inc/qcbor.h for backwards compatibility (#181)
    === updating mbedtls (modules/crypto/mbedtls):
    HEAD is now at acea48fc8 [nrf noup]  Fix buffer overread with stream cipher
    === updating nrfxlib (nrfxlib):
    Previous HEAD position was a7ef13f9 softdevice_controller: update CHANGELOG.rst
    HEAD is now at ab72f33c crypto: Ensure correct CryptoCell libs for bootloaders
    === updating trusted-firmware-m (modules/tee/tf-m/trusted-firmware-m):
    HEAD is now at 1ceee7647 [nrf fromtree] platform: nordic_nrf: Fix nrf9160 non-secure peripheral regression
    === updating matter (modules/lib/matter):
    Previous HEAD position was ed68b724d6 [nrf noup] wifi: Fix 5GHz association
    HEAD is now at 899d210917 [nrf noup] wifi: avoid unwanted connect request
    Synchronizing submodule url for 'third_party/nlio/repo'
    Synchronizing submodule url for 'third_party/nlassert/repo'
    Synchronizing submodule url for 'third_party/nlunit-test/repo'
    Synchronizing submodule url for 'third_party/pigweed/repo'
    === updating cjson (modules/lib/cjson):
    HEAD is now at c6af068 [nrf fromtree] fix: potential memory leak in merge_patch() (#611)
    === updating azure-sdk-for-c (modules/lib/azure-sdk-for-c):
    HEAD is now at 308c171c [nrf fromlist] Make repository a Zephyr module
    === updating cirrus (modules/hal/cirrus-logic):
    HEAD is now at 9f6b381 sdk-mcu-drivers: Added build system configs and generated files
    === updating openthread (modules/lib/openthread):
    HEAD is now at 57ef721ee [ip6] fix constant name style and simplify filtering of ICMP types (#9512)
    === updating cmock (test/cmock):
    HEAD is now at f65066f Merge pull request #404 from tz18/patch-1
    Synchronizing submodule url for 'vendor/c_exception'
    Synchronizing submodule url for 'vendor/unity'
    === updating memfault-firmware-sdk (modules/lib/memfault-firmware-sdk):
    HEAD is now at c374e92 Memfault Firmware SDK 1.3.3 (Build 3838)
    === updating canopennode (modules/lib/canopennode):
    HEAD is now at dec12fa stack: map CANopenNode crc16_ccitt() to Zephyr crc16_itu_t()
    === updating chre (modules/lib/chre):
    HEAD is now at b7955c27 Merge pull request #7 from stephanosio/require_full_libcpp
    === updating cmsis (modules/hal/cmsis):
    HEAD is now at 1abf291 zephyr: cmake/kconfig are external
    === updating edtt (tools/edtt):
    HEAD is now at 64e5105 edttt_bsim: Avoid infinite exception loop
    === updating fatfs (modules/fs/fatfs):
    HEAD is now at 427159b zephyr: fix ffconf.h override use of STRINGIZE
    === updating hal_nordic (modules/hal/nordic):
    HEAD is now at 9784731 nrfx_qspi: Correct use of workaround for anomaly 215 and 43 in nrfx_qspi
    === updating hal_st (modules/hal/st):
    HEAD is now at 9b128ca sensor/stmemsc: Align stmemsc i/f to v2.3
    === updating hal_wurthelektronik (modules/hal/wurthelektronik):
    HEAD is now at 24ca987 Initialized WE HAL module repository.
    === updating libmetal (modules/hal/libmetal):
    HEAD is now at b91611a lib: update libmetal to release v2023.04.0
    === updating liblc3 (modules/lib/liblc3):
    HEAD is now at 448f3de Merge pull request #8 from carlescufi/rename
    === updating littlefs (modules/fs/littlefs):
    HEAD is now at ca583fd Merge tag 'v2.5.0' of https://github.com/littlefs-project/littlefs into zephyr
    === updating loramac-node (modules/lib/loramac-node):
    HEAD is now at 3029c9f3 utilities: fix few shadowed variables
    === updating lvgl (modules/lib/gui/lvgl):
    HEAD is now at 8a6a2d1d zephyr: Move gluecode back to zephyr main repository
    === updating lz4 (modules/lib/lz4):
    HEAD is now at 8e303c2 zephyr: make this repo a zephyr module
    === updating mipi-sys-t (modules/debug/mipi-sys-t):
    HEAD is now at a819419 library: allow building without wchar support
    === updating nanopb (modules/lib/nanopb):
    HEAD is now at 42fa8b2 Merge pull request #2 from pdgendt/zephyr
    === updating net-tools (tools/net-tools):
    HEAD is now at e0828aa net-setup: Add instructions for NAT and routing
    === updating nrf_hw_models (modules/bsim_hw_models/nrf_hw_models):
    HEAD is now at 57b61a9 INT CNTRL: Generalize to N controllers
    === updating open-amp (modules/lib/open-amp):
    HEAD is now at 42b7c57 cmake: Compile with WITH_DCACHE_RSC_TABLE
    === updating picolibc (modules/lib/picolibc):
    HEAD is now at d07c38ff0 Version 1.8.2
    === updating segger (modules/debug/segger):
    HEAD is now at 9d01912 segger: config: RTT spinlock implementation
    === updating tinycrypt (modules/crypto/tinycrypt):
    HEAD is now at 3e9a49d cmake: Fix conditional in root CMakeLists.txt
    === updating TraceRecorderSource (modules/debug/TraceRecorder):
    HEAD is now at 1ede7ce Merge pull request #16 from aronlander-pe/zephyr
    === updating tf-m-tests (modules/tee/tf-m/tf-m-tests):
    HEAD is now at 6a17330 dev-apis: platform: Increase timeout for nRF devs
    === updating uoscore-uedhoc (modules/lib/uoscore-uedhoc):
    HEAD is now at 5fe2cb6 2.2.1
    === updating zcbor (modules/lib/zcbor):
    HEAD is now at 67fd8bb Update version from 0.6.99 to 0.7.0
    === updating zscilib (modules/lib/zscilib):
    HEAD is now at 34c3432 Merge pull request #50 from microbuilder/ztest_fixes
    PS C:\ncs\v2.5.0\nrf> cd .\samples\bluetooth\hci_lpuart\
    PS C:\ncs\v2.5.0\nrf\samples\bluetooth\hci_lpuart> west build --board [email protected]
    -- west build: generating a build system
    Loading Zephyr default modules (Zephyr base).
    -- Application: C:/ncs/v2.5.0/nrf/samples/bluetooth/hci_lpuart
    -- CMake version: 3.20.5
    -- Using NCS Toolchain 2.5.20231017.848171396279 for building. (C:/ncs/toolchains/c57af46cb7/cmake)
    CMake Deprecation Warning at C:/ncs/v2.5.0/zephyr/cmake/modules/FindDeprecated.cmake:121 (message):
      'PYTHON_PREFER' variable is deprecated.  Please use Python3_EXECUTABLE
      instead.
    Call Stack (most recent call first):
      C:/ncs/v2.5.0/zephyr/cmake/modules/python.cmake:16 (find_package)
      C:/ncs/v2.5.0/zephyr/cmake/modules/zephyr_default.cmake:129 (include)
      C:/ncs/v2.5.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
      C:/ncs/v2.5.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
      CMakeLists.txt:5 (find_package)
    
    
    -- 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:/ncs/v2.5.0/zephyr/.cache
    -- Zephyr version: 3.4.99 (C:/ncs/v2.5.0/zephyr)
    -- Found west (found suitable version "1.1.0", minimum required is "0.14.0")
    -- Board: nrf9160dk_nrf52840, 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:/ncs/v2.5.0/zephyr/boards/arm/nrf9160dk_nrf52840/nrf9160dk_nrf52840.dts
    -- Found devicetree overlay: C:/ncs/v2.5.0/zephyr/boards/arm/nrf9160dk_nrf52840/nrf9160dk_nrf52840_0_14_0.overlay
    -- Found devicetree overlay: C:/ncs/v2.5.0/nrf/samples/bluetooth/hci_lpuart/boards/nrf9160dk_nrf52840.overlay
    -- Found devicetree overlay: C:/ncs/v2.5.0/nrf/samples/bluetooth/hci_lpuart/boards/nrf9160dk_nrf52840_0_14_0.overlay
    -- Generated zephyr.dts: C:/ncs/v2.5.0/nrf/samples/bluetooth/hci_lpuart/build/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: C:/ncs/v2.5.0/nrf/samples/bluetooth/hci_lpuart/build/zephyr/include/generated/devicetree_generated.h
    -- Including generated dts.cmake file: C:/ncs/v2.5.0/nrf/samples/bluetooth/hci_lpuart/build/zephyr/dts.cmake
    
    warning: BT_CTLR_DTM_HCI (defined at subsys/bluetooth\controller\Kconfig.dtm:14) was assigned the
    value 'y' but got the value 'n'. Check these unsatisfied dependencies: BT_CTLR_DTM_HCI_SUPPORT (=n).
    See http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_BT_CTLR_DTM_HCI and/or look up
    BT_CTLR_DTM_HCI 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.5.0/zephyr/Kconfig
    Loaded configuration 'C:/ncs/v2.5.0/zephyr/boards/arm/nrf9160dk_nrf52840/nrf9160dk_nrf52840_defconfig'
    Merged configuration 'C:/ncs/v2.5.0/nrf/samples/bluetooth/hci_lpuart/prj.conf'
    Merged configuration 'C:/ncs/v2.5.0/nrf/samples/bluetooth/hci_lpuart/boards/nrf9160dk_nrf52840.conf'
    Configuration saved to 'C:/ncs/v2.5.0/nrf/samples/bluetooth/hci_lpuart/build/zephyr/.config'
    Kconfig header saved to 'C:/ncs/v2.5.0/nrf/samples/bluetooth/hci_lpuart/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
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/ncs/v2.5.0/nrf/samples/bluetooth/hci_lpuart/build
    ←[92m-- west build: building application
    [2/174] Generating include/generated/version.h
    -- Zephyr version: 3.4.99 (C:/ncs/v2.5.0/zephyr), build: v3.4.99-ncs1-1
    [174/174] Linking C executable zephyr\zephyr.elf
    Memory region         Used Size  Region Size  %age Used
               FLASH:      177024 B         1 MB     16.88%
                 RAM:       45016 B       256 KB     17.17%
            IDT_LIST:          0 GB         2 KB      0.00%

    PS C:\ncs\v2.5.0\nrf> git checkout v2.5.1
    ...
    PS C:\ncs\v2.5.0\nrf> west update
    ...
    PS C:\ncs\v2.5.0\nrf> cd .\samples\bluetooth\hci_lpuart\
    ...
    PS C:\ncs\v2.5.0\nrf\samples\bluetooth\hci_lpuart> west build --board [email protected]
    ... 

Related