can't write flash on new olimex lpc2148

(edited with more details)

I think my programmer or my dev board is broken.

The following is the contents of the flash script.

— begin —

halt

arm7_9 dcc_downloads enable

wait_halt

sleep 10

poll

mdh 0x0 100

flash probe 0

flash erase_sector 0 0 26

mdh 0x0 100

flash write_bank 0 main.bin 0x0

mdh 0x0 100

reset run

sleep 10

— end —

The following is the lpc2148.cfg file.

— begin —

telnet_port 4444

gdb_port 3333

interface “ft2232”

ft2232_device_desc “Olimex OpenOCD JTAG”

ft2232_layout “olimex-jtag”

ft2232_vid_pid 0x15BA 0x0003

jtag_speed 3

reset_config trst_and_srst srst_pulls_trst

jtag_device 4 0x1 0xf 0xe

daemon_startup reset

target arm7tdmi little run_and_init 0 arm7tdmi-s_r4

run_and_halt_time 0 30

target_script 0 reset oocd_flash_lpc2148.script

working_area 0 0x40000000 0x80000 nobackup

flash bank lpc2000 0x0 0x7D000 0 0 0 lpc2000_v2 14765 calc_checksum

— end —

When I call openocd:

openocd -f lpc2148.cfg

The following is a snippet of 1000 lines of output:

Open On-Chip Debugger 1.0 (today) svn:0.0001

$URL: svn://svn.berlios.de/openocd/trunk/src/openocd.c $

Info: jtag.c:1329 jtag_examine_chain(): JTAG device found: 0x4f1f0f0f (Manufacturer: 0x787, Part: 0xf1f0, Version: 0x4)

Warning: jtag.c:902 jtag_add_reset(): requested reset would assert trst

Warning: jtag.c:1157 jtag_check_value(): value captured during scan didn’t pass the requested check: captured: 0x0f check_value: 0x01 check_mask: 0x0f

Warning: jtag.c:1117 jtag_read_buffer(): in_handler reported a failed check

Warning: jtag.c:1157 jtag_check_value(): value captured during scan didn’t pass the requested check: captured: 0x0f check_value: 0x01 check_mask: 0x0f

Warning: jtag.c:1117 jtag_read_buffer(): in_handler reported a failed check

Info: target.c:240 target_init_handler(): executing reset script ‘oocd_flash_lpc2148.script’

Warning: arm7_9_common.c:972 arm7_9_halt(): target was already halted

Warning: jtag.c:1157 jtag_check_value(): value captured during scan didn’t pass the requested check: captured: 0x0f check_value: 0x01 check_mask: 0x0f

Warning: jtag.c:1117 jtag_read_buffer(): in_handler reported a failed check

Warning: jtag.c:1157 jtag_check_value(): value captured during scan didn’t pass the requested check: captured: 0x0f check_value: 0x01 check_mask: 0x0f

Warning: jtag.c:1117 jtag_read_buffer(): in_handler reported a failed check

Info: options.c:50 configuration_output_handler(): dcc downloads are enabled

Warning: arm7_9_common.c:972 arm7_9_halt(): target was already halted

User: target.c:784 target_arch_state(): target state: halted

User: armv4_5.c:340 armv4_5_arch_state(): target halted in Thumb state due to watchpoint, current mode: System

cpsr: 0xffffffff pc: 0xffffffef

Warning: jtag.c:1157 jtag_check_value(): value captured during scan didn’t pass the requested check: captured: 0x0f check_value: 0x01 check_mask: 0x0f

Warning: jtag.c:1117 jtag_read_buffer(): in_handler reported a failed check

Warning: jtag.c:1157 jtag_check_value(): value captured during scan didn’t pass the requested check: captured: 0x0f check_value: 0x01 check_mask: 0x0f

Warning: jtag.c:1117 jtag_read_buffer(): in_handler reported a failed check

Warning: jtag.c:1157 jtag_check_value(): value captured during scan didn’t pass the requested check: captured: 0x0f check_value: 0x01 check_mask: 0x0f

