Hi
I use openocd 0.2 to programm an aduc702x. I’m using the ftd2xx driver with OS X.
When I try to run code I get this error:
monitor reg pc 0x00000000
pc (/32): 0x00000000
monitor gdb_breakpoint_override hard
force hard breakpoints
thbreak main
Hardware assisted breakpoint 3 at 0x5a0: file …/main.c, line 20.
continue
Runtime error, file “/usr/local/arm/share/openocd/scripts/target/aduc702x.cfg”, line 0:
can’t read “watchdog_hdl”: no such variable
I haven’t used tcl yet so I don’t know exactly what to change in the target files. A hack is to comment out the line:
proc watchdog_service {} {
global watchdog_hdl
mww 0xffff036c 0
puts “watchdog!!”
set watchdog_hdl [after 500 watchdog_service]
}
Resulting in a warning message:
thbreak main
Hardware assisted breakpoint 3 at 0x5a0: file …/main.c, line 20.
continue
Runtime error, file “/usr/local/arm/share/openocd/scripts/target/aduc702x.cfg”, line 0:
can’t read “watchdog_hdl”: no such variable
main () at …/main.c:20
20 while (GP0DAT & 0x10) {
My next question is about writing to flash. OpenOCD now support writing to flash for aduc devices. I was able to write to flash without special support:
Set addresssize
set remoteaddresssize 32
#Increase Timeouts
set remotetimeout 999999
connect to openocd
target remote localhost:3333
stop mcu
monitor wait_halt
set arm mode
monitor armv4_5 core_state arm
mass erase flash
monitor mwh 0xFFFFF804 0x08
monitor mwb 0xFFFFF808 0x09
wait 3sec until flash has been erased
monitor sleep 5000
Speed up flash writing
set remote memory-write-packet-size 1024
set remote memory-write-packet-size fixed
set remote memory-read-packet-size 1024
set remote memory-read-packet-size fixed
map Flash to 0x0
monitor mww 0xFFFF0220 0x0
load code into flash
load
reset mcu
monitor reset
I use these commands in eclipse/gdb. The advantage of this way gdb know which file has to be loaded into flash. OpenOCD always requires the filename as argument. Is it possible to write to flash with openocd without filename as argument?
Is it faster than useing gdb?