ARM-USB-OCD + Olimex LPC-2378-STK

hello Dominic,

I’m trying debug my application on Olimex LPC-2378-STK board. And getting the following results…

→ The ISP on the board is working nice.

→ Now when i’m trying to debug the application directly through JTAG (enabling the neccessary links), it doesn’t work.

→ But if i first download the precompiled hex file of the same application (through NXP’s FlashMagic Utility ) and then debug with the JTAG, it works without any error.

so what i can see here is, whenever i run the openocd and give the debug command, the debugger itself is unable to write the binary (.bin) file to the flash ROM . But this should not happen in normal case.

As my debug console shows…

(gdb) target state: halted

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

cpsr: 0x20000010 pc: 0x000013ac

flash ‘lpc2000’ found at 0x00000000

erased sectors 0 through 0 on flash bank 0 in 0s 281250us

failed writing file main.bin to flash bank 0 at offset 0x00000000

flash program error

requesting target halt and executing a soft reset

force hardware breakpoints enabled

i’m also getting a warning when invoke openocd as

Info: openocd.c:84 main(): Open On-Chip Debugger (2007-01-31 12:00 CET)

Warning: embeddedice.c:175 embeddedice_build_reg_cache(): EmbeddedICE version 7 detected, EmbeddedICE handling might be broken

Warning: arm7_9_common.c:683 arm7_9_assert_reset(): srst resets test logic, too

Is there anything wrong with my settings or issuing debugger commands??

Best Regards,

maks

hello Dominic,

please reply to my querry , i’m desperately waiting for your comment!!

my config file looks like!!

#daemon configuration

telnet_port 4444

gdb_port 3333

#interface

interface ft2232

ft2232_device_desc “Olimex OpenOCD JTAG A”

ft2232_layout “olimex-jtag”

ft2232_vid_pid 0x15BA 0x0003

jtag_speed 10

#use combined on interfaces or targets that can’t set TRST/SRST separately

reset_config trst_and_srst srst_pulls_trst

#jtag scan chain

#format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE)

jtag_device 4 0x1 0xf 0xe

#target configuration

daemon_startup reset

#target

#target arm7tdmi

target arm7tdmi little run_and_halt 0 arm7tdmi-s_r4

run_and_halt_time 0 30

working_area 0 0x40000000 0x40000 nobackup

#flash configuration

flash bank lpc2000 0x0 0x40000 0 0 lpc2000_v1 0 12000 calc_checksum

flash bank cfi 0x80000000 0x400000 2 2 0

let me know if any more input u want regarding the topic!!

Thanks 'n Regards,

maks

Hi,

the first thing that caught my attention is your flash bank configuration:

#flash configuration

flash bank lpc2000 0x0 0x40000 0 0 lpc2000_v1 0 12000 calc_checksum

flash bank cfi 0x80000000 0x400000 2 2 0

I doubt your LPC237x board comes with 4MB of external flash - this seems to be copied from one of the example configs.

The LPC23xx uses the lpc2000_v2 sector layout, only older LPCs have the v1 layout (I just updated the Wiki to include this). The LPC2378 also comes with 512kB of flash, not just 256kB. Try changing your flash config to

flash bank lpc2000 0x0 0x80000 0 0 lpc2000_v2 0 12000 calc_checksum

Regards,

Dominic

Thanks Dominic !! it worked!!

but i have one more querry…

I had recently ported one simple uC/OS-ii application on lpc 2148 processor but here also i’m facing the same error that the, .bin file failed to write. Thus i’m unable to debug it directly.

what may be wrong here??

any suggestion !!

Best Regards,

Mayur