From 2e40546a8895758750435356ea359b98f69bfad3 Mon Sep 17 00:00:00 2001 From: bunnie Date: Mon, 4 Oct 2021 16:30:41 +0800 Subject: [PATCH] add a force overwrite option to the updater for the soc mode --- tools/usb_update.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tools/usb_update.py b/tools/usb_update.py index 7f187c780..ad4fd68c9 100755 --- a/tools/usb_update.py +++ b/tools/usb_update.py @@ -450,7 +450,7 @@ def main(): LOC_AUDIO = 0x06340000 LEN_AUDIO = 0x01C40000 elif args.force == True: - # try the v0.8 offsets + # try the v0.9 offsets LOC_SOC = 0x00000000 LOC_STAGING= 0x00280000 LOC_LOADER = 0x00500000 @@ -507,13 +507,19 @@ def main(): pc_usb.flash_program(LOC_LOADER, image, verify=verify) if args.soc != None: - print("This will overwrite any secret keys in your device. Continue? (y/n)") - confirm = input() - if len(confirm) > 0 and confirm.lower()[:1] == 'y': + if args.force == True: print("Programming SoC gateware {}".format(args.soc)) with open(args.soc, "rb") as f: image = f.read() pc_usb.flash_program(LOC_SOC, image, verify=verify) + else: + print("This will overwrite any secret keys in your device. Continue? (y/n)") + confirm = input() + if len(confirm) > 0 and confirm.lower()[:1] == 'y': + print("Programming SoC gateware {}".format(args.soc)) + with open(args.soc, "rb") as f: + image = f.read() + pc_usb.flash_program(LOC_SOC, image, verify=verify) if args.audiotest != None: print("Loading audio test clip {}".format(args.audiotest))