Page 1 of 1

Does usb_serial_jtag_driver_install() disable stdout?

Posted: Tue Jul 02, 2024 1:59 pm
by AndreaS73
I created a task for processing incoming data on the JTAG/USB serial line:

Code: Select all

void Serial_Task(void *arg)
{
    usb_serial_jtag_driver_config_t usb_serial_jtag_config =
    {
        .rx_buffer_size = BUFFER_SIZE,
        .tx_buffer_size = BUFFER_SIZE,
    };

    ESP_ERROR_CHECK(usb_serial_jtag_driver_install(&usb_serial_jtag_config));

    while (1)
    {

        int len = usb_serial_jtag_read_bytes(data, (BUFFER_SIZE - 1), 20 / portTICK_PERIOD_MS);
        if (len)
        {
            // do something
        }

        vTaskDelay(1);
    }
}
In main I activate the task:

Code: Select all

ESP_LOGI(TAG, "before"); // works
printf("before\n"); // works

xTaskCreate(Serial_Task, "serial_task", STACK_SIZE, NULL, 10, NULL);

ESP_LOGI(TAG, "after"); // don't work
printf("after\n"); // don't work
Is this the expected behavior? How to continue to use printf and ESP_LOGx functions?