“CPU没有停止”和“未发现APB-AP”错误
当我使用 JTAG 将 C 代码加载到评估板时,它加载成功。但是,当我从 main() 执行代码时,我立即收到“CPU 未停止”错误,然后是“未找到 APB-AP”错误。
在出现此错误之前,我能够加载并执行 USB 相关代码。
我用谷歌搜索它并使用 JTAG 命令“rx 0”来重置目标,但它没有做出任何改变。
我使用的是 ARM Cortex-M3 处理器、J-Link ARM V4.14d、IAR 嵌入式工作台 IDE。
谢谢你的帮助。
When I use JTAG to load my C code to evaluation board, it loads successfully. However, when I executed my code from main(), I immediately got "CPU is not halted" error, followed by "No APB-AP found" error.
I was able to load and executed the USB-related code before I got this error.
I googled for it and use JTAG command "rx 0" to reset the target, but it does not make any change.
I am using ARM Cortex-M3 Processor, J-Link ARM V4.14d, IAR Embedded workbench IDE.
Thanks for ur help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
一种可能性:看门狗
如果您的硬件有看门狗,那么您必须确保当 JTAG 想要停止 CPU 时它不会重置 CPU。如果看门狗重置 CPU,您通常会收到您所描述的“CPU 未停止”类型的错误。
如果 CPU 有内部看门狗电路,在某些 CPU 上,当 JTAG 停止 CPU 时,它会自动“暂停”。但在其他情况下,这种情况不会发生,您需要确保在进行 JTAG 调试时禁用看门狗。
如果您的电路有一个位于 CPU 外部的看门狗电路,那么通常您需要能够以某种方式禁用它(通常硬件设计人员会在板上提供某种开关/跳线来执行此操作)。
One possibility: watchdog
If your hardware has a watchdog, then you must ensure that it does not reset the CPU when the JTAG wants to halt it. If the watchdog resets the CPU you would typically get a "CPU not halted" type of error you described.
If the CPU has an internal watchdog circuit, on some CPUs it is automatically "paused" when the JTAG halts the CPU. But on others, that doesn't happen, and you need to ensure the watchdog is disabled while doing JTAG debugging.
If your circuit has a watchdog circuit that is external to the CPU, then typically you need to be able to disable it in some way (typically the hardware designer provides some sort of switch/jumper on the board to do so).
您是否将 jtag 线重新用作 GPIO 线并破坏了 jtag 与芯片通信的能力?我就是用这种方法把stellaris板砖砌成的。
are you re-using the jtag lines as gpio lines and clobbering the jtags ability to communicate with the chip? I bricked a stellaris board that way.
确保代码中有此行:
WatchdogStallEnable(WATCHDOG0_BASE); // 当CPU停止时停止看门狗
Make sure you have this line in code:
WatchdogStallEnable(WATCHDOG0_BASE); // stop the watchdog when CPU stopped