EmbeddedRelated.com
Forums
Memfault Beyond the Launch

Using Openocd with Olimex LPC2478 STK

Started by "jim.deas" July 18, 2009
I have installed the Olimex ARMUSB-Tiny jtag on my system in an attempt to replace FlashMagic for programing the flash but am having problems.
To minimize the variables I am running ocd in a telnet window with the following service cfg file.
--------
#daemon configuration
telnet_port 4444
gdb_port 3333

#interface
interface ft2232
ft2232_device_desc "Olimex OpenOCD JTAG TINY A"
ft2232_layout "olimex-jtag"
ft2232_vid_pid 0x15BA 0x0004

jtag_speed 3

#use combined on interfaces or targets that can't set TRST/SRST separately
reset_config trst_and_srst separate

#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
#target arm7tdmi little run_and_halt 0 lpc2000
run_and_halt_time 0 10

#target_script 0 reset oocd_flash2148.script
#working_area 0 0x40000000 0x2000 nobackup
working_area 0 0x40000000 0x4000 nobackup

#flash configuration
flash bank lpc2000 0x0 0x40000 0 0 0 lpc2000_v1 14745 calc_checksum
# pre-OpenOCD189
#flash bank lpc2000 0x0 0x40000 0 0 lpc2000_v2 0 14745 calc_checksum
-------------------------------

I have been able via telnet to erase and protect and when trying to write, I get an error -902. I know something happens because the first flash block changes state to 'not erased'

What should I be looking for? I can erase and change protection on the flash but not write?

An Engineer's Guide to the LPC2100 Series

I bought an Olimex arm-usb-ocd interface about a month ago. I think that
as far as openocd is concerned, they are identical. Here is the .cfg
file I've been using. (I assume you're working in windows with the
version of oocd supplied on the Olimex CD.)
#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_khz 500

#use combined on interfaces or targets that can't set TRST/SRST
separately
reset_config trst_and_srst separate

#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

#target_script 0 reset oocd_flash2138.script
working_area 0 0x40000000 0x40000 nobackup

#flash configuration
flash bank lpc2000 0x0 0x40000 0 0 0 lpc2000_v2 12000 calc_checksum
* I changed jtag_speed to jtag_khz after building openocd 0.1.0 on
linux. I'm pretty sure jtag_speed is equivalent.

* Your flash bank line may be more correct. I don't know. It is
certainly different.

* The actual command I've been using to flash goes something like:
flash write_image erase myproj/main.hex 0 ihex
-Hugh

--- In l..., "jim.deas" wrote:
>
> I have installed the Olimex ARMUSB-Tiny jtag on my system in an
attempt to replace FlashMagic for programing the flash but am having
problems.
> To minimize the variables I am running ocd in a telnet window with the
following service cfg file.
> --------
> #daemon configuration
> telnet_port 4444
> gdb_port 3333
>
> #interface
> interface ft2232
> ft2232_device_desc "Olimex OpenOCD JTAG TINY A"
> ft2232_layout "olimex-jtag"
> ft2232_vid_pid 0x15BA 0x0004
>
> jtag_speed 3
>
> #use combined on interfaces or targets that can't set TRST/SRST
separately
> reset_config trst_and_srst separate
>
> #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
> #target arm7tdmi little run_and_halt 0 lpc2000
> run_and_halt_time 0 10
>
> #target_script 0 reset oocd_flash2148.script
> #working_area 0 0x40000000 0x2000 nobackup
> working_area 0 0x40000000 0x4000 nobackup
>
> #flash configuration
> flash bank lpc2000 0x0 0x40000 0 0 0 lpc2000_v1 14745 calc_checksum
> # pre-OpenOCD189
> #flash bank lpc2000 0x0 0x40000 0 0 lpc2000_v2 0 14745 calc_checksum
> -------------------------------
>
> I have been able via telnet to erase and protect and when trying to
write, I get an error -902. I know something happens because the first
flash block changes state to 'not erased'
>
> What should I be looking for? I can erase and change protection on the
flash but not write?
>




Memfault Beyond the Launch