Difference between revisions of "LeapFrog Pollux Platform: FTDI JTAG How To"
(→Background) |
Peter Huewe (talk | contribs) m (moved Pollux: FTDI JTAG How To to LeapFrog Pollux Platform: FTDI JTAG How To: Consistent naming) |
||
(32 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
+ | [[Image:Didj_DLP_JTAG.JPG |350px|thumb|Didj FTDI2232 JTAG setup]] | ||
+ | |||
== Background == | == Background == | ||
− | |||
− | As we all progressed with our experimentation, Moogle [http://wtfmoogle.com/?p=910 identified the JTAG pads] on Didj, and then bcav added [[Didj JTAG How To | a wiki entry]] on how to use the JTAG port to debug a bootloader on Didj with [http://openocd.berlios.de/web/ OpenOCD] (Open On-Chip Debugger). We later happily discovered that JTAG pads are clearly labeled on the Leapster Explorer (in my book, its a Big Win whenever a manufacturer acknowleges our [http://cdn.makezine.com/make/MAKERS_RIGHTS.pdf Fundamental Rights!]) | + | I had been curious about JTAG ever since I started experimenting with Didj. I had wondered about whether it could be used to investigate our Pollux-based devices. |
+ | |||
+ | As we all progressed with our experimentation, Moogle [http://wtfmoogle.com/?p=910 identified the JTAG pads] on Didj, and then bcav added [[Didj JTAG How To | a wiki entry]] on how to use the JTAG port to debug a bootloader on Didj with [http://openocd.berlios.de/web/ OpenOCD] (Open On-Chip Debugger). We later happily discovered that JTAG pads are clearly labeled on the Leapster Explorer mainboard (in my book, its a Big Win whenever a manufacturer acknowleges our [http://cdn.makezine.com/make/MAKERS_RIGHTS.pdf Fundamental Rights!]) | ||
I had JTAG experimentation on my list-of-things-to-try for a while, but I didnt want to spend $72 to buy the JTAG dongle bcav used in the wiki entry. (I did have a home-made [http://nuwiki.openwrt.org/oldwiki/OpenWrtDocs/Customizing/Hardware/JTAG_Cable wiggler cable] that I hacked together for use with WRT routers, but I wasn't confident enough that it would fit the bill for this use case. Plus the speed over a parallel port was not great) | I had JTAG experimentation on my list-of-things-to-try for a while, but I didnt want to spend $72 to buy the JTAG dongle bcav used in the wiki entry. (I did have a home-made [http://nuwiki.openwrt.org/oldwiki/OpenWrtDocs/Customizing/Hardware/JTAG_Cable wiggler cable] that I hacked together for use with WRT routers, but I wasn't confident enough that it would fit the bill for this use case. Plus the speed over a parallel port was not great) | ||
− | Upon learning that that the ftdi2232 chip could be used to bitbang a JTAG connection and that the same part powers many USB-based JTAG cables, I purchased a $30 breakout board that was based on that chip - [http://www.dlpdesign.com/usb/usb1232h.shtml DLP Design DLP-USB1232H] ([http://www.dlpdesign.com/usb1232h-ds- | + | Upon learning that that the ftdi2232 chip could be used to bitbang a JTAG connection and that the same part powers many USB-based JTAG cables, I purchased a $30 breakout board that was based on that chip - [http://www.dlpdesign.com/usb/usb1232h.shtml DLP Design DLP-USB1232H] ([http://www.dlpdesign.com/usb/usb1232h-ds-v13.pdf datasheet]). |
− | What follows are the steps I used to make this breakout work with Didj and | + | What follows are the steps I used to make this breakout work with Didj, LX, LPX, and the Pollux-based eGo netbooks. |
+ | |||
+ | '''NOTE: if you aren't interested in wiring up your own usb JTAG using the FT2232, you can purchase a [[Flyswatter]] from [http://www.tincantools.com TinCanTools] for $49.95''' | ||
== Connecting == | == Connecting == | ||
+ | [[Image:JTAG PADS.jpg |150px|thumb|Didj JTAG pads]] | ||
+ | [[Image:DidjTP103.png|150px|thumb|Didj nSRST pad on opposite side of mainboard from JTAG pads]] | ||
+ | [[Image:LX-JTAG.jpg |150px|thumb|Leapster Explorer JTAG pads]] | ||
+ | [[Image:LP-JTAG.png |150px|thumb|LeapPad Explorer JTAG pads]] | ||
+ | [[Image:Augen-eGo-732-JTAG-FRONT.png|150px|thumb|Augen eGo 730-4 front JTAG pads]] | ||
+ | [[Image:Augen-eGo-732-JTAG-BACK.png|150px|thumb|Augen eGo 730-4 back JTAG pads]] | ||
− | The table below illustrates how to connect the DLP-USB1232H device pins to Didj and | + | The table below illustrates how to connect the DLP-USB1232H device pins to Didj, LX and the eGo. |
The pinout on the breakout is in the [http://www.dlpdesign.com/usb1232h-ds-v12.pdf DLP-USB1232H datasheet] (pinout is on page 4 and page 7). | The pinout on the breakout is in the [http://www.dlpdesign.com/usb1232h-ds-v12.pdf DLP-USB1232H datasheet] (pinout is on page 4 and page 7). | ||
Line 21: | Line 32: | ||
! align="left" | Didj Test Pad label | ! align="left" | Didj Test Pad label | ||
! align="left" | LX Test Pad label | ! align="left" | LX Test Pad label | ||
+ | ! align="left" | LPX Test Pad label | ||
+ | ! align="left" | eGo photo label | ||
|- bgcolor="#eeeeee" | |- bgcolor="#eeeeee" | ||
Line 27: | Line 40: | ||
| TP9 | | TP9 | ||
| RST | | RST | ||
+ | | RST | ||
+ | | nTRST | ||
|- bgcolor="#eeeeee" | |- bgcolor="#eeeeee" | ||
Line 33: | Line 48: | ||
| TP10 | | TP10 | ||
| TDI | | TDI | ||
+ | | TDI | ||
+ | | TDI | ||
|- bgcolor="#eeeeee" | |- bgcolor="#eeeeee" | ||
Line 38: | Line 55: | ||
| 5 | | 5 | ||
| TP11 | | TP11 | ||
+ | | TMS | ||
+ | | TMS | ||
| TMS | | TMS | ||
Line 44: | Line 63: | ||
| 18 | | 18 | ||
| TP12 | | TP12 | ||
+ | | TCK | ||
+ | | TCK | ||
| TCK | | TCK | ||
Line 50: | Line 71: | ||
| 2 | | 2 | ||
| TP13 | | TP13 | ||
+ | | TDO | ||
+ | | TDO | ||
| TDO | | TDO | ||
Line 55: | Line 78: | ||
| '''(S)RST''' | | '''(S)RST''' | ||
| 13 | | 13 | ||
− | | | + | | TP103 [1] |
+ | | nRST | ||
| nRST | | nRST | ||
− | + | | nPORST | |
+ | |||
|- bgcolor="#eeeeee" | |- bgcolor="#eeeeee" | ||
| '''GND''' | | '''GND''' | ||
Line 63: | Line 88: | ||
| TP14 | | TP14 | ||
| GND | | GND | ||
+ | | GND | ||
+ | | use any GND | ||
|} | |} | ||
'''IMPORTANT:''' You also need to '''connect pins 8 and 9 together''' on the DLP-USB1232H module in order to configure it to be powered via USB. | '''IMPORTANT:''' You also need to '''connect pins 8 and 9 together''' on the DLP-USB1232H module in order to configure it to be powered via USB. | ||
+ | |||
+ | [1] As an alternative to TP103, either side of R43 (jumper/0 Ohms) or the right pad of R45 (unpopulated) works. This is near the other test pads. | ||
Also, the Didj or LX must be powered on. | Also, the Didj or LX must be powered on. | ||
Line 76: | Line 105: | ||
$ '''sudo apt-get install openocd''' | $ '''sudo apt-get install openocd''' | ||
− | Place this configuration file - name it dlp-usb1232h.cfg - into your openocd /usr/share/openocd/scripts/ | + | Place this configuration file - name it dlp-usb1232h.cfg - into your openocd /usr/share/openocd/scripts/interface directory: |
<code> | <code> | ||
Line 93: | Line 122: | ||
− | Place the file (originally described [[Didj JTAG How To | here]]) into your home directory: | + | Place the file below, named openocd.cfg (originally described [[Didj JTAG How To | here]]), into your home directory: |
<code> | <code> | ||
Line 99: | Line 128: | ||
source [find interface/dlp-usb1232h.cfg] | source [find interface/dlp-usb1232h.cfg] | ||
jtag_khz 15000 | jtag_khz 15000 | ||
− | reset_config | + | # length of reset signal: [ms] |
+ | jtag_nsrst_assert_width 100 | ||
+ | # don't talk to JTAG after reset for: [ms] | ||
+ | jtag_nsrst_delay 250 | ||
+ | reset_config trst_and_srst separate | ||
+ | # end reset config | ||
if { [info exists CHIPNAME] } { | if { [info exists CHIPNAME] } { | ||
set _CHIPNAME $CHIPNAME | set _CHIPNAME $CHIPNAME | ||
Line 153: | Line 187: | ||
</code> | </code> | ||
+ | The reset command will restart the device: | ||
+ | >reset | ||
To debug bootloaders with GDB, see [[Didj JTAG How To]]. | To debug bootloaders with GDB, see [[Didj JTAG How To]]. | ||
Line 168: | Line 204: | ||
[http://randomprojects.org/wiki/DLP-USB1232H_and_OpenOCD_based_JTAG_adapter DLP-USB1232H_and_OpenOCD_based_JTAG_adapter] | [http://randomprojects.org/wiki/DLP-USB1232H_and_OpenOCD_based_JTAG_adapter DLP-USB1232H_and_OpenOCD_based_JTAG_adapter] | ||
− | + | [http://vak.ru/doku.php/proj/bitbang/bitbang-jtag Low-cost Bitbang JTAG using the FTDI FT232] | |
+ | |||
+ | |||
− | + | [[Category:Didj]] | |
+ | [[Category:Leapster Explorer]] | ||
+ | [[Category:Augen eGo]] | ||
+ | [[Category:LeapFrog Pollux Platform]] |
Latest revision as of 03:11, 27 October 2011
Contents
Background
I had been curious about JTAG ever since I started experimenting with Didj. I had wondered about whether it could be used to investigate our Pollux-based devices.
As we all progressed with our experimentation, Moogle identified the JTAG pads on Didj, and then bcav added a wiki entry on how to use the JTAG port to debug a bootloader on Didj with OpenOCD (Open On-Chip Debugger). We later happily discovered that JTAG pads are clearly labeled on the Leapster Explorer mainboard (in my book, its a Big Win whenever a manufacturer acknowleges our Fundamental Rights!)
I had JTAG experimentation on my list-of-things-to-try for a while, but I didnt want to spend $72 to buy the JTAG dongle bcav used in the wiki entry. (I did have a home-made wiggler cable that I hacked together for use with WRT routers, but I wasn't confident enough that it would fit the bill for this use case. Plus the speed over a parallel port was not great)
Upon learning that that the ftdi2232 chip could be used to bitbang a JTAG connection and that the same part powers many USB-based JTAG cables, I purchased a $30 breakout board that was based on that chip - DLP Design DLP-USB1232H (datasheet).
What follows are the steps I used to make this breakout work with Didj, LX, LPX, and the Pollux-based eGo netbooks.
NOTE: if you aren't interested in wiring up your own usb JTAG using the FT2232, you can purchase a Flyswatter from TinCanTools for $49.95
Connecting
The table below illustrates how to connect the DLP-USB1232H device pins to Didj, LX and the eGo. The pinout on the breakout is in the DLP-USB1232H datasheet (pinout is on page 4 and page 7).
Pin type | DLP-USB1232H pin # | Didj Test Pad label | LX Test Pad label | LPX Test Pad label | eGo photo label |
---|---|---|---|---|---|
TRST | 17 | TP9 | RST | RST | nTRST |
TDI | 16 | TP10 | TDI | TDI | TDI |
TMS | 5 | TP11 | TMS | TMS | TMS |
TCK | 18 | TP12 | TCK | TCK | TCK |
TDO | 2 | TP13 | TDO | TDO | TDO |
(S)RST | 13 | TP103 [1] | nRST | nRST | nPORST |
GND | Either 1 or 10 | TP14 | GND | GND | use any GND |
IMPORTANT: You also need to connect pins 8 and 9 together on the DLP-USB1232H module in order to configure it to be powered via USB.
[1] As an alternative to TP103, either side of R43 (jumper/0 Ohms) or the right pad of R45 (unpopulated) works. This is near the other test pads.
Also, the Didj or LX must be powered on.
Software Installation
Install OpenOCD (examples are Ubuntu Lucid)
$ sudo apt-get install openocd
Place this configuration file - name it dlp-usb1232h.cfg - into your openocd /usr/share/openocd/scripts/interface directory:
#
# DLP Design DLP-USB1232H USB-to-UART/FIFO interface module
#
# http://www.dlpdesign.com/usb/usb1232h.shtml
#
interface ft2232
ft2232_device_desc "Dual RS232-HS"
ft2232_layout usbjtag
ft2232_vid_pid 0x0403 0x6010
Place the file below, named openocd.cfg (originally described here), into your home directory:
telnet port 4444
source [find interface/dlp-usb1232h.cfg]
jtag_khz 15000
# length of reset signal: [ms]
jtag_nsrst_assert_width 100
# don't talk to JTAG after reset for: [ms]
jtag_nsrst_delay 250
reset_config trst_and_srst separate
# end reset config
if { [info exists CHIPNAME] } {
set _CHIPNAME $CHIPNAME
} else {
set _CHIPNAME pollux
}
if { [info exists ENDIAN] } {
set _ENDIAN $ENDIAN
} else {
set _ENDIAN little
}
if { [info exists CPUTAPID ] } {
set _CPUTAPID $CPUTAPID
} else {
# force an error till we get a good number
set _CPUTAPID 0x07926f0f
}
#jtag scan chain
jtag newtap $_CHIPNAME cpu -irlen 4 -expected-id $_CPUTAPID
set _TARGETNAME $_CHIPNAME.cpu
target create $_TARGETNAME arm926ejs -endian $_ENDIAN -chain-position $_TARGETNAME -variant arm926ejs
Usage
To launch OpenOCD from your home directory:
$ sudo /usr/bin/openocd -s /usr/share/openocd/scripts
To access OpenOCD directly, telnet to localhost port 4444:
$ telnet localhost 4444
Usage Examples
Read the registers using the 'mdw phys <address>' command in OpenOCD. In this example we are reading the MLCCONTROL0 register:
>halt
>mdw phys 0xc0004024
0xc0004024: 86534024
To write registers, use 'mww phys <address> <value>' In this example we are changing to the MLC to RGB888 mode, setting the H-stride and V-stride appropriately, and then setting the dirty flag:
>halt
>mww phys 0xc0004024 0x46534024
>mww phys 0xc0004028 0x00000003
>mww phys 0xc000402c 0x000003c0
>mww phys 0xc0004024 0x4653d034
The reset command will restart the device:
>reset
To debug bootloaders with GDB, see Didj JTAG How To.
Resources
The DLP-USB1232H is available from various sources, e.g.: Digikey, Mouser, or Saelig.
The module can also be used as a cheap and simple SPI BIOS chip programmer together with the flashrom utility.