Closed netjoon closed 1 year ago
This is not a tx_thread_sleep issue. I found root cause.
Hi @netjoon - what was the root cause?
I've set two thread's priority same. One thread sleep and the other thread is running. When 1st thread try to wake up, 2nd thread which has same priority with 1st thread is running. No preemption happened. That's why this issue happened.
Describe the bug tx_thread_sleep is not accurate when I set below system_clock and systick_cycles.
SYSTEM_CLOCK = 491520000 SYSTICK_CYCLES = ((SYSTEM_CLOCK / 1000000) -1)
When I call tx_thread_sleep(10) I'm expecting my system to wake up 10 systick later. I added tx_time_get() before and after sleep and check the tick, it varies from 16to 33. Is this expected behavior? If it is, how can we have exact us(microsecond)-based sleep time?
Please also mention any information which could help others to understand the problem you're facing:
To Reproduce Steps to reproduce the behavior:
Expected behavior I'm expecting print value around 10 but it is vary between 16 to 33.
Impact What impact does this issue have on your progress (e.g., annoyance, showstopper) Can not use this RTOS.
Logs and console output If applicable, add console logs or other types of debug information like Wireshark capture as
.zip
file.Additional context Add any other context about the problem here.