Can't upload after ESP Tools Flash Erase

clearlynotstefan
Posts: 4
Joined: Sat Mar 14, 2020 4:55 pm

Can't upload after ESP Tools Flash Erase

Postby clearlynotstefan » Sat Mar 14, 2020 5:05 pm

Hi All,

I'm new to these little gadgets and often out of my depth but managed to make some great IoT projects so far! ESP32 and Arduino IDE 1.8.9. - I had exclusively used the IDE to upload and had no problems. Recently I used an app that I coded as lazily as possible on an ESP32, basically it wrote and retrieved 6 or 7 ints to NVM every time through loop (which was unnecessary but I wanted to see how it'd work before i rewrote it to only write and retrieve when necessary). It worked for a few weeks and then lost connection constantly. I figured I just abused NVM too much, so I figured let's start fresh. I used the ESP Flash Download tool to do a clean erase of the board. Ever since, I can't get anything uploaded from the IDE (see below). Did I erase some bin file that came pre-installed to play nice with Arduino? How do I get my new code on this board! Greatly appreciate any help at all.

Code: Select all

esptool.py v2.6
Serial port COM3
Connecting........_____....._
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
MAC: a4
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 8192 bytes to 47...

Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.0 seconds (effective 4096.0 kbit/s)...

A fatal error occurred: Timed out waiting for packet header
A fatal error occurred: Timed out waiting for packet header

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

Re: Can't upload after ESP Tools Flash Erase

Postby ESP_Sprite » Sat Mar 14, 2020 6:56 pm

If you did indeed abuse the NVS too much, it could be that you 'burned a hole' in your flash chip: each sector only has a limited amount of times it can be erased and re-written, and while NVS does try to use the sectors allocated to it as fairly as possible, if you have a small NVS partition and lots and lots of writes, you can still wear out a sector. If a sector is worn out, there is no fixing it: it can't be properly erased anymore and erasing the flash will probably fail. In other words: sorry, your flash chip is more-or-less dead.

clearlynotstefan
Posts: 4
Joined: Sat Mar 14, 2020 4:55 pm

Re: Can't upload after ESP Tools Flash Erase

Postby clearlynotstefan » Sat Mar 14, 2020 7:11 pm

If my flash chip was actually fried, I would think I would have more problems, when I reset it it boots right up and recalls the numbers it had stored, or at least it did right before i used the erase tool. If I left it running for another two weeks it would have disconnected again, but i would expect physical damage to that degree to prevent it from booting on reset. I'm fairly certain i erased a bootloader or some other necessary thing by flashing, i reflashed the same firmware (in IDE) right before I did the erase and it worked perfectly, I did the erase and now I get the message above. I've only worked in IDE so I have no idea what i'm doing with these ESP32 tools. I do think it's odd that it gets to "writing 100%" before throwing an error, too

lbernstone
Posts: 831
Joined: Mon Jul 22, 2019 3:20 pm

Re: Can't upload after ESP Tools Flash Erase

Postby lbernstone » Sat Mar 14, 2020 9:58 pm

Try a different USB cable. Set the upload speed to 115200, then try setting flash mode to DIO @ 40MHz.

Who is online

Users browsing this forum: No registered users and 46 guests