Keil Logo


Display coverage information for the whole application in assembler format using the COVERAGE command:


µVision shows coverage information for each module in the Command window. Use the command COVTOFILE to save code coverage information to a file.

Example output (only for the main module)

\\example\main.c\main - 81% (43 of 53 instructions executed)
    1 condjump(s) or IT-block(s) not fully executed
 EX |  0x000006E4 main:
 EX |  0x000006E4 B580      PUSH     {r7,lr}
 EX |  0x000006E6 B086      SUB      sp,sp,#0x18
 EX |  0x000006E8 2000      MOVS     r0,#0x00
 EX |  0x000006EA 9005      STR      r0,[sp,#0x14]
 EX |  0x000006EC 2001      MOVS     r0,#0x01
 EX |  0x000006EE 9004      STR      r0,[sp,#0x10]
 EX |  0x000006F0 E7FF      B        0x000006F2
 EX |  0x000006F2 9804      LDR      r0,[sp,#0x10]
 EX |  0x000006F4 2809      CMP      r0,#0x09
 FT |  0x000006F6 DC37      BGT      0x00000768
 EX |  0x000006F8 E7FF      B        0x000006FA
 EX |  0x000006FA 9804      LDR      r0,[sp,#0x10]
 EX |  0x000006FC F2455156  MOVW     r1,#0x5556
 EX |  0x00000700 F2C55155  MOVT     r1,#0x5555
 EX |  0x00000704 FB801201  SMULL    r1,r2,r0,r1
 EX |  0x00000708 EB0272D2  ADD      r2,r2,r2,LSR #31
 EX |  0x0000070C EB020242  ADD      r2,r2,r2,LSL #1
 EX |  0x00000710 1A80      SUBS     r0,r0,r2
 EX |  0x00000712 2800      CMP      r0,#0x00
 EX |  0x00000714 9103      STR      r1,[sp,#0x0C]
 FT |  0x00000716 D109      BNE      0x0000072C
 EX |  0x00000718 E7FF      B        0x0000071A
 EX |  0x0000071A 9904      LDR      r1,[sp,#0x10]
 EX |  0x0000071C F241008D  MOVW     r0,#0x108D
 EX |  0x00000720 F2C00000  MOVT     r0,#0x00
 EX |  0x00000724 F000F82E  BL.W     __0printf (0x00000784)
 EX |  0x00000728 9002      STR      r0,[sp,#0x08]
 EX |  0x0000072A E7FF      B        0x0000072C
 EX |  0x0000072C 9804      LDR      r0,[sp,#0x10]
 EX |  0x0000072E F24A21E9  MOVW     r1,#0xA2E9
 EX |  0x00000732 F6C2618B  MOVT     r1,#0x2E8B
 EX |  0x00000736 FB801201  SMULL    r1,r2,r0,r1
 EX |  0x0000073A 1053      ASRS     r3,r2,#1
 EX |  0x0000073C EB0372D2  ADD      r2,r3,r2,LSR #31
 EX |  0x00000740 230B      MOVS     r3,#0x0B
 EX |  0x00000742 FB020013  MLS      r0,r2,r3,r0
 EX |  0x00000746 2800      CMP      r0,#0x00
 EX |  0x00000748 9101      STR      r1,[sp,#0x04]
 AT |  0x0000074A D109      BNE      0x00000760
 NE |  0x0000074C E7FF      B        0x0000074E
 NE |  0x0000074E 9904      LDR      r1,[sp,#0x10]
 NE |  0x00000750 F2410076  MOVW     r0,#0x1076
 NE |  0x00000754 F2C00000  MOVT     r0,#0x00
 NE |  0x00000758 F000F814  BL.W     __0printf (0x00000784)
 NE |  0x0000075C 9000      STR      r0,[sp,#0x00]
 NE |  0x0000075E E7FF      B        0x00000760
 EX |  0x00000760 9804      LDR      r0,[sp,#0x10]
 EX |  0x00000762 3001      ADDS     r0,r0,#0x01
 EX |  0x00000764 9004      STR      r0,[sp,#0x10]
 EX |  0x00000766 E7C4      B        0x000006F2
 NE |  0x00000768 2000      MOVS     r0,#0x00
 NE |  0x0000076A B006      ADD      sp,sp,#0x18
 NE |  0x0000076C BD80      POP      {r7,pc}

The output format has the form:

<qualifier> | <addr> <opcode> <assembly code>

The values below lists the possible qualifiers:

NE Not executed.
EX Executed.
AT Always taken. Conditional instruction which was always taken (condition always true).
NT Not Taken. Conditional instruction which was never taken (condition always false).
FT Fully Taken. Conditional instruction which was each taken and not taken for at least one time.

The output matches the display in the Disassembly window of the µVision debugger:

Code coverage in µVision Debugger

  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.