NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.

OMX Viewing Media Controller Traces

From Texas Instruments Wiki
Jump to: navigation, search

Introduction[edit]


The OMX firmware in EZSDK has been enabled with debug logs to ease the process of debug. These debug logs enable the user to trace through the execution sequence on the Media Controller. This article describes the steps to follow to view these debug logs on A8 running linux

Throughout this document there will be commands spelled out to execute. Some are to be executed on the Linux development host, some on the Linux target and some on the u-boot (bootloader) prompt. They are distinguished by different command prompts as follows:

host $ <this command is to be executed on the host>
target # <this command is to be executed on the target>
u-boot :> <this command is to be executed on the u-boot prompt>

Version Information and Compatibility[edit]

Note! These instructions have been updated for EZSDK 5.03.00.09 which uses UIA version 1.00.03.25.  These instructions are
applicable to DM816x and DM814x devices.
Note! There are some changes in the usage of LoggerSMDump utility with EZSDK version 5.03.00.09. Note the introduction
of <size> parameter in the command line syntax of LoggerSMDump utility.
Note! If you are using a previous version of EZSDK (5.02.01.59), then the <size> parameter should not be used for the
LoggerSMDump utility.

LoggerSMDump Utility[edit]


LoggerSMDump is a A8 utility provided in the EZSDK that prints the debug logs generated by the Media Controller. This utility is available in the target filesystem at /usr/share/ti/ti-uia/loggerSMDump.out.

First, the user should open a telnet session using the IP address of the EVM, as shown below -

telnet aaa.bbb.ccc.ddd

Execute loggerSMDump.out on the target filesystem to see its usage. The loggerSMDump.out utility has the following command syntax:

target #./loggerSMDump.out <addr> <size> <core name>

The parameter <addr> is the remote debug shared memory physical address in Hex. Refer the LOGGER_SM memory section in the EZSDK_Memory_Map for the address to be used. E.g., in EZSDK 5.02.01.59, this is 0x9E400000.

The parameter <size> is the size of the remote debug shared memory physical address in Hex. For this release, the size is 1MB. Therefore, the value of size parameter is 0x100000

The parameter <core_name> is the name of the Media Controller core. It can be one of the following: video: to denote VIDEO Media Controller vpss: to denote VPSS Media Controller all: to denote both VIDEO and VPSS Media Controller

Therefore, the loggerSMDump utility should be executed as shown below:

To see logs from both Media Controllers (VIDEO & VPSS)

target #./loggerSMDump.out 0x9E400000 0x100000 all

To see logs from both VIDEO Media Controller

target #./loggerSMDump.out 0x9E400000 0x100000 video

To see logs from both VPSS Media Controller

target #./loggerSMDump.out 0x9E400000 0x100000 vpss

Sample Output from LoggerSMDump[edit]


Given below is an example of the logs coming from the VIDEO and VPSS Media Controller -

N:Video P:1 #:00224 T:000000050083891b S:Module<OMX.TI.DUCATI.VIDDEC> Leaving<OMX_BASE_CmdEventHandler> @line<469>
with error<0:ErrorNone>
N:VPSS  P:2 #:00600 T:000000050033bdd1 S:Module<OMX.TI.VPSSM3.VFDC> @<OMX_BASE_PROCESS_CmdCompleteEvent> @line<824>
msg<Processing OMX_CommandStateSet>

The format of print is –

N:MediaControllerName P:PartitionId #:SequenceId T:64bit timestamp S:Print_from_media_controller

Controlling OMX Firmware Debug Levels from A8[edit]

OMX firmware supports controlling its debug levels from A8. This allows the user to control the amount of logs appearing on the telnet console. Using these debug levels, the user may choose to increase or decrease or even totally turn-off all logs from the Media Controller OMX Firmware. This section describes the various parameters and how these can be set and invoked from A8. The OMX examples demonstrate the usage of these parameters. The OMX example 'decode_display' has been used in this section here to describe this.

The structure ConfigureUIA defined in /ti/omx/demos/commmon/msgq.h is used to communicate and control the configurable debug parameters in OMX firmware from A8. This structure is defined as shown below:

