shotstar 发表于 2010-12-7 10:43:51

STM32 JLINK 用SW口调试出现问题(可以连接板子但是无法下载),用JTAG不会有问题

有时候能下载有时候就不行!

连接使用4根线:
VCC
GND
P13
P14

可以连接到板子
http://cache.amobbs.com/bbs_upload782111/files_35/ourdev_602841VC4L5W.JPG
(原文件名:22.JPG)
下载出现问题:
http://cache.amobbs.com/bbs_upload782111/files_35/ourdev_602844IBXSKO.JPG
(原文件名:11.JPG)
Build target 'Target 1'
linking...
Program Size: Code=17396 RO-data=704 RW-data=124 ZI-data=2820
FromELF: creating hex file...
"..\List\ADC.axf" - 0 Error(s), 0 Warning(s).
Load "..\\List\\ADC.AXF"

JLink info:
-----------
DLL: V4.11i, compiled Jan 28 2010 19:55:25
Firmware: J-Link ARM V8 compiled Dec1 2009 11:42:48
Hardware: V8.00
S/N : 68000019
Feature(s) : RDI, FlashDL, FlashBP, JFlash, GDBFull
---
* JLink Info: Found SWD-DP with ID 0x1BA01477
* JLink Info: TPIU fitted.
* JLink Info:   FPUnit: 6 code (BP) slots and 2 literal slots
* JLink Info: Found SWD-DP with ID 0x1BA01477
* JLink Info: TPIU fitted.
* JLink Info:   FPUnit: 6 code (BP) slots and 2 literal slots

Target info:
------------
Device: STM32F103C8
VTarget = 3.242V
State of Pins:
TCK: 0, TDI: 0, TDO: 0, TMS: 0, TRES: 1, TRST: 1
* JLink Info: Found SWD-DP with ID 0x1BA01477
* JLink Info: TPIU fitted.
* JLink Info:   FPUnit: 6 code (BP) slots and 2 literal slots
Hardware-Breakpoints: 6
Software-Breakpoints: 2048
Watchpoints:          4
JTAG speed: 200 kHz
---
* JLink Info: Found SWD-DP with ID 0x1BA01477
* JLink Info: TPIU fitted.
* JLink Info:   FPUnit: 6 code (BP) slots and 2 literal slots
***JLink Error: Can not read register 15 (R15), CPU may not be halted
**JLink Warning: T-bit of XPSR is 0 but should be 1. Changed to 1.
***JLink Error: Can not read register 20 (CFBP), CPU may not be halted
**JLink Warning: Could not read memory location 0x20000000 when trying to set soft RAM BP
Cannot setup Breakpoint at Address
***JLink Error: Can not read register 20 (CFBP), CPU may not be halted
**JLink Warning: T-bit of XPSR is 0 but should be 1. Changed to 1.
Erase Failed!

b54wco 发表于 2010-12-7 21:58:31

我也遇到类似问题,帮顶

zhou_1989 发表于 2010-12-7 22:17:57

没接复位,似乎

skoo 发表于 2010-12-7 22:37:59

同问.是不是芯片坏了?

cyxavr 发表于 2010-12-7 22:38:13

复位选择SYSRESETREQ
还有在DOWNLOAD TO FLASH 前打钩
估计这样就可以了。

shotstar 发表于 2010-12-8 08:46:57

TO 【3楼】 skoo
芯片没有坏我现在只能用串口ISP
TO【4楼】 cyxavr 又一天

照你的设置还是不行 ,上图
http://cache.amobbs.com/bbs_upload782111/files_35/ourdev_603103GLG6K9.JPG
(原文件名:1.JPG)

http://cache.amobbs.com/bbs_upload782111/files_35/ourdev_603104ECT32U.JPG
(原文件名:2.JPG)
http://cache.amobbs.com/bbs_upload782111/files_35/ourdev_603106X7RLLL.jpg
(原文件名:3.jpg)



* JLink Info:   FPUnit: 6 code (BP) slots and 2 literal slots
* JLink Info: Found SWD-DP with ID 0x1BA01477
* JLink Info: TPIU fitted.
* JLink Info:   FPUnit: 6 code (BP) slots and 2 literal slots

