Lots of tidying
- Removed generic `avr8` target - Simplified AVR8 target construction - Introduced register descriptor IDs - Simplified GDB register mappings - Simplified target interface contract - Other bits of tidying
This commit is contained in:
@@ -66,7 +66,6 @@ namespace Bloom::DebugToolDrivers
|
||||
);
|
||||
}
|
||||
|
||||
this->edbgAvr8Interface = std::make_unique<EdbgAvr8Interface>(this->edbgInterface.get());
|
||||
this->edbgAvrIspInterface = std::make_unique<EdbgAvrIspInterface>(this->edbgInterface.get());
|
||||
|
||||
this->setInitialised(true);
|
||||
@@ -81,6 +80,27 @@ namespace Bloom::DebugToolDrivers
|
||||
UsbDevice::close();
|
||||
}
|
||||
|
||||
TargetInterfaces::Microchip::Avr::Avr8::Avr8DebugInterface* EdbgDevice::getAvr8DebugInterface(
|
||||
const Targets::Microchip::Avr::Avr8Bit::Avr8TargetConfig& targetConfig,
|
||||
Targets::Microchip::Avr::Avr8Bit::Family targetFamily,
|
||||
const Targets::Microchip::Avr::Avr8Bit::TargetParameters& targetParameters,
|
||||
const Targets::TargetRegisterDescriptorMapping& targetRegisterDescriptorsById
|
||||
) {
|
||||
if (this->edbgAvr8Interface == nullptr) {
|
||||
this->edbgAvr8Interface = std::make_unique<EdbgAvr8Interface>(
|
||||
this->edbgInterface.get(),
|
||||
targetConfig,
|
||||
targetFamily,
|
||||
targetParameters,
|
||||
targetRegisterDescriptorsById
|
||||
);
|
||||
|
||||
this->configureAvr8Interface();
|
||||
}
|
||||
|
||||
return this->edbgAvr8Interface.get();
|
||||
}
|
||||
|
||||
std::string EdbgDevice::getSerialNumber() {
|
||||
using namespace CommandFrames::Discovery;
|
||||
using ResponseFrames::Discovery::ResponseId;
|
||||
|
||||
@@ -50,11 +50,16 @@ namespace Bloom::DebugToolDrivers
|
||||
*/
|
||||
void close() override;
|
||||
|
||||
TargetInterfaces::Microchip::Avr::Avr8::Avr8DebugInterface* getAvr8DebugInterface() override {
|
||||
return this->edbgAvr8Interface.get();
|
||||
}
|
||||
TargetInterfaces::Microchip::Avr::Avr8::Avr8DebugInterface* getAvr8DebugInterface(
|
||||
const Targets::Microchip::Avr::Avr8Bit::Avr8TargetConfig& targetConfig,
|
||||
Targets::Microchip::Avr::Avr8Bit::Family targetFamily,
|
||||
const Targets::Microchip::Avr::Avr8Bit::TargetParameters& targetParameters,
|
||||
const Targets::TargetRegisterDescriptorMapping& targetRegisterDescriptorsById
|
||||
) override;
|
||||
|
||||
TargetInterfaces::Microchip::Avr::AvrIspInterface* getAvrIspInterface() override {
|
||||
TargetInterfaces::Microchip::Avr::AvrIspInterface* getAvrIspInterface(
|
||||
const Targets::Microchip::Avr::Avr8Bit::Avr8TargetConfig& targetConfig
|
||||
) override {
|
||||
return this->edbgAvrIspInterface.get();
|
||||
}
|
||||
|
||||
@@ -153,5 +158,9 @@ namespace Bloom::DebugToolDrivers
|
||||
* @return
|
||||
*/
|
||||
std::uint16_t getCmsisHidReportSize();
|
||||
|
||||
virtual void configureAvr8Interface() {
|
||||
return;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@ namespace Bloom::DebugToolDrivers
|
||||
|
||||
try {
|
||||
EdbgDevice::init();
|
||||
this->edbgAvr8Interface->setReactivateJtagTargetPostProgrammingMode(true);
|
||||
|
||||
} catch (const DeviceNotFound& exception) {
|
||||
/*
|
||||
@@ -40,4 +39,8 @@ namespace Bloom::DebugToolDrivers
|
||||
throw exception;
|
||||
}
|
||||
}
|
||||
|
||||
void MplabPickit4::configureAvr8Interface() {
|
||||
this->edbgAvr8Interface->setReactivateJtagTargetPostProgrammingMode(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,5 +36,8 @@ namespace Bloom::DebugToolDrivers
|
||||
}
|
||||
|
||||
void init() override;
|
||||
|
||||
protected:
|
||||
void configureAvr8Interface() override;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@ namespace Bloom::DebugToolDrivers
|
||||
|
||||
try {
|
||||
EdbgDevice::init();
|
||||
this->edbgAvr8Interface->setReactivateJtagTargetPostProgrammingMode(true);
|
||||
|
||||
} catch (const DeviceNotFound& exception) {
|
||||
/*
|
||||
@@ -48,4 +47,8 @@ namespace Bloom::DebugToolDrivers
|
||||
throw exception;
|
||||
}
|
||||
}
|
||||
|
||||
void MplabSnap::configureAvr8Interface() {
|
||||
this->edbgAvr8Interface->setReactivateJtagTargetPostProgrammingMode(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,5 +39,8 @@ namespace Bloom::DebugToolDrivers
|
||||
}
|
||||
|
||||
void init() override;
|
||||
|
||||
protected:
|
||||
void configureAvr8Interface() override;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -11,9 +11,7 @@ namespace Bloom::DebugToolDrivers
|
||||
)
|
||||
{}
|
||||
|
||||
void XplainedPro::init() {
|
||||
EdbgDevice::init();
|
||||
|
||||
void XplainedPro::configureAvr8Interface() {
|
||||
this->edbgAvr8Interface->setMaximumMemoryAccessSizePerRequest(256);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ namespace Bloom::DebugToolDrivers
|
||||
return "Xplained Pro";
|
||||
}
|
||||
|
||||
void init() override;
|
||||
protected:
|
||||
void configureAvr8Interface() override;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user