普中开源电子分享网

 找回密码
 立即注册
搜索
查看: 1589|回复: 5

F407zgt6,CLion使用OpenOCD下载烧录问题

[复制链接]

1

主题

3

帖子

11

积分

新手上路

Rank: 1

积分
11
发表于 2023-7-3 09:42:45 | 显示全部楼层 |阅读模式
使用用CLion2023.1.3开发stm32,开发板是普中麒麟。对于hal版本的点亮led实验,使用普中ISP能免下载烧录成功。但配置使用OpenOCD来下载烧录报错,控制台完整的提示信息如下:



D:\meenv\OpenOCD-20230202-0.12.0\bin\openocd.exe -s D:\meenv\OpenOCD-20230202-0.12.0\share\openocd\scripts -f E:\devdocs\clionrelated\stm32codes\stm32demo2\stm32f4discovery.cfg -c "tcl_port disabled" -c "gdb_port disabled" -c "tcl_port disabled" -c "program \"E:/devdocs/clionrelated/stm32codes/stm32demo2/cmake-build-debug/stm32demo2.elf\"" -c reset -c shutdown
Open On-Chip Debugger 0.12.0 (2023-02-02) [https://github.com/sysprogs/openocd]
Licensed under GNU GPL v2
libusb1 09e75e98b4d9ea7909e8837b7a3f00dda4589dc3
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Info : CMSIS-DAP: SWD supported
Info : CMSIS-DAP: JTAG supported
Info : CMSIS-DAP: FW Version = 1.0
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 0 TDO = 1 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : clock speed 2000 kHz
Info : SWD DPIDR 0x2ba01477
Info : [stm32f4x.cpu] Cortex-M4 r0p1 processor detected
Info : [stm32f4x.cpu] target has 6 breakpoints, 4 watchpoints
Info : gdb port disabled
Error: timed out while waiting for target halted
embedded:startup.tcl:1467: Error: ** Unable to reset target **
in procedure 'program'
in procedure 'program_error' called at file "embedded:startup.tcl", line 1504
at file "embedded:startup.tcl", line 1467



主要的错误提示是:
Error: timed out while waiting for target halted
embedded:startup.tcl:1467: Error: ** Unable to reset target **


另外,使用的F407 OpenOCD配置文件内容如下:

source [find interface/cmsis-dap.cfg]
transport select swd
# increase working area to 64KB
set WORKAREASIZE 0x10000
source [find target/stm32f4x.cfg]
reset_config none separate


请各位老师赐教。
回复

使用道具 举报

1

主题

3

帖子

11

积分

新手上路

Rank: 1

积分
11
 楼主| 发表于 2023-7-3 09:49:15 | 显示全部楼层
使用的是开发板配套的普中仿真器。 不过,插到开发板上,中间的那个绿led灯(CNT)一直闪不停,不知是硬件有故障?
回复 支持 反对

使用道具 举报

1

主题

3

帖子

11

积分

新手上路

Rank: 1

积分
11
 楼主| 发表于 2023-7-5 09:45:04 | 显示全部楼层
经过反复尝试,参考普中官方的使用KEIL仿真时Debug的reset配置,结合OpenOCD命令的使用(手工分开执行,先openocd -f *.cfg启动服务后,再telnet 之后写入,再reset,shutdown就可以正常运行),基本可以确定问题在reset_config这块。

KEIL仿真时Debug的reset配置是sysresetreq,最新OpenOCD的board/stm32f4discovery.cfg这里srst_only就是模拟reset。
OpenOCD官方的原文如下:
System Reset: the SRST hardware signal resets all chips connected to the JTAG adapter, such as processors, power management chips, and I/O
controllers. Normally resets triggered with this signal behave exactly like pressing a RESET button。

怀疑可能是不能正确执行这个SRST,本人对普中麒麟407不熟悉,不知是否开发板哪里设置不正确,还是其它问题,请各位老师赐教。

回复 支持 反对

使用道具 举报

0

主题

1

帖子

4

积分

新手上路

Rank: 1

积分
4
发表于 2023-7-28 20:25:40 | 显示全部楼层
破案了,自带的烧写器有问题
换了个 Muse Lab 的 DAPLink 加个 JTAG转接板 cfg删掉reset设置就行

source [find interface/cmsis-dap.cfg]
transport select swd
source [find target/stm32f4x.cfg]
回复 支持 反对

使用道具 举报

0

主题

10

帖子

28

积分

新手上路

Rank: 1

积分
28
发表于 2023-8-8 15:26:44 | 显示全部楼层
放下电话,周小五想起自己请过无数人吃了数不清的饭,却唯独没有请父母吃过一顿饭!
父母一会儿工夫就赶了过来,看来是双色球走势图


叫了出租车。他们脸上全是笑容,丝毫没多想儿子为什么突然请澳洲幸运20他们出来吃饭,一家人第一次在家以外的地方一开奖网开奖结果起吃饭,吃一份最低档次的套餐。

回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

站长推荐上一条 /1 下一条

Archiver|手机版|小黑屋|普中开源电子分享网 粤ICP备16123577号-2

GMT+8, 2024-5-2 10:48 , Processed in 0.096180 second(s), 33 queries .

Powered by 论坛搭建 X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表