example lte_ble_gate failed on nRF9160

Hello,

I am trying to build the lte_ble_gate example from "ncs\v2.5.2\nrf\samples\cellular\lte_ble_gateway" for nRF9160.

I haven't made any changes but the example failed to build. 

This is the error that I get:

[343/350] Linking C executable zephyr\zephyr_pre0.elf
FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map
cmd.exe /C "cd . && C:\ncs\toolchains\c57af46cb7\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe -gdwarf-4 @CMakeFiles\zephyr_pre0.rsp -o zephyr\zephyr_pre0.elf && cmd.exe /C "cd /D C:\ncs\v2.5.2\nrf\samples\cellular\lte_ble_gateway\build\zephyr && C:\ncs\toolchains\c57af46cb7\opt\bin\cmake.exe -E true""
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: zephyr/drivers/bluetooth/libdrivers__bluetooth.a(h4.c.obj): in function `uart_irq_rx_disable':
C:\ncs\v2.5.2\nrf\samples\cellular\lte_ble_gateway\build/zephyr/include/generated/syscalls/uart.h:278: undefined reference to `__device_dts_ord_118'
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: zephyr/drivers/bluetooth/libdrivers__bluetooth.a(h4.c.obj): in function `z_impl_uart_irq_rx_enable':
C:/ncs/v2.5.2/zephyr/include/zephyr/drivers/uart.h:960: undefined reference to `__device_dts_ord_118'
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: zephyr/drivers/bluetooth/libdrivers__bluetooth.a(h4.c.obj): in function `uart_irq_tx_disable':
C:\ncs\v2.5.2\nrf\samples\cellular\lte_ble_gateway\build/zephyr/include/generated/syscalls/uart.h:230: undefined reference to `__device_dts_ord_118'
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: zephyr/drivers/bluetooth/libdrivers__bluetooth.a(h4.c.obj): in function `h4_send':
C:/ncs/v2.5.2/zephyr/drivers/bluetooth/hci/h4.c:490: undefined reference to `__device_dts_ord_118'
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: zephyr/drivers/bluetooth/libdrivers__bluetooth.a(h4.c.obj): in function `uart_fifo_read':
C:/ncs/v2.5.2/zephyr/include/zephyr/drivers/uart.h:820: undefined reference to `__device_dts_ord_118'
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: zephyr/drivers/bluetooth/libdrivers__bluetooth.a(h4.c.obj):C:/ncs/v2.5.2/zephyr/drivers/bluetooth/hci/h4.c:560: more undefined references to `__device_dts_ord_118' follow
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\c57af46cb7\opt\bin\cmake.EXE' --build 'c:\ncs\v2.5.2\nrf\samples\cellular\lte_ble_gateway\build'

It gives me undefined reference to __device_dts_ord_118. 

I found similar issue in the forum, but with pristine build it got resolved in their case but in my case it doesn't work.

I would greatly appreciate some help!

Parents Reply Children
  •   

    Adding the revision filed gives different error but it is also related to device tree:

    -- west build: building application
    [2/172] Generating include/generated/version.h
    -- Zephyr version: 3.4.99 (C:/ncs_new/v2.5.0/zephyr), build: 2e2523efe52a
    [167/172] Linking C executable zephyr\zephyr_pre0.elf
    FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map
    cmd.exe /C "cd . && C:\ncs\toolchains\c57af46cb7\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe -gdwarf-4 @CMakeFiles\zephyr_pre0.rsp -o zephyr\zephyr_pre0.elf && cmd.exe /C "cd /D C:\ncs_new\v2.5.0\nrf\samples\bluetooth\hci_lpuart\build\zephyr && C:\ncs\toolchains\c57af46cb7\opt\bin\cmake.exe -E true""
    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: app/libapp.a(main.c.obj): in function `uart_irq_tx_ready':
    C:/ncs_new/v2.5.0/zephyr/include/zephyr/drivers/uart.h:939: undefined reference to `__device_dts_ord_107'
    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: app/libapp.a(main.c.obj): in function `z_impl_uart_irq_tx_disable':
    C:/ncs_new/v2.5.0/zephyr/include/zephyr/drivers/uart.h:904: undefined reference to `__device_dts_ord_107'
    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: app/libapp.a(main.c.obj): in function `uart_fifo_read':
    C:/ncs_new/v2.5.0/zephyr/include/zephyr/drivers/uart.h:820: undefined reference to `__device_dts_ord_107'
    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: app/libapp.a(main.c.obj): in function `hci_uart_init':
    C:/ncs_new/v2.5.0/zephyr/samples/bluetooth/hci_uart/src/main.c:342: undefined reference to `__device_dts_ord_107'
    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: app/libapp.a(main.c.obj): in function `rx_isr':
    C:/ncs_new/v2.5.0/zephyr/samples/bluetooth/hci_uart/src/main.c:193: undefined reference to `__device_dts_ord_107'
    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: app/libapp.a(main.c.obj):C:/ncs_new/v2.5.0/zephyr/samples/bluetooth/hci_uart/src/main.c:403: more undefined references to `__device_dts_ord_107' follow
    collect2.exe: error: ld returned 1 exit status
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\c57af46cb7\opt\bin\cmake.EXE' --build 'c:\ncs_new\v2.5.0\nrf\samples\bluetooth\hci_lpuart\build'

    Also, the same happens with many other example such as hci_lpuart. The error is also related to device tree. 

    I looked zephyr  and followed the approach but didn't find any issue. 

    I compiled with other SDK and toolchain it work of some example but other failed.  

  • Hi!

    Surya09 said:
    /hci_uart/src/main.c:403: more undefined references to `__device_dts_ord_107' follow

    See this guide on how to debug these kinds of erros: https://blog.golioth.io/zephyr-devicetree-troubleshooting-generated-files/

    Surya09 said:
    Also, the same happens with many other example such as hci_lpuart. The error is also related to device tree. 

    Maybe you have made some changes the nRF9160-DK boards files, that is now affecting these samples. 

Related