diff options
| author | Julian Blake Kongslie | 2022-05-08 15:51:35 -0700 |
|---|---|---|
| committer | Julian Blake Kongslie | 2022-05-08 15:51:35 -0700 |
| commit | 38c5ae5b60eae9562b97da42f47af3861847f8e5 (patch) | |
| tree | 556fd9e5c38fb2feea56ce5741ca02a5e110ad63 /tool/download.tcl | |
| parent | Make the script for setting up the TTY actually connect. (diff) | |
| download | multipdp8-38c5ae5b60eae9562b97da42f47af3861847f8e5.tar.xz | |
*Proper* serial port for memory downloads. 115200 8O2 RS232 with CRTRTS.
Diffstat (limited to 'tool/download.tcl')
| -rwxr-xr-x | tool/download.tcl | 33 |
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 | |||
| 3 | set timeout 3600 | ||
| 4 | |||
| 5 | set core 0 | ||
| 6 | set wordsperline 1 | ||
| 7 | |||
| 8 | if {$::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 | |||
| 15 | spawn tool/connect | ||
| 16 | |||
| 17 | send "@[format %x [expr $core * 32768 / $wordsperline]]\n" | ||
| 18 | |||
| 19 | while {[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. | ||
| 27 | send "?" | ||
| 28 | expect -ex "?" | ||
| 29 | send "?" | ||
| 30 | expect -ex "?" | ||
| 31 | |||
| 32 | send "\n~." | ||
| 33 | wait | ||
