- Implemented program memory erasure routine in WchRiscV target driver

- Moved away from relying on WCH-Link debug tool command for erasing program memory, due to a bug that I couldn't fix
- Small tweaks to programming method selection in WCH-Link driver
- Refactored flash peripheral registers in WchRiscV target driver
This commit is contained in:
Nav
2025-01-29 23:48:32 +00:00
parent 55b8bf17fe
commit 7466850478
10 changed files with 166 additions and 33 deletions

View File

@@ -241,6 +241,12 @@ namespace DebugToolDrivers::Wch::Protocols::WchLink
this->sendCommandAndWaitForResponse(Commands::EndProgrammingSession{});
}
/*
* We don't actually use this anywhere, as the WCH-Link's erase function is buggy. For more, see the comment in
* the WchLinkDebugInterface::eraseMemory() member function.
*
* TODO: Consider removing this after v2.0.0
*/
void WchLinkInterface::eraseProgramMemory() {
this->sendCommandAndWaitForResponse(Commands::EraseProgramMemory{});
}