|
Post by necromant on Feb 2, 2011 17:03:12 GMT -5
Okay. OpenOCD is cool, but I wanted to have a tool that could seamlessly flash evalbot with the firmware supplied as an argument. So I made use of expect. Make sure you have OpenOCD running, the fire this thing:
#In FreeBSD that's in /usr/local/bin/expect
#!/usr/bin/expect set timeout 60 set fw [lindex $argv 0] spawn telnet localhost 4444 expect ">" send "reset\n" expect ">" send "halt\n" expect ">" send "flash write_image erase $fw 0\n" expect ">" send "reset\n" expect ">" send "exit\n"
Usage: ./flash filename.bin
This will reset the CPU, halt, flash the new firmware and exit. Note the the path MUST be relative to the openocd daemon or the absolute one.
And here goes obligatory dump_flash tool, in case you want to backup your stock firmware.
#!/usr/bin/expect set timeout 60 set fw [lindex $argv 0] spawn telnet localhost 4444 expect ">" send "reset\n" expect ">" send "halt\n" expect ">" send "dump_image $fw 0 262144\n" expect ">" send "reset\n" expect ">" send "exit\n"
Usage: ./dump original.bin
|
|
|
Post by chemuduguntar on Feb 13, 2011 0:28:27 GMT -5
I got something like this using -c option on openocd. Only trouble still is that I have to run it as sudo which is annoying.
|
|