LPC1768 Debug with Olimex ARM-USB-TINY-H + Eclipse + Zylin

Hi,

I bought a JTAG adapter from Olimex (http://www.olimex.com ARM-USB-TINY-H) for my LPC1768 Board (own design) to flash and debug it. I spent days to find the correct makefile & project.cfg to compile and flash the firmware. This works fine. But I dont know how to configure the Debug GDB Config under Eclipse. Although I have found a few tips and lines of code, but it still does not work :(. In the lpc1768.cfg file in openocd-0.6.1\scripts\target\ I changed “CCLK” to 96000 (set up in system_LPC17xx.c).

On the pictures are the config settings. I tried differnt Init & Run Commands with different error messages. Nothing works. Can someone help me?

The project files:

http://ottelo.funpic.de/openocdforum/files.png

The Run config for Eclipse:

http://ottelo.funpic.de/openocdforum/Run-config.png

project.cfg for flashing the firmware:

http://ottelo.funpic.de/openocdforum/project.png

project2.cfg for only connect (and then debug):

http://ottelo.funpic.de/openocdforum/project2.png

Debug GDP Config Tab 1:

http://ottelo.funpic.de/openocdforum/debug1.png

Debug GDP Config Tab 2:

http://ottelo.funpic.de/openocdforum/debug2.png

Debug GDP Config Tab 3:

http://ottelo.funpic.de/openocdforum/debug3.png

Debug GDP Config Tab 6:

http://ottelo.funpic.de/openocdforum/debug4.png

Initialize commands:

target remote localhost:3333
monitor reset
Monitor soft_reset_halt
MWW monitor 0xE01FC040 0x0002
load

Run commands:

monitor reg r13 = (0x10000000)
monitor reg pc = (0x10000004)
continue

Error messages:

Open On-Chip Debugger 0.6.1 (2012-10-07-10:34)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.sourceforge.net/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
adapter_nsrst_delay: 200
jtag_ntrst_delay: 200
adapter speed: 10 kHz
cortex_m3 reset_config vectreset
Info : max TCK change to: 30000 kHz
Info : clock speed 10 kHz
Info : JTAG tap: lpc1768.cpu tap/device found: 0x4ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x4)
Info : lpc1768.cpu: hardware has 6 breakpoints, 4 watchpoints

target remote localhost:3333
0x000000d0 in __do_global_dtors_aux ()
monitor reset
ftdi_write_data: usb bulk write failed
couldn't write MPSSE commands to FT2232
error: -104

in procedure 'reset'
Monitor soft_reset_halt
requesting target halt and executing a soft reset
ftdi_write_data: usb bulk write failed
couldn't write MPSSE commands to FT2232
MWW monitor 0xE01FC040 0x0002
Undefined command: "MWW".  Try "help".
load
Error erasing flash with vFlashErase packet
monitor reg r13 = (0x10000000)
register r13 not found in current target
monitor reg pc = (0x10000004)
  arm mcr cpnum op1 CRn op2 CRm value
  arm mrc cpnum op1 CRn op2 CRm
  arm reg   dap apid [ap_num]
  flash write_image [erase] [unlock] filename [offset [file_type]]
gdb_sync     lpc1768.cpu arm mcr cpnum op1 CRn op2 CRm value
    lpc1768.cpu arm mrc cpnum op1 CRn op2 CRm
    lpc1768.cpu arm reg     lpc1768.cpu dap apid [ap_num]
reg [(register_name|register_number) [value]]
in procedure 'reg'
continue
Note: automatically using hardware breakpoints for read-only addresses.
Warning:
Cannot insert hardware breakpoint 1.
Could not insert hardware breakpoints:
You may have requested too many hardware breakpoints/watchpoints.

Error Windows: Execution is suspended because of error

Ok I answer myself:

I put these commands into my project.cfg file:

init
sleep 200
reset init
halt
wait_halt

so my entire project.cfg:

# project file for Debug Sessions

source [find target/lpc1768.cfg]
reset_config srst_only

adapter_khz 500

init
sleep 200
reset init
halt
wait_halt

In the Init/Run fields of GDB/Debug Config I wrote these lines:

target remote localhost:3333
load
stepi
break main
continue

Now I get these Output:

source .gdbinit
target remote localhost:3333
0x1fff0080 in ?? ()
load
Loading section .text, size 0x428 lma 0x0
Start address 0x251, load size 1064
Transfer rate: 302 bytes/sec, 1064 bytes/write.
stepi
Note: automatically using hardware breakpoints for read-only addresses.
stepi ignored. GDB will now fetch the register state from the target.

Program received signal SIGINT, Interrupt.
Reset_Handler () at core/cm3/startup_LPC17xx.c:191
191	{
break main
Breakpoint 3 at 0x11a: file main.c, line 29.
continue

Breakpoint 1, main () at main.c:29
29		LPC_GPIO1->FIODIR |= 1 << 29; // P1.29 connected to LED

And everything works! :slight_smile:

Hi, ottelo,

can you tell me if JTAG adapter will run in such environment: http://www.encryptedfilestorage.com/zer … he-clouds/?