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?
Hello,
To enable RS-485 on UARTB and C on the i.MX6ULL Colibri module with a GPIO pin as the enable pin, your device tree modifications seem mostly correct. However, there are a few points and steps we should review to ensure proper functionality:
Device Tree Configuration: Ensure that your device tree changes for enabling RS-485 mode are correctly applied. Your configuration for &uart2 with rts-gpios, rs485-rts-delay, and fsl,dte-mode is a good start. The rs485-rts-active-high and linux,rs485-enabled-at-boot-time properties in imx6ull-colibri-aster.dtsi are also correctly set for enabling RS-485 at boot time and defining the RTS line’s active level.
Testing RS-485 Functionality: After deploying your kernel with the modified device tree, you can test RS-485 functionality in several ways:
Using the Serial Port: You can use a terminal program like minicom or picocom to open the serial port and try communicating with an RS-485 device. Ensure you configure the serial port settings (baud rate, parity, stop bits) to match those of your RS-485 device.
Using ioctl Calls in a Custom Program: As mentioned in the context, you can control RS-485 settings (like enabling RS-485 mode, setting RTS pin logic levels, and enabling receiver during transmission) by making ioctl calls in a C program. This method gives you fine-grained control over the RS-485 settings and is useful for debugging or when you need to dynamically change RS-485 parameters.
Troubleshooting:
Verify GPIO Configuration: Ensure that the GPIO pin used for RTS (&gpio1 1 GPIO_ACTIVE_HIGH) is not being used by another peripheral or system function. Conflicts can prevent proper operation.
Kernel Support: Confirm that your kernel version supports the RS-485 features you are trying to use. While the device tree properties you’ve set should not harm older kernels, functionality like rs485-rts-delay might not work as expected if the kernel doesn’t fully support it.
Hardware Setup: Double-check your hardware connections, including the RS-485 transceiver and any termination resistors required for your RS-485 network. Improper hardware setup can lead to communication issues.
If after following these steps
Please, also check if these links can help you solve your problem:
Hi @Prial,
Please always check the boot logs to check what device tree and overlays are being used.
It will show you something like this Loading DeviceTree: iimx6ull-colibri-eval-v3.dtb.
So, you need to make changes in this device tree or the device tree which is included in this dtb.
Of course, you can change it to use aster specific device tree as well which will reflect you changes done in aster specific device tree