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.

AM3359 DMTimer HWI and LoggerBuf

Other Parts Discussed in Thread: SYSBIOS, AM3359

Hello,

i am using ice am3359 with sysbios.

i have a DMTimer interrupt with 20kHz. It looks good. And in the .cfg file i have a LoggerBuf:

/* 
 * Create and install logger for the whole system
 */
var loggerBufParams = new LoggerBuf.Params();
loggerBufParams.numEntries = 256;
var logger0 = LoggerBuf.create(loggerBufParams);
Defaults.common$.logger = logger0;
Main.common$.diags_INFO = Diags.ALWAYS_ON;

When i want to use UIA System Analyzer [xdc.useModule('ti.uia.sysbios.LoggingSetup');] , its suggested to disable this LoggerBuf.

If i disable the LoggerBuf (UIA LoggingSetup also disabled) then my 20kHz DMTimer does not look like before on the scope.

I can see the 20kHz pin toggle, but i can see more longer low or high level with very short peaks (high or low). (see pic)

Can anyone explain this behavoir?

Thank You

  • I'm not sure I understand the two scope traces you've provided.

    Are you saying that the left hand trace is with the LoggerBuf disabled, and the right hand trace is with the LoggerBuf enabled?

    Alan

  • oh sorry,

    yes, that is exactly what i mean.  Without Logger, i have this behavoir on the left side. (longer low/high level with peaks and between sometimes the 20kHz )

    If i disable LoggerBuf, and enable LoggingSetup (UIA) then the scope shows only the 20kHz PinToggle without the high/low levels between them...

  • Not knowing where the code is that is toggling the i/o pin that you're monitoring, I'll make this guess:

    With Logging enabled, there is processing time added to each Hwi to post the log event associated with the Hwi. The additional processing time affects when the code that toggles the i/o pin you're monitoring is executed. The result is that the 'on' time is longer, appearing as an increase in 'duty cycle'.

    I don't have a solid explanation for the apparent frequency increase (twice the number of pulses per period) when logging is disabled unless it is a scope triggering artifact, (or the horizontal scale is not the same between the two snapshots).

    Alan

  • No the scope scale is the same. When i am using LoggingSetup (UIA) then i can see the normal correct 20kHz signal.

    It´s only if all Logger are disabled.

    I think a logger should not modifiy the timing or cause any time side affects when a HW Interrupt trigger a GPIO ?!

  • If the scope scale is the same and triggering is consistent between the two traces then I suspect what is happening is that the additional interrupt processing overhead of posting the Hwi log event is taking so long that every other timer interrupt is getting missed. This implies that the log-enabled scope trace is showing a 10KHz wave form and the log-disabled scope trace is showing a 20KHz wave form.

    As you stated, adding logging instrumentation should/would ideally not interfere with the runtime behavior of an application. Realistically though, software-controlled instrumentation will always have some effect on the performance.

    Due to the software overhead of posting the log events, logging high frequency interrupt events in a system can effect performance.

    If you do not need to have the interrupt events logged, you can add the following to your .cfg file to disable them:

        var Diags = xdc.useModule('xdc.runtime.Diags');
        var Hwi = xdc.useModule('ti.sysbios.hal.Hwi');
        Hwi.common$.diags_USER1 = Diags.ALWAYS_OFF;
        Hwi.common$.diags_USER2 = Diags.ALWAYS_OFF;
    If my suspicions are correct, the above configuration will yield the scope trace for logging-disabled even with logging enabled.
    Alan