Reading and Writing rpmsg in .NET

Hi @pkg_su,

I’m not used to .NET myself, so I tested on my side using Python and it worked. I used the baud rate 115200. Can you try to change to 115200 to see if it works?

I deployed it inside a container with python, using the pyserial library.

#!python3

import serial

def main():
    try:
        with serial.Serial("/dev/ttyRPMSG30", 115200, timeout=1) as ser:
            ser.write(b"Toradex!")
    except Exception as err:
        print(err)

if __name__ == "__main__":
    main()

Please note that we need to write the bytes to the serial, not the actual string ("bToradex!").

And exposed the ttyRPMSG to my container on the docker-compose file:

services:
  hmp-debug:
    build:
      context: .
      dockerfile: Dockerfile.debug
    image: ${LOCAL_REGISTRY}:5002/hmp-debug:${TAG}
    ports:
      - 6502:6502
      - 6512:6512
    devices:
      - "/dev/ttyRPMSG30:/dev/ttyRPMSG30"

After running the container, everything worked fine:

Overlays:

torizon@colibri-imx8x-06995803:~$ cat /boot/ostree/torizon-0b063e02951e998cfb713cab409e226f0ed7ec343933815517ec68930a8f0228/dtb/overlays.txt
fdt_overlays=colibri-imx8x_parallel-rgb_overlay.dtbo colibri-imx8x_ad7879_overlay.dtbo display-vga_overlay.dtbo colibri-imx8x_disable-cm40-uart_overlay.dtbo

Let me know if that helps. Unfortunately, I can’t help too much with .NET, but I believe it’s just a matter of finding the right way to write to the serial with your code.

Best Regards,
Hiago.

1 Like