Page 1 of 1

ESPLOG and UART0 coexistance for own use

Posted: Wed Jun 15, 2022 9:11 am
by rdson@esp
Hi there,

I'm looking for an information I couldn't find after an hour of investigating.
The EPSLOG uses by default the UART0 which also is the only UART on the board I've to dev for.
Is it possible to also use the UART0 for our own purpose besides the ESPLOG?
I played a bit with the UART functions like
setting up with uart_config_t uart_config = {...} and uart_param_config(0, &uart_config)
installing the UART driver with uart_driver_install(...),
getting the information like using uart_is_driver_installed(...) to figure things out a bit.
I saw that though the ESPLOG uses the UART0, uart_is_driver_installed(...) did return that UART0 is not active, I had to first call uart_driver_install(...) so UART0 was told active.
And this leads me to the question, do I interfere somehow with whatever the ESPLOG sets up for the UART0?

Thanks and best regards.

Re: ESPLOG and UART0 coexistance for own use

Posted: Thu Jun 16, 2022 7:00 am
by ESP_Sprite
What in particular do you want to use it for? If simply to print stuff, printf() works, or you can install the UART driver and use the UART functions. If you want to re-use the serial connection for other purposes, you can initialize e.g. UART1 to use the UART0 Tx/Rx pin and it'll 'take over' that port.

Re: ESPLOG and UART0 coexistance for own use

Posted: Thu Jun 16, 2022 8:49 am
by rdson@esp
Hi, just to print some information or give a little service interface over it.
I'm wondering, why is the UART0 not active (when calling uart_is_driver_installed(...) ) unless installing myself the driver prior? I thought it would have been already done by the ESP IDF, since the ESP_LOG system uses the UART0.

Re: ESPLOG and UART0 coexistance for own use

Posted: Fri Jun 17, 2022 1:42 am
by ESP_Sprite
The uart *driver* is not active at that point; the UART itself is used (otherwise you wouldn't have output) but output is handled by some more primitive IO routines in ROM.