eefocus_4091809 发表于 2026-3-28 17:17:53

ESP32IDF5.5.3,使用OTA例程开启flash加密运行错误

使用ESPIDF5.5.3的native_ota_example例程,在menuconfig中启用 Enable flash encryption on boot (READ DOCS FIRST)                                                                                                                                                Enable usage mode (Development (NOT SECURE))--->
然后编译烧录idf.py build flash monitor

I (525) native_ota_example: SHA-256 for the partition table: : f11564b6b35236893a38c38eb7445b021e5cd924635d6aad89de872a0befb818
I (555) native_ota_example: SHA-256 for bootloader: : b3de7a1b7d6f189ccdc633ce0b8659719b220db863dde344bd095edf76797bd5
I (765) native_ota_example: SHA-256 for current firmware: : 70bac46683c47accc4d682abbace390e17271af0c712d6a05ca9c1959e340628
W (775) nvs: Failed to read NVS security cfg: (ESP_ERR_INVALID_ARG)
I (775) nvs: Generating NVS encr-keys...
E (775) nvs: Failed to generate NVS encr-keys: (ESP_ERR_INVALID_ARG)
ESP_ERROR_CHECK failed: esp_err_t 0x102 (ESP_ERR_INVALID_ARG) at 0x400d7d65
--- 0x400d7d65: app_main at C:/Users/Administrator/Desktop/encryption/native_ota_example/main/native_ota_example.c:332
下面是我的分区表

# Name,   Type, SubType, Offset,   Size,   Flags
nvs,      data, nvs,   0x10000,0x4000,
otadata,data, ota,   0x14000,0x2000,
phy_init, data, phy,   0x16000,0x1000,
nvs_key,data, nvs_keys,0x17000,0x1000,   encrypted
ota_0,    app,ota_0,   0x20000,0x180000,
ota_1,    app,ota_1,   0x1A0000, 0x17F000,

出现了这样的错误,有没有大佬在知道是为什么吗



a1a1a21 发表于 2026-4-21 11:31:26

关闭 NVS 加密(最稳、最适合 OTA 示例)
[*]进入:
[*]Component config → NVS → Enable NVS encryption

[*]把它关掉(取消勾选)
保存,然后 完全擦除 Flash 再烧录


[*]
idf.py erase-flash
idf.py build flash monitor



页: [1]
查看完整版本: ESP32IDF5.5.3,使用OTA例程开启flash加密运行错误