Flash debugging OpenOCD+Olimex+arm-usb-ocd+Lpc2129
I can’t seem to get flash debugging working. I’m using a fresh copy of the 2106 flash demo from Lim Lynch’s tutorial, but I don’t have a 2106 board. Very little was needed to modify it to make it work with the lpc2129 proto board from Olimex - I just changed the pin number in main.c to use the yellow led on the board and changed the flash and ram lengths appropriately in the linker script. I know the code and arm-usb-ocd are working the because I was able to debug from RAM by pulling the code into the 2294 debugging demo from the yagarto site.
But between the openocd configuration file, the (on reset?) script defined by the config file, the gdb commands in the eclipse debug setup, and my own ignorance - I’m lost and need some help.
Using the configuration that I think is correct (below), when I launch the debug in eclipse - it just stalls at 60% and never progresses. If I remove the last 2 gdb commands (thbreak main and continue), it seems to launch a thread, but that thread seems to be associated solely with the UNDEF_Routine - main never seems to be entered.
Here are the files:
The openocd configuration file:
#daemon configuration
telnet_port 4444
gdb_port 3333
#interface
interface ft2232
ft2232_device_desc "Olimex OpenOCD JTAG A"
ft2232_layout "olimex-jtag"
ft2232_vid_pid 0x15BA 0x0003
jtag_speed 2
#use combined on interfaces or targets that can't set TRST/SRST separately
reset_config trst_and_srst 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_halt 0 arm7tdmi-s_r4
run_and_halt_time 0 30
target_script 0 reset oocd_flash2106.script
working_area 0 0x40000000 0x40000 nobackup
#flash configuration
flash bank lpc2000 0x0 0x20000 0 0 lpc2000_v1 0 14765 calc_checksum
#flash bank cfi 0x80000000 0x400000 2 2 0
# For more information about the configuration files, take a look at:
# http://openfacts.berlios.de/index-en.phtml?title=Open+On-Chip+Debugger
The referenced openocd reset script:
# LPC2106 flash command-"batch"
# adapted by Martin Thomas based on information from Dominic Rath - Thanks
sleep 500
poll
flash probe 0
flash erase 0 0 0
flash write 0 main.bin 0x0
reset run
sleep 500
And the eclipse debug commands:
target remote localhost:3333
monitor soft_reset_halt
monitor arm7_9 force_hw_bkpts enable
symbol-file main.out
thbreak main
continue
Any guidance is appreciated. Thanks,
Karim