Serial Debugging Tool

Preparation

Connections

  • Use the following diagram to connect your serial tool to your board’s GPIOs:

    • Tool Pin GND: <—> Pin17 of VIM’s GPIO
    • Tool Pin TXD: <—> Pin18 of VIM’s GPIO (Linux_Rx)
    • Tool Pin RXD: <—> Pin19 of VIM’s GPIO (Linux_Tx)
    • Tool Pin VCC: <—> Pin20 of VIM’s GPIO
  • Insert the USB-side of the tool into your computer.

Refer to this image:

Image of SerialConnections

  • Blue line: TXD
  • Orange line: RXD
  • Black line: GND

Another photo (don’t connect VCC):

Image of Serial Connections

Setup Serial Communication Program

Note

VIM1/VIM2/VIM3/VIM3L Baudrate: 115200

VIM4 Baudrate: 921600

Use the minicom serial communication program.

  • Install minicom
1
2
$ sudo apt update
$ sudo apt install minicom
  • Add access permissions
1
$ sudo usermod -a -G dialout $(whoami)

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

  • Setup minicom

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

1
$ sudo minicom -s

Enter the minicom setup mode:

1
2
3
4
5
6
7
8
9
10
11
12
+-----[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.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
+-----------------------------------------------------------------------+
| A - Serial Device : /dev/ttyUSB0 |
| B - Lockfile Location : /var/lock |
| C - Callin Program : |
| D - Callout Program : |
| E - Bps/Par/Bits : 115200 8N1 |
| F - Hardware Flow Control : No |
| G - Software Flow Control : No |
| |
| Change which setting? |
+-----------------------------------------------------------------------+
| Screen and keyboard |
| Save setup as dfl |
| Save setup as.. |
| Exit |
| Exit from Minicom |
+--------------------------+

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.

Note

The serial device node must correspond to Ubuntu’s serial device node.

  • Launch minicom

Type minicom into the Ubuntu Terminal:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
$ 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:
Khadas login:
Khadas login:
  • Exit minicom

You can use Ctrl + A + Z to open the menu:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
+-------------------------------------------------------------------+
| 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.

1
2
3
4
5
6

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

Choose Yes and hit Enter to exit minicom.

Tips
  1. If the Terminal output contains this line, you need to use sudo minicom.

    1
    /dev/ttyUSB0: Permission denied
  2. 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-bar or control-c to stop auto-boot. You will see the prompt kvim# when you’ve entered U-boot.

  3. 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 official OOWOW images.

See Also

  • Install the USB to TTL Driver

Install the CH340 driver.

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

Download the program from the SecureCRT website.

  • 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:

securecrt1

Select the Serial protocol, select the correct device node, set the baudrate to 115200, unselect XON/XOFF.

securecrt2

Click Connect.

securecrt3

  • 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.

minicom1

minicom2

minicom3

  • Install minicom

Use homebrew to install minicom.

1
$ brew install minicom
  • Setup minicom

Connect the USB to TTL Converter tool to your SBC and computer, then input the command:

1
$ minicom -s

Enter minicom setup mode:

1
2
3
4
5
6
7
8
9
10
11
┌─────[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 up/down arrow on the keyboard to shift to the Serial port setup item and hit Enter to enter the Serial port setup menu.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
┌───────────────────────────────────────────────────────────────────────┐
│ A - Serial Device : /dev/tty.usbserial-1410 │
│ B - Lockfile Location : /usr/local/Cellar/minicom/2.7.1/var │
│ C - Callin Program : │
│ D - Callout Program : │
│ E - Bps/Par/Bits : 115200 8N1 │
│ F - Hardware Flow Control : No │
│ G - Software Flow Control : No │
│ │
│ Change which setting? │
└───────────────────────────────────────────────────────────────────────┘
│ Screen and keyboard │
│ Save setup as dfl │
│ Save setup as.. │
│ Exit │
│ Exit from Minicom │
└──────────────────────────┘

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 setup, hit Enter to exit, then choose Save setup as dfl to save the configuration, then choose Exit from Minicom.

Note

The serial device node must correspond to the Mac OS’ serial device node.

  • Launch minicom

Type minicom into the Mac OS Terminal, to access your SBC’s serial Terminal.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
$ minicom
Welcome to minicom 2.7.1

OPTIONS:
Compiled on Sep 18 2017, 15:01:35.
Port /dev/tty.usbserial-1410, 16:02:04

Press Meta-Z for help on special keys

Ubuntu 20.04.2 LTS Khadas ttyS0

Khadas login:
Khadas login:
Khadas login:
  • Exit minicom

You can use option + Z to open the menu:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
┌───────────────────────────────────────────────────────────────────┐
│ Minicom Command Summary │
│ │
│ Commands can be called by Meta-<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.

1
2
3
4
5
6

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

Choose Yes and hit Enter to exit minicom.