Device Detail : Verdin iMX 8MP Quad WB IT.
OS: Torizon OS
I need to use Data Terminal Ready (DTR) control signal in RS-232 serial port.
My serial port interface device requires DTR signal support to send data to iMX, how can I enable it on iMX8MP.
On the Pinout Designer (torizon.io)
I can see CTS RTS RXD TXD supported. What needs to be done here?
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?
Hi, Samarth
The Verdin iMX8MP module does not natively support the DTR (Data Terminal Ready) signal on its UART interfaces. The standard UART signals available are CTS, RTS, RXD, and TXD, as you mentioned.
To use the DTR signal, you would typically need to implement it in software or use an external hardware solution. Here are a couple of approaches you could consider:
Software Emulation: You can use one of the available GPIO pins to emulate the DTR signal. This involves configuring a GPIO pin as an output and controlling it through your application to mimic the DTR behavior. You can use the GPIO sysfs interface or a dedicated GPIO library to control the pin.
External Hardware: If software emulation is not suitable, you might need to use an external UART-to-RS232 converter that supports the DTR signal. These converters can handle the DTR signal and interface with the Verdin module’s UART.
For software emulation, here is a basic example of how you might control a GPIO pin in a Linux environment:
# Export the GPIO pin (replace <gpio_pin_number> with the actual pin number)
echo <gpio_pin_number> > /sys/class/gpio/export
# Set the GPIO pin as an output
echo out > /sys/class/gpio/gpio<gpio_pin_number>/direction
# Set the GPIO pin to high (DTR active)
echo 1 > /sys/class/gpio/gpio<gpio_pin_number>/value
# Set the GPIO pin to low (DTR inactive)
echo 0 > /sys/class/gpio/gpio<gpio_pin_number>/value
You would need to integrate this control into your application logic to manage the DTR signal as required by your serial communication protocol.
Since I have physically shorted the RTS and DTR by soldering it. i.e pin 4 7 and 8 on a RS232 port. Now I want to set the DTR(RTS since I have shorted) to low so as to signal Data terminal ready to my peripheral device and start receiving data. Don’t need to make use of GPIO as of now. JFYI my device required only DTR output from iMX8mp and ofc Rx and Tx.
How can I set the RTS pin on imx8mp to low. Can it be done with a device tree overlay . Or I can set it directly with some linux command. Where should I start with?
I’ve attached the pin layout from torizon pin out design tool. Want to make pin no 133 as low.
Can I achieve this with some c/c++ code using termios library or any other library?
Will the above given commands work for these pins?
Would prefer the easiest way to achieve the same.
JFYI, I tried to disable rtscts signal with stty command, on checking with multimeter initially the voltage was 1.78. On disabling rtscts the voltage dropped to 0 for RTS pin. So if I say “active low” for specific pin does that mean the same as lowering the voltage to zero for that pin? Also as for my original requirement I need to set the DTR pin to low, now since my DTR and RTS and CTS pins are shorted my DTR will also go to low. Will it work?
After my previous post when I’m checking the voltage on rts pin with multimeter, I’m getting only 1.8v.
Earlier the stty -F /dev/ttymxc0 -crtscts command made the voltage low, but now its not working.
Can you please help?