mirror of https://github.com/m-labs/artiq.git
artiq_flash: support using alternative OpenOCD config files
This commit is contained in:
parent
25a9d345d9
commit
3f224add2f
|
@ -39,6 +39,8 @@ Prerequisites:
|
||||||
help="target board, default: %(default)s")
|
help="target board, default: %(default)s")
|
||||||
parser.add_argument("-m", "--adapter", default="clock",
|
parser.add_argument("-m", "--adapter", default="clock",
|
||||||
help="target adapter, default: %(default)s")
|
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("-f", "--storage", help="write file to storage area")
|
||||||
parser.add_argument("-d", "--dir", help="look for files in this directory")
|
parser.add_argument("-d", "--dir", help="look for files in this directory")
|
||||||
parser.add_argument("ACTION", nargs="*",
|
parser.add_argument("ACTION", nargs="*",
|
||||||
|
@ -130,10 +132,14 @@ def main():
|
||||||
try:
|
try:
|
||||||
if conv:
|
if conv:
|
||||||
bit2bin(bit, bin_handle)
|
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([
|
subprocess.check_call([
|
||||||
"openocd",
|
"openocd",
|
||||||
"-s", scripts_path,
|
"-s", scripts_path,
|
||||||
"-f", os.path.join("board", opts.target + ".cfg"),
|
"-f", target_file,
|
||||||
"-c", "; ".join(prog),
|
"-c", "; ".join(prog),
|
||||||
])
|
])
|
||||||
finally:
|
finally:
|
||||||
|
|
Loading…
Reference in New Issue