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 d07ec0dd..bd611392 100644 --- a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.cpp +++ b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.cpp @@ -1212,7 +1212,7 @@ TargetMemoryBuffer EdbgAvr8Interface::readMemory( std::uint32_t bytes, const std::set& excludedAddresses ) { - if (!excludedAddresses.empty() && this->avoidMaskedMemoryRead) { + if (!excludedAddresses.empty() && (this->avoidMaskedMemoryRead || type != Avr8MemoryType::SRAM)) { /* * Driver-side masked memory read. * 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 8122ee46..44af1e5f 100644 --- a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.hpp +++ b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.hpp @@ -31,13 +31,16 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr /** * Some EDBG devices don't seem to operate correctly when actioning the masked memory read EDBG command. The - * data returned in response to the command appears to be completely incorrect. This appears to only occur - * with the MPLAB Snap device. + * data returned in response to the command appears to be completely incorrect. * * Setting this flag to true will disable the EdbgAvr8Interface driver's use of the masked memory read command. * The driver will perform the masking itself, and then issue standard read memory commands. See the * implementation of EdbgAvr8Interface::readMemory() for more. * + * NOTE: Masked memory read commands are only implemented for SRAM reads. EDBG debug tools report EEPROM and + * FLASH as invalid memory types, when using the masked memory read command. So any masked reads to non-SRAM + * will result in driver-side masking, regardless of the value of this flag. + * * @param avoidMaskedMemoryRead */ void setAvoidMaskedMemoryRead(bool avoidMaskedMemoryRead) {