-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot init USB devices in boot.py #882
Comments
Please give some more details about this means: what exactly do you do, and what error output do you see? A soft reset (i.e. Ctrl-D in the REPL) will still disconnect the USB port each time, because the runtime USB interface objects have to all be freed and recreated. A hard reset (i.e. plugging the rp2 in, or calling The only difference between boot.py and main.py is that the first time the device boots from a hard reset, it runs boot.py before it initialises USB. If you put the code in main.py instead of boot.py then the rp2 would first try create a device using the default USB interface, then immediately switch to the custom USB interface. This can show up on the host as connect/disconnect/connect cycle, or as an error depending on the timing. |
With the init line commented out in boot.py:
I see the print statements I expect:
With the init line uncommented in boot.py:
I do not see the print statements I expect:
I get dropped back to the terminal, and connecting with |
Ah snap, If you copy both boot.py and main.py to the filesystem then main.py works and you can use I think the fix for this will be the planned work to have mpremote detect when the USB port is in a disconnect/reconnect cycle, and recover from it instead of erroring out. |
Is there a timeline for when the planned work might be finished? |
Not at the moment, I'm afraid. |
I assume this is impacting |
I tested this on a pico running MP 1.23 and the latest release of usb-device-cdc.
boot.py:
main.py:
Running this as-is,
IFACE_TWO
does show up in main.py, but uncommenting the init function causes the process to error out. This discord post suggests you can callusb.device.get.init()
in boot.py, is this no longer true?The text was updated successfully, but these errors were encountered: