Setup Serial Debugging Tool

Preperations

Connections

Follow the steps to do the connections:

1) Connect all the to GPIOs, and check the Tx / Rx Pins and ensure done the right connection:

2) Insert the USB to your PC.

The connections should be like this:

Image of SerialConnections

Another photo for more details(VCC Pin is not necessary):

Image of SerialConnections

Setup the Kermit Protocol(C-Kermit)

Install the c-kermit:

$ sudo apt-get install ckermit

Add the access permission

$ sudo usermod -a -G dialout gouwa

Tips: replace the gouwa with your real username.

Add the following contents into ~/.kermrc to finish the setup:

set line /dev/ttyUSB0
set speed 115200
set carrier-watch off
set handshake none
set flow-control none
robust
set file type bin
set file name lit
set rec pack 1000
set send pack 1000
set window 5
c

Run command kermit to launch C-Kermit

Ensure that you have done the right connection, and if everything goes fine, printing would be like this:

$ kermit
Connecting to /dev/ttyUSB0, speed 115200
 Escape character: Ctrl-\ (ASCII 28, FS): enabled
Type the escape character followed by C to get back,
or followed by ? to see other options.
----------------------------------------------------
GXL:BL1:9ac50e:a1974b;FEAT:ADFC318C;POC:3;RCY:0;EMMC:0;READ:0;0.0;CHK:0;
TE: 116640

...

Tips: If the printing contain following line, you might need to check the step Add the access permission above.

/dev/ttyUSB0: Permission denied

[Optional]Autodect setup

In the development process, the device node ttyUSB0 created at the first connection may drop out and a new one ttyUSB1 will be create if you do connection again at the moment:

$ ls /dev/ttyUSB*
/dev/ttyUSB1
$

In this case, when you run kermit, as the default configuration is setup as ttyUSB0, the connection will fail as following:

$ kermit
?SET SPEED has no effect without prior SET LINE
Sorry, you must SET LINE or SET HOST first
C-Kermit 9.0.302 OPEN SOURCE:, 20 Aug 2011, for Linux+SSL+KRB5 (64-bit)
 Copyright (C) 1985, 2011,
  Trustees of Columbia University in the City of New York.
Type ? or HELP for help.
(/home/gouwa/) C-Kermit> 

There are many solutions for this, but here we tend to introduce a more smart one:

1) Add following contents to /usr/bin/Kermit(the first letter is upper case K):

#!/bin/bash

if [ -c /dev/ttyUSB0 ]; then
    echo -e "kermit: ttyUSB0\n"
    sed -i "s/ttyUSB.*$/ttyUSB0/g" $HOME/.kermrc
elif [ -c /dev/ttyUSB1 ]; then
    echo -e "kermit: ttyUSB1\n"
    sed -i "s/ttyUSB.*$/ttyUSB1/g" $HOME/.kermrc
else
    echo -e "kermit: unknown!\n"
fi

# call the real command
kermit

2) Run new Kermit instead:

$ Kermit
kermit: ttyUSB1

Connecting to /dev/ttyUSB1, speed 115200
 Escape character: Ctrl-\ (ASCII 28, FS): enabled
Type the escape character followed by C to get back,
or followed by ? to see other options.
----------------------------------------------------

kvim#

See Also: