LOG Module
2-184
You can add messages to user logs or the system log by using
LOG_printf or LOG_event. To reduce execution time, log data is always
formatted on the host.
LOG_error writes a user error event to the system log. This operation is
not affected by any TRC trace bits; an error event is always written to the
system log. LOG_message writes a user message event to the system
log, provided that both TRC_GBLHOST and TRC_GBLTARG (the host
and target trace bits, respectively) traces are enabled.
When a problem is detected on the target, it is valuable to put a message
in the system log. This allows you to correlate the occurrence of the
detected event with the other system events in time. LOG_error and
LOG_message can be used for this purpose.
Log buffers are of a fixed size and reside in data memory. Each log event
buffer uses eight words in both the large and huge memory models.
Individual events hold four elements (two words per element) in the log’s
buffer. The first element holds a sequence number that allows the Event
Log to display logs in the correct order. The remaining three elements
contain data specified by the call that wrote the message to the log.
See the
Code Composer Studio
online tutorialfor examples of how to use
the LOG Manager.
LOG Manager
Properties
The following global property can be set for the LOG module in the LOG
Manager Properties dialog of the DSP/BIOS Configuration Tool or in a
Tconf script:
❏
Object Memory
. The memory segment that contains the LOG
objects.
Tconf Name: OBJMEMSEG
Type: Reference
Example:
bios.LOG.OBJMEMSEG = prog.get("myMEM");
LOG Object Properties
To create a LOG object in a configuration script, use the following syntax.
The Tconf examples that follow assume the object has been created as
shown here.
var myLog = bios.LOG.create("myLog");
The following properties can be set for a log object on the LOG Object
Properties dialog in the DSP/BIOS Configuration Tool or in a Tconf script:
❏
comment
. Type a comment to identify this LOG object.
Tconf Name: comment
Type: String
Example:
myLog.comment = "trace LOG";