-
Notifications
You must be signed in to change notification settings - Fork 0
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.7z
from the folder/Tools/openOCD-Config
to your prefered location on the disk and add{your_path}/openOCD/bin
to the environemnt variablePATH
. -
Run the script
create-env-variable.win.bat
to set the environemnt variableOPENOCD_SCRIPTS
used by openOCD to search for the target config filewch-riscv.cfg
. -
Double-click on the file
/Debug/DebugSession.Segger.emProject
to 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 exit
Erase all and program :
openOCD -f wch-riscv.cfg -c init -c halt -c "program xxx.hex\bin\elf " -c exit
Verify :
openOCD -f wch-riscv.cfg -c init -c halt -c "verify_image xxx.hex\bin\elf" -c exit
Reset and resume :
openOCD -f wch-riscv.cfg -c init -c halt -c wlink_reset_resume -c exit