Warning: jtag.c:1117 jtag_read_buffer(): in_handler reported a failed check

Warning: jtag.c:1157 jtag_check_value(): value captured during scan didn’t pass the requested check: captured: 0x0f check_value: 0x01 check_mask: 0x0f

Warning: jtag.c:1117 jtag_read_buffer(): in_handler reported a failed check

Warning: jtag.c:1157 jtag_check_value(): value captured during scan didn’t pass the requested check: captured: 0x0f check_value: 0x01 check_mask: 0x0f

Warning: jtag.c:1117 jtag_read_buffer(): in_handler reported a failed check

Warning: jtag.c:1157 jtag_check_value(): value captured during scan didn’t pass the requested check: captured: 0x0f check_value: 0x01 check_mask: 0x0f

Warning: jtag.c:1117 jtag_read_buffer(): in_handler reported a failed check

Warning: jtag.c:1157 jtag_check_value(): value captured during scan didn’t pass the requested check: captured: 0x0f check_value: 0x01 check_mask: 0x0f

Warning: jtag.c:1117 jtag_read_buffer(): in_handler reported a failed check

Warning: jtag.c:1157 jtag_check_value(): value captured during scan didn’t pass the requested check: captured: 0x0f check_value: 0x01 check_mask: 0x0f

Warning: jtag.c:1117 jtag_read_buffer(): in_handler reported a failed check

Warning: jtag.c:1157 jtag_check_value(): value captured during scan didn’t pass the requested check: captured: 0x0f check_value: 0x01 check_mask: 0x0f

Warning: jtag.c:1117 jtag_read_buffer(): in_handler reported a failed check

Warning: jtag.c:1157 jtag_check_value(): value captured during scan didn’t pass the requested check: captured: 0x0f check_value: 0x01 check_mask: 0x0f

Warning: jtag.c:1117 jtag_read_buffer(): in_handler reported a failed check

Warning: jtag.c:1157 jtag_check_value(): value captured during scan didn’t pass the requested check: captured: 0x0f check_value: 0x01 check_mask: 0x0f

Warning: jtag.c:1117 jtag_read_buffer(): in_handler reported a failed check

Warning: jtag.c:1157 jtag_check_value(): value captured during scan didn’t pass the requested check: captured: 0x0f check_value: 0x01 check_mask: 0x0f

Warning: jtag.c:1117 jtag_read_buffer(): in_handler reported a failed check

Warning: jtag.c:1157 jtag_check_value(): value captured during scan didn’t pass the requested check: captured: 0x0f check_value: 0x01 check_mask: 0x0f

Warning: jtag.c:1117 jtag_read_buffer(): in_handler reported a failed check

Warning: jtag.c:1157 jtag_check_value(): value captured during scan didn’t pass the requested check: captured: 0x0f check_value: 0x01 check_mask: 0x0f

Warning: jtag.c:1117 jtag_read_buffer(): in_handler reported a failed check

Warning: jtag.c:1157 jtag_check_value(): value captured during scan didn’t pass the requested check: captured: 0x0f check_value: 0x01 check_mask: 0x0f

Warning: jtag.c:1117 jtag_read_buffer(): in_handler reported a failed check

Warning: jtag.c:1157 jtag_check_value(): value captured during scan didn’t pass the requested check: captured: 0x0f check_value: 0x01 check_mask: 0x0f

Warning: jtag.c:1117 jtag_read_buffer(): in_handler reported a failed check

Warning: jtag.c:1157 jtag_check_value(): value captured during scan didn’t pass the requested check: captured: 0x0f check_value: 0x01 check_mask: 0x0f

Warning: jtag.c:1117 jtag_read_buffer(): in_handler reported a failed check

Warning: jtag.c:1157 jtag_check_value(): value captured during scan didn’t pass the requested check: captured: 0x0f check_value: 0x01 check_mask: 0x0f

Warning: jtag.c:1117 jtag_read_buffer(): in_handler reported a failed check

Warning: jtag.c:1157 jtag_check_value(): value captured during scan didn’t pass the requested check: captured: 0x0f check_value: 0x01 check_mask: 0x0f

Warning: jtag.c:1117 jtag_read_buffer(): in_handler reported a failed check

Warning: jtag.c:1157 jtag_check_value(): value captured during scan didn’t pass the requested check: captured: 0x0f check_value: 0x01 check_mask: 0x0f

Warning: jtag.c:1117 jtag_read_buffer(): in_handler reported a failed check

Warning: jtag.c:1157 jtag_check_value(): value captured during scan didn’t pass the requested check: captured: 0x0f check_value: 0x01 check_mask: 0x0f

Warning: jtag.c:1117 jtag_read_buffer(): in_handler reported a failed check

Warning: jtag.c:1157 jtag_check_value(): value captured during scan didn’t pass the requested check: captured: 0x0f check_value: 0x01 check_mask: 0x0f

Warning: jtag.c:1117 jtag_read_buffer(): in_handler reported a failed check

Warning: jtag.c:1157 jtag_check_value(): value captured during scan didn’t pass the requested check: captured: 0x0f check_value: 0x01 check_mask: 0x0f

Warning: jtag.c:1117 jtag_read_buffer(): in_handler reported a failed check

Warning: jtag.c:1157 jtag_check_value(): value captured during scan didn’t pass the requested check: captured: 0x0f check_value: 0x01 check_mask: 0x0f

Warning: jtag.c:1117 jtag_read_buffer(): in_handler reported a failed check

Warning: jtag.c:1157 jtag_check_value(): value captured during scan didn’t pass the requested check: captured: 0x0f check_value: 0x01 check_mask: 0x0f

Warning: jtag.c:1117 jtag_read_buffer(): in_handler reported a failed check

Warning: jtag.c:1157 jtag_check_value(): value captured during scan didn’t pass the requested check: captured: 0x0f check_value: 0x01 check_mask: 0x0f

Warning: jtag.c:1117 jtag_read_buffer(): in_handler reported a failed check

Warning: jtag.c:1157 jtag_check_value(): value captured during scan didn’t pass the requested check: captured: 0x0f check_value: 0x01 check_mask: 0x0f

Warning: jtag.c:1117 jtag_read_buffer(): in_handler reported a failed check

Warning: jtag.c:1157 jtag_check_value(): value captured during scan didn’t pass the requested check: captured: 0x0f check_value: 0x01 check_mask: 0x0f

Warning: jtag.c:1117 jtag_read_buffer(): in_handler reported a failed check

I’ve tried flashmagic and phillips tool. The software cannot connect to the LPCboard via a serial connection. I am unable to establish a terminal connection to the device either.

I am assuming its dead. I’ve put an email into techsupport at sparkfun.

If your olimex lpc-p2148 is stuck…

I don’t think the board is operating as the schematic indicates. The 1,2 ISP switches do not do anything on my board. So, I had to physically make the jumps in pins myself. There was a problem with whatever was flashed in the device that was affecting jtag communications. I could not ever establish a clean connection. I was also unable to use flashmagic and lpc flash utility to flash the device via the serial connection. I suppose this is where the 1,2 ISP switches would come into play. But no combination of the physical switch settings or use of the DTR flag stuff in the applications would work.

Get a a jumper cable. Jump your BSL line to a nearby ground. Leave the 1,2 ISP switches in off position. Use flashmagic and it all works.

I did not go back and try the jtag flash mechanism, maybe later, it works with serial port and thats all I need to continue working.

flashmagic works everytime with the BSL jumper cable setup (on my windoze box - xp).

My primary dev machine is macbook pro. Here’s things I’ve noticed.

Do not use an un-powered usb hub with the arm-usb-ocd. It seems like the root of most of my issues.

If you get any error on the openocd call, don’t continue. It must establish a clean connection before trying any flashing or debugging.