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.

Corrupted LoggerSM logging and XDC runtime error: wrong type of return value:getDefaultTransport

Other Parts Discussed in Thread: CCSTUDIO, SYSBIOS

Hello,

I'm using LoggerSM to send Log_print messages from the DSP to the host. This is a follow-on post to my question from last week here:

http://e2e.ti.com/support/embedded/bios/f/355/t/195224.aspx

I am writing the C674x DSP code for a DM816x.  We're using sysbios 6.32.05.54, and CCS 5.1.0.09000.

When I use the .cfg file settings copied from the other project, I get this error message:

js: "C:/CCStudio_v5.1/uia_1_00_03_25/packages/ti/uia/runtime/ServiceMgr.xs", line 81: XDC runtime error: wrong type of return value: getDefaultTransport
    "C:/CCStudio_v5.1/uia_1_00_03_25/packages/ti/uia/services/Rta.xs", line 58
    "C:/CCStudio_v5.1/uia_1_00_03_25/packages/ti/uia/sysbios/LoggingSetup.xs", line 325
xdctools_3_22_04_46\gmake.exe: *** [package/cfg/PolyDspMillennium_pe674.xdl] Error 1

If I add this line in my .cfg file the error goes away:

ServiceMgr.transportType = ServiceMgr.TransportType_FILE;

The reason I'm fiddling with settings is because I am seeing corrupted logging messages and am looking for the cause. I see logging such as this after running "logcat" in the serial port:

D/mengine (  443): CRIT  hd[0]: AudioManager: Started speaker things
D/mengine (  443): DEBUG dsp[0] »µ³þŽìñZ¿±;ŠýN—åÙßuý»ÿü®å·yíõkÜ£âîß½Ïmo¿ùFk“?}Fï¯÷]»ÍgÕÞþõyç»ïöíúª/»ùOfëûŸÒ
í¯¥ß½>
D/mengine (  443): DEBUG hd[0]: AudioManager: AudioCmd returned err=0, response str = " audioChanInit complete
"
D/mengine (  443): DEBUG dsp[0] #:00002 T:00000002900c58a9 S:what the fruit?

Sometimes the messages from "dsp[0]" are clean and sometimes they aren't. It looks like memory is being stomped on. If I run the existing project's dsp.out file there is no corruption so I did not suspect a problem on the host (ARM) side. Instead I suspect there is something wrong with my DSP settings. The DSP .map file shows that LOGGERSM is at a high address away from everything else:

MEMORY CONFIGURATION

         name            origin    length      used     unused   attr    fill
----------------------  --------  ---------  --------  --------  ----  --------
  OCMC_0                40300000   00040000  0000c000  00034000  RW X
  OCMC_1                40400000   00040000  00000000  00040000  RW X
  EXT_RAM               80000000   18000000  00000000  18000000  RW X
  SHARED_CTRL           98000000   01000000  01000000  00000000  RW  
  SHARED_DATA           9eb00000   00100000  00100000  00000000  RW  
  DDR2                  ac000000   03f00000  01455740  02aaa8c0  RW X
  EDMA                  aff00000   00100000  00000000  00100000  RW  
  LOGGERSM              b2d00000   00100000  00100000  00000000  RW  

What is the likely cause of the Log_print corruption? Am I following the wrong path by looking for something related to ServiceMgr.transportType? In spruh43b.pdf, it says "If you do not specify a transportType, UIA picks an appropriate transport
implementation to use based on your device. The defaults are found
using the ti.uia.family.Settings module. If the device is unknown to
ServiceMgr, TransportType_ETHERNET is used."

So it looks to me like the "device" is not properly specified because transportType is not specified but UIA is not picking an appropriate transport. The call to Settings.getDefaultTransport(); in ServiceMgr.xs is failing although the error message is confusing because it says the return *type* is wrong.

