Tools: added --no-extf option to uploader.py
needed for PX4 bootloader
This commit is contained in:
parent
e0d23c6495
commit
130f26c49a
@ -246,7 +246,8 @@ class uploader(object):
|
||||
target_system=None,
|
||||
target_component=None,
|
||||
source_system=None,
|
||||
source_component=None):
|
||||
source_component=None,
|
||||
no_extf=False):
|
||||
self.MAVLINK_REBOOT_ID1 = bytearray(b'\xfe\x21\x72\xff\x00\x4c\x00\x00\x40\x40\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\x53\x6b') # NOQA
|
||||
self.MAVLINK_REBOOT_ID0 = bytearray(b'\xfe\x21\x45\xff\x00\x4c\x00\x00\x40\x40\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\xcc\x37') # NOQA
|
||||
if target_component is None:
|
||||
@ -255,6 +256,7 @@ class uploader(object):
|
||||
source_system = 255
|
||||
if source_component is None:
|
||||
source_component = 1
|
||||
self.no_extf = no_extf
|
||||
|
||||
# open the port, keep the default timeout short so we can poll quickly
|
||||
self.port = serial.Serial(portname, baudrate_bootloader, timeout=2.0)
|
||||
@ -679,6 +681,9 @@ class uploader(object):
|
||||
self.board_type = self.__getInfo(uploader.INFO_BOARD_ID)
|
||||
self.board_rev = self.__getInfo(uploader.INFO_BOARD_REV)
|
||||
self.fw_maxsize = self.__getInfo(uploader.INFO_FLASH_SIZE)
|
||||
if self.no_extf:
|
||||
self.extf_maxsize = 0
|
||||
else:
|
||||
try:
|
||||
self.extf_maxsize = self.__getInfo(uploader.INFO_EXTF_SIZE)
|
||||
except Exception:
|
||||
@ -1062,6 +1067,7 @@ def main():
|
||||
)
|
||||
parser.add_argument('--download', action='store_true', default=False, help='download firmware from board')
|
||||
parser.add_argument('--identify', action="store_true", help="Do not flash firmware; simply dump information about board")
|
||||
parser.add_argument('--no-extf', action="store_true", help="Do not attempt external flash operations")
|
||||
parser.add_argument('--erase-extflash', type=lambda x: int(x, 0), default=None,
|
||||
help="Erase sectors containing specified amount of bytes from ext flash")
|
||||
parser.add_argument('firmware', nargs="?", action="store", default=None, help="Firmware file to be uploaded")
|
||||
@ -1100,7 +1106,8 @@ def main():
|
||||
args.target_system,
|
||||
args.target_component,
|
||||
args.source_system,
|
||||
args.source_component)
|
||||
args.source_component,
|
||||
args.no_extf)
|
||||
|
||||
except Exception as e:
|
||||
if not is_WSL:
|
||||
|
Loading…
Reference in New Issue
Block a user