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

I'm trying to use an ESP32-CAM for a face recognition project, using the basic CameraWebServer example. However, I keep getting these errors when uploading the code:

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

and

A fatal error occurred: Invalid head of packet (0xFD): Possible serial noise or corruption.

This is how my Tools look like. I'm using the AI Thinker ESP32-CAM board.

As you can see in the image, there is no Upload Speed. I've looked at other forums and I can't find anything that helps. Do any of you have any suggestions for help?

You need to post the verbose upload log. Did you use copy/paste of the supplied sample? Did you modify the code to specify AI-Thinker? I ask because the new default is NOT AI-Thinker.

Hi @gunduzthepro!

Did you have a look at the instructions here?

https://randomnerdtutorials.com/program-upload-code-esp32-cam/

and/or this

https://randomnerdtutorials.com/upload-code-esp32-cam-mb-usb/

Looks as if (at least some) boards require GPIO 0 connected to GND and the use of the on-board reset button while uploading code.

Screenshot from the second link:

Good luck!
ec2021

Sorry, I forgot to tell you I am using a FTDI Programmer. Also do you have any idea what this means: 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...

The first link I posted explains using an FTDI board

When searching the Internet for the warning I found this link

https://esp32.com/viewtopic.php?t=38903

There are some pins of the ESP32 that require certain levels to allow uploading firmware.

See the link above.

It's always a good idea to search the net using the error message (or at least some significant parts of it). In most cases there are already others with the same problem...

Good luck!
ec2021

1 Like

Probably either the Flash is faulty or your circuit is using some of the pins used by the Flash.

Although an ESP32 board may have a pin with a number on it, that does not mean its available to be freely used.

I did read it and also tried it but it didn't work.

So what should I do?

One of the things you can do is to post whether you have anything connected to the board or not.

If you use the board without any further components connected this reason for failure can be ruled out...

And you could follow @sonofcy ' s advice and post the complete error message, in code tags please.

Make sure that the error messages are set to "verbose" . See here https://support.arduino.cc/hc/en-us/articles/4407705216274-Use-verbose-output-in-the-Arduino-IDE

And here is another link

https://forum.arduino.cc/t/esp32-cam-unable-to-upload-code-solved/696769

In Arduino IDE 1, then if you had the No Serial Data receive error then reducing to upload speed could make the upload work.

No idea where the upload speed option is hidden in Arduino IDE 2.

Do you have the FTDI voltage selector set to 5V, many esp32cam boards will fail at 3.3V (yes I know the board is a 3.3v board, I think the 5V will be connected to a VR)

Please post pictures of the esp32cam board and the ftdi. Make sure you can see all the pictures clearly before posting.

Did you install the FTDI device driver?

I don't know what that is.

The device driver for the FTDI adapter. Here are some clues

1 Like

I've done that and I still get errors.

I looked at this forum (https://www.reddit.com/r/esp32/comments/1cxlavs/failed_to_communicate_with_the_flash_chip/)

Could my esp32_cam be damaged.

Remotely possible if you were doing something to the bootloader but you are just doing a normal upload. Some esp32's on some Windows PC's can be problematic. If you can by a different esp32cam or what about a totally different board like the ESP_EYE or the more powerful ESP32S3_EYE

My ESP32 works fine.