Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tools: uploader.py: verify correct install #29164

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions Tools/scripts/uploader.py
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,20 @@ def board_name_for_board_id(self, board_id):
print("Failed to get name: %s" % str(e))
return None

# verify the firmware
def verify(self, fw, force=False, boot_delay=None):
if self.bl_rev == 2:
self.__verify_v2("Verify ", fw)
else:
self.__verify_v3("Verify ", fw)

if boot_delay is not None:
self.__set_boot_delay(boot_delay)

print("\nRebooting.\n")
self.__reboot()
self.port.close()

# upload the firmware
def upload(self, fw, force=False, boot_delay=None):
# Make sure we are doing the right thing
Expand Down Expand Up @@ -1120,6 +1134,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('--verify', action="store_true", help="Do not flash firmware; simply verify the firmware, if 0 then all ok")
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")
Expand Down Expand Up @@ -1183,6 +1198,8 @@ def main():
up.dump_board_info()
elif args.download:
up.download(args.firmware)
elif args.verify:
up.verify(fw, force=args.force, boot_delay=args.boot_delay)
elif args.erase_extflash:
up.erase_extflash('Erase ExtF', args.erase_extflash)
print("\nExtF Erase Finished")
Expand Down
Loading