Extract debug tool firmware version at startup
This commit is contained in:
@@ -45,6 +45,8 @@ public:
|
|||||||
|
|
||||||
virtual std::string getSerialNumber() = 0;
|
virtual std::string getSerialNumber() = 0;
|
||||||
|
|
||||||
|
virtual std::string getFirmwareVersionString() = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* All debug tools that support target power management functions must provide an implementation of the
|
* All debug tools that support target power management functions must provide an implementation of the
|
||||||
* TargetPowerManagementInterface class, via this function.
|
* TargetPowerManagementInterface class, via this function.
|
||||||
|
|||||||
@@ -121,6 +121,11 @@ namespace DebugToolDrivers
|
|||||||
return std::string(data.begin(), data.end());
|
return std::string(data.begin(), data.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string EdbgDevice::getFirmwareVersionString() {
|
||||||
|
// TODO: Implement this
|
||||||
|
return "UNKNOWN";
|
||||||
|
}
|
||||||
|
|
||||||
void EdbgDevice::startSession() {
|
void EdbgDevice::startSession() {
|
||||||
using namespace CommandFrames::HouseKeeping;
|
using namespace CommandFrames::HouseKeeping;
|
||||||
using ResponseFrames::HouseKeeping::ResponseId;
|
using ResponseFrames::HouseKeeping::ResponseId;
|
||||||
|
|||||||
@@ -74,6 +74,13 @@ namespace DebugToolDrivers
|
|||||||
*/
|
*/
|
||||||
std::string getSerialNumber() override;
|
std::string getSerialNumber() override;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves the EDBG firmware version.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
std::string getFirmwareVersionString() override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Starts a session with the EDBG device using the "Housekeeping" EDBG sub-protocol.
|
* Starts a session with the EDBG device using the "Housekeeping" EDBG sub-protocol.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -59,6 +59,10 @@ namespace DebugToolDrivers::Wch
|
|||||||
return UsbDevice::getSerialNumber();
|
return UsbDevice::getSerialNumber();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string WchLinkBase::getFirmwareVersionString() {
|
||||||
|
return "v" + this->getDeviceInfo().firmwareVersion.toString();
|
||||||
|
}
|
||||||
|
|
||||||
const DeviceInfo& WchLinkBase::getDeviceInfo() const {
|
const DeviceInfo& WchLinkBase::getDeviceInfo() const {
|
||||||
if (!this->cachedDeviceInfo.has_value()) {
|
if (!this->cachedDeviceInfo.has_value()) {
|
||||||
this->cachedDeviceInfo = this->wchLinkInterface->getDeviceInfo();
|
this->cachedDeviceInfo = this->wchLinkInterface->getDeviceInfo();
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ namespace DebugToolDrivers::Wch
|
|||||||
|
|
||||||
std::string getSerialNumber() override;
|
std::string getSerialNumber() override;
|
||||||
|
|
||||||
|
std::string getFirmwareVersionString() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
WchLinkVariant variant;
|
WchLinkVariant variant;
|
||||||
|
|
||||||
|
|||||||
@@ -493,6 +493,7 @@ namespace TargetController
|
|||||||
Logger::info("Debug tool connected");
|
Logger::info("Debug tool connected");
|
||||||
Logger::info("Debug tool name: " + this->debugTool->getName());
|
Logger::info("Debug tool name: " + this->debugTool->getName());
|
||||||
Logger::info("Debug tool serial: " + this->debugTool->getSerialNumber());
|
Logger::info("Debug tool serial: " + this->debugTool->getSerialNumber());
|
||||||
|
Logger::info("Debug tool firmware version: " + this->debugTool->getFirmwareVersionString());
|
||||||
|
|
||||||
this->target = targetIt->second(this->environmentConfig.targetConfig);
|
this->target = targetIt->second(this->environmentConfig.targetConfig);
|
||||||
const auto& targetDescriptor = this->getTargetDescriptor();
|
const auto& targetDescriptor = this->getTargetDescriptor();
|
||||||
|
|||||||
Reference in New Issue
Block a user