Product
Solutions
Resources
Company
Download Trial Book a Demo

Code Coverage for Code Composer Studio (CCStudio) IDE

Generate code coverage for an embedded application in the Code Composer Studio IDE with RKTracer. Integrate the tool, enable it from External Tools, rebuild and run your tests on the target, save the data with rkdump, and generate the HTML reports.

Use this guide to generate code coverage for an embedded application in the Code Composer Studio (CCStudio) IDE. RKTracer integrates with Code Composer Studio through a command-line utility. You first integrate the tool from a command prompt, then enable it from inside the IDE, rebuild and run your tests on the embedded target, save the coverage data, and generate the HTML reports.

In short

Close the IDE and run rktracer -ds -integrate, enable the External Tools from Customize Perspective, rebuild and run your tests in debug mode, run rkdump from the Scripting Console, then run RKTracer Reports to generate the HTML report.

Step 1: Enable the code coverage tool

First, close the Code Composer Studio IDE, open a command prompt, and run the integration command. This integrates the RKTracer tool with the IDE.

integrate rktracer
rktracer -ds -integrate

Now open the IDE and make the External Tools visible in the toolbar and the menu. Go to WindowsPerspectiveCustomize Perspective. Under the Toolbar Visibility tab, select Launch and choose External Tools. Then open the Menu Visibility tab, go to the Run menu, scroll to the end, select External Tools, then apply and close.

The RKTracer tool is now available from RunExternal Tools, which offers three options:

  • RKTracer ON: Will enable RKTracer tool for instrumentation.
  • RKTracer OFF: Will disable RKTracer tool.
  • RKTracer Reports: Will generate reports in HTML format.

Step 2: Rebuild the application and run tests

Clean and build the application to instrument it with the RKTracer tool, then run your test cases on the embedded target in debug mode, or your preferred method.

Step 3: Save the coverage data

While still in debug mode, open the Scripting Console from the View menu and run the rkdump command to save the coverage data to the project folder.

scripting console
rkdump

Step 4: Generate the code coverage reports

Run the RKTracer Reports option from RunExternal Tools. The tool converts the raw coverage data files into coverage reports, mapping them with the JSON files generated during instrumentation, and generates the HTML output.

Enable coverage for selected files

You can scope coverage to specific folders, files, or functions by editing the rktracer.config file. For example, to instrument source files from some folders while ignoring others, add the following:

rktracer.config
ignore *.c
instrument */power/* */core/* */keys/*
never */firmware_loader/* */lockdown/*
  • ignore *.c ignores all C source files from instrumentation.
  • instrument instruments source files from the given folders.
  • never ignores the selected folders.

Next steps

Once your Code Composer Studio project reports coverage, the same RKTracer workflow applies across other build systems and IDEs. Browse the rest of the documentation, or read more about how RKTracer measures coverage through MC/DC.

Stuck on your build?

Open a support ticket and an engineer who knows your toolchain will help. You get a tracked ticket ID by email.