简体   繁体   English

如何调试ROM中存在的代码?

[英]How to debug code which is present on ROM?

I wanna know if normal practice of setting the breakpoints, step-in & step-out works same for the code which reside on ROM also. 我想知道设置断点,进入和退出的正常做法是否也适用于驻留在ROM中的代码。 Do we have to do something extra for ROM debugging. 我们是否需要为ROM调试做一些额外的事情。

It will depend largely on the processor an the debug hardware you use. 这将在很大程度上取决于处理器和您使用的调试硬件。 Many microcontrollers include on-chip debug hardware that includes hardware breakpoints that are essentially program-counter comparators. 许多微控制器包括片上调试硬件,该片上调试硬件包括实际上是程序计数器比较器的硬件断点。 Other facilities may be supported such as data access break-points and instruction trace - essentially an on-chip in-circuit emulator (ICE). 可以支持其他功能,例如数据访问断点和指令跟踪-本质上是片上在线仿真器(ICE)。

Hardware breakpoints are a necessarily limited resource; 硬件断点是必不可少的资源。 for example ARM7 devices have just two while ARM Cortex-M3/4 are endowed with eight. 例如,ARM7设备只有两个,而ARM Cortex-M3 / 4具有八个。

Either way, to utilise on-chip debug you require suitable debugger hardware (often via JTAG, or a vendor proprietary interface) to interface the target to the host debugger software. 无论哪种方式,要利用片上调试,都需要合适的调试器硬件(通常通过JTAG或供应商专有接口)将目标设备与主机调试器软件接口。

For chips without on-chip debug, you typically use an in-circuit emulator. 对于没有进行片上调试的芯片,通常使用在线仿真器。 This is debug hardware that connects to the target board in place of the processor and can be controlled directly by the host debug software. 这是调试硬件,代替处理器连接到目标板,并且可以由主机调试软件直接控制。 The emulator hardware executes instructions identically to the actual processor but can be halted and stepped and have breakpoints set. 仿真器硬件执行的指令与实际处理器相同,但可以暂停和步进并设置断点。 Essentially the ICE works like a special version of the target processor with debug support. 本质上,ICE的工作方式类似于带有调试支持的目标处理器的特殊版本。 A true ICE is uncommon on modern processors since on-chip debug capabilities are almost ubiquitous even on small devices such as PIC and AVR, however some external debug hardware can support features not available on on-chip debug. 真正的ICE在现代处理器上并不常见,因为即使在诸如PIC和AVR之类的小型设备上,片上调试功能也几乎无处不在,但是某些外部调试硬件可以支持片上调试所不具备的功能。 For example Segger's J-Link supports unlimited break-points on ARM7 and Cortex-M3/4. 例如,Segger的J-Link在ARM7和Cortex-M3 / 4上支持无限的断点

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM