- Additional target config options.

- Some tidying
This commit is contained in:
Nav
2025-01-07 22:38:11 +00:00
parent 7605d5e3a0
commit e98a73e687
11 changed files with 70 additions and 19 deletions

View File

@@ -209,20 +209,23 @@ namespace Targets::Microchip::Avr8
this->activated = true;
/*
* Validate the target signature.
*
* The signature obtained from the device should match what we loaded from the target description file.
*/
const auto targetSignature = this->avr8DebugInterface->getDeviceId();
if (this->targetConfig.signatureValidation) {
/*
* Validate the target signature.
*
* The signature obtained from the device should match what we loaded from the target description file.
*/
const auto targetSignature = this->avr8DebugInterface->getDeviceId();
if (targetSignature != this->signature) {
throw Exception{
"Failed to validate connected target - target signature mismatch.\nThe target signature"
" (\"" + targetSignature.toHex() + "\") does not match the AVR8 target description signature (\""
+ this->signature.toHex() + "\"). This will likely be due to an incorrect target name in the "
+ "configuration file (bloom.yaml)."
};
if (targetSignature != this->signature) {
throw Exception{
"Failed to validate connected target - target signature mismatch.\nThe target signature"
" (\"" + targetSignature.toHex() +
"\") does not match the AVR8 target description signature (\""
+ this->signature.toHex() + "\"). This will likely be due to an incorrect target name in the "
+ "configuration file (bloom.yaml)."
};
}
}
}

View File

@@ -38,5 +38,13 @@ namespace Targets::Microchip::Avr8
if (targetNode["preserve_eeprom"]) {
this->preserveEeprom = targetNode["preserve_eeprom"].as<bool>(this->preserveEeprom);
}
if (targetNode["signature_validation"]) {
this->signatureValidation = targetNode["signature_validation"].as<bool>(this->signatureValidation);
}
if (targetNode["stop_all_timers"]) {
this->stopAllTimers = targetNode["stop_all_timers"].as<bool>(this->stopAllTimers);
}
}
}

View File

@@ -79,6 +79,17 @@ namespace Targets::Microchip::Avr8
*/
bool preserveEeprom = true;
/**
* Determines whether Bloom will check for an AVR signature mismatch between the signature in the TDF and the
* connected target signature.
*/
bool signatureValidation = true;
/**
* Determines whether Bloom will stop all timer peripherals on the target, when target execution is stopped.
*/
bool stopAllTimers = true;
explicit Avr8TargetConfig(const TargetConfig& targetConfig);
};
}