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.

CCS5 Debug Question

Other Parts Discussed in Thread: CONTROLSUITE

Good Morning,

Just wanted to ask if anyone had come across a nice step-by-step tutorial for simply monitoring a single variable within your code while its running?

From the stuff I've been reading, you basically click the bug after you've built your application and it changes to the CCS Debug Perspective.  I tried watching on offline recorded video tutorial but he was doing a lot of extra stuff and moving very quickly.  I see the View-> Variables window and I think that's what he was using along with some sort of grid like display but can't figure how to get variables into it.

Appreciate the feedback,

Don

  • Hi Don,

    Normally CCS would need to halt the target to read the contents of memory. Fortunately, you are using a device that supports a feature called real-time mode. This allows the debugger to make non-intrusive memory accesses to the target. Hence the debugger can read memory while the target is running.

    How to do this is covered in the C2000 CCS Fundamentals Workshop. It shows a step-by-step example of how to enable real-time mode to update variables while the target is running. It uses an example from controlSUITE so you could also follow along (instructions may vary slightly depending on what device you are using)

    See slides 104-111 of: http://downloads.ti.com/dsps/dsps_public_sw/sdo_ccstudio/workshops/CCSv5/C2000/CCSv5-Workshop%28C2000%29_2.pdf

    The Fundamentals workshop overall is a good way to get familiar with CCS. I would recommend going through all the material sometime in the future:

    http://processors.wiki.ti.com/index.php/CCSv5_Fundamentals_Workshop#C2000_.C2.A0

    Thanks

    ki

  • Hi Ki,

    Thanks for the quick response.  I went through the example and it worked perfect.

    Looks like what I really wanted to use was the Expressions view, not the Variables view.

  • Hi Ki,

    May have found an exception to everything working OK on your instructions.

    I've been able to watch global variables and specific memory addresses such as sys.FaultStatus and 0x0050 but when I select a local variable within a function say "int dummy" and select add watch expression I get errors in the expression window: Error: Identifier not found: dummy

    Is the process different for locals?  No compile problems or anything, I'm watching all the other working ones run in real-time mode just fine.

  • Don said:
    but when I select a local variable within a function say "int dummy" and select add watch expression I get errors in the expression window: Error: Identifier not found: dummy

    A local variable with automatic storage scope is allocated on the stack, and so I wouldn't have expected real-time mode to display such a variable since its address is not known statically.

  • Chester,

    Its good that you have the insight to have seen the behavior you would have expected.  

    I was really hoping however to get a little more feedback on how to correct my procedure so that I could monitor a local variable as my code is running.  You'll have to forgive my learning curve, as the example tutorial I followed worked for all instances thus far except this one.

  • Don said:
    I was really hoping however to get a little more feedback on how to correct my procedure so that I could monitor a local variable as my code is running.

    Chester is correct.

    The main issue is the the debugger is unable to accurately read the value on the stack pointer while the target is running. You can try entering the actual address of the variable and casting it in the expressions window. But that would only work well in simple cases where the that variable will always remain in scope (like in a loop) .

    ki