Difference between revisions of "IoTGateway/BSP/Android/Gettingstarted/How to use UART"
From ESS-WIKI
Yuming.lin (talk | contribs) (Created page with "1. Overview<br/>2. Configuration 3. Boards *3.1 ROM3420 Borad *3.2 ROM7421 Borad") |
Yuming.lin (talk | contribs) |
||
Line 1: | Line 1: | ||
− | 1. Overview<br/>2. Configuration | + | 1. Overview |
+ | |||
+ | <span lang="en" style="font-family: "新細明體","serif"; font-size: 12pt; mso-bidi-font-family: 新細明體; mso-font-kerning: 0pt; mso-ansi-language: en; mso-fareast-language: zh-tw; mso-bidi-language: ar-sa;"><font color="#000000">The Android/Linux UART/serial port access from user is through the tty-devices. The tty-devices have different names depending on UART driver on different board.</font></span><br/>2. Configuration | ||
+ | |||
+ | <span lang="en"><font color="#000000">The utility stty can configure the serial speed. Then the com port can be accessed as a file:</font></span> Check baudrate | ||
+ | |||
+ | # stty -F /dev/ttymxc1 115200 | ||
+ | |||
+ | Read | ||
+ | |||
+ | #cat /dev/ttymxc1 & | ||
+ | |||
+ | Send | ||
+ | |||
+ | #echo test > /dev/ttymxc1 | ||
3. Boards | 3. Boards | ||
*3.1 ROM3420 Borad | *3.1 ROM3420 Borad | ||
+ | |||
+ | {| style="width: 100.54%;" cellpadding="0" cellspacing="0" border="0" width="100%" | ||
+ | |- | ||
+ | ! style="width: 18.32%;" | | ||
+ | '''COM Name''' | ||
+ | |||
+ | ! style="width: 25.82%;" | | ||
+ | '''NXP/Freescale Name''' | ||
+ | |||
+ | ! style="width: 27.92%;" | | ||
+ | '''Device''' | ||
+ | |||
+ | ! style="width: 27.92%;" | | ||
+ | '''RS485 support''' | ||
+ | |||
+ | |- | ||
+ | | style="width: 18.32%;" | | ||
+ | COM0 | ||
+ | |||
+ | | style="width: 25.82%;" | | ||
+ | UART2 | ||
+ | |||
+ | | style="width: 27.92%;" | | ||
+ | /dev/ttymxc1 | ||
+ | |||
+ | | style="width: 27.92%;" | | ||
+ | Yes | ||
+ | |||
+ | |- | ||
+ | | style="width: 18.32%;" | | ||
+ | COM1 | ||
+ | |||
+ | | style="width: 25.82%;" | | ||
+ | UART4 | ||
+ | |||
+ | | style="width: 27.92%;" | | ||
+ | /dev/ttymxc3 | ||
+ | |||
+ | | style="width: 27.92%;" | | ||
+ | Yes | ||
+ | |||
+ | |- | ||
+ | | style="width: 18.32%;" | | ||
+ | COM2 | ||
+ | |||
+ | | style="width: 25.82%;" | | ||
+ | UART5 | ||
+ | |||
+ | | style="width: 27.92%;" | | ||
+ | /dev/ttymxc4 | ||
+ | |||
+ | | style="width: 27.92%;" | | ||
+ | Yes | ||
+ | |||
+ | |} | ||
+ | |||
*3.2 ROM7421 Borad | *3.2 ROM7421 Borad | ||
+ | |||
+ | {| style="width: 100.54%;" cellpadding="0" cellspacing="0" border="0" width="100%" | ||
+ | |- | ||
+ | ! style="width: 18.32%;" | | ||
+ | '''COM Name''' | ||
+ | |||
+ | ! style="width: 25.82%;" | | ||
+ | '''NXP/Freescale Name''' | ||
+ | |||
+ | ! style="width: 27.92%;" | | ||
+ | '''Device''' | ||
+ | |||
+ | ! style="width: 27.92%;" | | ||
+ | '''RS485 support''' | ||
+ | |||
+ | |- | ||
+ | | style="width: 18.32%;" | | ||
+ | COM0 | ||
+ | |||
+ | | style="width: 25.82%;" | | ||
+ | UART2 | ||
+ | |||
+ | | style="width: 27.92%;" | | ||
+ | /dev/ttymxc1 | ||
+ | |||
+ | | style="width: 27.92%;" | | ||
+ | No | ||
+ | |||
+ | |- | ||
+ | | style="width: 18.32%;" | | ||
+ | COM1 | ||
+ | |||
+ | | style="width: 25.82%;" | | ||
+ | UART4 | ||
+ | |||
+ | | style="width: 27.92%;" | | ||
+ | /dev/ttymxc3 | ||
+ | |||
+ | | style="width: 27.92%;" | | ||
+ | No | ||
+ | |||
+ | |} |
Revision as of 08:35, 25 January 2017
1. Overview
The Android/Linux UART/serial port access from user is through the tty-devices. The tty-devices have different names depending on UART driver on different board.
2. Configuration
The utility stty can configure the serial speed. Then the com port can be accessed as a file: Check baudrate
# stty -F /dev/ttymxc1 115200
Read
#cat /dev/ttymxc1 &
Send
#echo test > /dev/ttymxc1
3. Boards
- 3.1 ROM3420 Borad
COM Name |
NXP/Freescale Name |
Device |
RS485 support |
---|---|---|---|
COM0 |
UART2 |
/dev/ttymxc1 |
Yes |
COM1 |
UART4 |
/dev/ttymxc3 |
Yes |
COM2 |
UART5 |
/dev/ttymxc4 |
Yes |
- 3.2 ROM7421 Borad
COM Name |
NXP/Freescale Name |
Device |
RS485 support |
---|---|---|---|
COM0 |
UART2 |
/dev/ttymxc1 |
No |
COM1 |
UART4 |
/dev/ttymxc3 |
No |