Added RiscVProgramInterface for RISC-V debug tools that are unable to program RISC-V targets via the debug interface

This commit is contained in:
Nav
2023-12-08 23:04:04 +00:00
parent 084eef1a30
commit f4b30dbdf6
4 changed files with 48 additions and 0 deletions

View File

@@ -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();