You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
I have searched the issue tracker for a similar issue and not found a similar issue.
General issue report
I run the example, just changed the output string
IDF version: 5.1.2
developboard: ESP32-S3
/* * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Unlicense OR CC0-1.0 */// DESCRIPTION:// This example contains minimal code to make ESP32-S2 based device// recognizable by USB-host devices as a USB Serial Device printing output from// the application.#include<stdio.h>#include<stdlib.h>#include<sys/reent.h>#include"esp_log.h"#include"freertos/FreeRTOS.h"#include"freertos/task.h"#include"tinyusb.h"#include"tusb_cdc_acm.h"#include"tusb_console.h"#include"sdkconfig.h"staticconstchar*TAG="example";
voidapp_main(void)
{
/* Setting TinyUSB up */ESP_LOGI(TAG, "USB initialization");
consttinyusb_config_ttusb_cfg= {
.device_descriptor=NULL,
.string_descriptor=NULL,
.external_phy= false, // In the most cases you need to use a `false` value
.configuration_descriptor=NULL,
};
ESP_ERROR_CHECK(tinyusb_driver_install(&tusb_cfg));
tinyusb_config_cdcacm_tacm_cfg= { 0 }; // the configuration uses default valuesESP_ERROR_CHECK(tusb_cdc_acm_init(&acm_cfg));
ESP_LOGI(TAG, "USB initialization DONE");
while (1) {
ESP_LOGI(TAG, "log -> uart");
ESP_LOGW(TAG, "log -> uart");
ESP_LOGE(TAG, "log -> uart\n");
vTaskDelay(1000 / portTICK_PERIOD_MS);
esp_tusb_init_console(TINYUSB_CDC_ACM_0); // log to usbESP_LOGI(TAG, "log -> USB");
ESP_LOGW(TAG, "log -> USB");
ESP_LOGE(TAG, "log -> USB\n");
vTaskDelay(1000 / portTICK_PERIOD_MS);
esp_tusb_deinit_console(TINYUSB_CDC_ACM_0); // log to uart
}
}
the function esp_tusb_init_console() and esp_tusb_deinit_console() causes memory leaks
this is my log:
I (14564) USER_app: GPIO 5 is low
I (14564) USER_app: Minimum free heap size: 362480 bytes
I (14564) USER_app: log -> uart
W (14564) USER_app: log -> uart
E (14564) USER_app: log -> uart
I (16564) USER_app: GPIO 5 is low
I (16564) USER_app: Minimum free heap size: 362480 bytes
I (16564) USER_app: log -> uart
W (16564) USER_app: log -> uart
E (16564) USER_app: log -> uart
I (18564) USER_app: GPIO 5 is low
I (18564) USER_app: Minimum free heap size: 362480 bytes
I (18564) USER_app: log -> uart
W (18564) USER_app: log -> uart
E (18564) USER_app: log -> uart
I (20564) USER_app: GPIO 5 is low
I (20564) USER_app: Minimum free heap size: 362480 bytes
I (20564) USER_app: log -> uart
W (20564) USER_app: log -> uart
E (20564) USER_app: log -> uart
I (22564) USER_app: GPIO 5 is low
I (22564) USER_app: Minimum free heap size: 362480 bytes
I (22564) USER_app: log -> uart
W (22564) USER_app: log -> uart
E (22564) USER_app: log -> uart
I (24564) USER_app: GPIO 5 is low
I (24564) USER_app: Minimum free heap size: 362480 bytes
I (24564) USER_app: log -> uart
W (24564) USER_app: log -> uart
E (24564) USER_app: log -> uart
I (26564) USER_app: log -> USB
W (26564) USER_app: log -> USB
E (26564) USER_app: log -> USB
I (28564) USER_app: log -> USB
W (28564) USER_app: log -> USB
E (28564) USER_app: log -> USB
I (30564) USER_app: log -> USB
W (30564) USER_app: log -> USB
E (30564) USER_app: log -> USB
I (32564) USER_app: log -> USB
W (32564) USER_app: log -> USB
E (32564) USER_app: log -> USB
I (2860568) USER_app: log -> USB
W (2860568) USER_app: log -> USB
E (2860568) USER_app: log -> USB
I (2862568) USER_app: log -> USB
W (2862568) USER_app: log -> USB
E (2862568) USER_app: log -> USB
I (6306568) USER_app: log -> USB
W (6306568) USER_app: log -> USB
E (6306568) USER_app: log -> USB
I (6310568) USER_app: log -> USB
W (6310568) USER_app: log -> USB
E (6310568) USER_app: log -> USB
I (6480568) USER_app: GPIO 5 is low
I (6480568) USER_app: Minimum free heap size: 81652 bytes
I (6480568) USER_app: log -> uart
W (6480568) USER_app: log -> uart
E (6480568) USER_app: log -> uart
I (6482568) USER_app: GPIO 5 is low
I (6482568) USER_app: Minimum free heap size: 81564 bytes
I (6482568) USER_app: log -> uart
W (6482568) USER_app: log -> uart
E (6482568) USER_app: log -> uart
I (6484568) USER_app: GPIO 5 is low
I (6484568) USER_app: Minimum free heap size: 81476 bytes
I (6484568) USER_app: log -> uart
W (6484568) USER_app: log -> uart
E (6484568) USER_app: log -> uart
I (6486568) USER_app: GPIO 5 is low
I (6486568) USER_app: Minimum free heap size: 81388 bytes
I (6486568) USER_app: log -> uart
W (6486568) USER_app: log -> uart
E (6486568) USER_app: log -> uart
I (6488568) USER_app: GPIO 5 is low
I (6488568) USER_app: Minimum free heap size: 81300 bytes
I (6488568) USER_app: log -> uart
W (6488568) USER_app: log -> uart
E (6488568) USER_app: log -> uart
I (6506568) USER_app: GPIO 5 is low
I (6506568) USER_app: Minimum free heap size: 80508 bytes
I (6506568) USER_app: log -> uart
W (6506568) USER_app: log -> uart
E (6506568) USER_app: log -> uart
I (6508568) USER_app: GPIO 5 is low
I (6508568) USER_app: Minimum free heap size: 80420 bytes
I (6508568) USER_app: log -> uart
W (6508568) USER_app: log -> uart
E (6508568) USER_app: log -> uart
I (6510568) USER_app: GPIO 5 is low
I (6510568) USER_app: Minimum free heap size: 80332 bytes
I (6510568) USER_app: log -> uart
W (6510568) USER_app: log -> uart
E (6510568) USER_app: log -> uart
I (6512568) USER_app: GPIO 5 is low
I (6512568) USER_app: Minimum free heap size: 80244 bytes
I (6512568) USER_app: log -> uart
W (6512568) USER_app: log -> uart
E (6512568) USER_app: log -> uart
I (6514568) USER_app: GPIO 5 is low
I (6514568) USER_app: Minimum free heap size: 80156 bytes
I (6514568) USER_app: log -> uart
W (6514568) USER_app: log -> uart
E (6514568) USER_app: log -> uart
I (6516568) USER_app: GPIO 5 is low
I (6516568) USER_app: Minimum free heap size: 80068 bytes
I (6516568) USER_app: log -> uart
W (6516568) USER_app: log -> uart
E (6516568) USER_app: log -> uart
I (6518568) USER_app: GPIO 5 is low
I (6518568) USER_app: Minimum free heap size: 79980 bytes
I (6518568) USER_app: log -> uart
W (6518568) USER_app: log -> uart
E (6518568) USER_app: log -> uart
I (6520568) USER_app: GPIO 5 is low
I (6520568) USER_app: Minimum free heap size: 79892 bytes
I (6520568) USER_app: log -> uart
W (6520568) USER_app: log -> uart
E (6520568) USER_app: log -> uart
I (6522568) USER_app: GPIO 5 is low
I (6522568) USER_app: Minimum free heap size: 79804 bytes
I (6522568) USER_app: log -> uart
W (6522568) USER_app: log -> uart
E (6522568) USER_app: log -> uart
I (6524568) USER_app: GPIO 5 is low
I (6524568) USER_app: Minimum free heap size: 79716 bytes
I (6524568) USER_app: log -> uart
W (6524568) USER_app: log -> uart
E (6524568) USER_app: log -> uart
I (6526568) USER_app: GPIO 5 is low
I (6526568) USER_app: Minimum free heap size: 79628 bytes
I (6526568) USER_app: log -> uart
W (6526568) USER_app: log -> uart
E (6526568) USER_app: log -> uart
I (6528568) USER_app: GPIO 5 is low
I (6528568) USER_app: Minimum free heap size: 79540 bytes
I (6528568) USER_app: log -> uart
W (6528568) USER_app: log -> uart
E (6528568) USER_app: log -> uart
There was no memory leak at first, it was a gradual decrease in memory after running for a while.
As long as I deactivate the function, there's no memory leak.
The text was updated successfully, but these errors were encountered:
Answers checklist.
General issue report
I run the example, just changed the output string
IDF version: 5.1.2
developboard: ESP32-S3
the function
esp_tusb_init_console()
andesp_tusb_deinit_console()
causes memory leaksthis is my log:
There was no memory leak at first, it was a gradual decrease in memory after running for a while.
As long as I deactivate the function, there's no memory leak.
The text was updated successfully, but these errors were encountered: