Problems build hci_lpuart for thingy91 sdk2.9.0

I am trying to compile hci_lpuart for thingy91_nrf52840, but I have these issue.

hci_lpuart:

/opt/nordic/ncs/v2.9.0/bootloader/mcuboot/boot/zephyr/serial_adapter.c
In file included from /opt/nordic/ncs/v2.9.0/zephyr/include/zephyr/sys/util_macro.h:34,
from /opt/nordic/ncs/v2.9.0/zephyr/include/zephyr/irq_multilevel.h:16,
from /opt/nordic/ncs/v2.9.0/zephyr/include/zephyr/devicetree.h:20,
from /opt/nordic/ncs/v2.9.0/zephyr/include/zephyr/device.h:12,
from /opt/nordic/ncs/v2.9.0/zephyr/include/zephyr/drivers/uart.h:28,
from /opt/nordic/ncs/v2.9.0/bootloader/mcuboot/boot/zephyr/serial_adapter.c:18:
/opt/nordic/ncs/v2.9.0/bootloader/mcuboot/boot/zephyr/serial_adapter.c: In function 'boot_uart_fifo_init':
/opt/nordic/ncs/v2.9.0/zephyr/include/zephyr/sys/util.h:97:55: error: size of unnamed array is negative
97 | #define ZERO_OR_COMPILE_ERROR(cond) ((int) sizeof(char[1 - 2 * !(cond)]) - 1)
| ^
/opt/nordic/ncs/v2.9.0/zephyr/include/zephyr/sys/util_internal.h:72:26: note: in definition of macro '__DEBRACKET'
72 | #define __DEBRACKET(...) __VA_ARGS__
| ^~~~~~~~~~~
/opt/nordic/ncs/v2.9.0/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)
| ^~~~~~~~~~~~~~~~~~~~
/opt/nordic/ncs/v2.9.0/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)
| ^~~~~~~~~~~
/opt/nordic/ncs/v2.9.0/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)
| ^~~~~~~~~~~~~
/opt/nordic/ncs/v2.9.0/zephyr/include/zephyr/device.h:297:9: note: in expansion of macro 'COND_CODE_1'
297 | COND_CODE_1(DT_HAS_COMPAT_STATUS_OKAY(compat), \
| ^~~~~~~~~~~
/opt/nordic/ncs/v2.9.0/zephyr/include/zephyr/device.h:299:22: note: in expansion of macro 'ZERO_OR_COMPILE_ERROR'
299 | (ZERO_OR_COMPILE_ERROR(0)))
| ^~~~~~~~~~~~~~~~~~~~~
/opt/nordic/ncs/v2.9.0/bootloader/mcuboot/boot/zephyr/serial_adapter.c:217:20: note: in expansion of macro 'DEVICE_DT_GET_ONE'
217 | uart_dev = DEVICE_DT_GET_ONE(zephyr_cdc_acm_uart);
| ^~~~~~~~~~~~~~~~~
[260/325] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/opt/nordic/ncs/v2.9.0/modules/hal/nordic/nrfx/helpers/nrfx_ram_ctrl.c.obj
ninja: build stopped: subcommand failed.
[10/20] No configure step for 'hci_lpuart'
FAILED: _sysbuild/sysbuild/images/bootloader/mcuboot-prefix/src/mcuboot-stamp/mcuboot-build /opt/nordic/ncs/v2.9.0/nrf/samples/bluetooth/hci_lpuart/build/_sysbuild/sysbuild/images/bootloader/mcuboot-prefix/src/mcuboot-stamp/mcuboot-build
cd /opt/nordic/ncs/v2.9.0/nrf/samples/bluetooth/hci_lpuart/build/mcuboot && /opt/nordic/ncs/toolchains/b8efef2ad5/Cellar/cmake/3.21.0/bin/cmake --build .
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: /opt/nordic/ncs/toolchains/b8efef2ad5/bin/cmake --build /opt/nordic/ncs/v2.9.0/nrf/samples/bluetooth/hci_lpuart/build

Any ideas on how to solve this? I'd really appreciate it.

And if you have any examples for sending data from an nRF7002, that would help.

