vApplicationStackOverflowHook with custom partitioning and 4MB flash size

neel_basu
Posts: 6
Joined: Sat Jan 18, 2020 7:41 pm

vApplicationStackOverflowHook with custom partitioning and 4MB flash size

Postby neel_basu » Sat Jan 18, 2020 7:51 pm

I am trying to create custom partition with 4MB flash size. First I have increased the flash size through `menuconfig` then I've selected custom partitioning in `menuconfig` My partitions.csv is the following.
  1. # Name,   Type, SubType, Offset,  Size, Flags
  2. # Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap
  3. nvs,      data, nvs,     ,        0x6000,
  4. phy_init, data, phy,     ,        0x1000,
  5. factory,  app,  factory, ,        0x200000,
The project is built and flashed properly. But it is crashing in a reboot loop with this error message.
  1. I (62) boot: ## Label            Usage          Type ST Offset   Length
  2. I (69) boot:  0 nvs              WiFi data        01 02 00009000 00006000
  3. I (77) boot:  1 phy_init         RF data          01 01 0000f000 00001000
  4. I (84) boot:  2 factory          factory app      00 00 00010000 00200000
  5. I (92) boot: End of partition table
  6. I (96) boot_comm: chip revision: 1, min. application chip revision: 0
  7. I (103) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x3d928 (252200) map
  8. I (203) esp_image: segment 1: paddr=0x0004d950 vaddr=0x3ffbdb60 size=0x026c8 (  9928) load
  9. I (207) esp_image: segment 2: paddr=0x00050020 vaddr=0x400d0020 size=0xed1c4 (971204) map
  10. 0x400d0020: _stext at ??:?
  11.  
  12. I (560) esp_image: segment 3: paddr=0x0013d1ec vaddr=0x3ffc0228 size=0x012c8 (  4808) load
  13. I (562) esp_image: segment 4: paddr=0x0013e4bc vaddr=0x40080000 size=0x00404 (  1028) load
  14. 0x40080000: _WindowOverflow4 at /home/neel/Projects/esp/esp-idf/components/freertos/xtensa_vectors.S:1778
  15.  
  16. I (567) esp_image: segment 5: paddr=0x0013e8c8 vaddr=0x40080404 size=0x1ccd4 (117972) load
  17. I (643) boot: Loaded app from partition at offset 0x10000
  18. I (643) boot: Disabling RNG early entropy source...
  19. I (644) cpu_start: Pro cpu up.
  20. I (647) cpu_start: Application information:
  21. I (652) cpu_start: Project name:     water
  22. I (657) cpu_start: App version:      19b32a3-dirty
  23. I (662) cpu_start: Compile time:     Jan 19 2020 01:06:53
  24. I (668) cpu_start: ELF file SHA256:  ae5cb65857ad08f5...
  25. I (674) cpu_start: ESP-IDF:          v4.1-dev-1572-g30372f5a4-dirty
  26. I (681) cpu_start: Starting app cpu, entry point is 0x40081314
  27. 0x40081314: call_start_cpu1 at /home/neel/Projects/esp/esp-idf/components/esp32/cpu_start.c:276
  28.  
  29. I (668) cpu_start: App cpu up.
  30. I (692) heap_init: Initializing. RAM available for dynamic allocation:
  31. I (699) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM
  32. I (705) heap_init: At 3FFB6388 len 00001C78 (7 KiB): DRAM
  33. I (711) heap_init: At 3FFB9A20 len 00004108 (16 KiB): DRAM
  34. I (717) heap_init: At 3FFBDB5C len 00000004 (0 KiB): DRAM
  35. I (723) heap_init: At 3FFCE9D8 len 00011628 (69 KiB): DRAM
  36. I (729) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
  37. I (735) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
  38. I (742) heap_init: At 4009D0D8 len 00002F28 (11 KiB): IRAM
  39. I (748) cpu_start: Pro cpu start user code
  40. I (769) spi_flash: detected chip: generic
  41. I (770) spi_flash: flash io: dio
  42. I (770) cpu_start: Starting scheduler on PRO CPU.
  43. I (0) cpu_start: Starting scheduler on APP CPU.
  44. ***ERROR*** A stack overflow in task main has been detected.
  45. abort() was called at PC 0x40097b40 on core 0
  46. 0x40097b40: vApplicationStackOverflowHook at /home/neel/Projects/esp/esp-idf/components/esp32/panic.c:125
  47.  
  48.  
  49. ELF file SHA256: ae5cb65857ad08f500dd86184d251f3397a747ccd676eefdeb9dda0ee5afad5b
  50.  
  51. Backtrace: 0x400977a1:0x3ffb5b50 0x40097b29:0x3ffb5b70 0x40097b40:0x3ffb5b90 0x4009b40b:0x3ffb5bb0 0x4009a640:0x3ffb5bd0 0x4009a5f6:0x55765776 |<-CORRUPTED
  52. 0x400977a1: invoke_abort at /home/neel/Projects/esp/esp-idf/components/esp32/panic.c:157
  53.  
  54. 0x40097b29: abort at /home/neel/Projects/esp/esp-idf/components/esp32/panic.c:174
  55.  
  56. 0x40097b40: vApplicationStackOverflowHook at /home/neel/Projects/esp/esp-idf/components/esp32/panic.c:125
  57.  
  58. 0x4009b40b: vTaskSwitchContext at /home/neel/Projects/esp/esp-idf/components/freertos/tasks.c:2768
  59.  
  60. 0x4009a640: _frxt_dispatch at /home/neel/Projects/esp/esp-idf/components/freertos/portasm.S:406
  61.  
  62. 0x4009a5f6: _frxt_int_exit at /home/neel/Projects/esp/esp-idf/components/freertos/portasm.S:206
  63.  
  64.  
  65. Rebooting...

ESP_Sprite
Posts: 9749
Joined: Thu Nov 26, 2015 4:08 am

Re: vApplicationStackOverflowHook with custom partitioning and 4MB flash size

Postby ESP_Sprite » Sun Jan 19, 2020 9:44 am

What does the code do; is there a possibility you actually have a stack overflow somewhere? Why do you think the partitioning is related?

chegewara
Posts: 2371
Joined: Wed Jun 14, 2017 9:00 pm

Re: vApplicationStackOverflowHook with custom partitioning and 4MB flash size

Postby chegewara » Sun Jan 19, 2020 3:16 pm

***ERROR*** A stack overflow in task main has been detected.
Try to increase main task stack in menuconfig.

neel_basu
Posts: 6
Joined: Sat Jan 18, 2020 7:41 pm

Re: vApplicationStackOverflowHook with custom partitioning and 4MB flash size

Postby neel_basu » Sun Jan 19, 2020 9:33 pm

I found out the problem was that I was including a class which has a big array. I removed that array then it worked. Possibly it was exploding the stack size.

Who is online

Users browsing this forum: Bing [Bot] and 89 guests