From b391598c879bd2c2cded53984f6c3dbf8cf900ec Mon Sep 17 00:00:00 2001 From: whitequark Date: Tue, 7 Mar 2017 14:37:08 +0000 Subject: [PATCH] artiq_devtool: add reset action. --- artiq/frontend/artiq_devtool.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/artiq/frontend/artiq_devtool.py b/artiq/frontend/artiq_devtool.py index 58cd8148f..644ae8913 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 hotswap clean") + "build reset boot boot+log connect hotswap clean") return parser @@ -117,6 +117,13 @@ def main(): if os.path.isdir(target_dir): shutil.rmtree(target_dir) + elif action == "reset": + logger.info("Resetting device") + artiq_flash = run_command( + "{env} artiq_flash start" + + (" --target-file " + args.config if args.config else "")) + drain(artiq_flash) + elif action == "boot" or action == "boot+log": logger.info("Uploading firmware") get_sftp().mkdir("/tmp/{tmp}".format(tmp=tmp))