I am having difficulty flashing a LPC-H2148 with the demo led app and I hope someone here will be able to see what I am doing wrong.
I am using a ARM-USB-OCD with eclipse. I suspect the board has had a previous bad flash but have no evidence of this.
I think the relevant errors are:
arm-elf-gbd.exe
failed writing file main.bin to flash bank 0 at offset 0x00000000
openocd-ftd2xx.exe
Error: arm7_9_common.c:561 arm7_9_execute_sys_speed(): timeout waiting for SYSCOMP & DBGACK, last DBG_STATUS: 0
Below is the order that I have done things and the output, all in probably far too much detail:
Output from building in Eclipse:
make -k all
“.assembling”
arm-elf-as -ahls -mapcs-32 -o crt.o crt.s > crt.lst
“.compiling”
arm-elf-gcc -I./ -c -fno-common -O0 -g main.c
“…linking”
arm-elf-ld -v -Map main.map -T2138_demo.cmd -o main.out crt.o main.o
GNU ld version 2.16.1
“…copying”
arm-elf-objcopy -O binary main.out main.bin
arm-elf-objdump -x --syms main.out > main.dmp
“…building hex”
arm-elf-objcopy -O ihex main.out main.hex
Connect ARM-USB-OCD to usb cable
Connect LPC-H2148 to usb cable (DBG_E and L_E jumbers are on)
Connect the JTAG cable
Run OpenOCD from Eclipse
Info: openocd.c:82 main(): Open On-Chip Debugger (2006-10-12 18:00 CEST)
Debug LPC2148_flash from Eclipse
Output from arm-elf-gbd.exe:
(gdb) target state: halted
target halted in Thumb state due to debug request, current mode: Undefined
cpsr: 0x600000fb pc: 0xfffffff0
flash ‘lpc2000’ found at 0x00000000
failed writing file main.bin to flash bank 0 at offset 0x00000000
flash program error
failed writing file main.bin to flash bank 0 at offset 0x00000000
flash program error
requesting target halt and executing a soft reset
Output from openocd-ftd2xx.exe:
Info: openocd.c:82 main(): Open On-Chip Debugger (2006-10-12 18:00 CEST)
Warning: arm7_9_common.c:842 arm7_9_halt(): target was already halted
Info: server.c:67 add_connection(): accepted ‘gdb’ connection from 0
Error: arm7_9_common.c:561 arm7_9_execute_sys_speed(): timeout waiting for SYSCOMP & DBGACK, last DBG_STATUS: 0
Warning: arm7_9_common.c:1963 arm7_9_write_memory(): memory write caused data abort (address: 0x40000020, size: 0x4, count: 0x3)
Error: armv4_5.c:186 armv4_5_mode_to_number(): invalid mode value encountered
Error: arm7_9_common.c:972 arm7_9_debug_entry(): cpsr contains invalid mode value - communication failure
Warning: arm7_9_common.c:623 arm7_9_poll(): DBGACK set while target was in unknown state. Reset or initialize target before resuming