Hi!
I am using a kt-link interface with the new mpsse drivers.
I am trying to write a programming script for the lpc17xx devices
(which I will be more than happy to share if ready), that basically
does this:
(1. reset the target)
2. halt the target
3. configure pll for max cpu frequency (100MHz)
4. write a file to flash.
However as soon as I start to mendle with the PLL registers, openocd
loses connection. IMHO it shouldn't as the CPU can handle disabling
the PLL mid-run, and from the uC code it works.
What I do, is I write 0 to the PLL0CON register bit, which should
route the non-plled clock source to the CPU frequency. After that I
would disable the pll entirely before setting it up with the new
values, but the script never reaches that point.
My script basically calls this function:
proc program { } {
adapter_khz 100
# jtag_reset 0 1
reset halt
# halt 0
# jtag_reset 0 0
# wait_halt
mdw 0x400FC084
mdw 0x400FC088
echo bypassing
#Bypass PLL if in use
mww 0x400FC080 0x00000001; # /* PLL0 Disconnect */
mww 0x400FC08C 0xAA; #FEED_seq_0
mww 0x400FC08C 0x55; #FEED_seq_1
echo X
sleep 1000
echo Y
mww 0x400FC080 0x00000000; # /* PLL0 Disable */
mww 0x400FC08C 0xAA; #FEED_seq_0
mww 0x400FC08C 0x55; #FEED_seq_1
echo done
(...........)
akos@FM12BQ:~/Downloads/_openocd/openocd$ src/openocd -f openocd.cfg
-s tcl -c init -c program
Open On-Chip Debugger 0.6.0-dev-00557-g61d38c5-dirty (2012-05-21-22:38)
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
10 kHz
666 kHz
Info : clock speed 666 kHz
Info : JTAG tap: lpc1768.cpu tap/device found: 0x4ba00477 (mfg: 0x23b,
part: 0xba00, ver: 0x4)
Info : lpc1768.cpu: hardware has 6 breakpoints, 4 watchpoints
100 kHz
Info : JTAG tap: lpc1768.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
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x1fff0080 msp: 0x10001ffc
0x400fc084: 0006010e
0x400fc088: 0706010e
bypassing
Feed
Polling target failed, GDB will be halted. Polling again in 100ms
X
Polling target failed, GDB will be halted. Polling again in 300ms
Polling target failed, GDB will be halted. Polling again in 700ms
Polling target failed, GDB will be halted. Polling again in 1500ms
Polling target failed, GDB will be halted. Polling again in 3100ms
Polling target failed, GDB will be halted. Polling again in 6300ms
Polling target failed, GDB will be halted. Polling again in 6300ms
Y
Warn : Block read error address 0x400fc084
Runtime Error: openocd.cfg:26:
in procedure 'program'
in procedure 'mdw' called at file "openocd.cfg", line 26
akos@FM12BQ:~/Downloads/_openocd/openocd$
------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel