From 748e28be387dce70c091dda5deb53a14476221b6 Mon Sep 17 00:00:00 2001 From: kk1050 <103404672+kk1050@users.noreply.github.com> Date: Tue, 26 Jul 2022 09:49:48 +0800 Subject: [PATCH] artiq_flash: bail out if scan chain is wrong Due to OpenOCD limitations, there currently doesn't seem to be a better way of doing it. Upstream patch may be coming. --- artiq/frontend/artiq_flash.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/artiq/frontend/artiq_flash.py b/artiq/frontend/artiq_flash.py index 532d1da92..1462ec83e 100755 --- a/artiq/frontend/artiq_flash.py +++ b/artiq/frontend/artiq_flash.py @@ -118,7 +118,12 @@ class Programmer: "telnet_port disabled" ] + preinit_script self._loaded = defaultdict(lambda: None) - self._script = ["init"] + self._script = [ + "set error_msg \"Trying to use configured scan chain anyway\"", + "if {[string first $error_msg [capture \"init\"]] != -1} {", + "puts \"Found error and exiting\"", + "exit}" + ] def _transfer_script(self, script): if isinstance(self._client, LocalClient):