artiq_flash: enclose filename in curly braces before passing to OpenOCD

Closes #927
This commit is contained in:
Sebastien Bourdeauducq 2018-03-22 17:20:45 +08:00
parent eeedcfbdd7
commit 46d5af31a1
1 changed files with 4 additions and 5 deletions

View File

@ -138,7 +138,7 @@ class Programmer:
bitfile = self._client.upload(bitfile)
add_commands(self._script,
"pld load {pld} {filename}",
"pld load {pld} {{{filename}}}",
pld=pld, filename=bitfile)
def load_proxy(self):
@ -152,8 +152,8 @@ class Programmer:
add_commands(self._script,
"flash probe {bankname}",
"flash erase_sector {bankname} {firstsector} {lastsector}",
"flash write_bank {bankname} {filename} {address:#x}",
"flash verify_bank {bankname} {filename} {address:#x}",
"flash write_bank {bankname} {{{filename}}} {address:#x}",
"flash verify_bank {bankname} {{{filename}}} {address:#x}",
bankname=bankname, address=address, filename=filename,
firstsector=address // self._sector_size,
lastsector=(address + size - 1) // self._sector_size)
@ -164,7 +164,7 @@ class Programmer:
filename = self._client.prepare_download(filename)
add_commands(self._script,
"flash probe {bankname}",
"flash read_bank {bankname} {filename} {address:#x} {length}",
"flash read_bank {bankname} {{{filename}}} {address:#x} {length}",
bankname=bankname, filename=filename, address=address, length=length)
def start(self):
@ -184,7 +184,6 @@ class Programmer:
cmdline += ["-s", scripts_path()]
cmdline += ["-c", "; ".join(self.script())]
cmdline = [arg.replace("{", "{{").replace("}", "}}") for arg in cmdline]
self._client.run_command(cmdline)
self._client.download()