eclipse + yagarto + openocd + amontec jtag tiny problem

Hi to all, in the last few days i trying in install and configure a complete ARM develop IDE. I’m using the latest sw version…openoncd r-1454.

Target board is the mcb2300 with lpc2368.

After few test I was able to configure the open openocd and program the board with the freertos uip example. I’m able to recompile that example to…using eclipse and yagarto…but I still have a problem to connect with the openocd using gdb inside eclipse.

These is the openocd config file that i launch to start openocd server:

telnet_port 4444

gdb_port 3333

gdb_memory_map enable

gdb_flash_program enable

interface ft2232

ft2232_device_desc “Amontec JTAGkey A”

ft2232_layout jtagkey

jtag_speed 100

ft2232_vid_pid 0x0403 0xcff8

jtag_nsrst_delay 200

jtag_ntrst_delay 200

reset_config trst_and_srst srst_pulls_trst

jtag newtap lpc2368 cpu -irlen 4 -ircapture 0x01 -irmask 0xe3

target create LPC2368 arm7tdmi -endian little -chain-position 0 -variant arm7tdmi-s_r4

LPC2368 configure -work-area-virt 0 -work-area-phys 0x40000000 -work-area-size 0x4000 -work-area-backup 0

Can someone tell me if is it ok?

Can someone suggest me the correct commands sequence that i have to use in the Eclipse to be able debug (with breakpoints) thru the openocd connection?

Thanks in advance to every one wants to help me to solve this situation,

Regard,

Renato

Even if you aren’t using OpenOCD to program the FLASH memory I think you still need to define the FLASH area. This is needed so that a hardware breakpoint can be selected when needed (executing code from FLASH). This is the line I have for an LPC2103 which you will need to modify for the LPC2368.

flash bank lpc2000 0x00000000 0x8000 0 0 0 lpc2000_v2 14746 calc_checksum

Note that I use FlashMagic (and not OpenOCD) to program my device.

As far as GDB goes… I use YAGARTO and if you do also make sure that you point to the correct GDB in your Debugger tab of your “Debug Configuration” in Eclipse. Here is what I have…

C:\Program Files\yagarto\bin\arm-elf-gdb.exe

Make sure you select a “Zylin Embedded debug (Native)” configuration.

Finally, here are my GDB init and run commands (Command tab of the debug configuration)…

“Initialize” commands

target remote localhost:3333

info mem

set $pc = 0x0

monitor poll

“Run” commands

break main

continue

clear main

info breakpoints

I’m never quite sure what is the right/best approach with the initialize/run commands for GDB… but these work for me with…

Eclipse

Yagarto

Zylin CDT

OpenOCD

Olimex USB JTAG Tiny A

LPC2103

TC

Your config file is wrong. Use the files that are supplied with OpenOCD - run OpenOCD like that:

openocd -f interface/jtagkey.cfg -f target/lpc2368.cfg

You will have to create the file lpc2368.cfg yourself, but you should base it on the file lpc2378.cfg (you can get that from the SVN tree).

4/3!!

I have a Luminary LM3S6918 with 64k ram, 256k flash,

Has anyone been successful at running a program from flash

and using Eclipse to set breakpoints. My JTAG is ARM-USB-TINY ?

(Olimex not Amontec)

Also I have two versions of eclipse one with “Zylin embedded CDT plug in”

(very hard to get this package presently) one with GDB Hardware debugging plug ins.

In both case I am not seeing breakpoints working in flash loaded program

is this possible to set up ?

At first,

GDB Initialization commands in Eclipse Debug configurations :

target remote localhost:3333

monitor reset

monitor sleep 500

monitor wait_halt 500

hbreak blinky.c:24

the breakpts would not stop the program,

and now after changing to:

target remote localhost:3333

info mem

set $pc = 0x0

monitor poll

I have the error below, and program does not run at all.

Also what would this mean as a kind of hint ??

Error: SWJ-DP STICKY ERROR

Error: dcb_dhcsr 0x30003, nvic_shcsr 0x20000, nvic_cfsr 0x0, nvic_bfar 0xe000edf8

Maybe who ever solves your problem can solve mine too.

I will post back if I figure out anything more.

Best of Luck to you.