<syntaxhighlight lang='c'> typedef struct ConfigureUIA {

   MessageQ_MsgHeader header;
   Int enableAnalysisEvents;
   Int debugLevel;
   Int enableStatusLogger;

} ConfigureUIA; </syntaxhighlight>

enableAnalysisEvents: This is used to enable analysis of the OMX Media Controller Firmware using CCS System Analyzer.

0: disables logging of analysis events in OMX firmware
1: enables logging of analysis events in OMX firmware

For more details on this see OMX_Using_System_Analyzer_For_Media_Controller_Analysis

enableStatusLogger: LoggerSM is the logger module used by the OMX Media Controller Firmware to log debug traces in the LOGGER_SM buffer. This flag is used to enable or disable the LoggerSM module. From a user perspective, what this means is that logging can be enabled or disabled in the OMX firmware using this flag. Possible values are:

0: disables logging in OMX firmware
1: enables logging in OMX firmware

debugLevel: This is used to control debug levels of the OMX firmware. This is a 5-bit wide bit-field variable. Each of the bits represent a particular debug level as shown below. Note that the bit positions mentioned are from LSB.

Bit-0: Debug Level 1
Bit-1: Debug Level 2
Bit-2: Debug Level 3
Bit-3: Debug Level 4
Bit-4: Debug Level 5

Each of these bits can be 1 or 0 to enable or disable the particular debug level. By default, debug level 1 is ON in the OMX firmware. Some example settings are given below:

debugLevel = 0x1: Turns on Debug Level 1 in OMX Firmware
debugLevel = 0x0: Turns off all Debug Levels in OMX Firmware
debugLevel = 0x3: Turns on Debug Levels 1 & 2 in OMX Firmware
debugLevel = 0x7: Turns on Debug Levels 1, 2 & 3 in OMX Firmware
debugLevel = 0x11: Turns on Debug Levels 1 & 5 in OMX Firmware

Note that enableStatusLogger should be 1 for debugLevel settings to take effect, as enableStatusLogger = 0 disables logging in OMX Firmware

configureUiaLoggerClient is a utility function that can be used to control OMX Firmware debug behaviour from A8. This function is defined in /ti/omx/demos/commmon/msgq.c and takes the following parameters.

Void configureUiaLoggerClient (Int coreId, ConfigureUIA *pCfgUIA)

coreId: This denotes the Media Controller ID. Possible values are:

1: VIDEO Media Controller
2: VPSS Media Controller

pCfgUIA: This is a pointer to the ConfigureUIA structure

An example usage of the configureUiaLoggerClient() function is shown below. This is available in all OMX examples as well, see decode_display/src/main.c

<syntaxhighlight lang='c'> /* UIA is an utility to get the logs from firmware on Linux terminal, and also

* to use System Analyzer. The following UIA configuration is required to change
* the default debug logging configuration, and is optional.
*/

/* Disable analysis events */ uiaCfg.enableAnalysisEvents = 0;

/* enable Status Logger */ uiaCfg.enableStatusLogger = 1;

/* set debug level to LEVEL1 */ uiaCfg.debugLevel = OMX_DEBUG_LEVEL1;

/* configureUiaLoggerClient() takes a COREID and the uiaCfg struct */ configureUiaLoggerClient(2, &uiaCfg); configureUiaLoggerClient(1, &uiaCfg); </syntaxhighlight>

What does OMX Firmware Debug Level mean?[edit]


The OMX Firmware Debug Levels are arranged hierarchically starting from Debug Level 1 to Debug Level 5.


  • Debug Level 1: This enables all create, control and delete time logs. This covers all OMX apis that deal with:
    • create functions (OMX_Init, OMX_GetHandle)
    • configuration functions (OMX_GetParameter, OMX_GetConfig, OMX_SetParameter, OMX_SetConfig)
    • buffer allocation and free functions (OMX_AllocateBuffer, OMX_FreeBuffer, OMX_UseBuffer)
    • control functions for state transition and port configuration (OMX_SendCommand)
    • delete functions (OMX_FreeHandle, OMX_Deinit)

