From a11e347e2caa2f13e9ed0828147ff91ab4e79c25 Mon Sep 17 00:00:00 2001 From: Nav Date: Fri, 8 Apr 2022 22:16:19 +0100 Subject: [PATCH] Implemented waiting for target stopped event after invoking a target reset via the EDBG AVR8 interface --- .../VendorSpecific/EDBG/AVR/EdbgAvr8Interface.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.cpp b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.cpp index 2e7cb264..bcb136c7 100644 --- a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.cpp +++ b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.cpp @@ -216,6 +216,14 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr if (response.getResponseId() == Avr8ResponseId::FAILED) { throw Avr8CommandFailure("AVR8 Reset target command failed", response); } + + try { + // Wait for stopped event + this->waitForStoppedEvent(); + + } catch (const Exception& exception) { + throw Exception("Failed to reset AVR8 target - missing stopped event."); + } } void EdbgAvr8Interface::activate() {