Hello,
I try to understand how to use HW timers from linux userspace.
Is it by calling timer_create ? If yes - which timer number is associated to it ?
Thank you,
Ran
Solved! Go to Solution.
timer_create() used hrtimer that is high res timer. When the board starts, BSP will pass hw timer to kernel that will be used by hrtimer.
kernel_imx/kernel/time/posix-timers.c
static int common_timer_create(struct k_itimer *new_timer)
{
hrtimer_init(&new_timer->it.real.timer, new_timer->it_clock, 0);
return 0;
}
timer_create() used hrtimer that is high res timer. When the board starts, BSP will pass hw timer to kernel that will be used by hrtimer.
kernel_imx/kernel/time/posix-timers.c
static int common_timer_create(struct k_itimer *new_timer)
{
hrtimer_init(&new_timer->it.real.timer, new_timer->it_clock, 0);
return 0;
}
Hi rashalit,
you may find useful the following threadReg: Using Timers in IMX
Regards,
Carlos
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Carlos,
I've checked the link but it did not help a lot.
I need one HW timer in userspace.
If linux timer_create() is actually using that HW timer than it is good enough.
What I asked before is if timer_create actually using a HW timer (and not just Linux' tick for example which has less precision).
Thank you,
Ran