STM32F103出现CPU could not be halted问题的解决方案

问题描述:

**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
***JLink Error: Can not read register 16 (XPSR) while CPU is running
***JLink Error: Can not read register 17 (MSP) while CPU is running
***JLink Error: Can not read register 18 (PSP) while CPU is running

***JLink Error: Can not read register 20 (CFBP) while CPU is running


解决方案

将HAL_MspInit()的__HAL_AFIO_REMAP_SWJ_DISABLE();注释掉,换成
__HAL_AFIO_REMAP_SWJ_NOJTAG();

  • 5
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 3
    评论
引用\[1\]和\[2\]中提到了在使用Jlink V8调试FL2440时,执行setpc 0命令时出现了"CPU is not halted!"的错误提示。这个错误提示意味着CPU没有停止运行,导致无法执行相应的调试操作。可能的原因是JTAG连接不稳定或者芯片的硬件问题。为了解决这个问题,可以尝试以下几个步骤: 1. 检查JTAG连接:确保JTAG连接器正确插入,并且连接稳定。可以尝试重新插拔JTAG连接器,或者更换连接器来排除连接问题。 2. 检查芯片硬件:确保芯片的硬件电路没有问题。可以检查供电电压、时钟信号等是否正常。如果可能的话,可以尝试使用其他芯片进行调试,以确定是否是芯片本身的问题。 3. 更新调试工具驱动:如果使用的是Jlink调试工具,可以尝试更新Jlink驱动到最新版本。有时候旧版本的驱动可能存在一些问题,更新到最新版本可能会解决一些兼容性问题。 4. 检查调试工具设置:确保调试工具的设置正确。可以检查调试工具的配置文件,确认是否有错误的设置或者缺少必要的配置。 总结起来,"CPU is not halted!"错误提示可能是由于JTAG连接不稳定、芯片硬件问题、调试工具驱动问题或者配置错误所导致的。通过检查JTAG连接、芯片硬件、更新驱动以及确认调试工具设置,可以尝试解决这个问题。 #### 引用[.reference_title] - *1* [FL2440使用J-Link烧写Nand> Flash遇到CPU is not halted!](https://blog.csdn.net/weixin_34041003/article/details/90682576)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [keil仿真调试报错](https://blog.csdn.net/litchi_3/article/details/129925398)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [解决keil出现cpu is not halted && cannot read register XX while cpu is running的另类方法](https://blog.csdn.net/AgonyRR/article/details/98875004)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Justice_Gao

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值