ESP32 FS Errors Hanging

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Ian
Normal user
Posts: 15
Joined: 05 Aug 2018, 14:14

ESP32 FS Errors Hanging

#1 Post by Ian » 31 Dec 2022, 15:07

Hello,

I've tried installing "ESP_Easy_mega_20221224_normal_ESP32_4M316k" on 2 different WROOM ESP32's (non S2) and both flash correctly, but give FS errors and hang.

Can someone give some advice please?

Ian

Code: Select all

Using '/dev/cu.usbserial-0001' as serial port.
[16:43:15]INIT : Booting version: ESP_Easy_mega_20221224_normal_ESP32_4M316k_ETH, (GitHub Actions) mega-20221224_35f2ff8 (ESP32 SDK v4.4.3)
Connecting...[16:43:15]6964 : Info  ets Jun  8 2016 00:22:57
[16:43:15]
[16:43:15]rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
..Serial port closed!
....
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting...................
Detecting chip type... ESP32
Connecting....................

Chip Info:
 - Chip Family: ESP32
 - Chip Model: ESP32-D0WDQ6 (revision 0)
 - Number of Cores: 2
 - Max CPU Frequency: 80MHz
 - Has Bluetooth: YES
 - Has Embedded Flash: NO
 - Has Factory-Calibrated ADC: NO
 - MAC Address: 24:0A:C4:81:AC:40
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
 - Flash Size: 4MB
 - Flash Mode: dout
 - Flash Frequency: 40MHz
Erasing flash (this may take a while)...
Chip erase completed successfully in 4.0s
Flash will be erased from 0x00001000 to 0x00004fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00010000 to 0x0013dfff...
Compressed 15872 bytes to 10320...
Writing at 0x00001000... (100 %)Wrote 15872 bytes (10320 compressed) at 0x00001000 in 0.4 seconds (effective 332.1 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 144...
Writing at 0x00008000... (100 %)Wrote 3072 bytes (144 compressed) at 0x00008000 in 0.0 seconds (effective 514.0 kbit/s)...
Hash of data verified.
Compressed 8192 bytes to 47...
Writing at 0x0000e000... (100 %)Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (effective 902.2 kbit/s)...
Hash of data verified.
Compressed 1234672 bytes to 842446...
Writing at 0x0013b15b... (100 %)Wrote 1234672 bytes (842446 compressed) at 0x00010000 in 20.1 seconds (effective 491.0 kbit/s)...
Hash of data verified.

Leaving...
Hard Resetting...
Hard resetting via RTS pin...
Done! Flashing is complete!

Showing logs:
[16:43:55]ets Jun  8 2016 00:22:57
[16:43:55]
[16:43:55]rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
[16:43:55]configsip: 0, SPIWP:0xee
[16:43:55]clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
[16:43:55]mode:DOUT, clock div:2
[16:43:55]load:0x3fff0018,len:4
[16:43:55]load:0x3fff001c,len:1044
[16:43:55]load:0x40078000,len:8896
[16:43:55]load:0x40080400,len:5828
[16:43:55]entry 0x400806ac
[16:43:56]U32 : Info   : 
[16:43:56]
[16:43:56]INIT : Booting version: HEAD_56d3225 (ESP32 SDK v4.4.1)
[16:43:56]33 : Info   : INIT : Free RAM:282864
[16:43:57]35 : Info   : INIT : Cold Boot - Restart Reason: CPU0: RTC Watch dog reset digital core and rtc module CPU1: for APP CPU, reseted by PRO CPU
[16:43:57]36 : Info   : FS   : Mounting...
[16:43:57]FS   : Mount failed
[16:43:58]37 : Error  : FS   : Mount failed
[16:43:58]RESET: Resetting factory defaults... using default settings
[16:43:58]RESET: Warm boot, reset count: 0
[16:43:58]RESET: formatting...
[16:44:15]RESET: formatting done...
[16:44:16]18990 : Error  : FS   : Error while reading/writing config.dat in 12237
[16:44:16]19810 : Error  : FS   : Error while reading/writing security.dat in 12237
[16:44:16]19943 : Info   : SaveToFile: free stack: 7416
[16:44:16]20004 : Info   : FILE : Saved config.dat offset: 8192 size: 820
[16:44:16]20005 : Info   : SaveToFile: free stack after: 7416
[16:44:16]20006 : Info   : SaveToFile: free stack: 7448
[16:44:16]20088 : Info   : FILE : Saved config.dat offset: 0 size: 3004
[16:44:16]20089 : Info   : SaveToFile: free stack after: 7448
[16:44:16]20090 : Info   : SaveToFile: free stack: 7256
[16:44:16]20153 : Info   : FILE : Saved security.dat offset: 0 size: 593
[16:44:16]20154 : Info   : SaveToFile: free stack after: 7256
[16:44:16]20156 : Info   : SaveToFile: free stack: 6888
[16:44:17]20159 : Error  : FS   : Error while reading/writing security.dat in 12318
[16:44:17]RESET: Successful, rebooting. (you might need to press the reset button if you've just flashed the firmware)
[16:44:18]21345 : Inets Jun  8 2016 00:22:57
[16:44:18]
[16:44:18]rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
[16:44:18]configsip: 0, SPIWP:0xee
[16:44:18]clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
[16:44:18]mode:DOUT, clock div:2
[16:44:18]load:0x3fff0018,len:4
[16:44:18]load:0x3fff001c,len:1044
[16:44:18]load:0x40078000,len:8896
[16:44:18]load:0x40080400,len:5828
[16:44:18]entry 0x400806ac
[16:44:18]U36 : Info   : 
[16:44:18]
[16:44:18]INIT : Booting version: HEAD_56d3225 (ESP32 SDK v4.4.1)
[16:44:18]37 : Info   : INIT : Free RAM:282564
[16:44:33]39 : Info   : INIT : Soft Reboot #1 Last Action before Reboot: Intended Reboot: ResetFactory Last systime: 21 - Restart Reason: CPU0: Softwa15196 : Info   : SaveToFile: free stack: 7528
[16:44:33]15257 : Info   : FILE : Saved config.dat offset: 8192 size: 820
[16:44:33]15258 : Info   : SaveToFile: free stack after: 7528
[16:44:33]15259 : Info   : SaveToFile: free stack: 7560
[16:44:33]15291 : Info   : FILE : Saved config.dat offset: 0 size: 3004
[16:44:33]15292 : Info   : SaveToFile: free stack after: 7560
[16:44:33]15293 : Info   : SaveToFile: free stack: 7368
[16:44:33]15353 : Info   : FILE : Saved security.dat offset: 0 size: 593
[16:44:33]15354 : Info   : SaveToFile: free stack after: 7368
[16:44:33]15356 : Info   : SaveToFile: free stack: 7000
[16:44:34]15359 : Error  : FS   : Error while reading/writing security.dat in 12318
[16:44:34]RESET: Successful, rebooting. (you might need to press the reset button if you've just flashed the firmware)
[16:44:34]16379 : Infets Jun  8 2016 00:22:57
[16:44:34]
[16:44:34]rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
[16:44:34]configsip: 0, SPIWP:0xee
[16:44:34]clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
[16:44:34]mode:DOUT, clock div:2
[16:44:34]load:0x3fff0018,len:4
[16:44:34]load:0x3fff001c,len:1044
[16:44:34]load:0x40078000,len:8896
[16:44:34]load:0x40080400,len:5828
[16:44:34]entry 0x400806ac
[16:44:44]ets Jun  8 2016 00:22:57
[16:44:44]
[16:44:44]rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
[16:44:44]configsip: 0, SPIWP:0xee
[16:44:44]clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
[16:44:44]mode:DOUT, clock div:2
[16:44:44]load:0x3fff0018,len:4
[16:44:44]load:0x3fff001c,len:1044
[16:44:44]load:0x40078000,len:8896
[16:44:44]load:0x40080400,len:5828
[16:44:44]entry 0x400806ac
[16:44:44]U36 : Info   : 
[16:44:44]
[16:44:44]INIT : Booting version: HEAD_56d3225 (ESP32 SDK v4.4.1)
[16:44:44]37 : Info   : INIT : Free RAM:282564
[16:44:59]39 : Info   : INIT : Cold Boot #2 Last Action before Reboot: Intended Reboot: ResetFactory Last systime: 37 - Restart Reason: CPU0: RTC Watch14993 : Info   : SaveToFile: free stack: 7528
[16:44:59]15052 : Info   : FILE : Saved config.dat offset: 8192 size: 820
[16:44:59]15053 : Info   : SaveToFile: free stack after: 7528
[16:44:59]15054 : Info   : SaveToFile: free stack: 7560
[16:44:59]15086 : Info   : FILE : Saved config.dat offset: 0 size: 3004
[16:44:59]15087 : Info   : SaveToFile: free stack after: 7560
[16:44:59]15088 : Info   : SaveToFile: free stack: 7368
[16:44:59]15146 : Info   : FILE : Saved security.dat offset: 0 size: 593
[16:44:59]15147 : Info   : SaveToFile: free stack after: 7368
[16:44:59]15149 : Info   : SaveToFile: free stack: 7000
[16:45:00]15152 : Error  : FS   : Error while reading/writing security.dat in 12318
[16:45:01]RESET: Successful, rebooting. (you might need to press the reset button if you've just flashed the firmware)
[16:45:01]16172 : Inets Jun  8 2016 00:22:57
[16:45:01]
[16:45:01]rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
[16:45:01]configsip: 0, SPIWP:0xee
[16:45:01]clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
[16:45:01]mode:DOUT, clock div:2
[16:45:01]load:0x3fff0018,len:4
[16:45:01]load:0x3fff001c,len:1044
[16:45:01]load:0x40078000,len:8896
[16:45:01]load:0x40080400,len:5828
[16:45:01]entry 0x400806ac
[16:45:01]U36 : Info   : 
[16:45:01]
[16:45:01]INIT : Booting version: HEAD_56d3225 (ESP32 SDK v4.4.1)
[16:45:01]37 : Info   : INIT : Free RAM:282564

User avatar
Ath
Normal user
Posts: 3526
Joined: 10 Jun 2018, 12:06
Location: NL

Re: ESP32 FS Errors Hanging

#2 Post by Ath » 31 Dec 2022, 16:36

When using an external flash tool (not via OTA Firmware Update) for the initial upload, you need to flash the .factory.bin file. That includes the partition table, including the FS partition (and other required partitions), so ESPEasy can format the FS as it will be uninitialized.
After configuring the device you can install (future) updates via the Firmware Update button on the Tools page, and then use the 'regular' .bin (without .factory in the name). It will keep the configuration intact, as long as you keep using the same flash layout (4M316k).
/Ton (PayPal.me)

TD-er
Core team member
Posts: 8759
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP32 FS Errors Hanging

#3 Post by TD-er » 01 Jan 2023, 01:58

Code: Select all

 - Chip Family: ESP32
 - Chip Model: ESP32-D0WDQ6 (revision 0)
 - Number of Cores: 2
 - Max CPU Frequency: 80MHz
 - Has Bluetooth: YES
 - Has Embedded Flash: NO
 - Has Factory-Calibrated ADC: NO
 - MAC Address: 24:0A:C4:81:AC:40
 
This part is a bit strange...
Why would it only detect this as max. CPU freq. of 80 MHz?
And also what flash tool is used here?
I don't recognize this info formatting.

Does this tool support some option to "not change bin"?
I think it may have detected the wrong flash parameters and thus set/changed some flags in the binary while flashing.
Some tools can detect flash size/speed and mode and toggle those bits in the binary when flashing it to the ESP.

Ian
Normal user
Posts: 15
Joined: 05 Aug 2018, 14:14

Re: ESP32 FS Errors Hanging

#4 Post by Ian » 02 Jan 2023, 10:01

Ath wrote: 31 Dec 2022, 16:36 When using an external flash tool (not via OTA Firmware Update) for the initial upload, you need to flash the .factory.bin file. That includes the partition table, including the FS partition (and other required partitions), so ESPEasy can format the FS as it will be uninitialized.
After configuring the device you can install (future) updates via the Firmware Update button on the Tools page, and then use the 'regular' .bin (without .factory in the name). It will keep the configuration intact, as long as you keep using the same flash layout (4M316k).
Thanks, is there page somewhere that explains the ESP32 flashing, I did have a look.

I've just tried flashing with the .factory.bin file. but I get a magic byte error?

Code: Select all

Using '/dev/cu.usbserial-0001' as serial port.
Connecting....
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting....
Detecting chip type... ESP32
Connecting....

Chip Info:
 - Chip Family: ESP32
 - Chip Model: ESP32-D0WDQ6 (revision 1)
 - Number of Cores: 2
 - Max CPU Frequency: 240MHz
 - Has Bluetooth: YES
 - Has Embedded Flash: NO
 - Has Factory-Calibrated ADC: YES
 - MAC Address: 24:6F:28:AF:39:E8
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
 - Flash Size: 4MB
Unexpected error: The firmware binary is invalid (magic byte=FF, should be E9)

User avatar
Ath
Normal user
Posts: 3526
Joined: 10 Jun 2018, 12:06
Location: NL

Re: ESP32 FS Errors Hanging

#5 Post by Ath » 02 Jan 2023, 10:11

The .factory.bin file has to be flashed at address 0x0 (zero), can't see what you are using now, but when, by accident, I select the .factory.bin file for flashing via OTA I get the same error message. Most likely you are trying to flash at (default) 0x10000, and that's probably also why you also got these FS errors earlier.
/Ton (PayPal.me)

User avatar
Ath
Normal user
Posts: 3526
Joined: 10 Jun 2018, 12:06
Location: NL

Re: ESP32 FS Errors Hanging

#6 Post by Ath » 02 Jan 2023, 10:13

Ian wrote: 02 Jan 2023, 10:01 Thanks, is there page somewhere that explains the ESP32 flashing, I did have a look.
That would be this page: https://espeasy.readthedocs.io/en/lates ... nload-tool
/Ton (PayPal.me)

Ian
Normal user
Posts: 15
Joined: 05 Aug 2018, 14:14

Re: ESP32 FS Errors Hanging

#7 Post by Ian » 02 Jan 2023, 10:14

And also what flash tool is used here?
I don't recognize this info formatting.
It's the ESPHome-Flasher on MacOS, could you recommend another, I could also do it on a PC?
Does this tool support some option to "not change bin"?
No it's quite basic.
Attachments
ESPHome.jpg
ESPHome.jpg (191.82 KiB) Viewed 3050 times

Ian
Normal user
Posts: 15
Joined: 05 Aug 2018, 14:14

Re: ESP32 FS Errors Hanging

#8 Post by Ian » 02 Jan 2023, 10:17

Thanks again, Best I use the Espressive tool on a PC then

User avatar
Ath
Normal user
Posts: 3526
Joined: 10 Jun 2018, 12:06
Location: NL

Re: ESP32 FS Errors Hanging

#9 Post by Ath » 02 Jan 2023, 10:19

Or the Python tool, as described here: https://randomnerdtutorials.com/flashin ... 2-esp8266/ as that's also used/included by the Espressif Windows tool
/Ton (PayPal.me)

Ian
Normal user
Posts: 15
Joined: 05 Aug 2018, 14:14

Re: ESP32 FS Errors Hanging

#10 Post by Ian » 02 Jan 2023, 10:33

I'll try the Python tool, will it automatically flash at address 0x0 (zero)?

TD-er
Core team member
Posts: 8759
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP32 FS Errors Hanging

#11 Post by TD-er » 02 Jan 2023, 12:47

Ian wrote: 02 Jan 2023, 10:01 [...]

I've just tried flashing with the .factory.bin file. but I get a magic byte error?
[...]
That's an indication you do change the bits I mentioned.
So your flash tool does try to detect the flash parameters and patch them.
This should not be done!

When using Chrome, you can also try the web flasher: https://td-er.nl/ESPEasy/

Ian
Normal user
Posts: 15
Joined: 05 Aug 2018, 14:14

Re: ESP32 FS Errors Hanging

#12 Post by Ian » 02 Jan 2023, 20:24

Ath wrote: 02 Jan 2023, 10:19 Or the Python tool, as described here: https://randomnerdtutorials.com/flashin ... 2-esp8266/ as that's also used/included by the Espressif Windows tool
I'm not having much luck :(

I erased the flash and installed the factory.bin

Code: Select all

ian@Ians-iMac Desktop % python -m esptool --chip esp32 --port /dev/cu.usbserial-0001 erase_flash                                                                   
esptool.py v2.8
Serial port /dev/cu.usbserial-0001
Connecting........_
Chip is ESP32D0WDQ6 (revision 0)
Features: WiFi, BT, Dual Core, Coding Scheme None
Crystal is 40MHz
MAC: 24:0a:c4:81:ac:40
Uploading stub...
Running stub...
Stub running...
Erasing flash (this may take a while)...
Chip erase completed successfully in 3.6s
Hard resetting via RTS pin...
ian@Ians-iMac Desktop % python -m esptool --chip esp32 --port /dev/cu.usbserial-0001 write_flash -z 0x0 ESP_Easy_mega_20221224_normal_ESP32s2_4M316k.factory.bin
esptool.py v2.8
Serial port /dev/cu.usbserial-0001
Connecting........_
Chip is ESP32D0WDQ6 (revision 0)
Features: WiFi, BT, Dual Core, Coding Scheme None
Crystal is 40MHz
MAC: 24:0a:c4:81:ac:40
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 1358000 bytes to 899395...
Wrote 1358000 bytes (899395 compressed) at 0x00000000 in 79.3 seconds (effective 136.9 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
Then on Arduino serial monitor this loops like crazy

Code: Select all

20:10:06.842 -> rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
20:10:06.842 -> configsip: 0, SPIWP:0xee
20:10:06.842 -> clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
20:10:06.842 -> mode:DIO, clock div:1
20:10:06.842 -> load:0x3ffe6100,len:124
20:10:06.842 -> ho 0 tail 12 room 4
20:10:06.842 -> load:0x4004c000,len:2044
20:10:06.842 -> load:0x40050000,len:9624
20:10:06.842 -> entry 0x4004c15c
20:10:06.842 -> Fatal exception (28): LoadProhibited
20:10:06.875 -> epc1=0x4004c1a7, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00130570, depc=0x00000000
20:10:07.225 -> ets Jun  8 2016 00:22:57
Also tried the Chrome web flasher (no factory.bin file available) and got

Code: Select all

Unable to fetch manifest: Unexpected token '<', "<!DOCTYPE "... is not valid JSON
Also tried on a Windows 11 using COM3 USB to UART but gives a "COM fail"

TD-er
Core team member
Posts: 8759
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP32 FS Errors Hanging

#13 Post by TD-er » 02 Jan 2023, 20:49

Huh? What version did you try to flash from the link I gave you?

When you get something like the com port being unavailable, you might want to replug the ESP to make sure no other program is using the COM port.
Also close software like Cura (slicer program for 3D printers) as this will always (, ask me how I know) mess with serial ports.

Edit:
When in Windows, you can also use the Espressif download tool, which is included in the ZIP file.
See here for screenshots:
https://espeasy.readthedocs.io/en/lates ... html#esp32

Make sure to check the checkbox "Do not change bin" (but then hardly readable without spaces)

User avatar
Ath
Normal user
Posts: 3526
Joined: 10 Jun 2018, 12:06
Location: NL

Re: ESP32 FS Errors Hanging

#14 Post by Ath » 02 Jan 2023, 22:13

You have uploaded an ESP32s2 bin file on a regular ESP32 chip, that's not going to work, as they have different cpu architectures...

Try to use this file: ESP_Easy_mega_20221224_normal_ESP32_4M316k.factory.bin
/Ton (PayPal.me)

Ian
Normal user
Posts: 15
Joined: 05 Aug 2018, 14:14

Re: ESP32 FS Errors Hanging

#15 Post by Ian » 03 Jan 2023, 17:34

Ath wrote: 02 Jan 2023, 22:13 You have uploaded an ESP32s2 bin file on a regular ESP32 chip, that's not going to work, as they have different cpu architectures...

Try to use this file: ESP_Easy_mega_20221224_normal_ESP32_4M316k.factory.bin
Oops sorry, I missed that.

I managed to get the new ESP Download tool V3.9.3 running on a PC, erased the flash downloaded the correct version on 2 different ESP32's (both WROOM though) and still no luck.

Again in error loop :(
Attachments
Screenshot_20230103_152721.png
Screenshot_20230103_152721.png (1.04 MiB) Viewed 2931 times

TD-er
Core team member
Posts: 8759
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP32 FS Errors Hanging

#16 Post by TD-er » 03 Jan 2023, 18:32

You need to flash the "Factory" bin file.
not the file without "factory" in the name.

The Factory file includes the bootloader, which needs to be flashed via serial.
The non-factory file should only be used when updating an existing unit via the web interface.

Ian
Normal user
Posts: 15
Joined: 05 Aug 2018, 14:14

Re: ESP32 FS Errors Hanging

#17 Post by Ian » 03 Jan 2023, 19:40

TD-er wrote: 03 Jan 2023, 18:32 You need to flash the "Factory" bin file.
So sorry, how stupid of me I was doing 2 things at once.

Now it works!!

Thank you for your time and patience.

TD-er
Core team member
Posts: 8759
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP32 FS Errors Hanging

#18 Post by TD-er » 03 Jan 2023, 20:16

Well, now you made this error, you will never forget :)
So be glad you made this error now or else you will make it quite often and keep on searching why it doesn't work :)

Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests