I have an Atmel AT91SAM7S256, and I use OpenOCD and a parallel port wiggler to program the flash. I’m reusing the OOCD configs/scripts that my coworkers have been using for at least a year. I tried to go the easy route and install the OOCD from Ubuntu 7.10 (rev 188), but it didn’t work. So I installed 128, which is what my coworkers use, and it worked. I did a binary search to find out which rev the regression happened in, and 141 is the first one that doesn’t work. I saw that there was a bunch of work done on the arm7 code in that rev, but I’m pretty unfamiliar with the details so I can’t see what’s wrong.
openocd_at91sam7s_flash.script
# The following command wills be executed on
# reset (because of run_and_init in the config-file)
# - halt target
# - init ecr
# - flash content of file main.bin into target-memory
# - shutdown openocd
#
# created by Martin Thomas
# http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects
# based on information from Dominic Rath
#
halt
sleep 50
wait_halt
# Init - taken form the script openocd_at91sam7_ecr.script
mww 0xfffffd44 0x00008000 # disable watchdog
mww 0xfffffd08 0xa5000001 # enable user reset
mww 0xfffffc20 0x00000601 # CKGR_MOR : enable the main oscillator
sleep 50
mww 0xfffffc2c 0x00481c0e # CKGR_PLLR: 96.1097 MHz
sleep 50
mww 0xfffffc30 0x00000007 # PMC_MCKR : MCK = PLL / 2 ~= 48 MHz
sleep 50
mww 0xffffff60 0x003c0100 # MC_FMR: flash mode (FWS=1,FMCN=60)
# arm7_9 force_hw_bkpts enable # program resides in flash
# AT91SAM7 flash command-"batch"
arm7_9 dcc_downloads enable
flash probe 0
flash write 0 main.bin 0x0
sleep 50
reset run
sleep 50
shutdown
openocd_at91sam7s_flash_wiggler.cfg
#daemon configuration
telnet_port 4444
gdb_port 3333
#interface
interface parport
#parport_port 0x378
parport_port /dev/parport0
parport_cable wiggler
jtag_speed 0
#use combined on interfaces or targets that can't set TRST/SRST separately
reset_config srst_only srst_pulls_trst
#jtag scan chain
#format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE)
jtag_device 4 0x1 0xf 0xe
#target configuration
daemon_startup reset
#target <type> <startup mode>
#target arm7tdmi <reset mode> <chainpos> <endianness> <variant>
target arm7tdmi little run_and_init 0 arm7tdmi
run_and_halt_time 0 30
# flash-options AT91
target_script 0 reset openocd_at91sam7s_flash.script
working_area 0 0x00200000 0x4000 nobackup
flash bank at91sam7 0 0 0 0 0
Here is the output of openocd: http://pastebin.com/mf14eb61