Esp32 cam program upload error

I have a ESP32-s cam board and i tried to upload the examples > esp32 > camera > cameraWebServer program in arduino but i got this below error. can some one help me out please.

Sketch uses 1510681 bytes (48%) of program storage space. Maximum is 3145728 bytes.
Global variables use 70388 bytes (21%) of dynamic memory, leaving 257292 bytes for local variables. Maximum is 327680 bytes.
esptool.py v4.5.1
Serial port /dev/ttyUSB0
Connecting....
Chip is ESP32-D0WD (revision v1.0)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
WARNING: Detected crystal freq 41.36MHz is quite different to normalized freq 40MHz. Unsupported crystal in use?
Crystal is 40MHz
MAC: a8:03:2a:64:bf:34
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
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 0x00182fff...
Compressed 18992 bytes to 13110...
Writing at 0x00001000... (100 %)

A fatal error occurred: Serial data stream stopped: Possible serial noise or corruption.
A fatal error occurred: Serial data stream stopped: Possible serial noise or corruption.

Can some one help me with this error, i tried the above solution as well but didn't worked

Sketch uses 1510681 bytes (48%) of program storage space. Maximum is 3145728 bytes.
Global variables use 70388 bytes (21%) of dynamic memory, leaving 257292 bytes for local variables. Maximum is 327680 bytes.
esptool.py v4.5.1
Serial port /dev/ttyUSB0
Connecting....
Chip is ESP32-D0WD (revision v1.0)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
WARNING: Detected crystal freq 41.36MHz is quite different to normalized freq 40MHz. Unsupported crystal in use?
Crystal is 40MHz
MAC: a8:03:2a:64:bf:34
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
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 0x00182fff...
Compressed 18992 bytes to 13110...
Writing at 0x00001000... (100 %)

A fatal error occurred: Serial data stream stopped: Possible serial noise or corruption.
A fatal error occurred: Serial data stream stopped: Possible serial noise or corruption.

Hi @sara59669. It is possible for a short or external circuitry connected to the Arduino board to interfere with the upload process, causing this type of upload error.

Make sure the board is not sitting on anything conductive that could short the contacts on the bottom of the board. Make sure there isn't any conductive debris (e.g., strands of wire or component leads) on the board or on the surface the board is sitting on.

If you have a shield or any external circuitry or components connected to your Arduino board, try this experiment:

  1. Disconnect the USB cable of the Arduino board from your computer.
  2. Disconnect any shields, modules, external circuitry, etc. from your board.
  3. Connect the Arduino board to your computer with a USB cable.

Now try uploading a sketch to the board again. Does the upload succeed?

This experiment will determine whether the upload error was caused by interference from your external circuitry. If so, you can then focus your attention on identifying the specific problem with the circuit and resolving it.

I have merged your cross-posts @sara59669.

Cross-posting is against the Arduino forum rules. The reason is that duplicate posts can waste the time of the people trying to help. Someone might spend a lot of time investigating and writing a detailed answer on one topic, without knowing that someone else already did the same in the other topic.

Repeated cross-posting can result in a suspension from the forum.

In the future, please only create one topic for each distinct subject matter. This is basic forum etiquette, as explained in the "How to get the best out of this forum" guide. It contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.

1 Like

same error again -

this is my setup -

please help me out

I see that you are using a USB to serial adapter module as the interface between the computer and the ESP32 board.

I was not able to find any information about that particular model. I did a test upload to an ESP32-CAM board using a different model of FTDI FT232R module and was successful. I used the following connections between the two:


:warning: I have the jumper on my FTDI FT232R module in the "3.3V" position.


USB Module ESP32-CAM
GND GND
VCC VCC
TX U0R
RX U0T

In addition, I have the "IO0" pin on the board connected to "GND".

From looking at the picture you shared, it appears your connections are similar. However, I am concerned about the voltage levels. As I mentioned above, I am able to select a 3.3 V levels on the FTDI FT232R module I have. This means that the "VCC" pin on the module outputs 5 V and the RX and TX pins also use 3.3 V logic levels. I don't know whether your module is using 3.3 V or 5 V levels. Exposing the ESP32 microcontroller on the ESP32-CAM to 5 V logic levels on the U0R pin could damage it as 3.3 V should be used instead.

Another observation I have is that the brown wire from your USB to serial module is connected to the pin that is marked "GND/R" on my ESP32-CAM board. I found that the upload failed when I had that connection, though with a different error from the one you are experiencing:

Connecting......................................

A fatal error occurred: Failed to connect to ESP32: No serial data received.

I changed the connection to the pin marked "GND" and after that the upload was successful.

I tried to change the brown wire to other GND but same issue. I don't have other ftdi module.

I have a Arduino Uno how to upload code to esp32 cam via Uno. I'll try.

Tried using Arduino Uno. Connection and errors below

When you are using an Uno board as a USB to serial adapter, confusingly the connections are like so:

Uno Target
RX RX (e.g., U0R)
TX TX (e.g., U0T)

The reason for this is that the pin labels on the Uno are referring to the pins on the ATmega328P microcontroller, but in this usage you are communicating directly between the Uno's USB to serial chip (ATmega16U2) and the target. Since the connections between the USB chip and the ATmega328P are RX-TX, TX-RX, the pin marked "RX" on the Uno is actually connected to the TX pin on the USB chip and the pin marked "TX" on the Uno is actually connected to the RX pin on the USB chip.

With the Uno, you have the problem of exposing the ESP32's U0R pin to 5 V as I suspected was also occurring with your FTDI module. It is possible this has caused permanent physical damage to the ESP32 and that physical damage might be the reason the upload is failing.

When you are using an Uno as a USB to serial adapter, it is best to connect the "RESET" pin on the Uno to the "GND" pin in order to hold the ATmega328P microcontroller in reset. Otherwise the ATmega328P might interfere with the communication between the Uno's USB chip and the target.

Visit 60+ ESP32-CAM Projects, Tutorials and Guides with Arduino IDE | Random Nerd Tutorials by Ruis Santos. You'll find example and explinations. All examples did work good on first attemps in my case.

1 Like

how can i check whether my esp32 cam chip is good or damaged? using multimeter?

It is easy and streightforward to use a TTL interface to prgram the ESP32cam like this:

I also built a breakout SMB for both ESP32cam and ESP8266
avecTTL
which works very good.

I may sell you that. If you want. I have not price yet, never sold. You can have it as DIY kit or all done.

I don't think there is any easy way. The damage would have occurred in the microscopic circuits on the silicon die of the ESP32 microcontroller.

I suggest you purchase a replacement board. If the problem does not occur when you attempt an upload to the replacement board (making sure to use the appropriate voltage levels this time), then you will know that the original board was damaged. If the same problem occurs with both boards then it is more likely that there is some problem with the rest of the system.

1 Like

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