Target info:
------------
Device: STM32F103C8
VTarget = 3.242V
State of Pins:
TCK: 0, TDI: 0, TDO: 0, TMS: 0, TRES: 1, TRST: 1
* JLink Info: Found SWD-DP with ID 0x1BA01477
* JLink Info: TPIU fitted.
* JLink Info:   FPUnit: 6 code (BP) slots and 2 literal slots
Hardware-Breakpoints: 6
Software-Breakpoints: 2048
Watchpoints:          4
JTAG speed: 200 kHz
---
* JLink Info: Found SWD-DP with ID 0x1BA01477
* JLink Info: TPIU fitted.
* JLink Info:   FPUnit: 6 code (BP) slots and 2 literal slots
**JLink Warning: T-bit of XPSR is 0 but should be 1. Changed to 1.
Erase Failed!

shotstar 发表于 2010-12-9 08:37:32

自己顶一下

b260123292 发表于 2010-12-10 12:47:14

请检查是否把3.3V接到了JTAG的一脚

shotstar 发表于 2010-12-13 12:47:36

【7楼】 b260123292
请检查是否把3.3V接到了JTAG的一脚
_____________________________--
3.3V没有的

【8楼】 topdreams 长风破浪
ba rst 引过来看看
------------------------
可以试一下

shangdawei 发表于 2010-12-13 14:17:17

先用 jflasher 把 flash 擦除, 然后在测试看看

pldjn 发表于 2010-12-13 14:57:44

复位的问题,只接个电阻和电容就好了,原来遇到过此类问题

liuswallow 发表于 2010-12-22 21:29:43

mark

shotstar 发表于 2010-12-31 11:00:33

【11楼】 pldjn
怎么连接?

shotstar 发表于 2010-12-31 11:01:14

rest 脚上接?

shotstar 发表于 2011-1-6 18:04:16

自己顶一下

haozi_1989 发表于 2011-1-7 13:07:23

回复【15楼】shotstar无缘流星
-----------------------------------------------------------------------

和楼主一样的问题,也是C8的片子,提示**JLink Warning: CPU could not be halted寻求解决中,另外就是ZE的片子SW连接没问题,Jtag死活连不上,郁闷中。

shotstar 发表于 2011-1-7 16:41:59

希望 碰到过的帮忙一下

haozi_1989 发表于 2011-1-7 19:57:12

回复【16楼】haozi_1989
-----------------------------------------------------------------------

继续观望中,谈谈今天的进展,今天重新焊了一块板子,竟然是可以的,但是发现非常不稳定,使用sW好几次才能下载进去一次,而且芯片复位不正常,按10次复位按键有三次不能复位,吧复位电容换成103的也不行,而同样的电路在ZET6的片子上却完全没有问题。表示很郁闷。

skoo 发表于 2011-1-7 20:07:05

Error: Flash Download failed - "Cortex-M3"终极答案:

芯片被加密,请用串口方式或通用编程器擦空芯片即可解决。

shotstar 发表于 2011-1-7 21:35:11

19楼】 skoo
现在都是用串口下载的 用串口擦空过芯片也不行

【18楼】 haozi_1989
跟你一样新焊接的有些可以但是 很不稳定

hujian228 发表于 2011-1-7 21:53:01

我用的是BHS STM32开发板,板子自带JLINKV7,刚才试过了,SW方式仿真和下载都正常。

shotstar 发表于 2011-1-9 09:41:40

【21楼】 hujian228
你连接了几根线啊

yaya001 发表于 2011-1-9 09:54:54

mark

skynet 发表于 2011-1-9 09:59:40

持续关注,楼主最终解决没有?

haozi_1989 发表于 2011-1-9 16:49:54

回复【20楼】shotstar无缘流星
-----------------------------------------------------------------------

http://www.ourdev.cn/bbs/bbs_content.jsp?bbs_sn=4502079&bbs_page_no=1&search_mode=3&search_text=haozi_1989&bbs_id=9999
我的问题总结了一些,觉得这问题出的还是有点诡异的,继续探索中。

b260123292 发表于 2011-1-10 17:26:14

确认你的VCC是接到JTAG的1号脚?

shotstar 发表于 2011-1-11 08:56:33

【26楼】 b260123292
确认你的VCC是接到JTAG的1号脚?
--------------------------------
VCC接了 看LZ位

shotstar 发表于 2011-1-11 11:54:38

换一个100脚的 stm32f103VB一模一样的电路 SW口 10M飞奔 很稳定 不知道什么原因

hy317 发表于 2011-1-11 12:00:49

把时钟频率降低试试看

shotstar 发表于 2011-1-11 12:49:44

目前 c8用的是200k 以及比较低了 50k也试过 没用啊

amateur1987 发表于 2011-3-31 17:49:20

./emotion/em001.gif

PXJ_520 发表于 2011-4-9 13:56:21

mark

wuyiduan 发表于 2011-5-20 10:34:40

晕死
我用SW下载,有时候好有时候坏
已经做了1K多套了
下好的程序再下都有可能下不了,多搞几次芯片都发烫
还有串口也时而能接收时而不工作,但是其他功能好的,串口发送都可以

后面的订单2K,都不敢做了
-----------------------------------------------

fenfeifenfeiff 发表于 2011-5-27 19:57:48

请问有人解决过这个问题吗?我也遇到同样的问题,菜鸟求助!

gxnuzyl 发表于 2011-6-8 00:41:02

我的也是C8,500K以下的速度很稳定,高于500K就不行了,只接了VDD,GND,PA13,PA14;在ZE上同样的设置可以最大上到10M,实际下载时是4M。
http://cache.amobbs.com/bbs_upload782111/files_40/ourdev_646671CEIGQT.jpg
使用C8时SW设置截图 (原文件名:SW设置截图.jpg)

http://cache.amobbs.com/bbs_upload782111/files_40/ourdev_646672W9XDA5.jpg
使用ZE时SW设置截图 (原文件名:使用ZE时SW设置截图.jpg)

wingoing 发表于 2011-7-12 21:01:04

mark,我也遇到了这样问题,不知道咋办啊!

scofiled 发表于 2011-9-16 14:20:48

遇到同样的问题

是PCB板上的 sw线太长, 降低速度到500k就可以了

fkepdcjgd 发表于 2011-9-20 15:14:53

我现在正是这样,不知是怎么回事,只是不能下载flash,我接的6线,用SW和JTAGE都是一样的.

fkepdcjgd 发表于 2011-9-20 15:15:59

回复【19楼】skoo
-----------------------------------------------------------------------

那用哪个工具可以解决呀,

yuhongshuai 发表于 2011-9-20 22:47:53

同问,,一手关注,一手摸索。。。

trent5145 发表于 2011-10-17 09:56:00

也是这个问题的路过,求真相

imjacob 发表于 2011-10-18 23:08:32

mark

Eiman 发表于 2011-10-20 23:59:28

我也遇到刚解决了.我的是JlinkV8+3合1的STM32小板通过JTAG相连的.设置改成这样即可,其它任何都不用改.硬件也不用改任何东西.
http://cache.amobbs.com/bbs_upload782111/files_46/ourdev_686817QVBJ8B.jpg
(原文件名:QQ截图20111020235505.jpg)

MyOS 发表于 2011-10-21 08:29:06

mark

cloud-cloud 发表于 2011-10-21 09:58:39

关注

xiaowan901108 发表于 2011-10-21 11:19:05

有帮助 顶

aleda303 发表于 2011-10-27 13:28:20

我只用了三条线,现在没发现问题

limber123 发表于 2011-10-27 16:27:18

三条线?学习了,呵呵

fishb00ne 发表于 2012-1-7 19:46:29

焊接问题

xfcylyf 发表于 2012-5-29 15:36:46

看来SW不太稳定啊,暂时还是别用了,老老实实用JTAG吧

wqm521216 发表于 2012-5-29 20:49:25

⊙﹏⊙b汗,现在的人太浮躁了,自己的问题非说芯片问题。12楼说的很清楚了,是复位问题,只要用阻容复位电路就行了,非说SWD下载不稳定。

hy317 发表于 2012-5-29 20:57:46

连接线的问题,如果是用的排线,GND在中间就不会有问题

lxl_lw 发表于 2012-7-7 15:01:40

我也是遇到了这样的问题,猜测是选择的速度太快了,降低频率试试就可以了。

njchenmin 发表于 2012-7-8 05:18:13

我一直用四线SW,VET6,很稳定,你的是不是SW线长了。

lanshh 发表于 2012-7-30 16:11:37


最近也是碰到了这个问题
速率大了

xfcylyf 发表于 2012-8-20 12:11:44

遇到同样问题:
JLink info:
------------
DLL: V4.15n, compiled Jun 18 2010 19:55:09
Firmware: J-Link ARM V8 compiled Sep 22 2011 16:23:23
Hardware: V8.00
S/N : 20100214
Feature(s) : RDI,FlashDL,FlashBP,JFlash,GDBFull

* JLink Info: Found SWD-DP with ID 0x1BA01477
* JLink Info: TPIU fitted.
* JLink Info:   FPUnit: 6 code (BP) slots and 2 literal slots
**JLink Warning: T-bit of XPSR is 0 but should be 1. Changed to 1.
ROMTableAddr = 0xE00FF003

