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.

UIA NONJTAGTRANSPORT with TransportType_USER but without the auto-created task

Hi,

Today our application uses UIA LoggingSetup with all defaults (JTAG Stop-mode). We would like to switch to using NONJTAGTRANSPORT with our custom transport type. However, when choosing TransportType_USER, the existing UIA implementation creates dedicated task for transferring the data. While we would like to incorporate this transfer logic into existing task in our application. How can we achieve that?

void OurTaskFunc()
{
    for (;;)
    {
        OurCode();
        TransferPendingLogData();
    }
}

Best,
Vasili

  • Hi Vasili,

    Just to clarify, are you using UIA 1.04.00.06 and CCS 6.0.0.00190?  If possible, could you post the .cfg file you are using?

    Thanks,

        Janet

  • Hi Janet,

    Yes. However, as I see that UIA 2.x is available, we are working on upgrading.

    So, can you please explain how this can be achieved in UIA 2.x? More precisely, we want the following:
    1. All the logs being stored in some type of circular buffer as this is done for the JTAG stop mode.
    2. A way to collect the pending data from this buffer in a context of our task.

    Best,
    Vasili

  • Hi Vasili,

    You may be able to use LoggerStreamer or LoggerStreamer2 to do what you want.  LoggerStreamer has a single buffer for all log events, LoggerStreamer2 is very similar, except that it allows multiple logger instances each with their own buffer.  You provide buffers to these loggers and when the buffer is full or flushed, an exchange function (that you write) is called.

    There is a tutorial for LoggerStreamer (geared to UIA 1.x but for 2.x code would be similar):

    http://processors.wiki.ti.com/index.php/System_Analyzer_Tutorial_5A

    Here is some information on the differences between LoggerStreamer and LoggerStreamer2:

    http://processors.wiki.ti.com/index.php/System_Analyzer_Migrating_from_UIA_LoggerStreamer_to_the_multi-instance_UIA_LoggerStreamer2

    Best regards,

        Janet

  • Hi Janet,

    1. I've looked into LoggerStreamer and LoggerStreamer2 as you suggested. However, the interface of both looks way more complicated than my need. In addition, they seem to miss another feature. I can't send only part of the data provided to the transfer function and resume sending later.

    On the other hand, I think I managed to produce a very simple hack for LoggerIdle that makes it to work exactly as I need. I added a simple configuration flag that prevents it from registering the actual idle function to send the data. In place of that, I just call the same function ( LoggerIdle_idleWriteEvent() ) from our code at the point where I want the data transfer to take place.

    I'm sending a patch demonstrating my hack. I hope it demonstrates my need well and TI can think of a better way of answering such need in future version of UIA.

    8836.LogIdle.patch.txt
    Left base folder: C:\TI\uia_2_00_01_34.org
    Right base folder: C:\TI\uia_2_00_01_34
    --- packages\ti\uia\sysbios\LoggerIdle.xdc	2014-06-10 15:38:26.000000000 +0300
    +++ packages\ti\uia\sysbios\LoggerIdle.xdc	2014-10-12 15:57:39.000000000 +0300
    @@ -294,12 +294,21 @@
          *  ======== initDecoder ========
          *  Initialize the Java LoggerIdleDecoder for use in the LoggerIdle
          *  'Records' ROV view.
          */
         function initDecoder();
     
    +    metaonly config Bool registerIdleFunc = true;
    +
    +    /*!
    +     *  ======== idleWriteEvent =========
    +     *  Idle function that calls the transport function to write one
    +     *  Log event.
    +     */
    +    Void idleWriteEvent();
    +
     instance:
         /*!
          *  ======== create ========
          *  Create a `LoggerIdle` logger
          *
          *  The logger instance will route all log events it receives to
    @@ -332,19 +341,12 @@
         /*!
          *  ======== idleWrite =========
          *  Idle function that calls the transport function.
          */
         Void idleWrite();
     
    -    /*!
    -     *  ======== idleWriteEvent =========
    -     *  Idle function that calls the transport function to write one
    -     *  Log event.
    -     */
    -    Void idleWriteEvent();
    -
         Void write(Log.Event evt, xdc.runtime.Types.ModuleId mid,
                 IArg numEventWords,
                 IArg a1, IArg a2, IArg a3, IArg a4,
                 IArg a5, IArg a6, IArg a7, IArg a8);
     
         struct Module_State {
    --- packages\ti\uia\sysbios\LoggerIdle.xs	2014-06-10 15:38:26.000000000 +0300
    +++ packages\ti\uia\sysbios\LoggerIdle.xs	2014-10-12 15:58:39.000000000 +0300
    @@ -73,13 +73,16 @@
         if (LoggerIdle.$written("writeWhenFull")) {
             LoggerIdle.$logWarning("The LoggerIdle.writeWhenFull configuration " +
                                    "parameter has been deprecated.  If the " +
                                    "buffer is full, old data will be overwritten.",
                     LoggerIdle, "writeWhenFull");
         }
    -    Idle.addFunc(LoggerIdle.idleWriteEvent);
    +
    +	if (params.registerIdleFunc) {
    +		Idle.addFunc(LoggerIdle.idleWriteEvent);
    +	}
     
         if (params.transportFxn == null) {
             this.$logError("LoggerIdle cannot have a null transport function", this);
         }
         mod.loggerFxn = params.transportFxn;
         mod.enabled = true;
    

    The configuration I used:

    var LoggingSetup = xdc.useModule('ti.uia.sysbios.LoggingSetup');
    LoggingSetup.loggerType = LoggingSetup.LoggerType_IDLE;
    LoggingSetup.snapshotLogging = true;
    
    var LoggerIdle = xdc.useModule('ti.uia.sysbios.LoggerIdle');
    LoggerIdle.transportFxn = "&TransferLogData";
    LoggerIdle.transportType = LoggerIdle.TransportType_UART;
    LoggerIdle.isTimestampEnabled = true;
    LoggerIdle.registerIdleFunc = false;
    

    2. After I concatenate all the transferred data into a single binary file on the other side. How do I open it in CCS? I tried following the tutorial here: http://processors.wiki.ti.com/index.php/System_Analyzer_Tutorial_3C
    But failed even loading the sample files attached in the tutorial.

    3. I've noticed the following warning during build:

    EXEC : warning : ti.uia.runtime.LogSnapshot does not have a logger defined.

    Any reason why LoggerIdle does not support LogSnapshot?

    Best regards,
    Vasili

  • Hi Vasili,

    1.  I haven't yet had a chance to look at your modifications to LoggerIdle, but it does seem like a reasonable request.

    2. The reason you can't load the binary file in CCS, I'm guessing, is that you need to pre-pend a UIAPacket header to the binary file.  This is a 16-byte header containing the type of data (HdrType_EventPkt), length of the packet, and a few other things which you can probably ignore.  The first word of the UIAPacket header (from UIAPacket.xdc) should contain the following:

         *  HdrType_EventPkt word1
         *   3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0
         *   1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
         *  |---------------------------------------------------------------|
         *  |H H H H|E|L L L L L L L L L L L L L L L L L L L L L L L L L L L|
         *  |---------------------------------------------------------------|
         *
         *  H = HdrType         (4-bits)
         *  E = Payload endian   (1-bit)
         *  L = Packet Length   (27-bits)

    You can probably just use the UIAPacket macros in UIAPacket__epilogue.h (see LoggerStopMode.c code for an example), or just hard-code the values.


    3.  LoggerIdle is a simple, light-weight logger that just inherits from the xdc.runtime.ILogger interface, and not the ti.uia.runtime.ILoggerSnapshot interface.  Therefore, you cannot use LogSnapshot with LoggerIdle.

    Best regards,

        Janet