diff --git a/scripts/serial_command.py b/scripts/serial_command.py index 46cc290..5bd179a 100644 --- a/scripts/serial_command.py +++ b/scripts/serial_command.py @@ -61,10 +61,10 @@ class UBoot: self.port.flush() output, _ = self.read_prompt(timeout) # Query immediately, before another command changes the return status. - self.port.write(b"echo __UBOOT_STATUS_${?}__\r") + self.port.write(b"echo __UBOOT_STATUS_ $?\r") self.port.flush() status, _ = self.read_prompt(5) - codes = re.findall(r"(?m)^__UBOOT_STATUS_(\d+)__$", status) + codes = re.findall(r"(?m)^__UBOOT_STATUS_ (\d+) *$", status) if codes != ["0"]: raise RuntimeError("Command failed or its exit status could not be verified: " + command) if ERROR.search(output):