| 
 
| VScode的插件多,还是决定使用它来开发CH32V,按照https://www.cnblogs.com/wahahahehehe/p/16896184.html的教程一步一步做, 记录一下遇到的问题和解决方法
 1.下载脚本
 在线模板的下载脚本有点问题,总是提示命令出错
 download.sh脚本修改如下,直接使用绝对地址,固件地址增加去除盘符的命令
 
 firmwareFile=$(echo $1 | sed 's/^\([a-zA-Z]\)\(.*\)/\2/g; s/://g' | sed 's/\\/\//g')
 d:/MounRiver/MounRiver_Studio/toolchain/OpenOCD/bin/openocd.exe -f d:/MounRiver/MounRiver_Studio/toolchain/OpenOCD/bin/wch-riscv.cfg \
 -c init -c halt \
 -c "flash erase_sector wch_riscv 0 last" \
 -c "program ${firmwareFile}" \
 -c "verify_image ${firmwareFile}" \
 -c wlink_reset_resume -c exit
 
 烧录命令修改为  bash ./download.sh "${programFile}"
 
 2.Cortex-Debug 调试
 脚本提示riscv-none-embed-gdb.exe的版本不对,到https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack/releases/tag/v10.2.0-1.2/
 下载xpack-riscv-none-embed-gcc-10.2.0 修改Cortex-Debug 的设置
 
 
 "cortex-debug.gdbPath": "riscv-none-embed-gdb.exe的目录",
 "cortex-debug.openocdPath": "openocd.exe的目录",
 "cortex-debug.gdbPath.windows": "riscv-none-embed-gdb.exe的目录"
 保存后,愉快的调试吧
 
 
 
 
 
 
 | 
 |