RT thread timing does not work on RaspberryPiPICO?

Created at 2022-08-04 18:23:53

Hello,

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:

ProjectSettings.PNG

My goal with this test is to turn on and off a LED for 10 seconds:
BlinkTest.PNG

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)

More

Follower
0
Views
775
1 Answer
flyboy
flyboy 2022-08-08

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.

https://github.com/RT-Thread/rt-thread/pull/6242

Write Your Answer

Log in to publish your answer.,Click here to log in.

Create
Post

Share