BullseyeCoverage Up Contents Search

Microchip MPLAB

MPLAB X IDE

This information applies to Microchip MPLAB X IDE with the XC16 and XC32 compilers. The XC8 compiler is not supported.

  1. In the Windows Control Panel, set the PATH environment variable with first entry C:\Program Files\BullseyeCoverage\bin, second entry your compiler toolchain bin directory, and then everything else following.
  2. Restart the MPLAB X IDE if it is running.
  3. Use the MPLAB X IDE menu command Tools Options.
  4. Navigate to Embedded: Build Tools.
  5. Press the Add button, select C:\Program Files\BullseyeCoverage\bin directory and press OK.

    Options Options

  6. Press OK to dismiss Options.
  7. Use the menu command File Project Properties.
  8. In the Compiler Toolchain, select the entry containing BullseyeCoverage\bin.

Project Properties

Run-Time Library Built Automatically

By default, BullseyeCoverage automatically compiles and adds the run-time library run/libcov-printf.c to compiler invocations that link an executable. This source implements the small footprint configuration. You can override this behavior by one of the alternatives below.

The source run/libcov-printf.c writes the data to the standard output, which appears in the UART Output window when using the simulator. Follow the steps below To enable the UART.

  1. Use the command Project Properties
  2. Navigate to Simulator
  3. In the Option categories, select Uart IO Options
  4. Check Enable Uart IO

Saving Coverage

Add a call to cov_dumpData into your program.

#if _BullseyeCoverage
    cov_dumpData();
#endif

The output file BullseyeCoverage.data-1 is written with the printf function to the UART Output window. Copy the text from the UART Output window as described there and put it into a file named BullseyeCoverage.data-1. Run the covpost command to transfer the data to the coverage file.

C:\> covpost BullseyeCoverage.data-1

Updated: 7 Sep 2023