Using LOG on UART0 and console example on UART1?

Posts: 1
Joined: Tue Dec 26, 2017 5:39 pm

Using LOG on UART0 and console example on UART1?

Postby ufanders » Tue Dec 26, 2017 5:45 pm

Hi guys,

I'm trying to use the console example on UART1 and keep the logging functionality on UART0. I modified the console.c code to use UART1 like so:

Code: Select all

/* Install UART driver for interrupt-driven reads and writes */
    ESP_ERROR_CHECK( uart_driver_install(/*CONFIG_CONSOLE_UART_NUM*/ 1,
            256, 0, 0, NULL, 0) );

    /* Tell VFS to use UART driver */
    esp_vfs_dev_uart_use_driver(/*CONFIG_CONSOLE_UART_NUM*/ 1);
However, when I run this I get crazy output on UART0:
This is an example of ESP-IDF console component.
Type 'help' to get the list of commands.
Use UP/DOWN arrows to navigate through command history.
Press TAB when typing command name to auto-complete.


> ;1R;3R;;1R;3[25R;1[25R;1R;1R25R;1R;1R;3R;1R;1R;3R3R;1R;1R;3R;1R;1R;3R;1R;1R;3R;1R;1R;3R
Unrecognized command
It looks like Linenoise and LOG might be using the same stdin/stdout/stderr.

Is there a way to redirect the printf() streams, create new streams or make the LOG and console coexist on differnet UARTs?


Return to “ESP32 IDF”

Who is online

Users browsing this forum: Baidu [Spider] and 16 guests