From 3a8d37168d5e477d2f0c6a26bff7e1d8ad0cd451 Mon Sep 17 00:00:00 2001 From: xwings Date: Tue, 28 Apr 2026 13:52:50 +0800 Subject: [PATCH] Fix MCU wait --- qiling/os/mcu/mcu.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/qiling/os/mcu/mcu.py b/qiling/os/mcu/mcu.py index 3e84dbdd2..270ab0bf8 100644 --- a/qiling/os/mcu/mcu.py +++ b/qiling/os/mcu/mcu.py @@ -27,9 +27,13 @@ def on_start(self): def on_interrupted(self, ucerr: int): self._begin = self.pc - # And don't restore anything. + # Real silicon would vector to HardFault here; we don't model that, so log and + # request a clean stop instead of raising — otherwise fast-mode timeouts surface + # firmware faults as test errors. if ucerr != UC_ERR_OK: - raise UcError(ucerr) + self.ql.log.warning(f'fast mode halted: {UcError(ucerr)} at PC=0x{self.pc:08x}') + self._stop_request = True + return self.ql.hw.step()