unset uart_set_pin on ESP32E

Ildar Belkin
Posts: 13
Joined: Mon Apr 24, 2023 3:16 pm

unset uart_set_pin on ESP32E

Postby Ildar Belkin » Wed Aug 06, 2025 1:38 pm

Hello.
uart_set_pin is mandatory part of configuring UART.
How to unset pin? UART API has no uart_unset_pin() or other way to do this.

The ESP32 UART manual in part where uart_set_pin() described says:
"The same macro UART_PIN_NO_CHANGE should be specified for pins that will not be used."
I didn't understand how to use it to unset pins.


The problem is that I get an error during my code when use uart_set_pin() again:
uart: GPIO xx is not usable, maybe used by others


My code should twice init uart->install driver->set_pin->delete driver->deinit port


Please, advise me a solution.

Sprite
Espressif staff
Espressif staff
Posts: 10636
Joined: Thu Nov 26, 2015 4:08 am

Re: unset uart_set_pin on ESP32E

Postby Sprite » Thu Aug 07, 2025 12:02 am

What GPIO are you using, on which chip?

Ildar Belkin
Posts: 13
Joined: Mon Apr 24, 2023 3:16 pm

Re: unset uart_set_pin on ESP32E

Postby Ildar Belkin » Thu Aug 07, 2025 7:41 am

18 for TXD and 19 for RXD. ESP32-WROOM-32E.

The project no uses WiFi or BLE or SPI, but uses I2C

uart: GPIO 18 is not usable, maybe used by others

I use 2 UARTs: one for GNSS, one for sattelite modem.
Error appear only when GNSS (18 pin) is initialized second time (after deinit and deinstall driver from first time).

Who is online

Users browsing this forum: Google [Bot] and 3 guests