Additional check in AVR8 EDBG driver to confirm the target's flash page size does not exceed the maximum memory access limit of the debug tool.

This commit is contained in:
Nav
2021-11-27 14:57:04 +00:00
parent 566d1be694
commit ca66cc856a

View File

@@ -106,6 +106,16 @@ void EdbgAvr8Interface::setTargetParameters(const Avr8Bit::TargetParameters& con
throw DeviceInitializationFailure("Failed to find status register size"); throw DeviceInitializationFailure("Failed to find status register size");
} }
if (config.flashPageSize.has_value() && this->maximumMemoryAccessSizePerRequest.has_value()
&& config.flashPageSize > this->maximumMemoryAccessSizePerRequest
) {
throw DeviceInitializationFailure("Flash page size for target ("
+ std::to_string(config.flashPageSize.value())
+ " bytes) exceeds maximum memory access size for EdbgAvr8Interface ("
+ std::to_string(this->maximumMemoryAccessSizePerRequest.value()) + " bytes)."
);
}
if (this->configVariant == Avr8ConfigVariant::NONE) { if (this->configVariant == Avr8ConfigVariant::NONE) {
auto configVariant = this->resolveConfigVariant(); auto configVariant = this->resolveConfigVariant();