2025-12-15 4:30 AM
Due to more performance requirement, i wanted to change the ThreadX timebase to 1ms. To what i have researched till now i need to make the following #define TX_TIMER_TICKS_PER_SECOND to 1000 which is usually set at 100 which is 10ms. Any idea what else need to be done to make the ThreadX timebase to 1ms other than this or is this enough already?
Thanks a lot for guidance.
Solved! Go to Solution.
2025-12-15 4:39 AM
You are right, the only change You need is setting TX_TIMER_TICKS_PER_SECOND to 1000.
Martin
2025-12-15 4:39 AM
You are right, the only change You need is setting TX_TIMER_TICKS_PER_SECOND to 1000.
Martin
2025-12-15 4:52 AM
TX_TIMER_TICKS_PER_SECOND doesn't seem to be used anywhere in the code. As such, changing it won't affect anything.
Tick frequency looks to be fixed to 1000 to me. You can manually edit the code to change the timer update frequency but doesn't seem to be a way to do this in my version of CubeMX.
Relevant code would be here:
htim6.Init.Period = (1000000U / 1000U) - 1U;
2025-12-15 6:49 AM - edited 2025-12-15 6:59 AM
ThreadX is using the System timer (not htim6 or other timers), the tick cycle time is set in tx_initialize_low_level.S, in my case (H725):
SYSTEM_CLOCK = 400000000
SYSTICK_CYCLES = ((SYSTEM_CLOCK / 1000) -1)This constant's are handled by CubeMX, and are depending on TX_TIMER_TICKS_PER_SECOND.
So setting
TX_TIMER_TICKS_PER_SECOND to 1000 will give You 1ms tick cyles.
Edit: Sorry I didn't see that You do not use CubeMX. If this is the case then You have to set the time directly in tx_initialize_low_level.S.