This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

[nRF52811] two way UART connection

Hello,

I am currently using the logger backend to send information via UART from the nRF52811 to a PC. This works well, but only for one way communication. I would like to send some instructions from the PC to the nRF52811, which means having a two way communication via UART. Is this even possible?

Thanks in advance.
David

Parents Reply Children
  • Just to clarify, I really just want to be able to send bytes via UART and have them be read by the nRF52811. With that working, I can then design my own protocol that interprets the command bytes

  • Hi,

    The CLI interface can be used for anything, not just control logging (see for instance the crypto CLI example). It is a bit complex though, so an alternative could be to skip the logger module altogether (including CLI) and use a simpler UART library for your UART communication. See for instance how physical UART is used in the NUS example.

  • Hi,

    Thanks for the tip, but that example is for UART over BLE, which is not exactly what I'm looking for. Actually, the nRF52811 is connected to an nRF52840 that is used as a bridge (for flashing the code and reading data), which is turn is connected to the PC via a usb cable. When I plug in the usb cable, a serial port is opened and I am reading that port. So, I am already receiving data from the nRF52811, but I would like to just send data through that serial port from the PC to the nRF52811.

  • Hi,

    slid_daaviet said:
    Thanks for the tip, but that example is for UART over BLE, which is not exactly what I'm looking for.

    Yes, but the thing is that the example implements UART bridging over BLE (so both physical UART and NUS). If you ignore the BLE/NUS part, you are left with a simple example of using plain UART without the added complexity of the logger library. You can also refer to the UART example for something similar.

    slid_daaviet said:
    So, I am already receiving data from the nRF52811, but I would like to just send data through that serial port from the PC to the nRF52811.

    I see. The easiest way is to refer to one of the examples mentioned above, which implements bidirectional UART communication.

  • Thanks for the help. I have tried adapting this example to the nRF52811, without success so far. I think the problem is in the APP_UART_FIFO_INIT function, but can't even debug it correctly, because there is a call to the app_error_handler funcion and NRF_BREAKPOINT_COND is activated. It's probably a vague problem description, but that's what I know so far...

Related