Flash Memory Corruption Issue

Ritesh
Posts: 1383
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: Flash Memory Corruption Issue

Postby Ritesh » Tue Mar 08, 2022 3:34 am

Ritesh wrote:
Mon Mar 07, 2022 6:13 am
WiFive wrote:
Thu Mar 03, 2022 3:04 pm
Anything is possible. Have you checked all the flash id and 3 byte status registers of the failing modules? What is the flash id of a working module?
Hello WiFive,

Please find following details for Non Working Modules having issues of Flash Memory
Flash ID Command Output
Chip is ESP32D0WDQ5 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
MAC: 44:17:93:42:fd:70
Uploading stub...
Running stub...
Stub running...
Manufacturer: 00
Device: 0000
Detected flash size: Unknown

3 Bytes Status registers
Chip is ESP32D0WDQ5 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
MAC: 44:17:93:42:fd:70
Uploading stub...
Running stub...
Stub running...
Status value: 0x0000
Also find same details for working modules
Flash ID Command Output
Detecting chip type... ESP32
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
MAC: c4:4f:33:09:75:f5
Uploading stub...
Running stub...
Stub running...
Manufacturer: c8
Device: 6018
Detected flash size: 16MB
Hard resetting via RTS pin...

3 Bytes Status registers
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
MAC: c4:4f:33:09:75:f5
Uploading stub...
Running stub...
Stub running...
Status value: 0xff0000
Let me know if need anything else from our end
Hello WiFive,

Hope above informations are helpful for you to get some basic details as per requirements which you need. Let me know if need anything else from my end.
Regards,
Ritesh Prajapati

LittleRain
Posts: 10
Joined: Wed May 05, 2021 7:33 am

Re: Flash Memory Corruption Issue

Postby LittleRain » Wed Mar 09, 2022 2:49 am

Yes, I was working on a project/job, uploaded the program and it was working.
Changed one line, and all of a sudden it kept restarting from an exception.
I removed the changes, tried again and it still wasn't working.

I tried to start debugging with JTAG, and noticed during upload it wasn't able to verify the flash.

Took me at least 2 weeks trying to fix the problem.
Tried lowering the baud rate at upload.
Someone had posted to downgrade the IDE version, and so I tried that.
I also noticed lots of forum posts saying to use the flash tool to do a full erase, also I tried that.
They all worked for a short period, some times just 1 or 2 uploads, sometimes all day.
And when I say working again, I mean it would actually boot and reach my code, but would still have a random exception in random places.

When I couldn't get it working at all again, I tried changing the flash chip, and it would work again, but would ultimately fail again soon after. Went through a few flash chips.

I had purchased a bunch of flash for very cheap a while back, after plugging them in to a programmer I realized they had been re-labeled, most of their ID didn't match the brand on the label, some would change every read by 1 bit, and some wouldn't fully erase or read at all.
Then I checked the original flash IC that came on the ESP32 and realized it wouldn't fully erase anymore either.

I originally thought it was because of the COM port, thought some bits were getting flipped.
But after I tried sticking the flash ICs in an EEPROM programmer and realized it was indeed the flash.

The reason I thought it was the COM port was because problems started happening right when my serial port stopped working.
Every time I initialized WiFi the serial port would always say "Access Denied," and the only way to upload would be to unplug the USB cable and while holding down restart and boot, plug it back in.
I had to hold them for the whole build process(which was pretty lengthy at that time), and then release right when it was trying to connect.
Soldering a 10uf cap from EN to GND fixed that, for a short time... At least now I can just unplug and plug while holding, and release them right away, and don't have to hold for the whole build process anymore.

What was supposed to be a quick easy job turned in to a slow brutal headache.

I ended up buying some flash chips, and replacement ESP32s from Digikey and haven't had a problem since.

Ritesh
Posts: 1383
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: Flash Memory Corruption Issue

Postby Ritesh » Thu Mar 10, 2022 5:54 am

LittleRain wrote:
Wed Mar 09, 2022 2:49 am
Yes, I was working on a project/job, uploaded the program and it was working.
Changed one line, and all of a sudden it kept restarting from an exception.
I removed the changes, tried again and it still wasn't working.

I tried to start debugging with JTAG, and noticed during upload it wasn't able to verify the flash.

Took me at least 2 weeks trying to fix the problem.
Tried lowering the baud rate at upload.
Someone had posted to downgrade the IDE version, and so I tried that.
I also noticed lots of forum posts saying to use the flash tool to do a full erase, also I tried that.
They all worked for a short period, some times just 1 or 2 uploads, sometimes all day.
And when I say working again, I mean it would actually boot and reach my code, but would still have a random exception in random places.

When I couldn't get it working at all again, I tried changing the flash chip, and it would work again, but would ultimately fail again soon after. Went through a few flash chips.

I had purchased a bunch of flash for very cheap a while back, after plugging them in to a programmer I realized they had been re-labeled, most of their ID didn't match the brand on the label, some would change every read by 1 bit, and some wouldn't fully erase or read at all.
Then I checked the original flash IC that came on the ESP32 and realized it wouldn't fully erase anymore either.

