Compiles but will not upload (This may be a dup)

I receive the following errors using the Arduino IDE with an ESP32 WROOM V1 using the example SimpleTime.ino; and many other examples. The sketch compiles ok but will not upload. I have tried several high-quality cables. and I can compile and upload blink OK.
Traceback (most recent call last):
File "esptool.py", line 3682, in
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
Failed uploading: uploading error: exit status 0xffffffff


Does anyone know what the problem is?

Hi, @gregfox151

Can you please post your code.

Thanks.. Tom.. :smiley: :+1: :coffee: :australia:

i've gotten that error many times, along with many other similar errors because i often switch between avr and esp32 and the esp32 boards operate on different com ports, 3 & 4.

suggest you try again. make sure the board is plugged in, and the proper com and board type are selected.

and if the error occurs, just try one more time

#include #include "time.h"

const char* ssid = "YOUR_SSID";
const char* password = "YOUR_PASS";

const char* ntpServer = "pool.ntp.org";
const long gmtOffset_sec = 3600;
const int daylightOffset_sec = 3600;

void printLocalTime()
{
struct tm timeinfo;
if(!getLocalTime(&timeinfo)){
Serial.println("Failed to obtain time");
return;
}
Serial.println(&timeinfo, "%A, %B %d %Y %H:%M:%S");
}

void setup()
{
Serial.begin(115200);

//connect to WiFi
Serial.printf("Connecting to %s ", ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println(" CONNECTED");

//init and get the time
configTime(gmtOffset_sec, daylightOffset_sec, ntpServer);
printLocalTime();

//disconnect WiFi as it's no longer needed
WiFi.disconnect(true);
WiFi.mode(WIFI_OFF);
}

void loop()
{
delay(1000);
printLocalTime();
}

It's not the code, as it happens on all code.
Thanks

1 Like

Hi,
What version IDE are you using?
What OS?

Thanks.. Tom... :smiley: :+1: :coffee: :australia:

i just got the following. it downloaded fine after trying again (see further below.

Sketch uses 729014 bytes (55%) of program storage space. Maximum is 1310720 bytes.
Global variables use 40124 bytes (12%) of dynamic memory, leaving 287556 bytes for local variables. Maximum is 327680 bytes.
esptool.py v3.0-dev
Traceback (most recent call last):
Serial port COM3
  File "esptool.py", line 3682, in <module>
  File "esptool.py", line 3675, in _main
  File "esptool.py", line 3329, in main
  File "esptool.py", line 263, in __init__
  File "site-packages\serial\__init__.py", line 88, in serial_for_url
  File "site-packages\serial\serialwin32.py", line 62, in open
serial.serialutil.SerialException: could not open port 'COM3': WindowsError(5, 'Access is denied.')
Failed to execute script esptool
the selected serial port Failed to execute script esptool
 does not exist or your board is not connected
Sketch uses 729014 bytes (55%) of program storage space. Maximum is 1310720 bytes.
Global variables use 40124 bytes (12%) of dynamic memory, leaving 287556 bytes for local variables. Maximum is 327680 bytes.
esptool.py v3.0-dev
Serial port COM3
Connecting....
Chip is ESP32-D0WD (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: c8:2b:96:ba:a7:b4
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 8192 bytes to 47...
Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.0 seconds (effective 13106.9 kbit/s)...
Hash of data verified.
Compressed 18656 bytes to 12053...
Writing at 0x00001000... (100 %)
Wrote 18656 bytes (12053 compressed) at 0x00001000 in 0.2 seconds (effective 899.1 kbit/s)...
Hash of data verified.
Compressed 729136 bytes to 417698...
Writing at 0x00010000... (3 %)
Writing at 0x00014000... (7 %)
Writing at 0x00018000... (11 %)
Writing at 0x0001c000... (15 %)
Writing at 0x00020000... (19 %)
Writing at 0x00024000... (23 %)
Writing at 0x00028000... (26 %)
Writing at 0x0002c000... (30 %)
Writing at 0x00030000... (34 %)
Writing at 0x00034000... (38 %)
Writing at 0x00038000... (42 %)
Writing at 0x0003c000... (46 %)
Writing at 0x00040000... (50 %)
Writing at 0x00044000... (53 %)
Writing at 0x00048000... (57 %)
Writing at 0x0004c000... (61 %)
Writing at 0x00050000... (65 %)
Writing at 0x00054000... (69 %)
Writing at 0x00058000... (73 %)
Writing at 0x0005c000... (76 %)
Writing at 0x00060000... (80 %)
Writing at 0x00064000... (84 %)
Writing at 0x00068000... (88 %)
Writing at 0x0006c000... (92 %)
Writing at 0x00070000... (96 %)
Writing at 0x00074000... (100 %)
Wrote 729136 bytes (417698 compressed) at 0x00010000 in 6.7 seconds (effective 865.6 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 128...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (128 compressed) at 0x00008000 in 0.0 seconds (effective 3071.9 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

Thank you!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.