Repository navigation
Home
Welcome to the WCH_V307_RISC-V wiki!
There is three ways to flash the firmare :
Run the tool WCH-LinkUtility.exe located in the floder /Tools/WCH-LinkUtility

Please follow the steps below :
-
Download and install Embedded Studio for RISC-V from Segger website: https://www.segger.com/downloads/embedded-studio/#ESforRISCV.
-
Extract
OpenOCD.7zfrom the folder/Tools/openOCD-Configto your prefered location on the disk and add{your_path}/openOCD/binto the environemnt variablePATH. -
Run the script
create-env-variable.win.batto set the environemnt variableOPENOCD_SCRIPTSused by openOCD to search for the target config filewch-riscv.cfg. -
Double-click on the file
/Debug/DebugSession.Segger.emProjectto open the project with Segger Embedded Studio. -
Once the project is opened, simply press F5 to start the debug session the tool will automatically flash the firmware and stop at the entry point :

Erase all :
openOCD -f wch-riscv.cfg -c init -c halt -c "flash erase_sector wch_riscv 0 last " -c exitErase all and program :
openOCD -f wch-riscv.cfg -c init -c halt -c "program xxx.hex\bin\elf " -c exitVerify :
openOCD -f wch-riscv.cfg -c init -c halt -c "verify_image xxx.hex\bin\elf" -c exitReset and resume :
openOCD -f wch-riscv.cfg -c init -c halt -c wlink_reset_resume -c exit