-
Notifications
You must be signed in to change notification settings - Fork 129
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 USB CDC mode flashing supported in espflash? #656
Comments
Any update on this one? |
I am unsure whether or not we intend to support DFU mode in the upcoming release, based on previous conversation among the team regarding this. Perhaps we will change our minds and choose to include it, but as of right now I'd say this will most likely require contributions from the community for it to be added. |
By the way, there seems to be some confusion between CDC and DFU flashing.
Here esptool didn't use DFU to flash, it flashed over CDC. For DFU flashing, there is nothing ESP-specific about it AFAIK, so the standard dfu-util package can be used. I don't think it makes sense to develop a new tool or to extend espflash to support DFU, when an existing tool does the job. OTOH, there is no technical reason why espflash shouldn't be able to flash the board over CDC in the above scenario — the protocol is exactly the same as when flashing over UART or USB_SERIAL_JTAG, we are just skipping the reset process since the chip is already in download mode. So this part could probably be fixed. However, as @jessebraham said, this will likely require a community contribution, as support for ESP32-S2 is not a priority for the team right now. |
@igrr Thanks for the correction. "support for ESP32-S2 is not a priority for the team right now." Note that ESP32-S2/S3/C3/C6/H2 all support USB CDC flashing under the download boot mode. https://docs.espressif.com/projects/arduino-esp32/en/latest/tutorials/cdc_dfu_flash.html |
Maybe we can document thisit in the README? The behavior and the decision to not prioritize fixing it. Because when I read this:
I get the impression that ESP32-S2 is included as well, since it worked in previous versions. |
I suppose the USB CDC download mode of ESP32-S2 isn't used as often as UART download mode is, which could be the reason why this issue hasn't been raised earlier.
That is true. However please note that ESP32-S3, C3, C6, H2 all have a fixed-function USB_SERIAL_JTAG peripheral which implements USB CDC (along with a vendor-specific USB-JTAG adapter). On the other hand, ESP32-S2 CDC is a software implementation which uses the USB_OTG peripheral. While finally both the USB_SERIAL_JTAG and USB_OTG based CDC implementations should work equally well, there could be some bugs which only occur in the USB_OTG case.
Having a section about chip-specific limitations such as this one sounds reasonable to me, but I'll defer to someone from esp-rs team whether it's an important enough thing to be added, or if keeping this issue open is enough. |
According to the ESP32-S2 reference manual, the download boot mode can be entered by holding GPIO0 down when the chip is reset (CHIP_PU is hold down). when CHIP_PU becomes high, the ESP32-S2FH4 becomes a USB device with DFU and CDC interfaces (303a:0002, /dev/ttyACM0 on Linux).
espflash
failed to flash the chip through USB under this mode:but this works:
More info:
then:
The text was updated successfully, but these errors were encountered: