Can REPL affect the timing that 'print()'s are delivered to PC? #16322
-
I have quiet a complicated project which is counting the frames of a video, well timing along side the video to output a LTC signal which can be recorded to align recording later. I implement some code where the moment the frame count changed, it is printed. When the output is recorded on PC (with timestamps applied by
I re-implemented a similar script, cut down to try to identify issue. I am seeing similar occasional delays.
Test code is structured similarly to proper code; One thread manages PIOs, which in turn trigger interrupt. Other thread manages UI, and prints to the 'screen'. It appears the IRQs happen at the correct time (33ms intervals), and that the main thread has ample 'sleep time' (1ms sleeps per dot + 5ms focused wait) between prints. Questions: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
The same delays are visible when the test script is run on a UART REPL '.uf2' If I grep the shorter "0.02" timestamps (right after delay) its pretty clear that this is happening every ~1.2s....
|
Beta Was this translation helpful? Give feedback.
-
Maybe you can try different kinds of boards... |
Beta Was this translation helpful? Give feedback.
When a Python script is running, the REPL loop is not active. Actually, the running Python is started by the most recent action of REPL (Read Eval Print Loop). The short delays may result from either garbage collection or reloading code from serial flash into the code cache.