summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2013-07-25 20:08:12 (GMT)
committerChristian Pointner <equinox@spreadspace.org>2013-07-25 20:08:12 (GMT)
commit842ab9ffa0a0f36314c6421ab12af9cc9e95f622 (patch)
tree9ca7d455422b213cdc28e764856aa37e89d68408
parent3bd2d8d4c94ab3903995f203504220549cf945e8 (diff)
the downloader now sends a reset pulse an asserts TxD low before sending 'identify'
git-svn-id: https://svn.spreadspace.org/pic/trunk@91 a09c6847-51d9-44de-8ef2-e725cf50f3c7
-rwxr-xr-xbootloader/downloader.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/bootloader/downloader.py b/bootloader/downloader.py
index cff9865..12e9644 100755
--- a/bootloader/downloader.py
+++ b/bootloader/downloader.py
@@ -87,6 +87,7 @@ def create_flash_segments(hexdata, fs, fss):
def open_serial(device, baud):
import serial
+ import time
print >> sys.stderr, "opening %s (%s Baud)" % (device, baud)
@@ -94,6 +95,12 @@ def open_serial(device, baud):
dev = serial.Serial(port=device, baudrate=baud, timeout=3)
dev.flushInput()
dev.flushOutput()
+ dev.setDTR(True) # send a reset pulse
+ dev.setBreak(True) # boot into bootloader
+ time.sleep(0.1)
+ dev.setDTR(False)
+ time.sleep(0.01)
+ dev.setBreak(False)
return dev
except (ValueError, serial.SerialException), msg: