Closed ThanosSiopoudis closed 2 years ago
@ThanosSiopoudis
Can you please confirm behavior with SPIRAM disabled, do you still observe same issue? I suspect this could be related to https://github.com/espressif/esp-idf/issues/9244#issuecomment-1174702372
@mahavirj Sure, I'll give it a go and I'll let you know.
Do you think this could also be affecting OTA updates? I have code that works without flash encryption, updating the app partitions, and once I try it on a flash encrypted device it bricks it with error invalid header: 0x6e951e03
I can confirm that both NVS and OTA updates work with SPIRAM disabled. Are there any workarounds?
Are there any workarounds?
Not yet. We are working on this, will keep you posted. CC @ginkgm
Ok, thanks. I can reliably reproduce the OTA update issue, so I can share code if it's helpful.
I'm doing the OTA update through an AES encrypted binary from an sd card, and it fails after 1000-1500 bytes written to flash through esp_ota_write
there's a very random panic thrown which is different every time.
This results in a reboot and corrupts the bootloader, bricking the device (recoverable if flashed through development mode). The same code works fine with either flash encryption disabled + PSRAM enabled, or flash encryption enabled + PSRAM disabled.
Please let me know if you prefer I open a new issue with logs and example code for this, unless it's confirmed it's related to the NVS issue.
@ThanosSiopoudis Could you try my workaround at https://github.com/espressif/esp-idf/issues/9244#issuecomment-1178005775?
Hi guys, you can pick the commit https://github.com/espressif/esp-idf/commit/8538153616af1b651af990c69ebc1b4cb2835c53 to solve this issue
Environment
git describe --tags
to find it): v5.0-dev-3654-gc2ccc383daxtensa-esp32-elf-gcc --version
to find it): xtensa-esp32-elf-gcc (crosstool-NG esp-2022r1-RC1) 11.2.0Problem Description
I tried using Secure Boot V2 + Flash encryption on my module with Release mode. While everything works as expected, and the device boots fine after the first reset once encryption is complete, on subsequent boots NVS encryption fails with
ESP_ERR_NVS_CORRUPT_KEY_PART
. The keys are generated from within the ESP32S3 deviceExpected Behavior
NVS encryption should not return
ESP_ERR_NVS_CORRUPT_KEY_PART
once it has generated the keysActual Behavior
ESP_ERR_NVS_CORRUPT_KEY_PART
thrown after the second device bootSteps to reproduce
menuconfig
ESP_ERR_NVS_CORRUPT_KEY_PART
afternvs_flash_init
Partition table
Code to reproduce this issue
// If your code is longer than 30 lines, GIST is preferred.
Debug Logs
Other items if possible
sdkconfig.zip