关于OpenOCD下载的flash driver缺失问题
本帖最后由 Sancheese 于 2022-5-18 12:31 编辑开发环境:Clion + gcc-arm-none-eabi + mingw64 + CMakeLists,下载器为 DAPLink ,其中编译环节已确定没有问题。
根据官方应用笔记 《AN0033 应用笔记 Eclipse with GCC》及其附件所述,我使用附件内的 OpenOCD_V2.0.0 ,替代了原先使用的 xpack-openocd-0.11.0-2
我的 AT32F403A.cfg 文件内容如下
#CMSIS DAP-HS
source
# adapter driver cmsis-dap
#SWD
transport select swd
#MCU
source
#10M
adapter speed 10000
# 不使用复位接口
reset_config none
以下是运行下载脚本时的指令:(为方便阅读,手动换行)
D:\DevelopTools\OpenOCD_V2.0.0\bin\ATLINK.exe
-s D:\DevelopTools\OpenOCD_V2.0.0\share\openocd\scripts
-f D:\Documents\AT32workspace\Template\AT32F403A.cfg
-c "tcl_port disabled" -c "gdb_port disabled" -c "tcl_port disabled"
-c "program \"D:/Documents/AT32workspace/Develop/cmake-build-debug/Develop.elf\"" -c reset -c shutdown
发现搜索路径默认为 share 目录,因此把原先 OpenOCD_V2.0.0 文件夹根目录的 scripts 文件夹拷贝到 share 中,并进行替换
运行结果如下:
Open On-Chip Debugger 0.10.0+dev-snapshot (2021-04-08-11:26)
更换source为
adapter driver cmsis-dap仍然是一样的报错
我觉得主要错误应该是最后一条的 flash driver not found
希望得到前辈们的指点
现在的下载方案是 pyocd +ArteryTek.AT32F403A_407_DFP.2.0.8.pack ,下载甚是繁琐,但验证了编译结果并没有问题 有技术人员支持一下吗? 运行程序不要使用ATLINK.exe,用OpenOCD.exe 本帖最后由 Sancheese 于 2022-5-19 14:15 编辑
AT32F403A.cfg 配置文件如下
#CMSIS DAP-HS
source
# adapter driver cmsis-dap
#SWD
# transport select swd
#MCU
source
#10M
adapter speed 5000
# 不使用复位接口
reset_config none
CLion 实际运行的命令如下D:\DevelopTools\OpenOCD_V2.0.0\bin\openocd.exe
-s D:\DevelopTools\OpenOCD_V2.0.0\share\openocd\scripts
-f D:\Documents\AT32workspace\Develop\AT32F403A.cfg
-c "tcl_port disabled" -c "gdb_port disabled" -c "tcl_port disabled"
-c "program \"D:/Documents/AT32workspace/Develop/cmake-build-debug/Develop.elf\""
-c reset -c shutdown
报错如下(仍旧是flash driver 'at32f4x' not found)
Open On-Chip Debugger 0.10.0+dev-snapshot (2021-12-17-16:55)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
adapter speed: 5000 kHz
Error: flash driver 'at32f4x' not found
muyichuan2012 发表于 2022-5-19 13:28
运行程序不要使用ATLINK.exe,用OpenOCD.exe
版主你好,首先应用手册里用的是 ATLINK.exe 所以我才模仿了一下,修改为 OpenOCD.exe 后仍旧是同样的报错,详细内容请第五楼 Sancheese 发表于 2022-5-19 14:13
版主你好,首先应用手册里用的是 ATLINK.exe 所以我才模仿了一下,修改为 OpenOCD.exe 后仍旧是同样的报 ...
target/at32f4xx.cfg 这个地方请使用at32f403axx.cfg试一试 tanmingjin 发表于 2022-5-19 14:24
target/at32f4xx.cfg 这个地方请使用at32f403axx.cfg试一试
你好,这次可以了,谢谢你的解决办法,接下来我试一下拷贝对应文件到xpack的Openocd文件夹内,看看可否下载 tanmingjin 发表于 2022-5-19 14:24
target/at32f4xx.cfg 这个地方请使用at32f403axx.cfg试一试
你好,我把cfg文件(所有 OpenOCD_V2.0.0\scripts\board 目录下以 at32 开头的.cfg文件)拷贝到xpack版本的 xpack-openocd-0.11.0-2\scripts\target 文件夹后,使用 xpack-openocd-0.11.0-2\bin\openocd.exe 下载仍旧报错Error: flash driver 'at32f403axx' not found,请问有解决办法吗 Sancheese 发表于 2022-5-19 15:17
你好,我把cfg文件(所有 OpenOCD_V2.0.0\scripts\board 目录下以 at32 开头的.cfg文件)拷贝到xpack版本的 ...
这样是不行的,openocd.exe你要用2.0.0里面的程序才可以 tanmingjin 发表于 2022-5-19 15:31
这样是不行的,openocd.exe你要用2.0.0里面的程序才可以
好吧,原来是特定版本才能进行下载。希望官方开发后续能针对这个问题解决一下,merge到主流分支上
页:
[1]