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.

Timer can't start on dsp

Hi all,

I tried to create a timer in dsp application on DM8168,  but Timer_Func can't be called. My code is as following:

Timer_Params timer_params;                                  

Timer_Params_init(&timer_params);         

Error_Bolck eb;                

Error_init(&eb);  

timer_params.period = 500;                                            

timer_params.periodType = Timer_PeriodType_MIRCOSECS;

timer_params.startMode = Timer_StartMode_USER;

timer_handle = Timer_Create(Timer_ANY, timerFunc, &timer_params, &eb);

if(timer_handle == NULL) {

}

Timer_start(timer_handle);

Above code is executed in a task, timer_handle returns correct, but timerFunc never be called. Dose any one can help, thanks!

 

BR,

Lihui

  • Hi Iihui,

    which version of SYS/BIOS and XDCtools are you using?

    Can you see the Timer created and if it's running using ROV?

    Can you insert a breakpoint in timerFunc()?

    Are you using any gel scripts that might need to set up the Timer's clock?

  • Hi Tom,

    I'm using bios_6_32_01_38 and xdctools_3_22_01_21.

    I'm sure the timer has been created, but the results of Timer_getPeriod and Timer_getCount are not correct, they always return big number, eg. Timer_getPeriod returns 1721511895 and Timer_getCount returns134496272 in each call.

    timerFunc can't be reached, I'm not using any gel scripts.

    Thanks.

    Lihui

  • Hi Tom,

    I have just insert a breakpoint in timerFunc, but it can't be reached, and I found that the timer has been created, it has valid address, but its halTimerHandle is null, do you know the reason, thanks.

     

    Lihui

  • Hi Lihui,

    on which core are you creating this timer? I'm thinking you probably need some sort of GEL scripts to turn on the timers for that core. Are you using a TI development board?

    Are you using the Instrumented library? If not, use the instrumented libraries by adding this to your .cfg file:

    BIOS.libType = BIOS.LibType_Instrumented;
    BIOS.assertsEnabled = true;
    BIOS.logsEnabled = true;

    This will enable some error checking when creating the Timer. If you see the Timer in ROV with this weird period value then it's most likely that the Timer hasn't been turned on before you're trying to create it.

    See this wiki page for the gel scripts.

  • Hi Tom, 

    I'm using TI development board EVMDM8168, and the timer is created on DSP core. I tried to use GEL scripts to turn on the timers and now the Timer_Func can be called, thank you very much.

    But GEL scripts is just used for debug, it can not be compiled into my app file, if i wanna download my app to DSP, the timers will be off when my app is running. Can you tell me how to enable the timers via Linux or sys/bios, because I download my DSP app by slaveloader.

    Thanks.

    Lihui

  • lihui gong said:
    But GEL scripts is just used for debug, it can not be compiled into my app file, if i wanna download my app to DSP, the timers will be off when my app is running. Can you tell me how to enable the timers via Linux or sys/bios, because I download my DSP app by slaveloader.

    Hi Lihui,

    I understand the dilemma here and I apologize that there isn't a better answer. From my understanding you'd have to examine the gel file and add the equivalent C code to access the timer registers in your application. I'm not sure why we don't have some code to do this is...but this portion is generally taken care of by a boot-loader. I'm not familiar enough with slaveloader to know if it can enable the timers for you.