mirror of https://github.com/m-labs/artiq.git
artiq_devtool: add hotswap action.
This commit is contained in:
parent
795a3e24d8
commit
cce1481fac
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue