Hi,
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,
Vasu
Hi Vasu:
For your gpt timer issue, I would suggest you check your gpt timer input clock source and prescaler from regiter GPT_CR and GPT_PN.
In the official demo, the input clock source is ipg_clk. The variable getFreq in the official demo is 75000000 .
If your project use the External clock as the input clock source, then the timer interrupt should be longer than 1 second.
Regards
Daniel
Hi Vasu:
Do you use the latest version SDK 2.7?
Regards
Daniel
Any update ?
Hi Vasu:
Sorry.
I copied the code into hello world example, and it works as expected.
Could you please attach your project here?
Regards
Daniel
Hi Daniel,
Sorry for the late reply.
If run example code working fine.
Same code copied into our free rtos based project timer callback function triggers every 2-5 seconds latency.
Why timer callback function latency is more ?
Thanks & Regards,
Vasu
Sorry I forgot to tell you, my test result is ok to run the gpt timer in a freertos task.
For your case, I would suggest you toggle a LED in the gpt timer ISR to check the real result.
Or you can send me a simple project to me to reproduce your issue on my side.
Regards
Daniel
Hi Daniel,
Sorry for the late reply.
timer callback latency issue This is my one thread.
When i was using QTMR timer working fine for me.
Still i am not able to find out why gpt timer is not working.
I have checked all possible interrupt priority but still no success.
Thanks & Regards,
Vasu
Hi Daniel,
I am using latest SDK 2.7.
Regards,
Vasu