From cce1481facd17d29c1053921d20498d3a2ae98c8 Mon Sep 17 00:00:00 2001 From: whitequark Date: Tue, 7 Mar 2017 06:49:02 +0000 Subject: [PATCH] artiq_devtool: add hotswap action. --- artiq/frontend/artiq_devtool.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/artiq/frontend/artiq_devtool.py b/artiq/frontend/artiq_devtool.py index f242ce6e2..58cd8148f 100755 --- a/artiq/frontend/artiq_devtool.py +++ b/artiq/frontend/artiq_devtool.py @@ -44,7 +44,7 @@ def get_argparser(): parser.add_argument("actions", metavar="ACTION", type=str, default=[], nargs="+", help="actions to perform, sequence of: " - "build boot boot+log connect clean") + "build boot boot+log connect hotswap clean") return parser @@ -182,6 +182,17 @@ def main(): "{env} python3 flterm.py {serial} --output-only") drain(flterm) + elif action == "hotswap": + logger.info("Hotswapping firmware") + try: + subprocess.check_call(["python3", + "-m", "artiq.frontend.artiq_coreboot", + "/tmp/{target}/software/{firmware}/{firmware}.bin" + .format(target=args.target, firmware=firmware)]) + except subprocess.CalledProcessError: + logger.error("Build failed") + sys.exit(1) + else: logger.error("Unknown action {}".format(action)) sys.exit(1)