Giter Site home page Giter Site logo

Comments (9)

github0null avatar github0null commented on May 20, 2024

cmd.exe /C "D:\MounRiver\MounRiver_Studio\toolchain\OpenOCD\bin\openocd.exe -s "h:\MajorProjects\AmusingDeviceProject\AntDevice\AntDevice" -f tools/wch-interface.cfg -f tools/wch-target.cfg -c "program "h:/MajorProjects/AmusingDeviceProject/AntDevice/AntDevice/build/Debug/AntDevice.hex" verify" -c "reset run" -c "exit"

下载命令不对,烧录器配置不要选用 OpenOCD

烧录器配置应该选用 Shell Flasher,才是用的 download.cmd 里的命令烧录的,

image

因为 CH32V 是定制的烧录命令和openocd,不能直接用普通的 openocd 命令去烧录

from eide.

Antecer avatar Antecer commented on May 20, 2024

原来如此,问题解决了,非常感谢!

from eide.

Antecer avatar Antecer commented on May 20, 2024

刚看到Shelll有个从云端安装Shell烧录脚本
image
于是好奇的试了一下,然后就下载失败了,错误提示:

Info : JTAG tap: riscv.cpu tap/device found: 0x00000001 (mfg: 0x000 (<invalid>), part: 0x0000, ver: 0x0)
Warn : Bypassing JTAG setup events due to errors
** Programming Started **
Error: couldn't open h
embedded:startup.tcl:1136: Error: ** Programming Failed **
in procedure 'program'
in procedure 'program_error' called at file "embedded:startup.tcl", line 1201
at file "embedded:startup.tcl", line 1136

好奇心害死猫!
最后我还是把shell改回原来的配置,就好了。

但是我还是觉得,这个问题应该反馈一下,毕竟是从插件内直接下载的配置,竟然无法使用。

from eide.

github0null avatar github0null commented on May 20, 2024

请粘贴完整的命令行 log

from eide.

Antecer avatar Antecer commented on May 20, 2024
--------------------------------------------------
firmware: h:/MajorProjects/AmusingDeviceProject/AntDevice/AntDevice/build/Debug/AntDevice.hex
--------------------------------------------------
Open On-Chip Debugger 0.11.0+dev-02215-gcc0ecfb6d-dirty (2022-09-28-11:32)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
Ready for Remote Connections
Info : WCH-Link-CH549  mod:RV version 2.8 
Info : wlink_init ok
Info : This adapter doesn't support configurable speed
Info : JTAG tap: riscv.cpu tap/device found: 0x00000001 (mfg: 0x000 (<invalid>), part: 0x0000, ver: 0x0)
Warn : Bypassing JTAG setup events due to errors
Info : [riscv.cpu.0] datacount=2 progbufsize=8
Info : Examined RISC-V core; found 1 harts
Info :  hart 0: XLEN=32, misa=0x40901125
[riscv.cpu.0] Target successfully examined.
Info : starting gdb server for riscv.cpu.0 on 3333
Info : Listening on port 3333 for gdb connections
Info : device id = 0x263e578f
Info : flash size = 256kbytes
Info : ROM 256 kbytes RAM 64 kbytes
erased sectors 0 through 255 on flash bank 0 in 0.212998s

Info : JTAG tap: riscv.cpu tap/device found: 0x00000001 (mfg: 0x000 (<invalid>), part: 0x0000, ver: 0x0)
Warn : Bypassing JTAG setup events due to errors
** Programming Started **
Error: couldn't open h
embedded:startup.tcl:1136: Error: ** Programming Failed **
in procedure 'program'
in procedure 'program_error' called at file "embedded:startup.tcl", line 1201
at file "embedded:startup.tcl", line 1136

 *  终端进程“cmd.exe /C "bash ./tools/program_flash.sh "h:\MajorProjects\AmusingDeviceProject\AntDevice\AntDevice\build\Debug\AntDevice.hex""”已终止,退出代码: 1。 

原工程默认Shell配置是:

烧录文件:${ExecutableName}.bin
烧录命令:download.cmd "${programFile}"

// cmd脚本
set HEXFILE=%1
set "HEXFILE=%HEXFILE:\=/%"

openocd -f ./tools/wch-interface.cfg -f ./tools/wch-target.cfg -c init -c halt -c "flash erase_sector wch_riscv 0 last " -c "program %HEXFILE%" -c "verify_image %HEXFILE%" -c wlink_reset_resume -c exit

通过EIDE下载的配置是:

烧录文件(默认值):${ExecutableName}.hex
烧录命令:bash ./tools/program_flash.sh "${programFile}"

// bash脚本:
#!/bin/bash

firmwareFile=$(echo $1 | sed 's/\\/\//g')

echo "--------------------------------------------------"
echo "firmware: ${firmwareFile}"
echo "--------------------------------------------------"

./tools/wch_openocd/bin/openocd.exe -f ./tools/wch_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

from eide.

github0null avatar github0null commented on May 20, 2024

把命令改成 bash ./tools/program_flash.sh "./${OutDirBase}/${ProjectName}.hex" 试试?

可能是 shell 模式的路径解析问题

from eide.

Antecer avatar Antecer commented on May 20, 2024

问题解决,能正常下载了,的确是相对路径的问题。
但是这样写的话,程序文件那个配置似乎就没用了吧。
感觉应该把这个相对路径的父级写到shell里面,这样在gui菜单配置参数能简单点。

from eide.

github0null avatar github0null commented on May 20, 2024

只是验证问题原因,后面会修改 shell 脚本的,命令还是保持不变

from eide.

Antecer avatar Antecer commented on May 20, 2024

好的,大佬解决问题真快!

from eide.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.