Target info:
------------
Device: STM32F103V8
VTarget = 3.306V
State of Pins:
TCK: 0, TDI: 0, TDO: 0, TMS: 0, TRES: 1, TRST: 1
* JLink Info: Found SWD-DP with ID 0x1BA01477
* JLink Info: TPIU fitted.
* JLink Info:   FPUnit: 6 code (BP) slots and 2 literal slots
Hardware-Breakpoints: 6
Software-Breakpoints: 2048
Watchpoints:          4
JTAG speed: 1000 kHz

**JLink Warning: T-bit of XPSR is 0 but should be 1. Changed to 1.
**JLink Warning: T-bit of XPSR is 0 but should be 1. Changed to 1.
Erase Failed!
好几天了,解决不了。请教各位高见......

377900751 发表于 2012-8-20 15:39:49

我也是,JTAG模式全正常,SWD模式能连接不能下载,怎么回事??

377900751 发表于 2012-8-20 15:41:02

点击AutoClk时,JLink灯都不亮了,半天才反应过来

aureole 发表于 2012-8-20 17:44:00

没连接复位线,设置复位就设置成 normal就行,不要设置成 HW

wqm521216 发表于 2012-8-20 18:15:08

把复位引脚上的上拉电阻去掉试一下SW能不能下载。

unifax001 发表于 2012-8-21 16:24:51

我也遇见过 jtag貌似真的比swd靠谱

shhfxb 发表于 2012-9-23 21:34:26

JTAG一般用标准2×10插座,抗干扰能力会好一点。SW线少,在小板上一般是经过简化的,所以扁线要尽可能短一点,SW两根线两边用GND线包围,板上插口离CPU也要近一点。

zchong 发表于 2012-9-23 22:19:31

4线,复位设置成Core and peripherals,用着挺好

我不乐意啊 发表于 2012-10-7 00:57:34

我出现这问题,怎么回事啊?

Target info:
------------
Device: STM32F103ZE
VTarget = 3.287V
State of Pins:
TCK: 0, TDI: 1, TDO: 1, TMS: 0, TRES: 1, TRST: 1
* JLink Info: Found SWD-DP with ID 0x1BA01477
* JLink Info: Found SWD-DP with ID 0x1BA01477
**JLink Warning: No matching core found.
Hardware-Breakpoints: 0
Software-Breakpoints: 2048
Watchpoints:          0
JTAG speed: 4000 kHz

**JLink Warning: CPU could not be halted
* JLink Info: Program size too small. Flash download skipped.
***JLink Error: Can not read register 20 (CFBP) while CPU is running
**JLink Warning: CPU could not be halted
**JLink Warning: Could not read memory location 0x20000000 when trying to set soft RAM BP
***JLink Error: Could not start CPU core. (ErrorCode: -1)
Cannot setup Breakpoint at Address
***JLink Error: Can not read register 20 (CFBP) while CPU is running
**JLink Warning: CPU could not be halted
**JLink Warning: Could not read memory location 0x20000000 when trying to set soft RAM BP
***JLink Error: Could not start CPU core. (ErrorCode: -1)
Cannot setup Breakpoint at Address
Erase Failed!

哪浀、佷羙 发表于 2012-10-27 14:38:42

出同样问题的路过,仍未找到原因、、、

vickyphan 发表于 2012-10-27 17:29:19

这个必须mark下

Kidult 发表于 2013-3-29 13:43:41

pldjn 发表于 2010-12-13 14:57 static/image/common/back.gif
复位的问题,只接个电阻和电容就好了,原来遇到过此类问题

能说清楚一些吗?

mcuyrj 发表于 2013-4-3 18:24:18

fkepdcjgd 发表于 2011-9-20 15:14 static/image/common/back.gif
我现在正是这样,不知是怎么回事,只是不能下载flash,我接的6线,用SW和JTAGE都是一样的. ...

JLINK   第1引脚 必须接3.3V

adce 发表于 2013-4-4 04:39:09

RST还是要接的....VCC可以不接....要不每次下载都得手动按复位....
SW的线可以长...如果是排线或是手捆线...多几个地线....
如果不是建议用USB线或网线...
排线能到80cm...正在用....

zhourdev 发表于 2013-7-15 19:35:15

我也出现了同样的问题.

跟复位的设置有关.

把 JTAG,Setting,Debug中的reset设成"Normal"就解决了.

