WCH-Link erase command doesn't erase the whole chip, as initially thought. It only erases the program memory segment.

The boot segment appears to be left untouched.
This commit is contained in:
Nav
2024-12-13 22:48:20 +00:00
parent a971e92a58
commit 00919e4057
6 changed files with 33 additions and 18 deletions

View File

@@ -89,6 +89,8 @@ namespace DebugToolDrivers::Wch
Protocols::WchLink::WchLinkInterface& wchLinkInterface;
DebugToolDrivers::Protocols::RiscVDebugSpec::DebugTranslator riscVTranslator;
const Targets::TargetMemorySegmentDescriptor& programSegmentDescriptor;
/**
* The 'target activation' command returns a payload of 5 bytes.
*
@@ -107,7 +109,6 @@ namespace DebugToolDrivers::Wch
void setSoftwareBreakpoint(const Targets::TargetProgramBreakpoint& breakpoint);
void clearSoftwareBreakpoint(const Targets::TargetProgramBreakpoint& breakpoint);
void eraseFlashMemory();
static std::span<const unsigned char> getFlashProgramOpcodes(const std::string& key);
};
}