modm API documentation
|
Classes | |
class | modm::platform::Itm |
lbuild module: modm:platform:itm
This module provides the ITM port 0 as a (buffered) Uart interface. You can use this class as a transmit-only alternative for logging:
The ITM is part of the ARM Cortex-M debug functionality and forwards its data to the Trace Port Interface Unit (TPIU) which outputs over the trace pins. Only the SWO trace pin is currently supported (asynchronous tracing).
The Itm
class will safely discard any data if a debugger is not attached, so you can use it for debugging without running the risk of a deadlock.
update()
function!By default the Itm
class is non-buffered and therefore blocking. You must set the modm:platform:itm:buffer.tx
option to non-zero to use the buffered version!
You must use OpenOCD to configure your target's hardware, as well as capture the asynchronous trace stream.
To log the output to a file called itm.fifo
you can call the modm_log_itm
command manually.
You can then either use tail -f itm.fifo
to display the raw data stream (which is often enough) or use the itmdump
program for an advanced use-case (like de-multiplexing data streams).
When using the modm:build:scons
or modm:build:make
modules, you can also use the convenience wrapper, which logs to a temporary file and displays its contents on the terminal:
Alternatively you can also use a JLink debug probe which auto-detects the CPU frequency:
You must call the update()
function repeatedly when a transmit buffer is used, otherwise you have to call flushWriteBuffer()
to empty the buffer.
Generated with: 0 in [0 ... 64Ki-2]