Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OTA update with secure boot and flash encryption - guru meditation in esp_ota_set_boot_partition (IDFGH-14629) #15380

Open
3 tasks done
PetyM opened this issue Feb 12, 2025 · 1 comment
Labels
Status: Opened Issue is new Type: Bug bugs in IDF

Comments

@PetyM
Copy link

PetyM commented Feb 12, 2025

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

IDF version.

v5.4, v5.3.2, v5.2.3

Espressif SoC revision.

ESP32-D0WD-V3 (revision v3.0)

Operating System used.

Linux

How did you build your project?

VS Code IDE

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

None

Development Kit.

Custom board

Power Supply used.

USB

What is the expected behavior?

I am trying to achieve firmware update on device with secure boot and flash encryption enabled. Update data is sent to device from webserver. Device confirms sucessfull update to webserver and reboots to new version.

What is the actual behavior?

Update is sucessfully written to OTA partition, but guru meditation occurs in esp_ota_set_boot_partition. Device then restarts and boots to new version of firmware. As FW crashes update confirmation cannot be sent back to websever.

Steps to reproduce.

sdkconfig (sorry, I could not figure how to upload without adding .txt)
partitions.csv

Update is recieved from webserver here:

esp_err_t Protocols::UriHandlers::postWebUpdateHandler(httpd_req_t *req)
{
    constexpr size_t MAX_SIZE = 1024;
    static std::span<uint8_t, MAX_SIZE> dataBuffer = std::span<uint8_t, MAX_SIZE>(reinterpret_cast<uint8_t *>(heap_caps_malloc(MAX_SIZE, MALLOC_CAP_SPIRAM)), MAX_SIZE);
    size_t alredyReceivedDataLen = 0;
    int readBytes;
    auto updater = GlobalInstances::UpdaterInstance::instance().getPartialUpdater();

    allowCORS(req);
    setJSONResponse(req);
    if (!checkAuthentication(req))
    {
        return httpd_resp_send_err(req, HTTPD_401_UNAUTHORIZED, "{}");
    }

    while (req->content_len > alredyReceivedDataLen)
    {
        readBytes = httpd_req_recv(req, reinterpret_cast<char *>(dataBuffer.data()), dataBuffer.size_bytes());
        if (readBytes <= 0)
        {
            return httpd_resp_send_500(req);
        }
        if (!updater.WriteOTAChunk(dataBuffer.first(readBytes)))
        {
            updater.UpdateAbort();
            return httpd_resp_send_500(req);
        }
        alredyReceivedDataLen += readBytes;
    }

    ESP_LOGI(TAG, "Update received %ul bytes", alredyReceivedDataLen);
    httpd_resp_sendstr(req, "{}");
    
    if (!updater.finishUpdate())
    {
        return httpd_resp_send_500(req);
    }

    vTaskDelay(pdMS_TO_TICKS(100));
    updater.restartUpdated();

    return ESP_OK;
}

Updater methods implementation:

bool PartialUpdater::WriteOTAChunk(std::span<uint8_t> dataChunk)
{
    bool result;
    esp_err_t esp_result;

    if(!headerChecked && dataChunk.size_bytes() > OTA_HEADER_SIZE)
    {
        result = checkUpdateVersion(dataChunk);
        ETL_ASSERT_OR_RETURN_VALUE(result, ETL_ERROR_WITH_VALUE(Exceptions::MessageException,"Header check failed"),false);
        result = getUpdateOTAPartition();
        ETL_ASSERT_OR_RETURN_VALUE(result, ETL_ERROR_WITH_VALUE(Exceptions::MessageException,"Get free partition failed"),false);
        headerChecked = true;
        esp_result = esp_ota_begin(updatePartition,OTA_WITH_SEQUENTIAL_WRITES,&updateHandle);
        ETL_ASSERT_OR_RETURN_VALUE(esp_result == ESP_OK, ETL_ERROR_WITH_VALUE(Exceptions::MessageException,"Begin ota failed"),false);
    }
    if(headerChecked)
    {
        esp_result = esp_ota_write(updateHandle, dataChunk.data(), dataChunk.size_bytes());
        ETL_ASSERT_OR_RETURN_VALUE(esp_result == ESP_OK, ETL_ERROR_WITH_VALUE(Exceptions::MessageException,"OTA write failed"),false);
    }
    return true;
    
}

bool PartialUpdater::finishUpdate()
{
    esp_err_t esp_result;

    esp_result = esp_ota_end(updateHandle);
    ETL_ASSERT_OR_RETURN_VALUE(esp_result == ESP_OK, ETL_ERROR_WITH_VALUE(Exceptions::MessageException,"OTA invalid image"),false);
    esp_result = esp_ota_set_boot_partition(updatePartition);
    ETL_ASSERT_OR_RETURN_VALUE(esp_result == ESP_OK, ETL_ERROR_WITH_VALUE(Exceptions::MessageException,"Unable to set new boot partition"),false);
    return true;
}

void PartialUpdater::restartUpdated()
{
    esp_restart();
}

Debug Logs.

ets Jul 29 2019 12:21:46

rst:0x1 (POWERON_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:3, clock div:1
secure boot v2 enabled
secure boot verification succeeded
load:0x3fff00c0 len:0x3780
load:0x40078000 len:0x729c
load:0x40080400 len:0x4
--- 0x40080400: _init at ??:?

load:0x40080404 len:0x1124
entry 0x400806c4
I (56) boot: ESP-IDF v5.4 2nd stage bootloader
I (56) boot: Multicore bootloader
I (56) boot: chip revision: v3.0
I (56) qio_mode: Enabling default flash chip QIO
I (60) boot.esp32: SPI Speed      : 80MHz
I (64) boot.esp32: SPI Mode       : QIO
I (67) boot.esp32: SPI Flash Size : 8MB
I (71) boot: Enabling RNG early entropy source...
I (75) boot: Partition Table:
I (78) boot: ## Label            Usage          Type ST Offset   Length
I (84) boot:  0 service_page     WiFi data        01 02 0000f000 00002000
I (91) boot:  1 nvs              WiFi data        01 02 00011000 00050000
I (97) boot:  2 nvs_key          NVS keys         01 04 00061000 00005000
I (104) boot:  3 otadata          OTA data         01 00 00066000 00002000
I (110) boot:  4 ota_0            OTA app          00 10 00100000 00300000
I (117) boot:  5 ota_1            OTA app          00 11 00400000 00300000
I (123) boot:  6 fs               Unknown data     01 82 00700000 00100000
I (130) boot: End of partition table
I (134) esp_image: segment 0: paddr=00100020 vaddr=3f400020 size=6c52ch (443692) map
I (220) esp_image: segment 1: paddr=0016c554 vaddr=3ff80000 size=0001ch (    28) load
I (221) esp_image: segment 2: paddr=0016c578 vaddr=3ffb0000 size=02a40h ( 10816) load
I (227) esp_image: segment 3: paddr=0016efc0 vaddr=40080000 size=01058h (  4184) load
I (233) esp_image: segment 4: paddr=00170020 vaddr=400d0020 size=e2cb0h (928944) map
I (406) esp_image: segment 5: paddr=00252cd8 vaddr=40081058 size=1a39ch (107420) load
I (429) esp_image: segment 6: paddr=0026d07c vaddr=00000000 size=02f54h ( 12116) 
I (432) esp_image: Verifying image signature...
I (432) secure_boot_v2: Verifying with RSA-PSS...
I (438) secure_boot_v2: Signature verified successfully!
I (452) boot: Loaded app from partition at offset 0x100000
I (452) secure_boot_v2: enabling secure boot v2...
I (452) secure_boot_v2: secure boot v2 is already enabled, continuing..
I (457) boot: Checking flash encryption...
I (461) flash_encrypt: flash encryption is enabled (3 plaintext flashes left)
I (468) boot: Disabling RNG early entropy source...
I (485) quad_psram: This chip is ESP32-D0WD
I (485) esp_psram: Found 8MB PSRAM device
I (485) esp_psram: Speed: 80MHz
I (485) esp_psram: PSRAM initialized, cache is in low/high (2-core) mode.
W (492) esp_psram: Virtual address not enough for PSRAM, map as much as we can. 4MB is mapped
I (500) cpu_start: Multicore app
I (970) esp_psram: SPI SRAM memory test OK
I (978) cpu_start: Pro cpu start user code
I (978) cpu_start: cpu freq: 240000000 Hz
I (978) app_init: Application information:
I (978) app_init: Project name:     sev-2_0-fw
I (982) app_init: App version:      3.3.74
I (986) app_init: ELF file SHA256:  985c73612...
--- Warning: Checksum mismatch between flashed and built applications. Checksum of built application is 129cdf5ce1f4367a0d8e93dc6ec4ea045fa155b497470f3d574d7d90c240bb4c
I (990) app_init: ESP-IDF:          v5.4
I (994) efuse_init: Min chip rev:     v3.0
I (998) efuse_init: Max chip rev:     v3.99 
I (1002) efuse_init: Chip rev:         v3.0
I (1006) heap_init: Initializing. RAM available for dynamic allocation:
I (1012) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (1017) heap_init: At 3FFC0028 len 0001FFD8 (127 KiB): DRAM
I (1022) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (1028) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (1034) heap_init: At 4009B3F4 len 00004C0C (19 KiB): IRAM
I (1039) esp_psram: Adding pool of 4096K of PSRAM memory to heap allocator
I (1046) spi_flash: detected chip: gd
I (1049) spi_flash: flash io: qio
W (1052) flash_encrypt: Flash encryption mode is DEVELOPMENT (not secure)
I (1064) nvs_sec_provider: NVS Encryption - Registering Flash encryption-based scheme...
I (00:00:00.094) main_task: Started on CPU0
I (1092) esp_psram: Reserving pool of 32K of internal memory for DMA/internal allocations
I (00:00:00.105) main_task: Calling app_main()
I (00:00:00.112) MAIN: --------------------------------------------------------
I (00:00:00.114) MAIN: Version 3.3.74 started
I (00:00:00.118) MAIN: --------------------------------------------------------
I (00:00:00.213) nvs: NVS partition "nvs" is encrypted.
I (00:00:00.237) gpio: GPIO[36]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:3 
I (00:00:00.375) esp_eth.netif.netif_glue: 94:e6:86:0c:d3:cb
I (00:00:00.376) esp_eth.netif.netif_glue: ethernet attached to netif
I (00:00:01.374) gpio: GPIO[2]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (00:00:02.425) gpio: GPIO[35]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:1 
...
I (00:00:20.888) UPDATER: Project name sev-2_0-fw
I (00:00:20.889) UPDATER: Update version from webserver is 3.3.76
I (00:00:57.036) MAIN: free mem remaining 47823
I (00:05:35.939) URI_HANDLERS: Update received 1511424l bytes
I (00:05:35.961) esp_image: segment 0: paddr=00400020 vaddr=3f400020 size=6c0ech (442604) map
I (00:05:36.045) esp_image: segment 1: paddr=0046c114 vaddr=3ff80000 size=0001ch (    28) 
I (00:05:36.062) esp_image: segment 2: paddr=0046c138 vaddr=3ffb0000 size=029b8h ( 10680) 
I (00:05:36.089) esp_image: segment 3: paddr=0046eaf8 vaddr=40080000 size=01520h (  5408) 
I (00:05:36.114) esp_image: segment 4: paddr=00470020 vaddr=400d0020 size=e2194h (926100) map
I (00:05:36.258) esp_image: segment 5: paddr=005521bc vaddr=40081520 size=19ed4h (106196) 
I (00:05:36.288) esp_image: segment 6: paddr=0056c098 vaddr=00000000 size=03f38h ( 16184) 
I (00:05:36.318) esp_image: Verifying image signature...
I (00:05:36.340) secure_boot_v2: Take trusted digest key(s) from eFuse block(s)
I (00:05:36.341) secure_boot_v2: #0 app key digest == #0 trusted key digest
I (00:05:36.343) secure_boot_v2: Verifying with RSA-PSS...
I (00:05:36.506) secure_boot_v2_rsa: Signature verified successfully!
I (00:05:36.525) esp_image: segment 0: paddr=00400020 vaddr=3f400020 size=6c0ech (442604) map
I (00:05:36.600) esp_image: segment 1: paddr=0046c114 vaddr=3ff80000 size=0001ch (    28) 
I (00:05:36.611) esp_image: segment 2: paddr=0046c138 vaddr=3ffb0000 size=029b8h ( 10680) 
I (00:05:36.624) esp_image: segment 3: paddr=0046eaf8 vaddr=40080000 size=01520h (  5408) 
I (00:05:36.645) esp_image: segment 4: paddr=00470020 vaddr=400d0020 size=e2194h (926100) map
I (00:05:36.790) esp_image: segment 5: paddr=005521bc vaddr=40081520 size=19ed4h (106196) 
I (00:05:36.817) esp_image: segment 6: paddr=0056c098 vaddr=00000000 size=03f38h ( 16184) 
I (00:05:36.835) esp_image: Verifying image signature...
I (00:05:36.846) secure_boot_v2: Take trusted digest key(s) from eFuse block(s)
I (00:05:36.848) secure_boot_v2: #0 app key digest == #0 trusted key digest
I (00:05:36.850) secure_boot_v2: Verifying with RSA-PSS...
I (00:05:36.993) secure_boot_v2_rsa: Signature verified successfully!
Guru Meditation Error: Core  1 panic'ed (Cache disabled but cached memory region accessed). 

Core  1 register dump:
PC      : 0x4014c7b8  PS      : 0x00060134  A0      : 0x80086f5c  A1      : 0x3ffeed20  
--- 0x4014c7b8: esp_task_wdt_print_triggered_tasks at /COMPONENT_ESP_SYSTEM_DIR/task_wdt/task_wdt.c:814 (discriminator 1)

A2      : 0x00000000  A3      : 0x00067000  A4      : 0x3ffeed7c  A5      : 0x00000020  
A6      : 0x3ffeed3c  A7      : 0x3ffb2b98  A8      : 0x80086eec  A9      : 0x00800000  
A10     : 0x00060000  A11     : 0x00007020  A12     : 0x00000000  A13     : 0x3ffeed34  
A14     : 0x3ffeed38  A15     : 0x3ffb2b98  SAR     : 0x00000008  EXCCAUSE: 0x00000007  
EXCVADDR: 0x00000000  LBEG    : 0x4000c2e0  LEND    : 0x4000c2f6  LCOUNT  : 0xffffffff  
--- 0x4000c2e0: memcpy in ROM
0x4000c2f6: memcpy in ROM



Backtrace: 0x4014c7b5:0x3ffeed20 0x40086f59:0x3ffeed60 0x40087373:0x3ffeede0 0x4014a161:0x3ffeee90 0x4014922f:0x3ffeeec0 0x401496f1:0x3ffeeef0 0x400e7908:0x3ffeef70 0x4012ac72:0x3ffeefa0 0x40168e97:0x3ffeeff0 0x401674b0:0x3ffef040 0x40168090:0x3ffef0f0 0x40166378:0x3ffef120 0x401678da:0x3ffef150 0x401665df:0x3ffef180
--- 0x4014c7b5: esp_task_wdt_print_triggered_tasks at /COMPONENT_ESP_SYSTEM_DIR/task_wdt/task_wdt.c:814 (discriminator 1)
0x40086f59: s_verify_write at /COMPONENT_SPI_FLASH_DIR/esp_flash_api.c:976
0x40087373: esp_flash_write_encrypted at /COMPONENT_SPI_FLASH_DIR/esp_flash_api.c:1380
0x4014a161: process_checksum at /COMPONENT_BOOTLOADER_SUPPORT_DIR/src/esp_image_format.c:953
0x4014922f: load_partitions at /COMPONENT_ESP_PARTITION_DIR/partition.c:208 (discriminator 3)
 (inlined by) ensure_partitions_loaded at /COMPONENT_ESP_PARTITION_DIR/partition.c:271 (discriminator 3)
0x401496f1: esp_partition_erase_range at /COMPONENT_ESP_PARTITION_DIR/partition_target.c:130
0x400e7908: BaseResult<(ErrorTypes)2>::isOk() const at /COMPONENT_RESULT_DIR/include/base_result.hpp:17
0x4012ac72: etl::imap<std::basic_string_view<char, std::char_traits<char> >, std::function<bool (Settings::RoiSettings&, ArduinoJson::V730HB24::JsonVariantConst)>, etl::less<std::basic_string_view<char, std::char_traits<char> > > >::insert_node(etl::map_base::Node*&, etl::imap<std::basic_string_view<char, std::char_traits<char> >, std::function<bool (Settings::RoiSettings&, ArduinoJson::V730HB24::JsonVariantConst)>, etl::less<std::basic_string_view<char, std::char_traits<char> > > >::Data_Node&) at /IDF_BUILD/_deps/etl-src/include/etl/map.h:2018
 (inlined by) etl::imap<std::basic_string_view<char, std::char_traits<char> >, std::function<bool (Settings::RoiSettings&, ArduinoJson::V730HB24::JsonVariantConst)>, etl::less<std::basic_string_view<char, std::char_traits<char> > > >::insert(std::pair<std::basic_string_view<char, std::char_traits<char> > const, std::function<bool (Settings::RoiSettings&, ArduinoJson::V730HB24::JsonVariantConst)> > const&) at /IDF_BUILD/_deps/etl-src/include/etl/map.h:1219
 (inlined by) void etl::imap<std::basic_string_view<char, std::char_traits<char> >, std::function<bool (Settings::RoiSettings&, ArduinoJson::V730HB24::JsonVariantConst)>, etl::less<std::basic_string_view<char, std::char_traits<char> > > >::insert<std::pair<std::basic_string_view<char, std::char_traits<char> > const, std::function<bool (Settings::RoiSettings&, ArduinoJson::V730HB24::JsonVariantConst)> > const*>(std::pair<std::basic_string_view<char, std::char_traits<char> > const, std::function<bool (Settings::RoiSettings&, ArduinoJson::V730HB24::JsonVariantConst)> > const*, std::pair<std::basic_string_view<char, std::char_traits<char> > const, std::function<bool (Settings::RoiSettings&, ArduinoJson::V730HB24::JsonVariantConst)> > const*) at /IDF_BUILD/_deps/etl-src/include/etl/map.h:1312
 (inlined by) void etl::imap<std::basic_string_view<char, std::char_traits<char> >, std::function<bool (Settings::RoiSettings&, ArduinoJson::V730HB24::JsonVariantConst)>, etl::less<std::basic_string_view<char, std::char_traits<char> > > >::assign<std::pair<std::basic_string_view<char, std::char_traits<char> > const, std::function<bool (Settings::RoiSettings&, ArduinoJson::V730HB24::JsonVariantConst)> > const*>(std::pair<std::basic_string_view<char, std::char_traits<char> > const, std::function<bool (Settings::RoiSettings&, ArduinoJson::V730HB24::JsonVariantConst)> > const*, std::pair<std::basic_string_view<char, std::char_traits<char> > const, std::function<bool (Settings::RoiSettings&, ArduinoJson::V730HB24::JsonVariantConst)> > const*) at /IDF_BUILD/_deps/etl-src/include/etl/map.h:1047
 (inlined by) etl::map<std::basic_string_view<char, std::char_traits<char> >, std::function<bool (Settings::RoiSettings&, ArduinoJson::V730HB24::JsonVariantConst)>, 1u, etl::less<std::basic_string_view<char, std::char_traits<char> > > >::map(std::initializer_list<std::pair<std::basic_string_view<char, std::char_traits<char> > const, std::function<bool (Settings::RoiSettings&, ArduinoJson::V730HB24::JsonVariantConst)> > >) at /IDF_BUILD/_deps/etl-src/include/etl/map.h:2736
0x40168e97: httpd_ws_get_frame_type at /COMPONENT_ESP_HTTP_SERVER_DIR/src/httpd_ws.c:450 (discriminator 1)
0x401674b0: httpd_sess_enum at /COMPONENT_ESP_HTTP_SERVER_DIR/src/httpd_sess.c:50 (discriminator 1)
 (inlined by) httpd_sess_get_free at /COMPONENT_ESP_HTTP_SERVER_DIR/src/httpd_sess.c:160 (discriminator 1)
 (inlined by) httpd_sess_new at /COMPONENT_ESP_HTTP_SERVER_DIR/src/httpd_sess.c:198 (discriminator 1)
0x40168090: httpd_find_uri_handler at /COMPONENT_ESP_HTTP_SERVER_DIR/src/httpd_uri.c:106 (discriminator 1)
0x40166378: verify_url at /COMPONENT_ESP_HTTP_SERVER_DIR/src/httpd_parse.c:59
0x401678da: httpd_sess_set_send_override at /COMPONENT_ESP_HTTP_SERVER_DIR/src/httpd_txrx.c:20
0x401665df: cb_on_body at /COMPONENT_ESP_HTTP_SERVER_DIR/src/httpd_parse.c:419 (discriminator 1)





ELF file SHA256: 985c73612
--- Warning: Checksum mismatch between flashed and built applications. Checksum of built application is 129cdf5ce1f4367a0d8e93dc6ec4ea045fa155b497470f3d574d7d90c240bb4c

Rebooting...
ets Jul 29 2019 12:21:46

rst:0x3 (SW_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:3, clock div:1
secure boot v2 enabled
secure boot verification succeeded
load:0x3fff00c0 len:0x3780
load:0x40078000 len:0x729c
load:0x40080400 len:0x4
--- 0x40080400: _init at ??:?

load:0x40080404 len:0x1124
entry 0x400806c4
I (55) boot: ESP-IDF v5.4 2nd stage bootloader
I (55) boot: Multicore bootloader
I (55) boot: chip revision: v3.0
I (55) qio_mode: Enabling default flash chip QIO
I (59) boot.esp32: SPI Speed      : 80MHz
I (63) boot.esp32: SPI Mode       : QIO
I (67) boot.esp32: SPI Flash Size : 8MB
I (70) boot: Enabling RNG early entropy source...
I (75) boot: Partition Table:
I (77) boot: ## Label            Usage          Type ST Offset   Length
I (84) boot:  0 service_page     WiFi data        01 02 0000f000 00002000
I (90) boot:  1 nvs              WiFi data        01 02 00011000 00050000
I (97) boot:  2 nvs_key          NVS keys         01 04 00061000 00005000
I (103) boot:  3 otadata          OTA data         01 00 00066000 00002000
I (110) boot:  4 ota_0            OTA app          00 10 00100000 00300000
I (116) boot:  5 ota_1            OTA app          00 11 00400000 00300000
I (123) boot:  6 fs               Unknown data     01 82 00700000 00100000
I (130) boot: End of partition table
I (151) esp_image: segment 0: paddr=00400020 vaddr=3f400020 size=6c0ech (442604) map
I (231) esp_image: segment 1: paddr=0046c114 vaddr=3ff80000 size=0001ch (    28) load
I (231) esp_image: segment 2: paddr=0046c138 vaddr=3ffb0000 size=029b8h ( 10680) load
I (237) esp_image: segment 3: paddr=0046eaf8 vaddr=40080000 size=01520h (  5408) load
I (244) esp_image: segment 4: paddr=00470020 vaddr=400d0020 size=e2194h (926100) map
I (416) esp_image: segment 5: paddr=005521bc vaddr=40081520 size=19ed4h (106196) load
I (439) esp_image: segment 6: paddr=0056c098 vaddr=00000000 size=03f38h ( 16184) 
I (442) esp_image: Verifying image signature...
I (443) secure_boot_v2: Verifying with RSA-PSS...
I (448) secure_boot_v2: Signature verified successfully!
I (461) boot: Loaded app from partition at offset 0x400000
I (462) secure_boot_v2: enabling secure boot v2...
I (462) secure_boot_v2: secure boot v2 is already enabled, continuing..
I (467) boot: Checking flash encryption...
I (471) flash_encrypt: flash encryption is enabled (3 plaintext flashes left)
I (478) boot: Disabling RNG early entropy source...
I (494) quad_psram: This chip is ESP32-D0WD
I (495) esp_psram: Found 8MB PSRAM device
I (495) esp_psram: Speed: 80MHz
I (495) esp_psram: PSRAM initialized, cache is in low/high (2-core) mode.
W (502) esp_psram: Virtual address not enough for PSRAM, map as much as we can. 4MB is mapped
I (510) cpu_start: Multicore app
I (980) esp_psram: SPI SRAM memory test OK
I (988) cpu_start: Pro cpu start user code
I (988) cpu_start: cpu freq: 240000000 Hz
I (988) app_init: Application information:
I (988) app_init: Project name:     sev-2_0-fw
I (992) app_init: App version:      3.3.76
I (996) app_init: ELF file SHA256:  129cdf5ce...
I (1000) app_init: ESP-IDF:          v5.4
I (1004) efuse_init: Min chip rev:     v3.0
I (1008) efuse_init: Max chip rev:     v3.99 
I (1012) efuse_init: Chip rev:         v3.0
I (1016) heap_init: Initializing. RAM available for dynamic allocation:
I (1022) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (1027) heap_init: At 3FFBFF38 len 000200C8 (128 KiB): DRAM
I (1033) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (1038) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (1044) heap_init: At 4009B3F4 len 00004C0C (19 KiB): IRAM
I (1049) esp_psram: Adding pool of 4096K of PSRAM memory to heap allocator
I (1056) spi_flash: detected chip: gd
I (1059) spi_flash: flash io: qio
W (1062) flash_encrypt: Flash encryption mode is DEVELOPMENT (not secure)
I (1074) nvs_sec_provider: NVS Encryption - Registering Flash encryption-based scheme...
I (00:05:37.073) main_task: Started on CPU0
I (1102) esp_psram: Reserving pool of 32K of internal memory for DMA/internal allocations
I (00:05:37.084) main_task: Calling app_main()
I (00:05:37.091) MAIN: --------------------------------------------------------
I (00:05:37.093) MAIN: Version 3.3.76 started
I (00:05:37.097) MAIN: --------------------------------------------------------
I (00:05:37.192) nvs: NVS partition "nvs" is encrypted.

More Information.

No response

@PetyM PetyM added the Type: Bug bugs in IDF label Feb 12, 2025
@github-actions github-actions bot changed the title OTA update with secure boot and flash encryption - guru meditation in esp_ota_set_boot_partition OTA update with secure boot and flash encryption - guru meditation in esp_ota_set_boot_partition (IDFGH-14629) Feb 12, 2025
@espressif-bot espressif-bot added the Status: Opened Issue is new label Feb 12, 2025
@mahavirj
Copy link
Member

@PetyM

Could you please try increasing ESP_TASK_WDT_TIMEOUT_S from current 5 sec to say 10 sec? I suspect an issue with task watchdog timeout (reference) here and corresponding handler getting invoked whilst the cache is disabled (flash program operation is on-going).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Opened Issue is new Type: Bug bugs in IDF
Projects
None yet
Development

No branches or pull requests

3 participants