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.

LAUNCHXL-CC26X2R1: 如何使用CCS调试正在运行程序的目标板?

Part Number: LAUNCHXL-CC26X2R1

我目前想在CC26x2 launchpad 蓝牙AOA UI例程运行时调试板子,按照此文章e2echina.ti.com/.../faq-ccs-cc2640r2f-cc26x2的做法可以成功在不打断代码运行情况下在CCS中查看板子各寄存器的状态和一些全局变量的值。

但此状态下不能进行断点、单步运行等调试,只能添加或者观测一些全局变量,看不到一些想观测的局部变量,也看不到程序暂停时停留的代码位置。这个有办法解决吗?

  • 局部变量或仅在有限范围内有效的变量只能在该范围内查看

    Local variables are often placed in CPU registers and not on the stack. These variables also have a limited lifetime even within the scope in which they are valid. Depending on the optimization performed, a variable placed in a register may not have a cohesive view of the current state of the variable. Some possible solutions are:

    • Move the variable to global scope, so it remains accessible in RAM.
    • Make the variable volatile, so the compiler doesn’t place the value in a register.
    • Make a shadow copy of the variable that is global and volatile.
  • 那么断点调试功能在这种情况下也无法使用了?

  • 局部变量观测参考上面提到的方法