-
Notifications
You must be signed in to change notification settings - Fork 111
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 there any interest in supporting flashing of TinyUSB devices? #97
Comments
@igrr can you comment on the original question please? thanks |
@sblantipodi I will need to research a bit on what the "TinyUSB mode" is to answer this question. As far as this tool is concerned, the only thing that is necessary is that the application running on the ESP can be reset into ROM download mode over USB CDC using RTS/DTR signals. My guess is the issue you are seeing may be due to the board not having correct eFuses burned, and therefore it uses USB_SERIAL_JTAG peripheral in download mode instead of the USB_OTG peripheral. From espefuse summary you have posted here I see that |
TinyUSB is the SW USB implementation layer. For example on Windows, the USB port will disappear from the device manager in Windows when the ESP32-S2 reboots. It is possible to let the ESP32-S2 reboot into 'flash mode' via the web flasher, but then it will not be able to continue. The enumerated serial port in Windows does get the same com port nr. assigned and also the same USB PID (0x0002) but I don't think it is the same serial port as the one you initially granted permission for in the browser. I have a version running here which is using some patches added by @Jason2866 to help the S2 to enter flash mode. So far I have no idea what is preventing this. Either you may need to enumerate a new serial device after switching it to flash mode, or maybe simply re-start (reinit?) the serial port. I also noticed in the esptool.py some comments stating |
@TD-er correct me if I'm wrong please but as far as I know PlatformIO is able to flash those boards on both modes on my Windows PC. The software USB mode: the hardware native USB version: I have done some benchmarks that seems to confirm what I'm saying, TinyUSB CDC is 2 times faster than USB JTAG Serial, it doesn't causes microlag on the chip while printing to serial like the other mode, and it requires less memory. The latest implementation from Jason2866 is the best I have tried so far. It can flashes the S3 with a software emulated USB firmware (USB/JTAG) without the needs of pressing buttons on the microcontroller and it works with improv-wifi as well. TD-er, please correct me if I said some inaccuracies. |
If you see "USB Serial/JTAG debug unit" in device manager, that is the port provided by the hardware USB_SERIAL_JTAG peripheral. USB_SERIAL_JTAG is a fixed-function composite USB device which provides two classes: USB CDC, for serial port emulation, and a vendor-specific JTAG adapter device. |
As far as I understand it:
When using USBCDC, the serial port will be enumerated as "TinyUSB CDC" When using hardware JTAG, you probably see flow control in action, which will limit the actual throughput making it feel slightly more sluggish? |
@igrr Tried your fork / PR of |
@sblantipodi @igrr For supporting devices which are using Tinyusb mode (firmware) there is an "touch mode" query (special sequence) with 1200baud necessary. The device will switch and opens a new serial port. Connect to this port and flashing is possible (as with every other device). |
thank you all for the answers and for the clarifications. after some research I found that Espressif explains it well here: they say: this is probably why I found TinyUSB much more responsive than the JTAG CDC method. with TinyUSB I can drive 500 LEDs at 60FPS without flickering, @Jason2866 yes I know it, I can upload my tinyusb firmware using PlatformIO with this options:
thanks for pointing it out and for the great job on your web tools... |
As title.
Is there any plan in supporting the flash of TinyUSB devices that was flashed with a TinyUSB firmware previously?
The text was updated successfully, but these errors were encountered: