-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Is it possible to switch the USB mode at runtime programmatically? #8277
Comments
you could manually boot into download mode, which will expose the CDC/JTAG interface and allow you to flash. |
@me-no-dev this is not really a solution... to let users flash the firmware on their devices and then configure the wifi connection on the same webpage before accessing the web interface of the firmware itself. if you set the device in CDC mode and then you flash a TinyUSB firmware, you can't setup the wifi connection as described before because the improv-wifi does not work since it tries to Serial.print() using the TinyUSB method on a CDC connection. |
seems that you mention a few different problems. Getting TinyUSB's CDC to reboot into download, when attempted by
|
@me-no-dev thanks for the answer. the idea is to
it would be cool to have a function like the is it possible to do this? this could be really useful since the only method that works with web tools is CDC. |
Switching USB controllers is not all that straight-forward. We can and should look into this in the future, but as of now is not possible. |
if you agree please leave this issue open as a reminder, this feature would be really really useful for a lot of use cases in addition to the one I explained before. |
done :) |
thank you very much, I appreciate it. :) |
Related to this, is it possible to change the device type programmatically before initialising? I would like to select either CDC or MSC (depending on a user input at boot), and it's okay to reboot in order to change between them |
Postponing to 3.1.0 milestone. |
Hello, has this topic been worked on? I want to create a Custom USB HID Device with an update feature: When the user presses a button while the setup() function is running, the USB mode should switch to MSC Update, so a user can upload a new binary firmware file to ESP via the explorer. I've tried that and the windows explorer also openes and shows that "MSC drive" when I press the button. Here is my code:
Is that what I want to do currently possible and if so, what am I doing wrong? |
Hello, Due to the overwhelming volume of issues currently being addressed, we have decided to close the previously received tickets. If you still require assistance or if the issue persists, please don't hesitate to reopen the ticket. Thanks. |
Board
Lolin ESP32-S3 mini
Device Description
ESP32-S3
Hardware Configuration
no gpio in use
Version
latest master (checkout manually)
IDE Name
CLION
Operating System
Windows 11
Flash frequency
80MHz
PSRAM enabled
yes
Upload speed
115200
Description
esptool.js does not work with TinyUSB devices like S2 and S3,
espressif/esptool-js#97
this means that you cannot flash this devices using a web tool when they are in TinyUSB mode.
as you can imagine TinyUSB is much better than CDC since CDC creates lags on S3, it consumes more memory and it's not as stable as TinyUSB.
is there a way to flash a CDC firmware using the esptool.js and then switch to TinyUSB at runtime using some lines of code inside our firmware?
Sketch
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: