8000 USB output only starts after main.py finishes (RP2040) · Issue #5212 · adafruit/circuitpython · GitHub
[go: up one dir, main page]

Skip to content
USB output only starts after main.py finishes (RP2040) #5212
Closed
@urish

Description

@urish

CircuitPython version

- Adafruit CircuitPython 7.0.0-beta.0 on 2021-08-24; Raspberry Pi Pico with rp2040
- Adafruit CircuitPython 6.3.0 on 2021-06-01; Raspberry Pi Pico with rp2040

(tested on both versions)

Code/REPL

print("Hello, Pi Pico!")

Behavior

I'm working on adding CircuitPython support to my Raspberry Pi Pico simulator on Wokwi.com.

The USB Serial output seems to initialize only after main.py finishes running, so the user can't see any output (or enter any input, such as Ctrl+C) as long as main.py is running. Once main.py finishes running, the USB Serial console initializes and then the user is dropped into the REPL and can interact with it.

With MicroPython, when using USB console, it seems to be able to initialize the USB Serial while main.py in running. So the very first prints do not show up, but then after ~16 milliseconds prints starting to show.

Here's a bit more complex example demonstrating the issue. The code is running and blinking the LED, but the Serial prints do not show up, as the Serial USB does not initialize until after main() finishes:

https://wokwi.com/arduino/projects/307811252339475011

Ideally, I think the best user experience for the simulator is to start executing main.py only when the Serial console has fully initialized. This way, the user can also see the output in case of any syntax errors in main.py. Also, I'd love to be able to use the official Pi Pico builds out of the box, without having to maintain a separate build for running in the simulator.

I'd appreciate any relevant input or pointers how to look into this and provide CircuitPython users with the best possible user experience.

Description

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    rp2040Raspberry Pi RP2040supportissues that involve helping a user accomplish a tasktooling

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0