aboutsummaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2014-08-25 10:21:26 +0200
committerLorenz Meier <lm@inf.ethz.ch>2014-08-25 10:21:26 +0200
commit9825ed8f3cd037b8fd131a911ba350a29203ef0c (patch)
tree3def8e19ff6b5f8e8bc1e6d3cf8027ae3c3ac476 /Tools
parentff28b5e930dc07105b4e1f7b43ff3b9f7b09f7ac (diff)
downloadpx4-firmware-9825ed8f3cd037b8fd131a911ba350a29203ef0c.tar.gz
px4-firmware-9825ed8f3cd037b8fd131a911ba350a29203ef0c.tar.bz2
px4-firmware-9825ed8f3cd037b8fd131a911ba350a29203ef0c.zip
Attempt at fixing programming timeouts
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/px_uploader.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Tools/px_uploader.py b/Tools/px_uploader.py
index d8f4884bc..b46db00b5 100755
--- a/Tools/px_uploader.py
+++ b/Tools/px_uploader.py
@@ -178,9 +178,9 @@ class uploader(object):
MAVLINK_REBOOT_ID1 = bytearray(b'\xfe\x21\x72\xff\x00\x4c\x00\x00\x80\x3f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf6\x00\x01\x00\x00\x48\xf0')
MAVLINK_REBOOT_ID0 = bytearray(b'\xfe\x21\x45\xff\x00\x4c\x00\x00\x80\x3f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf6\x00\x00\x00\x00\xd7\xac')
- def __init__(self, portname, baudrate):
+ def __init__(self, portname, baudrate, interCharTimeout=0.001, timeout=0.5):
# open the port, keep the default timeout short so we can poll quickly
- self.port = serial.Serial(portname, baudrate, timeout=2.0)
+ self.port = serial.Serial(portname, baudrate)
self.otp = b''
self.sn = b''
@@ -195,7 +195,7 @@ class uploader(object):
def __recv(self, count=1):
c = self.port.read(count)
if len(c) < 1:
- raise RuntimeError("timeout waiting for data")
+ raise RuntimeError("timeout waiting for data (%u bytes)", count)
# print("recv " + binascii.hexlify(c))
return c