BLE communication between a nRF52 DK board and a nRF9160 DK board

I am running V2.5.0 SDK. I have a nRF52 DK board that is running the V2.5.0/nrf/samples/Bluetooth/peripheral_uart application. It is working beautifully. I have nRF Toolbox installed on my iPhone. I can connect to the nRF52 DK Bluetooth running the NUS UART service. I can send text strings back and forth from my iPhone to the nrf52DK baord. We have been using the nRF9160 processor for years and we are very comfortable with its operation. We have never used the Bluetooth feature on the nRF9160. I have a nRF9160 dk board that I would like to implement the NUS UART Bluetooth connection like I have running with the iPhone using nRF Toolbox. I want an application on the nRF9160 to search for BLE devices advertising the UART service. I want to connect to that BLE device and be able to send text string back and forth like I can do on my iPhone. I tried the "Bluetooth central UART" but it does not support the nRF9160 as a valid board.

what do I need to do to implement a simple BLE connection between the nRF52DK and the nRF9160DK so I can send text strings back and forth simulating a UART.I have not used any BLE functions until we received the nrf52DK board. I am sure it is operator error. Our application depends on the BLE capability to talk between an nRF52 and a nRF9160. any help would be greatly appreciated.

  • The build of hci_lpuart failed similar to all others. What am I missing.? it seems ...dts_ord... is always undefined on my system. is there something I need to set somehwre?

    [167/172] Linking C executable zephyr\zephyr_pre0.elf
    FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map
    cmd.exe /C "cd . && C:\Nordic1\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:\Nordic1\test\hci_lpuart\build\zephyr && C:\Nordic1\toolchains\c57af46cb7\opt\bin\cmake.exe -E true""
    c:/nordic1/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:\Nordic1\v2.5.0\zephyr\include\zephyr\drivers\uart.h:939: undefined reference to `__device_dts_ord_107'
    c:/nordic1/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:\Nordic1\v2.5.0\zephyr\include\zephyr\drivers\uart.h:904: undefined reference to `__device_dts_ord_107'
    c:/nordic1/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:\Nordic1\v2.5.0\zephyr\include\zephyr\drivers\uart.h:820: undefined reference to `__device_dts_ord_107'
    c:/nordic1/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:\Nordic1\v2.5.0\zephyr\samples\bluetooth\hci_uart\src\main.c:342: undefined reference to `__device_dts_ord_107'
    c:/nordic1/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:\Nordic1\v2.5.0\zephyr\samples\bluetooth\hci_uart\src\main.c:193: undefined reference to `__device_dts_ord_107'
    c:/nordic1/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:\Nordic1\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:\Nordic1\toolchains\c57af46cb7\opt\bin\cmake.EXE' --build 'c:\Nordic1\test\hci_lpuart\build'

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

  • Sorry, I'm puzzled as to why it's failing on your end. Initially, I suspected that some files in the SDK might have been corrupted or altered. However, since you were able to successfully build the gateway sample, it doesn't seem likely that this is the issue.

    Did you build the hci_lpuart sample for the 'nrf9160dk_nrf52840' board? 

      

  • yes I used nrf9160dk_nrf52840 and it's overlays. I think the problem is with the device tree. googling around others have seen a similar error but I do not see how to fix it. I can build other examples for the nRF52 and the nRF9160 (blinky, buttons). I will remove the hci_lpuart and try the entire process again.

  • I repeated the entire process and got the same error. I am stuck here. How do I move forward. I will repeat the process for the central application you sent me.

  • https://docs.zephyrproject.org/latest/build/dts/troubleshooting.html

    undefined reference to __device_dts_ord_<N>

    This usually happens on a line like this:

    const struct device *dev = DEVICE_DT_GET(NODE_ID);
    

    does this make any sense to you or help solve the problem?
Related