rst:0x10 (RTCWDT_RTC_RESET),boot:0x33 (SPI_FAST_FLASH_BOOT) invalid header: 0xbc5d02e9

Yolnit
Posts: 7
Joined: Thu Jun 13, 2024 2:11 pm

rst:0x10 (RTCWDT_RTC_RESET),boot:0x33 (SPI_FAST_FLASH_BOOT) invalid header: 0xbc5d02e9

Postby Yolnit » Thu Sep 26, 2024 8:19 am

Hello everybody.

I am using my own board with an ESP32E_WROOM with the initial configuration for the strapping pins corresponding to the datasheet (PD or PU). I am using a micro USB to power up my ESP and sending code. Everything worked very good but recently I tried something on the board because I made a mistake on the schematic. The wire (connected to GND) has been left floating and might touch the RX or TX pins from the USB UART driver that i am using FT231XS. Since now, i have this kind of logs when I try running my ESP32 :

Code: Select all

C:\Users\CorentinLEROY\esp\v5.0.6\esp-idf\examples\get-started\blink>idf.py -p COM10 flash monitor
Executing action: flash
Running ninja in directory C:\Users\CorentinLEROY\esp\v5.0.6\esp-idf\examples\get-started\blink\build
Executing "ninja flash"...
[1/5] cmd.exe /C "cd /D C:\Users\CorentinLEROY\esp\v5.0.6\esp-idf\examples\get-started\blink\build\esp-idf\esptool_py && C:\Users\CorentinLEROY\.espressif\python_env\idf5.0_py3.9_env\Scripts\python.exe C:/Users/CorentinLEROY/esp/v5.0.6/esp-idf/components/partition_table/check_sizes.py --offset 0x8000 partition --type app C:/Users/CorentinLEROY/esp/v5.0.6/esp-idf/examples/get-started/blink/build/partition_table/partition-table.bin C:/Users/CorentinLEROY/esp/v5.0.6/esp-idf/examples/get-started/blink/build/blink.bin"
blink.bin binary size 0x2ddf0 bytes. Smallest app partition is 0x100000 bytes. 0xd2210 bytes (82%) free.
[2/5] Performing build step for 'bootloader'
[1/1] cmd.exe /C "cd /D C:\Users\CorentinLEROY\esp\v5.0.6\esp-idf\examples\get-started\blink\build\bootloader\esp-idf\esptool_py && C:\Users\CorentinLEROY\.espressif\python_env\idf5.0_py3.9_env\Scripts\python.exe C:/Users/CorentinLEROY/esp/v5.0.6/esp-idf/components/partition_table/check_sizes.py --offset 
0x8000 bootloader 0x1000 C:/Users/CorentinLEROY/esp/v5.0.6/esp-idf/examples/get-started/blink/build/bootloader/bootloader.bin"
Bootloader binary size 0x6760 bytes. 0x8a0 bytes (8%) free.
[2/3] cmd.exe /C "cd /D C:\Users\CorentinLEROY\esp\v5.0.6\esp-idf\components\esptool_py && C:\Users\CorentinLEROY\.espressif\tools\cmake\3.24.0\bin\cmake.exe -D IDF_PATH=C:/Users/CorentinLEROY/esp/v5.0.6/esp-idf -D SERIAL_TOOL=C:/Users/CorentinLEROY/.espressif/python_env/idf5.0_py3.9_env/Scripts/python.exe;;C:/Users/CorentinLEROY/esp/v5.0.6/esp-idf/components/esptool_py/esptool/esptool.py;--chip;esp32 -D SERIAL_TOOL_ARGS=--before=default_reset;--after=hard_reset;write_flash;@flash_args -D WORKING_DIRECTORY=C:/Users/CorentinLEROY/esp/v5.0.6/esp-idf/examples/get-started/blink/build -P C:/Users/CorentinLEROY/esp/v5.0.6/esp-idf/components/esptool_py/run_serial_tool.cmake"
esptool.py --chip esp32 -p COM10 -b 460800 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size 2MB 0x1000 bootloader/bootloader.bin 0x10000 blink.bin 0x8000 partition_table/partition-table.bin
esptool.py v4.7.0
Serial port COM10
Connecting....
Chip is ESP32-D0WD-V3 (revision v3.0)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: b4:8a:0a:89:44:7c
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Flash will be erased from 0x00001000 to 0x00007fff...
Flash will be erased from 0x00010000 to 0x0003dfff...
Flash will be erased from 0x00008000 to 0x00008fff...
Compressed 26464 bytes to 16486...
Writing at 0x00001000... (50 %)
Writing at 0x000076cc... (100 %)
Wrote 26464 bytes (16486 compressed) at 0x00001000 in 0.8 seconds (effective 281.1 kbit/s)...
Hash of data verified.
Compressed 187888 bytes to 98470...
Writing at 0x00010000... (14 %)
Writing at 0x0001c19d... (28 %)
Writing at 0x00021a2d... (42 %)
Writing at 0x00027610... (57 %)
Writing at 0x000300d2... (71 %)
Writing at 0x00037e2d... (85 %)
Writing at 0x0003dd2a... (100 %)
Wrote 187888 bytes (98470 compressed) at 0x00010000 in 2.8 seconds (effective 527.6 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 103...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (103 compressed) at 0x00008000 in 0.1 seconds (effective 384.2 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
Executing action: monitor
Running idf_monitor in directory C:\Users\CorentinLEROY\esp\v5.0.6\esp-idf\examples\get-started\blink
Executing "C:\Users\CorentinLEROY\.espressif\python_env\idf5.0_py3.9_env\Scripts\python.exe C:\Users\CorentinLEROY\esp\v5.0.6\esp-idf\tools/idf_monitor.py -p COM10 -b 115200 --toolchain-prefix xtensa-esp32-elf- --target esp32 --revision 0 C:\Users\CorentinLEROY\esp\v5.0.6\esp-idf\examples\get-started\blink\build\blink.elf --force-color -m 'C:\Users\CorentinLEROY\.espressif\python_env\idf5.0_py3.9_env\Scripts\python.exe' 'C:\Users\CorentinLEROY\esp\v5.0.6\esp-idf\tools\idf.py' '-p' 'COM10'"...
--- WARNING: GDB cannot open serial ports accessed as COMx
--- Using \\.\COM10 instead...
--- idf_monitor on \\.\COM10 115200 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
inv����ets Jul 29 2019 12:21:46

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
ets Jul 29 2019 12:21:46

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
ets Jul 29 2019 12:21:46

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
ets Jul 29 2019 12:21:46

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
ets Jul 29 2019 12:21:46

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
ets Jul 29 2019 12:21:46

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
ets Jul 29 2019 12:21:46

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
ets Jul 29 2019 12:21:46

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
ets Jul 29 2019 12:21:46

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
ets Jul 29 2019 12:21:46

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
ets Jul 29 2019 12:21:46

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
ets Jul 29 2019 12:21:46

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
ets Jul 29 2019 12:21:46

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
ets Jul 29 2019 12:21:46

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
ets Jul 29 2019 12:21:46

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
ets Jul 29 2019 12:21:46

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
ets Jul 29 2019 12:21:46

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
invalid header: 0x52686f32
ets Jul 29 2019 12:21:46

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
invalid header: 0x52686f32

Done
I have a LED that is always powered up when I plug my USB. I also have the correct strapping pin config on my board. When I use a ESP32 kit, the soft is running perfectly. I don't really know what to do now because it seems that the code is in the esp32 flash, but the ESP cannot communicate with the flash. Is it in deep sleep?

PS, I measured the current and the voltage coming from the USB port and I got 20mA on the VCC pin with +3V3, can it be the reason?

Tanguy
Posts: 10
Joined: Thu Dec 09, 2021 9:33 pm

Re: rst:0x10 (RTCWDT_RTC_RESET),boot:0x33 (SPI_FAST_FLASH_BOOT) invalid header: 0xbc5d02e9

Postby Tanguy » Fri Sep 27, 2024 7:06 am

Do you have encryption enabled ?
If so it might be because your bootloader or your app has been loaded unencrypted. In this case you could try :
idf.py encrypted-bootloader-flash encrypted-flash

Yolnit
Posts: 7
Joined: Thu Jun 13, 2024 2:11 pm

Re: rst:0x10 (RTCWDT_RTC_RESET),boot:0x33 (SPI_FAST_FLASH_BOOT) invalid header: 0xbc5d02e9

Postby Yolnit » Sun Sep 29, 2024 9:47 am

Hello Tanguy,

I worked on a nvs project with the encryption enabled. I tried you command line on a random project (blinky led) with no specific configuration activated in the menuconfig. Here are the logs :

Code: Select all

C:\Users\CorentinLEROY\Desktop\ESP32_NVS\example>idf.py encrypted-bootloader-flash encrypted-flash              
Executing action: encrypted-bootloader-flash
Running ninja in directory C:\Users\CorentinLEROY\Desktop\ESP32_NVS\example\build
Executing "ninja encrypted-bootloader-flash"...
[1/1] cmd.exe /C "cd /D C:\Users\CorentinLEROY\Desktop\ESP32_NVS\example\build\esp-idf\bootloader && C:\Users\CorentinLEROY\.espressif\tools\cmake\3.24.0\bin\cmake.exe -E echo "Error: The target encrypted-bootloader-flash requires" && C:\Users\CorentinLEROY\.espressif\tools\cmake\3.24.0\bin\cmake.exe -E echo "CONFIG_SECURE_FLASH_ENCRYPTION_MODE_DEVELOPMENT to be enabled." && C:\Users\CorentinLEROY\.espressif\tools\cmake\3.24.0\bin\cmake.exe -E env "FAIL_MESSAGE=Failed executing target (see errors on lines above)" C:/Users/CorentinLEROY/.espressif/tools/cmake/3.24.0/bin/cmake.exe -P C:/Users/CorentinLEROY/esp/v5.0.6/esp-idf/tools/cmake/scripts/fail.cmake"
FAILED: esp-idf/bootloader/CMakeFiles/encrypted-bootloader-flash C:/Users/CorentinLEROY/Desktop/ESP32_NVS/example/build/esp-idf/bootloader/CMakeFiles/encrypted-bootloader-flash
cmd.exe /C "cd /D C:\Users\CorentinLEROY\Desktop\ESP32_NVS\example\build\esp-idf\bootloader && C:\Users\CorentinLEROY\.espressif\tools\cmake\3.24.0\bin\cmake.exe -E echo "Error: The target encrypted-bootloader-flash requires" && C:\Users\CorentinLEROY\.espressif\tools\cmake\3.24.0\bin\cmake.exe -E echo "CONFIG_SECURE_FLASH_ENCRYPTION_MODE_DEVELOPMENT to be enabled." && C:\Users\CorentinLEROY\.espressif\tools\cmake\3.24.0\bin\cmake.exe -E env "FAIL_MESSAGE=Failed executing target (see errors on lines above)" C:/Users/CorentinLEROY/.espressif/tools/cmake/3.24.0/bin/cmake.exe -P C:/Users/CorentinLEROY/esp/v5.0.6/esp-idf/tools/cmake/scripts/fail.cmake"
Error: The target encrypted-bootloader-flash requires
CONFIG_SECURE_FLASH_ENCRYPTION_MODE_DEVELOPMENT to be enabled.
CMake Error at C:/Users/CorentinLEROY/esp/v5.0.6/esp-idf/tools/cmake/scripts/fail.cmake:3 (message):
  Failed executing target (see errors on lines above)


ninja: build stopped: subcommand failed.
ninja failed with exit code 1, output of the command is in the C:\Users\CorentinLEROY\Desktop\ESP32_NVS\example\build\log\idf_py_stderr_output_11668 and 
C:\Users\CorentinLEROY\Desktop\ESP32_NVS\example\build\log\idf_py_stdout_output_11668
I clearly don't have any sort of encryption activated in this project but I still have the same log as before when i run the idf.py -p COM flash monitor command.

It's seems the issue is somewhere else.

Could it be something about the flash not communicating with the µC? Because I can run the prog on an ESP32 devkit..

KR

Tanguy
Posts: 10
Joined: Thu Dec 09, 2021 9:33 pm

Re: rst:0x10 (RTCWDT_RTC_RESET),boot:0x33 (SPI_FAST_FLASH_BOOT) invalid header: 0xbc5d02e9

Postby Tanguy » Mon Sep 30, 2024 7:21 am

If the microcontroller could'nt communicate with the flash, you wouldn't be able to flash anything and you wouldn't get anything in the monitor.

Are you sure this board has never been encrypted ? Could you please run

Code: Select all

espefuse.py -p COMx summary
and share the setting of eFuses ?

Yolnit
Posts: 7
Joined: Thu Jun 13, 2024 2:11 pm

Re: rst:0x10 (RTCWDT_RTC_RESET),boot:0x33 (SPI_FAST_FLASH_BOOT) invalid header: 0xbc5d02e9

Postby Yolnit » Mon Sep 30, 2024 10:47 am

Hello Tanguy,

I didn't mentionned that I previously worked on a nvs project with encryption data inside the nvs partition. In fact you're right, the board has been encrypted.

Here are the logs :

Code: Select all

espefuse.py v4.7.0
Connecting....
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting....
Detecting chip type... ESP32

=== Run "summary" command ===
EFUSE_NAME (Block) Description  = [Meaningful Value] [Readable/Writeable] (Hex Value)
----------------------------------------------------------------------------------------
Calibration fuses:
ADC_VREF (BLOCK0)                                  True ADC reference voltage                         = 1135 R/W (0b00101)

Config fuses:
WR_DIS (BLOCK0)                                    Efuse write disable mask                           = 128 R/W (0x0080)
RD_DIS (BLOCK0)                                    Disable reading from BlOCK1-3                      = 1 R/W (0x1)
DISABLE_APP_CPU (BLOCK0)                           Disables APP CPU                                   = False R/W (0b0)
DISABLE_BT (BLOCK0)                                Disables Bluetooth                                 = False R/W (0b0)
DIS_CACHE (BLOCK0)                                 Disables cache                                     = False R/W (0b0)
CHIP_CPU_FREQ_LOW (BLOCK0)                         If set alongside EFUSE_RD_CHIP_CPU_FREQ_RATED; the = False R/W (0b0)
                                                    ESP32's max CPU frequency is rated for 160MHz. 24
                                                   0MHz otherwise
CHIP_CPU_FREQ_RATED (BLOCK0)                       If set; the ESP32's maximum CPU frequency has been = True R/W (0b1)
                                                    rated
BLK3_PART_RESERVE (BLOCK0)                         BLOCK3 partially served for ADC calibration data   = False R/W (0b0)
CLK8M_FREQ (BLOCK0)                                8MHz clock freq override                           = 49 R/W (0x31)
VOL_LEVEL_HP_INV (BLOCK0)                          This field stores the voltage level for CPU to run = 0 R/W (0b00)
                                                    at 240 MHz; or for flash/PSRAM to run at 80 MHz.0
                                                   x0: level 7; 0x1: level 6; 0x2: level 5; 0x3: leve
                                                   l 4. (RO)
CODING_SCHEME (BLOCK0)                             Efuse variable block length scheme
   = NONE (BLK1-3 len=256 bits) R/W (0b00)
CONSOLE_DEBUG_DISABLE (BLOCK0)                     Disable ROM BASIC interpreter fallback             = True R/W (0b1)
DISABLE_SDIO_HOST (BLOCK0)                                                                            = False R/W (0b0)
DISABLE_DL_CACHE (BLOCK0)                          Disable flash cache in UART bootloader             = True R/W (0b1)

Flash fuses:
FLASH_CRYPT_CNT (BLOCK0)                           Flash encryption is enabled if this field has an o = 1 R/W (0b0000001)
                                                   dd number of bits set
FLASH_CRYPT_CONFIG (BLOCK0)                        Flash encryption config (key tweak bits)           = 15 R/W (0xf)

Identity fuses:
CHIP_PACKAGE_4BIT (BLOCK0)                         Chip package identifier #4bit                      = False R/W (0b0)
CHIP_PACKAGE (BLOCK0)                              Chip package identifier                            = 1 R/W (0b001)
CHIP_VER_REV1 (BLOCK0)                             bit is set to 1 for rev1 silicon                   = True R/W (0b1)
CHIP_VER_REV2 (BLOCK0)                                                                                = True R/W (0b1)
WAFER_VERSION_MINOR (BLOCK0)                                                                          = 0 R/W (0b00)
WAFER_VERSION_MAJOR (BLOCK0)                       calc WAFER VERSION MAJOR from CHIP_VER_REV1 and CH = 3 R/W (0b011)
                                                   IP_VER_REV2 and apb_ctl_date (read only)
PKG_VERSION (BLOCK0)                               calc Chip package = CHIP_PACKAGE_4BIT << 3 + CHIP_ = 1 R/W (0x1)
                                                   PACKAGE (read only)

Jtag fuses:
JTAG_DISABLE (BLOCK0)                              Disable JTAG                                       = True R/W (0b1)

Mac fuses:
MAC (BLOCK0)                                       MAC address
   = b4:8a:0a:89:44:7c (CRC 0xa1 OK) R/W
MAC_CRC (BLOCK0)                                   CRC8 for MAC address                               = 161 R/W (0xa1)
MAC_VERSION (BLOCK3)                               Version of the MAC field                           = 0 R/W (0x00)

Security fuses:
UART_DOWNLOAD_DIS (BLOCK0)                         Disable UART download mode. Valid for ESP32 V3 and = False R/W (0b0)
                                                    newer; only
ABS_DONE_0 (BLOCK0)                                Secure boot V1 is enabled for bootloader image     = False R/W (0b0)
ABS_DONE_1 (BLOCK0)                                Secure boot V2 is enabled for bootloader image     = False R/W (0b0)
DISABLE_DL_ENCRYPT (BLOCK0)                        Disable flash encryption in UART bootloader        = False R/W (0b0)
DISABLE_DL_DECRYPT (BLOCK0)                        Disable flash decryption in UART bootloader        = True R/W (0b1)
KEY_STATUS (BLOCK0)                                Usage of efuse block 3 (reserved)                  = False R/W (0b0)
SECURE_VERSION (BLOCK3)                            Secure version for anti-rollback                   = 0 R/W (0x00000000)
BLOCK1 (BLOCK1)                                    Flash encryption key
   = ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? -/-
BLOCK2 (BLOCK2)                                    Security boot key
   = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 R/W
BLOCK3 (BLOCK3)                                    Variable Block 3
   = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 R/W

Spi Pad fuses:
SPI_PAD_CONFIG_HD (BLOCK0)                         read for SPI_pad_config_hd                         = 0 R/W (0b00000)
SPI_PAD_CONFIG_CLK (BLOCK0)                        Override SD_CLK pad (GPIO6/SPICLK)                 = 0 R/W (0b00000)
SPI_PAD_CONFIG_Q (BLOCK0)                          Override SD_DATA_0 pad (GPIO7/SPIQ)                = 0 R/W (0b00000)
SPI_PAD_CONFIG_D (BLOCK0)                          Override SD_DATA_1 pad (GPIO8/SPID)                = 0 R/W (0b00000)
SPI_PAD_CONFIG_CS0 (BLOCK0)                        Override SD_CMD pad (GPIO11/SPICS0)                = 0 R/W (0b00000)

Vdd fuses:
XPD_SDIO_REG (BLOCK0)                              read for XPD_SDIO_REG                              = False R/W (0b0)
XPD_SDIO_TIEH (BLOCK0)                             If XPD_SDIO_FORCE & XPD_SDIO_REG                   = 1.8V R/W (0b0)
XPD_SDIO_FORCE (BLOCK0)                            Ignore MTDI pin (GPIO12) for VDD_SDIO on reset     = False R/W (0b0)

Flash voltage (VDD_SDIO) determined by GPIO12 on reset (High for 1.8V, Low/NC for 3.3V)
I am actually reading this document from Espressif : https://docs.espressif.com/projects/esp ... encryption

I didn't know very well about encryption but I think the issue here is the

Code: Select all

FLASH_CRYPT_CNT
bit set to 1 and not to 0.

I have checked the Security feature to see if I disabled the "Enable flash encryption on boot", then entered the

Code: Select all

 idf.py flash
and at last,

Code: Select all

idf.py efuse-burn FLASH_CRYPT_CNT
but it doesn't work very well, I got this error :

Code: Select all

Executing action: efuse-burn
ninja: error: unknown target 'efuse-burn'
command "efuse-burn" is not known to idf.py and is not a Ninja target
I am still working on this one, I'll let you know if I find the problem to this.

Tanguy
Posts: 10
Joined: Thu Dec 09, 2021 9:33 pm

Re: rst:0x10 (RTCWDT_RTC_RESET),boot:0x33 (SPI_FAST_FLASH_BOOT) invalid header: 0xbc5d02e9

Postby Tanguy » Mon Sep 30, 2024 11:08 am

So your problem is that your board has encryption enabled and you are loading unencrypted bootloader and app.

You can try disabling encryption by burning FLASH_CRYPT_CNT to the value 3 (it will have two bits sets -> even number-> encryption disabled).

try :

Code: Select all

espefuse.py -p COMx burn_efuse FLASH_CRYPT_CNT 3
then reflash module.

Yolnit
Posts: 7
Joined: Thu Jun 13, 2024 2:11 pm

Re: rst:0x10 (RTCWDT_RTC_RESET),boot:0x33 (SPI_FAST_FLASH_BOOT) invalid header: 0xbc5d02e9

Postby Yolnit » Mon Sep 30, 2024 12:05 pm

Thank Tanguy, that was the issue. I will continue to read the Espressif documentation to avoid other issues with encryption.

Just by curiosity, could I have flashed an encrypted bootloader instead of disable encryption? I think this is the first thing we have tried but it didn't worked... Do you have any idea?

Why the FLASH_CRYPT_CNT need an even number to disable the encryption?

Tanguy
Posts: 10
Joined: Thu Dec 09, 2021 9:33 pm

Re: rst:0x10 (RTCWDT_RTC_RESET),boot:0x33 (SPI_FAST_FLASH_BOOT) invalid header: 0xbc5d02e9

Postby Tanguy » Mon Sep 30, 2024 4:58 pm

Just by curiosity, could I have flashed an encrypted bootloader instead of disable encryption?
Yes. It failed because you tried with another project that had the development mode disabled.
After enabling encryption in menuconfig, you first use

Code: Select all

idf.py flash bootloader-flash
It will generate encryption key and burn it in efuse before flashing.
If release mode is selected in menuconfig, it will also burn DISABLE_DL_ENCRYPT eFuse and the firmware can not be reflashed (ever).
If instead developement mode is selected, you can alway reflash the firmware with

Code: Select all

idf.py encrypted-flash monitor
To anwser your question, if your project had encryption enabled with development mode AND your board was already encrypted with DISABLE_DL_ENCRYPT at 0 then it should have worked.


Why the FLASH_CRYPT_CNT need an even number to disable the encryption?
Note : an eFuse is an hardware bit that can only be set, never cleared. You can not set an eFuse to 0 if is 1.

The eFuse summary tip for FLASH_CRYPT_CNT is : Flash encryption is enabled if this field has an odd number of bits set.
Odd number of bit, not odd value. 0b0011101 (29 in decimal) means encryption is disabled.

To understand how it works :
If you flash you board again with a encrypted-enabled project it will automatically burn another fuse and it will set its value to 0b0000111.
If you want to flash an unencrypted project again, you can burn another fuse and set it to 0b0001111 value.
You can do that until you get 0b1111111 value then encryption will be permanently enabled because there is no way to set another eFuse.

Yolnit
Posts: 7
Joined: Thu Jun 13, 2024 2:11 pm

Re: rst:0x10 (RTCWDT_RTC_RESET),boot:0x33 (SPI_FAST_FLASH_BOOT) invalid header: 0xbc5d02e9

Postby Yolnit » Fri Oct 04, 2024 6:57 am

Hello Tanguy sorry for the late answer.

I understand now thank you so much for your help. I'll be more careful next time i work with encryption. :D

Wish you the best!

Corentin

Who is online

Users browsing this forum: Google [Bot] and 61 guests