2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-27 04:08:27 +08:00

frontend: make coremgmt flash zynq-compatible

This commit is contained in:
occheung 2024-09-19 09:46:17 +08:00
parent 2b73d5a4c6
commit 5c21649d10
2 changed files with 40 additions and 31 deletions

View File

@ -208,6 +208,7 @@ class CommMgmt:
for filename in bin_paths:
with open(filename, "rb") as fi:
bin_ = fi.read()
if (len(bin_paths) > 1):
image_buf.write(struct.pack(self.endian + "I", len(bin_)))
image_buf.write(bin_)

View File

@ -94,6 +94,9 @@ def get_argparser():
t_flash = tools.add_parser("flash",
help="flash the running system")
p_zynq = t_flash.add_argument("-z", "--zynq", default=False,
help="target zynq device", action="store_true")
p_directory = t_flash.add_argument("directory", metavar="DIRECTORY", type=str,
help="directory that contains the binaries")
@ -160,6 +163,10 @@ def main():
mgmt.config_erase()
if args.tool == "flash":
if args.zynq:
boot = os.path.join(args.directory, "boot.bin")
bins = [ boot ]
else:
def artifact_path(this_binary_dir, *path_filename):
if args.srcbuild:
# source tree - use path elements to locate file
@ -194,6 +201,7 @@ def main():
firmware = firmwares[0]
bins = [ gateware, bootloader, firmware ]
mgmt.flash(bins)
if args.tool == "reboot":