Merge branch 'bugfix/console_example_stack_overflow' into 'master'
Increase event task stack size to fix console example stack overflow See merge request idf/esp-idf!1879
This commit is contained in:
commit
44c3b0a1ba
5 changed files with 51 additions and 6 deletions
|
@ -281,7 +281,7 @@ config SYSTEM_EVENT_QUEUE_SIZE
|
||||||
|
|
||||||
config SYSTEM_EVENT_TASK_STACK_SIZE
|
config SYSTEM_EVENT_TASK_STACK_SIZE
|
||||||
int "Event loop task stack size"
|
int "Event loop task stack size"
|
||||||
default 2048
|
default 2304
|
||||||
help
|
help
|
||||||
Config system event task stack size in different application.
|
Config system event task stack size in different application.
|
||||||
|
|
||||||
|
|
|
@ -184,10 +184,10 @@ typedef struct tcpip_adapter_dns_param_s {
|
||||||
msg.data = (void*)(_data);\
|
msg.data = (void*)(_data);\
|
||||||
msg.api_fn = (_fn);\
|
msg.api_fn = (_fn);\
|
||||||
if (TCPIP_ADAPTER_IPC_REMOTE == tcpip_adapter_ipc_check(&msg)) {\
|
if (TCPIP_ADAPTER_IPC_REMOTE == tcpip_adapter_ipc_check(&msg)) {\
|
||||||
ESP_LOGD(TAG, "check: remote, if=%d fn=%p\n", (_if), (_fn));\
|
ESP_LOGV(TAG, "check: remote, if=%d fn=%p\n", (_if), (_fn));\
|
||||||
return msg.ret;\
|
return msg.ret;\
|
||||||
} else {\
|
} else {\
|
||||||
ESP_LOGD(TAG, "check: local, if=%d fn=%p\n", (_if), (_fn));\
|
ESP_LOGV(TAG, "check: local, if=%d fn=%p\n", (_if), (_fn));\
|
||||||
}\
|
}\
|
||||||
}while(0)
|
}while(0)
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,7 @@ static sys_sem_t api_sync_sem = NULL;
|
||||||
static bool tcpip_inited = false;
|
static bool tcpip_inited = false;
|
||||||
static sys_sem_t api_lock_sem = NULL;
|
static sys_sem_t api_lock_sem = NULL;
|
||||||
extern sys_thread_t g_lwip_task;
|
extern sys_thread_t g_lwip_task;
|
||||||
#define TAG "tcpip_adapter"
|
static const char* TAG = "tcpip_adapter";
|
||||||
|
|
||||||
static void tcpip_adapter_api_cb(void* api_msg)
|
static void tcpip_adapter_api_cb(void* api_msg)
|
||||||
{
|
{
|
||||||
|
@ -79,7 +79,7 @@ static void tcpip_adapter_api_cb(void* api_msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
msg->ret = msg->api_fn(msg);
|
msg->ret = msg->api_fn(msg);
|
||||||
ESP_LOGD(TAG, "call api in lwip: ret=0x%x, give sem", msg->ret);
|
ESP_LOGV(TAG, "call api in lwip: ret=0x%x, give sem", msg->ret);
|
||||||
sys_sem_signal(&api_sync_sem);
|
sys_sem_signal(&api_sync_sem);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -20,11 +20,19 @@
|
||||||
#include "freertos/FreeRTOS.h"
|
#include "freertos/FreeRTOS.h"
|
||||||
#include "freertos/task.h"
|
#include "freertos/task.h"
|
||||||
#include "soc/rtc_cntl_reg.h"
|
#include "soc/rtc_cntl_reg.h"
|
||||||
|
#include "sdkconfig.h"
|
||||||
|
|
||||||
|
#ifdef CONFIG_FREERTOS_USE_STATS_FORMATTING_FUNCTIONS
|
||||||
|
#define WITH_TASKS_INFO 1
|
||||||
|
#endif
|
||||||
|
|
||||||
static void register_free();
|
static void register_free();
|
||||||
static void register_restart();
|
static void register_restart();
|
||||||
static void register_deep_sleep();
|
static void register_deep_sleep();
|
||||||
static void register_make();
|
static void register_make();
|
||||||
|
#if WITH_TASKS_INFO
|
||||||
|
static void register_tasks();
|
||||||
|
#endif
|
||||||
|
|
||||||
void register_system()
|
void register_system()
|
||||||
{
|
{
|
||||||
|
@ -32,6 +40,9 @@ void register_system()
|
||||||
register_restart();
|
register_restart();
|
||||||
register_deep_sleep();
|
register_deep_sleep();
|
||||||
register_make();
|
register_make();
|
||||||
|
#if WITH_TASKS_INFO
|
||||||
|
register_tasks();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 'restart' command restarts the program */
|
/** 'restart' command restarts the program */
|
||||||
|
@ -72,6 +83,36 @@ static void register_free()
|
||||||
ESP_ERROR_CHECK( esp_console_cmd_register(&cmd) );
|
ESP_ERROR_CHECK( esp_console_cmd_register(&cmd) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 'tasks' command prints the list of tasks and related information */
|
||||||
|
#if WITH_TASKS_INFO
|
||||||
|
|
||||||
|
static int tasks_info(int argc, char** argv)
|
||||||
|
{
|
||||||
|
const size_t bytes_per_task = 40; /* see vTaskList description */
|
||||||
|
char* task_list_buffer = malloc(uxTaskGetNumberOfTasks() * bytes_per_task);
|
||||||
|
if (task_list_buffer == NULL) {
|
||||||
|
ESP_LOGE(__func__, "failed to allocate buffer for vTaskList output");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
vTaskList(task_list_buffer);
|
||||||
|
fputs(task_list_buffer, stdout);
|
||||||
|
free(task_list_buffer);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void register_tasks()
|
||||||
|
{
|
||||||
|
const esp_console_cmd_t cmd = {
|
||||||
|
.command = "tasks",
|
||||||
|
.help = "Get information about running tasks",
|
||||||
|
.hint = NULL,
|
||||||
|
.func = &tasks_info,
|
||||||
|
};
|
||||||
|
ESP_ERROR_CHECK( esp_console_cmd_register(&cmd) );
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // WITH_TASKS_INFO
|
||||||
|
|
||||||
/** 'deep_sleep' command puts the chip into deep sleep mode */
|
/** 'deep_sleep' command puts the chip into deep sleep mode */
|
||||||
|
|
||||||
static struct {
|
static struct {
|
||||||
|
|
|
@ -3,7 +3,7 @@ CONFIG_LOG_BOOTLOADER_LEVEL_WARN=y
|
||||||
CONFIG_LOG_BOOTLOADER_LEVEL=2
|
CONFIG_LOG_BOOTLOADER_LEVEL=2
|
||||||
|
|
||||||
# Increase main task stack size
|
# Increase main task stack size
|
||||||
CONFIG_MAIN_TASK_STACK_SIZE=6144
|
CONFIG_MAIN_TASK_STACK_SIZE=7168
|
||||||
|
|
||||||
# Enable filesystem
|
# Enable filesystem
|
||||||
CONFIG_PARTITION_TABLE_CUSTOM=y
|
CONFIG_PARTITION_TABLE_CUSTOM=y
|
||||||
|
@ -11,3 +11,7 @@ CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions_example.csv"
|
||||||
CONFIG_PARTITION_TABLE_CUSTOM_APP_BIN_OFFSET=0x10000
|
CONFIG_PARTITION_TABLE_CUSTOM_APP_BIN_OFFSET=0x10000
|
||||||
CONFIG_PARTITION_TABLE_FILENAME="partitions_example.csv"
|
CONFIG_PARTITION_TABLE_FILENAME="partitions_example.csv"
|
||||||
CONFIG_APP_OFFSET=0x10000
|
CONFIG_APP_OFFSET=0x10000
|
||||||
|
|
||||||
|
# Enable FreeRTOS stats formatting functions, needed for 'tasks' command
|
||||||
|
CONFIG_FREERTOS_USE_TRACE_FACILITY=y
|
||||||
|
CONFIG_FREERTOS_USE_STATS_FORMATTING_FUNCTIONS=y
|
||||||
|
|
Loading…
Reference in a new issue