This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LoggerSMDump not returning (no logs being read)

Other Parts Discussed in Thread: SYSBIOS

OMAP L138

SYS/BIOS: 6_34_04_22

UIA: 1_03_00_02 

Note 1: While trying to compile my code, I was advised by TI (Todd) to switch to UIA_1_02_00_07 (http://e2e.ti.com/support/embedded/tirtos/f/355/t/356220.aspx) but I decided to persist and commented out the offending function call to see how far I can get. ]

Hi

I am trying to get LoggerSM working on OMAP L138. I have modified my C code and .cfg file so that all logging is done via loggerSM module. I have configured the loggerSM to stored coded logs to the shared memory, which I they try to retrieve and store in a binary file. When I try to retrieve the logs using the LoggerSMDump utility, I get the following message:

> ./loggerSMDump.out -d 0x80000000 0xffff dsp myBinaryFile2.bin
LoggerSM_dumpSharedMem: Show status of all 1 partitions
partitionId = 0, addr = 0x80000000, headerTag = 0x14011938 [initialized]
  version = 1, decode = 0, overwrite = 0x0
  moduleId = 0x8052, instanceId = 0x1
  buffer = 0x80000080, endPtr = 0x8000ff00
  writePtr = 0x80000080, readPtr = 0x80000080
  bufferSize = 0xfe80, droppedEvents = 0x0
Opened myBinaryFile2.bin to store encoded records


The console terminal just hangs after I execute loggerSMDump.out. 

I can see in my .map file that a loggerSM section is created in the shared RAM "L3_CAB_RAM" at the expected address (0x80000000), but I dont know if any logs are actually being stored there or not.

In my C file, I am only calling Log_printfX( ), for example:

Log_print0(Diags_USER1, "--> main:");

I include the folloiwng files in my source code:

/* xdctools header files */
#include <xdc/std.h>
#include <xdc/runtime/Diags.h>
#include <xdc/runtime/Error.h>
#include <xdc/runtime/Log.h>
#include <xdc/runtime/System.h>

/* package header files */
#include <ti/ipc/Ipc.h>
#include <ti/ipc/MultiProc.h>
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Task.h>

Below are the relevant parts of my cfg file:

/* set default diags mask */
var Diags = xdc.useModule('xdc.runtime.Diags');
var Defaults = xdc.useModule('xdc.runtime.Defaults');

Defaults.common$.diags_ENTRY     = Diags.ALWAYS_OFF;
Defaults.common$.diags_EXIT      = Diags.ALWAYS_OFF;
Defaults.common$.diags_STATUS    = Diags.RUNTIME_ON;
Defaults.common$.diags_USER1     = Diags.ALWAYS_ON;   /* FIXME #31 */
Defaults.common$.diags_USER2     = Diags.ALWAYS_OFF;
Defaults.common$.diags_USER3     = Diags.ALWAYS_OFF;
.

.

Defaults.common$.diags_INFO      = Diags.ALWAYS_OFF;
Defaults.common$.diags_ANALYSIS  = Diags.ALWAYS_OFF;

 

/* override diags mask for selected modules */
xdc.useModule('xdc.runtime.Main');
Diags.setMaskMeta(
    "xdc.runtime.Main",
    Diags.ENTRY | Diags.EXIT | Diags.INFO,
    Diags.RUNTIME_ON
);

var Registry = xdc.useModule('xdc.runtime.Registry');
Registry.common$.diags_ENTRY = Diags.RUNTIME_OFF;
Registry.common$.diags_EXIT  = Diags.RUNTIME_OFF;
Registry.common$.diags_INFO  = Diags.RUNTIME_OFF;
Registry.common$.diags_USER1 = Diags.RUNTIME_OFF;

/* service manager (for data xfer b/w host and master core) */
var ServiceMgr = xdc.useModule('ti.uia.runtime.ServiceMgr');
ServiceMgr.topology = ServiceMgr.Topology_MULTICORE;
ServiceMgr.masterProcId = 0;
ServiceMgr.transportType = ServiceMgr.TransportType_FILE;
ServiceMgr.periodInMs = 200;

/* sys/bios load logging (disabled) */
var LoggingSetup = xdc.useModule('ti.uia.sysbios.LoggingSetup');
LoggingSetup.loadLogging = false;

/* sys/bios event logging for hwi, swi, tasks and main logging (all disabled)

LoggingSetup.sysbiosTaskLogging = false;
LoggingSetup.sysbiosSwiLogging = false;
LoggingSetup.sysbiosHwiLogging = false;
LoggingSetup.mainLogging = false;

 

var LoggerSM = xdc.useModule('ti.uia.runtime.LoggerSM');

var MultiProc = xdc.useModule('ti.sdo.utils.MultiProc');
LoggerSM.sharedMemorySize = 0xFFFF;
LoggerSM.numPartitions = 1;
LoggerSM.partitionId = MultiProc.id;
LoggerSM.bufSection = ".loggerSM";
LoggerSM.decode = false;


var logger = LoggerSM.create();
LoggingSetup.loadLogger = logger;
LoggingSetup.mainLogger = logger;
LoggingSetup.sysbiosLogger = logger;

Defaults.common$.logger = LoggerSM.create();


I would really appreciate any help.

Thanks

  • ferric said:
    LoggingSetup.sysbiosTaskLogging = false;
    LoggingSetup.sysbiosSwiLogging = false;
    LoggingSetup.sysbiosHwiLogging = false;
    LoggingSetup.mainLogging = false;

    You've disabled all logging with the above lines, so there with be nothing logging into LoggerSM.

    What do you mean that you've commented out the offending function?

    Todd

  • Thanks Todd for the quick reply.

    I meant that in UIAMetaData.xs (located in .../ti/uia/runtime), I made the following change:

    cpuFreq = 300; /*BIOS.getCpuFrequency();
    I wasn't too concerned about the accuracy of the timestamps, therefore I just put a dummy value for cpuFreq instead of making the actual call. Hope I haven' misunderstood what this code is supposed to do. (?).

    I'll modify my cfg file like you suggested.

    Thanks.

  • Still no luck. I've set the following lines to true (they were false before):

    LoggingSetup.sysbiosTaskLogging = true; /*false; */
    LoggingSetup.sysbiosSwiLogging = true; /*false; */
    LoggingSetup.sysbiosHwiLogging = true; /*false; */
    LoggingSetup.mainLogging = true; /*false; */


    I still dont get any logs out from the loggerSMDump application.

    Is there something else that looks wrong in my .cfg or source code?

  • Why do you have the ServiceMgr included? This module is only used to help move logs off the processor via some physical connection.

    Why are you explicitly only having Defaults.common$.diags_USER1 on? LoggingSetup defaults the Diags mask unless the user has explicitly set them, like you have.

    I guess the real question is what Log events are you trying to get? Task? Load? Your own?

    Todd

  • At the moment, I am only trying to get my own logs out, by adding Log_printn( ) commands in the source code. For example, I have the following line in my main function:

    Log_print0(Diags_USER1, "--> main:");

    Thanks for looking into this.

    Ferric

  • I tried out your configuration and the record was added. What makes you think it is not being written? Here is the memory buffer.

    Here are the meanings for the highlighted values:
    First highlighted value: 0x20001080 = readPtr.
    Second highlighted value: 0x20001094 = writePtr
    Third highlight values: Log record...the 0x349c is a pointer to the "--> main:" string.

    Please note you should move to UIA 1.04.00.06. There is a bug with LoggerSM_write2. Or you could fix the offending line and rebuild your current UIA.

    The fix for SDOCM00103804 to went into 1.04.00.06 was to add the following bolded line into LoggerSM_write2 in the  packages\ti\uia\runtime\LoggerSM.c file.

            myWrPtr = fillInEventHdr((Bits32 *)LoggerSM_module->sharedObj->writePtr,
                          numBits8ToWrite, LoggerSM_module->serial++);
            *(myWrPtr++) = ((evt) & 0xffff0000) | mid;
            *(myWrPtr++) = a1;

    Todd

  • Thanks a lot for your help Todd.

    I have modified LoggerSM_write2( ) like you suggested above, and recompiled my app, but I am still getting the same problem. (I am assuming that I don't need to recompile the LoggerSMDump utility. ). I cannot upgrade UIA because that would require sys/bios version 6.35 or later (http://e2e.ti.com/support/embedded/tirtos/f/355/p/356220/1249703.aspx).

    Maybe I am doing something wrong on the source-side (not including some header file perhaps?).

    Thanks once again.

  • Can you confirm the records are in the shared memory on the target. Open a Memory browser and look for ti_uia_runtime_LoggerSM_Module_State_o_sharedBuffer__A. You should see records similar to my picture that I attached.

    Todd

  • I do not have a CCS instance running as our setup is currently based on command line tools only. I only have the loggerSMDump utility to read the memory contents.

    One more thing; I said in my previous reply that I had done the bug fix you suggested but it didn't make any difference. I was under the impression that I could simply modify the LoggerSM.c file (in /ti/uia/runtime/ folder) and rebuild my app. But I now realise that perhaps I need to rebuild the UIA modules before rebuilding my app. Is that correct (i.e. do you think I need to rebuild UIA in order for the bug fix to take effect)?

    I have also noticed that even when I set LoggerSM.decode = true in my cfg file and rebuild my app, the LoggerSMDump utility still thinks that the logs are encoded and opens a LoggerSM.bin file for storing the logs. I thought that the logs would have been stored in decoded form and would simply be displayed on the console. Something's not quite right in my setup.

    Ferric

  • Hi Ferric,

    You need to rebuild the UIA library. Sorry I did not make that clean enough. Take a look in the TI-RTOS User Guide for instructions on how to rebuild products within TI-RTOS (e.g. gmake -f tirtos.mak uia).

    I'll send you a modified LoggerSM.bin that dumps the first N words of the memory. We can look at that to figure out exactly what is going on. Just to make sure, which version of UIA are you using?

    Todd

  • Thanks Todd. I am using UIA_1_03_00_02.


    I did try to rebuild UIA this morning by following the instructions in Section 6.3 ("Rebuilding Target-side UIA Modules") in spruh43d ("Spectrum Analyzer UG"). The compilation stopped when it couldn't find the "ti.sysbios.knl.Semaphore" . Below is the exact error message:

    "ti/uia/sysbios/IpcMP.xdc", line 41:  can't find imported unit: ti.sysbios.knl.Semaphore (ti.sysbios.knl.Semaphore)

    I'll try to follow the instructions in the document you referred to, but I suspect that I'd get the same result.
  • Just an update on the last sentence in my previous post: I can't find the tirtos.mak file on my machine. I inherited this machine from a colleague and all the tools (IPC, XDCtools, Syslink, sys/bios etc) are installed seperately (i.e. not as part of a unified "TI-RTOS" installation).

    Therefore, my only option is to follow the instructions in spruh43d and use the uia.mak file. But this results in the error I mentioned in my previous post.

  • Can you post the uia.mak and uia.bld files you are using and the exact command you are running?

  • The files are attached. The exact command is: make -f uia.mak

    (This is based on Section 6.3 in spruh43d)

    uia_mak_bld.zip
  • Can you try this new library (I added the .pdf to avoid the forum police)? 5658.loggersm.a.pdf

    Rebuild loggerSMDump.out with the new library and run it. This will dump out the contents of the shared memory. Please ntoe I have not tested it...I'm tracking down a board to verify it.

    Todd

  • Hi Todd

    Thanks for sending me the library, at last I can see what's being stored in the memory.


    The log buffer output is attached (. Each entry originally had 6 zeros at front, which I have removed. For example, the third entry was '00000014', which I have truncated to 14. I've compared to the memory dump you posted earlier in this thread but couldn;t see any similarity or any helpful pattern.

    Ferric

  • I have finally got the formatted version of logs working. By formatted version I mean that LoggerSM.decode is set to true in the cfg file. In the end it turned out that I was doing too much in my configuration file. I removed unnecessary entries related to Defaults.common$.diags_** and Registry.common$.diags_**, and replaced them with only Main.common$.diags_USER1 = Diags.ALWAYS_ON; the logs started to appear correctly via the loggerSMDump.out utility (Thanks ToddMullanix at TI). 

    I still need to get the coded version of logs working (with LoggerSM.decode = false) because the decoded version would incur a performance hit on the dsp. But maybe I need to open a new thread for that.

    For anyone trying this in future (getting LoggerSM to work on OMAP L138), here are the relevant parts of my final Dsp.cfg file:

    /* set default diags mask */
    var Diags = xdc.useModule('xdc.runtime.Diags');
    var Defaults = xdc.useModule('xdc.runtime.Defaults');



    /* Added based on example .cfg file (videoM3LoggerSM.cfg)
    var Main = xdc.useModule('xdc.runtime.Main');
    Main.common$.diags_USER1 = Diags.ALWAYS_ON;

    /* sys/bios load logging (disabled) */
    var LoggingSetup = xdc.useModule('ti.uia.sysbios.LoggingSetup');
    LoggingSetup.loadLogging = false;

    /* sys/bios event logging for hwi, swi, tasks and main logging

    LoggingSetup.sysbiosTaskLogging = true;
    LoggingSetup.sysbiosSwiLogging = true;
    LoggingSetup.sysbiosHwiLogging = true;
    LoggingSetup.mainLogging = true;

    var LoggerSM = xdc.useModule('ti.uia.runtime.LoggerSM');

    var MultiProc = xdc.useModule('ti.sdo.utils.MultiProc');
    LoggerSM.sharedMemorySize = 0xFFFF; /*0x20000;*/
    LoggerSM.numPartitions = 1;
    LoggerSM.partitionId = MultiProc.id;
    LoggerSM.bufSection = ".loggerSM";
    LoggerSM.decode = true;


    var logger = LoggerSM.create();
    LoggingSetup.loadLogger = logger;
    LoggingSetup.mainLogger = logger;
    LoggingSetup.sysbiosLogger = logger;

    Defaults.common$.logger = LoggerSM.create();


    /* place the shared memory at the right location */
    /*Program.sectMap[".loggerSM"] = new Program.SectionSpec(); */
    Program.sectMap[".loggerSM"] = "L3_CBA_RAM";
    Program.sectMap[".loggerSM"].loadAddress = 0x80000000;
    Program.sectMap[".loggerSM"].type = "NOLOAD";

    Ferric

  • Hi Todd


    I am closing this thread now as my immediate problem has been resolved. Would it be possible for you to send me the source code for the modified loggerSM.a library that you sent me earlier in this thread (5658.loggersm.a.pdf).

    Thanks a lot for your help.

    Ferric