I originally thought it was because of the COM port, thought some bits were getting flipped.
But after I tried sticking the flash ICs in an EEPROM programmer and realized it was indeed the flash.

The reason I thought it was the COM port was because problems started happening right when my serial port stopped working.
Every time I initialized WiFi the serial port would always say "Access Denied," and the only way to upload would be to unplug the USB cable and while holding down restart and boot, plug it back in.
I had to hold them for the whole build process(which was pretty lengthy at that time), and then release right when it was trying to connect.
Soldering a 10uf cap from EN to GND fixed that, for a short time... At least now I can just unplug and plug while holding, and release them right away, and don't have to hold for the whole build process anymore.

What was supposed to be a quick easy job turned in to a slow brutal headache.

I ended up buying some flash chips, and replacement ESP32s from Digikey and haven't had a problem since.
Hello,

Thanks a lot for providing updates.

I have checked your response and it seems like mostly problem into Flash memory which is embeded into ESP32-WROVER module but i am little bit confused like how it will become as it is initially working and then suddenly getting problem.

I just want to understand it little bit more as per explanation given from your end.
Regards,
Ritesh Prajapati

Ritesh
Posts: 1383
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: Flash Memory Corruption Issue

Postby Ritesh » Fri Mar 11, 2022 3:57 am

Ritesh wrote:
Tue Mar 08, 2022 3:34 am
Ritesh wrote:
Mon Mar 07, 2022 6:13 am
WiFive wrote:
Thu Mar 03, 2022 3:04 pm
Anything is possible. Have you checked all the flash id and 3 byte status registers of the failing modules? What is the flash id of a working module?
Hello WiFive,

Please find following details for Non Working Modules having issues of Flash Memory
Flash ID Command Output
Chip is ESP32D0WDQ5 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
MAC: 44:17:93:42:fd:70
Uploading stub...
Running stub...
Stub running...
Manufacturer: 00
Device: 0000
Detected flash size: Unknown

3 Bytes Status registers
Chip is ESP32D0WDQ5 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
MAC: 44:17:93:42:fd:70
Uploading stub...
Running stub...
Stub running...
Status value: 0x0000
Also find same details for working modules
Flash ID Command Output
Detecting chip type... ESP32
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
MAC: c4:4f:33:09:75:f5
Uploading stub...
Running stub...
Stub running...
Manufacturer: c8
Device: 6018
Detected flash size: 16MB
Hard resetting via RTS pin...

3 Bytes Status registers
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
MAC: c4:4f:33:09:75:f5
Uploading stub...
Running stub...
Stub running...
Status value: 0xff0000
Let me know if need anything else from our end
Hello WiFive,

Hope above informations are helpful for you to get some basic details as per requirements which you need. Let me know if need anything else from my end.
Hello WiFive,

Let me know if need anything else from my end to investigate issue from your end.
Regards,
Ritesh Prajapati

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Flash Memory Corruption Issue

Postby WiFive » Fri Mar 11, 2022 8:12 am

You have a different flash chip than the GitHub issue and seems your problem is different so you will have to wait for espressif to examine your hardware.

Ritesh
Posts: 1383
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: Flash Memory Corruption Issue

Postby Ritesh » Fri Mar 11, 2022 8:46 am

WiFive wrote:
Fri Mar 11, 2022 8:12 am
You have a different flash chip than the GitHub issue and seems your problem is different so you will have to wait for espressif to examine your hardware.
Thanks for your quick response for the same.
Regards,
Ritesh Prajapati

desp32fun
Posts: 7
Joined: Sat Jan 22, 2022 10:44 am

Re: Flash Memory Corruption Issue

Postby desp32fun » Tue Apr 26, 2022 2:58 pm

We went through this with XMC Flash Chips and about 3000 Wrover-E modules in the field.
Good news: You can fix this permanently in your next firmware update
Bad news: You have to do it before the problem hits you.

TL;DR: XMC Flash chips can be write protected, and their status registers, too. That's what's happening through "bad luck", I guess. Once locked, your module is doomed. The fix? Set the right parameters and lock the status registers yourself.
All described below.

https://en.hoerbert.com/technology/esp3 ... e-modules/

Good luck!

Ritesh
Posts: 1383
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: Flash Memory Corruption Issue

Postby Ritesh » Sun May 01, 2022 9:54 am

desp32fun wrote:
Tue Apr 26, 2022 2:58 pm
We went through this with XMC Flash Chips and about 3000 Wrover-E modules in the field.
Good news: You can fix this permanently in your next firmware update
Bad news: You have to do it before the problem hits you.

TL;DR: XMC Flash chips can be write protected, and their status registers, too. That's what's happening through "bad luck", I guess. Once locked, your module is doomed. The fix? Set the right parameters and lock the status registers yourself.
All described below.

https://en.hoerbert.com/technology/esp3 ... e-modules/

Good luck!
Hello,

Thanks for sharing details and links

But this is totally different issue then issue of ours regarding flash memory corruption. Actually, Our issue is like Flash Memory is being corrupted run time on field when it is being under test.
Regards,
Ritesh Prajapati

Who is online

Users browsing this forum: No registered users and 70 guests