EmbDev.net

Forum: ARM programming with GCC/GNU tools flashing and debugging lpc2388 with eclipse, yagarto and openOCD really need help


Author: Thorsten F. (thorstenf)
Posted on:

Rate this post
0 useful
not useful
I would like to programm and debug a nxp lpc2388 on a mcb2300 board.
Right now i am using following programms/drivers:

Windows XP SP3
Eclipse Galileo including Zylin CDT
Yagarto 4.4.2
openOCD 0.3.1 (installer Version from http://www.freddiechopin.info)
libusb win32

I am (more or less?) successful at compiling my sourcecode and 
connecting openocd to the Olimex-arm-usb-ocd. I start opencd as an 
externaltool (within eclipse) with the follwing arguments:
-f .../target/lpc2378.cfg
-f .../interface/olimex-arm-usb-ocd.cfg
So far the part that seems to work, if i connect Openocd i get the 
following Output in the console:
Open On-Chip Debugger 0.3.1 (2009-11-13-16:13)
$URL$
For bug reports, read
  http://openocd.berlios.de/doc/doxygen/bugs.html
C:\Programme\OpenOCD\0.3.1\bin\openocd.exe: option requires an argument -- c
jtag_nsrst_delay: 200
jtag_ntrst_delay: 200
trst_and_srst srst_pulls_trst srst_gates_jtag trst_push_pull srst_open_drain
500 kHz
Info : clock speed 500 kHz
Info : JTAG tap: lpc2378.cpu tap/device found: 0x4f1f0f0f (mfg: 0x787, part: 0xf1f0, ver: 0x4)
Info : Embedded ICE version 7
Error: EmbeddedICE v7 handling might be broken

Except for the last Line everything looks ok. Unfortunately i have no 
idea how to solve this problem, but actually do not think its my main 
problem.

As soon as i start arm-elf-gdb using the following arguments:
target remote localhost:3333
monitor sleep 500
monitor poll
monitor flash probe 0
monitor flash info 0
monitor soft_reset_halt
monitor flash erase_sector 0 0 0
monitor flash write_image main.bin 0x0
monitor reset run
monitor sleep 500
monitor soft_reset_halt
symbol-file main.elf
info mem
thbreak main
continue
I see different "Versions" of behaviour. Unfortunately it just doesnt 
work no matter which version i see. Most of the time it looks like this:
Warning: /cygdrive/D/workspace/merses/LCD/.dep: No such file or directory.
Warning: /cygdrive/D/workspace/merses/LCD: No such file or directory.
mi_cmd_break_watch: Missing <expression>
No registers.
target remote localhost:3333
0x00000000 in __lcd_print_from_thumb ()
monitor sleep 500
monitor poll
background polling: on
TAP: lpc2378.cpu (enabled)
target state: running
monitor flash probe 0
flash 'lpc2000' found at 0x00000000
monitor flash info 0
#0 : lpc2000 at 0x00000000, size 0x0007d000, buswidth 0, chipwidth 0
  #  0: 0x00000000 (0x1000 4kB) protected
  #  1: 0x00001000 (0x1000 4kB) protected
  #  2: 0x00002000 (0x1000 4kB) protected
  #  3: 0x00003000 (0x1000 4kB) protected
  #  4: 0x00004000 (0x1000 4kB) protected
  #  5: 0x00005000 (0x1000 4kB) protected
  #  6: 0x00006000 (0x1000 4kB) protected
  #  7: 0x00007000 (0x1000 4kB) protected
  #  8: 0x00008000 (0x8000 32kB) protected
  #  9: 0x00010000 (0x8000 32kB) protected
  # 10: 0x00018000 (0x8000 32kB) protected
  # 11: 0x00020000 (0x8000 32kB) protected
  # 12: 0x00028000 (0x8000 32kB) protected
  # 13: 0x00030000 (0x8000 32kB) protected
  # 14: 0x00038000 (0x8000 32kB) protected
  # 15: 0x00040000 (0x8000 32kB) protected
  # 16: 0x00048000 (0x8000 32kB) protected
  # 17: 0x00050000 (0x8000 32kB) protected
  # 18: 0x00058000 (0x8000 32kB) protected
  # 19: 0x00060000 (0x8000 32kB) protected
  # 20: 0x00068000 (0x8000 32kB) protected
  # 21: 0x00070000 (0x8000 32kB) protected
  # 22: 0x00078000 (0x1000 4kB) protected
  # 23: 0x00079000 (0x1000 4kB) protected
  # 24: 0x0007a000 (0x1000 4kB) protected
  # 25: 0x0007b000 (0x1000 4kB) protected
  # 26: 0x0007c000 (0x1000 4kB) protected
lpc2000 flash driver variant: 1, clk: 4000kHz
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: 0x000000d3 pc: 0x00000000
monitor flash erase_sector 0 0 0
erased sectors 0 through 0 on flash bank 0 in 0.281250s
monitor flash write_image main.bin 0x0
Verification will fail since checksum in image (0xea0000e4) to be written to flash is different from calculated vector checksum (0x26fedf8f).
To remove this warning modify build tools on developer PC to inject correct LPC vector checksum.
wrote 1216 byte from file main.bin in 0.453125s (2.620690 kb/s)
monitor reset run
JTAG tap: lpc2378.cpu tap/device found: 0x4f1f0f0f (mfg: 0x787, part: 0xf1f0, ver: 0x4)
monitor sleep 500
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: 0x000000d3 pc: 0x00000000
symbol-file main.elf
info mem
Using memory regions provided by the target.
Num Enb Low Addr   High Addr  Attrs 
0   y    0x00000000 0x0007d000 flash blocksize 0x1000 nocache 
1   y    0x0007d000 0x100000000 rw nocache 
thbreak main
Hardware assisted breakpoint 1 at 0x412: file main.c, line 6.
continue

Allthough the flash seems to be protected, the Flash is erased 
successfully und filled with my programm. Allthough i dont know how to 
get rid of this wrong checksum.
Another Version contains this behaviour:
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: 0x400000d3 pc: 0x00000000
monitor flash erase_sector 0 0 0
memory write caused data abort (address: 0x40000000, size: 0x4, count: 0x2)
Write memory at address 0x40000000 failed (check work_area definition)
lpc2000 prepare sectors returned -307
failed erasing sectors 0 to 0 (-902)
monitor flash write_image main.bin 0x0
Verification will fail since checksum in image (0xea0000e4) to be written to flash is different from calculated vector checksum (0x26fedf8f).
To remove this warning modify build tools on developer PC to inject correct LPC vector checksum.
wrote 1216 byte from file main.bin in 0.437500s (2.714286 kb/s)

Either way it just freezes at "continue" and i dont have a chance to do 
anything.

I have tried to get this to work for a long time now. What confuses me 
the most: with the same software and Configuration it works on another 
pc. There i also have this "Error: EmbeddedICE v7 handling might be 
broken" as well as the "wrong checksum" Error, but debugging perfectly 
works.

Right now i am completely out of ideas and feeling really desperate. I 
really hope that someone here can help me.

Thank you in advance

Author: Marcio Ribeiro (Guest)
Posted on:

Rate this post
0 useful
not useful
I'm having same problems using olimex open ocd to program a lpc2368.

Could you tell me if you got you system working/programming?

Sds,

Marcio Ribeiro

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.