From 1e7e3c45fc4ba056fbea4891250339c678a4d24c Mon Sep 17 00:00:00 2001 From: Nav Date: Mon, 27 Dec 2021 04:17:15 +0000 Subject: [PATCH] Added new 'disableDebugWirePreDisconnect' target parameter, for automatically disabling debugWire before disconnecting from the target. --- .../CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.cpp | 6 ++++++ .../CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.hpp | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-) 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 bd611392..73e95550 100644 --- a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.cpp +++ b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.cpp @@ -85,6 +85,12 @@ void EdbgAvr8Interface::configure(const TargetConfig& targetConfig) { } this->configVariant = this->resolveConfigVariant().value_or(Avr8ConfigVariant::NONE); + + if (targetConfig.jsonObject.contains("disableDebugWirePreDisconnect")) { + this->disableDebugWireOnDeactivate = targetConfig.jsonObject.find( + "disableDebugWirePreDisconnect" + )->toBool(); + } } void EdbgAvr8Interface::setTargetParameters(const Avr8Bit::TargetParameters& config) { diff --git a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.hpp b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.hpp index 44af1e5f..711e8999 100644 --- a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.hpp +++ b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.hpp @@ -339,12 +339,6 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr * ISP, after they've finished a debug session. After programming the target, the user will need to cycle the * target power before Bloom can gain access for another debug session. * - * NOTE: ATM, this isn't actually used anywhere. It will always be false. We may include this as a target - * config parameter, but we first need to consider the actual demand. AVRDUDE used to handle the disabling of - * the debugWire module, but a recent update resulted in it failing to do so. And that was some time ago, so - * we need to check if AVRDUDE and other programming software (MPLAB IPE) can handle the disabling of the - * debugWire module. If not, then we can come back to this. - * * See disableDebugWire() method below. */ bool disableDebugWireOnDeactivate = false;