I'm using Akos Vandra's lpc17xx scripts with a recent git checkout of
OpenOCD with an lpc1766 board. Flashing seems to partially work but the
image doesn't verify. This makes me think that I have something wrong with
my clock but no value of adapter_khz seems to make it flash correctly.
Here's what I'm seeing when I try to flash. I disabled all PLL manipulation
in order to be relatively sure that the board is waking up a 4MHz. I think
this means that I'd be safe using adapter_khz of 333 or so. The adapter is
an Olimex ARM-USB-OCD.

(gdb) flash
JTAG tap: lpc1766.cpu tap/device found: 0x4ba00477 (mfg: 0x23b, part:
0xba00, ver: 0x4)
Only resetting the Cortex-M3 core, use a reset-init event handler to reset
any peripherals
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x80000684 msp: 0x10007ff0
wrote 2508 bytes from file app.bin in 4.439107s (0.552 KiB/s)
checksum mismatch - attempting binary compare
diff 0 address 0x00000004. Was 0x85 instead of 0xc5
diff 1 address 0x00000007. Was 0x80 instead of 0x00
diff 2 address 0x00000008. Was 0xc9 instead of 0xd9
diff 3 address 0x0000000c. Was 0xc9 instead of 0xe9
diff 4 address 0x00000010. Was 0xe9 instead of 0xf9
diff 5 address 0x00000015. Was 0x06 instead of 0x07
[clipped]

Here is .gdbinit.

target remote localhost:3333
symbol-file app.elf
monitor poll on

define syms
    symbol-file app.elf
end

define flash
    #monitor soft_reset_halt
    monitor reset halt
    #monitor flash write_image app.elf
    monitor flash write_image app.bin 0x0 bin
    monitor verify_image app.bin 0x0 bin
    symbol-file app.elf
    monitor reset init
end

define reboot
    monitor reset init
    continue
end
EOF

And here is openocd.cfg.

#set CCLK 96000

source [find interface/olimex-arm-usb-ocd.cfg]
source [find target/lpc1766.cfg]
puts [format "_TARGETNAME = %s" $_TARGETNAME]

adapter_khz 50

gdb_breakpoint_override hard
lpc1766.cpu configure -event reset-init {
    puts [format "reset init = %d" 1]
    mww 0x400FC040 0x01
    mdw 0x400FC040
}

lpc1766.cpu configure -event gdb-attach {
    mww 0x400FC040 0x01
    mdw 0x400FC040
}
EOF

Any help appreciated.

   ks
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to