esp32-opencv icon indicating copy to clipboard operation
esp32-opencv copied to clipboard

***ERROR*** A stack overflow in task main has been detected.

Open farhanjaa opened this issue 2 years ago • 4 comments

hi joachim Burket i want to use opencv library in esp32 but when i compile hello_opencv example i have this problem

entry 0x400806ac I (27) boot: ESP-IDF v5.0-dev-2332-ge498209ed2 2nd stage bootloader I (27) boot: compile time 00:34:14 I (27) boot: chip revision: 1 I (31) boot_comm: chip revision: 1, min. bootloader chip revision: 0 I (39) boot.esp32: SPI Speed : 40MHz I (43) boot.esp32: SPI Mode : DIO I (48) boot.esp32: SPI Flash Size : 4MB I (52) boot: Enabling RNG early entropy source... I (58) boot: Partition Table: I (61) boot: ## Label Usage Type ST Offset Length I (69) boot: 0 nvs WiFi data 01 02 00081000 00006000 I (76) boot: 1 phy_init RF data 01 01 00087000 00001000 I (83) boot: 2 factory factory app 00 00 00090000 00177000 I (91) boot: End of partition table I (95) boot_comm: chip revision: 1, min. application chip revision: 0 I (102) esp_image: segment 0: paddr=00090020 vaddr=3f400020 size=3c2b8h (246456) map I (196) esp_image: segment 1: paddr=000cc2e0 vaddr=3ffb0000 size=03d38h ( 15672) load I (202) esp_image: segment 2: paddr=000d0020 vaddr=400d0020 size=c3b68h (801640) map I (479) esp_image: segment 3: paddr=00193b90 vaddr=3ffb3d38 size=0127ch ( 4732) load I (481) esp_image: segment 4: paddr=00194e14 vaddr=40080000 size=0a150h ( 41296) load I (501) esp_image: segment 5: paddr=0019ef6c vaddr=50000000 size=00010h ( 16) load I (507) boot: Loaded app from partition at offset 0x90000 I (507) boot: Disabling RNG early entropy source... I (521) cpu_start: Pro cpu up. I (521) cpu_start: Starting app cpu, entry point is 0x40081134 0x40081134: call_start_cpu1 at /home/farhanisixi/esp/esp-idf/components/esp_system/port/cpu_start.c:152

I (508) cpu_start: App cpu up. I (536) cpu_start: Pro cpu start user code I (536) cpu_start: cpu freq: 160000000 Hz I (536) cpu_start: Application information: I (541) cpu_start: Project name: hello_opencv I (546) cpu_start: App version: 1 I (550) cpu_start: Compile time: Apr 8 2022 00:34:28 I (557) cpu_start: ELF file SHA256: f13dd3463082c66e... I (563) cpu_start: ESP-IDF: v5.0-dev-2332-ge498209ed2 I (569) heap_init: Initializing. RAM available for dynamic allocation: I (576) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM I (582) heap_init: At 3FFB83B0 len 00027C50 (159 KiB): DRAM I (589) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM I (595) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM I (601) heap_init: At 4008A150 len 00015EB0 (87 KiB): IRAM I (609) spi_flash: detected chip: generic I (612) spi_flash: flash io: dio I (623) cpu_start: Starting scheduler on PRO CPU. I (0) cpu_start: Starting scheduler on APP CPU. I (627) hello_opencv: Starting main

M1 = [ 0, 0, 255, 0, 0, 255; 0, 0, 255, 0, 0, 255]

M2 = [ 0, 0, 111, 0, 0, 111; 0, 0, 111, 0, 0, 111]

eye = [0.1, 0, 0, 0, 0, 0, 0, 0, 0, 0; 0, 0.1, 0, 0, 0, 0, 0, 0, 0, 0; 0, 0, 0.1, 0, 0, 0, 0, 0, 0, 0; 0, 0, 0, 0.1, 0, 0, 0, 0, 0, 0; 0, 0, 0, 0, 0.1, 0, 0, 0, 0, 0; 0, 0, 0, 0, 0, 0.1, 0, 0, 0, 0; 0, 0, 0, 0, 0, 0, 0.1, 0, 0, 0; 0, 0, 0, 0, 0, 0, 0, 0.1, 0, 0; 0, 0, 0, 0, 0, 0, 0, 0, 0.1, 0; 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.1]

ones = [ 3, 3, 3, 3; 3, 3, 3, 3; 3, 3, 3, 3; 3, 3, 3, 3; 3, 3, 3, 3; 3, 3, 3, 3; 3, 3, 3, 3; 3, 3, 3, 3; 3, 3, 3, 3; 3, 3, 3, 3; 3, 3, 3, 3; 3, 3, 3, 3; 3, 3, 3, 3; 3, 3, 3, 3; 3, 3, 3, 3]

floats vector = [3.1415927; 2; 3.01]

Gray matrix = [ 1, 2, 3, 4, 5; 6, 7, 8, 9, 10; 11, 12, 13, 14, 15]

Thresholded matrix = [ 0, 0, 0, 0, 0; 0, 0, 255, 255, 255; 255, 255, 255, 255, 255]

Resized matrix = [ 2, 3, 4, 6; 9, 10, 11, 13]

ERROR A stack overflow in task main has been detected.

Backtrace:0x40081b8a:0x3ffbb7e00x40084c35:0x3ffbb800 0x40087386:0x3ffbb820 0x40086219:0x3ffbb8a0 0x40084d34:0x3ffbb8d0 0x40084ce6:0x00000004 |<-CORRUPTED 0x40081b8a: panic_abort at /home/farhanisixi/esp/esp-idf/components/esp_system/panic.c:409

0x40084c35: esp_system_abort at /home/farhanisixi/esp/esp-idf/components/esp_system/esp_system.c:135

0x40087386: vApplicationStackOverflowHook at /home/farhanisixi/esp/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:378

0x40086219: vTaskSwitchContext at /home/farhanisixi/esp/esp-idf/components/freertos/FreeRTOS-Kernel/tasks.c:3511

0x40084d34: _frxt_dispatch at /home/farhanisixi/esp/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/portasm.S:433

0x40084ce6: _frxt_int_exit at /home/farhanisixi/esp/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/portasm.S:228

farhanjaa avatar Apr 07 '22 18:04 farhanjaa

hi farhanjaa, i met this problem too.Have you solved this problem now?

binyiWang avatar Aug 08 '22 06:08 binyiWang

Hi! I'm experiencing the same problem... Did someone managed to fix that?

AdarWa avatar Dec 05 '22 17:12 AdarWa

Try increasing the stack size? Similar to https://github.com/joachimBurket/esp32-opencv/issues/12#issuecomment-1438339987

jimwormold avatar Feb 28 '23 12:02 jimwormold

$ vi sdkconfig

CONFIG_ESP_MAIN_TASK_STACK_SIZE=3584 ---> change this value

nopnop2002 avatar Jan 20 '24 09:01 nopnop2002