Hi guys!
I have been using a programming script that used to work flawlessly, but
since I upgraded to openocd HEAD, it does not. I hope somebody can help me
out with this.
My target is an lpc17xx (1764 to be precise).
Flashing the target only works if the code in the microcontroller has an
invalid checksum AND the target has been reset. If trying to flash while
the code is valid, the flash is only erased (0xFFFFFF everywhere), but the
new code is not uploaded. After this, and a reset, the next programming
works fine...
My script is the following:
$OPENOCD -f $CFG -s $TCL \
-c "init" \
-c "adapter_khz 666" \
-c "reset init" \
-c "halt" \
-c "wait_halt 1000" \
-c "mww 0x400FC040 1" \ <---- this is supposed to disable boot
rom mapping to address 0
-c "flash write_image erase unlock tmp.bin 0x0 bin" \
-c "reset run" \
-c "exit"
The configuration file is:
akos@fm12bq:~/projects/c/openocd$ cat openocd-jtag.cfg
source [find interface/iqprogrammer.cfg]
source [find target/lpc1764.cfg]
adapter_khz 600
Where the files are:
lpc1764.cfg is from git.
iqprogrammer.cfg (actually a kt-link clone)
#
# Kristech KT-Link
#
# http://www.kristech.eu
#
interface ft2232
ft2232_vid_pid 0x0403 0x6010
ft2232_layout ktlink
Output is:akos@fm12bq:~/projects/ARM/devkittest/Debug$ jtagburn
devkittest.elf
/bin/jtagburn: 16: [: missing ]
Open On-Chip Debugger 0.7.0-dev-00053-g4a5dc09-dirty (2012-10-25-00:31)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.sourceforge.net/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
adapter_nsrst_delay: 200
adapter speed: 10 kHz
cortex_m3 reset_config vectreset
adapter speed: 600 kHz
Info : max TCK change to: 30000 kHz
Info : clock speed 600 kHz
Info : JTAG tap: lpc1764.cpu tap/device found: 0x4ba00477 (mfg: 0x23b,
part: 0xba00, ver: 0x4)
Info : lpc1764.cpu: hardware has 6 breakpoints, 4 watchpoints
adapter speed: 666 kHz
Info : JTAG tap: lpc1764.cpu tap/device found: 0x4ba00477 (mfg: 0x23b,
part: 0xba00, ver: 0x4)
Warn : Only resetting the Cortex-M3 core, use a reset-init event handler to
reset any peripherals or configure hardware srst support.
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
auto erase enabled
auto unlock enabled
wrote 32768 bytes from file tmp.bin in 3.405492s (9.397 KiB/s)
Info : JTAG tap: lpc1764.cpu tap/device found: 0x4ba00477 (mfg: 0x23b,
part: 0xba00, ver: 0x4)
Warn : Only resetting the Cortex-M3 core, use a reset-init event handler to
reset any peripherals or configure hardware srst support.
Error: lpc1764.cpu -- clearing lockup after double fault
target state: halted
target halted due to debug-request, current mode: Handler HardFault
xPSR: 0x01000003 pc: 0xfffffffe msp: 0xffffffd8
Polling target failed, GDB will be halted. Polling again in 100ms
Regards,
Ákos Vandra
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel