Changes

Jump to: navigation, search

DESK-MX6-L/Pheripherals/UART

1,335 bytes added, 15:17, 27 May 2022
Accessing the peripheral
...
root@imx6qxelk:~#
</pre>
 
==== Configuring the RS232/RS485 mode====
When the UART5 (aka <code>/dev/ttymxc4</code> device in Linux) is properly configured using the hardware jumpers (see [[AXEL_Lite_SOM/AXEL_Lite_Evaluation_Kit/Interfaces_and_Connectors/UARTs#UART5 | Interfaces and Connectors - UART5]] EVK page), the MultiProtocol transceiver pins has to be initialized for setting the related user selectable modes: the RS232 or RS485 mode can be selected with the <code>gpio-leds</code> class and the led <code>rs232_on</code>.
 
From <code>imx6q-sbcx-cb0012.dts</code> or <code>imx6dl-sbcx-cb0012.dts</code>:
 
<pre>
leds {
compatible = "gpio-leds";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_rs232_485_422_1>;
 
rs232_485_422 {
gpios = <&gpio7 13 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "default-on";
};
 
rs232_on {
gpios = <&gpio5 29 GPIO_ACTIVE_LOW>;
linux,default-trigger = "default-on";
};
};
</pre>
 
===== RS232 mode =====
This is the default protocol mode; this can be also activated (when different) using the following command:
<pre class="workstation-terminal">
root@desk-mx6:~# echo 0 > /sys/class/leds/rs232_on/brightness
</pre>
 
===== RS485 mode =====
This mode can be activated using the following command:
<pre class="workstation-terminal">
root@desk-mx6:~# echo 255 > /sys/class/leds/rs232_on/brightness
</pre>
8,143
edits

Navigation menu