before you set the breakpoint your program is like 100000 lines of code further… Instead “monitor reset” and waiting to halt like a second do “monitor reset halt” or - if that won’t work “monitor reset” and then “monitor soft_reset_halt”.

When you are using GDB Hardware Debugging plugin (which is also my choice), you do not need to set the breakpoint with the commands - in the settings somewhere at the bottom you can specify the function at which you want a temporary breakpoint placed. GDB will decide whether that should be hardware of software.

4/3!!

At first,

My Initialization (which almost works)

GDB Initialization commands in Eclipse Debug configurations :

target remote localhost:3333 
monitor reset 
monitor sleep 500 
monitor wait_halt 500 
hbreak blinky.c:24

the breakpts would not stop the program

(Your comments:)

before you set the breakpoint your program is like 100000 lines of code further… Instead (of) “monitor reset” and waiting to halt like a second (do you mean the command monitor sleep 500 ??)

do “monitor reset halt” or - if that won’t work “monitor reset” and then “monitor soft_reset_halt”.

When you are using GDB Hardware Debugging plugin (which is also my choice), you do not need to set the breakpoint with the commands:

  • in the settings somewhere at the bottom you can specify the function

at which you want a temporary breakpoint placed.

GDB will decide whether that should be hardware of software.

(My reply)

I am not sure which version of openOCD you are refering to.

I am using openOCD version 0.1.0 and GDB 6.8

(I believe these are the latest, older

versions of openOCD may have had a differnt numbering system)

I did not see “soft_reset_halt” in the manual for openOCD.

Please spell out for me all of the GDB and “monitor” commands to openOCD I need.

In other words please re-do my listing above

to make break points work. Also tell me which version of

openOCD you got the new listing to work with.

Also what do you mean by “in the settings somewhere at the bottom” etc. ?

I hope you are hinting that I should be able to just graphically set a breakpt in my code in the eclipse debug view, and eclipse should tell all the other players openOCD and GDB etc, what to do, with out having to manually send comands to GDB via a command window every time I want to set or clear a breakpt.

“The modern stone age way of doing it”.

Thanks,

Joe

Hi to all, as suggest to me by tcomins I insert this line in the open ocd cmd file:

flash bank lpc2000 0x00000000 0x20000 0 0 0 lpc2000_v2 14746 calc_checksum

and then i insert this lines in the gdb commmand tad inside eclipse:

target remote localhost:3333

monitor reset halt

monitor sleep 500

monitor poll

monitor soft_reset_halt

load

break main

continue

info breakpoints

but I’m not able to enter in debug mode, and these are messages present in the eclipse console tab:

arget remote localhost:3333

0x7fffe13e in ?? ()

monitor reset halt

JTAG tap: lpc2368.cpu tap/device found: 0x4f1f0f0f (Manufacturer: 0x787, Part: 0xf1f0, Version: 0x4)

srst pulls trst - can not reset into halted mode. Issuing halt after reset.

target state: halted

target halted in Thumb state due to debug-request, current mode: Supervisor

cpsr: 0xa00000f3 pc: 0x7fffe140

monitor sleep 500

monitor poll

target state: halted

target halted in Thumb state due to debug-request, current mode: Supervisor

cpsr: 0xa00000f3 pc: 0x7fffe140

monitor soft_reset_halt

requesting target halt and executing a soft reset

target state: halted

target halted in ARM state due to debug-request, current mode: Supervisor

cpsr: 0xa00000d3 pc: 0x00000000

load

Loading section prog, size 0x27a37 lma 0x2a4

Ignoring packet error, continuing…

Ignoring packet error, continuing…

Loading section .data, size 0x220 lma 0x27cdc

Ignoring packet error, continuing…

Error erasing flash with vFlashErase packet

Breakpoint 1 at 0x534: file main.c, line 121.

break main

Note: automatically using hardware breakpoints for read-only addresses.

continue

Warning:

Cannot insert hardware breakpoint 1.

Could not insert hardware breakpoints:

You may have requested too many hardware breakpoints/watchpoints.

Num Type Disp Enb Address What

1 breakpoint keep y 0x00000534 in main at main.c:121

info breakpoints

Cannot access memory at address 0x7fffe142

WHAT IS WRONG?

THNKS