Difference between revisions of "Zero/dev/serial-console"
(Created page with "{{Zero_header}} {{Languages|zero/dev/serial-console}} Radxa Zero > Development Guide > Serial Console") |
RadxaYuntian (Talk | contribs) |
||
(One intermediate revision by one other user not shown) | |||
Line 3: | Line 3: | ||
[[Zero | Radxa Zero]] > [[zero/dev | Development Guide]] > [[zero/dev/serial-console | Serial Console]] | [[Zero | Radxa Zero]] > [[zero/dev | Development Guide]] > [[zero/dev/serial-console | Serial Console]] | ||
+ | |||
+ | Radxa Zero exports one dedicated debug serial console, which can be used to access the low level debug message. | ||
+ | |||
+ | === Requirement === | ||
+ | |||
+ | * Radxa Zero | ||
+ | * USB Type-C power adapter and USB Type-C charging data cable | ||
+ | * Host PC with Windows or Linux | ||
+ | * USB to TTL serial cable | ||
+ | ** The definition of each pin of USB to TTL cable is showing like this: | ||
+ | |||
+ | [[File:usb2ttl-cable-definition.jpeg | 500px ]] | ||
+ | |||
+ | ==== Note ==== | ||
+ | |||
+ | * The default baud rate of Radxa Zero is 115200 , please check if your USB to TTL cable support 115200 bps baud rate. This is a well supported data rate, but please still make sure to have a high quality one, as counterfeit products are quite common. The instructions below uses a [https://ftdichip.com/products/ft232rl/ FT232RL] based cable. | ||
+ | |||
+ | === Connection === | ||
+ | |||
+ | Connect the USB to TTL serial cable as below. '''DO NOT connect the red wire.''' We will power Radxa Zero separately from a reliable power supply. | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! Radxa Zero || <---> || USB to TTL cable | ||
+ | |- | ||
+ | | RX(pin 10) || <---> || Green wire | ||
+ | |- | ||
+ | | TX(pin 8) || <---> || White wire | ||
+ | |- | ||
+ | | GND(pin 6) || <---> || Black wire | ||
+ | |} | ||
+ | |||
+ | [[File:Zero-serial-connection.jpeg | 500px ]] | ||
+ | |||
+ | === Serial setting on host PC === | ||
+ | |||
+ | The default serial setting for Radxa Zero U-Boot and kernel console is: | ||
+ | |||
+ | baudrate: 115200 | ||
+ | data bit: 8 | ||
+ | stop bit: 1 | ||
+ | parity : none | ||
+ | flow control: none | ||
+ | |||
+ | ==== Linux ==== | ||
+ | |||
+ | minicom is a serial tool that supports a wide range of baud rate. | ||
+ | |||
+ | Install minicom: | ||
+ | |||
+ | sudo apt-get update | ||
+ | sudo apt-get install minicom | ||
+ | |||
+ | Plug in the USB to TTL cable, kernel <code>sudo dmesg | tail</code> should show the following device: | ||
+ | |||
+ | [1036835.654076] usb 1-6.4.3: new full-speed USB device number 103 using xhci_hcd | ||
+ | [1036835.755730] usb 1-6.4.3: New USB device found, idVendor=0403, idProduct=6001 | ||
+ | [1036835.755732] usb 1-6.4.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0 | ||
+ | [1036835.755733] usb 1-6.4.3: Product: USB <-> Serial | ||
+ | [1036835.755734] usb 1-6.4.3: Manufacturer: FTDI | ||
+ | [1036835.756728] ftdi_sio 1-6.4.3:1.0: FTDI USB Serial Device converter detected | ||
+ | [1036835.756750] usb 1-6.4.3: Detected FT232BM | ||
+ | [1036835.757195] usb 1-6.4.3: FTDI USB Serial Device converter now attached to ttyUSB0 | ||
+ | |||
+ | '''/dev/ttyUSB0''' is our serial device here. | ||
+ | |||
+ | ===== Setup minicom===== | ||
+ | |||
+ | First let's add the current user to <code>plugdev</code> group so we can access serial device without root permission. | ||
+ | |||
+ | sudo usermod -a -G plugdev $USER | ||
+ | |||
+ | Edit your '''~/.bashrc''' and add the following line so minicom will always be launched with the following default setting: | ||
+ | |||
+ | alias minicom='minicom -w -t xterm -l -R UTF-8' | ||
+ | |||
+ | Login to a new terminal to for the change to take effect. | ||
+ | |||
+ | Create and edit file '''~/.minirc.zero''' with the following content: | ||
+ | |||
+ | pu port /dev/ttyUSB0 | ||
+ | pu baudrate 115200 | ||
+ | pu bits 8 | ||
+ | pu parity N | ||
+ | pu stopbits 1 | ||
+ | pu rtscts No | ||
+ | |||
+ | Now executing '''minicom zero''' will use the config above, and connect to Radxa Zero's serial console. | ||
+ | |||
+ | ==== Windows ==== | ||
+ | |||
+ | Putty is also great serial tool that supports a wide range baud rate. | ||
+ | |||
+ | Plug in the USB to TTL cable to you windows PC. In your '''Device Manager''' you can find the '''COMX''' under Serial Port section. In our example it is '''COM3'''. | ||
+ | |||
+ | Launch Putty on your windows PC and configure it as follows: | ||
+ | |||
+ | Under '''Session''', set '''Serial line''' as COM3, '''Speed''' as 115200, and '''Connection type''' as Serial. | ||
+ | |||
+ | Put '''radxa zero''' in the '''Saved Sessions''' textbox and click '''Save''' button. | ||
+ | |||
+ | [[File:Putty-setting-session-zero.jpeg | 500px ]] | ||
+ | |||
+ | Under '''Connection-Serial''', copy the following settings: | ||
+ | |||
+ | [[File:Putty-setting-serial-zero.jpg | 500px ]] | ||
+ | |||
+ | Once you are done, click '''Open''' button to start using serial console. | ||
+ | |||
+ | === FAQs === | ||
+ | |||
+ | ====1. When I opened the debug console, there is system startup information on the screen, but I can't type anything?==== | ||
+ | |||
+ | One possible reason is incorrect serial configuration, such as Hardware Flow Control. Make sure Hardware Flow Control is disabled and try again. |
Latest revision as of 02:24, 2 December 2021
Radxa Zero > Development Guide > Serial Console
Radxa Zero exports one dedicated debug serial console, which can be used to access the low level debug message.
Contents
Requirement
- Radxa Zero
- USB Type-C power adapter and USB Type-C charging data cable
- Host PC with Windows or Linux
- USB to TTL serial cable
- The definition of each pin of USB to TTL cable is showing like this:
Note
- The default baud rate of Radxa Zero is 115200 , please check if your USB to TTL cable support 115200 bps baud rate. This is a well supported data rate, but please still make sure to have a high quality one, as counterfeit products are quite common. The instructions below uses a FT232RL based cable.
Connection
Connect the USB to TTL serial cable as below. DO NOT connect the red wire. We will power Radxa Zero separately from a reliable power supply.
Radxa Zero | <---> | USB to TTL cable |
---|---|---|
RX(pin 10) | <---> | Green wire |
TX(pin 8) | <---> | White wire |
GND(pin 6) | <---> | Black wire |
Serial setting on host PC
The default serial setting for Radxa Zero U-Boot and kernel console is:
baudrate: 115200 data bit: 8 stop bit: 1 parity : none flow control: none
Linux
minicom is a serial tool that supports a wide range of baud rate.
Install minicom:
sudo apt-get update sudo apt-get install minicom
Plug in the USB to TTL cable, kernel sudo dmesg | tail
should show the following device:
[1036835.654076] usb 1-6.4.3: new full-speed USB device number 103 using xhci_hcd [1036835.755730] usb 1-6.4.3: New USB device found, idVendor=0403, idProduct=6001 [1036835.755732] usb 1-6.4.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [1036835.755733] usb 1-6.4.3: Product: USB <-> Serial [1036835.755734] usb 1-6.4.3: Manufacturer: FTDI [1036835.756728] ftdi_sio 1-6.4.3:1.0: FTDI USB Serial Device converter detected [1036835.756750] usb 1-6.4.3: Detected FT232BM [1036835.757195] usb 1-6.4.3: FTDI USB Serial Device converter now attached to ttyUSB0
/dev/ttyUSB0 is our serial device here.
Setup minicom
First let's add the current user to plugdev
group so we can access serial device without root permission.
sudo usermod -a -G plugdev $USER
Edit your ~/.bashrc and add the following line so minicom will always be launched with the following default setting:
alias minicom='minicom -w -t xterm -l -R UTF-8'
Login to a new terminal to for the change to take effect.
Create and edit file ~/.minirc.zero with the following content:
pu port /dev/ttyUSB0 pu baudrate 115200 pu bits 8 pu parity N pu stopbits 1 pu rtscts No
Now executing minicom zero will use the config above, and connect to Radxa Zero's serial console.
Windows
Putty is also great serial tool that supports a wide range baud rate.
Plug in the USB to TTL cable to you windows PC. In your Device Manager you can find the COMX under Serial Port section. In our example it is COM3.
Launch Putty on your windows PC and configure it as follows:
Under Session, set Serial line as COM3, Speed as 115200, and Connection type as Serial.
Put radxa zero in the Saved Sessions textbox and click Save button.
Under Connection-Serial, copy the following settings:
Once you are done, click Open button to start using serial console.
FAQs
1. When I opened the debug console, there is system startup information on the screen, but I can't type anything?
One possible reason is incorrect serial configuration, such as Hardware Flow Control. Make sure Hardware Flow Control is disabled and try again.