Hello Toradex community,
I am working with a AM62 SOM with an Ivy Carrier board and trying to set up a RS485 communication. Here i share you the tdx-info summery:
Software summary
Bootloader: U-Boot
Kernel version: 6.6.94-7.3.0-g7642ad324113 #1-Torizon SMP PREEMPT Thu Jul 3 08:47:26 UTC 2025
Kernel command line: root=LABEL=otaroot rootfstype=ext4 quiet logo.nologo vt.global_cursor_default=0 plymouth.ignore-serial-consoles splash fbcon=map:3 ostree=/ostree/boot.1/torizon/e54388c03b414f15de5038757766a36da4957b04d84c897e8d44a069401c4dec/0
Distro name: NAME=“Torizon OS”
Distro version: VERSION_ID=7.3.0-build.18
Distro variant: VARIANT=“Docker”
Hostname: verdin-am62-15645393
Hardware info
HW model: Toradex Verdin AM62 WB on Ivy Board
Toradex version: 0075 V1.2A
Serial number: 15645393
Processor arch: aarch64
I had enable the Ivy device tree so i think i don’t need to use an overlay to enable RS485 peripheral.
torizon@verdin-am62-15645393:~$ cat /proc/device-tree/model
Toradex Verdin AM62 WB on Ivy Board
torizon@verdin-am62-15645393:~$ cat /proc/device-tree/compatible
toradex,verdin-am62-wifi-ivytoradex,verdin-am62-wifitoradex,verdin-am62ti,am625
I am working on a single project container with Python. I configure docker-compose.yml to have access to the UART2 of the board. Here i share you the configuration:
services:
test-debug:
build:
context:.
dockerfile: Dockerfile.debug
image: ${LOCAL_REGISTRY}:5002/test-debug:${TAG}
ports:- ${DEBUG_SSH_PORT}:${DEBUG_SSH_PORT}-
${DEBUG_PORT1}:${DEBUG_PORT1}
devices:
- "/dev/verdin-uart2:/dev/verdin-uart2"
- "/dev/gpiochip2:/dev/gpiochip2"
- "/dev/gpiochip3:/dev/gpiochip3"
group_add:
- "20"
i made a simple script in python to send a “Hello world” and catch it with a RS485 to USB converter.
Here is the script:
import sys
import serial
import serial.rs485
import time
def test_rs485_loopback():
ser = serial.Serial("/dev/verdin-uart2",9600, 8, 'N', 1, timeout=1)
ser.reset_input_buffer()
ser.reset_output_buffer()
if not ser.is_open:
ser.open()
if ser.is_open:
ser.rs485_mode = serial.rs485.RS485Settings(delay_before_tx=0.001, delay_before_rx=0.001, loopback=False)
print("Serial port opened successfully.")
print(ser.name)
test_data = b'Hello RS485'
time.sleep(0.01)
ser.write(test_data)
time.sleep(0.05)
print(f"Wrote {len(test_data)} bytes: {test_data}")
s = ser.read(len(test_data))
print(f"Read {len(s)} bytes: {s}")
When i debug the container, over the serial i only receive ‘0x00’ instead of b’Hello RS485’.
Can anyone tell me if i’m doing the things rigth? or i have to configure something else to acces to the RS485 port?
Thank you in advance.