diff options
author | Andrew Tridgell <andrew@tridgell.net> | 2015-03-05 22:05:17 +1100 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2015-03-07 09:45:51 +0100 |
commit | d9b4f5b170b808af6a92b4a474e3115628670196 (patch) | |
tree | c093f35ca3aeb24075cb1d1efe9f80dc9601c191 | |
parent | 9495ec4f5af535b3873193835daa12e890bf1397 (diff) | |
download | px4-firmware-d9b4f5b170b808af6a92b4a474e3115628670196.tar.gz px4-firmware-d9b4f5b170b808af6a92b4a474e3115628670196.tar.bz2 px4-firmware-d9b4f5b170b808af6a92b4a474e3115628670196.zip |
px_loader: added --force option
this can be used to override the board type check. Useful when
changing bootloaders
-rwxr-xr-x | Tools/px_uploader.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Tools/px_uploader.py b/Tools/px_uploader.py index 859c821e5..686f01190 100755 --- a/Tools/px_uploader.py +++ b/Tools/px_uploader.py @@ -416,7 +416,12 @@ class uploader(object): def upload(self, fw): # Make sure we are doing the right thing if self.board_type != fw.property('board_id'): - raise IOError("Firmware not suitable for this board") + msg = "Firmware not suitable for this board (board_type=%u board_id=%u)" % ( + self.board_type, fw.property('board_id')) + if args.force: + print("WARNING: %s" % msg) + else: + raise IOError(msg) if self.fw_maxsize < fw.property('image_size'): raise RuntimeError("Firmware image is too large for this board") @@ -486,6 +491,7 @@ else: parser = argparse.ArgumentParser(description="Firmware uploader for the PX autopilot system.") parser.add_argument('--port', action="store", required=True, help="Serial port(s) to which the FMU may be attached") parser.add_argument('--baud', action="store", type=int, default=115200, help="Baud rate of the serial port (default is 115200), only required for true serial ports.") +parser.add_argument('--force', action='store_true', default=False, help='Override board type check and continue loading') parser.add_argument('firmware', action="store", help="Firmware file to be uploaded") args = parser.parse_args() |