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.

CCS/MSP432E401Y: Scripting Console for DSS: Profiling events

Part Number: MSP432E401Y

Tool/software: Code Composer Studio

Hi

I am using the scripting console in DSS and I would like to programmatically find the number of clock cycles between two breakpoints. I believe the methods in the ProfileClock/Memory would help me. However, in the console, it says the methods are not available. I tried a bunch of commands below. Please help.

Shantanu

  • Hello,
    a profile clock instance already exists with an active debug session. Hence you can do something like:

    js:> activeDS.clock.enable()

    js:> activeDS.clock.read()
    0

    The first call enables the profile clock. The second call reads it. activeDS is the current debug session if you manually started a debug session in CCS. Otherwise substitute activeDS with your debug session object.

    Thanks
    ki
  • Is this valid across all platforms? Eg. ARM, C2000, etc?
  • Shantanu Sampath63 said:
    Is this valid across all platforms? Eg. ARM, C2000, etc?

    It depends on the device and CCS version.
    For example, for Cortex-M devices (which is what an MSP432 is), you need to be using the latest CCS version (CCSv8.0.0). The profile clock is not supported on earlier versions for Cortex-M.
    Thanks
    ki
  • So how exactly do I get the cycle count?
  • Via scripting console, see the example below:

    The first line enables the profile clock

    The second line runs the target to a breakpoint I set earlier

    The third line reads the profile clock and returns the cycle count from the time I ran the target to when it hit the breakpoint (1926 cycles)

    Thanks

    ki

  • note that you don't have to enable the clock every time. You can just enable it once and use the other apis to reset the clock value , etc