From 46d5af31a1a3304a4e0a4cb8af7cf2cb2ba36e8a Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Thu, 22 Mar 2018 17:20:45 +0800 Subject: [PATCH] artiq_flash: enclose filename in curly braces before passing to OpenOCD Closes #927 --- artiq/frontend/artiq_flash.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/artiq/frontend/artiq_flash.py b/artiq/frontend/artiq_flash.py index 27d527579..b11548a03 100755 --- a/artiq/frontend/artiq_flash.py +++ b/artiq/frontend/artiq_flash.py @@ -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()