BullseyeCoverage
The IAR integrated development environment cannot be configured to build using BullseyeCoverage. However, you can build from the command prompt as described below.
Use this method if you want to use Ninja and your version of the IAR utility iarbuild recognizes the -ninja option.
Run iarbuild with -ninja.
For example:
C:\HelloWorld> "C:\Program Files\IAR Systems\Embedded Workbench 9.2\common\bin\iarbuild" HelloWorld.ewp -ninja Debug IAR Command Line Build Utility V9.1.9.10638 Copyright 2002-2023 IAR Systems AB. HelloWorld - Debug Reading project nodes... Ninja file generated in C:\HelloWorld\Debug
See the instructions for integrating with Ninja.
Use this method if you do not want to use Ninja.
These steps show how to convert an IDE project to a script. Before enabling BullseyeCoverage, make sure the script successfully builds your project without BullseyeCoverage.
PATH environment variable the IAR Systems common\bin and arch\bin directories.
For example:
set PATH=%PATH%;C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.4\common\bin set PATH=%PATH%;C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.4\arm\bin
iarbuild with -log all to obtain a detailed log.
iarbuild project.ewp -build config -log all >log.txt
The config parameter is typically either Debug or Release.
Look at the project in the IAR IDE to determine this name.
grep to extract these lines as shown below.
grep -F .exe log.txt >build.bat
build.bat by shortening the compiler names and quoting other filenames that contain spaces.
Use the directory separator forward slash / rather than backslash \ to avoid escaping quotes.
For example, change
C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.4\arm\bin\iccarm.exe C:\Program Files\IAR Systems\Embedded Workbench 8.4 Kickstart\arm\examples\Actel\CoreMP7\Blinky\blinky.c -o C:\Program Files\IAR Systems\Embedded Workbench 8.4 Kickstart\arm\examples\Actel\CoreMP7\Blinky\Debug RAM\Obj\ …to:
iccarm "C:\Program Files\IAR Systems\Embedded Workbench 8.4 Kickstart\arm\examples\Actel\CoreMP7\Blinky\blinky.c" -o "C:\Program Files\IAR Systems\Embedded Workbench 8.4 Kickstart\arm\examples\Actel\CoreMP7\Blinky\Debug RAM\Obj/" …
Invoke build.bat to verify you can build your project without BullseyeCoverage.
.\build.bat
Make sure the BullseyeCoverage/bin is first in the PATH environment variable.
set PATH=%ProgramFiles%\BullseyeCoverage\bin;%PATH% cov01 -1 .\build.bat
By default, BullseyeCoverage automatically compiles the run-time library
run/libcov-iar.c and adds the resulting object file to linker invocations.
This source implements the small footprint configuration.
You can override this behavior by one of the alternatives below.
libcov-,
for example libcov-userDefined.a
--lib
Add a call to cov_dumpData into your program.
The output file BullseyeCoverage.data-1 is written in the project directory.
#if _BullseyeCoverage
cov_dumpData();
#endif
The BullseyeCoverage run-time source file for IAR Systems,
BullseyeCoverage/run/libcov-iar.c, uses the overridable low-level i/o functions.
If you do not have implementations of these low-level i/o functions, configure to run under the simulator.
If you need to run on real hardware,
see Embedded Systems.
After building your application using build.bat, return to the IDE and start the debugger.
BullseyeCoverage run-time error messages are written to standard error.
After starting the debugger, use the command View Terminal I/O so
that you can see any error messages that might occur.
Updated: 31 Jul 2024
Copyright © Bullseye Testing Technology. All Rights Reserved.