why800 发表于 2013-8-16 15:05:56

我也遇到这个问题,芯片肯定没有损坏。不要贸然更换芯片,虽然更换后能能够解决。

上面有位兄弟说的对,设置为串口BOOTLOADER启动,用串口ISP写一次就搞定了。

横刀观沧海 发表于 2013-8-22 09:56:05

出现同样的问题,仍然找不到原因,希望有大神给指点迷津

横刀观沧海 发表于 2013-8-22 10:14:35

楼主,最后怎么解决的啊

风轻云淡~ 发表于 2013-9-18 15:36:47

我也出现类似错误,两天了,下不了软件,中秋节都没心情了。。。

jasongwq 发表于 2013-9-18 15:44:26

        RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO,ENABLE);
        GPIO_PinRemapConfig(GPIO_Remap_SWJ_JTAGDisable , ENABLE);
楼主的程序里有没有这句话啊?

yuanbuqi 发表于 2014-1-17 21:29:44

出现和楼主一样的问题,降低速度后可以下载了

bass 发表于 2014-1-17 22:23:12

换个驱动版本 或者软件 我以前也遇过 就这样解决了

zhourdev 发表于 2014-1-18 10:42:17

zchong 发表于 2012-9-23 22:19
4线,复位设置成Core and peripherals,用着挺好

按你的建议试了,问题解决了.

justdomyself 发表于 2014-1-21 09:49:47

刚试了以下用jlink的1、5、7、20脚分别对应接上即可   500khz高了就不行就是这种错误

justdomyself 发表于 2014-1-21 11:06:55

刚试了以下用jlink的1、5、7、20脚分别对应接上即可   500khz高了就不行就是这种错误

huyhuyhuy 发表于 2014-2-19 09:44:00

复位脚是要接的 否者就这样 还有不能进中断仿真。

marrt.80 发表于 2015-1-9 11:10:40

解决方法:
我做项目时也出现此情况:
**JLink Warning: CPU could not be halted
***JLink Error: Can not read register 15 (R15) while CPU is running
***JLink Error: Can not read register 16 (XPSR) while CPU is running
***JLink Error: Can not read register 0 (R0) while CPU is running
***JLink Error: Can not read register 1 (R1) while CPU is running
***JLink Error: Can not read register 2 (R2) while CPU is running
***JLink Error: Can not read register 3 (R3) while CPU is running
***JLink Error: Can not read register 4 (R4) while CPU is running
***JLink Error: Can not read register 5 (R5) while CPU is running
***JLink Error: Can not read register 6 (R6) while CPU is running
***JLink Error: Can not read register 7 (R7) while CPU is running
***JLink Error: Can not read register 8 (R8) while CPU is running
***JLink Error: Can not read register 9 (R9) while CPU is running
***JLink Error: Can not read register 10 (R10) while CPU is running
***JLink Error: Can not read register 11 (R11) while CPU is running
***JLink Error: Can not read register 12 (R12) while CPU is running
***JLink Error: Can not read register 13 (R13) while CPU is running
***JLink Error: Can not read register 14 (R14) while CPU is running
***JLink Error: Can not read register 15 (R15) while CPU is running

楼上各位方法我都试了,都是无效的。因为硬件和硬件设置都没问题。这个电路和设置做过几个产品了,但每次都都有意避开BOOT0与BOOT1引脚,
这次因PCB时就近用了BOOT1并初始化,只要操作BOOT1就会出现上述情况。

382249937@qq.co 发表于 2015-4-29 20:15:09

mark!!!

彬彬啡礼 发表于 2015-5-8 10:24:51

学习了。

lonesomely 发表于 2015-5-12 16:11:59

标记一下

男小北 发表于 2015-8-25 14:32:02

复位电路问题

lingjun1015 发表于 2017-7-4 09:34:18

zhourdev 发表于 2014-1-18 10:42
按你的建议试了,问题解决了.

这招有效!又一次被画PCB的给坑了,还以为软件问题。昨天好好地,今天死活就不是无法下载无法仿真!!!!!!!

蛋定 发表于 2019-1-7 00:10:27

遇到同样的问题,还没有解决。。。

fkuelong 发表于 2024-4-10 11:58:35

我也遇到这个问题,我用V12隔离版本,下载程序时,也出去这个问题, 但我用V9 是正常的频率2M,也没找到原因
页: [1]
查看完整版本: STM32 JLINK 用SW口调试出现问题(可以连接板子但是无法下载),用JTAG不会有问题