-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Windows 11 problem with connecting to ESP32 (ESPTOOL-374) #706
Comments
Hello @sw-dev-code, The chip needs to reset into download mode in order to communicate with esptool and accept commands. This usually happens automatically by asserting DTR and RTS control lines of the USB to serial converter chip (more info here). There might be a regression/difference in Windows 11 drivers causing the DTR/RTS signals to not propagate properly. A temporary solution is putting the chip into the download mode manually. Please try that and let me know if that helps. At the moment, this is the only report of such behavior and I do not have access to a W11 machine. It would be great if you could help debug the issue, but that would require an oscilloscope or a logic analyzer. |
Thanks for the help @radimkarnis My other college also has the same problem, so it's not just on my PC. Yes, that is a solution. So there is something different with Windows 11 drivers. Unfortunately, I don't have an oscilloscope or logic analyzer. Can you leave the ticket open so if you or anybody else find a solution can give an update? |
Thanks for verifying with your colleague. Can you please install the latest CP210x drivers (if your devkit uses this USB-UART bridge) and try again? We can at least try to rule out as many suspects as possible. I will leave this ticket open until we have a solution. |
@radimkarnis It was tested with latest drivers |
Maybe using the "CP210x Universal Windows Driver" or the "CP210x Windows Drivers" makes a difference? |
@maxgerhardt I try the one from the link below and now it's working fine. So if anybody else has the same issue they can try. https://www.silabs.com/documents/public/software/CP210x_VCP_Windows.zip |
Thank you both for investigating. So installing the latest windows drivers ( @sw-dev-code could you please check with your colleague if this helps in his case? |
@radimkarnis It doesn't work with the latest driver, it works with this one https://www.silabs.com/documents/public/software/CP210x_VCP_Windows.zip. It's working on the colleague side also, so it's fixed for now. If I find some new issue I will report it. |
Just confirming the last post (and adding some version numbers): I originally downloaded and installed Next I installed above mentioned There is also a |
I'm having the same exact problem :
On Windows 11, haven't tried on other versions of windows. 1% of the time the chip automatically enters in programming mode and the rest by manually pressing the boot button. I have tried all the drivers (even the working reported https://www.silabs.com/documents/public/software/CP210x_VCP_Windows.zip. without any luck. |
Hi @marcpiulachs, |
Hi @radimkarnis just tried to program the very same board with a windows 10 machine and the code uploads just fine, no need to press BOOT every time, So it seems to be a problem with my windows 11 setup or drivers BTW, just noticied the version of esptool.py is 2.6
|
Also having the same issue on Windows 11, could not use esptool to communicate with the device. I added an additional delay in esptool.py v3.2 line 593:
Now it works reliably. |
I have the same problem on a Macbook with the M1 Chip |
@marcpiulachs @markphelan thank you for your reports and for investigating! @RocketRene please follow this issue: #712 |
Noticed something strange. After looking at all the posts I finally decided to scope out RST and DTR as well (EN and GPIO0, I believe) and noticed that the board goes into download mode when DTR is held low and RST is pulsed low during that time. When I check what the CP2102 is outputting, it looks like, if DTR is set low by the python code and then the RST is set low, it only has the effect of setting DTR high again (RST never goes low or high, it just remains high). |
CP2102 driver installed without error on Win 11. |
if you have boot button bottom right beside usb port on the esp32 board, just push the boot button and then execute that command. |
Obrigado, resolvi meu problema! |
Does anyone know if a solution for this problem was ever found? I've just recently upgraded to Windows 11 and ran into this issue. I've tried using all 3 Windows drivers listed on the Silicon Labs site:
|
boot and reset signal didnt properly overlap for me,(boot should be low on reset(en) rising edge) |
I'm also having this problem on Windows 11 (and probably other computers). I have tried a few different sets of drivers. The chip is a CP2104 and its on custom hardware with an ESP32-MINI-1. There are capacitors and I have adjusted values to try and see if that would do it. What I think is happening is the driver is no longer asserting the DTR / RTS lines correctly. Here is what my scope is showing: Enable for some reason is triggering low after IO0, instead of the other way around. I think there is a point where IO0 is supposed to go low, where Enable goes high (to enter bootloader) but for some reason that command is not executed. If I send commands over Python, it does appear to work:
The sleep times are arbitrary. This generates the pulse I would expect, but I'm still not 100% certain it is entering the bootloader as I cannot program it yet. I see this note in the code: Line 537 in 84918ea
|
Tried a freezed version of esptool 3.1 using pyInstaller and loaded onto different computers in my office and virtual machines. All of them showed the same behavior: Worked on Windows 10 but not on Windows 11, which I had to press the boot button expressly. |
The "working" link above is not with a version number so it changes. |
I was trying to update the latest pip-installed esptool.py but was disappointed to find that the esptool.py-script.py is just a wrapper for esptool.py.exe, which is not source code I could add the delays to. I also tried the 2014 version cp210x driver to no avail. So if I want to manually add the delays, what are my options? Where is the source .py for esptool.py? |
Thank you @dobairoland! So could you suggest a custom sequence? I tried a sequence in an earlier post in a config file but that didn't work. I'll solder some wires to my board and probe with logic analyzer to see if esptool is actually using the config file. I was using this sequence: custom_reset_sequence = D1|R1|W0.1|D0|R1|W0.5|D1|R0 |
esptool would tell you if it is using a config file with a |
I have done some probing: With the custom config I could create the correct transitions for both cp and ft, only on the surface. If I zoom in, I could see that when RTS is asserted, EN is pulled down. Then when DTR is asserted and RTS is de-asserted, EN is pulled high while IO0 is pulled low. This should work but on win 10 system EN is pulled high and about 0.1ms later IO0 is pulled low. DTR and RTS didn't transition simultaneously but has a short delay. This delay was OK. I guess the bootloader hasn't fully loaded and didn't look at IO0. But on a win 11 system, the delay is 3.5ms. So the processor is brought out of reset and allow to run for 3.5ms before IO0 is set to low (download). This difference in the delay between EN going high and IO0 going to low seems to be the only cause of failure to download. I tested ft231X, which worked on both win 10 and 11. The delay between EN going high and IO0 going low is about 0.5ms. I wish I could find the exact timing for IO0 to be held low after reset to be counted but I couldn't find that in ESP32's spec sheets. Anyway, if I play with this delay on ft231x to be even a bit over 1ms, then this fails to work. So this may have something to do with driver and how OS handles such serial port requests. From my past experience developing USB host/device, I could guess that a few SOFs passed between cp drive asserts DTR and de-asserts RTS so the delay is too long. FT driver is written differently so it didn't suffer as much delay as cp. I also tested toggling DTR and RTS using pyserial on python. Same pyserial 3.5, but on win 10 the delay is about 0.1ms and on win 11 it is 3.5ms, that is if you assert DTR then immediately de-assert RTS. So guessing esptool relies on pyserial so we are screwed! |
Any way to fix this? |
on a side note, i updated my machine to Win11 and have no issue using ESPTOOL (v4.5.1) flashing an ESP32S3 YUP No issues `./esptool.exe -b 921600 write_flash 0x1000 firmware/bootloader.bin 0x8000 firmware/partition-table.bin 0x10000 firmware/code.bin esptool.py v4.5.1 Leaving... |
Does either dev board have capacitors on the EN pin? We've had issues when there aren't any capacitors on the EN pin to slow down the transition for a millisecond or three. This applies more to those who design their own boards, not those who use existing dev boards. |
@k9jm My solution is to dual boot with Linux mint. It's been a while since I used mint but it's been great once I managed to disable secure boot etc to install mint. I was able to flash with esptool, thonny, and VSCode + platformio (Arduino). The same laptop had win 10 on it and I don't recall flashing firmware with it but it's definitely able to flash and this time I didn't probe the timing, assuming the EN going back to HIGH precedes IO0 going to LOW with a short enough delay. I recommend installing a second drive and install Linux mint to dual boot. At least you will get most of your dev tools on mint like on windows or mac os. |
yes, the other board is my design 4.7k pull up to 3.3v and .1uf cap to gnd both go into programming mode every time, no issues |
So this really comes down to the designs. Mine have not incorporated any capacitors since those were not needed. I bet a lot of devices have been made with those caps and a lot made without them. I have a dev board from TTGO (I think) and it couldn't enter programming mode. It only has a reset button, no boot button. I don't have a schematic but I'm guessing no caps. A 4.7K + 100nF will give 0.5ms time constant, which is probably not quite enough but did work for you. A 1K and 10uF will be 10ms time constant, really long but I guess it did work (Can't say it will always work). I really wish whoever smarty pants re-vamped the win 11's USB scheduler should re-write their smarty code to prioritize certain things. The DTR and RTS can't be (de)asserted simultaneously because they are two separate USB requests to the chip. So it comes down to why two consecutive requests to do DTR and RTS rom cp210x gets such a long 3.5ms delay under win 11 only. Maybe they laid additional code on top of the CDC class but they don't have such thing for vendor class (not CDC class) USB requests to the device so FT chips are not seeing the delay between DTR and RTS manipulations. This is way beyond what folks here are willing to look into. Same USB UART chips, different behaviors on different OS, that's the OS's problem, a windows problem. |
as per "esp32_hardware_design_guidelines_en.pdf" they recommend 10k pull up and .1uf on the reset pin |
Could you do a screen shot with page number in the shot? I read through my 2020 version of that doc and didn't find anything. I just downloaded a 2022 version and there was something about CPU_PU pin. I have a 10K pullup but don't have a cap to gnd. I appreciate your help. |
Hey, This still seems to be an issue for me. My board has randomly stopped letting me connect to it with esptoolpy and esptool js |
I am getting Md5 file error in Windows 11. I tried on Fedora it's working good, but unable to use Serial.print(), which causes the Md5 error
|
The Blink code is working good on Fedora but on Windows 11 I get the Md5 error |
|
Had the same issue with Ahoy DTU webinstaller under win11. It worked finally with the CH341 v.3.5.2019.1 driver for the ESP8266. You can find it on this website: https://electropeak.com/learn/how-to-install-ch340-driver/ |
System : windows 11 |
Not working in Windows 11, but it works in Windows 10 !!!! I installed many drivers and tried everything. I could not get it working. |
My Circuit: So, what to do ? So long |
Hi,, clic at link https://sparks.gogo.co.nz/ch340.html , uninstall old driver CH340X , instal setup of new driver downloaded and updated with link proposal. and ready write to Esp8266 . |
Thanks for those posting about the extra milliseconds of latency when running via Windows 11. I thought perhaps I could get this working via WSL so I wouldn't need to reboot or use a second machine, and indeed it does work for me. Follow steps below to get it working for yourself. The chip I'm connecting to is ESP32-U4WDH (revision v3.1). I did install version 6.7.0.0 of the CP210X driver in Windows 11, but I don't think that should have an impact, the driver should not be used once the device is passed through to WSL. WSL passthrough steps
Microsoft's docs for passing through devices are here: https://learn.microsoft.com/en-us/windows/wsl/connect-usb#attach-a-usb-device |
Operating System
Windows 11
Version
v3.2
Python Version
3.10.1
Chip Description
ESP32
Device Description
No response
Hardware Configuration
No response
How is Esptool Run
PlatformIO and Console
Full Esptool Command Line that Was Run
esptool.py erase_flash
Esptool Output
More Information
Important thing is that in Windows 10 I never got this error. Flashing and Erasing the device worked without any problems.
Other Steps to Reproduce
No response
I Have Read the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: