I use spiffs in my project. I got error when added simple open-read function to app_main.
function:
- void data_load()
- {
- FILE *file;
- file = fopen("/spiffs/data/my_data", "rb");
- if(file == NULL)
- {
- printf("%s : Cant open file\n", __func__);
- return;
- }
- fread(&data_total.ID, sizeof(data_total.ID), 1, file); // size ID 2 bytes
- fread(&data_total.data, sizeof(data_total.data), 1, file); // size data is 4 bytes
- fclose(file);
- printf("data loaded: (%d)(%d) \n", data_total.ID, data_total.data);
- }
Where I should to dig?
Output:
Code: Select all
rst:0x1 (POWERON_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:0x3fff0018,len:4
load:0x3fff001c,len:5820
load:0x40078000,len:9020
ho 0 tail 12 room 4
load:0x40080000,len:6120
0x40080000: _WindowOverflow4 at C:/Projects/ESP32/TOOLS/esp-idf/components/freertos/xtensa_vectors.S:1685
entry 0x40080334
0x40080334: _KernelExceptionVector at ??:?
I (30) boot: ESP-IDF v3.1 2nd stage bootloader
I (30) boot: compile time 20:37:26
I (30) boot: Enabling RNG early entropy source...
I (34) boot: SPI Speed : 40MHz
I (38) boot: SPI Mode : DIO
I (42) boot: SPI Flash Size : 4MB
I (47) boot: Partition Table:
I (50) boot: ## Label Usage Type ST Offset Length
I (57) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (65) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (72) boot: 2 factory factory app 00 00 00010000 00100000
I (80) boot: 3 storage Unknown data 01 82 00180000 00200000
I (87) boot: End of partition table
I (91) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x2b1cc (176588) map
I (162) esp_image: segment 1: paddr=0x0003b1f4 vaddr=0x3ffc0000 size=0x0346c ( 13420) load
I (168) esp_image: segment 2: paddr=0x0003e668 vaddr=0x3ffc346c size=0x00000 ( 0) load
I (169) esp_image: segment 3: paddr=0x0003e670 vaddr=0x40080000 size=0x00400 ( 1024) load
0x40080000: _WindowOverflow4 at C:/Projects/ESP32/TOOLS/esp-idf/components/freertos/xtensa_vectors.S:1685
I (178) esp_image: segment 4: paddr=0x0003ea78 vaddr=0x40080400 size=0x01598 ( 5528) load
I (189) esp_image: segment 5: paddr=0x00040018 vaddr=0x400d0018 size=0x8c500 (574720) map
0x400d0018: _flash_cache_start at ??:?
I (397) esp_image: segment 6: paddr=0x000cc520 vaddr=0x40081998 size=0x1116c ( 69996) load
0x40081998: esp_intr_set_in_iram at C:/Projects/ESP32/TOOLS/esp-idf/components/esp32/intr_alloc.c:773
I (426) esp_image: segment 7: paddr=0x000dd694 vaddr=0x400c0000 size=0x00000 ( 0) load
I (427) esp_image: segment 8: paddr=0x000dd69c vaddr=0x50000000 size=0x00000 ( 0) load
I (444) boot: Loaded app from partition at offset 0x10000
I (444) boot: Disabling RNG early entropy source...
I (445) cpu_start: Pro cpu up.
I (448) cpu_start: Starting app cpu, entry point is 0x400810b0
0x400810b0: call_start_cpu1 at C:/Projects/ESP32/TOOLS/esp-idf/components/esp32/cpu_start.c:225
I (0) cpu_start: App cpu up.
I (459) heap_init: Initializing. RAM available for dynamic allocation:
I (466) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM
I (472) heap_init: At 3FFDBB30 len 000044D0 (17 KiB): DRAM
I (478) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (484) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (491) heap_init: At 40092B04 len 0000D4FC (53 KiB): IRAM
I (497) cpu_start: Pro cpu start user code
I (67) cpu_start: Starting scheduler on PRO CPU.
abort() was called at PC 0x4008106a on core 0
0x4008106a: start_cpu0_default at C:/Projects/ESP32/TOOLS/esp-idf/components/esp32/cpu_start.c:381 (discriminator 9)
Backtrace: 0x40090590:0x3ffe3bc0 0x40090733:0x3ffe3be0 0x4008106a:0x3ffe3c00 0x40081235:0x3ffe3c30 0x4007907f:0x3ffe3c50 0x400791
31:0x3ffe3c80 0x4007914f:0x3ffe3cc0 0x40079445:0x3ffe3ce0 0x40080359:0x3ffe3df0 0x40007c31:0x3ffe3eb0 0x4000073d:0x3ffe3f20
0x40090590: invoke_abort at C:/Projects/ESP32/TOOLS/esp-idf/components/esp32/panic.c:649
0x40090733: abort at C:/Projects/ESP32/TOOLS/esp-idf/components/esp32/panic.c:649
0x4008106a: start_cpu0_default at C:/Projects/ESP32/TOOLS/esp-idf/components/esp32/cpu_start.c:381 (discriminator 9)
0x40081235: call_start_cpu0 at C:/Projects/ESP32/TOOLS/esp-idf/components/esp32/cpu_start.c:213
0x40080359: _UserExceptionVector at ??:?
Also, when I commented it my app starts...
And when I added function for reading adc value, I got this cpu stop:
Code: Select all
rst:0x1 (POWERON_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:0x3fff0018,len:4
load:0x3fff001c,len:5820
load:0x40078000,len:9020
ho 0 tail 12 room 4
load:0x40080000,len:6120
0x40080000: _WindowOverflow4 at C:/Projects/ESP32/TOOLS/esp-idf/components/freer
tos/xtensa_vectors.S:1685
entry 0x40080334
0x40080334: _KernelExceptionVector at ??:?
I (30) boot: ESP-IDF v3.1 2nd stage bootloader
I (30) boot: compile time 21:28:59
I (30) boot: Enabling RNG early entropy source...
I (34) boot: SPI Speed : 40MHz
I (39) boot: SPI Mode : DIO
I (43) boot: SPI Flash Size : 4MB
I (47) boot: Partition Table:
I (50) boot: ## Label Usage Type ST Offset Length
I (57) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (65) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (72) boot: 2 factory factory app 00 00 00010000 00100000
I (80) boot: 3 storage Unknown data 01 82 00180000 00200000
I (87) boot: End of partition table
I (92) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x2b634 (177
716) map
I (163) esp_image: segment 1: paddr=0x0003b65c vaddr=0x3ffc0000 size=0x0346c ( 1
3420) load
I (168) esp_image: segment 2: paddr=0x0003ead0 vaddr=0x3ffc346c size=0x00000 (
0) load
I (169) esp_image: segment 3: paddr=0x0003ead8 vaddr=0x40080000 size=0x00400 (
1024) load
0x40080000: _WindowOverflow4 at C:/Projects/ESP32/TOOLS/esp-idf/components/freer
tos/xtensa_vectors.S:1685
I (179) esp_image: segment 4: paddr=0x0003eee0 vaddr=0x40080400 size=0x01130 (
4400) load
I (189) esp_image: segment 5: paddr=0x00040018 vaddr=0x400d0018 size=0x8dd50 (58
0944) map
0x400d0018: _flash_cache_start at ??:?
I (400) esp_image: segment 6: paddr=0x000cdd70 vaddr=0x40081530 size=0x115d4 ( 7
1124) load
0x40081530: esp_restart at C:/Projects/ESP32/TOOLS/esp-idf/components/esp32/syst
em_api.c:244
I (429) esp_image: segment 7: paddr=0x000df34c vaddr=0x400c0000 size=0x00000 (
0) load
I (430) esp_image: segment 8: paddr=0x000df354 vaddr=0x50000000 size=0x00000 (
0) load
I (447) boot: Loaded app from partition at offset 0x10000
I (447) boot: Disabling RNG early entropy source...
I (448) cpu_start: Pro cpu up.
I (451) cpu_start: Starting app cpu, entry point is 0x400810b0
0x400810b0: call_start_cpu1 at C:/Projects/ESP32/TOOLS/esp-idf/components/esp32/
cpu_start.c:225
I (0) cpu_start: App cpu up.
I (462) heap_init: Initializing. RAM available for dynamic allocation:
I (469) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM
I (475) heap_init: At 3FFDBB38 len 000044C8 (17 KiB): DRAM
I (481) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (487) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (494) heap_init: At 40092B04 len 0000D4FC (53 KiB): IRAM
I (500) cpu_start: Pro cpu start user code
assertion "res == pdTRUE" failed: file "C:/Projects/ESP32/TOOLS/esp-idf/componen
ts/esp32/cpu_start.c", line 378, function: start_cpu0_default
abort() was called at PC 0x400d6de3 on core 0
0x400d6de3: __assert_func at /Users/ivan/e/newlib_xtensa-2.2.0-bin/newlib_xtensa
-2.2.0/xtensa-esp32-elf/newlib/libc/stdlib/../../../.././newlib/libc/stdlib/asse
rt.c:63 (discriminator 8)
Backtrace: 0x40090590:0x3ffe3b90 0x40090733:0x3ffe3bb0 0x400d6de3:0x3ffe3bd0 0x4
0081052:0x3ffe3c00 0x40081235:0x3ffe3c30 0x4007907f:0x3ffe3c50 0x40079131:0x3ffe
3c80 0x4007914f:0x3ffe3cc0 0x40079445:0x3ffe3ce0 0x40080359:0x3ffe3df0 0x40007c3
1:0x3ffe3eb0 0x4000073d:0x3ffe3f20
0x40090590: invoke_abort at C:/Projects/ESP32/TOOLS/esp-idf/components/esp32/pan
ic.c:649
0x40090733: abort at C:/Projects/ESP32/TOOLS/esp-idf/components/esp32/panic.c:64
9
0x400d6de3: __assert_func at /Users/ivan/e/newlib_xtensa-2.2.0-bin/newlib_xtensa
-2.2.0/xtensa-esp32-elf/newlib/libc/stdlib/../../../.././newlib/libc/stdlib/asse
rt.c:63 (discriminator 8)
0x40081052: start_cpu0_default at C:/Projects/ESP32/TOOLS/esp-idf/components/esp
32/cpu_start.c:378 (discriminator 1)
0x40081235: call_start_cpu0 at C:/Projects/ESP32/TOOLS/esp-idf/components/esp32/
cpu_start.c:213
0x40080359: _UserExceptionVector at ??:?
I have never faced such problems with cpu stops (ussually, I get into app_main at least).
So what may be the issue? What should I look for?