Loading programs onto board with gdb

We’ve been given an assignment for a computer hardware paper, but I’m really struggling to get the board working at home.

> openocd -f openocd.cfg
Open On-Chip Debugger 0.4.0 (2010-04-27-15:56)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.berlios.de/doc/doxygen/bugs.html
srst_only srst_pulls_trst srst_gates_jtag srst_open_drain
Warn : use 'at91sam7s256.cpu' as target identifier, not '0'
Info : clock speed 6000 kHz
Info : JTAG tap: at91sam7s256.cpu tap/device found: 0x3f0f0f0f (mfg: 0x787, part: 0xf0f0, ver: 0x3)
Info : Embedded ICE version 1
Info : at91sam7s256.cpu: hardware has 2 breakpoint/watchpoint units

So that starts OK.

Then I start the debugger and set the target:

> arm-elf-gdb main.elf
GNU gdb 6.1
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "--host=i686-pc-linux-gnu --target=arm-elf"...
(gdb) target remote localhost:3333
Remote debugging using localhost:3333
0x00000000 in ?? ()
(gdb)

this causes the openocd window to say:

Info : accepting 'gdb' connection from 0
undefined debug reason 6 - target needs reset

So what does this “undefined debug reason 6 - target needs reset” business mean?

hi!

your messages seems to be ok. After starting gdb and connecting it to openOCD you need some more commands to get it run…

here for example my gdb initialization:

target remote localhost:3333
monitor reset
monitor wait 500
monitor soft_reset_halt
monitor arm7_9 force_hw_bkpts enable

after the initialization you can type

load

to load the code into sram/sdram. When this command is completed you can run/continue execution of your code.

regards