From e167e6bec49b680c89a52e60fe4053924b835299 Mon Sep 17 00:00:00 2001 From: Matthias Grob Date: Sun, 30 Sep 2018 18:32:45 +0200 Subject: [PATCH] px_uploader: catch non-standard baud exception to fix Cygwin upload. It failed silently but when catching it prints "non-standard baudrates are not supported on this platform". Discussion about platform independet FTDI detection is in issue #10429. --- Tools/px_uploader.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Tools/px_uploader.py b/Tools/px_uploader.py index 07dba0384a..cb164e8d91 100755 --- a/Tools/px_uploader.py +++ b/Tools/px_uploader.py @@ -336,7 +336,12 @@ class uploader(object): self.port.flushInput() # Set a baudrate that can not work on a real serial port # in that it is 233% off. - self.port.baudrate = self.baudrate_bootloader * 2.33 + try: + self.port.baudrate = self.baudrate_bootloader * 2.33 + except NotImplementedError as e: + # This error can occur because pySerial on Windows does not support odd baudrates + print(str(e) + " -> could not check for FTDI device, assuming USB connection") + return self.__send(uploader.GET_SYNC + uploader.EOC)