Hi, I’m the Toradex AI Assistant. I’m in early beta, and I would appreciate your feedback.
The Toradex Support team will follow up with you shortly!
Did you like my answer?
To configure SODIMM 144 as an output for the RTS signal in RS-485 mode, you need to ensure that the pin is correctly muxed and configured in the device tree. Here are the steps to achieve this:
Pin Multiplexing Configuration:
Ensure that the pin is correctly muxed as a GPIO in the pinctrl node. Your current configuration seems correct, but let’s double-check it:
GPIO Configuration:
Ensure that the GPIO is correctly configured as an output. You can add a GPIO configuration node to explicitly set the direction of the GPIO:
Device Tree Overlay:
If you are using a device tree overlay, ensure that the overlay is correctly applied and does not conflict with other configurations.
Rebuild and Deploy:
Rebuild your device tree and deploy it to the target device. Ensure that the new device tree is being used by the kernel.
Looking at the device tree for the SODIMM 144 pin and imx8 colibri, this pin is to be used in SCFW, so I don’t believe its a good choice for your RTS if other pins are available.
/*
1 * This pin is used in the SCFW as a UART. Using it from
2 * Linux would require rewritting the SCFW board file.
3 */
4 pinctrl_hog_scfw: hogscfwgrp {
5 fsl,pins = <IMX8QXP_SCU_GPIO0_00_LSIO_GPIO2_IO03 0x20>; /* SODIMM 144 */
6 };
And looking at the RS485 device tree bindings yaml, I see rs485 as being built in half duplex. So when you enable at boot, this should indicate the half duplex.
Understood and agree re: pin 144. We do not need that pin and I have resolved that conflict.
Do you or does anybody know just for proof-of-concept if Toradex has an example demo for use with the Colibri Evaluation board that exercises its RS-485 connection?
I don’t have a Toradex demo example for rs485 readily available, but I did find another resolved ticket with a script inside that appears to be working from the customers perspective.
UPDATE Ultimately we ended up implementing our own userspace client that uses the Linux DT Binding for RS-485 so that it has control over the RTS/DE with much faster response time than using GPIO from userspace.
Hey @cowboydan
Just curious…so you abandoned the rts control built into the serial drivers and now just use the rx/tx functionality there coupled with a userspace client to toggle the gpio when applicable?
Hey @DaveM
The reverse - we abandoned user-mode GPIO control of RTS (latency ~4msec after end of transmission before RTS was de-asserted) to the native control of RTS build into the drivers (latency ~tens of microseconds). The problem was a collision with the client reply whilst our RTS was enabled and the data not being received. We couldn’t live with a workaround of a “pause” period between transmit/receive, so the native driver control of RTS seems to work well for us.
Ah…when you said “userspace client”, I leapt to “toggle gpio”, “sent data”, “toggle gpio”, “receive data”. Tough timing there
So your pin config for that signal connected to your 485 driver is _RTS or is it _GPIO? I’m interpreting your comment above as you’ve changed to “native” _RTS, thus having uart-has-rtscts in the device tree (as opposed to having rts-gpios in there?)