This level excludes all data processing functions (OMX_EmptyThisBuffer, OMX_FillThisBuffer). By default, OMX firmware has Debug Level 1 ON. The other debug levels cover functions that are involved in data processing. Therefore, by default these Debug Levels are OFF in OMX Firmware.


  • Debug Level 2: This enables logs in the OMX apis involved in the data processing path:
    • data buffer passing (OMX_EmptyThisBuffer, OMX_FillThisBuffer).

By default, OMX firmware has Debug Level 2 OFF.


  • Debug Level 3: This enables logs in the OMX firmware internal functions that deal with data processing. By default, OMX firmware has Debug Level 3 OFF.


  • Debug Level 4: This is essentially an extension of Debug Level 3. Some additional logs are enabled in the data processing path. Note that Debug Levels 2 to 4 essentially cover data processing. However, in order to keep performance impact of enabling logs minimal, they have been hierarchically arranged into 3 debug levels. By default, OMX firmware has Debug Level 4 OFF.


  • Debug Level 5: Reserved for future usage.

Viewing traces from DSP on A8[edit]


The DSP firmware built in EZSDK does not have the necessary changes to integrate UIA and enable viewing traces from A8 for debug purpose in the same way as mentioned above for the VIDEO and VPSS Media Controller.

This section documents the changes needed to integrate UIA and view DSP traces on A8. This is to enable users to add this support for the available version of EZSDK.

In the file /examples/ti/omx/demos/dm81xx/DspAppMain.cfg, add the following at the end and recompile DSP firmware:

/* ====================================================== */
/* ================ Logger configuration ================ */
/* ====================================================== */
var Defaults = xdc.useModule('xdc.runtime.Defaults');
var Diags = xdc.useModule('xdc.runtime.Diags');
var Main = xdc.useModule('xdc.runtime.Main');
var Load = xdc.useModule('ti.sysbios.utils.Load');
Load.hwiEnabled = false;
Load.swiEnabled = false;
/*
* Create a static task for M3 UIA configuration
*/
var taskParams = new Task.Params();
taskParams.instance.name = "uiaServerTask";
task_params.stackSize = 0x6000;
Task.create('&uiaServerTask', taskParams);
 /*
 *  Create a LoggerSM instance and use it for all logging. Make sure it is at the same section
 for all cores (DSP, Video, VPSS) and not put anything else in "LOGGER_SM". All cores will
 share this same memory. All cores must have numCores and sharedMemorySize be the same value.
 */
var LoggerSM = xdc.useModule('ti.uia.runtime.LoggerSM');
LoggerSM.partitionId = 0;
LoggerSM.bufSection = ".loggerSM";
LoggerSM.sharedMemorySize = 0x00100000;
LoggerSM.numPartitions = 3;
LoggerSM.decode = true;
LoggerSM.overwrite = false;
var statusLogger = LoggerSM.create();
 /*
 *  Make sure the section is in LOGGERSM (defined in
 *  ti\omx\build\MemSegmentDefinition.xs). Also make sure it is a NOLOAD
 *  section. This avoids wiping out another cores logger memory when more
 *  than one cores is loaded.
 */
Program.sectMap[".loggerSM"] = new Program.SectionSpec();
Program.sectMap[".loggerSM"].loadSegment = "LOGGER_SM";
Program.sectMap[".loggerSM"].type = "NOLOAD";
 /*
 *  Plug the LoggerSM logger into LoggerCircBuf. All STATUS events
 *  and logs from Main will go to the LoggerSM instance
 */
LoggerCircBuf = xdc.useModule('ti.uia.runtime.LoggerCircBuf');
LoggerCircBuf.statusLogger = statusLogger;
LoggerCircBuf.filterByLevel = true;
LoggerCircBuf.moduleToRouteToStatusLogger = "xdc.runtime.Main";
 /*
 *  Use LoggingSetup which uses UploadMode_JTAGSTOPMODE as the
 *  default. Increase the Log sizes.
 *
 *  Configuration done by the application is still honored (e.g. setting
 *  up the common$.diags mask).
 *
 *  Please refer to the ti.uia.sysbios.LoggingSetup module for more
 *  details and configuration options.
 */
