Skip to content

Hybrid compile won't boot -> Cache disabled but cached memory region accessed (ESP32-WROOM-32UE-N16) #341

@qniens

Description

@qniens

PROBLEM DESCRIPTION

After compiling and and uploading the ESP32 won't boot and is in a crash loop.
Crash output:

ELF file SHA256: a26cc51a3

E (228) esp_core_dump_flash: Core dump flash config is corrupted! CRC=0x7bd5c66f instead of 0x0
E (237) esp_core_dump_elf: Elf write init failed!
E (241) esp_core_dump_common: Core dump write failed with error=-1
Rebooting...
ets Jul 29 2019 12:21:46

rst:0x3 (SW_RESET),boot:0x13 (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:DIO, clock div:2
load:0x3fff0030,len:4744
load:0x40078000,len:15712
load:0x40080400,len:3164
entry 0x4008059c
Guru Meditation Error: Core  0 panic'ed (Cache error). 
Cache disabled but cached memory region accessed

Core  0 register dump:
PC      : 0x400eeebc  PS      : 0x00060b35  A0      : 0x8008165a  A1      : 0x3ffe3ac0
A2      : 0x3ffbe760  A3      : 0x3ffe3b58  A4      : 0x00000000  A5      : 0x00000000  
A6      : 0x3ffe3ac0  A7      : 0x3ffe3ac4  A8      : 0x8008d891  A9      : 0x3ffe3ac0
A10     : 0x3ffe3ac4  A11     : 0x00000000  A12     : 0x0000001c  A13     : 0x00060923  
A14     : 0x00000001  A15     : 0x3ffb6c74  SAR     : 0x0000001f  EXCCAUSE: 0x00000007
EXCVADDR: 0x00000000  LBEG    : 0x400eeedc  LEND    : 0x400eeee7  LCOUNT  : 0x00000000  


Backtrace: 0x400eeeb9:0x3ffe3ac0 0x40081657:0x3ffe3b00 0x400f0f49:0x3ffe3b30 0x4008d145:0x3ffe3b50 0x400d5afb:0x3ffe3b80 0x400d5f3e:0x3ffe3be0 0x400d732b:0x3ffe3c00 0x400d736d:0x3ffe3c20 0x400d73ff:0x3ffe3c40 0x40081d5a:0x3ffe3c60 0x40079786:0x3ffe3c90 |<-CORRUPTED

TO REPRODUCE

Clean project folder. Remove the following folders (if present):

  • .dummy
  • .pio
  • managed_components
  • output
  • test
  • build

Remove the following files (if present):

  • .dummy
  • sdkconfig.defaults
  • sdkconfig.esp32doit-devkit-v1
  • sdkconfig.test
  • dependencies.lock
  • CMakeLists.txt

platformio.ini

[env:test]
platform =  https://github.com/pioarduino/platform-espressif32/releases/download/55.03.34/platform-espressif32.zip
framework = arduino
board = esp32doit-devkit-v1
monitor_speed = 115200
build_type = debug
build_flags = 
  -Wl,--print-memory-usage
  -D CORE_DEBUG_LEVEL=5

build_unflags =
  -DBOARD_HAS_PSRAM

custom_component_remove =
  espressif/esp_hosted
  espressif/esp_wifi_remote
  espressif/esp-dsp
  espressif/esp32-camera
  espressif/libsodium
  espressif/esp-modbus
  espressif/qrcode
  espressif/esp_insights
  espressif/esp_diag_data_store
  espressif/esp_diagnostics
  espressif/esp_rainmaker
  espressif/rmaker_common

custom_sdkconfig  = 
  CONFIG_ETH_IRAM_OPTIMIZATION=y

main.cpp

#include <Arduino.h>

void setup() {
    vTaskDelay(2000);
    log_d("Start");
}

uint32_t count = 0;
void loop() {
    log_d("Hello, World! Count: %u", count);
    count++;
    vTaskDelay(1000);
    if (count == 20) {
        log_d("Restarting now..."); // To see initialization logs again
        ESP.restart();
    }
}

Press upload. Compiler output (interesting part):
Processing test (platform: https://github.com/pioarduino/platform-espressif32/releases/download/55.03.34/platform-espressif32.zip; framework: arduino; board: esp32doit-devkit-v1)

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32doit-devkit-v1.html
PLATFORM: Espressif 32 (55.3.34) > DOIT ESP32 DEVKIT V1
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
 - contrib-piohome @ 3.4.4
 - framework-arduinoespressif32 @ 3.3.4
 - framework-arduinoespressif32-libs @ 5.5.0+sha.8410210c9a
 - framework-espidf @ 3.50501.0 (5.5.1)
 - tool-cmake @ 4.0.3
 - tool-esp-rom-elfs @ 2024.10.11
 - tool-esptoolpy @ 5.1.0
 - tool-mklittlefs @ 3.2.0
 - tool-ninja @ 1.13.1
 - tool-openocd-esp32 @ 2.1200.20250707 (12.0)
 - toolchain-xtensa-esp-elf @ 14.2.0+20250730
*** Compile Arduino IDF libs for test ***
*** "custom_component" is used to deselect managed idf components ***
[ComponentManager] Created backup of build file
[ComponentManager] Component not found: espressif/esp_hosted
[ComponentManager] Component not found: espressif/esp_wifi_remote
[ComponentManager] Component not found: espressif/esp-dsp
[ComponentManager] Component not found: espressif/esp32-camera
[ComponentManager] Component not found: espressif/libsodium
[ComponentManager] Component not found: espressif/esp-modbus
[ComponentManager] Component not found: espressif/qrcode
[ComponentManager] Component not found: espressif/esp_insights
[ComponentManager] Component not found: espressif/esp_diag_data_store
[ComponentManager] Component not found: espressif/esp_diagnostics
[ComponentManager] Component not found: espressif/esp_rainmaker
[ComponentManager] Component not found: espressif/rmaker_common
[ComponentManager] Session completed with 13 changes
*** Add "custom_sdkconfig" settings to IDF sdkconfig.defaults ***
Info: Independent frequency mode (< 80MHz): Flash=40m, PSRAM=40
Replace: CONFIG_ESPTOOLPY_FLASHFREQ_80M=y with: # CONFIG_ESPTOOLPY_FLASHFREQ_80M is not set
Replace: # CONFIG_ESPTOOLPY_FLASHFREQ_40M is not set with: CONFIG_ESPTOOLPY_FLASHFREQ_40M=y
Replace: # CONFIG_ESPTOOLPY_FLASHFREQ_26M is not set with: # CONFIG_ESPTOOLPY_FLASHFREQ_26M is not set
Replace: # CONFIG_ESPTOOLPY_FLASHFREQ_20M is not set with: # CONFIG_ESPTOOLPY_FLASHFREQ_20M is not set
Replace: CONFIG_ESPTOOLPY_FLASHFREQ="80m" with: CONFIG_ESPTOOLPY_FLASHFREQ="40m"
Replace: CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y with: CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
Replace: # CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set with: # CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set
Replace: # CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set with: # CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set
Replace: # CONFIG_ESPTOOLPY_FLASHSIZE_32MB is not set with: # CONFIG_ESPTOOLPY_FLASHSIZE_32MB is not set
Replace: # CONFIG_ESPTOOLPY_FLASHSIZE_64MB is not set with: # CONFIG_ESPTOOLPY_FLASHSIZE_64MB is not set
Replace: # CONFIG_ESPTOOLPY_FLASHSIZE_128MB is not set with: # CONFIG_ESPTOOLPY_FLASHSIZE_128MB is not set
Replace: CONFIG_ESPTOOLPY_FLASHSIZE="4MB" with: CONFIG_ESPTOOLPY_FLASHSIZE="4MB"
Replace: # CONFIG_ETH_IRAM_OPTIMIZATION is not set with: CONFIG_ETH_IRAM_OPTIMIZATION=y
Replace: CONFIG_SPIRAM=y with: # CONFIG_SPIRAM is not set
Replace: # CONFIG_SPIRAM_SPEED_40M is not set with: CONFIG_SPIRAM_SPEED_40M=y
Replace: CONFIG_SPIRAM_SPEED_80M=y with: # CONFIG_SPIRAM_SPEED_80M is not set
Replace: CONFIG_SPIRAM_SPEED=80 with: CONFIG_SPIRAM_SPEED=40
Replace: # CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_80 is not set with: # CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_80 is not set
Replace: CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_160=y with: # CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_160 is not set
Replace: # CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240 is not set with: CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y
Replace: CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ=160 with: CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ=240
Replace: # CONFIG_ESP32_DEFAULT_CPU_FREQ_80 is not set with: # CONFIG_ESP32_DEFAULT_CPU_FREQ_80 is not set
Replace: CONFIG_ESP32_DEFAULT_CPU_FREQ_160=y with: # CONFIG_ESP32_DEFAULT_CPU_FREQ_160 is not set
Replace: # CONFIG_ESP32_DEFAULT_CPU_FREQ_240 is not set with: CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y
Add: # CONFIG_ESPTOOLPY_FLASHFREQ_120M is not set
Add: # CONFIG_SPIRAM_SPEED_20M is not set
Add: # CONFIG_SPIRAM_SPEED_120M is not set
Add: # CONFIG_SPIRAM_SPEED_200M is not set
Reading CMake configuration...

Then lots of logs about compiling, ends with:

Linking .pio\build\test\firmware.elf
Firmware metrics can not be shown. Set the terminal codepage to "utf-8" or "cp65001" on Windows.
Retrieving maximum program size .pio\build\test\firmware.elf
Checking size .pio\build\test\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [=         ]   6.4% (used 21012 bytes from 327680 bytes)
Flash: [=         ]   7.4% (used 310397 bytes from 4194304 bytes)
*** Copied compiled esp32 IDF libraries to Arduino framework ***

It will then compile the project and uploads to board.

EXPECTED BEHAVIOUR

Simple test program should run

SCREENSHOTS

ADDITIONAL CONTEXT

ESP32 is an ESP32-WROOM-32UE-N16 (No PSRAM with ethernet)

(Please, remember to close the issue when the problem has been addressed)

Metadata

Metadata

Assignees

No one assigned

    Labels

    fix-pendingfix will be applied in new releasefixed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions