BTT. I could really use some help with this one.
I increased the stack size to a ridiculous amount (0x8000 bytes) for my wifi task, which eliminated the stack overflow, though something seems wrong about this, given that it used to work with about 1/4 that amount of stack.
Then, through trial and error, I've identified a particular system call that returns an error:
Code: Select all
memReport();
wifi_init_config_t WIFI_INIT_CONFIG = WIFI_INIT_CONFIG_DEFAULT();
err = esp_wifi_init(&WIFI_INIT_CONFIG);
if (err != ESP_OK)
{
ESP_LOGE(TAG, "taskInit(): esp_wifi_init() returned 0x%x.", err);
vTaskDelay(portMAX_DELAY);
}
Returns this:
Code: Select all
I (2767) memreport: memReport(): there are 64960 MALLOC_CAP_32BIT bytes free.
I (2777) memreport: memReport(): there are 25120 MALLOC_CAP_8BIT bytes free.
I (2797) memreport: memReport(): there are 25120 MALLOC_CAP_DMA bytes free.
I (2807) memreport: memReport(): there are 0 MALLOC_CAP_SPIRAM bytes free.
I (2817) memreport: memReport(): there are 64960 MALLOC_CAP_INTERNAL bytes free.
I (2827) memreport: memReport(): there are 25120 MALLOC_CAP_DEFAULT bytes free.
I (2847) memreport: memReport(): there are 0 MALLOC_CAP_INVALID bytes free.
I (2867) wifi: wifi driver task: 3ffd8b9c, prio:23, stack:3584, core=0
I (2877) wifi: wifi firmware version: 581f422
I (2877) wifi: config NVS flash: enabled
I (2877) wifi: config nano formating: disabled
I (2877) wifi: Init dynamic tx buffer num: 32
I (2887) wifi: Init data frame dynamic rx buffer num: 32
I (2887) wifi: Init management frame dynamic rx buffer num: 32
I (2897) wifi: Init management short buffer num: 32
I (2897) wifi: Init static rx buffer size: 1600
W (2907) wifi: malloc buffer fail
I (2907) wifi: Init static rx buffer num: 9
I (2907) wifi: Init dynamic rx buffer num: 32
E (2917) wifi: Expected to init 10 rx buffer, actual is 9
I (2917) wifi: Deinit lldesc rx mblock:0
I (2927) wifi: Deinit lldesc rx mblock:0
I (2927) wifi: Deinit lldesc rx mblock:0
I (2927) wifi: Deinit lldesc rx mblock:0
E (2947) Wifi: taskInit(): esp_wifi_init() returned 0x101.
Where 0x101 is ESP_ERR_NO_MEM: out of memory.
Any idea what gives here? What memory am I out of that this call needs?