diff --git a/src/Targets/Microchip/AVR/AVR8/Avr8.cpp b/src/Targets/Microchip/AVR/AVR8/Avr8.cpp index b8f06706..5bfc0d6e 100644 --- a/src/Targets/Microchip/AVR/AVR8/Avr8.cpp +++ b/src/Targets/Microchip/AVR/AVR8/Avr8.cpp @@ -554,8 +554,7 @@ void Avr8::loadTargetRegisterDescriptors() { } void Avr8::loadTargetMemoryDescriptors() { - auto ramSize = this->targetParameters->ramSize.value(); - auto ramStartAddress = this->targetParameters->ramStartAddress.value(); + const auto ramStartAddress = this->targetParameters->ramStartAddress.value(); this->targetMemoryDescriptorsByType.insert(std::pair( TargetMemoryType::RAM, @@ -563,10 +562,25 @@ void Avr8::loadTargetMemoryDescriptors() { TargetMemoryType::RAM, TargetMemoryAddressRange( ramStartAddress, - ramStartAddress + ramSize + ramStartAddress + this->targetParameters->ramSize.value() ) ) )); + + if (this->targetParameters->eepromStartAddress.has_value() && this->targetParameters->eepromSize.has_value()) { + const auto eepromStartAddress = this->targetParameters->eepromStartAddress.value(); + + this->targetMemoryDescriptorsByType.insert(std::pair( + TargetMemoryType::EEPROM, + TargetMemoryDescriptor( + TargetMemoryType::EEPROM, + TargetMemoryAddressRange( + eepromStartAddress, + eepromStartAddress + this->targetParameters->eepromSize.value() + ) + ) + )); + } } TargetSignature Avr8::getId() {