examples: aws_iot: fine tune stack size for aws_iot task

Signed-off-by: Mahavir Jain <mahavir@espressif.com>
This commit is contained in:
Mahavir Jain 2018-02-20 17:04:07 +05:30
parent f2b2d045ba
commit 886b5df30b
2 changed files with 5 additions and 20 deletions

View file

@ -277,7 +277,7 @@ void aws_iot_task(void *param) {
continue;
}
ESP_LOGI(TAG, "-->sleep");
ESP_LOGI(TAG, "Stack remaining for task '%s' is %d bytes", pcTaskGetTaskName(NULL), uxTaskGetStackHighWaterMark(NULL));
vTaskDelay(1000 / portTICK_RATE_MS);
sprintf(cPayload, "%s : %d ", "hello from ESP32 (QOS0)", i++);
paramsQOS0.payloadLen = strlen(cPayload);
@ -328,10 +328,5 @@ void app_main()
ESP_ERROR_CHECK( err );
initialise_wifi();
#ifdef CONFIG_MBEDTLS_DEBUG
const size_t stack_size = 36*1024;
#else
const size_t stack_size = 36*1024;
#endif
xTaskCreatePinnedToCore(&aws_iot_task, "aws_iot_task", stack_size, NULL, 5, NULL, 1);
xTaskCreatePinnedToCore(&aws_iot_task, "aws_iot_task", 9216, NULL, 5, NULL, 1);
}

View file

@ -125,18 +125,6 @@ static const char * ROOT_CA_PATH = CONFIG_EXAMPLE_ROOT_CA_PATH;
#error "Invalid method for loading certs"
#endif
/**
* @brief Default MQTT HOST URL is pulled from the aws_iot_config.h which
* uses menuconfig to find a default.
*/
char HostAddress[255] = AWS_IOT_MQTT_HOST;
/**
* @brief Default MQTT port is pulled from the aws_iot_config.h which
* uses menuconfig to find a default.
*/
uint32_t port = AWS_IOT_MQTT_PORT;
static esp_err_t event_handler(void *ctx, system_event_t *event)
{
switch(event->event_id) {
@ -325,6 +313,8 @@ void aws_iot_task(void *param) {
}
}
ESP_LOGI(TAG, "*****************************************************************************************");
ESP_LOGI(TAG, "Stack remaining for task '%s' is %d bytes", pcTaskGetTaskName(NULL), uxTaskGetStackHighWaterMark(NULL));
vTaskDelay(1000 / portTICK_RATE_MS);
}
@ -374,5 +364,5 @@ void app_main()
initialise_wifi();
/* Temporarily pin task to core, due to FPU uncertainty */
xTaskCreatePinnedToCore(&aws_iot_task, "aws_iot_task", 16384+1024, NULL, 5, NULL, 1);
xTaskCreatePinnedToCore(&aws_iot_task, "aws_iot_task", 9216, NULL, 5, NULL, 1);
}