summaryrefslogtreecommitdiff
path: root/tool/download.tcl
diff options
context:
space:
mode:
authorJulian Blake Kongslie2022-05-08 15:51:35 -0700
committerJulian Blake Kongslie2022-05-08 15:51:35 -0700
commit38c5ae5b60eae9562b97da42f47af3861847f8e5 (patch)
tree556fd9e5c38fb2feea56ce5741ca02a5e110ad63 /tool/download.tcl
parentMake the script for setting up the TTY actually connect. (diff)
downloadmultipdp8-38c5ae5b60eae9562b97da42f47af3861847f8e5.tar.xz
*Proper* serial port for memory downloads. 115200 8O2 RS232 with CRTRTS.
Diffstat (limited to 'tool/download.tcl')
-rwxr-xr-xtool/download.tcl33
1 files changed, 33 insertions, 0 deletions
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 @@
1#!/usr/bin/env expect
2
3set timeout 3600
4
5set core 0
6set wordsperline 1
7
8if {$::argc > 1} {
9 set core [lindex $::argv 0]
10 set wordsperline [lindex $::argv 1]
11} elseif {$::argc > 0} {
12 set core [lindex $::argv 0]
13}
14
15spawn tool/connect
16
17send "@[format %x [expr $core * 32768 / $wordsperline]]\n"
18
19while {[gets stdin line] >= 0} {
20 send "$line\n"
21 expect -ex "$line\n"
22}
23
24# It's likely we ended with a very large zero-memory operation. We want to see
25# two command bytes echoed back to us in order to guarantee that the zero
26# operation has completely flushed to memory.
27send "?"
28expect -ex "?"
29send "?"
30expect -ex "?"
31
32send "\n~."
33wait