threadX question

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
DeXi_1316761
Level 3
Level 3
Distributor - Future(GC)
10 sign-ins 5 sign-ins 10 replies posted

In Wiced RTOS- ThreadX, how long(ms) is one tick? example: tx_thread_sleep(1).

0 Likes
1 Solution
PriyaM_16
Moderator
Moderator
Moderator
250 replies posted 100 replies posted 50 replies posted

1 Timer tick is equivalent to 1msec.

To support my statement:

In platform.c file, the platform_tick_timer is initialized.

platform_tick_timer_init() -> platform_tick_init() ->  platform_pmu_cycles_per_tick = CYCLES_PMU_PER_TICK;

CYCLES_PMU_PER_TICK = ( ( ( (platform_reference_clock_get_freq( PLATFORM_REFERENCE_CLOCK_ILP )) + ( (1000) / 2 ) ) / (1000) ) )

and PLATFORM_REFERENCE_CLOCK_ILP = 32000.

(Note: Platform I have referred is: CYW943907AEVAL1F)

View solution in original post

2 Replies
PriyaM_16
Moderator
Moderator
Moderator
250 replies posted 100 replies posted 50 replies posted

1 Timer tick is equivalent to 1msec.

To support my statement:

In platform.c file, the platform_tick_timer is initialized.

platform_tick_timer_init() -> platform_tick_init() ->  platform_pmu_cycles_per_tick = CYCLES_PMU_PER_TICK;

CYCLES_PMU_PER_TICK = ( ( ( (platform_reference_clock_get_freq( PLATFORM_REFERENCE_CLOCK_ILP )) + ( (1000) / 2 ) ) / (1000) ) )

and PLATFORM_REFERENCE_CLOCK_ILP = 32000.

(Note: Platform I have referred is: CYW943907AEVAL1F)

riya wrote:

1 Timer tick is equivalent to 1msec.

Don't assueme 1 tick as 1 ms.

It's true for now as SYSTICK_FREQUENCY happen to be 1000, but there is no guarantee it won't be changed in the future.

Use tx_thread_sleep((ULONG)(num_ms * SYSTICK_FREQUENCY / 1000)) instead.

0 Likes