Skip to content

Commit

Permalink
artiq_flash: support using alternative OpenOCD config files
Browse files Browse the repository at this point in the history
sbourdeauducq committed Jul 19, 2016
1 parent 0744620 commit 0590021
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion artiq/frontend/artiq_flash.py
Original file line number Diff line number Diff line change
@@ -39,6 +39,8 @@ def get_argparser():
help="target board, default: %(default)s")
parser.add_argument("-m", "--adapter", default="nist_clock",
help="target adapter, default: %(default)s")
parser.add_argument("--target-file", default=None,
help="use alternative OpenOCD target file")
parser.add_argument("-f", "--storage", help="write file to storage area")
parser.add_argument("-d", "--dir", help="look for files in this directory")
parser.add_argument("action", metavar="ACTION", nargs="*",
@@ -130,10 +132,14 @@ def main():
try:
if conv:
bit2bin(bit, bin_handle)
if opts.target_file is None:
target_file = os.path.join("board", opts.target + ".cfg")
else:
target_file = opts.target_file
subprocess.check_call([
"openocd",
"-s", scripts_path,
"-f", os.path.join("board", opts.target + ".cfg"),
"-f", target_file,
"-c", "; ".join(prog),
])
finally:

0 comments on commit 0590021

Please sign in to comment.