From 38c5ae5b60eae9562b97da42f47af3861847f8e5 Mon Sep 17 00:00:00 2001 From: Julian Blake Kongslie Date: Sun, 8 May 2022 15:51:35 -0700 Subject: *Proper* serial port for memory downloads. 115200 8O2 RS232 with CRTRTS. --- tool/download.tcl | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 tool/download.tcl (limited to 'tool/download.tcl') diff --git a/tool/download.tcl b/tool/download.tcl new file mode 100755 index 0000000..c0dca55 --- /dev/null +++ b/tool/download.tcl @@ -0,0 +1,33 @@ +#!/usr/bin/env expect + +set timeout 3600 + +set core 0 +set wordsperline 1 + +if {$::argc > 1} { + set core [lindex $::argv 0] + set wordsperline [lindex $::argv 1] +} elseif {$::argc > 0} { + set core [lindex $::argv 0] +} + +spawn tool/connect + +send "@[format %x [expr $core * 32768 / $wordsperline]]\n" + +while {[gets stdin line] >= 0} { + send "$line\n" + expect -ex "$line\n" +} + +# 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 "\n~." +wait -- cgit v1.2.3