Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


products:sbc:edge2:development:setup-serial-tool

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
products:sbc:edge2:development:setup-serial-tool [2022/09/28 00:30]
hyphop
products:sbc:edge2:development:setup-serial-tool [2022/12/05 05:19]
hyphop [Hardware Connection]
Line 1: Line 1:
-====== Edge2 Serial console ======+====== Edge2 Setup Serial Debug Console ====== 
 + 
 +===== Introduction ===== 
 + 
 +This page will introduce the serial debugging tools. You will learn how to connect Khadas SBC to PC and install debugging software on different PCs. 
 + 
 +===== Preparation ===== 
 + 
 +Take a serial tool, which is also known as an USB to TTL Converter like [[https://www.amazon.com/Adaptor-Download-Adapter-Converter-LinkMore/dp/B08VGRRJ67/ref=sr_1_4?dchild=1&keywords=USB+to+TTL+ch340&qid=1629184609&sr=8-4|CH340 USB to TTL Converter]]. 
 + 
 +An [[/products/sbc/edge2/applications/gpio/40pin-header|Edge2 IO board]] is needed to work with the serial tool. 
 + 
 + 
 +===== Hardware Connection ===== 
 + 
 +{{/products/sbc/edge2/development/edge2-io.webp?500|serial_connections}} 
 + 
 +^  ^ USB-TTL pin name  ^ Edge2 GPIO name ^ GPIO pin ^  
 +| 1 | ''GND''      | ''GND'' | 4 | 
 +| 2 | ''TXD''      | ''DRX'' | 3 | 
 +| 3 | ''RXD''      | ''DTX'' | 2 | 
 + 
 +Full [[/products/sbc/edge2/applications/gpio/40pin-header#reference-table| Edge2 GPIO header - reference table]] 
 +       
 +/* IMHO its ugly  
 + 
 +You can connect your serial tool to the board GPIO pins, referring to the following diagram, 
 + 
 +  * Tool Pin ''GND'' <-> ''Pin1'' of Edge2 IO's GPIO 
 +  * Tool Pin ''TXD'' <-> ''Pin2'' of Edge2 IO's GPIO ''DRX'' 
 +  * Tool Pin ''RXD'' <-> ''Pin3'' of Edge2 IO's GPIO ''DTX'' 
 + 
 +*/ 
 + 
 +===== Setup Serial Communication Program ===== 
 + 
 +<WRAP important > 
 +Edge2 Baudrate: **1500000** 
 +</WRAP> 
 + 
 +<tabbox Ubuntu>  
 + 
 +Use the ''minicom'' serial communication program. 
 + 
 +1. **Install** 
 + 
 +```shell 
 +$ sudo apt update 
 +$ sudo apt install minicom 
 +``` 
 +Add permissions to access 
 +```shell 
 +$ sudo usermod -a -G dialout $(whoami) 
 +``` 
 +<WRAP info > 
 +You may need to logout or reboot your system to take effect. 
 +</WRAP> 
 + 
 +2. **Setup** 
 + 
 +Connect your SBC to the computer via the USB to TTL Converter tool before setting up ''minicom''
 + 
 +```shell 
 +$ sudo minicom -s 
 +``` 
 + 
 +Enter the ''minicom'' setup mode: 
 +``` 
 ++-----[configuration]------+ 
 +| Filenames and paths      | 
 +| File transfer protocols 
 +| Serial port setup        | 
 +| Modem and dialing        | 
 +| Screen and keyboard      | 
 +| Save setup as dfl        | 
 +| Save setup as..          | 
 +| Exit                     | 
 +| Exit from Minicom        | 
 ++--------------------------+ 
 +``` 
 +Use the up/down arrow keys to shift to ''Serial port setup'', and hit Enter to enter the ''Serial port setup menu''
 + 
 +  * You can use ''Shift'' + ''A'' to setup the serial device, hit Enter to confirm. 
 +  * You can use ''Shift'' + ''E'' to setup the baudrate, choose ''115200'' and hit Enter to confirm. 
 +  * You can use ''Shift'' + ''F'' to disable the hardware flow control, set to ''NO''
 + 
 +After completing the setup, hit Enter to exit, then choose Save setup as dfl, then Exit from Minicom. 
 +<WRAP info > 
 +The serial device node must correspond to Ubuntu’s serial device node. 
 +</WRAP> 
 + 
 +3. **Launch** 
 + 
 +Type ''minicom'' into the Ubuntu Terminal: 
 + 
 +``` 
 +$ minicom 
 +elcome to minicom 2.7.1 
 + 
 +OPTIONS: I18n  
 +Compiled on Dec 23 2019, 02:06:26. 
 +Port /dev/ttyUSB0, 15:24:13 
 + 
 +Press CTRL-A Z for help on special keys 
 + 
 +Ubuntu 20.04.2 LTS Khadas ttyS0 
 + 
 +Khadas login:  
 +``` 
 + 
 +4. **Exit** 
 + 
 +You can use ''Ctrl''+''A''+''Z'' to open the menu: 
 +``` 
 ++-------------------------------------------------------------------+ 
 +|                      Minicom Command Summary                      | 
 +|                                                                   | 
 +|              Commands can be called by CTRL-A <key>               | 
 +|                                                                   | 
 +|               Main Functions                  Other Functions     | 
 +|                                                                   | 
 +| Dialing directory..D  run script (Go)....G | Clear Screen.......C | 
 +| Send files.........S  Receive files......R | cOnfigure Minicom..O | 
 +| comm Parameters....P  Add linefeed.......A | Suspend minicom....J | 
 +| Capture on/off.....L  Hangup.............H | eXit and reset.....X | 
 +| send break.........F  initialize Modem...M | Quit with no reset.Q | 
 +| Terminal settings..T  run Kermit.........K | Cursor key mode....I | 
 +| lineWrap on/off....W  local Echo on/off..E | Help screen........Z | 
 +| Paste file.........Y  Timestamp toggle...N | scroll Back........B | 
 +| Add Carriage Ret...U                                              | 
 +|                                                                   | 
 +|             Select function or press Enter for none.              | 
 ++-------------------------------------------------------------------+ 
 +``` 
 +Use ''Shift''+''Q'' to exit ''minicom''
 + 
 +``` 
 ++----------------------+ 
 +| Leave without reset? | 
 +|     Yes       No     | 
 ++----------------------+ 
 +``` 
 +Choose ''Yes'' and hit Enter to exit ''minicom''
 + 
 + 
 +<WRAP info > 
 +  * If the Terminal output contains this line, you need to use ''sudo minicom''.\\ ```sh 
 +/dev/ttyUSB0: Permission denied 
 +``` 
 +  * To access U-Boot, leave your USB-Serial-Debug tool connected, then press the reset button on your device once. You should see some print-out on your Terminal, then quickly press the ''space'' or ''control-c'' to stop auto-boot. You will see the prompt ''kvim#'' when you've entered U-boot. 
 +  * Standard “help” commands are listed in U-Boot Usage Guide, you’ll need to first have a version of Android or Ubuntu installed in your VIM device, from our [[https://dl.khadas.com/Firmware/Krescue/images|official OOWOW]] images. 
 +</WRAP> 
 + 
 +<tabbox Windows>  
 + 
 +1. Install Driver 
 + 
 +Install the CH340 driver. 
 + 
 +  - Download the [[https://dl.khadas.com/Tools/CH34x_Install_Windows_v3_4.zip|driver]]. 
 +  - Unzip the compressed file. 
 +  - Run the installer. 
 + 
 +2. Install SecureCRT 
 + 
 +Download the program from the [[https://www.vandyke.com/products/securecrt|SecureCRT]] website. 
 + 
 +3. Setup SecureCRT 
 + 
 +Before starting SecureCRT, you’ll need to connect the USB to TTL Converter tool to your SBC and computer. 
 + 
 +Launch SecureCRT and navigate to ''File''->''Quick Connect'': 
 + 
 +{{/products/sbc/common/development/securecrt1.png|securecrt1}} 
 + 
 +Select the ''Serial'' protocol, select the correct device node, set the baudrate to ''115200'', unselect ''XON/XOFF''
 + 
 +{{/products/sbc/common/development/securecrt2.png|securecrt2}} 
 + 
 +Click ''Connect''
 + 
 +{{/products/sbc/common/development/securecrt3.png|securecrt3}} 
 + 
 +<tabbox Mac OS>  
 + 
 +1. Setup Meta key 
 + 
 +minicom needs a Meta key. Use Terminal to create a Meta key. 
 +Go to ''Terminal''->''Preferences''->''Keyboard'', select Use Option as Meta key. 
 + 
 +{{/products/sbc/common/development/minicom1_en.png|minicom1_en}} \\ 
 +{{/products/sbc/common/development/minicom2_en.png|minicom2_en}} \\ 
 +{{/products/sbc/common/development/minicom3_en.png|minicom3_en}} 
 + 
 +2. Install 
 + 
 +```shell 
 +$ sudo apt update 
 +$ sudo apt install minicom 
 +``` 
 +Add access permissions 
 +```shell 
 +$ sudo usermod -a -G dialout $(whoami) 
 +``` 
 +<WRAP info > 
 +You may need to logout or reboot your system for changes to take effect. 
 +</WRAP> 
 + 
 +3. Setup 
 + 
 +Connect the USB to TTL Converter tool to your SBC and computer before setting up ''minicom''
 +```shell 
 +$ sudo minicom -s 
 +``` 
 +Enter the minicom setup mode: 
 +``` 
 ++-----[configuration]------+ 
 +| Filenames and paths      | 
 +| File transfer protocols 
 +| Serial port setup        | 
 +| Modem and dialing        | 
 +| Screen and keyboard      | 
 +| Save setup as dfl        | 
 +| Save setup as..          | 
 +| Exit                     | 
 +| Exit from Minicom        | 
 ++--------------------------+ 
 +``` 
 +Use the up/down arrows to shift to ''Serial port setup'', and hit Enter to enter the ''Serial port setup menu''
 + 
 +  * You can use ''Shift'' + ''A'' to setup the serial device, hit Enter to confirm. 
 +  * You can use ''Shift'' + ''E'' to setup the baudrate, choose ''115200'' and hit Enter to confirm. 
 +  * You can use ''Shift'' + ''F'' to disable the hardware flow control, set to ''NO''
 + 
 +After completing the setup, hit Enter to exit, then choose Save setup as dfl, then Exit from Minicom. 
 + 
 +<WRAP info > 
 +The serial device node must correspond to the Mac OS’ serial device node. 
 +</WRAP> 
 + 
 +4. Launch 
 + 
 +Type ''minicom'' into the Ubuntu Terminal: 
 + 
 +``` 
 +$ minicom 
 +elcome to minicom 2.7.1 
 + 
 +OPTIONS: I18n  
 +Compiled on Dec 23 2019, 02:06:26. 
 +Port /dev/ttyUSB0, 15:24:13 
 + 
 +Press CTRL-A Z for help on special keys 
 + 
 +Ubuntu 20.04.2 LTS Khadas ttyS0 
 + 
 +Khadas login:  
 +``` 
 + 
 +5. Exit 
 + 
 +You can use ''Ctrl''+''A''+''Z'' to open the menu: 
 +``` 
 ++-------------------------------------------------------------------+ 
 +|                      Minicom Command Summary                      | 
 +|                                                                   | 
 +|              Commands can be called by CTRL-A <key>               | 
 +|                                                                   | 
 +|               Main Functions                  Other Functions     | 
 +|                                                                   | 
 +| Dialing directory..D  run script (Go)....G | Clear Screen.......C | 
 +| Send files.........S  Receive files......R | cOnfigure Minicom..O | 
 +| comm Parameters....P  Add linefeed.......A | Suspend minicom....J | 
 +| Capture on/off.....L  Hangup.............H | eXit and reset.....X | 
 +| send break.........F  initialize Modem...M | Quit with no reset.Q | 
 +| Terminal settings..T  run Kermit.........K | Cursor key mode....I | 
 +| lineWrap on/off....W  local Echo on/off..E | Help screen........Z | 
 +| Paste file.........Y  Timestamp toggle...N | scroll Back........B | 
 +| Add Carriage Ret...U                                              | 
 +|                                                                   | 
 +|             Select function or press Enter for none.              | 
 ++-------------------------------------------------------------------+ 
 +``` 
 +Use ''Shift''+''Q'' to exit ''minicom''
 + 
 +``` 
 ++----------------------+ 
 +| Leave without reset? | 
 +|     Yes       No     | 
 ++----------------------+ 
 +``` 
 +Choose ''Yes'' and hit Enter to exit ''minicom''
 +</tabbox>
  
  
-{{page>products:sbc:common:development:setup-serial-tool&noheader}} 
Last modified: 2023/04/03 22:30 by nick