Thanks,
Annie

  • Update:

    Based on the example config at this site http://processors.wiki.ti.com/index.php/OMX_Viewing_Media_Controller_Traces, I tried adding this to my .cfg file:

    ServiceMgr.transportType = ServiceMgr.TransportType_NULL;

    This got rid of the build error message but I still see corruption in the DSP logs.

  • Annie Mac said:
    Sometimes the messages from "dsp[0]" are clean and sometimes they aren't. It looks like memory is being stomped on

    I'm wondering if Linux has been granted that memory used by the LOGGERSM section.  Could you please provide your 'bootargs' variable setting for Linux (can be retrieved using the Linux command '% cat /proc/cmdline').

    If not that, perhaps you have caching enabled for that LOGGERSM section and it needs to be non-cached (just guessing, I'm not sure it does need to be non-cached).  The cachable setting for that LOGGERSM section @ 0xb2d00000 is controlled by MAR register 178, and to control that setting you would have configuration element in your DSP's .cfg file, something like:
        var Cache = xdc.useModule('ti.sysbios.family.c64p.Cache');
        Cache.MAR160_191 = 0x00040000;
    Do you have any setting in your .cfg file for Cache.MAR160_191?  If so, it probably needs to be removed (MAR178 controls caching for 0xb2000000->0xb3000000).

    Regards,

    - Rob

     

  • Hello Rob,

    I have no cache-related settings in my .cfg file.

    # cat /proc/cmdline
    console=ttyO2,115200n8 androidboot.console=ttyO2 vram=16M mem=128M@0x80000000 mem=640M@0xC0000000 vmalloc=700M
     eth=50:56:63:9e:09:a4 root=/dev/mmcblk0p5 rootwait init=/init

    I have run another test and have looked at the contents of the memory at 0xb2d00000. I am going to attach a text file with the decoded ASCII values which come from the memory dump after pausing the DSP through JTAG. I also tried interpreting the decoded ASCII values. Please see the text at the end of the file. I do see segments of the logging which I want to see but I have shown the "logcat" output too and you will see that these segments do not show in the logcat output. I suspect the starting point of the place where the LoggerSM module tries to interpret strings is incorrect. Is that possible?

    Thanks,
    Annie

    0601.memDump.txt

  • Annie,

    Thanks for analyzing all that output.

    Your memory dump image is interesting.  In case you're curious, the beginning of that area at 0xb2d00000 is actually this object, defined in LoggerSM.xdc:
        /*!
         *  ======== SharedObj ========
         */
        struct SharedObj {
            Bits32 headerTag;
            Bits32 version;
            Bits32 numPartitions;
            Char *endPtr;
            volatile Char *readPtr;
            Char *writePtr;
            Char *buffer;
            Bits32 bufferSizeMAU;
            Bits32 droppedEvents;
            Bits16 moduleId;
            Bits16 instanceId;
            Bits16 decode;
            Bits16 overwrite;
        };
    The values match up nicely, so we know that the memory dump is showing this state object.  One interesting note is that the "readPtr" and "writePtr" are both pointing to the same location - 0xb2d00708.  This reflects the fact that this LoggerSM instance is empty, and indicates the last area that was read by the 'logcat' tool (I assume).  It might be interesting to look at the values prior to 0xb2d00708 to see if they match the last thing output by logcat (and you can display the memory window as "character" to show ASCII).

    Another interesting point is the coloring in the image.  Note the dark green starting at 0xb2d00280.  According to the boxes above the window, dark green is for L2 cache, meaning that the displayed values came from the L2 cache.  You indicated that there was no MAR cache config in your .cfg files, but that doesn't necessarily mean that something else isn't setting them.  Could you check the value of the MAR register at 0x018482c8 (if it is 1 then caching is enabled for 0xb2000000->b2ffffff)?

    Regarding your .txt file dumps, it would be easier if you looked at memory in 8-bit character output.  Your "interpretation" is fixing a little-endian display issue, where every 4-byte word is reversed.

    Regards,

    - Rob

     

  • Robert Tivy said:
    According to the boxes above the window, dark green is for L2 cache, meaning that the displayed values came from the L2 cache

    I forgot to add that it might prove useful to uncheck that "L2 Cache" box at the top of the Memory window and see if the values in green change (other than the color, which will change to either white (not in cache) or blue (L1D Cache)).

    Regards,

    - Rob

     

  • Hello Rob,

    Thanks for your reply. The value of the MAR register at 0x018482c8 is indeed 1. I will look at how to disable this.

    Displaying memory in character mode! Doh! Why didn't I look for a handy shortcut like that?

    I'll make some changes and do some more testing.

    Thanks,
    Annie

  • Annie Mac said:

    Thanks for your reply. The value of the MAR register at 0x018482c8 is indeed 1. I will look at how to disable this.

    Put this in your .cfg file to disable it:
        var Cache = xdc.useModule('ti.sysbios.family.c64p.Cache');
        Cache.MAR160_191 = 0x00000000;
    However, each MAR register has only one valid bit, yet the configuration element above covers 32 registers.  Setting Cache.MAR160_191 to 0x00000000 disables caching for the whole memory range of 0xa0000000 -> 0xbfffffff.  In order to preserve other MAR registers that need (or should have) cache enabled you should inspect MAR registers 160->191 in your memory window.  We already know that you don't want 0x018482c8 to be 1.  MAR160 is at 0x01848280 and MAR191 is at 0x018482fc, so when displaying that memory range you should see a bunch of 0x00000000 and 0x00000001 values.

    Whatever the resulting bit mask is, it should *not* have bit 18 set (which covers MAR178).  Also, it's important to realize that in the .cfg setting of Cache.MAR160_191, bit 0 reflects MAR160 and bit 31 reflects MAR191 (kinda backwards, but it is what it is).

    I hope this helps, and hope that I haven't misstated any numbers or addresses above.

    Regards,

    - Rob

     

  • Thanks Rob. Your advice has fixed the issue  :-)

    In my case I had to add this so that the existing config of MAR172 - 175 kept the value of 1:

    var Cache = xdc.useModule('ti.sysbios.family.c64p.Cache');
    Cache.MAR160_191 = 0x0000F000;

    With this change the DSP logging displayed when "logcat" is run in the serial port is clean and solid. Yay!

  • Annie Mac said:

    In my case I had to add this so that the existing config of MAR172 - 175 kept the value of 1:

    var Cache = xdc.useModule('ti.sysbios.family.c64p.Cache');
    Cache.MAR160_191 = 0x0000F000;

    Great to hear, you're welcome.  That config looks right (although I'm sure you *knew* that, but it's a tricky config).

    Regards,

    - Rob