EmbDev.net

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


von Thorsten F. (thorstenf)


Rate this post
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:
1
-f .../target/lpc2378.cfg
2
-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:
1
Open On-Chip Debugger 0.3.1 (2009-11-13-16:13)
2
$URL$
3
For bug reports, read
4
  http://openocd.berlios.de/doc/doxygen/bugs.html
5
C:\Programme\OpenOCD\0.3.1\bin\openocd.exe: option requires an argument -- c
6
jtag_nsrst_delay: 200
7
jtag_ntrst_delay: 200
8
trst_and_srst srst_pulls_trst srst_gates_jtag trst_push_pull srst_open_drain
9
500 kHz
10
Info : clock speed 500 kHz
11
Info : JTAG tap: lpc2378.cpu tap/device found: 0x4f1f0f0f (mfg: 0x787, part: 0xf1f0, ver: 0x4)
12
Info : Embedded ICE version 7
13
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:
1
target remote localhost:3333
2
monitor sleep 500
3
monitor poll
4
monitor flash probe 0
5
monitor flash info 0
6
monitor soft_reset_halt
7
monitor flash erase_sector 0 0 0
8
monitor flash write_image main.bin 0x0
9
monitor reset run
10
monitor sleep 500
11
monitor soft_reset_halt
12
symbol-file main.elf
13
info mem
14
thbreak main
15
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:
1
Warning: /cygdrive/D/workspace/merses/LCD/.dep: No such file or directory.
2
Warning: /cygdrive/D/workspace/merses/LCD: No such file or directory.
3
mi_cmd_break_watch: Missing <expression>
4
No registers.
5
target remote localhost:3333
6
0x00000000 in __lcd_print_from_thumb ()
7
monitor sleep 500
8
monitor poll
9
background polling: on
10
TAP: lpc2378.cpu (enabled)
11
target state: running
12
monitor flash probe 0
13
flash 'lpc2000' found at 0x00000000
14
monitor flash info 0
15
#0 : lpc2000 at 0x00000000, size 0x0007d000, buswidth 0, chipwidth 0
16
  #  0: 0x00000000 (0x1000 4kB) protected
17
  #  1: 0x00001000 (0x1000 4kB) protected
18
  #  2: 0x00002000 (0x1000 4kB) protected
19
  #  3: 0x00003000 (0x1000 4kB) protected
20
  #  4: 0x00004000 (0x1000 4kB) protected
21
  #  5: 0x00005000 (0x1000 4kB) protected
22
  #  6: 0x00006000 (0x1000 4kB) protected
23
  #  7: 0x00007000 (0x1000 4kB) protected
24
  #  8: 0x00008000 (0x8000 32kB) protected
25
  #  9: 0x00010000 (0x8000 32kB) protected
26
  # 10: 0x00018000 (0x8000 32kB) protected
27
  # 11: 0x00020000 (0x8000 32kB) protected
28
  # 12: 0x00028000 (0x8000 32kB) protected
29
  # 13: 0x00030000 (0x8000 32kB) protected
30
  # 14: 0x00038000 (0x8000 32kB) protected
31
  # 15: 0x00040000 (0x8000 32kB) protected
32
  # 16: 0x00048000 (0x8000 32kB) protected
33
  # 17: 0x00050000 (0x8000 32kB) protected
34
  # 18: 0x00058000 (0x8000 32kB) protected
35
  # 19: 0x00060000 (0x8000 32kB) protected
36
  # 20: 0x00068000 (0x8000 32kB) protected
37
  # 21: 0x00070000 (0x8000 32kB) protected
38
  # 22: 0x00078000 (0x1000 4kB) protected
39
  # 23: 0x00079000 (0x1000 4kB) protected
40
  # 24: 0x0007a000 (0x1000 4kB) protected
41
  # 25: 0x0007b000 (0x1000 4kB) protected
42
  # 26: 0x0007c000 (0x1000 4kB) protected
43
lpc2000 flash driver variant: 1, clk: 4000kHz
44
monitor soft_reset_halt
45
requesting target halt and executing a soft reset
46
target state: halted
47
target halted in ARM state due to debug-request, current mode: Supervisor
48
cpsr: 0x000000d3 pc: 0x00000000
49
monitor flash erase_sector 0 0 0
50
erased sectors 0 through 0 on flash bank 0 in 0.281250s
51
monitor flash write_image main.bin 0x0
52
Verification will fail since checksum in image (0xea0000e4) to be written to flash is different from calculated vector checksum (0x26fedf8f).
53
To remove this warning modify build tools on developer PC to inject correct LPC vector checksum.
54
wrote 1216 byte from file main.bin in 0.453125s (2.620690 kb/s)
55
monitor reset run
56
JTAG tap: lpc2378.cpu tap/device found: 0x4f1f0f0f (mfg: 0x787, part: 0xf1f0, ver: 0x4)
57
monitor sleep 500
58
monitor soft_reset_halt
59
requesting target halt and executing a soft reset
60
target state: halted
61
target halted in ARM state due to debug-request, current mode: Supervisor
62
cpsr: 0x000000d3 pc: 0x00000000
63
symbol-file main.elf
64
info mem
65
Using memory regions provided by the target.
66
Num Enb Low Addr   High Addr  Attrs 
67
0   y    0x00000000 0x0007d000 flash blocksize 0x1000 nocache 
68
1   y    0x0007d000 0x100000000 rw nocache 
69
thbreak main
70
Hardware assisted breakpoint 1 at 0x412: file main.c, line 6.
71
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:
1
monitor soft_reset_halt
2
requesting target halt and executing a soft reset
3
target state: halted
4
target halted in ARM state due to debug-request, current mode: Supervisor
5
cpsr: 0x400000d3 pc: 0x00000000
6
monitor flash erase_sector 0 0 0
7
memory write caused data abort (address: 0x40000000, size: 0x4, count: 0x2)
8
Write memory at address 0x40000000 failed (check work_area definition)
9
lpc2000 prepare sectors returned -307
10
failed erasing sectors 0 to 0 (-902)
11
monitor flash write_image main.bin 0x0
12
Verification will fail since checksum in image (0xea0000e4) to be written to flash is different from calculated vector checksum (0x26fedf8f).
13
To remove this warning modify build tools on developer PC to inject correct LPC vector checksum.
14
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

von Marcio Ribeiro (Guest)


Rate this post
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

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.