Colibri imx6ull UARTC RS485 communication

Hello,

We are using colibri imx6ull soc on our own carrier board. in our application RS485 communication is working on UARTC with manipulating sodim29(gpio3_IO[23]) as direction control. From user space or c code running on linux we encounter timing errors. I mean manipulating a gpio pin as direction control causes some data loss over rs485 line.which is expected. other uart channells are used for gsm, rf and power line communication interfaces.

When I look for an alternate pin for UARTC RTS signal on “pinout designer” it says pin#178 can be used for Alternative.(ENET1_CRS_DV).
If it is possible to use that pin shown on pinout designer, pls elaborate the process step by step how can I achieve this.

if not possible do you have a workarround for UARTC RS485 usage.
thanks in advance.

Hello @abobow ,

Greetings and thank you for writing to Toradex Community!

“I mean manipulating a gpio pin as direction control causes some data loss over rs485 line.which is expected.”

Could you please elaborate on what exactly does this mean? And if possible provide and example.

And regarding your question on UARTC RTS, you might have to correctly pinmux the pin and use it in uart_pinctrl. In general , for more information on RS485, please kindly have a look at this link: High performance, low power Embedded Computing Systems | Toradex Developer Center

Best Regards, Janani.

Hello Janani

Thank you for your interest. what I mean with “I mean manipulating a gpio pin as direction control causes some data loss over rs485 line.which is expected.” is;
I used an available GPIO pin as chip select for RS485 direction control. On user space i set the gpio high and write my buffer to rs485 related uart and then set the gpio pin low for receiving.
In documents there is no RTS and CTS for UARTC in imx6ull, practically i need to know how to use that port for rs485 communication.
It seems İ am in lack of a general information about how to pinmux or how to customize device tree. Could you advice a starting point about those topics.

Kind Regards

Hello @abobow ,

Thank you for your reply.

If you think, you require more information on any of Toradex’s modules and the HW /SW related to them, you can always visit our knowledge webpage: developer.toradex.com. This page contains several articles that we have created for our customers’ ease of use and for them to get started easily on our modules.

Here are few of the articles that might be useful for you:

Device tree modification:

Pin Multi-plexing

Thank you and Best Regards,
Janani

Hello Janani,

I red those documents you suggested. very usefull no doubt, but I need a specific road map for my situation. and it is;
I must enable an RTS pin for UARTC which is not a standart feature of imx6ull-colibri. When i run pinout designer application I can see there are alternate pins for use of this purpose. for example “GPIO1_IO08” pin#4 is available for setting UARTC RTS feature as an alternative pin. What should be my steps starting from downloading latest BSP and devicetree sources… or is it possible to twicth it from user space. I am new to embedded linux so pls guide me on that point of view.
kind regards.

Hello @abobow ,

Thank you for writing back.
Unfortunately, you cannot mux these pins from the userspace. But you can definitely modify them from the device tree. The pin you have mentioned is used in the ADC group in the device tree, and so, when you don’t use ADC, you can try to use this pin as a UARTC RTS.

In order to include these RTS in the UARTC, you need to modify the part UART5 in the device tree (imx6ull-colibri.dtsi « dts « boot « arm « arch - linux-toradex.git - Linux kernel for Apalis, Colibri and Verdin modules) similiar to how it is done in UART1.

I hope this helps.

Best Regards,

Janani.