
P a g e
12 | 13
Summary of Steps
When using the mbed.org on-line IDE, use the SDA-USB port for outputting debug/information messages. This is
intrusive in that it takes time and cycles to send the data out the USB port. When you move to the Keil/ULINK
pro
environment, you must re-target the debug/information messages.
To retarget the debug/information messages, use ITM port-0, a few ITM specific output functions defined in
itm_output.cpp, and redefine the macros PRINTF and PUTS so the output is sent to the Debug Viewer in μVision.
Because outputting these messages has less performance penalty when using ULINK
pro
, program timing and
execution may be different. These differences can uncover race conditions and other timing issues that would
rarely be encountered and thus extremely difficult to debug.
Once recompiled with the output redirected, the remainder of steps involves configuring the μVision/
ULINKpro
tools to operate with the FRMD-K64F board as previously described.
For additional information on using the Keil tools and ULINK
pro
JTAG, refer to the References section.
Useful Definitions/Terms
Instrumentation Trace Macrocell (ITM)
As used by μVision, ITM is thirty-two 32 bit memory addresses (Port 0 through 31) that, when written to, will be
output on either the SWO or Trace Port. This is useful for printf type operations. μVision uses Port 0.
Embedded Trace Macrocell (ETM)
Displays all the executed instructions. The ULINK
pro
provides ETM and requires a special 20 pin CoreSight
connector. ETM also provides Code Coverage and Performance Analysis.
Embedded Trace Buffer (ETB)
A small amount of internal RAM used as an ETM trace buffer.
Hardware Breakpoints
The Cortex-M4 has six hardware breakpoints. These can be set/unset on-the-fly without stopping the processor.
They are no skid; they do not execute the instruction they are set on when a match occurs. The CPU is halted
before the instruction is executed.
Watchpoints
The Cortex-M4 has two watchpoints. These are conditional breakpoints. They stop the program when a specified
value is read and/or written to a specified address or variable.