Reputation: 141
Error is as follows
esptool.py v3.0-dev
Serial port COM10
Connecting...
Traceback (most recent call last):
File "esptool.py", line 3682, in <module>
File "esptool.py", line 3675, in _main
File "esptool.py", line 3330, in main
File "esptool.py", line 512, in connect
File "esptool.py", line 492, in _connect_attempt
File "esptool.py", line 431, in sync
File "esptool.py", line 369, in command
File "esptool.py", line 332, in write
File "site-packages\serial\serialwin32.py", line 323, in write
serial.serialutil.SerialTimeoutException: Write timeout
Failed to execute script esptool
An error occurred while uploading the sketch
I also change many port but still gave the same error. I also give the additional board manager URL "https://dl.espressif.com/dl/package_esp32_index.json" I use multiple codes but give the same error, so it is unnecessary to attach the code. by the way, the code is in the C language.
Upvotes: 1
Views: 5736
Reputation: 51
For me this is what worked, first of all changed the usb cable, the first usb cable that I was using was just a charging cable, then 2nd one supported data transfer still it didn't work. Finally third one was a bit better in terms of quality, it was a old phone's charging cable that supported data transfer. Also, I had my upload speed changed to 115200
by going to tools->upload speed
. Try this and I hope it works :)
Upvotes: 0
Reputation: 69
I was having the same "Write timeout" error.
What works for me is to add --before usb_reset
esptool --before usb_reset --chip esp32s3 --port com4 erase_flash
Upvotes: 0
Reputation: 1
Press the Boot button while your code is uploading. Most esp32s have two small black buttons on either side of the the usb cable input.
One is labled "boot" and the other "en". to fix the problem Press the Boot button for 3 seconds while your code is uploading. That should work.
Another solution could be to if you are using the arduino ide. After selecting the esp32 board that you will be using. open the tools menu/bar and enable "Erase all flash before skecth upload".
Hope this helps!
Upvotes: 0
Reputation: 54
Your error can be caused by a few different things.
USB Cable Check: Let's start by giving your USB cable a quick once-over. Some cables are designed only for charging and don't transfer data. To check if your cable is up for the task, here's a simple test:
Choosing the Right Port: It's important to make sure you're using the correct port for uploading. If you were not sure to find it in the last step, try using the Arduino IDE to upload some basic code to your board. The Arduino IDE will show you all available serial ports, making it easier to find the one that works for your ESP32.
Getting into Flash Mode: If you can read from the board but can't upload to it, it might not be in the right mode. You can sort this out by pressing the "flash" button (if your board has one) while plugging it into the USB port. This gets your board into flash mode, making it ready for uploads.
Upvotes: 1
Reputation: 2247
I had problems uploading code which turned out to be the cable; about the first four or so cables I tried didn't work. I guess it pushes the specs to the limit and cheaper USB cables can't cope. I've now found a cable that works, and have no problems anymore.
I tried everything else first, different ports, different computers, and it was quite surprising that even different cables didn't work, until I finally happened to use one that worked.
So try all your USB cables before giving up. And then go and buy a better cable, just to make sure!
Upvotes: 2