Search code examples
arduinouploadserial-portesp32

Got an error uploading my sketch to esp32


I've got an issue when i try to upload my code to my ESP32. The exact model is ESP-WROOM-32D , ESP32_DEVKit_V4

Output is :

Sketch uses 1671989 bytes (85%) of program storage space. Maximum is 1966080 bytes.
Global variables use 57136 bytes (17%) of dynamic memory, leaving 270544 bytes for local variables. Maximum is 327680 bytes.
esptool.py v4.2.1
Serial port COM6
Connecting.........
Chip is ESP32-D0WD-V3 (revision 3)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: c4:de:e2:13:36:30
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
WARNING: Failed to communicate with the flash chip, read/write operations will fail. Try checking the chip connections or removing any other hardware connected to IOs.
Configuring flash size...
Flash will be erased from 0x00001000 to 0x00005fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00010000 to 0x001a9fff...
Compressed 18880 bytes to 13017...

A fatal error occurred: Packet content transfer stopped (received 8 bytes)
Failed uploading: uploading error: exit status 2

And there is also this in the serial port :

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
invalid header: 0xffffffff
invalid header: 0xffffffff
invalid header: 0xffffffff
invalid header: 0xffffffff
invalid header: 0xffffffff
invalid header: 0xffffffff
invalid header: 0xffffffff
invalid header: 0xff�ets Jul 29 2019 12:21:46

This is looping over and over I don't understand why is that and why I can't upload my sketch thanks for any help !!!


Solution

  • A quick search of the warning you received WARNING: Failed to communicate with the flash chip, read/write operations will fail. Try checking the chip connections or removing any other hardware connected to IOs yields what is likely the answer to your question:

    From this link: https://github.com/espressif/esptool/issues/705

    This is a clear indication that the problem are faulty devkits - specifically their flash chips. According to your logs, communication with the ESP works fine until the point when a flash chip read/write operation chip happens.

    WARNING: Failed to communicate with the flash chip, read/write operations will fail. Try checking the chip connections or removing
    

    any other hardware connected to IOs.

    This warning is tied directly to faulty hardware. Try running python -m esptool flash_id, this command asks the ESP to interrogate the flash chip and report its manufacturer and device number. If this fails, only 0000s or ffffs are reported back.