Difference between revisions of "IoTGateway/BSP/Android/Gettingstarted/How to use UART"

From ESS-WIKI
Jump to: navigation, search
Line 105: Line 105:
  
 
|}
 
|}
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
= <span style="color: rgb(0, 0, 205);"><span style="font-size: large;">'''Test Sample'''</span></span> =
 +
 +
1. Click "Serial Port"
 +
 +
[[File:Imx6ABV1 APP serialport.png|972x187px|Imx6ABV1 APP serialport.png]]
 +
 +
2. Click "Setup"
 +
 +
[[File:Imx6ABV1 serialport setup.png|973x552px|Imx6ABV1 serialport setup.png]]
 +
 +
3. Click "Device" , and choose the used device(e.g. ttymxc1)
 +
 +
[[File:Imx6ABV1 serialport setup device 1.png|492x140px|Imx6ABV1 serialport setup device 1.png]]
 +
 +
4. Click "Baud rate" , and choose the used baudrate(e.g. 115200)
 +
 +
[[File:Imx6ABV1 serialport setup device 2.png|428x140px|Imx6ABV1 serialport setup device 2.png]]

Revision as of 04:27, 6 February 2017

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.


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 

Boards

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







 

ROM3420 COM.png

ROM7421 Borad

COM Name NXP/Freescale Name Device

RS485 support

COM0 UART2

/dev/ttymxc1

No

COM1 UART4

/dev/ttymxc3

No







Test Sample

1. Click "Serial Port"

Imx6ABV1 APP serialport.png

2. Click "Setup"

Imx6ABV1 serialport setup.png

3. Click "Device" , and choose the used device(e.g. ttymxc1)

Imx6ABV1 serialport setup device 1.png

4. Click "Baud rate" , and choose the used baudrate(e.g. 115200)

Imx6ABV1 serialport setup device 2.png