openocd and flash debug

Hi all,

I try to find a way to debug my application on flash. I’m very not an expert with all the dgb stuff. I can get some part of the chain working but i cannot get the debug (breakpoint , single step etc) working.

Can somebody tell me or give me the link to get this setup working.

AT91sam7S256

Debug in flash

openocd rev93

eclipse with all the cdt plugins installed.

I have follow the tutorial from lynch but this one is for ram debug only i think.

What i need in my cfg file for openocd

what is the gdb command i have to send from eclipse

What is the debug information i have to have in my makefile (dwarf-2 ?)

OPT = 0

what else ?

wig.cfg

# OPENOCD "Batch"-Programming
# for Atmel SAM7 ARM7TDMI
#
# Using a Wiggler-Type JTAG-Interface
# Adapted by Martin Thomas (www.siwawi.arubi.uni-kl.de/avr_projects)
# Based on information from Dominic Rath - Thank you!

#daemon configuration
telnet_port 4444
gdb_port 3333

#interface
interface parport
parport_cable wiggler
parport_port 0x378
jtag_speed 0

#use combined on interfaces or targets that can't set TRST/SRST separately
## mthomas: used this for Atmel SAM7S64-EK
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

#target configuration
daemon_startup reset

#target  
#target arm7tdmi    
target arm7tdmi little run_and_init 0 arm7tdmi_r4

run_and_halt_time 0 30

working_area 0 0x00100000 0x40000 nobackup
flash bank at91sam7 0 0 0 0 0


# mthomas AT91SAM7

eclipse command

target remote localhost:3333
monitor soft_reset_halt
monitor reg pc 0x00000000
monitor ARM7_9 force_hw_bkpts enable
break main
load
continue

Jonathan

Hi Jonathan.

First, are you working from the tutorial I prepared for Atmel’s AT91SAM7S processors? It is now on their web site: www.at91.com

In Eclipse, you need to prepare a “debug launch configuration” for EPROM debugging. This is explained in great detail in the tutorial.

The Eclipse GDB initialization script that I use is:

target remote localhost:3333

monitor soft_reset_halt

monitor arm7_9 force_hw_bkpts enable

symbol-file main.out

thbreak main

continue

The “load” command you used doesn’t make sense for a EPROM-based application, you have to program the flash with OpenOCD or SAM-BA first, before you attempt to launch the debugger.

Keep us posted about your progress. I have new AT91SAM7S256 sample projects that I could send you that demonstrate interrupts and show how to program the on chip flash via OpenOCD.

cheers,

Jim Lynch

Hi Lynch,

Yes i use the one on the at91.com . But i don’t see the flash debug part. I’m probably blind :slight_smile:

i have been able to debug lpc2129 but not thru eclipse, but from insight.

if you can send me your project file, i 'll apreciate it.

jdumaresq AT cimeq.qc.ca

regards