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:
@@ -106,6 +106,16 @@ void EdbgAvr8Interface::setTargetParameters(const Avr8Bit::TargetParameters& con
|
||||
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) {
|
||||
auto configVariant = this->resolveConfigVariant();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user