Corrected bug with leaving programming mode on Snap and PICkit 4 debug tools

This commit is contained in:
Nav
2023-05-08 02:44:03 +01:00
parent 61d608989d
commit 1f57ca3f21
4 changed files with 14 additions and 0 deletions

View File

@@ -18,6 +18,7 @@ namespace Bloom::DebugToolDrivers
try {
EdbgDevice::init();
this->edbgAvr8Interface->setReactivateJtagTargetPostProgrammingMode(true);
} catch (const DeviceNotFound& exception) {
/*

View File

@@ -18,6 +18,7 @@ namespace Bloom::DebugToolDrivers
try {
EdbgDevice::init();
this->edbgAvr8Interface->setReactivateJtagTargetPostProgrammingMode(true);
} catch (const DeviceNotFound& exception) {
/*

View File

@@ -898,6 +898,12 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr
}
this->programmingModeEnabled = false;
if (this->configVariant == Avr8ConfigVariant::MEGAJTAG && this->reactivateJtagTargetPostProgrammingMode) {
this->deactivatePhysical();
this->targetAttached = false;
this->activate();
}
}
std::map<Family, std::map<PhysicalInterface, Avr8ConfigVariant>>

View File

@@ -74,6 +74,10 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr
this->maximumMemoryAccessSizePerRequest = maximumSize;
}
void setReactivateJtagTargetPostProgrammingMode(bool reactivateJtagTargetPostProgrammingMode) {
this->reactivateJtagTargetPostProgrammingMode = reactivateJtagTargetPostProgrammingMode;
}
/*
* The public methods below implement the interface defined by the Avr8Interface class.
* See the comments in that class for more info on the expected behaviour of each method.
@@ -328,6 +332,8 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr
*/
std::optional<Targets::TargetMemorySize> maximumMemoryAccessSizePerRequest;
bool reactivateJtagTargetPostProgrammingMode = false;
/**
* We keep record of the current target state for caching purposes. We'll only refresh the target state if the
* target is running. If it has already stopped, then we assume it cannot transition to a running state without