Differences
This shows you the differences between the selected revision and the current version of the page.
hardware:jtag 2008/12/12 22:41 | hardware:jtag 2017/09/06 18:38 current | ||
---|---|---|---|
Line 13: | Line 13: | ||
* You need a JTAG cable | * You need a JTAG cable | ||
- | ===== JTAG Interface scheme for DNS-323 ===== | + | Two types of jtag cables are discussed here: |
+ | 1: The "Wiggler" style, which is basically a conversion between the jtag interface on the embedded system and the parralel (printer) port on your PC. | ||
+ | 2: The "Amontec JTAGKey Tiny" (other commercially models may or may not work), which provides a USB connection at the PC side. | ||
+ | Comparison: pro method 1: cheaper, Pro method 2: less soldering (faster?) | ||
- | {{hardware:dns-323-jtag.pdf| JTAG Port Pinout and Wiggler style Programmer}} | ||
+ | ===== JTAG Pinout Reference ===== | ||
+ | **TOP VIEW** | ||
+ | **Note Pin 1 is square pin** | ||
+ | ^ Signal ^ Pin ^ Pin ^ Signal ^ | ||
+ | | sRST| 9| 10| TCK| | ||
+ | | TDO| 7| 8| TCK| | ||
+ | | GND| 5| 6| TMS| | ||
+ | | GND| 3| 4| TDI| | ||
+ | | Vcc| 1| 2| nTRST| | ||
- | ==== Amontec JTAGKey Tiny ==== | + | **Note nTRST must be sent a buffered high signal to use JTAG** |
- | [http://www.amontec.com/jtagkey-tiny.shtml| JTAGKey Tiny] | + | |
- | Solder 4K7 Ohm resistors @ R202 R201 R200 | + | Be aware that this pinout seems to be based on the DNS 323 version B2 and the CH3SNAS. The DNS-323 version A1 has the same space for a header, but the location of the surrounding resistors is different. This might or might not have consequences for the validity of the pinout as above. (Anyone: more information on the A1 rev.?) |
- | Connect JTAG pins just like the Wrigler port, and also bridge R199 (EN pin to VCC) to enable JTAG. | + | Rev A1 is the same pinout, smd resistors are already attached, just add header. |
- | openocd.cfg: | ||
+ | |||
+ | ===== JTAG Interface scheme for DNS-323 with the Wiggler port===== | ||
+ | See the attached pinout: | ||
+ | {{:hardware:dns-323-jtag.png}} | ||
+ | |||
+ | |||
+ | |||
+ | ==== openocd configuration file for the Wiggler method ==== | ||
+ | |||
+ | openocd.cfg | ||
<code> | <code> | ||
+ | cat openocd.cfg | ||
+ | #daemon configuration | ||
telnet_port 4444 | telnet_port 4444 | ||
gdb_port 3333 | gdb_port 3333 | ||
- | interface ft2232 | + | #interface |
- | ft2232_device_desc "Amontec JTAGkey" | + | interface parport |
- | ft2232_layout jtagkey | + | parport_port 0x378 |
- | ft2232_vid_pid 0x0403 0xcff8 | + | parport_cable wiggler |
- | jtag_speed 3 | + | #parport_cable old_amt_wiggler |
+ | jtag_speed 1 | ||
+ | #use combined on interfaces or targets that can't set TRST/SRST separately | ||
+ | #reset_config trst_and_srst srst_pulls_trst | ||
+ | #reset_config trst_only | ||
+ | #reset_config trst_and_srst combined | ||
reset_config srst_only | reset_config srst_only | ||
+ | |||
+ | #jtag scan chain | ||
+ | #format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE) | ||
jtag_device 4 0x1 0xf 0xe | jtag_device 4 0x1 0xf 0xe | ||
Line 47: | Line 75: | ||
# planing with flash code - work in progress | # planing with flash code - work in progress | ||
- | #working_area 0 0x00400000 0x40000 nobackup | + | working_area 0 0x00400000 0x40000 nobackup |
# driver addr size chip_width bus_width options | # driver addr size chip_width bus_width options | ||
- | flash bank cfi 0xff800000 0x800000 1 2 0 | + | flash bank cfi 0xff800000 0x400000 1 2 0 |
#target configuration | #target configuration | ||
Line 57: | Line 85: | ||
sleep 500 | sleep 500 | ||
halt | halt | ||
- | |||
</code> | </code> | ||
- | ===== JTAG Pinout Reference ===== | ||
- | **TOP VIEW** | ||
- | **Note Pin 1 is square pin** | ||
- | ^ Signal ^ Pin ^ Pin ^ Signal ^ | + | ===== JTAG Interface scheme for DNS-323 with the Amontec JTAGKey Tiny ===== |
- | | sRST| 9| 10| TCK| | + | [[http://www.amontec.com/jtagkey-tiny.shtml| JTAGKey Tiny]] |
- | | TDO| 7| 8| TCK| | + | |
- | | GND| 5| 6| TMS| | + | |
- | | GND| 3| 4| TDI| | + | |
- | | Vcc| 1| 2| nTRST| | + | |
- | **Note nTRST must be sent a buffered high signal to use JTAG** | + | Solder 47 KOhm resistors @ R202 R201 R200 |
+ | Connect JTAG pins just like the Wiggler port, and also bridge R199 (EN pin to VCC) to enable JTAG. | ||
+ | Refer to the top half of the pdf as attached in the previous section. | ||
+ | Pinout of the jtagkey tiny is available [[http://www.amontec.com/jtag_pinout.shtml| here]] | ||
+ | ==== openocd configuration file for the Amontec JTAGKey Tiny ==== | ||
- | ===== OpenOCD ===== | + | openocd.cfg |
- | + | ||
- | ==== openocd.cfg ==== | + | |
<code> | <code> | ||
- | cat openocd.cfg | ||
- | #daemon configuration | ||
telnet_port 4444 | telnet_port 4444 | ||
gdb_port 3333 | gdb_port 3333 | ||
- | #interface | + | interface ft2232 |
- | interface parport | + | ft2232_device_desc "Amontec JTAGkey" |
- | parport_port 0x378 | + | ft2232_layout jtagkey |
- | parport_cable wiggler | + | ft2232_vid_pid 0x0403 0xcff8 |
- | #parport_cable old_amt_wiggler | + | jtag_speed 3 |
- | jtag_speed 1 | + | |
- | #use combined on interfaces or targets that can't set TRST/SRST separately | + | |
- | #reset_config trst_and_srst srst_pulls_trst | + | |
- | #reset_config trst_only | + | |
- | #reset_config trst_and_srst combined | + | |
reset_config srst_only | reset_config srst_only | ||
- | |||
- | #jtag scan chain | ||
- | #format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE) | ||
jtag_device 4 0x1 0xf 0xe | jtag_device 4 0x1 0xf 0xe | ||
Line 106: | Line 119: | ||
# planing with flash code - work in progress | # planing with flash code - work in progress | ||
- | working_area 0 0x00400000 0x40000 nobackup | + | #working_area 0 0x00400000 0x40000 nobackup |
# driver addr size chip_width bus_width options | # driver addr size chip_width bus_width options | ||
- | flash bank cfi 0xff800000 0x400000 1 2 0 | + | flash bank cfi 0xff800000 0x800000 1 2 0 |
#target configuration | #target configuration | ||
Line 116: | Line 129: | ||
sleep 500 | sleep 500 | ||
halt | halt | ||
+ | |||
</code> | </code> | ||
+ | |||
+ | |||
+ | ===== OpenOCD ===== | ||
+ | |||
==== Running OpenOCD ==== | ==== Running OpenOCD ==== | ||
Line 152: | Line 170: | ||
MMU: disabled, D-Cache: disabled, I-Cache: enabled | MMU: disabled, D-Cache: disabled, I-Cache: enabled | ||
</code> | </code> | ||
- | |||
- | ===== Locked Flash ===== | ||
- | <code> | ||
- | Table 26. S29GL064M (Model R4) Sector Group Protection/Unprotection Addresses | ||
- | Sector/Sector Sector/Sector Sector/Sector | ||
- | Sector A21–A12 Block Size Sector A21–A12 Block Size Sector A21–A12 Block Size | ||
- | (Kbytes) (Kbytes) (Kbytes) | ||
- | SA0 0000000000 8 SA23–SA26 00100XXXXX 256 (4x64) SA79–SA82 10010XXXXX 256 (4x64) | ||
- | SA1 0000000001 8 SA27-SA30 00101XXXXX 256 (4x64) SA83–SA86 10011XXXXX 256 (4x64) | ||
- | SA2 0000000010 8 SA31-SA34 00110XXXXX 256 (4x64) SA87–SA90 10100XXXXX 256 (4x64) | ||
- | SA3 0000000011 8 SA35-SA38 00111XXXXX 256 (4x64) SA91–SA94 10101XXXXX 256 (4x64) | ||
- | SA4 0000000100 8 SA39-SA42 01000XXXXX 256 (4x64) SA95–SA98 10110XXXXX 256 (4x64) | ||
- | SA5 0000000101 8 SA43-SA46 01001XXXXX 256 (4x64) SA99–SA102 10111XXXXX 256 (4x64) | ||
- | SA6 0000000110 8 SA47-SA50 01010XXXXX 256 (4x64) SA103–SA106 11000XXXXX 256 (4x64) | ||
- | SA7 0000000111 8 SA51-SA54 01011XXXXX 256 (4x64) SA107–SA110 11001XXXXX 256 (4x64) | ||
- | 0000001XXX SA55–SA58 01100XXXXX 256 (4x64) SA111–SA114 11010XXXXX 256 (4x64) | ||
- | SA8–SA10 0000010XXX 192 (3x64) SA59–SA62 01101XXXXX 256 (4x64) SA115–SA118 11011XXXXX 256 (4x64) | ||
- | 0000011XXX SA63–SA66 01110XXXXX 256 (4x64) SA119–SA122 11100XXXXX 256 (4x64) | ||
- | SA11–SA14 00001XXXXX 256 (4x64) SA67–SA70 01111XXXXX 256 (4x64) SA123–SA126 11101XXXXX 256 (4x64) | ||
- | SA15–SA18 00010XXXXX 256 (4x64) SA71–SA74 10000XXXXX 256 (4x64) SA127–SA130 11110XXXXX 256 (4x64) | ||
- | SA19–SA22 00011XXXXX 256 (4x64) SA75–SA78 10001XXXXX 256 (4x64) SA131–SA134 11111XXXXX 256 (4x64) | ||
- | </code> | ||
- | |||
- | Any clues how to use this to write a cfi_spansion_protect function for openocd would be greatly appreciated. | ||
===== TODO ===== | ===== TODO ===== | ||
Line 181: | Line 175: | ||
===== Links ===== | ===== Links ===== | ||
- | * [[http://forum.dsmg600.info/t250-DNS323-JTAG-Pinout-interface-details.html|Forum thread]] | + | * [[http://dns323.kood.org/forum/t250-DNS323-JTAG-Pinout-interface-details.html|Forum thread]] |