Corrected memory type used for memory writes with the JTAG config variant, in the EDBG AVR8 driver

This commit is contained in:
Nav
2022-12-18 19:23:58 +00:00
parent 5fe50b1997
commit f64a14b04a

View File

@@ -735,14 +735,28 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr
break; break;
} }
case TargetMemoryType::EEPROM: { case TargetMemoryType::EEPROM: {
avr8MemoryType = switch (this->configVariant) {
this->configVariant == Avr8ConfigVariant::XMEGA || this->configVariant == Avr8ConfigVariant::UPDI case Avr8ConfigVariant::UPDI:
? Avr8MemoryType::EEPROM_ATOMIC case Avr8ConfigVariant::XMEGA: {
: Avr8MemoryType::EEPROM; avr8MemoryType = Avr8MemoryType::EEPROM_ATOMIC;
if (this->configVariant == Avr8ConfigVariant::XMEGA) { if (this->configVariant == Avr8ConfigVariant::XMEGA) {
// EEPROM addresses should be in relative form, for XMEGA (PDI) targets // EEPROM addresses should be in relative form, for XMEGA (PDI) targets
startAddress -= this->targetParameters.eepromStartAddress.value(); startAddress -= this->targetParameters.eepromStartAddress.value();
}
break;
}
case Avr8ConfigVariant::MEGAJTAG: {
avr8MemoryType = this->programmingModeEnabled
? Avr8MemoryType::EEPROM_PAGE
: Avr8MemoryType::EEPROM;
break;
}
default: {
avr8MemoryType = Avr8MemoryType::EEPROM;
break;
}
} }
} }
default: { default: {