Parents
  • did it work before upgrading to 2.9.0?
    yes and the same issue.

    Have you tried other samples?
    Others samples build without problems. 

  • I can build, 

    I add the " --no-sysbuild"  flag as an extra build argument.

    But , I have new problem with lte_ble_gateway

    *** Booting nRF Connect SDK v2.9.0-7787b2649840 ***
    *** Using Zephyr OS v3.7.99-1f8f3dc29142 ***
    [00:00:00.230,041] <inf> lte_ble_gw: LTE Sensor Gateway sample started
    [00:00:00.230,224] <inf> lte_ble_gw: Initializing Bluetooth..
    [00:00:00.230,224] <err> bt_hci_core: No HCI driver registered
    [00:00:00.230,224] <err> lte_ble_gw: Bluetooth init failed (err -19)

  • Yes, I flashed HCI to the nrf52840. You can then compile lte_ble_gateway with SDK 3.0.0.

    I am using examples lte_ble_gateway and hci_lpuart SDK 3.0.0

    But now I have this error.


    [00:00:00.227,783] <wrn> lpuart: req pin low when expected high
    [00:00:00.227,935] <err> lpuart: Empty receiver state:4
    *** Booting nRF Connect SDK v3.0.0-3bfc46578e42 ***
    *** Using Zephyr OS v4.0.99-a0e545cb437a ***
    [00:00:00.230,804] <inf> lte_ble_gw: LTE Sensor Gateway sample started
    [00:00:00.230,926] <inf> lte_ble_gw: Initializing Bluetooth..
    [00:00:00.476,013] <inf> lte_ble_gw: Establishing LTE link (this may take some time) ...
    [00:00:02.258,636] <wrn> lpuart: req pin low when expected high
    [00:00:02.258,758] <err> lpuart: Empty receiver state:4
    [00:00:04.339,965] <wrn> lpuart: req pin low when expected high
    [00:00:04.340,118] <err> lpuart: Empty receiver state:4
    [00:00:06.381,744] <wrn> lpuart: req pin low when expected high
    [00:00:06.381,896] <err> lpuart: Empty receiver state:4
    [00:00:08.398,681] <wrn> lpuart: req pin low when expected high
    [00:00:08.398,803] <err> lpuart: Empty receiver state:4
    ASSERTION FAIL [success] @ WEST_TOPDIR/zephyr/subsys/bluetooth/host/hci_core.c:432
    command opcode 0x0c03 timeout
    [00:00:10.241,455] <err> os: r0/a1: 0x00000003 r1/a2: 0x00000000 r2/a3: 0x00000002
    [00:00:10.241,485] <err> os: r3/a4: 0x00000003 r12/ip: 0x20018b28 r14/lr: 0x0002039f
    [00:00:10.241,485] <err> os: xpsr: 0x01000000
    [00:00:10.241,516] <err> os: Faulting instruction address (r15/pc): 0x000203ac
    [00:00:10.241,546] <err> os: >>> ZEPHYR FATAL ERROR 3: Kernel oops on CPU 0
    [00:00:10.241,577] <err> os: Current thread: 0x2000f6e8 (unknown)
    [00:00:10.456,787] <err> os: Halting system

  • Did you do any modifications to any of the builds? Can you describe what you did exactly so it can be reproduced?

  • I am getting a similar error for a project that was seemingly working a few days back, with no changes made to any configuration, using SDK / Toolchain 2.8.0. 

    Below is the output from attempting to build this.

    C:/ncs/v2.8.0/bootloader/mcuboot/boot/zephyr/serial_adapter.c: In function 'boot_uart_fifo_init':
    C:/ncs/v2.8.0/zephyr/include/zephyr/sys/util.h:97:55: error: size of unnamed array is negative
    97 | #define ZERO_OR_COMPILE_ERROR(cond) ((int) sizeof(char[1 - 2 * !(cond)]) - 1)
    | ^
    C:/ncs/v2.8.0/zephyr/include/zephyr/sys/util_internal.h:72:26: note: in definition of macro '__DEBRACKET'
    72 | #define __DEBRACKET(...) __VA_ARGS__
    | ^~~~~~~~~~~
    C:/ncs/v2.8.0/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.8.0/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.8.0/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.8.0/zephyr/include/zephyr/device.h:297:9: note: in expansion of macro 'COND_CODE_1'
    297 | COND_CODE_1(DT_HAS_COMPAT_STATUS_OKAY(compat), \
    | ^~~~~~~~~~~
    C:/ncs/v2.8.0/zephyr/include/zephyr/device.h:299:22: note: in expansion of macro 'ZERO_OR_COMPILE_ERROR'
    299 | (ZERO_OR_COMPILE_ERROR(0)))
    | ^~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.8.0/bootloader/mcuboot/boot/zephyr/serial_adapter.c:217:20: note: in expansion of macro 'DEVICE_DT_GET_ONE'
    217 | uart_dev = DEVICE_DT_GET_ONE(zephyr_cdc_acm_uart);
    | ^~~~~~~~~~~~~~~~~

    Any pointers?

  • Sounds like you have messed up somewhere in the NCS installation. Perhaps you can try reinstalling the entire thing.

  • I appreciate the tip, however this happened without me changing anything to do with the installation.
    To further this I followed your advice and received the same result over again.

    I am looking further into this and will update with anything I find, however it is seemingly occurring to a code-base which was previously working with the same build configuration.

Reply
  • I appreciate the tip, however this happened without me changing anything to do with the installation.
    To further this I followed your advice and received the same result over again.

    I am looking further into this and will update with anything I find, however it is seemingly occurring to a code-base which was previously working with the same build configuration.

Children
  • It seems my problem revolved around me building my project for the thingy91, where the project, required to have the configuration of the 52840dk, in reference to MCU boot and some obscure configs related to that. If the OP is still having issues, I'd recommend having a hack at the dk variant of the chip set you are using, as these tend to include the MCU boot configs necessary.

Related