ESPLOG and UART0 coexistance for own use

rdson@esp
Posts: 8
Joined: Wed Jun 15, 2022 8:41 am

ESPLOG and UART0 coexistance for own use

Postby rdson@esp » Wed Jun 15, 2022 9:11 am

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.

ESP_Sprite
Posts: 9577
Joined: Thu Nov 26, 2015 4:08 am

Re: ESPLOG and UART0 coexistance for own use

Postby ESP_Sprite » Thu Jun 16, 2022 7:00 am

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.

rdson@esp
Posts: 8
Joined: Wed Jun 15, 2022 8:41 am

Re: ESPLOG and UART0 coexistance for own use

Postby rdson@esp » Thu Jun 16, 2022 8:49 am

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.

ESP_Sprite
Posts: 9577
Joined: Thu Nov 26, 2015 4:08 am

Re: ESPLOG and UART0 coexistance for own use

Postby ESP_Sprite » Fri Jun 17, 2022 1:42 am

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.

Who is online

Users browsing this forum: No registered users and 239 guests