请问如何增加esp32s2 wifi stack 大小 “A stack overflow in task httpd has been detected”
Posted: Wed Feb 16, 2022 1:48 am
固件用的是4.3版本
模组是esp32s2 2M内存版本
代码如下
static esp_err_t image_handler(httpd_req_t *req)
{
ESP_LOGI(TAG, "Web GET begin\n");
uint16_t tmp[1000]={1};
char *json_data = (char *)heap_caps_calloc(80*63*10, sizeof(char), MALLOC_CAP_SPIRAM); ;
cJSON *message =cJSON_CreateObject();
cJSON *data=cJSON_CreateIntArray(tmp,1000);
cJSON_AddItemToObject(message,"data",data);
json_data = cJSON_Print(message);
printf(json_data);
ESP_LOGI(TAG, "Minimum free heap size: %d bytes\n", esp_get_minimum_free_heap_size());
httpd_resp_set_type(req, "application/json");
httpd_resp_set_hdr(req,"Access-Control-Allow-Origin","*");
httpd_resp_send(req,json_data,1000);
free(json_data);
return ESP_OK;
}
调试下来错误代码
[09:19:23.651] ***ERROR*** A stack overflow in task httpd has been detected.
[09:19:23.651]
[09:19:23.651] Backtrace:0x4002e1f7:0x3fff8a70 0x4002eaa1:0x3fff8a90 0x40031835:0x3fff8ab0 0x4003036e:0x3fff8b30 0x4002eb98:0x3fff8b50 0x4002eb4a:0x4001a690 |<-CORRUPTED
调整了
Max number of Wifi staic TX buffers 32
Default send buffer size 57440
没有找到stack 设置大小
麻烦高手指导一下谢谢
模组是esp32s2 2M内存版本
代码如下
static esp_err_t image_handler(httpd_req_t *req)
{
ESP_LOGI(TAG, "Web GET begin\n");
uint16_t tmp[1000]={1};
char *json_data = (char *)heap_caps_calloc(80*63*10, sizeof(char), MALLOC_CAP_SPIRAM); ;
cJSON *message =cJSON_CreateObject();
cJSON *data=cJSON_CreateIntArray(tmp,1000);
cJSON_AddItemToObject(message,"data",data);
json_data = cJSON_Print(message);
printf(json_data);
ESP_LOGI(TAG, "Minimum free heap size: %d bytes\n", esp_get_minimum_free_heap_size());
httpd_resp_set_type(req, "application/json");
httpd_resp_set_hdr(req,"Access-Control-Allow-Origin","*");
httpd_resp_send(req,json_data,1000);
free(json_data);
return ESP_OK;
}
调试下来错误代码
[09:19:23.651] ***ERROR*** A stack overflow in task httpd has been detected.
[09:19:23.651]
[09:19:23.651] Backtrace:0x4002e1f7:0x3fff8a70 0x4002eaa1:0x3fff8a90 0x40031835:0x3fff8ab0 0x4003036e:0x3fff8b30 0x4002eb98:0x3fff8b50 0x4002eb4a:0x4001a690 |<-CORRUPTED
调整了
Max number of Wifi staic TX buffers 32
Default send buffer size 57440
没有找到stack 设置大小
麻烦高手指导一下谢谢