Re: Is "CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC = 32768" correct for nRF52840?

Wang, Steven L

Hi Carles:

   Thanks for help on it.


On 6/28/2019 9:50 PM, Cufi, Carles wrote:
Hi Steven,

Yes, it's correct but there's an inaccuracy problem that Andy has fixed in this PR:


-----Original Message-----
From: <> On
Behalf Of Wang, Steven L via Lists.Zephyrproject.Org
Sent: 28 June 2019 10:03
Subject: [Zephyr-devel] Is "CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC = 32768"
correct for nRF52840?


   Does anyone know if "CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC = 32768" is
correct for nRF52840? I call test_kernel_systick() with reel_board and
it always fails. I tried to print "start_time" and "stop_time"

and found that "stop_time - start_time" was around "32670". However, it
is supposed to be a number bigger than "32768". So, I'm wondering if
"32768" is correct setting.

#define WAIT_TIME_US 1000000

void test_kernel_systick(void)
        u32_t start_time, stop_time, diff;

        start_time = osKernelSysTick();
        stop_time = osKernelSysTick();

        diff = SYS_CLOCK_HW_CYCLES_TO_NS(stop_time -
                                         start_time) / NSEC_PER_USEC;

        zassert_true(diff >= WAIT_TIME_US, NULL); }



Join to automatically receive all group messages.