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.

AM5728: Timer6 can't work stable

Part Number: AM5728
Other Parts Discussed in Thread: AM5718, SYSBIOS

Hello Champs,

HW: customer own AM5718 board
SW: am57xx_06_03_02_08 SDK

Customer can't use Timer6, but he can use Timer5. 

1. How to trigger the Timer6?

2. What timer can be used on AM5718?

Timer6 callback 
Clock_Tick and print Clock_getTicks() in every task, then the timer6 is not stable in some time. Below is the log

[ 28.000] led 28000...
[ 29.000] led 29000...
[ 30.000] led 30000...
[ 31.000] led 31000...
[ 32.000] led 32000...
[ 33.000] led 33000...
[ 34.000] led 34000...
[ 35.000] led 35000...
[ 36.000] led 36000...
[ 37.000] led 37000...
[ 38.000] led 38000...
[ 39.000] led 39000...
[ 40.000] led 40000...
[ 41.000] led 41000...
[ 42.000] led 42000...
[ 43.000] led 43000...
[ 44.003] led 44003...
[ 45.005] led 45005...
[ 46.007] led 46007...
[ 47.009] led 47009...
[ 48.011] led 48011...
[ 49.013] led 49013...
[ 50.015] led 50015...
[ 51.017] led 51017...
[ 52.019] led 52019...
[ 53.021] led 53021...
[ 54.023] led 54023...
[ 55.025] led 55025...
[ 56.027] led 56027...
[ 57.029] led 57029...
[ 58.031] led 58031...
[ 59.033] led 59033...
[ 60.035] led 60035...


configuration code in .cfg

var timer0Params = new Timer.Params();
timer0Params.instance.name = "timer0";
timer0Params.period = 1000;
timer0Params.periodType = xdc.module("ti.sysbios.interfaces.ITimer").PeriodType_MICROSECS;
timer0Params.extFreq.lo = 20000000;
timer0Params.runMode = xdc.module("ti.sysbios.interfaces.ITimer").RunMode_CONTINUOUS;
Program.global.timer0 = Timer.create(4, "&TimerFxn", timer0Params);
Clock.tickSource = Clock.TickSource_USER;
Clock.tickPeriod = 1000;
var timer1Params = new Timer.Params();
timer1Params.instance.name = "timer1";
timer1Params.period = 1000;
timer1Params.periodType = xdc.module("ti.sysbios.interfaces.ITimer").PeriodType_MICROSECS;
timer1Params.extFreq.lo = 20000000;
timer0Params.runMode = xdc.module("ti.sysbios.interfaces.ITimer").RunMode_CONTINUOUS;
Program.global.timer1 = Timer.create(5, "&clockFxn", timer1Params);
ti_sysbios_timers_dmtimer_Timer.anyMask = 48;
ti_sysbios_timers_dmtimer_Timer.intFreq.lo = 20000000;
ti_sysbios_timers_dmtimer_Timer.timerSettings[4].intNum = 12;
ti_sysbios_timers_dmtimer_Timer.timerSettings[5].intNum = 13;

The callback clock function:

void clockFxn(UArg arg)
{
    Clock_tick();
}

He has referenced below links

http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/bios/sysbios/6_46_04_53/exports/bios_6_46_04_53/docs/cdoc/ti/sysbios/family/shared/vayu/TimerSupport.html#avail.Mask

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/719876/rtos-am5728-timer-interrupt-instability/2662506?tisearch=e2e-sitesearch&keymatch=Timer%20instability#2662506

http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/bios/sysbios/6_40_01_15/exports/bios_6_40_01_15/docs/cdoc/ti/sysbios/timers/dmtimer/doc-files/TimerTables.html

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/634017/rtos-am5728-timer-control-from-dsp

Thanks.
Rgds
Shine

  • Hi Shine,

    I see you are using two timer instances here. Can you try running just Timer 6 and see if it is working properly? Also, can you share the code for the Clock_tick?

    Regards,
    Parth

  • Hi Parth,

    Thanks for your help.

    1. Customer has tried running just Timer6, it is not stable. The deviation is not just several ms. It printed many different clock data. 

    2. Clock_tick() is the TI-RTOS clock function.

    Thanks.
    Rgds
    Shine

  • Hi Parth,

    Any suggestions on this issue is appreciated. 

    Thanks.
    Rgds
    Shine

  • Hi Shine,

    Apologies for delay. There is no apparent reason for Timer5 and Timer6 behaving in different manner when both are used in same way. I am trying to reproduce the issue on my end and will soon get back with updates.
    Meanwhile, can you check if you are seeing similar behavior with any other timer instance?

    Regards,
    Parth

  • Hi Parth,

    Thanks for your reply. 

    Customer has tested other Timers. Except for Timer0, 5, 6, the other timers will make Linux not work normally (maybe there is something wrong with his configuration). Besides, the maximum period of Timer0 can only reach 25971Hz. So only Timer5 can work normally. 

    The configuration of Timer0 is below, the other timers' configuration are similar (20MHz in default)

    var timer1Params = new Timer.Params();
    timer1Params.instance.name = "timer1";
    timer1Params.period = 1000;
    timer1Params.periodType = xdc.module("ti.sysbios.interfaces.ITimer").PeriodType_MICROSECS;
    timer1Params.runMode = xdc.module("ti.sysbios.interfaces.ITimer").RunMode_CONTINUOUS;
    timer1Params.extFreq.lo = 25971;
    Program.global.timer1 = Timer.create(0, "&clockFxn", timer1Params);
    var IntXbar = xdc.useModule('ti.sysbios.family.shared.vayu.IntXbar');
    var TimerSupport = xdc.useModule('ti.sysbios.family.shared.vayu.TimerSupport');
    TimerSupport.availMask = 0xFFFF;

    Thanks.
    Rgds
    Shine

  • Hi Shine,

    Is this issue still open?
    If yes, can you please highlight the current state of the issue?

    Regards,
    Parth

  • Hi Parth,

    There is no response from customer. We can close the case.

    Thanks.
    Rgds
    Shine