Corrected value of APPICATION_BYTES XMEGA (PDI) device parameter in EDBG driver. Also added APP section start address extraction

This commit is contained in:
Nav
2022-12-12 00:51:45 +00:00
parent d63bce750c
commit 91f8cbc931
3 changed files with 11 additions and 7 deletions

View File

@@ -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");

View File

@@ -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;
}
}

View File

@@ -44,6 +44,8 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit
// XMega/PDI/UPDI specific target params
std::optional<std::uint32_t> appSectionPdiOffset;
std::optional<std::uint32_t> appSectionStartAddress;
std::optional<std::uint32_t> appSectionSize;
std::optional<std::uint16_t> bootSectionSize;
std::optional<std::uint32_t> bootSectionPdiOffset;
std::optional<std::uint32_t> eepromPdiOffset;