ESP32-S3 partition 0 invalid magic number
Posted: Mon Jul 24, 2023 3:01 pm
Hi,
I'm trying to setup my ESP32-S3 devkit to test out flash encryption. I seem to be stuck at the 2nd stage bootloader, where it's spitting out this information.
Here are the steps I am taking:
1. espsecure.exe generate_flash_encryption_key --keylen 512 key.bin
2. espefuse.exe --port COM26 burn_key BLOCK_KEY0 key.bin XTS_AES_256_KEY
3. espefuse.exe --port COM26 burn_efuse SPI_BOOT_CRYPT_CNT
4. espsecure.exe encrypt_flash_data --aes_xts --keyfile key.bin --address 0x00000 --output bootloader-encrypted.bin bootloader.bin
5. espsecure.exe encrypt_flash_data --aes_xts --keyfile key.bin --address 0x80000 --output partitions-encrypted.bin partitions.bin
6. esptool.exe --chip esp32s3 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size detect 0x0 bootloader-encrypted.bin 0x10000 partitions-encrypted.bin
Here is my partition table
I've tried to increase the partition table offset from 0x8000 to 0x10000 (and modify partitions accordingly), but it does not seem to make any difference with respect to the boot error.
The online docs lists this as an example under "flash encryption>possible failures", but the description doesn't match my situation since I confirmed the partition table is indeed encrypted.
https://docs.espressif.com/projects/esp ... e-failures
Can someone give me any advice on how to get past this error?
I'm trying to setup my ESP32-S3 devkit to test out flash encryption. I seem to be stuck at the 2nd stage bootloader, where it's spitting out this information.
Code: Select all
Build:Mar 27 2021
rst:0x1 (POWERON),boot:0x8 (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3970,len:0x29a4
load:0x403c9700,len:0xbcc
load:0x403cc700,len:0x45bc
entry 0x403c9954
(36) boot: ESP-IDF 4.4.4 2nd stage bootloader
(37) boot: compile time 10:42:51
(37) boot: chip revision: v0.1
(38) boot_comm: chip revision: 1, min. bootloader chip revision: 0
(45) boot.esp32s3: Boot SPI Speed : 80MHz
(50) boot.esp32s3: SPI Mode : DIO
(55) boot.esp32s3: SPI Flash Size : 8MB
(60) boot: Enabling RNG early entropy source...
(65) flash_parts: partition 0 invalid magic number 0xbe09
(71) boot: Failed to verify partition table
(76) boot: load partition table error!
1. espsecure.exe generate_flash_encryption_key --keylen 512 key.bin
2. espefuse.exe --port COM26 burn_key BLOCK_KEY0 key.bin XTS_AES_256_KEY
3. espefuse.exe --port COM26 burn_efuse SPI_BOOT_CRYPT_CNT
4. espsecure.exe encrypt_flash_data --aes_xts --keyfile key.bin --address 0x00000 --output bootloader-encrypted.bin bootloader.bin
5. espsecure.exe encrypt_flash_data --aes_xts --keyfile key.bin --address 0x80000 --output partitions-encrypted.bin partitions.bin
6. esptool.exe --chip esp32s3 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size detect 0x0 bootloader-encrypted.bin 0x10000 partitions-encrypted.bin
Here is my partition table
Code: Select all
nvs, data, nvs, 0x9000, 0x5000,
otadata, data, ota, 0xe000, 0x2000,
factory, app, factory, 0x10000, 0x200000,
app0, app, ota_0, 0x210000,0x200000,
app1, app, ota_1, 0x410000,0x200000,
spiffs, data, spiffs, 0x610000,0x1df000, encrypted
nvs_key, data, nvs_keys,0x7ef000,0x1000, encrypted
coredump, data, coredump,0x7f0000,0x10000, encrypted
The online docs lists this as an example under "flash encryption>possible failures", but the description doesn't match my situation since I confirmed the partition table is indeed encrypted.
https://docs.espressif.com/projects/esp ... e-failures
Can someone give me any advice on how to get past this error?