forked from M-Labs/artiq
artiq_flash: determine which firmware to flash by looking at filesystem
Closes #1719
This commit is contained in:
parent
5cd721c514
commit
4fb8ea5b73
|
@ -446,13 +446,17 @@ def main():
|
||||||
storage_img = args.storage
|
storage_img = args.storage
|
||||||
programmer.write_binary(*config["storage"], storage_img)
|
programmer.write_binary(*config["storage"], storage_img)
|
||||||
elif action == "firmware":
|
elif action == "firmware":
|
||||||
if variant.endswith("satellite"):
|
firmware_fbis = []
|
||||||
firmware = "satman"
|
for firmware in "satman", "runtime":
|
||||||
else:
|
filename = artifact_path(variant_dir, "software", firmware, firmware + ".fbi")
|
||||||
firmware = "runtime"
|
if os.path.exists(filename):
|
||||||
|
firmware_fbis.append(filename)
|
||||||
firmware_fbi = artifact_path(variant_dir, "software", firmware, firmware + ".fbi")
|
if not firmware_fbis:
|
||||||
programmer.write_binary(*config["firmware"], firmware_fbi)
|
raise FileNotFoundError("no firmware found")
|
||||||
|
if len(firmware_fbis) > 1:
|
||||||
|
raise ValueError("more than one firmware file, please clean up your build directory. "
|
||||||
|
"Found firmware files: {}".format(" ".join(firmware_fbis)))
|
||||||
|
programmer.write_binary(*config["firmware"], firmware_fbis[0])
|
||||||
elif action == "load":
|
elif action == "load":
|
||||||
if args.target == "sayma":
|
if args.target == "sayma":
|
||||||
gateware_bit = artifact_path(variant_dir, "gateware", "top.bit")
|
gateware_bit = artifact_path(variant_dir, "gateware", "top.bit")
|
||||||
|
|
Loading…
Reference in New Issue