Upload
tom-hunkler
View
155
Download
6
Tags:
Embed Size (px)
Citation preview
JTAG-lock-pick 1.x.xManual EN 2.0 / 120229
www.distortec.comwww.freddiechopin.info
page 2/28 JTAG-lock-pick 1.x.xManual EN 2.0 / 120229
Table of contents1. Introduction......................................................................................................................................3
1.1. Supported target chips..............................................................................................................51.2. “Strong points” of JTAG-lock-pick project..............................................................................51.3. Contents of the package............................................................................................................6
2. Hardware..........................................................................................................................................72.1. Connectors................................................................................................................................7
2.1.1. JTAG.................................................................................................................................72.1.2. RS-232..............................................................................................................................72.1.3. UART................................................................................................................................9
2.2. LEDs.......................................................................................................................................102.3. Jumpers...................................................................................................................................10
2.3.1. J1 jumper – JVREF.........................................................................................................102.3.2. J2 jumper – connecting JVREF and UVREF..................................................................102.3.3. J3 jumper – UVREF........................................................................................................10
3. Drivers............................................................................................................................................113.1. libusb-win32...........................................................................................................................113.2. ftd2xx......................................................................................................................................113.3. Change of driver.....................................................................................................................12
4. Software..........................................................................................................................................144.1. OpenOCD...............................................................................................................................144.2. Atollic TrueSTUDIO...............................................................................................................154.3. CooCox CoIDE.......................................................................................................................164.4. IAR Embedded Workbench for ARM.....................................................................................16
4.4.1. OpenOCD........................................................................................................................174.4.2. CooCox CoIARPlugin....................................................................................................17
4.5. Keil MDK-ARM.....................................................................................................................174.6. Rowley CrossWorks for ARM................................................................................................17
5. Sources of additional information..................................................................................................196. Troubleshooting..............................................................................................................................207. Manual changelog..........................................................................................................................218. Hardware changelog.......................................................................................................................229. Appendix.........................................................................................................................................23
9.1. Circuit's schematic diagram (version 1.1)..............................................................................249.2. Bill of materials (version 1.1).................................................................................................27
page 3/28 JTAG-lock-pick 1.x.xManual EN 2.0 / 120229
1. IntroductionJTAG-lock-pick is an ARM core processors JTAG using USB bus to connect to PC. The device is based on FTDI FT22321 chip – a dual channel USB <=> UART/FIFO converter. By design first channel is connected to JTAG interface and the second one has full UART / RS-232 interface (RXD, TXD, RTS, CTS, DCD, DSR, DTR, RI) with option to connect to RS-485 converter. JTAG-lock-pick project was created to be an uncompromising and powerful solution, taking maximum advant-age of all used ICs.
Pic. 1: JTAG-lock-pick – device in enclosure
Maximum frequency of JTAG interface's clock is 6MHz. Thanks to USB bus the device can be con-nected to any PC on the market – it would not be possible with parallel interface (LPT), which is completely obsolete nowadays. Thanks to use of 74LVC series advanced line buffers, target devices with very wide range of supply voltage – from about 1.6V up to 5.5V – can be connected.
One of project's requirements was to have both UART and RS-232 interface. Selection between RS-232 and UART is automatic and based on presence of UART interface's line buffers' supply voltage – if this voltage is higher than about 1.7V then UART interface is enabled. Four most important sig-nals of UART interface (RXD, TXD, RTS, CTS) are also buffered with 74LVC series level shifters. Other lines are driven directly by FT2232 chip – output signal's high level voltage is 5V, input's high level voltage is (typically) about 1.6V. Thanks to having TXDEN signal on UART connector, RS-485 converter can be connected to the device.
Designed circuit faciliates powering of line buffers – and thus target device (via JTAG / UART con-nectors) – with 3.3V or 5V voltage. UART's and JTAG's supply rails are separated, additional jumper
1 http://www.ftdichip.com/Products/ICs/FT2232D.htm
page 4/28 JTAG-lock-pick 1.x.xManual EN 2.0 / 120229
allows to connect them, so various voltage configurations are possible. USB bus is the source of these voltages, maximum current drawn by the target is 500mA for 5V voltage (according to spe-cification) or 150mA for 3.3V voltage, which is more than enough for complex digital devices without power circuits.
JTAG-lock-pick is fully software compatible with JTAGkey2 interface from Amontec, so in many applications available configurations can be used instead of creating them manually. It is also pos-sible to program FPGA, CPLD and AVR chips with SVF files using JTAG-lock-pick and software provided by Amontec.
JTAG-lock-pick has separate SRST and TRST lines, which can be independently configured to push-pull or open-drain mode.
Pic. 2: JTAG-lock-pick – top side of device's circuit
JTAG-lock-pick project is a successor to 4R|\/|-JT4G Rev023 project, eliminating it's shortcom-ings. Most important one – predecessor had SRST i TRST lines shorted “by design”, which limited debugging capabilities. Additionally the buffering IC used previously – 74VHC244 – had a signific-ant flaw, which resulted in breakdown of input voltages through clamp diodes on unconnected sup-ply rail, which was very confusing but perfectly safe for JTAG and target device. These problems do not occur in JTAG-lock-pick .
Picture 1 shows the device in enclosure, pictures 2 and 3 show assembled JTAG-lock-pick circuit.
2 http://www.amontec.com/jtagkey.shtml 3 http://www.freddiechopin.info/index.php/pl/projekty/49-arm-jtag-rev01-rev02
page 5/28 JTAG-lock-pick 1.x.xManual EN 2.0 / 120229
Pic. 3: JTAG-lock-pick – bottom side of device's circuit
1.1. Supported target chipsJTAG-lock-pick interface and PC software that uses it (among others: OpenOCD, Atollic TrueSTUDIO, CooCox CoIDE, Keil MDK-ARM, IAR Embedded Workbench for ARM, Rowley CrossWorks for ARM, see chapter 4) are able to communicate with almost any existing type of ARM processor, including the most popular::
– ARM7 (LPC2xxx, AT91SAM7, STR7xx, ...),– ARM9 (LPC3xxx, AT91SAM9, STR9xx, ...),– Cortex-M3 (STM32, LM3S, LPC17xx, AT91SAM3, …),– ...
The only limiting factor is support for specific chip in PC software.
1.2. “Strong points” of JTAG-lock-pick project– safe and reliable communication with target devices with supply voltage in the range from
about 1.6V up to 5.5V, signals buffered with 74LVC series advanced level shifters,– UART and RS-232 interfaces, each with complete set of eight standard signals, four most im-
portant lines of UART interface are buffered (from about 1.6V up to 5.5V),– ability to power target circuit through JTAG with 3.3V or 5V voltage,– separated supply rails of JTAG and UART,– safe enclosing, which protects JTAG, connected PC and target device from accidental dam-
age,
page 6/28 JTAG-lock-pick 1.x.xManual EN 2.0 / 120229
– ability to connect RS-485 converter,– …
1.3. Contents of the package– JTAG-lock-pick debugger / programmer (JTAG + RS-232 + UART), machine assembled,
tested, in transparent enclosure (outer dimensions 24mm x 47mm x 66mm) with machine milled connector slots and with rubber feet, (picture 1, 2 and 3),
– JTAG <=> target ribbon cable, 20cm, (picture 4),– IDC-10 <=> DB-9 (RS-232) ribbon adapter cable, 20cm, (picture 5),– two IDC-14 ribbon crimp connectors + 20cm of 14-wire ribbon cable to assemble any UART
interface cable,– USB mini-B cable, black, 1,8m,– DVD with manual, drivers, set of useful software – free (CodeSourcery gcc toolchain, Ec-
lipse IDE, OpenOCD, CooCox CoIDE) and proprietary in evaluation versions (Atollic TrueSTUDIO for STM32 Lite, Keil MDK-ARM + CooCox CoMDKPlugin, IAR Embedded Workbench for ARM + CooCox CoIARPlugin, Rowley CrossWorks for ARM) – all of them in the most recent versions.
page 7/28 JTAG-lock-pick 1.x.xManual EN 2.0 / 120229
2. Hardware
2.1. Connectors
2.1.1. JTAGSignals' assignment in JTAG connector (shown in table 1) is compatible with the so-called “stand-ard” .
Table 1: Pinout of JTAG connector
JVREF – 1 2 – JVREF
nTRST – 3 4 – GND
TDI – 5 6 – GND
TMS – 7 8 – GND
TCK – 9 10 – GND
n/c – 11 12 – GND
TDO – 13 14 – GND
nSRST – 15 16 – GND
n/c – 17 18 – GND
n/c – 19 20 – GND
JVREF lines are supply rails for buffers (or the target circuit – if powering buffers from PC's side was selected). Picture 4 shows typical 20-wire ribbon connection cable.
2.1.2. RS-232Signals' assignment in RS-232 connector (shown in table 2) is compatible with standard DB-9 con-nector. Use of ribbon cable with DB-9 crimp connector (shown on picture 5) gives standard serial port connected to JTAG-lock-pick .
Table 2: Pinout of RS-232 connector
DCD – 1 2 – DSR
RXD – 3 4 – RTS
TXD – 5 6 – CTS
DTR – 7 8 – RI
GND – 9 10 – GND
page 8/28 JTAG-lock-pick 1.x.xManual EN 2.0 / 120229
Pic. 4: Standard JTAG connection ribbon cable
Pic. 5: RS-232 connection ribbon cable
page 9/28 JTAG-lock-pick 1.x.xManual EN 2.0 / 120229
2.1.3. UART
Signals' assignment in UART connector (shown in table 3) is partially compatible with RS-232 con-nector.
Table 3: Pinout of UART connector
DCD – 1 2 – DSR
RXD – 3 4 – RTS
TXD – 5 6 – CTS
DTR – 7 8 – RI
GND – 9 10 – GND
UVREF – 11 12 – UVREF
TXDEN – 1314 – n/c
UVREF lines are supply rails for buffers (or the target circuit – if powering buffers from PC's side was selected).
JTAG-lock-pick's UART interface can be connected with target circuit with straight 14-wire ribbon cable (similar to the cable shown on picture 4), ribbon cable with “flying-leads” terminals (ex-ample of such cable is shown on picture 6) or a different cable – made for specific purpose.
Pic. 6: Example of UART ribbon cable with "flying-leads" terminals
Typical RS-485 transceiver (i.e. MAX485 IC) can be connected to UART connector, thanks to hav-
page 10/28 JTAG-lock-pick 1.x.xManual EN 2.0 / 120229
ing TXDEN signal – in such case this line controls the direction of transmission.
2.2. LEDsOn JTAG-lock-pick's PCB there are seven LEDs. Their meaning is as follows:
– D_USB (green), near USB connector – USB device enumeration finished, JTAG-lock-pick was properly discovered by operating system,
– D_JVCC (green), near JTAG connector – presence of valid supply voltage for JTAG inter-face's buffers (and target circuit),
– D_SRST (yellow), in the center of module – nSRST signal is in active (low) state – target device is in reset,
– D_RS (green), near RS-232 connector – lack of valid supply voltage for UART interface's buffers, RS-232 interface is active, UART interface is not active,
– D_UART (green), near UART connector – presence of valid supply voltage for UART inter-face's buffers, UART interface is active, RS-232 interface is not active,
– D_RX (yellow), in the center of module – reception of character through UART / RS-232 in-terface,
– D_TX (red), in the center of module – transmission of character through UART / RS-232 in-terface.
2.3. JumpersOn JTAG-lock-pick's PCB there are three jumpers used to configure power supplies. Wrong con-figuration of jumpers can cause damage to JTAG, target circuit or USB port in PC! All jump-ers are removed by default.
2.3.1. J1 jumper – JVREFInstalling the jumper on position marked as 5V or 3V3 causes JTAG interface's buffers (and target circuit via JVREF lines) to be powered with 5V or 3.3V respectively. It enables debugging of target circuits that do not provide supply voltage for buffers and / or powering target circuit through JTAG. If target circuit has its own power supply, which is provided via JVREF lines, this jumper must not be installed!
2.3.2. J2 jumper – connecting JVREF and UVREFInstalling this jumper connects JVREF and UVREF rails, which – for example – enables UART in-terface's buffers to be powered with voltage provided via JVREF lines. If both JVREF and UVREF voltages are provided externally this jumper must not be installed!
2.3.3. J3 jumper – UVREFRole of this jumper is similar to J1, but it is responsible for voltage on UVREF lines which supplies UART interface's buffers.
page 11/28 JTAG-lock-pick 1.x.xManual EN 2.0 / 120229
3. DriversFirst connection of JTAG to computer should result in discovery of new USB devices, for which chosen drivers should be installed. Basically there are two options of drivers:
– open-source libusb-win32 drivers,– FT2232 manufacturer's drivers based on ftd2xx library.
The choice depends on the software that will be used for debugging with JTAG-lock-pick . OpenOCD (see chapter 4.1) versions that are currently available in the internet use libftdi4 library, so they need libusb-win32 driver. Individual compilation of OpenOCD, so that it would use slightly faster (in Windows) ftd2xx driver, is possible (but complicated). CooCox CoIDE environment (see chapter 4.3) and CooCox plugins: CoMDKPlugin (for Keil MDK-ARM, see chapter 4.5) and CoIARPlugin (for IAR Embedded Workbench for ARM, see chapter 4.4.2) use ftd2xx driver. Rowley CrossWorks for ARM environment (see chapter 4.6) can use both kinds of drivers.
Archive with both types of drivers for JTAG-lock-pick is located on the DVD included in the pack-age in Drivers folder. The most recent versions of drivers can be found on DISTORTEC's5 website in Download section and on Freddie Chopin's6 website in Download → Projects → JTAG-lock-pick section.
3.1. libusb-win32This open-source driver is only for the first channel of FT2232 chip – the one which is connected to JTAG interface. For the second channel – used for UART / RS-232 interface – ftd2xx driver must be installed (see chapter 3.2).
It is recommended to install this driver in fully manual mode, in which the driver's file is selected directly, not searched by op-erating system – during installation this op-tion is called “Don't search. I will choose the driver to install.” (see picture 7). Manual installation is also necessary when changing driver (see chapter 3.3).
Correct installation of driver is confirmed by appearance of JTAG-lock-pick – USB <=> JTAG adapter in libusb-win32 devices group in Device Manager. This situation (after installing ftd2xx driver for UART/RS-232 interface) is shown on pic-ture 8.
3.2. ftd2xxAfter installation of these driver following four elements should appear in system's Device Man-ager:
4 Distribution of OpenOCD compiled to use ftd2xx proprietary driver allegedly violates GPLv2 license5 http://www.distortec.com/ 6 http://www.freddiechopin.info/
Pic. 7: Manual installation of drivers
page 12/28 JTAG-lock-pick 1.x.xManual EN 2.0 / 120229
– in Universal Serial Bus Controllers group: JTAG-lock-pick - USB <=> JTAG adapter (only if ftd2xx driver was installed for JTAG channel instead of libusb-win32), JTAG-lock-pick - USB <=> UART/RS-232 adapter and USB Composite Device;
– in Ports (COM & LPT) group: JTAG-lock-pick - USB <=> UART/RS-232 adapter (COM xx);
Contents of Device Manager after installing whole set of ftd2xx drivers is shown on picture 9.
Pic. 8: Installed libusb-win32 (JTAG) and ftd2xx (UART/RS-232) drivers in Device Manager
3.3. Change of driverIf a need to change JTAG channel driver occurs (because of – for example – mistake or change of used software), JTAG-lock-pick - USB <=> JTAG adapter element in Device Manager should be located and double-clicked to open its properties. Then Driver Update... button in Driver tab should be used, which will open driver update wizard. It is important not to let the system search for the driver automatically – “Don't search. I will choose the driver to install.” option should be used (see picture 7) – otherwise the system will most likely install exactly the same driver's version again, without making any change.
page 13/28 JTAG-lock-pick 1.x.xManual EN 2.0 / 120229
Pic. 9: Installed ftd2xx drivers in Device Manager
page 14/28 JTAG-lock-pick 1.x.xManual EN 2.0 / 120229
4. SoftwareList of programs in which JTAG-lock-pick can be used contains the most popular tools for ARM core processors, among others: OpenOCD, Atollic TrueSTUDIO, CooCox CoIDE, Keil MDK-ARM, IAR Embedded Workbench for ARM and Rowley CrossWorks for ARM. Usage of JTAG-lock-pick in this applications is described in details in following subchapters.
From software's point of view JTAG-lock-pick may be used as Amontec JTAGkey. Because of that, use of this device is very simple – in most cases used software will have available configurations for this JTAG.
4.1. OpenOCD 7
Basic command to start OpenOCD should look like this:
> openocd -f interface/jtagkey.cfg -f target/XXX.cf g
or> openocd -f interface/jtagkey.cfg -f board/XXX.cfg
(depending on where the configuration file for target device / chip is located).
For example – running OpenOCD for STM32 chip (ARM Cortex-M3) should result in similar output as shown below (exact messages will – of course – depend on version of OpenOCD and used target device):
> openocd -f interface/jtagkey.cfg -f target/stm32f 1x.cfgOpen On-Chip Debugger 0.5.0 (2011-08-09-23:21)Licensed under GNU GPL v2For bug reports, read http://openocd.berlios.de/doc/doxygen/bugs. htmlInfo : only one transport option; autoselect 'jtag'1000 kHzadapter_nsrst_delay: 100jtag_ntrst_delay: 100cortex_m3 reset_config sysresetreqInfo : clock speed 1000 kHzInfo : JTAG tap: stm32.cpu tap/device found: 0x3ba0 0477 (mfg: 0x23b, part: 0xba00, ver: 0x3)Info : JTAG tap: stm32.bs tap/device found: 0x16410 041 (mfg: 0x020, part: 0x6410, ver: 0x1)Info : stm32.cpu: hardware has 6 breakpoints, 4 wat chpoints
OpenOCD can also be used only for programming target from command line (or with batch files / scripts) with following command:
> openocd -f interface/jtagkey.cfg -f target/XXX.cf g -c "init; reset halt; flash write_image erase YYY.EXT; reset run; s hutdown"
This line consists of several OpenOCD's commands:
– init – required before following “executable” commands (other than configuration) in com-mand line,
– reset halt – resets and halts the device, which is required prior to programming the target,– flash write_image erase YYY.EXT – writes contents of YYY.EXT file (where EXT is hex, bin
or elf extension) to target's flash memory, erasing it before programming (only affected
7 http://openocd.sourceforge.net/
page 15/28 JTAG-lock-pick 1.x.xManual EN 2.0 / 120229
range),– reset run – resets and resumes target's operation, which results in execution of programmed
firmware,– shutdown – closes OpenOCD's session.
Example of programming STM32 chip with stm32_blink_led.hex file is shown below.
> openocd -f interface/jtagkey.cfg -f target/stm32f 1x.cfg -c "init; reset halt; flash write_image erase stm32_blink_led .hex; reset run; shutdown"Open On-Chip Debugger 0.5.0 (2011-08-09-23:21)Licensed under GNU GPL v2For bug reports, read http://openocd.berlios.de/doc/doxygen/bugs. htmlInfo : only one transport option; autoselect 'jtag'1000 kHzadapter_nsrst_delay: 100jtag_ntrst_delay: 100cortex_m3 reset_config sysresetreqInfo : clock speed 1000 kHzInfo : JTAG tap: stm32.cpu tap/device found: 0x3ba0 0477 (mfg: 0x23b, part: 0xba00, ver: 0x3)Info : JTAG tap: stm32.bs tap/device found: 0x16410 041 (mfg: 0x020, part: 0x6410, ver: 0x1)Info : stm32.cpu: hardware has 6 breakpoints, 4 wat chpointsInfo : JTAG tap: stm32.cpu tap/device found: 0x3ba0 0477 (mfg: 0x23b, part: 0xba00, ver: 0x3)Info : JTAG tap: stm32.bs tap/device found: 0x16410 041 (mfg: 0x020, part: 0x6410, ver: 0x1)target state: haltedtarget halted due to debug-request, current mode: T hreadxPSR: 0x01000000 pc: 0x0800024c msp: 0x20000ed0auto erase enabledInfo : device id = 0x20036410Info : flash size = 128kbyteswrote 2048 bytes from file stm32_blink_led.hex in 0 .312500s (6.400 KiB/s)Info : JTAG tap: stm32.cpu tap/device found: 0x3ba0 0477 (mfg: 0x23b, part: 0xba00, ver: 0x3)Info : JTAG tap: stm32.bs tap/device found: 0x16410 041 (mfg: 0x020, part: 0x6410, ver: 0x1)shutdown command invoked
4.2. Atollic TrueSTUDIO 8
According to information on Atollic's website full version of Atollic TrueSTUDIO environment has full support for FTDI FT2232 based interfaces9 (including JTAG-lock-pick , thanks to compatibility with JTAGkey). Free Lite version for STM32 chips can still work with JTAG-lock-pick via OpenOCD (see chapter 4.1), but the cooperation is not completely smooth.
Before attempting any configuration the project should be built so that executable file with .elf ex-tension has been created. OpenOCD should be started in the background – “externally” (using op-erating system's command line) or by configuring it in Run > External Tools > External Tools Con-figurations... menu, example command which starts OpenOCD for STM32 microcontrollers should look like this:
8 http://www.atollic.com/index.php/truestudio 9 http://www.atollic.com/index.php/truestudio/targets/jtagdongles/amontec
page 16/28 JTAG-lock-pick 1.x.xManual EN 2.0 / 120229
> openocd -f interface/jtagkey.cfg -f target/stm32f 1x.cfg -c "reset_config trst_and_srst"
Debugging configuration can be performed with Debug Configurations... option from Run menu. In newly opened window new Embedded C/C++ Application type configuration should be created and configured in following order:
1. in Main tab the name of the project that is meant to be debugged should be typed into (or se-lected with Browse... button) into Project field, and then name of executable .elf file should by typed into (or selected with Search Project... or Browse... button) C/C++ Application field just above; in most cases these fields will be filled automatically when creating debug-ging configuration;
2. in Debugger tab Connect to remote GDB server option should be chosen and 3333 value should be entered into Port number field, all other options are ignored – their values do not affect anything and they should be considered nonfunctional;
3. in Startup Debug tab whole content of Initialization Commands field should be removed and replaced with following lines:
# send "reset halt" to OpenOCDmonitor reset halt# load application to target via GDBload# send "reset halt" to OpenOCDmonitor reset halt# set temporary breakpoint at main() and resume tar gettbreak maincontinue
4. all changes should be confirmed with Apply button and debugging session can be started right away with Debug button.
Problems that should be expected during cooperation of Lite version of Atollic TrueSTUDIO envir-onment with OpenOCD are (among others):
– target device cannot be “reset” during debugging session with Restart button;– operating system informs about improper termination of GDB application when debugging
session is closed;
4.3. CooCox CoIDE 10
In this environment available configuration for Amontec JTAGkey should be used. All options re-lated to JTAG interface configuration can be found in Debug > Debug Configuration menu, after selecting the debug configuration for active project that will be available there (typically it will be called project_name.configuration). Amontec-JTAGkey option should be selected from the Adapter list in Hardware groupbox in the first tab (Debugger) and then click Apply button and Close button.
4.4. IAR Embedded Workbench for ARM 11
In IAR's environment two approaches to using JTAG-lock-pick interface are possible – one can use OpenOCD (see chapter 4.1) or CooCox CoIARPlugin.
10 http://www.coocox.org/CooCox_CoIDE.htm 11 http://www.iar.com/en/Products/IAR-Embedded-Workbench/ARM/
page 17/28 JTAG-lock-pick 1.x.xManual EN 2.0 / 120229
4.4.1. OpenOCDFirst step is – obviously - starting OpenOCD in background (via operating system's command prompt) with parameters matching target device that is used, usually the call will look more or less like this:
openocd -f interface/jtagkey.cfg -f target/XXX.cfg
Then in IAR Embedded Workbench for ARM environment's project options (Project > Options) De-bugger option should be selected from the side menu. In Setup tab GDB Server option should be se-lected from Driver list and in Download tab Use flash loader(s) option should be checked. Then se-lect GDB Server option from side menu and in GDB Server tab enter localhost into TCP/IP address of hostname [.port] field.
4.4.2. CooCox CoIARPlugin 12
After installing the plugin select Debugger in side menu of project's options (Project > Options). In Setup tab RDI option should be selected from Driver list and in Download tab Use flash loader(s) option should be checked. Then select RDI option from side menu, type path to CoRDI.dll file loc-ated in CooCox CoIARPlugin installation folder (typically it will be c:\Program Files\CooCox\CoIARPlugin\CoRDI.dll, in 64-bit system Program Files (x86) folder will be used) into Manufacturer RDI driver field and check Allow hardware reset option. After closing project's options with OK button, new menu – RDI – will appear in application. The only active option – Configure – should be selected from this menu – in newly opened window target device should be selected from the side list and Amontec-JTAGkey option should be selected from the Adapter list in Adapter Config groupbox.
4.5. Keil MDK-ARM 13
Use of JTAG-lock-pick interface in Keil MDK-ARM environment (also known as µVision or RealView) is possible with CooCox CoMDKPlugin14. After installing it, in project's options (Project > Options for Target 'project_name', option available only when project is selected in Projects win-dow) in Utilities tab CooCox Debugger should be selected from the list under Use Target Driver for Flash Programming, Update Target before Debugging option should be checked and Settings button should be clicked. In newly opened window go to Debug tab and select JTAGkey from Adapter list in USB Adapter groupbox. After pressing OK button and going back to project's options go to De-bug tab and select Use option on the right side, then – again – select CooCox Debugger option from the list next to it – there is no need to configure it again with Settings button, because this configur-ation is shared (the same for Utilities and Debug tabs). The last options that should be checked are located just below: Load Application at Startup and Run to main(). Whole configuration should be confirmed with OK button.
4.6. Rowley CrossWorks for ARM 15
Whole configuration of JTAG-lock-pick in Rowley CrossWorks for ARM environment is limited to double-clicking on Amontec JTAGkey option in Targets window. Proper connection with target device is indicated on application's status bar and by appearance of JTAG's serial number and tar-
12 http://www.coocox.org/CoLinkGuide/CoIARPlugin.html 13 http://www.keil.com/arm/mdk.asp 14 http://www.coocox.org/CoLinkGuide/CoMDKPlugin.html 15 http://www.rowley.co.uk/arm/index.htm
page 18/28 JTAG-lock-pick 1.x.xManual EN 2.0 / 120229
get's Device ID in Properties Window for Amontec JTAGkey – this situation is shown on picture 10. In some cases adjustment of JTAG Clock Divider value may be necessary.
Pic. 10: Proper connection with target device in Rowley CrossWorks for ARM environment
page 19/28 JTAG-lock-pick 1.x.xManual EN 2.0 / 120229
5. Sources of additional informationAdditional information and support about JTAG, software, debugging and ARM core processors can be found on many websites:
– DISTORTEC's website ( http://www.distortec.com/ ),– Freddie Chopin's website ( http://www.freddiechopin.info/ ),– Elektroda's forum ( http://www.elektroda.pl/rtvforum/ ),– SparkFun's forum ( http://forum.sparkfun.com/viewforum.php?f=18 ),– OpenOCD's website ( http://openocd.sourceforge.net/ ),– Yagarto toolchain's website ( http://www.yagarto.de/ ),– WinARM toolchain's website (information often out of date!) ( http://www.siwawi.arubi.uni-
kl.de/avr_projects/arm_projects/ ),– google ( http://www.google.com/ ).
page 20/28 JTAG-lock-pick 1.x.xManual EN 2.0 / 120229
6. TroubleshootingProblem: After starting OpenOCD following message appears:
OpenOCD Error: unable to open ftdi device
Cause: OpenOCD can use two different kinds of drivers to communicate with FTDI FT2232 chip – proprietary ftd2xx or open-source libusb-win32. The choice is made at the stage of compilation of OpenOCD. This message can point to several issues:
1. JTAG is not properly connected to the computer,2. JTAG is “blocked” by another application or by another session of OpenOCD,3. Wrong driver was installed for JTAG.
Solution: Ad 1. Check JTAG <=> PC connection.Ad 2. Close all other OpenOCD sessions or other software connected with JTAG.Ad 3. Uninstall wrong and install correct driver (see chapter 3.3).
Problem: Attempt to program / debug target device in CooCox CoIDE environment results in following error:
Target Chip not found
Cause: CooCox CoIDE environment in version 1.4.0 (the most recent at the time of writing this document) does not work correctly with FTDI FT2232 based JTAGs.
Solution: Previous version 1.3.0 should be used or higher versions should be tested when they are published.
page 21/28 JTAG-lock-pick 1.x.xManual EN 2.0 / 120229
7. Manual changelog1.0 (19/08/2009)
1.1 (29/08/2009) 1. Change of information about location of libusb-win32 driver – it's no longer bundled with OpenOCD, archive with both types of drivers for JTAG-lock-pick is available on the website
2. Added information about OpenOCD subforum on SparkFun's forum
1.2 (15/03/2010) 1. Minor fixes2. Added information about version 1.1 of the project (Hardware changelog
chapter, update of photos, added circuit's schematic diagram and bill of materials)
3. Two print-screens of operating system's Device Manager added to chapter about final drivers
4. Update of console output after starting version 0.4.0 of OpenOCD
1.3 (26/12/2010) 1. Minor fixes2. Added information about version 1.1.1 of PCB3. Information about EEPROM programming with FT_Prog software4. Rowley CrossWorks for ARM environment: information about support for
libusb-win32 driver, update of print-screen5. Joining of multiple commands passed to OpenOCD with “-c” option into
one string, separating elements with semicolon
1.3.1 (10/12/2011) 1. Minor fixes2. Detailed description of condition which requires “base” drivers to be
installed and EEPROM to be programmed
2.0 (29/02/12) 1. Fixes to most of descriptions2. Removal of information about elements and versions of JTAG (only
assembled FULL version is available)3. Added supported target devices, “strong points” and contents of the
package4. Removal of information about “base” drivers and EEPROM
programming (available versions come with programmed EEPROM)5. Added information about change of driver6. Added information about other software which support JTAG-lock-pick7. Removal of circuit's schematic diagram and bill of materials for version
1.0 (only version 1.1 is available)8. Added English translation
page 22/28 JTAG-lock-pick 1.x.xManual EN 2.0 / 120229
8. Hardware changelog1.0 (19/02/2009)
1.1 (31/01/2010) Schematic:1. Minor fixes2. LP2980 IC (50mA max) replaced with LP2985 IC (150mA max) (ICs are
fully compatible)3. Change of order of LEDs and resistors in two places (resistor-diode
instead of diode-resistor) – D_UART i D_RS LEDs can be moved further away from IDC connectors, which makes them more visible
4. RA4 resistor array value changed from 4 x 10kR to 4 x 100kRPCB:
1. Minor fixes2. Removal of all tracks “directly” joining neighbouring pads (in MAX3243
IC and in 4 x 100kR resistor arrays)3. Matching of PCB's mechanics to measured dimensions of Z-24A
enclosing (position of mount holes, IDC-20 connector, D_USB and D_JVCC LEDs)
4. Moving IDC connectors “deeper”
1.1.1 (22/11/2010)PCB:1. Matching mount holes to (finally) published exact drawings of Z-24A
enclosure
page 23/28 JTAG-lock-pick 1.x.xManual EN 2.0 / 120229
9. Appendix– circuit's schematic diagram (version 1.1), page 24– bill of materials (version 1.1), page 27
page 24/28 JTAG-lock-pick 1.x.xManual EN 2.0 / 120229
9.1. Circuit's schematic diagram (version 1.1)
11
22
33
44
DD
CC
BB
AA
Title
Num
ber
Rev
isio
nS
ize
A4
Dat
e:2010-0
1-3
1S
hee
t o
fF
ile:
D:\
Ele
ktr
onik
a\..\J
TA
G-l
ock
-pic
k-m
ain.S
chD
oc
Dra
wn B
y:
VB
US
1
D-
2
D+
3
GN
D4
SH
LD
5
US
Bm
ini B
, 5-p
in
100nF
C6
10uF
C7
FB
2
GN
D
GN
DG
ND
GN
D
+5V
1k5R
R3
+5V
12
Y1
6M
Hz
27pF
C5
27pF
C8
GN
D
CS
1
SC
L2
D3
Q4
GN
D5
OR
G6
DU
7
VC
C8
U5
93C
46
100nF
C10
GN
D
1k5R
R4
+5V
GN
D
470R
R1
100nF
C4
GN
D
+5V
100nF
C11
100nF
C12
100nF
C13
100nF
C14
GN
D
+5V
D_U
SB
GR
EE
N
470R
R5
100nF
C9
+5V
GN
D
rx_le
dtx
_le
d
ft_tx
dft
_rx
dft
_rt
sft
_ct
sft
_dtr
ft_dsr
ft_dcd
ft_ri
n_tv
ccn_jtag
_oe
ft_tc
k
ft_tm
s
ft_td
ift
_td
o
ntr
st_oe
ft_ntr
st
nsr
st_oe
ft_nsr
st
ft_nsr
st_in
+5V
+5V
VC
C5
21
4
U8
74L
VC
1G
125
JVC
C
JVC
C
JVC
C
JVC
C
JVC
C
ft_tc
k
ft_tm
s
ft_td
i
n_jt
ag_oe
n_jt
ag_oe
n_jt
ag_oe
+5V
nsr
st_oe
ft_nsr
st
ntr
st_oe
ft_ntr
st
VC
CA
1
A1
2
A2
3
GN
D4
DIR
5B
26
B1
7V
CC
B8
U6
74L
VC
2T
45
+5V
JVC
C
GN
DG
ND
ft_nsr
st_in
ft_td
o
GN
D
JVC
C
ntr
st
tdi
tms
tck
tdo
nsr
st
b_tc
k
b_tm
s
b_td
i
b_td
ob_nsr
st
b_nsr
st
b_ntr
st
IN1
ON
/OF
F3
OU
T5
BY
P4
GN
D2
U1
LP
2985-3
.3G
ND
+5V
+3.3
V
10uF
C1
GN
D
pw
ren
D_JV
CC
GR
EE
N
330R
R6
n_tv
cc
1 2 3
J1 Hea
der
3
JVC
C+
3.3
V
+5V
D_S
RS
TY
EL
LO
W
470R
R2
+5V
100nF
C16
100nF
C17
100nF
C18
JVC
C
GN
D
100nF
C19
100nF
C20
+5V
EE
SK
1E
ED
AT
A2
VCC3
RE
SE
T4
RS
TO
UT
5
3V
3O
UT
6
US
BD
P7
US
BD
M8
GND9
SI/
WU
A10
AC
BU
S3
11
AC
BU
S2
12
AC
BU
S1
13
VCCIOA14
AC
BU
S0
15
AD
BU
S7
16
AD
BU
S6
17
GND18
AD
BU
S5
19
AD
BU
S4
20
AD
BU
S3
21
AD
BU
S2
22
AD
BU
S1
23
AD
BU
S0
24
GND25
SI/
WU
B26
BC
BU
S3
27
BC
BU
S2
28
BC
BU
S1
29
BC
BU
S0
30
VCCIOB31
BD
BU
S7
32
BD
BU
S6
33
GND34
BD
BU
S5
35
BD
BU
S4
36
BD
BU
S3
37
BD
BU
S2
38
BD
BU
S1
39
BD
BU
S0
40
PW
RE
N41
VCC42
XT
IN43
XT
OU
T44
AGND45
AVCC46
TE
ST
47
EE
CS
48
U3
FT
2232
e_cs
e_dat
a
e_cl
k
JTA
G-l
ock
-pic
k, F
T2232 &
JT
AG
1.1
Fre
ddie
Chopin
ft_tx
den
1/2
VC
C5
24
U7
74L
VC
1G
14
+3.3
V
JVC
C
+3.3
V
100nF
C15
+3.3
V
4 x
22R
RA
1
4 x
22R
RA
2
4 x
22R
RA
3
FB
1
10uF
C2
100nF
C3
GN
DG
ND
JVC
C
4 x
100kR
RA
5G
ND
tdo
nsr
st
JVR
EF
JVR
EF
4 x
100kR
RA
4
nsr
st_oe
ntr
st_oe
n_jt
ag_oe
e_dat
a_o
e_dat
a_o
+5V
VC
C8
21
6
U2A
74L
VC
2G
125
VC
C8
57
3
U2B
74L
VC
2G
125
VC
C8
21
6
U4A
74L
VC
2G
125
VC
C8
57
3
U4B
74L
VC
2G
125
12
34
56
78
910
11
12
13
14
15
16
17
18
19
20
JTA
G
IDC
20
ntr
sttd
itm
stc
k
tdo
nsr
stJVR
EF
b_ntr
st
b_td
i
b_tm
s
b_tc
k
b_td
ob_nsr
st
JTA
G v
oltag
e se
lect
no jum
per
- e
xte
rnal
JV
CC
1-2
- 3
.3V
2-3
- 5
V
11
22
33
44
DD
CC
BB
AA
Title
Num
ber
Rev
isio
nS
ize
A4
Dat
e:2010-0
1-3
1S
hee
t o
fF
ile:
D:\
Ele
ktr
onik
a\..\J
TA
G-l
ock
-pic
k-u
art.S
chD
ocDra
wn B
y:
JTA
G-l
ock
-pic
k, U
AR
T &
RS
-232
1.1
Fre
ddie
Chopin
2/2
13
V-
39
C1-
24
14
12
C1+
28
10
FO
RC
EO
FF
22
11
FO
RC
EO
N23
V+
27
VC
C26
GN
D25
5
15
19
84 6 7
18
17
16
C2+
1
C2-
2
INV
AL
ID21
20
U9
MA
X3243
100nF
C21
470nF
C23
470nF
C22
470nF
C27
100nF
C28
+5V
GN
D
GN
D
GN
D
GN
D
+5V
ft_dtr
ft_dsr
ft_dcd
ft_ri
txd
rxd
rts
cts
dtr
dsr
dcd
ri
dcd
rxd
txd
dtr
dsr
rts
cts
ri
GN
D
VC
CA
1
A1
2
A2
3
GN
D4
DIR
5B
26
B1
7V
CC
B8
U12
74L
VC
2T
45
UV
CC
UV
CC
GN
D
b_tx
d
b_rt
s
b_rx
db_ct
s
ft_rt
s
ft_tx
d
ft_rx
dft
_ct
s
100nF
C29
100nF
C30
100nF
C31
GN
D
D_R
SG
RE
EN
330R
R8
ft_dcd
b_rx
d
b_tx
d
ft_dtr
ft_dsr
b_rt
s
b_ct
s
ft_ri
GN
D
GN
D
GN
D
UV
CC
UV
CC
ft_tx
den
GN
D
GN
D
GN
D
D_T
XR
ED
470R
R10
D_R
XY
EL
LO
W
470R
R9
+5V
rx_le
d
tx_le
d
1 2 3
J3 Hea
der
3
UV
CC
+3.3
V
+5V
J2 Jum
per
UV
CC
JVC
C
4 x
22R
RA
6
4 x
22R
RA
7
FB
3U
VC
C
100nF
C25
GN
D
10uF
C26
GN
D
4 x
100kR
RA
8
u_rx
du_ct
s
UV
CC
GN
D
UV
RE
FU
VR
EF
UV
RE
F
D_U
AR
TG
RE
EN
330R
R7
VC
C5
24
U10
74L
VC
1G
14
+3.3
VU
VC
C
+3.3
V
ft_tx
d
ft_rt
s
ft_rx
d
ft_ct
s
+3.3
V
uar
t_en
uar
t_en
uar
t_en
+3.3
V
100nF
C24
+3.3
V
GN
D
VC
C8
21
6
U11A
74L
VC
2G
125
VC
C8
57
3
U11B
74L
VC
2G
125
12
34
56
78
910
11
12
13
14
UA
RT
IDC
14
12
34
56
78
910
RS
-232
IDC
10
u_dsr
u_rt
su_ct
su_ri
u_dcd
u_rx
du_tx
du_dtr
u_dcd
u_dsr
u_rx
d
u_rt
su_tx
d
u_ct
s
u_dtr
u_ri
UA
RT
volt
age
sele
ctno jum
per
- e
xte
rnal
UV
CC
1-2
- 3
.3V
2-3
- 5
V
JVC
C a
nd U
VC
C c
onnec
tion
1-2
- c
onnec
ted
no jum
per
- d
isco
nnec
ted
page 27/28 JTAG-lock-pick 1.x.xManual EN 2.0 / 120229
9.2. Bill of materials (version 1.1)
JT
AG
-lock
-pic
k 1
.1 -
Bil
l O
f M
ate
rials
31.0
1.2
010
C1,
C2,
C7,
C26
CA
PM
P3216X
18M
10uF
4
CA
PC
2012M
100nF
22
C5,
C8
CA
PC
2012M
27pF
2
C22,
C23,
C27
CA
PC
2012M
470nF
3
D_JV
CC
, D
_R
S,
D_U
AR
T,
D_U
SB
GR
EE
NC
AP
C2012M
4
D_R
X,
D_S
RS
TY
ELLO
WC
AP
C2012M
2
D_T
XR
ED
CA
PC
2012M
1
FB
1,
FB
2,
FB
3R
ES
C2012M
3
J1,
J3
HD
R1X
32
J2
Jum
per
HD
R1X
21
JT
AG
IDC
20
1
R1,
R2,
R5,
R9,
R10
RE
SC
2012M
470R
5
R3,
R4
RE
SC
2012M
1k5R
2
R6,
R7,
R8
RE
SC
2012M
330R
3
RA
1,
RA
2,
RA
3,
RA
6,
RA
7R
ES
A3216X
06M
5
RA
4,
RA
5,
RA
8R
ES
A3216X
06M
3
RS
-232
IDC
10
1
U1
LP
2985-3
.3S
OT
-95P
-284X
119-5
M1
U2,
U4,
U11
74LV
C2G
125
SO
P-6
5P
-400X
130-8
M3
U3
Dual U
SB
UA
RT
/ F
IFO
I.C
.F
T2232
1
U5
93C
46
SO
IC127P
600X
175-8
M1
U6,
U12
74LV
C2T
45
SO
P-6
5P
-400X
130-8
M2
U7,
U10
74LV
C1G
14
SO
T-6
5P
-212X
110-5
M2
U8
74LV
C1G
125
SO
T-6
5P
-212X
110-5
M1
U9
MA
X3243
SO
P65P
710X
200-2
8M
1
UA
RT
IDC
14
1
US
Bm
ini B
, 5-p
inU
SB
min
i-B
SM
D1
Y1
6M
Hz
HC
-49S
1
Designator
Description
Comment
Footprint
Model:Footprint
Value
Quantity
Pola
rized T
anta
lum
Capacitor
Pola
rized
capacitor
Mold
ed C
apacitor,
2-L
eads,
Body 3
,2x1,6
mm
, IP
C L
ow
D
ensity
C3
, C
4, C
6,
C9
, C
10,
C1
1, C
12
, C
13,
C1
4,
C15,
C16,
C1
7,
C18,
C19,
C2
0,
C2
1,
C24,
C25,
C2
8,
C29,
C30,
C3
1
Capacitor
Capacitor
Chip
Capa
citor,
Body 2
.0x1.3
mm
, IP
C L
ow
Density
Capacitor
Capacitor
Chip
Capa
citor,
Body 2
.0x1.3
mm
, IP
C L
ow
Density
Capacitor
Capacitor
Chip
Capa
citor,
Body 2
.0x1.3
mm
, IP
C L
ow
Density
Typic
al LE
DC
hip
Capa
citor,
Body 2
.0x1.3
mm
, IP
C L
ow
Density
Typic
al LE
DC
hip
Capa
citor,
Body 2
.0x1.3
mm
, IP
C L
ow
Density
Typic
al LE
DC
hip
Capa
citor,
Body 2
.0x1.3
mm
, IP
C L
ow
Density
Choke
Choke
Chip
Resis
tor,
Body 2
.0x1.3
mm
, IP
C L
ow
Density
Header,
3-P
inH
eader
3C
onnecto
r; H
eader;
3 P
ositio
n
Jum
per
Wire
Connecto
r; H
eader;
2 P
ositio
n
Header,
10-P
in,
Dual ro
wID
C-2
0,
angle
dID
C h
eader,
angle
d,
20-p
in
Resis
tor
Resis
tor
Chip
Resis
tor,
Body 2
.0x1.3
mm
, IP
C L
ow
Density
Resis
tor
Resis
tor
Chip
Resis
tor,
Body 2
.0x1.3
mm
, IP
C L
ow
Density
Resis
tor
Resis
tor
Chip
Resis
tor,
Body 2
.0x1.3
mm
, IP
C L
ow
Density
Quad c
hip
resis
tor
arr
ay,
4D
03
Resis
tor
arr
ay
Chip
Resis
tor
Arr
ay,
8-L
ead
s,
Body 3
,2x1,6
mm
, IP
C L
ow
D
ensity
4 x
22R
Quad c
hip
resis
tor
arr
ay,
4D
03
Resis
tor
arr
ay
Chip
Resis
tor
Arr
ay,
8-L
ead
s,
Body 3
,2x1,6
mm
, IP
C L
ow
D
ensity
4 x
100kR
Header,
5-P
in,
Dual ro
wID
C-1
0,
angle
dID
C h
eader,
angle
d,
10-p
in
Mic
ropow
er
150 m
A L
ow
Nois
e U
ltra
Low
-Dro
pout
Regula
tor
SO
T23,
5-L
eads,
Body 3
,0x3,0
mm
(m
ax),
Pitch 0
,95m
m,
IPC
Low
Density
Dual bus b
uff
er
gate
with 3
-sta
te o
utp
uts
TS
OP
, 8-L
eads,
Body 3
,2x2,9
mm
(m
ax),
Pitch 0
,65m
m,
IPC
Low
Density
TS
QF
P-5
0P
-9
00
X9
00
X160
-48M
TS
QF
P,
48-L
eads,
Body 9
,0x9,0
mm
(m
ax),
Pitch
0,5
0m
m,
IPC
Low
Den
sity
1K
(64 x
16 o
r 128 x
8)
Serial M
icro
wire E
EP
RO
MS
OIC
, 8-L
eads,
Body 5
,0x4,0
mm
(m
ax),
Pitch 1
,27m
m,
IPC
Low
Density
Dual-bit d
ual-supply
bus t
ransceiv
er
with
configura
ble
voltage t
ransla
tion a
nd 3
-sta
te
outp
uts
TS
OP
, 8-L
eads,
Body 3
,2x2,9
mm
(m
ax),
Pitch 0
,65m
m,
IPC
Low
Density
Sin
gle
Schm
itt-
trig
ger
invert
er
SO
T23,
5-L
eads,
Body 2
,3x2,3
mm
(m
ax),
Pitch 0
,65m
m,
IPC
Low
Density
Sin
gle
bus b
uff
er
gate
with 3
-sta
te o
utp
ut
SO
T23,
5-L
eads,
Body 2
,3x2,3
mm
(m
ax),
Pitch 0
,65m
m,
IPC
Low
Density
±15kV
ES
D-P
rote
cte
d,
1µ
A,
3.0
V/5
.5V
, 250kbps,
RS
-232 T
ransceiv
er
with A
uto
Shutd
ow
nS
OP
, 28-L
eads,
Bod
y 1
0,3
x5,4
mm
(m
ax),
Pitch 0
,65m
m,
IPC
Low
Density
Header,
7-P
in,
Dual ro
wID
C-1
4,
angle
dID
C h
eader,
angle
d,
14-p
in
US
B 2
.0,
Rig
ht
Angle
, S
MT
, B
Type,
Recepta
cle
, 5
Positio
n,
Bla
ck
Connecto
r; U
SB
2.0
, T
ype B
, S
M;
5 P
ositio
n;
Rig
ht
Angle
Cry
sta
l O
scill
ato
rQ
uart
z C
rysta
l S
MD