From fbf141c7efe4e07f464efd3678cf8cda9ef25dd8 Mon Sep 17 00:00:00 2001 From: Nav Date: Sun, 5 Jun 2022 21:04:08 +0100 Subject: [PATCH] Fixed bug with some debug tools (PICkit4 and Snap) losing control of the target after disabling programming mdoe --- .../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 ad1c0dca..130eb10b 100644 --- a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.cpp +++ b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.cpp @@ -789,6 +789,14 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr } this->programmingModeEnabled = false; + + if (this->configVariant == Avr8ConfigVariant::MEGAJTAG) { + this->deactivatePhysical(); + this->setTargetParameters(this->targetParameters); + this->targetAttached = false; + this->activate(); + this->stop(); + } } std::map>