69 Commits

Author SHA1 Message Date
Lorenz Meier
9e312e8dba Uploader: Do not show timeout for larger binaries when everything is still as expected. 2017-08-13 11:36:12 +02:00
Julien Lecoeur
38fff6546d Fix python 3 compatibility in px_uploader.py 2017-06-08 07:57:00 +02:00
Lorenz Meier
5f4fb744ca Uploader: Signal GCS or other connected devices that a FiFirmware upload is pending and requires device access. 2017-06-05 22:44:21 +02:00
Julian Oes
e9aef2eb95 px_uploader.py: properly loop through all baudrates
In case when the baudrate change failed, we should still try that
baudrate again in the next iteration.
2017-04-22 08:00:51 +02:00
Julian Oes
2467297acf px_uploader.py: fix exception on baudrate change
This prevents an exception happening inside the serial stack.
2017-04-22 08:00:51 +02:00
Julian Oes
12c7421be9 px_uploader.py: remove unused exception vars 2017-02-27 11:23:09 +01:00
Julian Oes
974a9a0673 px_uploader.py: enable file to be used as module
In order to use px_uploader as a module from another Python script, all
the action needs to be moved into a main() function which is only called
if the file is run directly.
2017-02-27 11:23:09 +01:00
Julian Oes
090d7ebd6b px_uploader: fix SerialException error
Sometimes right after reboot, we got a `raise SerialException(
msg.errno, "could not open port {}: {}".format(self._port, msg))`.
If this happens now, we will just try again later.
2017-02-27 11:23:09 +01:00
Julian Oes
b0a8073e15 px_uploader.py: small whitespace fix
Found by PEP8 checker.
2017-02-27 11:23:09 +01:00
Julian Oes
ff87d43be0 px_uploader.py: vim modeline for indent settings 2017-02-27 11:23:09 +01:00
Julian Oes
172f35042f px_uploader.py: use consistent indenting
This file had the indentending mixed up between 4 and 8 spaces.
This changes it to the Pythonic way of 4 spaces.
2017-02-27 11:23:09 +01:00
Lorenz Meier
495e16d510 Uploader script: Fix Python 2 issue and timing corner case on Mac OS, both in a robust fashion 2017-02-17 22:28:14 +01:00
Lucas De Marchi
f9795ccbab px_uploader: support multiple baud rates
We may need to change the baud rate from one version to the other.
Allowing the script to try multiple baud rates makes the transition a
little bit less painful.

