esp-idf: No boot error with: memory_layout: SOC_RESERVE_MEMORY_REGION region range 0xfffffffc - 0x00000000 ov (IDFGH-403)
Environment
- Development Kit: [ESP32-Wrover-Kit]
- Kit version (for WroverKit/PicoKit/DevKitC): [?]
- Core (if using chip or module): []
- IDF version (
git rev-parse --short HEADto get the commit id.): 9ca30f6 - Development Env: [Make]
- Operating System: [MacOS]
- Power Supply: [USB]
Problem Description
Suddenly, my app does not boot anymore. I’ve reverted my changes and it still does not boot up. I get this output:
I (186) boot: ESP-IDF v3.2-dev-915-g6f58208 2nd stage bootloader
I (187) boot: compile time 07:12:15
I (187) boot: Enabling RNG early entropy source...
I (207) boot: SPI Speed : 40MHz
I (220) boot: SPI Mode : DIO
I (233) boot: SPI Flash Size : 4MB
I (246) boot: Partition Table:
I (257) boot: ## Label Usage Type ST Offset Length
I (279) boot: 0 nvs WiFi data 01 02 00009000 00004000
I (303) boot: 1 otadata OTA data 01 00 0000d000 00002000
I (326) boot: 2 phy_init RF data 01 01 0000f000 00001000
I (349) boot: 3 factory factory app 00 00 00010000 000f0000
I (372) boot: 4 ota_0 OTA app 00 10 00100000 00100000
I (396) boot: 5 ota_1 OTA app 00 11 00200000 00100000
I (419) boot: 6 storage Unknown data 01 82 00300000 00100000
I (443) boot: End of partition table
I (456) boot: Defaulting to factory image
I (470) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x1fffc (131068) map
I (773) esp_image: segment 1: paddr=0x00030024 vaddr=0x3ffbdb60 size=0x031ac ( 12716) load
I (803) esp_image: segment 2: paddr=0x000331d8 vaddr=0x3ffc0d0c size=0x00000 ( 0) load
I (805) esp_image: segment 3: paddr=0x000331e0 vaddr=0x40080000 size=0x00400 ( 1024) load
0x40080000: _WindowOverflow4 at /Users/cyril/esp/esp-idf/components/freertos/xtensa_vectors.S:1685
I (831) esp_image: segment 4: paddr=0x000335e8 vaddr=0x40080400 size=0x0ca28 ( 51752) load
I (981) esp_image: segment 5: paddr=0x00040018 vaddr=0x400d0018 size=0x82868 (534632) map
0x400d0018: _stext at ??:?
I (2103) esp_image: segment 6: paddr=0x000c2888 vaddr=0x4008ce28 size=0x02e00 ( 11776) load
0x4008ce28: vPortYield at /Users/cyril/esp/esp-idf/components/freertos/portasm.S:528
I (2133) esp_image: segment 7: paddr=0x000c5690 vaddr=0x400c0000 size=0x00000 ( 0) load
I (2135) esp_image: segment 8: paddr=0x000c5698 vaddr=0x50000200 size=0x00000 ( 0) load
I (2217) boot: Loaded app from partition at offset 0x10000
I (2217) boot: Disabling RNG early entropy source...
I (2221) cpu_start: Pro cpu up.
I (2230) cpu_start: Starting app cpu, entry point is 0x40081028
0x40081028: call_start_cpu1 at /Users/cyril/esp/esp-idf/components/esp32/cpu_start.c:228
I (1) cpu_start: App cpu up.
E (2263) memory_layout: SOC_RESERVE_MEMORY_REGION region range 0xfffffffc - 0x00000000 overlaps with 0xffffffff - 0xffffffff
abort() was called at PC 0x401157cb on core 0
0x401157cb: s_prepare_reserved_regions at /Users/cyril/esp/esp-idf/components/soc/src/memory_layout_utils.c:97
(inlined by) soc_get_available_memory_regions at /Users/cyril/esp/esp-idf/components/soc/src/memory_layout_utils.c:114
Backtrace: 0x4008db47:0x3ffe3550 0x4008ddb9:0x3ffe3570 0x401157cb:0x3ffe3590 0x400d2b11:0x3ffe38e0 0x40081192:0x3ffe3c60 0x400790f5:0x3ffe3c80 0x400794c9:0x3ffe3cc0 0x400807e6:0x3ffe3df0 0x40007c31:0x3ffe3eb0 0x4000073d:0x3ffe3f20
0x4008db47: invoke_abort at /Users/cyril/esp/esp-idf/components/esp32/panic.c:660
0x4008ddb9: abort at /Users/cyril/esp/esp-idf/components/esp32/panic.c:660
0x401157cb: s_prepare_reserved_regions at /Users/cyril/esp/esp-idf/components/soc/src/memory_layout_utils.c:97
(inlined by) soc_get_available_memory_regions at /Users/cyril/esp/esp-idf/components/soc/src/memory_layout_utils.c:114
0x400d2b11: heap_caps_init at /Users/cyril/esp/esp-idf/components/heap/heap_caps_init.c:65
0x40081192: call_start_cpu0 at /Users/cyril/esp/esp-idf/components/esp32/cpu_start.c:213
Looking at the code, I’m seeing this:
if (reserved[i].end > reserved[i+1].start) {
ESP_EARLY_LOGE(TAG, "SOC_RESERVE_MEMORY_REGION region range " \
"0x%08x - 0x%08x overlaps with 0x%08x - 0x%08x",
reserved[i].start, reserved[i].end, reserved[i+1].start,
reserved[i+1].end);
abort();
}
Since both reserved[i].end and start are int_ptr, the test above fails while end is 0 and (start is 0xFF.... thus negative).
The system does not boot.
Please notice that the application size fits the partition (partition is 900kB or so, while the app is 740kB), and make size returns:
Total sizes:
DRAM .data size: 12716 bytes
DRAM .bss size: 94848 bytes
Used static DRAM: 107564 bytes ( 17016 available, 86.3% used)
Used static IRAM: 64552 bytes ( 66520 available, 49.2% used)
Flash code: 534630 bytes
Flash rodata: 131068 bytes
Total image size:~ 742966 bytes (.bin may be padded larger)
Expected Behavior
The application should start
Actual Behavior
It does not (the CPU 0 does not start)
Steps to repropduce
I’ve no idea why this appeared suddenly. I’ve reverted my changes, make clean and make, yet it’s still there (while it worked perfectly before).
Other items if possible
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 25 (11 by maintainers)
@igrr I think this issue is because the psram vaddr overlaps with instruction address:
This can be reproduced when size of .flash.text is exactly 1~31 bytes under MMU_PAGE_SIZE boudary:
I solved this with below patch (and similar works for all chips):