From f747a526b97b29a0479c62c4ecea285f1f5f2fde Mon Sep 17 00:00:00 2001 From: Julian Blake Kongslie Date: Sun, 13 Mar 2022 16:51:03 -0700 Subject: Change command parser to support bulk download script. --- download.tcl | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 download.tcl (limited to 'download.tcl') diff --git a/download.tcl b/download.tcl new file mode 100755 index 0000000..2e64865 --- /dev/null +++ b/download.tcl @@ -0,0 +1,28 @@ +#!/usr/bin/env expect + +set core 0 + +if {$::argc > 0} { + set core [lindex $::argv 0] +} + +spawn nios2-terminal --instance 0 +expect -ex "connected to hardware target" + +send "@[format %x [expr $core * 32768]]\n" + +while {[gets stdin line] >= 0} { + send "$line\n" + expect -ex "$line" +} + +# It's likely we ended with a very large zero-memory operation. We want to see +# two command bytes echoed back to us in order to guarantee that the zero +# operation has completely flushed to memory. +send "?" +expect -ex "?" +send "?" +expect -ex "?" + +send "\004" +expect -ex "exiting due to ^D on remote" -- cgit v1.2.3