This also fixes a bug in which it would go the next port before trying
to identify the board after asking it to reboot.
2017-02-16 09:35:23 +01:00
Julian Oes
c91b36bf1f px_uploader.py: try to follow PEP8 (#6278)
This fixes some non-Pythonic things and unneccessary semicolons.

Still to fix are line-length and multiple spaces before operators.
2017-01-12 02:51:06 -05:00
Julian Oes
d57e9f13d7 px_uploader.py: catch exception in except block
This could lead to an exception if serial is not available.
2016-10-20 23:18:56 +02:00
Julian Oes
d1822699a9 px_uploader.py: remove unused variable 2016-10-20 23:18:56 +02:00
Julian Oes
a14c565ab1 px_uploader.py: trailing whitespace 2016-10-20 23:18:56 +02:00
José Roberto de Souza
b9728ecf39 Uploader tool: Add option to set different baudrates for bootloader and flight stack
By default the baudrate in flight stack (Mavlink or NSH) 57600 and the default
baudrate of bootloader is 115200. So we may need to set different
baudrates.
2016-10-05 11:25:14 +02:00
José Roberto de Souza
7e0946466e Uploader tool: Reboot board and keep it in bootloader
The Mavlink reboot messages was only requesting the board to reboot.
If the flashed bootloader has a small or no timeout user will
never be able to update firmware.
2016-10-05 11:25:14 +02:00
Lorenz Meier
71fd4b9e98 Uploader tool: Try MAVLink reboot command first 2016-09-17 23:49:41 +02:00
Lorenz Meier
f918b0c992 Uploader: Make sure to warn about wrong board type 2016-01-21 09:34:54 +01:00
David Sidrane
923a43b67f Support for Rev 5 of Bootloader 2015-12-04 13:10:29 -10:00
Andrew Tridgell
2c2359dcf0 px_uploader.py: added --boot-delay option
this sets the bootloader delay
2015-03-14 21:12:21 +11:00
Andrew Tridgell
332d42b105 px_uploader: print chip version 2015-03-07 09:46:27 +01:00
Andrew Tridgell
d9b4f5b170 px_loader: added --force option
this can be used to override the board type check. Useful when
changing bootloaders
2015-03-07 09:45:51 +01:00
Lorenz Meier
200f0e9a93 Better error handling for multi-board setups 2015-03-02 23:05:03 +01:00
Lorenz Meier
a31fccb0b0 Uploader: Fix flashing if multiple board types are connected 2015-03-02 22:36:48 +01:00
Lorenz Meier
6d2e8b9d08 Reduce delay between board search attempts, code style 2015-02-26 13:07:43 +01:00
Johan Jansen
74177a2688 px4_uploader: Push program bytes faster by using bigger blocks 2015-02-26 11:14:54 +01:00
Johan Jansen
a8f9caaaa5 px4_uploader: Prevent spin-lock from hogging CPU 2015-02-26 11:14:06 +01:00
Simon Wilks
0a99a26fcc Cleanup uploader output. 2015-01-19 16:51:08 +01:00
Johan Jansen
11469ad9b5 px_uploader: Small fix to properly display timeouts 2015-01-12 12:25:30 +01:00
Johan Jansen
1eda1f816b px_uploader: Minor code cleanup 2015-01-08 16:30:47 +01:00
Johan Jansen
2aa7b3038a px_uploader: Added progress bar for erasing and uploading firmware 2015-01-08 13:18:50 +01:00
Lorenz Meier
8e8dd62fbd Let the uploader print the binary size 2014-11-15 13:49:06 +01:00
Lorenz Meier
72977ee909 Better error handling instructions 2014-11-02 22:13:59 +01:00
Lorenz Meier
44a2473632 Fix up reboot logic 2014-11-02 22:03:49 +01:00
Lorenz Meier
5862f4ffe6 Fix error handling 2014-11-02 22:00:42 +01:00
Lorenz Meier
166580b8f7 Time out on serial instead of just hanging there 2014-11-02 21:41:55 +01:00
Lorenz Meier
9825ed8f3c Attempt at fixing programming timeouts 2014-08-25 10:21:26 +02:00
Lorenz Meier
3f4aef60c8 Increase timeout in an attempt to prevent timout python failure 2014-08-12 08:21:38 +02:00
Lorenz Meier
d6999384ce Improve modem manager warning to avoid having smart people tell us we have Linux compatibility issues while we actually do not. 2014-07-08 11:42:46 +02:00
Andrew Tridgell
0785512026 px_uploader: added ModemManager warning 2014-07-08 11:41:04 +02:00
Andrew Tridgell
ec2197fd1b uploader: ignore bad character encodings for older bootloaders
this prevents the uploader from throwing an exception with older
bootloaders
2014-04-05 12:07:27 +02:00
Lorenz Meier
70964dd87c Update upload script from bootloader repo 2014-02-09 18:34:54 +01:00
Lorenz Meier
080b2da214 Updated uploader from Bootloader repo 2014-02-05 14:24:01 +01:00
Julian Oes
dcfd5bdbe7 Python uploader: Ignore exceptions when sending reboot tries 2013-12-02 23:07:36 +01:00
Lorenz Meier
8aaf285ac5 Python exception handling from muggenhor 2013-10-13 12:38:26 +02:00
Andrew Tridgell
1f19a27e3c make upload on Linux much more reliable
Upload on Linux now only tries usb-3D_Robotics boards. This should
also make it handle more ports on MacOS
2013-09-12 00:47:08 +02:00
Lorenz Meier
57769ec437 Reducing timeout to 0.5 seconds 2013-09-10 14:09:09 +02:00