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.

MSP430F2619: How to generate code coverage report

Part Number: MSP430F2619

I used -gen_profile_info in the compiler options (under properties linker and then edit flags and adding gen profile info) generate a build that runs with no error but does have a warning.

Description Resource Path Location Type
#10247-D creating output section ".ppdata" without a SECTIONS specification hfx2_project C/C++ Problem

I run the debugger successfully and check the worksspace and there isn't a .pdat file.

I also tried adding --use_profile_info=file.prf into the compiler option that didn't generate a .prf either.

Not sure what i'm doing wrong any insight would be great.

I'm using a msp-ts430m64 evaluation board and a msp430 usb debug ineterface msp-feet430uif. I'm using code composer studio version 12.7.1.00001

Thanks in advance

Edit :

Some good news.

Ok so i was able to update get a .dat report but i'm unable to get a .prf file. I've tried using TI_PROFDATA that didn't work. I also tried TI_PROFDATA with TI_PROFDATA --analyze=codecov and also with --analyze=codecov and both didn't work. What exactly am i doing wrong? I also tried to set TI_COVDIR AND COVDATA to a location and a name and both didn't work. Any suggestions would be great.

Edit 2:

I found this and followed it (https://software-dl.ti.com/ccs/esd/documents/application_notes/appnote-code_coverage_compiler.html). The csv generated shows a frequency of 0 for everything when i can obviously see the led blink. I am using  _TI_start_pprof_collection(); and  _TI_stop_pprof_collection(); within the code. I get errors when i build collect but the guide says that is expected and i do get a .csv file generated. Why is frequency for everything if i'm see the led blink so the code is obviously doing something? Any insight would be amazing. Thanks

  • Hello,

    I have brought this thread to the attention of the compiler experts. They will be able to assist further.

    Thanks

    ki

  • I presume you fixed ...

    #10247-D creating output section ".ppdata" without a SECTIONS specification

    Please try to run a simple program that only performs ...

        puts("Does this string get printed?");

    What happens?  If it doesn't work, then try some of these Tips for using printf.

    Thanks and regards,

    -George

  • Yes I was able to get the .pdat file, .prf and csv file. But the .csv file shows a frequency of 0 for everything. When i attempt to build with the analyze configuration it fails. The debugger fails as well. I tried putting

        puts("Does this string get printed?");

    in my code and was able to see it as an entry in the csv when i attempt to build the analyze configuration. But the frequency is 0.In the .csv everything is 0. In the collect configuration when i try puts or printf i do not see it print to the console.  

    I also tried the code by itself (attempting to print to console) and nothing. prints. in my code i can physically see the evaluation board led lightup so i can confirm the code is working/blinking the led.

  • Please create a new program, entirely separate from the current one, where all of the code is ...

    #include <stdio.h>
    
    int main()
    {
        puts("Does this string get printed?");
        return 0;
    }    

    When it works correctly, that string appears in the Console view.  If that does not happen, then please try the Tips for using printf.

    Thanks and regards,

    -George

  • I was able to get it to print to console by changing the heap and stack size to 300. I then set my collect and analyze configurations heap and stack size to 300 and reran with my original code (blink led, _TI_start_pprof_collection(); and  _TI_stop_pprof_collection(); called) and still saw the .csv with frequency of 0 for every entry (the entries match the code).

  • Here's the code that i have

    #include <stdio.h>
    #include <msp430.h>
    
    volatile unsigned int i;
    volatile unsigned long j = 0;
    
    int main(void)
    {
    
    
    //    WDTCTL = WDTPW + WDTHOLD;                 // Stop WDT
    //
    //    puts("Does this string get printed?");
    //    printf("hello world");
    //    return 0;
    
      _TI_start_pprof_collection();
    
      WDTCTL = WDTPW + WDTHOLD;                 // Stop WDT
    
      P5DIR |= 0x10;                            // P5.4= output direction
      P5SEL |= 0x10;                            // P5.4= MCLK option select
      P1DIR |= 0x01;                            // P1.0 = output direction
      //P1DIR |= 0x02;                            // P1.1 = output direction
    
      BCSCTL1 &= ~XT2OFF;                       // Activate XT2 high freq xtal
      BCSCTL3 |= XT2S_2;                        // 3   16MHz crystal or resonator
      do
      {
        IFG1 &= ~OFIFG;                         // Clear OSCFault flag
        for (i = 0xFF; i > 0; i--);             // Time for flag to set
      }
      while (IFG1 & OFIFG);                     // OSCFault flag still set?
    
      BCSCTL2 |= SELM_2;                        // MCLK = XT2 HF XTAL (safe)
    
      P1OUT |= 0x01;                          // P1.1 = 1
    
      //initalize variable
      int loop_count = 0;
    
      for (;;)                                  // Infinite loop
      {
        for(j = 0xFFFFF; j > 0; j--);
    
        //P1OUT |= 0x02;                          // P1.1 = 1
        P1OUT ^= 0x01;                         // P1.1 = 0
        //P1OUT &= ~0x02;                         // P1.1 = 0
    
        //break out of for loop after 5 times
        if (loop_count == 5)
        {
            break;
        }
    
        loop_count = loop_count + 1;
    
      }
    
      //stop code coverage data collection
      _TI_stop_pprof_collection();
    
        return 0;
    }

  • Please make the stack and heap as large as you can.  While I cannot guarantee it resolves the problem, it is easy to try.

    Please use the linker map file to determine where the section .ppdata is allocated.  Inspect that memory range before and after you execute code.  Does anything change?

    Thanks and regards,

    -George

  • I figured it out. I had to delete the .csv and rerun the analyze configuration and it would properly show me the frequency of everyline of code. Weird but that's what worked haha

**Attention** This is a public forum