diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashDone.cpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashDone.cpp index 69a8020e..a6bf6279 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashDone.cpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashDone.cpp @@ -25,6 +25,9 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets try { if (debugSession.programmingSession.has_value()) { const auto& programmingSession = debugSession.programmingSession.value(); + Logger::info( + "Flushing " + std::to_string(programmingSession.buffer.size()) + " bytes to target's program memory" + ); targetControllerConsole.enableProgrammingMode(); 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 7ff8046f..d2af1c50 100644 --- a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.cpp +++ b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.cpp @@ -772,6 +772,10 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr } void EdbgAvr8Interface::enableProgrammingMode() { + if (this->programmingModeEnabled) { + return; + } + auto response = this->edbgInterface.sendAvrCommandFrameAndWaitForResponseFrame( EnterProgrammingMode() ); @@ -784,6 +788,10 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr } void EdbgAvr8Interface::disableProgrammingMode() { + if (!this->programmingModeEnabled) { + return; + } + auto response = this->edbgInterface.sendAvrCommandFrameAndWaitForResponseFrame( LeaveProgrammingMode() );