DART-MX8M UART: Difference between revisions

From Variscite Wiki
No edit summary
Line 3: Line 3:
--> {{#lst:Android_Platform_Customization|{{#var:RELEASE_PARAM|RELEASE_N7.1.1_1.0.0_VAR-SOM-MX6}}}} <!--
--> {{#lst:Android_Platform_Customization|{{#var:RELEASE_PARAM|RELEASE_N7.1.1_1.0.0_VAR-SOM-MX6}}}} <!--
--> {{#lst:Yocto_Platform_Customization|{{#var:RELEASE_PARAM|RELEASE_SUMO_V1.0_DART-MX8M}}}} <!--
--> {{#lst:Yocto_Platform_Customization|{{#var:RELEASE_PARAM|RELEASE_SUMO_V1.0_DART-MX8M}}}} <!--
--> {{PageHeader|{{#var:HARDWARE_NAME}} UART}} {{DocImage|category1=Yocto|category2=Android}}[[Category:DART-MX8M]][[Category:DART-MX8M-MINI]] __toc__
--> {{PageHeader|UART}} {{DocImage|category1=Yocto|category2=Android}}[[Category:DART-MX8M]][[Category:DART-MX8M-MINI]] __toc__
 
<!-- Set local variables
= {{#var:HARDWARE_NAME}} UART Overview =
--> {{#vardefine:SHOW_DART_SECTION | <!--
{{#ifeq: {{#var:HARDWARE_NAME}}|VAR-SOM-MX8M-NANO|
-->    {{#switch:{{#var:HARDWARE_NAME}} | <!--
All 4 UARTs on {{#var:HARDWARE_NAME}} are enabled by default.<br>
-->      DART-MX8M | <!--
UART1 is connected to J30 header on {{#var:HARDWARE_NAME}} carrier board.<br>
-->      DART-MX8M-MINI = true | <!--
UART2 is connected to Bluetooth module.<br>  
-->      false <!--
UART3 is connected to J18 header.<br>
-->    }} <!--
UART4 is connected to debug console.<br>
--> }} <!--
On {{#var:HARDWARE_NAME}} SoMs without WIFI/BT module UART2 is also connected to J18 header.<br>
--> {{#vardefine:SHOW_SYMPHONY_SECTION | <!--
See the [https://www.variscite.com/wp-content/uploads/2020/01/VAR-SOM-MX8M-NANO-Datasheet.pdf carrier board datasheet] for the exact pinout.<br>  
-->    {{#switch:{{#var:HARDWARE_NAME}} | <!--
Only UART2 has RTS and CTS lines.
-->      DART-MX8M = false | <!--
|
-->      true <!--
All 4 UARTs on {{#var:HARDWARE_NAME}} are enabled by default.<br>
-->    }} <!--
--> }} <!--
--> {{#vardefine:SYMPHONY_SOM_NAME | <!--
-->    {{#switch:{{#var:HARDWARE_NAME}} | <!--
-->       DART-MX8M-MINI = VAR-SOM-MX8M-MINI | <!--
-->      {{#var:HARDWARE_NAME}} <!--
-->    }} <!--
--> }} <!--
--> {{#vardefine:DTS_PATH | <!--
-->   {{#switch:{{#var:ANDROID_NAME}} | <!--
-->      Pie = {{#var:BUILD_FOLDER}}/{{#var:BUILD_FOLDER_ANDROID}}/variscite/kernel_imx/ | <!--
-->   }} <!--
--> }} <!--
--> {{#vardefine:DTS_NAME | <!--
-->    {{#switch:{{#var:HARDWARE_NAME}} | <!--
-->       DART-MX8M = {{#ifeq: {{#var:YOCTO_NAME}}|Morty|variscite/imx8m-var-dart-common.dtsi|freescale/fsl-imx8mq-var-dart-common.dtsi}} | <!--
-->      DART-MX8M-MINI = freescale/fsl-imx8mm-var-dart.dts | <!--
-->      VAR-SOM-MX8M-MINI = freescale/fsl-imx8mn-var-som.dts | <!--
-->      {{#var:HARDWARE_NAME}} <!--
-->    }} <!--
--> }}
= UART Overview =
{{#ifeq: {{#var:SHOW_DART_SECTION}}|true|
On '''{{#var:HARDWARE_NAME}}''' all 4 UARTs are enabled by default.<br>
UART1 is connected to debug console.<br>
UART1 is connected to debug console.<br>
UART2 and UART3 are connected to J12 header on {{#var:HARDWARE_NAME}} carrier board.<br>  
UART2 and UART3 are connected to J12 header on VAR-DT8MCustomBoard.<br>  
UART4 is connected to Bluetooth module.<br>
UART4 is connected to Bluetooth module.<br>
On {{#var:HARDWARE_NAME}} SoMs without WIFI/BT module UART4 is also connected to J12 header.<br>
On {{#var:HARDWARE_NAME}} SoMs without WIFI/BT module UART4 is also connected to J12 header.<br>
See the [https://www.variscite.com/wp-content/uploads/2018/04/VAR-DT8MCustomBoard-Datasheet.pdf carrier board datasheet] for the exact pinout.<br>  
See the [https://www.variscite.com/wp-content/uploads/2018/04/VAR-DT8MCustomBoard-Datasheet.pdf carrier board datasheet] for the exact pinout.<br>  
Only UART4 has RTS and CTS lines.
Only UART4 has RTS and CTS lines.
}}
|}}


{{#ifeq: {{#var:SHOW_SYMPHONY_SECTION}}|true|
On '''{{#var:SYMPHONY_SOM_NAME}}''' all 4 UARTs are enabled by default.<br>
UART1 is connected to J30 header on Symphony-Board (located on the back of the board).<br>
UART2 is connected to Bluetooth module.<br>
UART3 is connected to J18 header.<br>
UART4 is connected to debug console.<br>
On {{#var:SYMPHONY_SOM_NAME}} SoMs without WIFI/BT module UART2 is also connected to J18 header.<br>
See the [https://www.variscite.com/wp-content/uploads/2019/07/Symphony-Board-Datasheet.pdf carrier board datasheet] for the exact pinout.<br>
Only UART2 has RTS and CTS lines.
|}}
= UART naming under Linux =
= UART naming under Linux =


The Linux devices corresponding to UART1 - UART4 are /dev/ttymxc0 - /dev/ttymxc3 respectively.  
The Linux devices corresponding to UART1 - UART4 are /dev/ttymxc0 - /dev/ttymxc3 respectively.  


{{#ifeq: {{#var:HARDWARE_NAME}}|VAR-SOM-MX8M-NANO| |
{{#ifeq: {{#var:SHOW_DART_SECTION}}|true|
= Testing UART2 =
= Testing UART2 on {{#var:HARDWARE_NAME}} =


Short J12.4 and J12.6 pins and run the following commands:
Short J12.4 and J12.6 pins and run the following commands:
Line 40: Line 73:


For each time you run this echo command the "hello" string should appear on the terminal.
For each time you run this echo command the "hello" string should appear on the terminal.
}}


= Testing UART3 =
= Testing UART3 on {{#var:HARDWARE_NAME}} =


Short {{#ifeq: {{#var:HARDWARE_NAME}}|VAR-SOM-MX8M-NANO| J18.3 and J18.5 | J12.11 and J12.13}} pins and run the following commands:
Short J12.11 and J12.13 pins and run the following commands:
<pre>
<pre>
stty -F /dev/ttymxc2 -echo -onlcr 115200
stty -F /dev/ttymxc2 -echo -onlcr 115200
Line 52: Line 84:


For each invocation of echo command the "hello" string should appear on the terminal.
For each invocation of echo command the "hello" string should appear on the terminal.
|}}
{{#ifeq: {{#var:SHOW_SYMPHONY_SECTION}}|true|
= Testing UART3 on {{#var:SYMPHONY_SOM_NAME}} =
Short J18.3 and J18.5 pins and run the following commands:
<pre>
stty -F /dev/ttymxc2 -echo -onlcr 115200
cat /dev/ttymxc2 &
echo hello > /dev/ttymxc2
</pre>
For each invocation of echo command the "hello" string should appear on the terminal.
|}}


= Disabling UART2 =
= Disabling UART2 =


To disable UART2 edit {{#ifeq: {{#var:ANDROID_NAME}} | Pie |{{#var:BUILD_FOLDER}}/{{#var:BUILD_FOLDER_ANDROID}}/variscite/kernel_imx/}}arch/arm64/boot/dts/{{#ifeq: {{#var:HARDWARE_NAME}}|DART-MX8M|{{#ifeq: {{#var:YOCTO_NAME}}|Morty|variscite/imx8m-var-dart-common.dtsi|freescale/fsl-imx8mq-var-dart-common.dtsi}}| {{#ifeq: {{#var:HARDWARE_NAME}}|DART-MX8M-MINI|freescale/fsl-imx8mm-var-dart.dts|freescale/fsl-imx8mn-var-som.dts}}}} under kernel source directory and modify
To disable UART2 on '''{{#var:HARDWARE_NAME}}''' edit {{#var:DTS_PATH}}arch/arm64/boot/dts/{{#var:DTS_NAME}} under kernel source directory and modify


<pre>
<pre>
Line 74: Line 120:


Other UARTs can be disabled in the same manner.
Other UARTs can be disabled in the same manner.
{{#ifeq: {{#var:SYMPHONY_SOM_NAME}}|VAR-SOM-MX8M-MINI|
To disable UART2 on '''{{#var:SYMPHONY_SOM_NAME}}''' edit {{#var:DTS_PATH}}arch/arm64/boot/dts/freescale/freescale/fsl-imx8mm-var-som.dts in the same manner.
|}}

Revision as of 17:26, 23 April 2020


UART

UART Overview

On DART-MX8M all 4 UARTs are enabled by default.
UART1 is connected to debug console.
UART2 and UART3 are connected to J12 header on VAR-DT8MCustomBoard.
UART4 is connected to Bluetooth module.
On DART-MX8M SoMs without WIFI/BT module UART4 is also connected to J12 header.
See the carrier board datasheet for the exact pinout.
Only UART4 has RTS and CTS lines.


UART naming under Linux

The Linux devices corresponding to UART1 - UART4 are /dev/ttymxc0 - /dev/ttymxc3 respectively.

Testing UART2 on DART-MX8M

Short J12.4 and J12.6 pins and run the following commands:

stty -F /dev/ttymxc1 -echo -onlcr 115200
cat /dev/ttymxc1 &
echo hello > /dev/ttymxc1

For each time you run this echo command the "hello" string should appear on the terminal.

Testing UART3 on DART-MX8M

Short J12.11 and J12.13 pins and run the following commands:

stty -F /dev/ttymxc2 -echo -onlcr 115200
cat /dev/ttymxc2 &
echo hello > /dev/ttymxc2

For each invocation of echo command the "hello" string should appear on the terminal.


Disabling UART2

To disable UART2 on DART-MX8M edit arch/arm64/boot/dts/freescale/fsl-imx8mq-var-dart-common.dtsi under kernel source directory and modify

&uart2 {
        ...
        status = "okay";
};

to

&uart2 {
        ...
        status = "disabled";
};

Other UARTs can be disabled in the same manner.