This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

如何使用JTAG连接一个正在运行的Target Device

这两天在调试程序,需要使用JTAG连接一个正在运行的Target Device而不重新download 程序,以便直接查看当前寄存器的值。把学到的内容分享出来,方便大家遇到同样的情况时有个参考。

一、使用CCS如何实现

1. 使用CCS新建或打开一个同样target device的工程,当然也可以是在板子上正在运行程序的工程;

2. Properties->Debug->Program/Memory Load->去掉标红处的对勾.

3.Properties->Debug->Auto Run and Launch Option->去掉标红处的对勾.

4.Click debug as follows

5. 如果是与正在运行程序同一个工程,Run-> Load symbols-> .out file->Connect; 不仅可以查看寄存器值,还可以观察程序运行到哪里;如果不是同一个工程,只是同一个device,那么直接connect.

6. Pause,然后观察寄存器的值即可。

Note: 上面是我用的方法,之后在wiki上找到了参考,链接为:processors.wiki.ti.com/.../MSP430_-_Connecting_to_a_running_target

二、使用IAR如何实现

IAR 略有不同,

  1. Firstly download code to device, then pause, Emulator-> Check ‘Release JTAG on GO’; and then disconnect;
  2. Project > Options > Debugger
    1. 去掉 Run to main的对勾
  3. Project > Options > Debugger > Fet Debugger (setup tab)
    1. 选中“attach to running target”
  4. 重新编译工程,将正在运行的板子的JTAG连接至Debugger, 然后点击  ‘Debug without Downloading’, Pause to Check the Registers value.

如果大家还有不同的办法或建议,欢迎分享!!!O(∩_∩)O~