Module to aid in configuring SYSBIOS logging when using ti.uiactools.loggers.stream.LoggerStreamer2
The LoggingSetupSTM module automates the process of configuring an application
to use UIA events, and configures SYS/BIOS modules to capture user-specified
information such as CPU Load, Task Load and Task Execution so that it can
be displayed by System Analyzer. It also automates the creation of
infrastructure modules such as loggers. If you are do not want to use LoggerStreamer2
to log events, please use ti.uiactools.sysbios.LoggingSetup instead.
The following configuration script demonstrates the use of the LoggingSetupSTM
module in the XDC configuration file for the application:
Example 1: Configuring an application to use the default settings provided
by LoggingSetupSTM. The following default settings are automatically applied:
// the Log module provides logging APIs for use by the user's software
var Log = xdc.useModule('xdc.runtime.Log');
// the LoggingSetupSTM module's default settings configure much of the UIA infrastructure.
var LoggingSetupSTM = xdc.useModule('ti.uiactools.sysbios.LoggingSetupSTM');
Example 2: A number of 'template' applications are available that
provide predefined XDC configuration scripts and C code for use in new
projects. These templates provide good examples of how to configure all
of the various modules that are involved in setting up the UIA infrastructure,
including the LoggingSetupSTM module. The templates can be downloaded from
the System Analyzer Wiki site at
They can also be generated directly by CCS, using the CCS New Project
Wizard. The following steps show how to use CCSv5.0.x to generate a new project
that configure the NDK to provide an Ethernet transport for uploading events
from the target to the host, please perform the following steps in CCS. :
| enum LoggingSetupSTM.UploadMode |
 |
| XDCscript usage |
meta-domain |
values of type LoggingSetupSTM.UploadMode
const LoggingSetupSTM.UploadMode_SIMULATOR;
const LoggingSetupSTM.UploadMode_PROBEPOINT;
const LoggingSetupSTM.UploadMode_JTAGSTOPMODE;
const LoggingSetupSTM.UploadMode_JTAGRUNMODE;
const LoggingSetupSTM.UploadMode_NONJTAGTRANSPORT;
const LoggingSetupSTM.UploadMode_NONJTAG_AND_JTAGSTOPMODE;
const LoggingSetupSTM.UploadMode_STREAMER;
const LoggingSetupSTM.UploadMode_IDLE;
const LoggingSetupSTM.UploadMode_STM;
| config LoggingSetupSTM.disableMulticoreEventCorrelation // module-wide |
 |
Set to true for single core applications
| XDCscript usage |
meta-domain |
LoggingSetupSTM.disableMulticoreEventCorrelation = Bool false;
DETAILS
When true the LoggingSetupSTM module will not automatically
include the the LogSync module. The LogSync module is
required in order to enable events from multiple CPU cores
to be correlated with each other.
SEE
| config LoggingSetupSTM.eventUploadMode // module-wide |
 |
Event upload mode
| XDCscript usage |
meta-domain |
DETAILS
Upload_STREAMER: events are uploaded by the application
when the LoggerStreamer2 logger calls the application-provided
buffer exchange function. If a different type of logger is
required, please use ti.uiactools.sysbios.LoggingSetup instead.
EXAMPLE
The following is an example of the configuration script used
to configure the system to use a LoggerStreamer logger in order to
stream events from the target to the host while the target is running.
var LoggingSetupSTM = xdc.useModule('ti.uiactools.sysbios.LoggingSetupSTM');
LoggingSetupSTM.eventUploadMode = LoggingSetupSTM.UploadMode_STM;
| config LoggingSetupSTM.loadLogging // module-wide |
 |
Enable the Load module event logging
| XDCscript usage |
meta-domain |
LoggingSetupSTM.loadLogging = Bool true;
DETAILS
If this is false, the events will be disabled. Otherwise the events
will be enabled.
Use the
loadLoggingRuntimeControl parameter
to determine whether the state can be modified during runtime.
| config LoggingSetupSTM.loadLoggingRuntimeControl // module-wide |
 |
