Difference between revisions of "IoTGateway/BSP/Android/Gettingstarted/How to use UART"
From ESS-WIKI
Yuming.lin (talk | contribs) |
Yuming.lin (talk | contribs) |
||
| Line 1: | Line 1: | ||
| − | 1. Overview | + | <span style="color: rgb(0, 0, 205);">'''<span style="font-size: large;">1. Overview</span>'''</span> |
| − | <span lang="en | + | <span lang="en"><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/><span style="color: rgb(0, 0, 205);"><span style="font-size: large;">'''2. Configuration'''</span></span> |
<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 | <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 | ||
| Line 15: | Line 15: | ||
#echo test > /dev/ttymxc1 | #echo test > /dev/ttymxc1 | ||
| − | 3. Boards | + | '''<span style="font-size: large;"><span style="color: rgb(0, 0, 205);">3. Boards</span></span>''' |
| − | + | 3.1 ROM3420 Borad | |
| − | {| style="width: | + | {| style="width: 500px;" cellpadding="1" cellspacing="1" border="1" align="left" |
|- | |- | ||
| − | ! | + | ! scope="col" | '''COM Name''' |
| − | ''' | + | ! scope="col" | '''NXP/Freescale Name''' |
| + | ! scope="col" | '''Device''' | ||
| + | ! scope="col" | | ||
| + | '''RS485 support''' | ||
| + | |||
| + | |- | ||
| + | | COM0 | ||
| + | | UART2 | ||
| + | | | ||
| + | /dev/ttymxc1 | ||
| − | + | | | |
| − | + | No | |
| − | + | |- | |
| − | + | | COM1 | |
| + | | UART4 | ||
| + | | | ||
| + | /dev/ttymxc3 | ||
| − | + | | | |
| − | + | No | |
|- | |- | ||
| − | | | + | | COM2 |
| − | + | | UART5 | |
| + | | | ||
| + | /dev/ttymxc4 | ||
| − | + | | | |
| − | + | No | |
| − | | | + | |} |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | + | | |
| − | |||
| − | + | 3.2 ROM7421 Borad | |
| − | |||
| − | + | {| style="width: 500px;" cellpadding="1" cellspacing="1" border="1" align="left" | |
| + | |- | ||
| + | ! scope="col" | '''COM Name''' | ||
| + | ! scope="col" | '''NXP/Freescale Name''' | ||
| + | ! scope="col" | '''Device''' | ||
| + | ! scope="col" | | ||
'''RS485 support''' | '''RS485 support''' | ||
|- | |- | ||
| − | | | + | | COM0 |
| − | COM0 | + | | UART2 |
| − | + | | | |
| − | | | ||
| − | UART2 | ||
| − | |||
| − | |||
/dev/ttymxc1 | /dev/ttymxc1 | ||
| − | + | | | |
| − | + | Yes | |
|- | |- | ||
| − | | | + | | COM1 |
| − | COM1 | + | | UART4 |
| − | + | | | |
| − | | | ||
| − | UART4 | ||
| − | |||
| − | |||
/dev/ttymxc3 | /dev/ttymxc3 | ||
| − | + | | | |
| − | + | Yes | |
|} | |} | ||
Revision as of 09:18, 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 |
No |
| COM1 | UART4 |
/dev/ttymxc3 |
No |
| COM2 | UART5 |
/dev/ttymxc4 |
No |
3.2 ROM7421 Borad
| COM Name | NXP/Freescale Name | Device |
RS485 support |
|---|---|---|---|
| COM0 | UART2 |
/dev/ttymxc1 |
Yes |
| COM1 | UART4 |
/dev/ttymxc3 |
Yes |