JTAG Projects

Schematics for a parallel-port JTAG interface, similar to the many wiggler clones around. Ideas for this circuit were taken from many pages already on the web. This circuit on the parallel port of an Ubuntu desktop machine does most of my JTAG chores. It does not work with the parallel port on my Compaq/HP laptop, hence the concentration on the Olimex ARM-USB-TINY interface in the scripts below.

Use at your own risk.

Scripts and Config files for OpenOCD

The OpenOCD script language has gone through great changes in the last year, but released binaries can be slow to catch up. Here are some working configuration files and script files for the two languages. (These are based on examples that other people have posted on the web.)

Old Style

A simple language with a command word followed by options on a command-line.

openocd_app_olimex.cfg
A configuration file to set a target AT91SAM7S256-based board up for debugging using an Olimex ARM-USB-TINY JTAG adaptor.
openocd_flash_app_olimex.cfg
A configuration file that goes on to call a script. The script programs a specifically named .elf file into flash.
openocd_flash_app.script
The script that goes with openocd_flash_app_olimex.cfg . The name of the .elf binary file is programmed in to the "flash write_image" command. This target uses a separate clock oscillator instead of a crystal, and CKGR_MOR is set to allow for this.

New Style

Based on Tcl.

openocd-olimex.cfg
A configuration file to set a target AT91SAM7S256-based board up for debugging using an Olimex ARM-USB-TINY JTAG adaptor. This target uses a separate clock oscillator instead of a crystal, and CKGR_MOR is set to allow for this.

Analysis Scripts

OpenOCD uses a version of Tcl for scripting, so you can write small programs for routine analysis tasks. A command like source stm32f4_usart_regs.ocd will run that script in the openocd process and (in that case) give an annotated dump of the contents of the USART control registers. A downside with the scripts here is that their output goes to stdout in the openocd process, not the telnet console. Some of these scripts are:

cortexm4_hardfault.ocd
Analyzes some of the registers and conditions associated with a Hard Fault in an ARM Cortex-M4 processor.
stm32f4_pwr_regs.ocd
Dumps the registers associated with power control in an STM32F4xx processor.
stm32f4_rcc_regs.ocd
Dumps the registers associated with clock control in an STM32F4xx processor.
stm32f4_rtc_regs.ocd
Dumps the registers associated with the real-time clock/calendar in an STM32F4xx processor.
stm32f4_usart_regs.ocd
Dumps the registers associated a USART in an STM32F4xx processor. The version here is preset for USART2.