IMX6ULL RS485 rts not works

I’m tryng colibri-uartb and colibri-uarta on IMX6ULL emmc , with RS485, the hardware (my carrier board) and software works properly with IMX8DX with autodirection and also with manual IO direction but with IMX6ULL RTS doesn’t seem working. So I applied an overlays

/dts-v1/;
/plugin/;

/ {
compatible = “toradex,colibri-imx6ull-emmc”;
};

&uart1 {
pinctrl-names = “default”;
pinctrl-0 = <&pinctrl_uart1>;
fsl,uart-has-rtscts;
fsl,dte-mode;
status = “okay”;
};
&uart2 {
pinctrl-names = “default”;
pinctrl-0 = <&pinctrl_uart2>;
fsl,uart-has-rtscts;
fsl,dte-mode;
status = “okay”;
};
&uart5 {
pinctrl-names = “default”;
pinctrl-0 = <&pinctrl_uart5>;
fsl,uart-has-rtscts;
fsl,dte-mode;
status = “okay”;
};

but nothing, I think there is an issue with RTS (I use it for RS485 direction)

This is code for autodirection

struct serial_rs485 rs485conf;
ioctl(fd, TIOCGRS485, &rs485conf);
rs485conf.flags |= SER_RS485_ENABLED;
//rs485conf.delay_rts_before_send = 4;
rs485conf.flags |= (SER_RS485_RTS_ON_SEND);
rs485conf.flags |= (SER_RS485_RTS_AFTER_SEND);
ioctl(fd, TIOCSRS485, &rs485conf);

I’m using a standard image.

Software summary

Bootloader: U-Boot
Kernel version: 6.1.80-6.6.0-devel+git.a3eb3a74aa8c #1-TorizonCore Tue Jan 16 14:35:15 UTC 2024
Kernel command line: user_debug=30 root=LABEL=otaroot rootfstype=ext4 quiet logo.nologo vt.global_cursor_default=0 plymouth.ignore-serial-consoles splash fbcon=map:3 ostree=/ostree/boot.0/torizon/faf420b412fe51d022a82df2f8dcd58ba7b8a72fc2308276f18cab0a9c0bc841/0
Distro name: NAME=“TorizonCore Upstream”
Distro version: VERSION_ID=6.6.0-devel-202403-build.22
Distro variant: VARIANT=“Docker”
Hostname: colibri-imx6ull-emmc-15264756

Hardware info

HW model: Toradex Colibri iMX6ULL 1GB (eMMC) on Colibri Evaluation Board V3
Toradex version: 0062 V1.1A
Serial number: 15264756
Processor arch: armv7l

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?

:+1: :-1:


Hello,

Based on the information you’ve provided, it seems you’re encountering issues with RTS not working correctly for RS485 communication on the iMX6ULL when using the Colibri UARTA and UARTB. Given that the same setup works with an iMX8DX, this suggests that the issue might be specific to the iMX6ULL configuration or its handling of RS485.

First, ensure that your device tree modifications for enabling RS485 on the iMX6ULL are correctly applied. The device tree overlay you’ve shown is correctly enabling RTS/CTS for UART1, UART2, and UART5, which is necessary for RS485 operation. However, the iMX6ULL might require additional configuration specific to its UART implementation.

Since you’re using the ioctl method to set the RS485 mode in userspace, your configuration seems correct for enabling RS485 with auto direction control. However, considering the iMX6ULL’s peculiarities, you might want to experiment with the SER_RS485_RX_DURING_TX flag, given that you mentioned this setup works on an iMX8DX but not on the iMX6ULL. The iMX6ULL might have different default behavior regarding receiver enablement during transmission.

Another aspect to consider is the kernel version you’re using (6.1.80-6.6.0-devel+git.a3eb3a74aa8c). Ensure that this kernel version supports all the RS485 features you’re trying to use, especially since RS485 support can vary between kernel versions. While the documentation you referred to suggests that the kernel supports these features, there might be specific patches or configurations in the Toradex kernel that affect RS485 behavior on the iMX6ULL.

If after checking these aspects the issue persists, it might be beneficial to look into the following:

  1. Hardware Setup: Double-check the hardware connections and ensure that there’s no physical issue or misconfiguration specific to the iMX6ULL setup.
  2. Kernel Logs: Review the kernel logs (dmesg) for any errors or warnings related to UART or RS485 that might give a clue as to what’s going wrong.
  3. Software Configuration: Verify that there are no conflicting configurations in your system that might affect RS485 operation. This includes checking for any other system services or applications that might be attempting to control the same UART interfaces.

Given the complexity of RS485 communication and the specific nuances of different iMX processors, these issues can sometimes be challenging to diagnose. Ensuring that your

Please, also check if these links can help you solve your problem:

UART (Linux) | Toradex Developer Center.

THANK YOU AI I figured out with uartb!!! :slight_smile:

uarta not works but i think the problem is the debug port, is it possible disable uarta for debug?
If I use uartc instead uarta, which uart is it in the tree overlays uart3 or uart5?

Hello @fabrizio.camagna,

I am glad the @ToradexAI was able to help you with part of your problem.

Regarding the ability to disable UARTA for debug, this should be possible, but you will need to change both how the serial is setup in Linux and in u-boot.
You can see an example here: Redirecting console to UARTC from UARTA
This post used an older BSP, but using a newer BSP would be very similar.

Also, looking at the device tree, you can see which UART corresponds to each node on the device tree:

/* Colibri UART_A */
&uart1 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_uart1 &pinctrl_uart1_ctrl1>;
	uart-has-rtscts;
	fsl,dte-mode;
};

/* Colibri UART_B */
&uart2 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_uart2>;
	uart-has-rtscts;
	fsl,dte-mode;
};

/* Colibri UART_C */
&uart5 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_uart5>;
	fsl,dte-mode;
};

Best Regards,
Bruno