ESP32-S3 with large FLASH resets before second-stage bootloader

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

Re: ESP32-S3 with large FLASH resets before second-stage bootloader

Postby ESP_Sprite » Fri Dec 09, 2022 12:52 am

No, you do not. For instance, our ESP32-S3-WROOM-1-N8R8 module has octal PSRAM but quad flash.

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

Re: ESP32-S3 with large FLASH resets before second-stage bootloader

Postby ESP_Sprite » Fri Dec 09, 2022 5:43 am

Just to check if it's not a software error, could you use esptool to write the attached bin file? (esptool.py write_flash 0 hello_world_merged.bin)
Attachments
hello_world_s3.zip
(118.23 KiB) Downloaded 192 times

Julien1138
Posts: 12
Joined: Mon Dec 05, 2022 4:38 pm

Re: ESP32-S3 with large FLASH resets before second-stage bootloader

Postby Julien1138 » Fri Dec 09, 2022 8:01 am

ESP_Sprite wrote:
Fri Dec 09, 2022 12:52 am
No, you do not. For instance, our ESP32-S3-WROOM-1-N8R8 module has octal PSRAM but quad flash.
Ok. But GPIO 33 to 37 should be free, right ? Im my case they are not.

Julien1138
Posts: 12
Joined: Mon Dec 05, 2022 4:38 pm

Re: ESP32-S3 with large FLASH resets before second-stage bootloader

Postby Julien1138 » Fri Dec 09, 2022 8:14 am

ESP_Sprite wrote:
Fri Dec 09, 2022 5:43 am
Just to check if it's not a software error, could you use esptool to write the attached bin file? (esptool.py write_flash 0 hello_world_merged.bin)
I get:

Code: Select all

Serial port /dev/ttyACM0
Connecting....
Detecting chip type... ESP32-S3
Chip is ESP32-S3 (revision v0.1)
Features: WiFi, BLE
Crystal is 40MHz
MAC: 7c:df:a1:e0:ed:ec
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Flash will be erased from 0x00000000 to 0x00042fff...
Compressed 271392 bytes to 121485...
Wrote 271392 bytes (121485 compressed) at 0x00000000 in 6.1 seconds (effective 355.1 kbit/s)...
File  md5: 40ec11bb88e3ecb964fd97fa1a91d71d
Flash md5: bb729591c20498546ecec631b501276b
MD5 of 0xFF is 9fccc877fcc99e6e2419487f3a67e2f1

A fatal error occurred: MD5 of file does not match data in flash!
And when I add the --no-stub option, I get:

Code: Select all

Serial port /dev/ttyACM0
Connecting...
Detecting chip type... ESP32-S3
Chip is ESP32-S3 (revision v0.1)
Features: WiFi, BLE
Crystal is 40MHz
MAC: 7c:df:a1:e0:ed:ec
Enabling default SPI flash mode...
Configuring flash size...
Flash will be erased from 0x00000000 to 0x00042fff...
Erasing flash...
Took 4.91s to erase flash block
Writing at 0x00040000... (96 %)
A fatal error occurred: Failed to write to target Flash after seq 256 (result was 01050000: Requested resource not found)

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

Re: ESP32-S3 with large FLASH resets before second-stage bootloader

Postby ESP_Sprite » Fri Dec 09, 2022 9:43 am

Ah, that is a good point. If you use GPIO33-37 for something else, that won't work indeed. However, I'd expect the process to fail when the PSRAM is initialized, which is much later in the boot process, so I don't think it explains your current issue.

The flash write error caused me to look through the datasheet of the chip a bit more. I think you may be running into a power issue: the flash chip is fairly hungry and can pull up to 70mA from the 1.8V line. The ESP32S3 internal LDO is however only specced for 40mA, and this also feeds the internal PSRAM. It could be that that voltage rail is simply buckling under load. You could try to give the flash chip external 1.8V, see if it behaves a bit better that way.

Julien1138
Posts: 12
Joined: Mon Dec 05, 2022 4:38 pm

Re: ESP32-S3 with large FLASH resets before second-stage bootloader

Postby Julien1138 » Thu Dec 22, 2022 1:32 pm

So,

I changed my ESP32-S3R8V with a S3R2. And I changed the flash IC with an Infineon S25FL512SDSMFB010 which is 3.3V compatible and 64 MB (I could not find anything smaller with the same footprint and available).

And I still get this error at programming :

Code: Select all

esptool.py v4.4
Serial port COM11
Connecting...
Chip is ESP32-S3 (revision v0.1)
Features: WiFi, BLE
Crystal is 40MHz
MAC: 7c:df:a1:f0:90:20
Changing baud rate to 460800
Changed.
Enabling default SPI flash mode...
Configuring flash size...
Auto-detected Flash size: 64MB
Flash will be erased from 0x00000000 to 0x00005fff...
Flash will be erased from 0x00010000 to 0x00041fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Erasing flash...
Took 0.00s to erase flash block
Wrote 21504 bytes at 0x00000000 in 0.5 seconds (316.2 kbit/s)...
Hash of data verified.
Erasing flash...
Took 0.83s to erase flash block
Writing at 0x00040000... (97 %)
A fatal error occurred: Failed to write to target Flash after seq 192 (result was 01053638: Requested resource not found)
I tried flashing your hello_world_s3 (esptool.py write_flash 0 hello_world_merged.bin) and I get this error :

Code: Select all

esptool.py v4.4
Serial port COM11
Connecting...
Detecting chip type... ESP32-S3
Chip is ESP32-S3 (revision v0.1)
Features: WiFi, BLE
Crystal is 40MHz
MAC: 7c:df:a1:f0:90:20
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Flash will be erased from 0x00000000 to 0x00042fff...
Warning: Image file at 0x0 is protected with a hash checksum, so not changing the flash frequency setting. Use the --flash_frequency=keep option instead of --flash_frequency=20m in order to remove this warning, or use the --dont-append-digest option for the elf2image command in order to generate an image file without a hash checksum
Compressed 271392 bytes to 121485...
Writing at 0x00000000... (12 %)Traceback (most recent call last):
  File "runpy.py", line 194, in _run_module_as_main
  File "runpy.py", line 87, in _run_code
  File "C:\Espressif\python_env\idf5.0_py3.8_env\lib\site-packages\esptool\__main__.py", line 11, in <module>
    esptool._main()
  File "C:\Espressif\python_env\idf5.0_py3.8_env\lib\site-packages\esptool\__init__.py", line 1026, in _main
    main()
  File "C:\Espressif\python_env\idf5.0_py3.8_env\lib\site-packages\esptool\__init__.py", line 826, in main
    operation_func(esp, args)
  File "C:\Espressif\python_env\idf5.0_py3.8_env\lib\site-packages\esptool\cmds.py", line 556, in write_flash
    esp.flash_defl_block(block, seq, timeout=timeout)
  File "C:\Espressif\python_env\idf5.0_py3.8_env\lib\site-packages\esptool\loader.py", line 109, in inner
    return func(*args, **kwargs)
  File "C:\Espressif\python_env\idf5.0_py3.8_env\lib\site-packages\esptool\loader.py", line 991, in flash_defl_block
    self.check_command(
  File "C:\Espressif\python_env\idf5.0_py3.8_env\lib\site-packages\esptool\loader.py", line 407, in check_command
    val, data = self.command(op, data, chk, timeout=timeout)
  File "C:\Espressif\python_env\idf5.0_py3.8_env\lib\site-packages\esptool\loader.py", line 376, in command
    p = self.read()
  File "C:\Espressif\python_env\idf5.0_py3.8_env\lib\site-packages\esptool\loader.py", line 308, in read
    return next(self._slip_reader)
StopIteration
here the percentage stopped at 12%, but sometimes it reaches 37% or even 50%.

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

Re: ESP32-S3 with large FLASH resets before second-stage bootloader

Postby ESP_Sprite » Fri Dec 23, 2022 2:47 am

That might be a known issue. Can you put the ESP32 in download mode (by lowering IO0 and hard-resetting the board) and try uploading again?

Who is online

Users browsing this forum: No registered users and 52 guests