How to use UART for RSB-4710

From ESS-WIKI
Revision as of 02:59, 25 September 2024 by Xingxing.li (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

UART

The Android/Linux UART/serial port access is via the tty-devices. The tty-devices have different names depending on the UART driver on different boards. 
RS-485 uses half-duplex communication, which means that one medium is shared for transmitting and receiving data. Therefore the system needs to control the RS- 485 transceiver transmit mode. Usually the UART RTS signal is used to switch the
transmitter on and off.

RSB-4710 UART

Com Name Device Node Remark
COM1 /dev/ttyS4 Support RS-232,no flow control
COM2 /dev/ttyS2 Debug port
COM3 /dev/ttyUSB0 Support RS-232
COM4 /dev/ttyUSB1 Support RS-232
COM5 /dev/ttyUSB2 Support RS-232 and RS-485
COM6 /dev/ttyUSB3 Support RS-232 and RS-485


How to Configure RS232/485 Mode

Enter U-boot interrupt mode.
Connect the device to the debug port and open the debug console.
Press “ctrl + c” before powering on the device. The following information should be displayed on the debug console:

Hit any key to stop autoboot: 0
=> <INTERRUPT>
=>

Then input the following command to configure the UART mode.
RS-485 Mode:

setenv uart_mode 0x0c
saveenv
reset

RS-232 Mode:

setenv uart_mode 0x00
saveenv
reset

Note: 
The default value is RS-232. 
Cp210x supports four ports, but for RSB-4710 only ttyUSB2 and ttyUSB3 support RS-485 mode.
In the above command “setenv uart_mode 0x0c”, 0x0c means set bit2(ttyUSB2) and bit3(ttyUSB3) to 1 (0 means to RS-232; 1 means to RS-485).
To configure just ttyUSB2 (or ttyUSB3) to RS-485 mode, change 0x0c to 0x04 (or 0x08).