forked from M-Labs/artiq
artiq_flash: do not suppress useful backtrace information
This commit is contained in:
parent
f2cc2a5ff2
commit
eeedcfbdd7
@ -327,46 +327,43 @@ def main():
|
||||
atexit.register(lambda: os.unlink(bin_filename))
|
||||
return bin_filename
|
||||
|
||||
try:
|
||||
for action in args.action:
|
||||
if action == "gateware":
|
||||
gateware_bin = convert_gateware(
|
||||
artifact_path(variant, "gateware", "top.bit"))
|
||||
programmer.write_binary(*config["gateware"], gateware_bin)
|
||||
if args.target == "sayma":
|
||||
rtm_gateware_bin = convert_gateware(
|
||||
artifact_path("rtm_gateware", "rtm.bit"), header=True)
|
||||
programmer.write_binary(*config["rtm_gateware"],
|
||||
rtm_gateware_bin)
|
||||
elif action == "bootloader":
|
||||
bootloader_bin = artifact_path(variant, "software", "bootloader", "bootloader.bin")
|
||||
programmer.write_binary(*config["bootloader"], bootloader_bin)
|
||||
elif action == "storage":
|
||||
storage_img = args.storage
|
||||
programmer.write_binary(*config["storage"], storage_img)
|
||||
elif action == "firmware":
|
||||
if variant == "satellite":
|
||||
firmware = "satman"
|
||||
else:
|
||||
firmware = "runtime"
|
||||
|
||||
firmware_fbi = artifact_path(variant, "software", firmware, firmware + ".fbi")
|
||||
programmer.write_binary(*config["firmware"], firmware_fbi)
|
||||
elif action == "load":
|
||||
if args.target == "sayma":
|
||||
rtm_gateware_bit = artifact_path("rtm_gateware", "rtm.bit")
|
||||
programmer.load(rtm_gateware_bit, 0)
|
||||
gateware_bit = artifact_path(variant, "gateware", "top.bit")
|
||||
programmer.load(gateware_bit, 1)
|
||||
else:
|
||||
gateware_bit = artifact_path(variant, "gateware", "top.bit")
|
||||
programmer.load(gateware_bit, 0)
|
||||
elif action == "start":
|
||||
programmer.start()
|
||||
for action in args.action:
|
||||
if action == "gateware":
|
||||
gateware_bin = convert_gateware(
|
||||
artifact_path(variant, "gateware", "top.bit"))
|
||||
programmer.write_binary(*config["gateware"], gateware_bin)
|
||||
if args.target == "sayma":
|
||||
rtm_gateware_bin = convert_gateware(
|
||||
artifact_path("rtm_gateware", "rtm.bit"), header=True)
|
||||
programmer.write_binary(*config["rtm_gateware"],
|
||||
rtm_gateware_bin)
|
||||
elif action == "bootloader":
|
||||
bootloader_bin = artifact_path(variant, "software", "bootloader", "bootloader.bin")
|
||||
programmer.write_binary(*config["bootloader"], bootloader_bin)
|
||||
elif action == "storage":
|
||||
storage_img = args.storage
|
||||
programmer.write_binary(*config["storage"], storage_img)
|
||||
elif action == "firmware":
|
||||
if variant == "satellite":
|
||||
firmware = "satman"
|
||||
else:
|
||||
raise ValueError("invalid action", action)
|
||||
except FileNotFoundError as e:
|
||||
raise SystemExit(e)
|
||||
firmware = "runtime"
|
||||
|
||||
firmware_fbi = artifact_path(variant, "software", firmware, firmware + ".fbi")
|
||||
programmer.write_binary(*config["firmware"], firmware_fbi)
|
||||
elif action == "load":
|
||||
if args.target == "sayma":
|
||||
rtm_gateware_bit = artifact_path("rtm_gateware", "rtm.bit")
|
||||
programmer.load(rtm_gateware_bit, 0)
|
||||
gateware_bit = artifact_path(variant, "gateware", "top.bit")
|
||||
programmer.load(gateware_bit, 1)
|
||||
else:
|
||||
gateware_bit = artifact_path(variant, "gateware", "top.bit")
|
||||
programmer.load(gateware_bit, 0)
|
||||
elif action == "start":
|
||||
programmer.start()
|
||||
else:
|
||||
raise ValueError("invalid action", action)
|
||||
|
||||
if args.dry_run:
|
||||
print("\n".join(programmer.script()))
|
||||
|
Loading…
Reference in New Issue
Block a user