Core dump to flash problem (4.1 beta)

cpehonk
Posts: 17
Joined: Sat Nov 09, 2019 3:41 pm

Core dump to flash problem (4.1 beta)

Postby cpehonk » Sat Nov 09, 2019 3:50 pm

Hi all,
I have a serious problem getting core dump to flash to run on WEMOS LOLIN32 ESP32 board.
I'm using VisualGDB with 4.1Beta IDF and enabled core dump to flash in sdkconfig. That is what I am getting on the console after initiating a core dump (using devision by zero):

Guru Meditation Error: Core 0 panic'ed (Unhandled debug exception)
Debug exception reason: BREAK instr
Core 0 register dump:
PC : 0x400d7286 PS : 0x00060336 A0 : 0x800d5f6d A1 : 0x3ffbc860
A2 : 0x3ffcff84 A3 : 0x3ffb4904 A4 : 0x3ffbc970 A5 : 0x400d7286
A6 : 0x3ffb496f A7 : 0x00000001 A8 : 0x3f402854 A9 : 0x3ffbc7e0
A10 : 0x0000001f A11 : 0x3ffbc800 A12 : 0x0000001f A13 : 0x3ffbc880
A14 : 0x3ffbc860 A15 : 0x00000008 SAR : 0x00000008 EXCCAUSE: 0x00000001
EXCVADDR: 0x00000000 LBEG : 0x4000c349 LEND : 0x4000c36b LCOUNT : 0x00000000

ELF file SHA256: 3cf52017169b421a2e79d40b5d79a9f7b9f854e9b2e801b227e33f178228d5c0

Backtrace: 0x400d7283:0x3ffbc860 0x400d5f6a:0x3ffbc8a0 0x400d86c9:0x3ffbc960 0x400d870d:0x3ffbc9b0 0x400d52cc:0x3ffbc9d0 0x400d1f8a:0x3ffbca20

I (14598) esp_core_dump_flash: Save core dump to flash...
I (14603) esp_core_dump_common: Found tasks: (10)!
*r??P????,??m????-X???b&?n'nbf(???-?"??d?cbv#?%???f8?~??r?-?@%VF-?dN8|?t?X???'p?,P?w?t?,??-????P??'p?,P??'p?,P?X~?-jq?|?)?EX?H~t????,??????????r?+??*????l ????r??l???aj??n????l?j??v?,???@??(?????l?j??v?,??,?@??(?????l?j??v?,??,?@??(?????l?j??v?,??,?@??(?????l?j??v?,???@??(?????l?j??v?,??,?@??(?????l?j??v?,??,?@??(?????l?j??v?,??????(?????l?j??v?,???@??(?????l?j??v?,???@??(?????l?j??v?,??,?@??(?????l?j??v?,??,?@??(?????l?j??v?,??,?@??(?????l?j??v?,???@??(?????l?j??v?,??,?@??(?????l?j??v?,??????(?????l?j??v?,???@??(?"????l?j??v?,??,?@??(?????l?j??v?,??,?@??(?"????l?j??v?,??,?@??(?B????l?j??v?,???@??(?b????l?j??v?,??,?@??(?B????l?j??v?,??,?@??(?b????l?j??v?,??????(??????l?j??v?,???@??(??????l?j??v?,???@??(??*r??P????,??m????-X??(N?f?v?

This output never ends up. So, I tried to track down where the problem may arise. I added several ESP_COREDUMP_LOGI statements, which generated the following:
I (14609) esp_core_dump_common: tcb_sz_padded: (356)!
I (14615) esp_core_dump_common: Is task #0 valid: 1 (TCB)
I (14621) esp_core_dump_common: Is task #0 valid: 1 (stack dump len = 772)
I (14628) esp_core_dump_common: Is task #1 valid: 1 (TCB)
I (14634) esp_core_dump_common: Is task #1 valid: 1 (stack dump len = 396)
I (14642) esp_core_dump_common: Is task #2 valid: 1 (TCB)
I (14648) esp_core_dump_common: Is task #2 valid: 1 (stack dump len = 384)
I (14656) esp_core_dump_common: Is task #3 valid: 1 (TCB)
I (14662) esp_core_dump_common: Is task #3 valid: 1 (stack dump len = 452)
I (14669) esp_core_dump_common: Is task #4 valid: 1 (TCB)
I (14675) esp_core_dump_common: Is task #4 valid: 1 (stack dump len = 348)
I (14683) esp_core_dump_common: Is task #5 valid: 1 (TCB)
I (14689) esp_core_dump_common: Is task #5 valid: 1 (stack dump len = 464)
I (14696) esp_core_dump_common: Is task #6 valid: 1 (TCB)
I (14702) esp_core_dump_common: Is task #6 valid: 1 (stack dump len = 388)
I (14710) esp_core_dump_common: Is task #7 valid: 1 (TCB)
I (14716) esp_core_dump_common: Is task #7 valid: 1 (stack dump len = 412)
I (14724) esp_core_dump_common: Is task #8 valid: 1 (TCB)
I (14730) esp_core_dump_common: Is task #8 valid: 1 (stack dump len = 456)
I (14737) esp_core_dump_common: Is task #9 valid: 1 (TCB)
I (14743) esp_core_dump_common: Is task #9 valid: 1 (stack dump len = 392)
I (14751) esp_core_dump_common: Core dump len = 8160 (10 0)
I (14757) esp_core_dump_common: Write prepare defined: 0x40090648
I (14764) esp_core_dump_flash: Core dump flash len = 8164
I (14770) esp_core_dump_flash: Erased wr_data (0x3ffbc718, len = 8)
I (14777) esp_core_dump_flash: SPI flash erase, num of secs = 2 at $00290000
I (14785) esp_core_dump_flash: SPI flash erase done, err = $0
I (14791) esp_core_dump_common: Write start defined: 0x40090938
I (14798) esp_core_dump_common: Write header
I (14803) esp_core_dump_flash: flash_write_data, start = $00290000, offset = $0, len = 16
I (14812) esp_core_dump_flash: SPI flash write to $00290000, len = 16!

From my experience all spi_flash_xxx commands/API will result in undefined behaviour. First, I outcommented the "spi_flash_erase_range" call in "prepare", so I got further till "write data". But the "spi_flash_write" command (last LOG entry) which is executed after the LOG leads to the above shown output. Any hints ?
Btw. here is my partition table:
I (45) boot: Partition Table:
I (49) boot: ## Label Usage Type ST Offset Length
I (56) boot: 0 nvs WiFi data 01 02 00009000 00004000
I (64) boot: 1 nvs_key NVS keys 01 04 0000d000 00002000
I (71) boot: 2 otadata OTA data 01 00 0000f000 00002000
I (79) boot: 3 phy_init RF data 01 01 00011000 00001000
I (86) boot: 4 app0 OTA app 00 10 00020000 00100000
I (93) boot: 5 app1 OTA app 00 11 00120000 00100000
I (101) boot: 6 storage Unknown data 01 82 00220000 00070000
I (108) boot: 7 coredump Unknown data 01 03 00290000 00010000
I (116) boot: End of partition table

Any help appreciated !
Greetings
Chris

Who is online

Users browsing this forum: No registered users and 59 guests