Does Zephyr have a turnkey / drop-in solution for communicating between two processors via UART?

Hello,

I am currently working through the nRF Connect SDK Intermediate training in preparation for an upcoming project. Said project will require communication between two physically separate processors over UART. Specifically, a nRF91 modem and a nRF52 BLE module.

From my research, it doesn't seem that Zephyr has a drop-in driver to facilitate communication between processors via UART, unless I am overlooking it?

Ideally, it would be as simple as enabling the driver, defining your UART pins, and defining the maximum payload size. The low level hardware and protocol framing would be handled by the driver. The message types and corresponding message payloads would be defined by the developer on the application layer. A callback function would return a pointer to the received payload (message) and payload size. Parsing and processing the message would be left to the application developer.

Does something like this not already exist? I would be surprised if not since it is such a common use case and given that Zephyr is meant to be a plug-and-play OS it seems. For reference, I have created my own version of this on FreeRTOS for the nRF52840.

I have seen SLIP, but this seems to only handle the framing layer.

Edit: If an existing solution does exist , it doesn't necessarily have to be UART based, but could be transport agnostic.

Thanks,

Derek

Parents
  • Hello,

    I may be a bit late to the party, but you mentioned: 

    Specifically, a nRF91 modem and a nRF52 BLE module

    So are those the two things that you want to communicate with eachother? In that case, there are samples in the nRF Connect SDK (NCS) showing how to do this. I don't know exactly what you intend to do, but if you aim to have the main application running on an nRF91's application core, communicate with the modem core, and use the nRF52 as a BLE device, then we have samples doing this. One of these is the NCS\nrf\applications\connectivity_bridge (particularly meant to be running on an Thingy91). This utilizes the onboard nRF52840 as a BLE device (running the ncs\zephyr\samples\bluetooth\hci_uart sample)

    Best regards,

    Edvin

  • Hey Edvin, after reviewing these examples, it looks like you are still required to hook everything together in software. It also looks like the ncs\zephyr\samples\bluetooth\hci_uart sample uses the H:4 HCI transport protocol which has no error checking (CRC for example).

    Based on this, it doesn't look like an adequate, robust, and generic drop-in solution with error checking exists for Zephyr in regard to communication between two MCU's using a UART.

    I guess I will just write my own modular solution that I can easily port to other Zephyr projects.

Reply
  • Hey Edvin, after reviewing these examples, it looks like you are still required to hook everything together in software. It also looks like the ncs\zephyr\samples\bluetooth\hci_uart sample uses the H:4 HCI transport protocol which has no error checking (CRC for example).

    Based on this, it doesn't look like an adequate, robust, and generic drop-in solution with error checking exists for Zephyr in regard to communication between two MCU's using a UART.

    I guess I will just write my own modular solution that I can easily port to other Zephyr projects.

Children
Related