uasyncio / stdio over usb / uart

RP2040 based microcontroller boards running MicroPython.
Target audience: MicroPython users with an RP2040 boards.
This does not include conventional Linux-based Raspberry Pi boards.
Post Reply
Filip_KONAX
Posts: 16
Joined: Wed Jun 08, 2022 1:05 pm

uasyncio / stdio over usb / uart

Post by Filip_KONAX » Wed Jun 22, 2022 3:38 pm

I'm loosing confidence in MicroPython being a good choice for my project. Struggling all along the road with unpredictable execution stops.
Short description of the project (see my other posts): using RP2 and MicroPython with a Waveshare modem on hardware uart.
1) stdio over usb stops when having a lot of communication over the uart (starvation of the TinyUSB task?), partly covered by adding sleep instructions but not sure if that's the way to go (how long should I wait?), irresponsive stdio over usb as result when not putting enough sleep instructions
2) tried to implement the simple "blinking led" on the second core with an easy infinite loop (and a variable to stop it from core 0), stops blinking quite fast (about 5-10 seconds) IRQ problem between USB/UART/TIMER for sleep_ms?
3) tried uasyncio on the second core, stops also quite fast, unless I stop doing my uart stuff on core 0 and just put a sleep instruction one core 0 (what's the point having dual core then :? )
What am I missing? Where did I go wrong? Should I better move to C?

hippy
Posts: 130
Joined: Sat Feb 20, 2021 2:46 pm
Location: UK

Re: uasyncio / stdio over usb / uart

Post by hippy » Wed Jun 22, 2022 4:01 pm

There have been issues with threading on the MicroPython RP2 port but I believe those should have been fixed in recent builds. Make sure you have a recent build - 1.19 arrived after the threading fix so that should include it.

Filip_KONAX
Posts: 16
Joined: Wed Jun 08, 2022 1:05 pm

Re: uasyncio / stdio over usb / uart

Post by Filip_KONAX » Wed Jun 22, 2022 5:13 pm

hippy wrote:
Wed Jun 22, 2022 4:01 pm
There have been issues with threading on the MicroPython RP2 port but I believe those should have been fixed in recent builds. Make sure you have a recent build - 1.19 arrived after the threading fix so that should include it.
Thank you for the reply, unfortunately using 1.19 already...

Post Reply