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.

  • C:\Nordic1\test_n160\central_uart\build\zephyr\include\generated\syscalls\uart.h:230: undefined reference to `__device_dts_ord_118'

    from devicetree_generated.h

    118 /soc/peripheral@40000000/uart@a000/nrf-sw-lpuart

    so where does this get set. the note says it is not being set. do I need to add this to an alias file somehow? How come it is set in your build. This is the unzipped central file you sent me with no changes.

  • I also see the following in autoconfig.h. Where does that get defined. I do not

    #define CONFIG_DT_HAS_NORDIC_NRF_SW_LPUART_ENABLED 1
  • I see a definition in overlay file. what is missing? do I need an alias statement or something?


    &uart2 {
    current-speed = <1000000>;
    status = "okay";
    /delete-property/ hw-flow-control;

    pinctrl-0 = <&uart2_default_alt>;
    pinctrl-1 = <&uart2_sleep_alt>;
    pinctrl-names = "default", "sleep";
    lpuart: nrf-sw-lpuart {
    compatible = "nordic,nrf-sw-lpuart";
    status = "okay";
    req-pin = <21>; /* <&interface_to_nrf52840 3 0>; */
    rdy-pin = <19>; /* <&interface_to_nrf52840 2 0>; */
    };
    };

  • Vidor: I found the problem Burt helped in determining that I needed to do a pristine build as soon as I created the build configuration. I was assuming that the first build would be pristine. the pristine build worked on hci_lpuart and I flashed it into the nRF52840. The pristine worked on central_uart that you sent me. I flashed it into the nrf9160 and all is working below is an example of messages seen on the nrf9160. The nrf52DK board is running uart_peripheral. I have a temp/humidity sensor connected that is sending data every 10 seconds. I see this on the nrf9160 console. I can also send commands over to the nRF52 board. All is good. Let me play with this for a few days and see if all problems are eliminated. Thanks for your patience and you help. my rookie mistake not using pristine first.

    *** Booting nRF Connect SDK v2.5.0 ***
    Starting Bluetooth Central UART example
    T: 25.26 H: 51.50
    T: 25.27 H: 51.46
    T: 25.27 H: 51.48
    T: 25.27 H: 51.51
    T: 25.27 H: 51.50
    T: 25.26 H: 51.54
    T: 25.26 H: 51.50
    T: 25.26 H: 51.57

  • It's great to hear that you've successfully built the projects now. 

    Timothy said:
    I was assuming that the first build would be pristine.

    If there is no existing 'build' folder in the project at the time of the first build, it should be same as performing a pristine build. So, I'm unsure why you encountered these build errors in the first place (I didn't include my build folder in the .zip). Despite multiple attempts, I have not been able to reproduce these errors on my end. 

    A pristine or clean build is necessary when adding new overlay files to a project, as CMake will not detect the new overlays otherwise.

    Timothy said:

    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?

    Yes, the issue in our case was that relevant configurations from the overlay files in central_build/boards/nrf9160dk_nrf9160_ns* were not being applied.

Related