Disabled use of masked memory read commands, for non-SRAM reads, in the EDBG AVR8 driver.

EDBG tools don't seem to support masked memory reads for EEPROM or FLASH. They just report an 'invalid memtype' error.
This commit is contained in:
Nav
2021-12-26 00:41:23 +00:00
parent 42ea81971f
commit 38afcfd84c
2 changed files with 6 additions and 3 deletions

View File

@@ -1212,7 +1212,7 @@ TargetMemoryBuffer EdbgAvr8Interface::readMemory(
std::uint32_t bytes, std::uint32_t bytes,
const std::set<std::uint32_t>& excludedAddresses const std::set<std::uint32_t>& excludedAddresses
) { ) {
if (!excludedAddresses.empty() && this->avoidMaskedMemoryRead) { if (!excludedAddresses.empty() && (this->avoidMaskedMemoryRead || type != Avr8MemoryType::SRAM)) {
/* /*
* Driver-side masked memory read. * Driver-side masked memory read.
* *

View File

@@ -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 * 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 * data returned in response to the command appears to be completely incorrect.
* with the MPLAB Snap device.
* *
* Setting this flag to true will disable the EdbgAvr8Interface driver's use of the masked memory read command. * 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 * The driver will perform the masking itself, and then issue standard read memory commands. See the
* implementation of EdbgAvr8Interface::readMemory() for more. * 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 * @param avoidMaskedMemoryRead
*/ */
void setAvoidMaskedMemoryRead(bool avoidMaskedMemoryRead) { void setAvoidMaskedMemoryRead(bool avoidMaskedMemoryRead) {