Getting wierd error while uploading code to esp32 WROOM -32

I was trying to run a servo motor using my esp32 WROOM 32 board
But get the following error

esptool.py v4.5.1
Serial port COM5
Connecting....
Chip is ESP32-D0WD-V3 (revision v3.1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: fc:b4:67:92:22:8c
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 0x0004efff...
Compressed 18992 bytes to 13112...

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

I removed the esp32 from the connections and uploaded the code, and the code successfully uploads ,

but when i try to upload with connections to pins then the said error occurs ,
pins connections ::

gnd servo- gnd esp32
power servo - 5v esp32
sig servo - P15 esp32

what might be the reason for the inability to upload code when pins are connected , ?
please help

Do You power a servo from the controller 5 volt pin?
How is the controller powered?

Please post a proper schematics. Pen and paper usually works well.

have a look at esp32-pinout-reference-gpios checking on the pins you are using - some are 'strapping pins' and must be in set states on programming/boot

Always show us a good schematic of your proposed circuit.
Show us good images of your ‘actual’ wiring.
Give links to components.

I do know that some boards (this one I have it also) will require you to hold the boot button just as the Arduino IDE attempts to connect via com port. To get around this I have placed a small electrolytic capacitor (i used100uf 35v but can be much smaller 10uf 10v even) between the EN pin and GND. This will upload the code without the need to press the button.

Far as your code goes with attached pins. I believe it to be the devices themselves connecting two pins that are used as DATA when the boot process starts or that the devices are drawing too much current to allow the RE-boot of the chip when uploading. MY advice would be to power them separately with a battery or compatible power supply to avoid current/volt draw from the board and see if this helps.

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