-
Notifications
You must be signed in to change notification settings - Fork 120
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
Firmware programming using native USB port on ESP32-S3 does not work #331
Comments
Has been fixed upstream but has not been released yet. We'll update when available. |
Hi Paulus,
Feel free to reach out to me, if you need more information or further testing... |
Weird. When we erase the flash, we call Line 163 in ccf9c3b
Esptool-js supports flashing on write too, but that calls the same logic: |
Could be the old stub loader code used in esptool.js. There where some mandatory bug fixes for the S3 in native USB mode in esptool.py stub loaders. |
Yes, there where quite a few fixes in the stub, but actually I tried the stub from esptool.py 4.5.1 and experience the same behavior. The only difference being, that the upload failed a bit earlier (at around 30% instead of at around 80%). I assume (kind of thinking loud) that this has to be kind of a timeout/watchdog issue in the stub that is not triggered by smaller firmware as the upload process is shorter. One difference I was able to spot is how flash size, frequency, etc are handled, when calling Lines 184 to 190 in 0e0bc1d
vs https://github.com/espressif/esptool-js/blob/e8d66b62bfec8c416e65fca614e06965b8bf78fa/index.js#L292-L298 not sure if this could be related..? |
Have you tried when changing this values? |
Yes, I've tried changing these values, but as expected, it did not make any difference. I would have been surprised, if this was the cause, since flashing over an USB to UART bridge works, using exactly the same call... Can anybody replicate the problem or am I the only one facing this issue? |
I have the same issue when I try to configure the WiFi via the ESP Web Tools interface. |
The S3 native USB has 3 modes: (1) CDC/JTAG || (2) OTG - TinyUSB driver || (3) disabled USB Web tools and other uploading modes work best with the (1) CDC/JTAG. Therefore, S3 demands that CDC/JTAG is activated by the running firmware and that all next firmwares keep this mode always active. |
@SuGlider |
To workaround this S3 bug esptool.py and esptool.js needs to be enhanced to do this (set up S3 to work correctly with cdc/jtag) without any user interaction. |
This is not a esptool.py bug, because it works fine with ESPTOOL.py. This is a limitation of WEB-USB-tools. The work around for S3/S2 USB is to set USB DFU mode manually (ROM) by keeping BOOT pressed and pulsing RESET/EN. https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/api-guides/dfu.html |
Check this video: https://www.youtube.com/watch?v=Zqqj8GC0Q9Q |
Can the web flasher toggle the CTS/RTS pins? |
As I do use CDC/JTAG for the USB mode on my S3 devices, this can not be the issue. By now I am suspecting, that the issue is somehow related to Windows not playing nicely with something in esp-web-tools: A few weeks ago, I switched my main workstation to Linux and noticed, that the issue went away (uploading using Chromium). When going back to Windows the problem reappears and the device gets corrupted, after the upload process aborts with the "The device has been lost" message. A side note: I do not use a merged firmware file, I use a manifest with four parts. |
@dkalliv See also my comment here: espressif/esptool-js#97 (comment) |
I tried to upload my firmware using the native USB port of some ESP32-S3 based devices (Epressif ESP32-S3-DevKitC-1, WT32-SC01 Plus as well as one of my own designs). Unfortunatelly the upload (programming) fails with the message "Installation failed, The device has been lost."
It looks like the programming works fine, but towards the end the transfer speeds up like crazy and then fails...
However programming works just just fine, when using an USB to UART bridge (same firmware, same manifest). Interestingly I can program the devices with esptool-js using the native USB port without any issues (using the same firmware).
Just to be sure that this is not related to my system, I've tried the same thing on three different Windows 10 systems and on one system running Windows 11 (not sure if the problem is present on Apple systems as well). I've experienced the same behavior on Microsoft Edge as well as on Google Chrome.
Do you have any idea how this could be fixed?
The text was updated successfully, but these errors were encountered: