Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


Sidebar

products:sbc:edge-2l:development:setup-serial-tool

Edge-2L Setup Serial Debug Console

Introduction

This page introduces the serial debugging tools. You will learn how to connect a Khadas SBC to a PC and install debugging software on different operating systems.

Preparation

You will need a serial tool, also known as a USB-to-TTL Converter, such as the CH340 USB to TTL Converter.

An Edge-2L IO board is required to interface with the serial tool.

Hardware Connection

serial_connections

USB-TTL pin name Edge-2L GPIO name GPIO pin
1 GND GND 4
2 TXD DRX 3
3 RXD DTX 2

Full Edge-2L GPIO header - reference table

Setup Serial Communication Program

Edge-2L Baudrate: 1500000

Ubuntu

Use the minicom serial communication program.

1. Install

$ sudo apt update
$ sudo apt install minicom

Add permissions to access the serial port:

$ sudo usermod -a -G dialout $(whoami)

You may need to log out or reboot your system for this change to take effect.

2. Setup

Connect your SBC to the computer via the USB-to-TTL converter before setting up minicom.

$ sudo minicom -s

You will 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 navigate to Serial port setup, and press Enter to enter the Serial port setup menu.

  • Press A to set the serial device, then press Enter to confirm.
  • Press E to set the baudrate, select 1500000 and press Enter to confirm.
  • Press F to disable hardware flow control, and set it to NO.

After completing the setup, press Enter to exit the menu, then select Save setup as dfl, and finally Exit from Minicom.

The serial device node must correspond to the correct serial device node in Ubuntu.

3. Launch

Type minicom into the Ubuntu terminal:

$ minicom

Output example:

welcome 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

Press Ctrl+A, then Z to open the help 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.              |
+-------------------------------------------------------------------+

Press Q to exit minicom.

+----------------------+
| Leave without reset? |
|     Yes       No     |
+----------------------+

Choose Yes and hit Enter to exit minicom.

  • If the terminal output contains the following line, you need to use sudo minicom:
/dev/ttyUSB0: Permission denied
  • To access U-Boot, keep the USB-Serial-Debug tool connected, press the reset button on your device once. You should see output in your terminal, then quickly press the Spacebar or Ctrl+C to stop auto-boot. You will see the kvim# prompt when you have entered U-Boot.
  • Standard “help” commands are listed in the U-Boot Usage Guide. You will need to have a version of Android or Ubuntu installed on your device, available from our official OOWOW images.

Windows

1. Install Driver

Install the CH340 driver.

  1. Download the driver.
  2. Unzip the compressed file.
  3. Run the installer.

2. Install SecureCRT

Download the program from the SecureCRT website.

3. Setup SecureCRT

Before starting SecureCRT, connect the USB-to-TTL converter tool to your SBC and computer.

Launch SecureCRT and navigate to FileQuick Connect:

securecrt1

Select the Serial protocol, choose the correct COM port (device node), set the baudrate to 1500000, and ensure XON/XOFF is not selected.

securecrt2

Click Connect.

securecrt3

Mac OS

1. Setup Meta key

Minicom requires a Meta key. To create one, open the Terminal application and go to TerminalPreferencesKeyboard, select Use Option as Meta key.

minicom1_en
minicom2_en
minicom3_en

2. Install

$ brew install minicom

Add access permissions

$ sudo usermod -a -G dialout $(whoami)

You may need to log out or reboot your system for changes to take effect.

3. Setup

Connect the USB-to-TTL converter tool to your SBC and computer before setting up minicom.

$ sudo minicom -s

You will 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 navigate to Serial port setup, and press Enter to enter the Serial port setup menu.

  • Press A to set the serial device, then press Enter to confirm.
  • Press E to set the baudrate, select 1500000 and press Enter to confirm.
  • Press F to disable hardware flow control, and set it to NO.

After completing the setup, press Enter to exit the menu, then select Save setup as dfl, and finally Exit from Minicom.

The serial device node must correspond to the correct serial device node in macOS.

4. Launch

Type minicom in the terminal:

$ minicom

Output example:

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

Press Ctrl+A, then Z to open the help 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.              |
+-------------------------------------------------------------------+

Press Q to exit minicom.

You will see:

+----------------------+
| Leave without reset? |
|     Yes       No     |
+----------------------+

Select Yes and press Enter to exit minicom.

Last modified: 2026/02/01 22:48 by gray