Hi
I am using ESP32D0WDQ6 (revision 0). Are there any issues with that particular revision?
Also I have tried to pinpoint where the problem is but inserting log statements as you suggested Kolban. This are my findings so far.
As part of the wifi initialisation the event_handler is created, just the standard way
Code: Select all
ESP_ERROR_CHECK( esp_event_loop_init(event_handler, NULL) );
... and it is here in the event_handler the reset is done. To pinpoint it more accurately I have inserted some log statements here as well like so...
Code: Select all
static esp_err_t event_handler(void *ctx, system_event_t *event)
{
switch(event->event_id) {
case SYSTEM_EVENT_STA_START:
ESP_LOGI(SOLARLAMP_SENSOR_ALERT, "SYSTEM_EVENT_STA_START");
esp_err_t status;
status = esp_wifi_connect();
switch ( status ) {
case ESP_ERR_WIFI_NOT_INIT: {
printf("WiFi is not initialized by eps_wifi_init\n");
break;
}
case ESP_ERR_WIFI_NOT_STARTED: {
printf("WiFi is not started by esp_wifi_start\n");
break;
}
case ESP_ERR_WIFI_CONN: {
printf("WiFi internal error, station or soft-AP control block wrong\n");
break;
}
case ESP_ERR_WIFI_SSID: {
printf("SSID of AP which station connects is invalid\n");
break;
}
default: {
printf("Something else\n");
}
}
break;
case SYSTEM_EVENT_STA_GOT_IP:
ESP_LOGI(SOLARLAMP_SENSOR_ALERT, "SYSTEM_EVENT_STA_GOT_IP");
xEventGroupSetBits(wifi_event_group, CONNECTED_BIT);
break;
case SYSTEM_EVENT_STA_DISCONNECTED:
ESP_LOGI(SOLARLAMP_SENSOR_ALERT, "SYSTEM_EVENT_STA_DISCONNECTED");
/* This is a workaround as ESP32 WiFi libs don't currently
auto-reassociate. */
esp_wifi_connect();
xEventGroupClearBits(wifi_event_group, CONNECTED_BIT);
break;
default:
break;
}
return ESP_OK;
}
... and from this I can tell you that it fails in SYSTEM_EVENT_STA_START right after the
Code: Select all
ESP_LOGI(SOLARLAMP_SENSOR_ALERT, "SYSTEM_EVENT_STA_START");
... so I guess it is the esp_wifi_connect() that causes the problem. To track it further I have inserted the switch statement but of course this is never reached as it is a reset going on.
Here is the output from the UART serial terminal
Code: Select all
I (448) SENSOR_ALERT_CLIENT: SYSTEM_EVENT_STA_START
ets Jun 8 2016 00:22:57
rst:0x8 (TG1WDT_SYS_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
ets Jun 8 2016 00:22:57
rst:0x7 (TG0WDT_SYS_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:0x3fff0008,len:8
load:0x3fff0010,len:4400
load:0x40078000,len:11072
load:0x40080000,len:252
entry 0x40080034
W (90) boot: PRO CPU has been reset by WDT.
W (90) boot: WDT reset info: PRO CPU PC=0x40059b6f
W (90) boot: WDT reset info: APP CPU PC=0x400803c0
I (109) boot: ESP-IDF v3.0-dev-20-g9b955f4-dirty 2nd stage bootloader
I (131) boot: compile time 00:45:11
I (144) boot: Enabling RNG early entropy source...
I (161) boot: SPI Speed : 40MHz
I (173) boot: SPI Mode : DIO
I (186) boot: SPI Flash Size : 4MB
I (199) boot: Partition Table:
I (210) boot: ## Label Usage Type ST Offset Length
I (233) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (256) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (279) boot: 2 factory factory app 00 00 00010000 00100000
I (303) boot: End of partition table
I (316) boot: Disabling RNG early entropy source...
I (333) boot: Loading app partition at offset 00010000
I (1331) boot: segment 0: paddr=0x00010018 vaddr=0x00000000 size=0x0ffe8 ( 65512)
I (1332) boot: segment 1: paddr=0x00020008 vaddr=0x3f400010 size=0x19e40 (106048) map
I (1348) boot: segment 2: paddr=0x00039e50 vaddr=0x3ffb0000 size=0x02bb8 ( 11192) load
I (1379) boot: segment 3: paddr=0x0003ca10 vaddr=0x40080000 size=0x00400 ( 1024) load
I (1402) boot: segment 4: paddr=0x0003ce18 vaddr=0x40080400 size=0x12d5c ( 77148) load
I (1464) boot: segment 5: paddr=0x0004fb7c vaddr=0x400c0000 size=0x00000 ( 0) load
I (1465) boot: segment 6: paddr=0x0004fb84 vaddr=0x00000000 size=0x00484 ( 1156)
I (1486) boot: segment 7: paddr=0x00050010 vaddr=0x400d0018 size=0x6b4a4 (439460) map
I (1512) cpu_start: Pro cpu up.
I (1524) cpu_start: Starting app cpu, entry point is 0x40080e68
I (0) cpu_start: App cpu up.
I (1557) heap_alloc_caps: Initializing. RAM available for dynamic allocation:
I (1579) heap_alloc_caps: At 3FFAE2A0 len 00001D60 (7 KiB): DRAM
I (1600) heap_alloc_caps: At 3FFB8488 len 00027B78 (158 KiB): DRAM
I (1621) heap_alloc_caps: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (1642) heap_alloc_caps: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (1664) heap_alloc_caps: At 4009315C len 0000CEA4 (51 KiB): IRAM
I (1685) cpu_start: Pro cpu start user code
I (1740) cpu_start: Starting scheduler on PRO CPU.
I (198) cpu_start: Starting scheduler on APP CPU.
I (318) wifi: wifi firmware version: 72ddf26
I (318) wifi: config NVS flash: enabled
I (318) wifi: config nano formating: disabled
I (318) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (328) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (368) wifi: Init dynamic tx buffer num: 32
I (368) wifi: Init dynamic rx buffer num: 32
I (368) wifi: wifi driver task: 3ffbe6e8, prio:23, stack:4096
I (368) wifi: Init static rx buffer num: 10
I (378) wifi: Init dynamic rx buffer num: 32
I (378) wifi: Init rx ampdu len mblock:7
I (388) wifi: Init lldesc rx ampdu entry mblock:4
I (388) wifi: wifi power manager task: 0x3ffc3ab0 prio: 21 stack: 2560
I (398) SENSOR_ALERT_CLIENT: Setting WiFi configuration SSID bmv8...
I (398) wifi: wifi timer task: 3ffc4b30, prio:22, stack:3584
I (448) phy: phy_version: 355.1, 59464c5, Jun 14 2017, 20:25:06, 0, 0
I (448) wifi: mode : sta (24:0a:c4:03:87:74)
... and this is repeated over and over again except for the third time the output changes a bit
Code: Select all
I (448) SENSOR_ALERT_CLIENT: SYSTEM_EVENT_STA_START
Something else
ets Jun 8 2016 00:22:57
rst:0x8 (TG1WDT_SYS_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
ets Jun 8 2016 00:22:57
rst:0x7 (TG0WDT_SYS_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:0x3fff0008,len:8
load:0x3fff0010,len:4400
load:0x40078000,len:11072
load:0x40080000,len:252
entry 0x40080034
W (90) boot: PRO CPU has been reset by WDT.
W (90) boot: WDT reset info: PRO CPU PC=0x40086a52
W (90) boot: WDT reset info: APP CPU PC=0x40081610
... notice the "Something else" that means that this time the event_handler enters the switch statement and resolves to the default case.
I have also pulled from the esp-idf repository and updated submodules, erased flash on the ESP32, make clean but the outcome is the same.
I would be thankful if you could help me.
Thanks