var LoggingSetup = xdc.useModule('ti.uia.sysbios.LoggingSetup');
LoggingSetup.loadLoggerSize = 1024*10;
LoggingSetup.mainLoggerSize = 1024*1024;
LoggingSetup.sysbiosLoggerSize = 32768*10;
 /* Use the a transport to move the records to MCSA */
LoggingSetup.eventUploadMode = LoggingSetup.UploadMode_NONJTAGTRANSPORT;
 /* ================ UIA configuration ================ */
/*
 *  The default is to have a single core. This example is a multi-core
 *  example. So UIA must be told to act accordingly.
 */
var ServiceMgr = xdc.useModule('ti.uia.runtime.ServiceMgr');
ServiceMgr.topology = ServiceMgr.Topology_MULTICORE;
ServiceMgr.transportType = ServiceMgr.TransportType_NULL;
 /* The HOST is the master UIA processors */
ServiceMgr.masterProcId = 3;
 /* The application is using the UIA benchmark events. */
var UIABenchmark  = xdc.useModule('ti.uia.events.UIABenchmark');
 var UIAStatistic = xdc.useModule('ti.uia.events.UIAStatistic');
 /*
 * Turn on ANALYSIS for benchmark events and others for Log_print used in app
 */
/* RUNTIME_ON Diags masks */
Main.common$.diags_USER1 = Diags.RUNTIME_ON;
/* RUNTIME_OFF Diags masks */
Main.common$.diags_ANALYSIS = Diags.RUNTIME_OFF;
Main.common$.diags_ENTRY = Diags.RUNTIME_OFF;
Main.common$.diags_EXIT = Diags.RUNTIME_OFF;
Main.common$.diags_USER2 = Diags.RUNTIME_OFF;
Main.common$.diags_USER3 = Diags.RUNTIME_OFF;
Main.common$.diags_USER4 = Diags.RUNTIME_OFF;
Main.common$.diags_USER5 = Diags.RUNTIME_OFF;
Main.common$.diags_USER6 = Diags.RUNTIME_OFF;
Main.common$.diags_USER7 = Diags.RUNTIME_OFF;
Main.common$.diags_INFO = Diags.RUNTIME_OFF;
Main.common$.diags_USER8 = Diags.RUNTIME_OFF;
/* Turning Semaphore logging off */
Semaphore.common$.diags_USER1 = Diags.RUNTIME_OFF;
Semaphore.common$.diags_USER2 = Diags.RUNTIME_OFF;

The steps to view traces from DSP are similar to VIDEO and VPSS Media Controllers as mentioned above.

Note! A future version of EZSDK will have this integrated for DSP in the same way as done for VIDEO and VPSS Media
Controllers

Download the Latest EZSDK[edit]

The latest EZSDK is available for download from http://software-dl.ti.com/dsps/dsps_public_sw/ezsdk/latest/index_FDS.html.

The current version is 5.05.02.00. The supported platforms are DM816x and DM814x.

EZSDK Support
E2e.jpg {{
  1. switchcategory:MultiCore=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article OMX Viewing Media Controller Traces here.

Keystone=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article OMX Viewing Media Controller Traces here.

C2000=For technical support on the C2000 please post your questions on The C2000 Forum. Please post only comments about the article OMX Viewing Media Controller Traces here. DaVinci=For technical support on DaVincoplease post your questions on The DaVinci Forum. Please post only comments about the article OMX Viewing Media Controller Traces here. MSP430=For technical support on MSP430 please post your questions on The MSP430 Forum. Please post only comments about the article OMX Viewing Media Controller Traces here. OMAP35x=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article OMX Viewing Media Controller Traces here. OMAPL1=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article OMX Viewing Media Controller Traces here. MAVRK=For technical support on MAVRK please post your questions on The MAVRK Toolbox Forum. Please post only comments about the article OMX Viewing Media Controller Traces here. For technical support please post your questions at http://e2e.ti.com. Please post only comments about the article OMX Viewing Media Controller Traces here.

}}

Hyperlink blue.png Links

Amplifiers & Linear
Audio
Broadband RF/IF & Digital Radio
Clocks & Timers
Data Converters

DLP & MEMS
High-Reliability
Interface
Logic
Power Management

Processors

Switches & Multiplexers
Temperature Sensors & Control ICs
Wireless Connectivity