Re: ARM HW timer config


Gil Pitney
 

There is a global variable sys_clock_hw_cycles_per_tick which is set
in kernel/sys_clock.c from CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC, and is
later used in cortex_m_systick.c.

Looks like TI CC2560 runs at 48 MHz, so setting
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC to 48000000 should be sufficient.
That's what I did for TI CC32xx (setting at 80 Mhz), and all the
timing functions worked out fine.

On 21 February 2017 at 02:29, Geoffrey LE GOURRIEREC
<geoffrey.legourrierec@smile.fr> wrote:
Hi all,

I'm having trouble understanding how to choose a value for the
SYS_CLOCK_HW_CYCLES_PER_SEC config variable.

I'm porting the CC2650 SoC from TI, which uses a Cortex M3 core.
Thus I plan to use the Cortex's embedded "SysTick" timer as a HW timer.
However, taking a look at drivers/timer/cortex_m_systick.c, the mentioned
CONFIG_SYSTICK_CLOCK_FREQ variable is not in fact defined anywhere.

Should I then simply use the frequency of the clock driving the Cortex core?
Or should I use the driver's interface in the SoC's init() function to set
it up,
and use the generated frequency in SYS_CLOCK_HW_CYCLES_PER_SEC?

Best regards,

--
Geoffrey Le GourriƩrec


_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@lists.zephyrproject.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel

Join devel@lists.zephyrproject.org to automatically receive all group messages.