I have discovered that the timing of RT thread OS does not work as expected on the raspberry pi pico. To demonstrate this issue I have created a default blink project with the following (default) settings:
My goal with this test is to turn on and off a LED for 10 seconds:
In reality, the LED goes on and off approx every 5 seconds. I have tried different delay values but every time the LED blinking happens too fast. The point I am making is: the timing is way off.
Using the sleep function of PICO SDK works perfectly as expected, but i want to use RT thread functions to have a portable code.
I tried playing around with the frequency value but the result stays the same.. sleep value in the code does not match the reality.
Is there a configuration or an implementation that i am missing? Ultimately i want to use software timers but at the moment this won't be possible because the timing is way off. This simple on-and-off example was for me a good starting point to test the timing.
Note: i am using the latest version of RT thread (and BSP)
I noticed that the sys tick of the previous ported version is not accurate, a patch has been submitted, you can refer to the modification.