Merge branch 'bugfix/aws_iot_examples_stack_tune' into 'master'
examples: aws_iot: fine tune stack size for aws_iot task See merge request idf/esp-idf!1962
This commit is contained in:
commit
eb935c2982
2 changed files with 5 additions and 20 deletions
|
@ -277,7 +277,7 @@ void aws_iot_task(void *param) {
|
||||||
continue;
|
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);
|
vTaskDelay(1000 / portTICK_RATE_MS);
|
||||||
sprintf(cPayload, "%s : %d ", "hello from ESP32 (QOS0)", i++);
|
sprintf(cPayload, "%s : %d ", "hello from ESP32 (QOS0)", i++);
|
||||||
paramsQOS0.payloadLen = strlen(cPayload);
|
paramsQOS0.payloadLen = strlen(cPayload);
|
||||||
|
@ -328,10 +328,5 @@ void app_main()
|
||||||
ESP_ERROR_CHECK( err );
|
ESP_ERROR_CHECK( err );
|
||||||
|
|
||||||
initialise_wifi();
|
initialise_wifi();
|
||||||
#ifdef CONFIG_MBEDTLS_DEBUG
|
xTaskCreatePinnedToCore(&aws_iot_task, "aws_iot_task", 9216, NULL, 5, NULL, 1);
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -125,18 +125,6 @@ static const char * ROOT_CA_PATH = CONFIG_EXAMPLE_ROOT_CA_PATH;
|
||||||
#error "Invalid method for loading certs"
|
#error "Invalid method for loading certs"
|
||||||
#endif
|
#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)
|
static esp_err_t event_handler(void *ctx, system_event_t *event)
|
||||||
{
|
{
|
||||||
switch(event->event_id) {
|
switch(event->event_id) {
|
||||||
|
@ -325,6 +313,8 @@ void aws_iot_task(void *param) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ESP_LOGI(TAG, "*****************************************************************************************");
|
ESP_LOGI(TAG, "*****************************************************************************************");
|
||||||
|
ESP_LOGI(TAG, "Stack remaining for task '%s' is %d bytes", pcTaskGetTaskName(NULL), uxTaskGetStackHighWaterMark(NULL));
|
||||||
|
|
||||||
vTaskDelay(1000 / portTICK_RATE_MS);
|
vTaskDelay(1000 / portTICK_RATE_MS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -374,5 +364,5 @@ void app_main()
|
||||||
|
|
||||||
initialise_wifi();
|
initialise_wifi();
|
||||||
/* Temporarily pin task to core, due to FPU uncertainty */
|
/* 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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue