ESP32 Stuck in Reset and Cannot Upload Code

MrGadget
Posts: 5
Joined: Sat Apr 02, 2022 11:54 pm

ESP32 Stuck in Reset and Cannot Upload Code

Postby MrGadget » Sun Aug 27, 2023 12:21 am

My ESP32 is constantly outputting the following out the serial port:

Code: Select all

rst:0x10 (RTCWDT_RTC_RESET),boot:0x33 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
ets_main.c 371 
ets Jun  8 2016 00:22:57
And now when I try to download code to it I get:

Code: Select all

Sketch uses 732305 bytes (55%) of program storage space. Maximum is 1310720 bytes.
Global variables use 44824 bytes (13%) of dynamic memory, leaving 282856 bytes for local variables. Maximum is 327680 bytes.
esptool.py v4.5.1
Serial port COM5
Connecting.....
Chip is ESP32-D0WD (revision v1.0)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 94:3c:c6:38:85:f4
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 0x000c4fff...
Compressed 18992 bytes to 13112...

A fatal error occurred: Packet content transfer stopped (received 8 bytes)
Failed uploading: uploading error: exit status 2
So figuring I somehow damaged the ESP I moved the LCD display to another ESP32 board and it was working fine with test programs.

Then I put in the same code as above and my serial port went dead with the same symptoms.

Now some history.:
I wrote this a few years ago and have been updating it with improvements over time. I realize now that it probably had this problem back then but because I was doing OTA I did not realize it.

At least not until I messed up OTA leaving serial as my only option.

Now some observations:
A cold boot works, meaning the display shows me what I want to see.
But if I press the reset button the display goes white and nothing is seen.

How can I fix these two boards? One of them is a nice one with a battery and charging circuit.

Thank you.

ESP_Sprite
Posts: 9052
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32 Stuck in Reset and Cannot Upload Code

Postby ESP_Sprite » Sun Aug 27, 2023 3:20 am

There's some issue communicating with onboard flash. Possibly you have shorted or are using the pins used for that?

MrGadget
Posts: 5
Joined: Sat Apr 02, 2022 11:54 pm

Re: ESP32 Stuck in Reset and Cannot Upload Code

Postby MrGadget » Sun Aug 27, 2023 2:55 pm

Good question ESP_Sprite.

For the first one I did disconnect the LCD so that nothing was connected and I still could not download any program.

For this latest second board, I was programming test program that used the LCD and I did this many times with no issues.

It wasn't until my first download of my original code (from a few years ago) that it 'broke' serial download.

In other words, I think my original code is causing this?

If I am right then it suggests that you can write code which will brick the ESP32 which I have never heard of before.

And I believe that it is a hard reset (while powered on) which causes it to constantly reboot meaning it never get to the code which accepts a new program.

So here are the steps to support my theory:
1) I power up the board by plugging the usb cable into a power source and the display comes up as expected.
2) I press the hard reset button and the display goes white.

Or,
1) I plug it into my computer with Arduino IDE running and initially the display comes up as expected.
2) I press the serial monitor button on the IDE and the display goes white (I suspect because this action wiggles reset) and it repeatedly displays what I show above on the serial port.

One newbie question, my program is quite big as it has five or six pages it can display of data. Is it possible my program is too big and spilling into areas it should not be in?

ESP_Sprite
Posts: 9052
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32 Stuck in Reset and Cannot Upload Code

Postby ESP_Sprite » Mon Aug 28, 2023 12:52 am

I think your board is simply broken because of some externality. It's technically possible to brick a board by uploading some specific code to it, but it is very unlikely to have happened here: that code would need to do things that are so uncommon in a normal ESP program (messing with non-volatile flash bits or eFuses) that there's about zero chance for it to happen unintended.

MrGadget
Posts: 5
Joined: Sat Apr 02, 2022 11:54 pm

Re: ESP32 Stuck in Reset and Cannot Upload Code

Postby MrGadget » Mon Aug 28, 2023 7:42 pm

Thank you for your reply ESP_Sprite.

I did find a solution that worked for one of the boards using esptool.py.

This is a good tutorial that worked for me:
https://randomnerdtutorials.com/esp32-e ... sh-memory/

Unfortunately, it did not work for the older board with a rechargeable battery.

Maybe that one has been damaged as it seems to spew out serial data some makes sense and some does not. It is like some of it is at another baud rate but I have tried all bauds to no avail.

Who is online

Users browsing this forum: No registered users and 136 guests