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.

TDA4VM: Create Timer

Part Number: TDA4VM

Now i am using TDA4VM/J721EX board and "psdk_rtos_auto_j7_07_01" sdk.

I want to create a timer and do something in the timer callback.So,i wrote the code ad bellow:

TimerP_Handle Test_timerHandle;

static void Test_TimerCb(void)
{
    appLogPrintf("-----------------------1000ms timer");
}

static void Test_Timer(void)
{
    appLogPrintf("-----------------------Create Timer");
    /*Create Timer*/
    TimerP_Params timerParams;

    TimerP_Params_init(&timerParams);
    appLogPrintf("-----------------------TimerP_Params_init");
    timerParams.startMode = TimerP_StartMode_USER;
    timerParams.periodType = TimerP_PeriodType_MICROSECS;
    timerParams.period = 1000;/*usecs*/

    Test_timerHandle = TimerP_create(TimerP_ANY, (TimerP_Fxn)Test_TimerCb,
                                &timerParams);
     appLogPrintf("-----------------------TimerP_create end--------------");
    if (NULL == Test_timerHandle)
    {
        /*Failed to create timer*/
        appLogPrintf("-----------------------timer create failed--------------");
    }
    else
    {
        appLogPrintf("-----------------------TimerP_start--------------");
        TimerP_start(Test_timerHandle);
    }
}

But,the log ends at "-----------------------TimerP_Params_init".The program is stuck in the TimerP_create function.

Can anyone help me ?

  • Hi Guokai Yuan,

    Can you please connect a debugger and see what is happening here - is the core crashing or hanging somewhere? Also check the value of Test_timerHandle.

    Without that information it is hard to tell why the next print didn't come.

    Regards,

    Karan