PRELIMINARY LogSinkITM interface
WARNING These APIs are PRELIMINARY, and subject to change in the next few months.
The LogSinkITM module is a sink that can be used in conjunction with the Log.h API. The API defined in this file should not be used directly, but is made available to the Logging framework and used as a transport layer for Log.h
To use the ITM sink, ensure that the correct library for your device is linked in and include this header file as follows:
Additionally, LogSinkITM_init must be called before LogSinkITM can be used. It is called from Board_init().
This module implements two functions that are required by the Log API:
- printf(const Log_Module *handle, uint32_t header, uint32_t index, uint32_t numArgs, ...);
- buf(const Log_Module *handle, uint32_t header, uint32_t index, uint8_t *data, size_t size);
Whenever a log-statement is invoked, that uses LogSinkITM as its sink, the functions above are ultimately invoked.
Overview
LogSinkITM is a sink/transport layer that is able to output log-statements over ITM. It uses the ITM driver to stream data out onto a user-selectable pin, which can be received and processed by a host-side tool. For more information about the host-side tool, see tools/log/tiutils. For more information about the Log API, see the Log documentation
ITM Channels
LogSinkITM uses certain channels for different purposes. Seperate channels are used for data transfer, time synchronization, etc. For a complete overview, refer to LogSinkITM_StimulusPorts
ITM Timestamps
Timestamps are automatically generated by the ITM hardware, and a synchronization timestamp is sent over the time-sync channel when the ITM sink is initiated. The timestamp is taken from the RTC, but the format depends on the device. Refer to TimestampP.h for implementation details