Added RiscVProgramInterface for RISC-V debug tools that are unable to program RISC-V targets via the debug interface
This commit is contained in:
@@ -51,6 +51,7 @@ namespace Targets::RiscV
|
||||
|
||||
void RiscV::setDebugTool(DebugTool* debugTool) {
|
||||
this->riscVDebugInterface = debugTool->getRiscVDebugInterface();
|
||||
this->riscVProgramInterface = debugTool->getRiscVProgramInterface();
|
||||
}
|
||||
|
||||
void RiscV::activate() {
|
||||
@@ -395,6 +396,10 @@ namespace Targets::RiscV
|
||||
return this->writeMemory(memoryType, alignedStartAddress, alignedBuffer);
|
||||
}
|
||||
|
||||
if (memoryType == TargetMemoryType::FLASH && this->riscVProgramInterface != nullptr) {
|
||||
return this->riscVProgramInterface->writeFlashMemory(startAddress, buffer);
|
||||
}
|
||||
|
||||
this->riscVDebugInterface->writeDebugModuleRegister(RegisterAddress::ABSTRACT_DATA_1, startAddress);
|
||||
|
||||
auto command = AbstractCommandRegister();
|
||||
|
||||
Reference in New Issue
Block a user