Difference between revisions of "How to debug"

From ESS-WIKI
Jump to: navigation, search
 
(12 intermediate revisions by 2 users not shown)
Line 3: Line 3:
 
There are plenty types of usb to uart bridge in the market . Most of them use the following chip :
 
There are plenty types of usb to uart bridge in the market . Most of them use the following chip :
  
*CP210X
+
*[https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers CP210X]
*PL2303
+
*[http://www.prolific.com.tw/US/ShowProduct.aspx?pcid=41 PL2303]
 +
*[https://sparks.gogo.co.nz/ch340.html CH340]
  
It is easy to get the drivers. Download driver for [https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers CP210X ]and [http://www.prolific.com.tw/US/ShowProduct.aspx?p_id=225&pcid=41 PL2303 ].
+
= Hardware PIN define <!--5f39ae17-8c62-4a45-bc43-b32064c9388a:W3siYmxvY2tJZCI6IjcwMjQtMTU1MzQ5MTgyOTM0NyIsImJsb2NrVHlwZSI6InBhcmFncmFwaCIsInN0eWxlcyI6eyJhbGlnbiI6ImxlZnQiLCJpbmRlbnQiOjAsInRleHQtaW5kZW50IjowLCJsaW5lLWhlaWdodCI6MS43NSwiYmFjay1jb2xvciI6IiIsInBhZGRpbmciOiIifSwidHlwZSI6InBhcmFncmFwaCIsInJpY2hUZXh0Ijp7ImRhdGEiOlt7ImNoYXIiOiJVIn0seyJjaGFyIjoiUyJ9LHsiY2hhciI6IkIifSx7ImNoYXIiOiIgIn0seyJjaGFyIjoidCJ9LHsiY2hhciI6Im8ifSx7ImNoYXIiOiIgIn0seyJjaGFyIjoiVSJ9LHsiY2hhciI6IkEifSx7ImNoYXIiOiJSIn0seyJjaGFyIjoiVCJ9LHsiY2hhciI6IiAifSx7ImNoYXIiOiJhIn0seyJjaGFyIjoiZCJ9LHsiY2hhciI6ImEifSx7ImNoYXIiOiJwIn0seyJjaGFyIjoidCJ9LHsiY2hhciI6ImUifSx7ImNoYXIiOiJyIn1dLCJpc1JpY2hUZXh0Ijp0cnVlLCJrZWVwTGluZUJyZWFrIjp0cnVlfX0seyJibG9ja0lkIjoiNTAxMy0xNTUzNDkyMDU3MTkxIiwiYmxvY2tUeXBlIjoicGFyYWdyYXBoIiwic3R5bGVzIjp7ImFsaWduIjoibGVmdCIsImluZGVudCI6MCwidGV4dC1pbmRlbnQiOjAsImxpbmUtaGVpZ2h0IjoxLjc1LCJiYWNrLWNvbG9yIjoiIiwicGFkZGluZyI6IiJ9LCJ0eXBlIjoicGFyYWdyYXBoIiwicmljaFRleHQiOnsiZGF0YSI6W3siY2hhciI6IkgifSx7ImNoYXIiOiJhIn0seyJjaGFyIjoiciJ9LHsiY2hhciI6ImQifSx7ImNoYXIiOiJ3In0seyJjaGFyIjoiYSJ9LHsiY2hhciI6InIifSx7ImNoYXIiOiJlIn0seyJjaGFyIjoiICJ9LHsiY2hhciI6IlAifSx7ImNoYXIiOiJJIn0seyJjaGFyIjoiTiJ9LHsiY2hhciI6IiAifSx7ImNoYXIiOiJkIn0seyJjaGFyIjoiZSJ9LHsiY2hhciI6ImYifSx7ImNoYXIiOiJpIn0seyJjaGFyIjoibiJ9LHsiY2hhciI6ImUifV0sImlzUmljaFRleHQiOnRydWUsImtlZXBMaW5lQnJlYWsiOnRydWV9fV0=--> =
  
 +
RSB4680 debug port pin define&nbsp;:&nbsp;
  
 +
{| border="1" cellspacing="1" cellpadding="1"
 +
|-
 +
| '''PIN'''
 +
| '''PIN Name'''
 +
|-
 +
| 1
 +
| NC
 +
|-
 +
| 2
 +
| TX
 +
|-
 +
| 3
 +
| RX
 +
|-
 +
| 4
 +
| GND
 +
|}
  
= Hardware PIN define <!--5f39ae17-8c62-4a45-bc43-b32064c9388a:W3siYmxvY2tJZCI6IjcwMjQtMTU1MzQ5MTgyOTM0NyIsImJsb2NrVHlwZSI6InBhcmFncmFwaCIsInN0eWxlcyI6eyJhbGlnbiI6ImxlZnQiLCJpbmRlbnQiOjAsInRleHQtaW5kZW50IjowLCJsaW5lLWhlaWdodCI6MS43NSwiYmFjay1jb2xvciI6IiIsIn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5lQnJlYWsiOnRydWV9fV0=--> =
+
[[File:RSB4680 Debug port.jpg|885x675px|RSB4680 Debug port.jpg]]
 +
 
 +
'''Note&nbsp;:&nbsp;'''
  
TBD
+
Please connect device's TX to usb2uart adapter's RX and&nbsp;device's RX to usb2uart adapter's TX .
  
 
= UART parameter =
 
= UART parameter =
Line 21: Line 42:
 
*Parity&nbsp; &nbsp; &nbsp; :None
 
*Parity&nbsp; &nbsp; &nbsp; :None
 
*FlowControl:None or XON/XOFF
 
*FlowControl:None or XON/XOFF
 +
 +
 +
 +
= Debug on windows =
 +
 +
Install usb2uart adapter's driver. Connect adapter to PC , you will find COM port like&nbsp;:
 +
 +
[[File:RK3288 Debian Debug Port Number.png|800x572px|RK3288 Debian Debug Port Number.png]]
 +
 +
Putty is very populate tool on Windows. [https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html Download putty here.]
 +
 +
Run PUTTY.exe, select&nbsp;Connection type of "Serial" , input COM port found in Device Manager.
 +
 +
Set Parameter like&nbsp;:
  
 
[[File:RK3288 Debian Debug Port Config.png|RTENOTITLE]]
 
[[File:RK3288 Debian Debug Port Config.png|RTENOTITLE]]
 +
 +
Then Click "Open" to start debug console.
 +
 +
 +
 +
= Debug on Ubuntu =
 +
 +
"Kermit" and "MiniCom" are very famous tools on Ubuntu.
 +
 +
&nbsp;Connect adapter to PC , find COM port&nbsp;:
 +
<pre>$ ls /dev/ttyUSB*
 +
/dev/ttyUSB0
 +
</pre>
 +
 +
 +
 +
 +
 +
== Kermit ==
 +
 +
'''Install Kermit&nbsp;:&nbsp;'''
 +
<pre>sudo apt-get update
 +
sudo apt-get install ckermit
 +
</pre>
 +
 +
'''Config Kermit&nbsp;:&nbsp;'''
 +
<pre>vi $HOME/.kermrc;
 +
</pre>
 +
 +
Input the following content&nbsp;:&nbsp;
 +
<pre>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 &nbsp;pack 1000
 +
set send pack 1000
 +
set window 5
 +
 +
</pre>
 +
 +
'''Note&nbsp;:&nbsp;'''
 +
 +
Change "/dev/ttyUSB0" according your system, Use Command "ls /dev/ttyUSB*" .
 +
 +
'''Run kermit'''
 +
<pre>sudo kermit
 +
</pre>
 +
 +
= MiniCom =
 +
 +
'''Install MiniCom:&nbsp;'''
 +
<pre>sudo apt-get update
 +
sudo apt-get install minicom
 +
</pre>
 +
 +
 +
 +
'''Run kermit'''
 +
<pre>$ sudo minicom
 +
Welcome to minicom 2.7                                     
 +
OPTIONS: I18n     
 +
Compiled on Jan  1 2014, 17:13:19.   
 +
Port /dev/ttyUSB0, 15:57:00                               
 +
Press CTRL-A Z for help on special keys</pre>
 +
 +
According the tips, press CTRL-A, then press Z to show help.
 +
<pre>  +-------------------------------------------------------------------+
 +
                          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.              |
 +
  +--------------------------------------------------------------------+</pre>
 +
 +
According the tips, press O&nbsp;to show configuration.
 +
<pre> +-----[configuration]------+ 
 +
          | Filenames and paths      | 
 +
          | File transfer protocols  | 
 +
          | Serial port setup        | 
 +
          | Modem and dialing        | 
 +
          | Screen and keyboard      |
 +
          | Save setup as dfl        |
 +
          | Save setup as..          |               
 +
          | Exit                    |               
 +
          +--------------------------+</pre>
 +
 +
Press "↓", move cursor to "Serial port setup" to Config parameter.
 +
 +
Then press "A"-"G" to set relative content as following&nbsp;:
 +
<pre> +-----------------------------------------------------------------------+                                         
 +
  | A -    Serial Device    &nbsp;: /dev/ttyUSB0                              |                                         
 +
  | B - Lockfile Location    &nbsp;: /var/lock                                |                                         
 +
  | C -  Callin Program    &nbsp;:                                          |                                         
 +
  | D -  Callout Program    &nbsp;:                                          |                                         
 +
  | E -    Bps/Par/Bits      &nbsp;: 115200 8N1                                |                                         
 +
  | F - Hardware Flow Control&nbsp;: No                                        |                                         
 +
  | G - Software Flow Control&nbsp;: No                                        |                                         
 +
  |                                                                      |                                         
 +
  |    Change which setting?                                              |                                         
 +
  +-----------------------------------------------------------------------+</pre>
 +
 +
When configuration is done, back to choose "Save setup as dfl" to save as default configuration.

Latest revision as of 04:28, 26 October 2021

USB2UART Bridge

There are plenty types of usb to uart bridge in the market . Most of them use the following chip :

Hardware PIN define

RSB4680 debug port pin define : 

PIN PIN Name
1 NC
2 TX
3 RX
4 GND

RSB4680 Debug port.jpg

Note : 

Please connect device's TX to usb2uart adapter's RX and device's RX to usb2uart adapter's TX .

UART parameter

  • BaudRate:115200
  • DataBits  :8
  • StopBits  :1
  • Parity      :None
  • FlowControl:None or XON/XOFF


Debug on windows

Install usb2uart adapter's driver. Connect adapter to PC , you will find COM port like :

RK3288 Debian Debug Port Number.png

Putty is very populate tool on Windows. Download putty here.

Run PUTTY.exe, select Connection type of "Serial" , input COM port found in Device Manager.

Set Parameter like :

RTENOTITLE

Then Click "Open" to start debug console.


Debug on Ubuntu

"Kermit" and "MiniCom" are very famous tools on Ubuntu.

 Connect adapter to PC , find COM port :

$ ls /dev/ttyUSB*
/dev/ttyUSB0



Kermit

Install Kermit : 

sudo apt-get update
sudo apt-get install ckermit

Config Kermit : 

vi $HOME/.kermrc;

Input the following content : 

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

Note : 

Change "/dev/ttyUSB0" according your system, Use Command "ls /dev/ttyUSB*" .

Run kermit

sudo kermit

MiniCom

Install MiniCom: 

sudo apt-get update
sudo apt-get install minicom


Run kermit

$ sudo minicom
Welcome to minicom 2.7                                       
OPTIONS: I18n       
Compiled on Jan  1 2014, 17:13:19.     
Port /dev/ttyUSB0, 15:57:00                                 
Press CTRL-A Z for help on special keys

According the tips, press CTRL-A, then press Z to show help.

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

According the tips, press O to show configuration.

 +-----[configuration]------+  
           | Filenames and paths      |   
           | File transfer protocols  |   
           | Serial port setup        |  
           | Modem and dialing        |  
           | Screen and keyboard      | 
           | Save setup as dfl        | 
           | Save setup as..          |                 
           | Exit                     |                 
           +--------------------------+

Press "↓", move cursor to "Serial port setup" to Config parameter.

Then press "A"-"G" to set relative content as following :

 +-----------------------------------------------------------------------+                                          
   | 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?                                              |                                          
   +-----------------------------------------------------------------------+

When configuration is done, back to choose "Save setup as dfl" to save as default configuration.