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/MSP432P4111: Counting clock cycles with CCS9.2 on the MSP432

Part Number: MSP432P4111
Other Parts Discussed in Thread: MSP-FET

Tool/software: Code Composer Studio

I'm trying to use Code Composer to count clock cycles between breakpoints.

I've tried enabling the Profile Clock by clicking on "Run->Clock->Enable", but the clock always shows "0", and enabling the clock prevents me from being able to re-load code.  I need to disconnect, reconnect, disable the clock, disconnect, then reconnect again before I can reload.

I found this article on clock counting:  software-dl.ti.com/.../ccsv7_counting_cycles.html

The problem is when I click on the down arrow next to the "new breakpoint" button I don't see "count event" in the list of choices, I only see "Breakpoint", "Hardware Breakpoint", "Profile Control Point", "Watchpoint (read or write)", "Watchpoint with data".  I do not see "count event".

What's the best way to count cycles between breakpoints on my setup?  Thanks.

  • Does it work on a trivial program?

    I have a MSP432P4111 LaunchPad.  I have the simple program shown below.

    I launched the debug session for my project.

    From the Run menu I selected Clock -> Enable

    The clock then shows up at the bottom

    I placed a breakpoint on line 24.

    I then run.

    I get 29 in the clock.

    Each time I run after that the clock goes up by 20.

    For my test I just created a new project with the Project wizard and then added this code to the main.c

    #include "msp.h"
    
    /**
     * main.c
     */
    void main(void)
    {
        volatile int i = 0;
        volatile int j = 0;
    	WDT_A->CTL = WDT_A_CTL_PW | WDT_A_CTL_HOLD;		// stop watchdog timer
    
    	while(1) {
    	    if (i<1000) {
    	        i++;
    	        j=i-1;
    	    }
    	    else {
    	        i=0;
    	        j=0;
    	    }
    	    j=i;
    	}
    }

    I am worried that your breakpoint list is shorter than mine.  This is what I see:

    What kind of debug probe are you using?  The LaunchPad has an XDS110 on it.  Any XDS probe should work.  If you are using an MSP-FET it is quite possible that the capabilities are limited.

    Regards,

    John

  • John,

    I think you're onto something because we're using the MSP-FET.  We've found other issues, so we've purchased an XDS110, which may provide better clock-based profiling.

    Thanks.

  • Let me know if you run into issues with your xds110.  

    Regards,

    John

  • Hi John,

    I have verified that the profile clock functions as expected on the XDS110.

    Thank you