Board = imx rt 1064evk.
If i run evkmimxrt1064_gpt_timer example code timer generating 1 second delay.
Same code copied into my free rtos project but timer callback calling after 3-5 seconds delay.
GPT_GetDefaultConfig(&gptConfig); GPT_Init(ELMEASURE_GPT, &gptConfig); /* Initialize GPT module */ GPT_SetClockDivider(ELMEASURE_GPT, 3); /* Divide GPT clock source frequency by 3 inside GPT module */ gptFreq = ELMEASURE_GPT_CLK_FREQ; /* Get GPT clock frequency */ gptFreq /= 3; /* GPT frequency is divided by 3 inside module */ GPT_SetOutputCompareValue(ELMEASURE_GPT, kGPT_OutputCompare_Channel1, gptFreq); /* Set both GPT modules to 1 second duration */ GPT_EnableInterrupts(ELMEASURE_GPT, kGPT_OutputCompare1InterruptEnable); /* Enable GPT Output Compare1 interrupt */ NVIC_SetPriority(GPT_IRQ_ID, 4U);/* Enable at the Interrupt */ EnableIRQ(GPT_IRQ_ID);
Why timer callback interrupt latency more ?
How to solve this issue ?
Thanks & Regards,
Solved! Go to Solution.
Hi Vasudhevan G,
Thank you for your interest in NXP Semiconductor products and
for the opportunity to serve you.
I think the delay issue is caused by GPT interrupt handler be preempted by other tasks or interrupt handlers which have higher priority.
So I think you should increase the interrupt priority to assure it will be serviced immediately.