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 1d2c4fab..1d7904dc 100644 --- a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.cpp +++ b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.cpp @@ -1142,12 +1142,12 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr throw DeviceInitializationFailure("Missing required parameter: BOOT_BASE_ADDR"); } - if (!this->targetParameters.bootSectionSize.has_value()) { - throw DeviceInitializationFailure("Missing required parameter: BOOT_BYTES"); + if (!this->targetParameters.appSectionSize.has_value()) { + throw DeviceInitializationFailure("Missing required parameter: APPLICATION_BYTES"); } - if (!this->targetParameters.flashSize.has_value()) { - throw DeviceInitializationFailure("Missing required parameter: APPLICATION_BYTES"); + if (!this->targetParameters.bootSectionSize.has_value()) { + throw DeviceInitializationFailure("Missing required parameter: BOOT_BYTES"); } if (!this->targetParameters.eepromPdiOffset.has_value()) { @@ -1245,7 +1245,7 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr Logger::debug("Setting APPLICATION_BYTES AVR8 parameter"); this->setParameter( Avr8EdbgParameters::DEVICE_XMEGA_APPLICATION_BYTES, - this->targetParameters.flashSize.value() + this->targetParameters.appSectionSize.value() ); Logger::debug("Setting BOOT_BYTES AVR8 parameter"); diff --git a/src/Targets/Microchip/AVR/AVR8/TargetDescription/TargetDescriptionFile.cpp b/src/Targets/Microchip/AVR/AVR8/TargetDescription/TargetDescriptionFile.cpp index c0d977ae..61ee453a 100644 --- a/src/Targets/Microchip/AVR/AVR8/TargetDescription/TargetDescriptionFile.cpp +++ b/src/Targets/Microchip/AVR/AVR8/TargetDescription/TargetDescriptionFile.cpp @@ -181,8 +181,10 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit::TargetDescription const auto appMemorySegment = this->getFlashApplicationMemorySegment(programMemoryAddressSpace.value()); - if (appMemorySegment.has_value() && appMemorySegment->pageSize.has_value()) { - targetParameters.flashPageSize = appMemorySegment->pageSize.value(); + if (appMemorySegment.has_value()) { + targetParameters.appSectionStartAddress = appMemorySegment->startAddress; + targetParameters.appSectionSize = appMemorySegment->size; + targetParameters.flashPageSize = appMemorySegment->pageSize; } } diff --git a/src/Targets/Microchip/AVR/AVR8/TargetParameters.hpp b/src/Targets/Microchip/AVR/AVR8/TargetParameters.hpp index 1dec1819..ee68e021 100644 --- a/src/Targets/Microchip/AVR/AVR8/TargetParameters.hpp +++ b/src/Targets/Microchip/AVR/AVR8/TargetParameters.hpp @@ -44,6 +44,8 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit // XMega/PDI/UPDI specific target params std::optional appSectionPdiOffset; + std::optional appSectionStartAddress; + std::optional appSectionSize; std::optional bootSectionSize; std::optional bootSectionPdiOffset; std::optional eepromPdiOffset;