Corrected potential issue with delta programming on some AVR8 debugWIRE targets

This commit is contained in:
Nav
2025-02-19 00:18:19 +00:00
parent a98793de16
commit d7d1f71aac
4 changed files with 16 additions and 3 deletions

View File

@@ -36,6 +36,7 @@ namespace DebugToolDrivers::Microchip::Protocols::Edbg::Avr
static constexpr Avr8EdbgParameter DEVICE_FLASH_PAGE_SIZE = {0x02, 0x00}; static constexpr Avr8EdbgParameter DEVICE_FLASH_PAGE_SIZE = {0x02, 0x00};
static constexpr Avr8EdbgParameter DEVICE_FLASH_SIZE = {0x02, 0x02}; static constexpr Avr8EdbgParameter DEVICE_FLASH_SIZE = {0x02, 0x02};
static constexpr Avr8EdbgParameter DEVICE_OCD_REVISION = {0x02, 0x13}; static constexpr Avr8EdbgParameter DEVICE_OCD_REVISION = {0x02, 0x13};
static constexpr Avr8EdbgParameter DEVICE_PAGE_BUFFERS_PER_FLASH_BLOCK = {0x02, 0x14};
static constexpr Avr8EdbgParameter DEVICE_OCD_DATA_REGISTER = {0x02, 0x18}; static constexpr Avr8EdbgParameter DEVICE_OCD_DATA_REGISTER = {0x02, 0x18};
static constexpr Avr8EdbgParameter DEVICE_SPMCR_REGISTER = {0x02, 0x1D}; static constexpr Avr8EdbgParameter DEVICE_SPMCR_REGISTER = {0x02, 0x1D};
static constexpr Avr8EdbgParameter DEVICE_OSCCAL_ADDR = {0x02, 0x1E}; static constexpr Avr8EdbgParameter DEVICE_OSCCAL_ADDR = {0x02, 0x1E};

View File

@@ -999,6 +999,12 @@ namespace DebugToolDrivers::Microchip::Protocols::Edbg::Avr
Logger::debug("Setting OCD_REVISION AVR8 device parameter"); Logger::debug("Setting OCD_REVISION AVR8 device parameter");
this->setParameter(Avr8EdbgParameters::DEVICE_OCD_REVISION, parameters.ocdRevision); this->setParameter(Avr8EdbgParameters::DEVICE_OCD_REVISION, parameters.ocdRevision);
Logger::debug("Setting DEVICE_PAGE_BUFFERS_PER_FLASH_BLOCK AVR8 device parameter");
this->setParameter(
Avr8EdbgParameters::DEVICE_PAGE_BUFFERS_PER_FLASH_BLOCK,
parameters.buffersPerFlashPage.value_or(0x01)
);
Logger::debug("Setting OCD_DATA_REGISTER AVR8 device parameter"); Logger::debug("Setting OCD_DATA_REGISTER AVR8 device parameter");
this->setParameter(Avr8EdbgParameters::DEVICE_OCD_DATA_REGISTER, parameters.ocdDataRegisterAddress); this->setParameter(Avr8EdbgParameters::DEVICE_OCD_DATA_REGISTER, parameters.ocdDataRegisterAddress);

View File

@@ -22,9 +22,9 @@ namespace DebugToolDrivers::Microchip::Protocols::Edbg::Avr::Parameters::Avr8Gen
"boot_section_options.boot_section_1" "boot_section_options.boot_section_1"
); );
if (firstBootSectionOptionGroup.has_value()) { if (firstBootSectionOptionGroup.has_value()) {
this->bootSectionStartWordAddress = static_cast<std::uint32_t>( this->bootSectionStartWordAddress = StringService::toUint32(
StringService::toUint32(firstBootSectionOptionGroup->get().getProperty("start_address").value) / 2 firstBootSectionOptionGroup->get().getProperty("start_address").value
); ) / 2;
} }
this->ramStartAddress = static_cast<std::uint16_t>(ramMemorySegment.startAddress); this->ramStartAddress = static_cast<std::uint16_t>(ramMemorySegment.startAddress);
@@ -35,6 +35,11 @@ namespace DebugToolDrivers::Microchip::Protocols::Edbg::Avr::Parameters::Avr8Gen
this->ocdRevision = StringService::toUint8(ocdPropertyGroup.getProperty("ocd_revision").value); this->ocdRevision = StringService::toUint8(ocdPropertyGroup.getProperty("ocd_revision").value);
this->ocdDataRegisterAddress = StringService::toUint8(ocdPropertyGroup.getProperty("ocd_datareg").value); this->ocdDataRegisterAddress = StringService::toUint8(ocdPropertyGroup.getProperty("ocd_datareg").value);
const auto buffersPerFlashPageProperty = ocdPropertyGroup.tryGetProperty("buffers_per_flash_page");
if (buffersPerFlashPageProperty.has_value()) {
this->buffersPerFlashPage = StringService::toUint8(buffersPerFlashPageProperty->get().value);
}
const auto eepromPeripheralDescriptor = targetDescriptionFile.getTargetPeripheralDescriptor("eeprom"); const auto eepromPeripheralDescriptor = targetDescriptionFile.getTargetPeripheralDescriptor("eeprom");
const auto& eepromRegisterGroupDescriptor = eepromPeripheralDescriptor.getRegisterGroupDescriptor("eeprom"); const auto& eepromRegisterGroupDescriptor = eepromPeripheralDescriptor.getRegisterGroupDescriptor("eeprom");

View File

@@ -23,6 +23,7 @@ namespace DebugToolDrivers::Microchip::Protocols::Edbg::Avr::Parameters::Avr8Gen
std::uint8_t eepromPageSize; std::uint8_t eepromPageSize;
std::uint8_t ocdRevision; std::uint8_t ocdRevision;
std::uint8_t ocdDataRegisterAddress; std::uint8_t ocdDataRegisterAddress;
std::optional<std::uint8_t> buffersPerFlashPage;
std::uint8_t eearAddressHigh; std::uint8_t eearAddressHigh;
std::uint8_t eearAddressLow; std::uint8_t eearAddressLow;
std::uint8_t eedrAddress; std::uint8_t eedrAddress;