Page 1 of 1

esp-idf/examples/06_sntp crash

Posted: Sat Dec 10, 2016 7:15 pm
by martinayotte
I've tried to narrow a crash in esp-idf/examples/06_sntp, but I didn't figured out.
Most other examples are working fine, so there must be something wrong ...

Code: Select all

ets Jun  8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0x00
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3ffc0008,len:0
load:0x3ffc0008,len:1964
load:0x40078000,len:3696
ho 0 tail 12 room 4
load:0x40080000,len:260
entry 0x40080034
I (575) heap_alloc_caps: Initializing heap allocator:
I (576) heap_alloc_caps: Region 19: 3FFC0F34 len 0001F0CC tag 0
I (577) heap_alloc_caps: Region 25: 3FFE8000 len 00018000 tag 1
I (587) cpu_start: Pro cpu up.
I (593) cpu_start: Single core mode
I (599) cpu_start: Pro cpu start user code
I (812) phy: phy_version: 258, Nov 29 2016, 15:51:07, 0, 0
I (972) cpu_start: Starting scheduler on PRO CPU.
I (974) example: Boot count: 1
I (974) example: Time is not set yet. Connecting to WiFi and getting time over NTP.
tcpip_task_hdlxxx : 3ffc4bc4, prio:18,stack:2048
I (984) wifi: frc2_timer_task_hdl:3ffc6628, prio:22, stack:2048
W (984) wifi: wifi_nvs_load: index mismatch, i=5 index=0

assertion "0 && "esp_wifi_init(&cfg)"" failed: file "/home/martin/git-work/esp-idf-v0.9/examples/06_sntp/main/./sntp_main.c", line 129, function: initialise_wifi
Guru Meditation Error: Core  0 panic'ed (Unhandled debug exception)
Register dump:
PC      : 0x40056f2a  PS      : 0x00060936  A0      : 0x80081e8d  A1      : 0x3ffc2d30  
A2      : 0x000000a2  A3      : 0x3f4038f9  A4      : 0x3f405258  A5      : 0x3f4051e0  
A6      : 0x00000081  A7      : 0x00000008  A8      : 0x00000000  A9      : 0x3ffc2c70  
A10     : 0x000000a2  A11     : 0x3ffc1084  A12     : 0x00000000  A13     : 0x3f403927  
A14     : 0x00000001  A15     : 0x0000000f  SAR     : 0x00000014  EXCCAUSE: 0x00000001  
EXCVADDR: 0x00000000  LBEG    : 0x4000c28c  LEND    : 0x4000c296  LCOUNT  : 0x00000000  

Backtrace: 0x40056f2a:0x3ffc2d30 0x40081e8d:0x3ffc2d50 0x400f624b:0x3ffc2d80 0x400f6371:0x3ffc2e10 0x400f643b:0x3ffc2e70 0x400d0c41:0x3ffc2f00

                                                                                                                                              Rebooting...

Re: esp-idf/examples/06_sntp crash

Posted: Sun Dec 11, 2016 3:54 pm
by ESP_igrr
Same is begin discussed here: http://esp32.com/viewtopic.php?f=13&t=671

Re: esp-idf/examples/06_sntp crash

Posted: Tue Dec 13, 2016 2:41 am
by liuzhifu
Hi martinayotte,
Just can't reproduce this issue myself. By investigating related code also didn't get any mistakes.

So could you send me your sdkconfig or enlarge the stack of main task, you can do this in menuconfig: Component Config --> ESP32-specific config-->Main task stack size
and make the stack size at least 4096 or bigger...and check whether the problem still exist, if still exist, then I need further investigate....

Re: esp-idf/examples/06_sntp crash

Posted: Tue Dec 13, 2016 8:51 pm
by martinayotte
the sdkconfig was the default version coming from git (except for ssid/passwd), and stacksize was already at 4096, and resizing it to 8192 didn't help.
But why in the debug output it is shown as "stack:2048" ?

Code: Select all

ets Jun  8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0x00
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3ffc0008,len:0
load:0x3ffc0008,len:1964
load:0x40078000,len:3696
ho 0 tail 12 room 4
load:0x40080000,len:260
entry 0x40080034
I (575) heap_alloc_caps: Initializing heap allocator:
I (576) heap_alloc_caps: Region 19: 3FFC0F34 len 0001F0CC tag 0
I (577) heap_alloc_caps: Region 25: 3FFE8000 len 00018000 tag 1
I (587) cpu_start: Pro cpu up.
I (592) cpu_start: Single core mode
I (599) cpu_start: Pro cpu start user code
I (803) phy: phy_version: 258, Nov 29 2016, 15:51:07, 0, 0
I (1843) cpu_start: Starting scheduler on PRO CPU.
I (1845) example: Boot count: 1
I (1845) example: Time is not set yet. Connecting to WiFi and getting time over NTP.
tcpip_task_hdlxxx : 3ffc5c04, prio:18,stack:2048
I (1855) wifi: frc2_timer_task_hdl:3ffc7668, prio:22, stack:2048
W (1855) wifi: wifi_nvs_load: index mismatch, i=5 index=0

assertion "0 && "esp_wifi_init(&cfg)"" failed: file "/home/martin/git-work/esp-idf-v0.9/examples/06_sntp/main/./sntp_main.c", line 129, function: initialise_wifi
Guru Meditation Error: Core  0 panic'ed (Unhandled debug exception)
Register dump:
PC      : 0x40056f2a  PS      : 0x00060936  A0      : 0x80081e8d  A1      : 0x3ffc4560  
A2      : 0x000000a2  A3      : 0x3f4038f9  A4      : 0x3f405258  A5      : 0x3f4051e0  
A6      : 0x00000081  A7      : 0x00000008  A8      : 0x00000000  A9      : 0x3ffc44a0  
A10     : 0x000000a2  A11     : 0x3ffc1084  A12     : 0x00000000  A13     : 0x3f403927  
A14     : 0x00000001  A15     : 0x0000000f  SAR     : 0x00000014  EXCCAUSE: 0x00000001  
EXCVADDR: 0x00000000  LBEG    : 0x4000c28c  LEND    : 0x4000c296  LCOUNT  : 0x00000000  

Backtrace: 0x40056f2a:0x3ffc4560 0x40081e8d:0x3ffc4580 0x400f624b:0x3ffc45b0 0x400f6371:0x3ffc4640 0x400f643b:0x3ffc46a0 0x400d0c41:0x3ffc4730

                                                                                                                                              Rebooting...

Re: esp-idf/examples/06_sntp crash

Posted: Tue Dec 13, 2016 9:53 pm
by kolban
At a wild guess, looking at the ESP_LOG tag which says "wifi" and the text which reads "frc2_timer_task_hdl" ... this may be a FreeRTOS task that does indeed only need a stack size of 2048 which is a separate task from your own user tasks.