Introduction
The ITM Library provides an ITM Transport API for string and binary data logging.
The ITM module provides 32 ports to transport data over. CCS is utilized to configure
the ITM module and SWO Trace export (see \ref export below for details). CCS restricts
string messages to port 0, while all other ports may be used for binary data (32, 16,
or 8 bit values).
This library will work with any M3/M4 devices with an ITM module. The device and XDS
used must also support SWD (Serial Wire Debug) with SWO (Serial Wire Output) Trace.
Both XDS2xx and XDSICDI Emulators support SWD with SWO Trace.
\note
If CCS is not used to configure the device for SWO Trace export (see \ref export
below for details) the ITM FIFO full check performed by all ITM transport calls will
always indicate empty and the data written to the ITM ports discarded. Thus, when not
using CCS there is no penalty beyond the cycles it takes to execute the ITM functions.
\par ITM Library Revision History
Revision | Date | Notes |
1.0 | 1/7/2011 | First release |
1.1 | 9/29/2014 | Added missing CCS project files |
Build Notes
\par Conventions
The following public naming conventions are used by the API
\li ITM_ - Prefix for public ITM Library functions, typedefs and defines
\li eITM - Prefix for public ITM Library enumerations
\par Pre-defined Symbols
The ITM Library supports the following pre-defined symbols that if defined
enable the functionality at compile time.
\li DEBUG - If defined, additional functionality is included to provide debug assistance.
Static values are provided for the number of writes to the ITM ports, the max number of retries
required before the ITM port's FIFO full bit was clear, and the number of times the max
retries occured. See the source for more details.
\par Directory Structure
ITM is a component of cTools so it resides within the cTools directory structure.
|--cTools
|
|-- ITMLib
| |
| |-- doc
| | |
| | |--html
| | |
| | |-index.html (Doxygen API documentation)
| |
| |-- include (Public API include file)
| |-- src (Private .c and .h files )
| |-- projects (Target specific library builds)
| | |
| | |--M3 (Will work with M3 and M4 devices)
|-- Examples (Target specific stand-alone example projects)
|
|--common (files common across examples)
|--LM4F232
|-- ITM_Ex
ITM Export Notes
CCS must be used to configure ITM and SWO Trace export. The minimum revision of CCS and
emupack that supports ITM and SWO Trace export are CCSv5.5 and emupack 5.1.340.0. Also,
if the XDS firmware is not at the proper revision level, CCS will generate an error when
you try to use ITM and SWO Trace. The XDS2xx firmware needs to be at least version 1.0.0.5
for ITM and SWO Trace export support. Check with your specific XDS vendor for firmware update
instructions if necessary.
When using CCS to capture ITM data (with either an XDS2xx or XDSICDI) you need to configure
the ITM module and SWO Trace through CSS 5.5's "Tools->Hardware Trace Analyzer->Custom Core Trace"
configuration window. The Transport type by default should be "SWO Trace".
Simply hit the Start button to automatically configure the connected device's ITM module and SWO Trace,
and to bring up the Trace Viewer window. The Trace Viewer window is updated every time the core is halted.