Tools: fixed uploader.py for px4 bootloader

by fetching ext flash info before we get IDs the bootloader is left in
a state where it accepts an erase and upload
This commit is contained in:
Andrew Tridgell 2021-10-25 12:12:23 +11:00
parent 350de066a5
commit dfd2686878
1 changed files with 5 additions and 3 deletions

View File

@ -682,9 +682,6 @@ class uploader(object):
print("Unsupported bootloader protocol %d" % self.bl_rev)
raise RuntimeError("Bootloader protocol mismatch")
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:
@ -693,6 +690,11 @@ class uploader(object):
except Exception:
print("Could not get external flash size, assuming 0")
self.extf_maxsize = 0
self.__sync()
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)
def dump_board_info(self):
# OTP added in v4: