espressif / esp-idf

Espressif IoT Development Framework. Official development framework for Espressif SoCs.
Apache License 2.0
13.49k stars 7.26k forks source link

After setting the eFuse bit, the program can no longer be flash to ESP32S3 F8N8. (IDFGH-9775) #11109

Closed 1201yuge closed 1 year ago

1201yuge commented 1 year ago

Answers checklist.

IDF version.

v5.0.1

Operating System used.

Windows

How did you build your project?

VS Code IDE

If you are using Windows, please specify command line type.

CMD

What is the expected behavior?

Normally flash program

What is the actual behavior?

A fatal error occurred: MD5 of file does not match data in flash!

Steps to reproduce.

Development board: ESP32-S3-DevKitC-1 v1.0, only one COM port connected, no pins are connected.

At first, the program was downloaded and run successfully. Then, to test the speed of Octal Flash and PSRAM, I followed the official website instructions to enable CONFIG_ESPTOOLPY_OCT_FLASH, but an error occurred: Octal Flash option selected, but EFUSE not configured!

After searching, I followed the instructions in [(https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/api-guides/flash_psram_config.html#error-handling)] to set eFuse bit:

python3 ./espefuse.py -p /dev/<serial_device> --do-not-confirm burn_efuse FLASH_TYPE 1

After the setting was successful, the code could no longer be downloaded. The download command and Log information are as follows: C:\Users\yuge\.espressif\python_env\idf5.0_py3.8_env\Scripts\python.exe C:\Users\yuge\esp\esp-idf\components\esptool_py\esptool\esptool.py -p COM12 -b 115200 --before default_reset --after hard_reset --chip esp32s3 write_flash --flash_mode dout --flash_freq 80m --flash_size detect 0x0 bootloader/bootloader.bin 0x10000 qv500.bin 0x8000 partition_table/partition-table.bin esptool.py v4.5.1 Serial port COM12 Connecting.... Chip is ESP32-S3 (revision v0.1) Features: WiFi, BLE Crystal is 40MHz MAC: 7c:df:a1:e8:04:7c Uploading stub... Running stub... Stub running... Configuring flash size... Auto-detected Flash size: 8MB Flash will be erased from 0x00000000 to 0x00005fff... Flash will be erased from 0x00010000 to 0x00041fff... Flash will be erased from 0x00008000 to 0x00008fff... Compressed 20864 bytes to 13303... Wrote 20864 bytes (13303 compressed) at 0x00000000 in 1.7 seconds (effective 99.3 kbit/s)... File md5: fc90338226dd4e9c4e5af182fec52653 Flash md5: b145c0e952abec491d69c8c5f8ac47c4 MD5 of 0xFF is b145c0e952abec491d69c8c5f8ac47c4 A fatal error occurred: MD5 of file does not match data in flash!

Then I checked the status according to online information: C:\Users\yuge\.espressif\python_env\idf5.0_py3.8_env\Scripts\python.exe C:\Users\yuge\esp\esp-idf\components\esptool_py\esptool\esptool.py -p COM12 -b 115200 read_flash_status esptool.py v4.5.1 Serial port COM12 Connecting.... Detecting chip type... ESP32-S3 Chip is ESP32-S3 (revision v0.1) Features: WiFi, BLE Crystal is 40MHz MAC: 7c:df:a1:e8:04:7c Uploading stub... Running stub... Stub running... Status value: 0x0200 Hard resetting via RTS pin...

C:\Users\yuge\.espressif\python_env\idf5.0_py3.8_env\Scripts\python.exe C:\Users\yuge\esp\esp-idf\components\esptool_py\esptool\esptool.py -p COM12 -b 115200 flash_id esptool.py v4.5.1 Serial port COM12 Connecting.... Detecting chip type... ESP32-S3 Chip is ESP32-S3 (revision v0.1) Features: WiFi, BLE Crystal is 40MHz MAC: 7c:df:a1:e8:04:7c Uploading stub... Running stub... Stub running... Manufacturer: 20 Device: 4017 Detected flash size: 8MB Flash type set in eFuse: octal (8 data lines) Hard resetting via RTS pin...

And set: C:\Users\yuge\.espressif\python_env\idf5.0_py3.8_env\Scripts\python.exe C:\Users\yuge\esp\esp-idf\components\esptool_py\esptool\esptool.py -p COM12 write_flash_status --non-volatile 0 Connecting.... Detecting chip type... ESP32-S3 Chip is ESP32-S3 (revision v0.1) Features: WiFi, BLE Crystal is 40MHz MAC: 7c:df:a1:e8:04:7c Uploading stub... Running stub... Stub running... Initial flash status: 0x0200 Setting flash status: 0x0000 After flash status: 0x0200 Hard resetting via RTS pin...

But the problem still cannot be solved, and the download still gives an error:

A fatal error occurred: MD5 of file does not match data in flash!

Build or installation Logs.

esptool.py v4.5.1
Serial port COM12
Connecting....
Chip is ESP32-S3 (revision v0.1)
Features: WiFi, BLE
Crystal is 40MHz
MAC: 7c:df:a1:e8:04:7c
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 8MB
Flash will be erased from 0x00000000 to 0x00005fff...
Flash will be erased from 0x00010000 to 0x00041fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Compressed 20864 bytes to 13303...
Wrote 20864 bytes (13303 compressed) at 0x00000000 in 1.7 seconds (effective 99.3 kbit/s)...
File md5: fc90338226dd4e9c4e5af182fec52653
Flash md5: b145c0e952abec491d69c8c5f8ac47c4
MD5 of 0xFF is b145c0e952abec491d69c8c5f8ac47c4
A fatal error occurred: MD5 of file does not match data in flash!

More Information.

  1. The development board is only connected to the com interface, all the pins are not connected to anything
  2. Under the same environment, replacing the development board with another one allows the program to be downloaded normally.
kayzen9 commented 1 year ago

Stub running... Manufacturer: 20 Device: 4017 Detected flash size: 8MB Flash type set in eFuse: octal (8 data lines) Hard resetting via RTS pin...

this is not octal flash based on manufacturar..see https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/api-reference/peripherals/spi_flash/spi_flash_optional_feature.html#opi-flash-support

maybe ur devkit was quad flash & octal spiram?? https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/api-guides/flash_psram_config.html#all-supported-modes-and-speeds

1201yuge commented 1 year ago

@kayzen9 Oh, you are right. This devkit is indeed quad flash & octal spiram. I have set its efuse bit, which cannot be reversed, so this devkit has been damaged? Is there any way to save it?

Icarus113 commented 1 year ago

Hi @1201yuge

I think there's no way to reverse this.

Few backgrounds: The efuse bit (FLASH_TYPE) you burnt is used in both the chip ROM and ESP-IDF SDK to detect if it's an octal flash chip. There might be a condition that some devboards manufactured by other companies cannot guarantee this bit to be burnt correctly. So we provide such a way. But it's irreversible...

Icarus113 commented 1 year ago

Will close this issue. Feel free to reopen if there's any further question.