Specify whether load logging can be enabled / disabled at runtime
| XDCscript usage |
meta-domain |
LoggingSetupSTM.loadLoggingRuntimeControl = Bool true;
DETAILS
This determines what diags settings are applied to the module's diags
mask. If 'false', the diags bits will be configured as
ALWAYS_ON, meaning they can't be changed at runtime. If 'true', the
bits will be configured as 'RUNTIME_ON'.
Use the
loadLogging parameter
to determine whether the event is ON or OFF. For example, the
following two lines set the Load modules events to
initially be 'ALWAYS_ON'.
LoggingSetupSTM.loadLogging = true;
LoggingSetupSTM.loadLoggingRuntimeControl = false;
| config LoggingSetupSTM.logger // module-wide |
 |
LoggerStreamer used for logging events
| XDCscript usage |
meta-domain |
EXAMPLE
Example 1: Configuring an loggerStreamer with custom settings for use
by LoggingSetupSTM.
The following configuration script shows how to create a LoggerStreamer2
module and hook it in to the LoggingSetupSTM module so that it is used to
log SysBios and application events:
// the Log module provides logging APIs for use by the user's software
var Log = xdc.useModule('xdc.runtime.Log');
var LoggerStreamer = xdc.useModule('ti.uiactools.loggers.stream.LoggerStreamer2');
// A packet length of 1500 bytes or less is recommended for streaming over UDP.
// The UDP packet length includes a 42 byte UDP packet header, which must be pre-pended
// in front of the UIA event packet that is generated by LoggerStreamer2.
// Also, the LoggerStreamer buffer must be word aligned and an integer multiple of 4
// (i.e. contain an even number of UInt32 words).
LoggerStreamer.bufSize = 1498-42;
LoggerStreamer.isTimestampEnabled = true;
LoggerStreamer.primeFxn = '&prime';
LoggerStreamer.exchangeFxn = '&exchange';
var logger0 = LoggerStreamer.create();
var Defaults = xdc.useModule('xdc.runtime.Defaults');
Defaults.common$.logger = logger0;
// the LogSnapshot module supports logging dynamic strings and blocks of memory values.
// Configure it to use the LoggerStreamer2 logger.
var LogSnapshot = xdc.useModule('ti.uiactools.runtime.LogSnapshot');
LogSnapshot.common$.logger = logger0;
// Configure LoggingSetup to use the same LoggerStreamer logger for Bios and application events.
var LoggingSetup = xdc.useModule('ti.uiactools.sysbios.LoggingSetupSTM');
LoggingSetup.eventUploadMode = LoggingSetup.UploadMode_STM;
LoggingSetup.logger = logger0;
| config LoggingSetupSTM.mainLogging // module-wide |
 |
Enable main and non-XDC modules event logging
| XDCscript usage |
meta-domain |
LoggingSetupSTM.mainLogging = Bool true;
DETAILS
If this is false, the events will be disabled. Otherwise the events
will be enabled.
Use the
mainLoggingRuntimeControl parameter
to determine whether the state can be modified during runtime.
| config LoggingSetupSTM.mainLoggingRuntimeControl // module-wide |
 |
Specify whether main logging can be enabled / disabled at runtime
| XDCscript usage |
meta-domain |
LoggingSetupSTM.mainLoggingRuntimeControl = Bool true;
DETAILS
This determines what diags settings are applied to the module's diags
mask. If 'false', the diags bits will be configured as
ALWAYS_ON, meaning they can't be changed at runtime. If 'true', the
bits will be configured as 'RUNTIME_ON'.
Use the
mainLogging parameter
to determine whether the event is ON or OFF. For example, the
following two lines set the Load modules events to
initially be 'ALWAYS_ON'.
LoggingSetupSTM.mainLogging = true;
LoggingSetupSTM.mainLoggingRuntimeControl = false;
| config LoggingSetupSTM.sysbiosHwiLogging // module-wide |
 |
Enable SYSBIOS Hwi and Clock modules' event logging
| XDCscript usage |
meta-domain |
LoggingSetupSTM.sysbiosHwiLogging = Bool false;
DETAILS
If this is false, the events will be disabled. Otherwise the events
will be enabled.
Use the
sysbiosHwiLoggingRuntimeControl parameter
to determine whether the state can be modified during runtime.
| config LoggingSetupSTM.sysbiosHwiLoggingRuntimeControl // module-wide |
 |
Specify whether Hwi and Clock logging can be enabled / disabled at runtime
| XDCscript usage |
meta-domain |
LoggingSetupSTM.sysbiosHwiLoggingRuntimeControl = Bool false;
DETAILS
This determines what diags settings are applied to the module's diags
mask. If 'false', the diags bits will be configured as
ALWAYS_ON, meaning they can't be changed at runtime. If 'true', the
bits will be configured as 'RUNTIME_ON'.
Use the
sysbiosHwiLogging parameter
to determine whether the event is ON or OFF. For example, the
following two lines set the Load modules events to
initially be 'ALWAYS_ON'.
LoggingSetupSTM.sysbiosHwiLogging = true;
LoggingSetupSTM.sysbiosHwiLoggingRuntimeControl = false;
| config LoggingSetupSTM.sysbiosSwiLogging // module-wide |
 |
Enable SYSBIOS Swi module's event logging
| XDCscript usage |
meta-domain |
LoggingSetupSTM.sysbiosSwiLogging = Bool false;
DETAILS
If this is false, the events will be disabled. Otherwise the events
will be enabled.
Use the
sysbiosSwiLoggingRuntimeControl parameter
to determine whether the state can be modified during runtime.
| config LoggingSetupSTM.sysbiosSwiLoggingRuntimeControl // module-wide |
 |
Specify whether Swi logging can be enabled / disabled at runtime
| XDCscript usage |
meta-domain |
LoggingSetupSTM.sysbiosSwiLoggingRuntimeControl = Bool false;
DETAILS
This determines what diags settings are applied to the module's diags
mask. If 'false', the diags bits will be configured as
ALWAYS_ON, meaning they can't be changed at runtime. If 'true', the
bits will be configured as 'RUNTIME_ON'.
Use the
sysbiosSwiLogging parameter
to determine whether the event is ON or OFF. For example, the
following two lines set the Load modules events to
initially be 'ALWAYS_ON'.
LoggingSetupSTM.sysbiosSwiLogging = true;
LoggingSetupSTM.sysbiosSwiLoggingRuntimeControl = false;
| config LoggingSetupSTM.sysbiosTaskLogging // module-wide |
 |
Enable SYSBIOS Task module's event logging
| XDCscript usage |
meta-domain |
LoggingSetupSTM.sysbiosTaskLogging = Bool true;
DETAILS
If this is false, the events will be disabled. Otherwise the events
will be enabled.
Use the
sysbiosTaskLoggingRuntimeControl parameter
to determine whether the state can be modified during runtime.
| config LoggingSetupSTM.sysbiosTaskLoggingRuntimeControl // module-wide |
 |
Specify whether Task logging can be enabled / disabled at runtime
| XDCscript usage |
meta-domain |
LoggingSetupSTM.sysbiosTaskLoggingRuntimeControl = Bool true;
DETAILS
This determines what diags settings are applied to the module's diags
mask. If 'false', the diags bits will be configured as
ALWAYS_ON, meaning they can't be changed at runtime. If 'true', the
bits will be configured as 'RUNTIME_ON'.
Use the
sysbiosTaskLogging parameter
to determine whether the event is ON or OFF. For example, the
following two lines set the Load modules events to
initially be 'ALWAYS_ON'.
LoggingSetupSTM.sysbiosTaskLogging = true;
LoggingSetupSTM.sysbiosTaskLoggingRuntimeControl = false;