Page 1 of 1

ESP32-MINI-1-N4 UART1 issue

Posted: Thu Jan 18, 2024 7:36 pm
by gschelotto
I want to use UART1 over GPIO9 and GPIO10 in a ESP32-MINI-1-N4 for a basic serial communication.
Everything goes well about UART1 configuration, compilation and device flashing.
When I run the idf monitor it says that UART1 is already used and the device resets continually.
What's going on?
Is the UART1 used by another peripheral? Which one? Maybe SD_DATA2 and SD_DATA3 as shown in the attached image?

Is it possible to re-configure GPIO9 and GPIO10 to use UART1 as expected?
How? I'm not able to find any documentation about this.

thanks in advance,
gaston

Re: ESP32-MINI-1-N4 UART1 issue

Posted: Fri Jan 19, 2024 2:04 am
by ESP_Sprite
GPIO9 and 10 are by default connected to the internal flash, so reconfiguring these pins will lead to issues. However, you can use the GPIO matrix to re-route that UART to any (free, compatible) GPIO.

Re: ESP32-MINI-1-N4 UART1 issue

Posted: Fri Jan 19, 2024 7:22 am
by gschelotto
All right. Could you provide some example? If I remap using uart_set_pin function

ESP_ERROR_CHECK(uart_set_pin(UART_NUM_1, GPIO_NUM_4, GPIO_NUM_2, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE));

I get the same error: UART driver already installed

Re: ESP32-MINI-1-N4 UART1 issue

Posted: Sat Jan 20, 2024 3:15 am
by ESP_Sprite
That is a different issue. Can you show your entire code?

Re: ESP32-MINI-1-N4 UART1 issue

Posted: Sat Jan 20, 2024 10:26 am
by gschelotto
I've found the issue. I'm calling UART initialization two times...
thanks for your support!
gaston

Re: ESP32-MINI-1-N4 UART1 issue

Posted: Wed Jan 24, 2024 11:14 am
by Tanguy
ESP_Sprite wrote:
Fri Jan 19, 2024 2:04 am
GPIO9 and 10 are by default connected to the internal flash, so reconfiguring these pins will lead to issues. However, you can use the GPIO matrix to re-route that UART to any (free, compatible) GPIO.
Hello,
As stated by the datasheet of the ESP32-MINI-1 :
Pins GPIO6, GPIO7, GPIO8, GPIO11, GPIO16, and GPIO17 on the ESP32-U4WDH chip are connected to the SPI flash integrated on the module and are not led out.
GPIO9 and 10 are listed as available GPIO. Can you confirm that your statement above do not apply to the ESP-MINI-1 and that GPIO9 and 10 can be used as standard GPIO on this model ?

Re: ESP32-MINI-1-N4 UART1 issue

Posted: Thu Jan 25, 2024 6:53 am
by ESP_Sprite
Tanguy wrote:
Wed Jan 24, 2024 11:14 am
Hello,
As stated by the datasheet of the ESP32-MINI-1 :
Pins GPIO6, GPIO7, GPIO8, GPIO11, GPIO16, and GPIO17 on the ESP32-U4WDH chip are connected to the SPI flash integrated on the module and are not led out.
GPIO9 and 10 are listed as available GPIO. Can you confirm that your statement above do not apply to the ESP-MINI-1 and that GPIO9 and 10 can be used as standard GPIO on this model ?
Ah, you're right; the Mini-1 uses a SOC with the flash integrated and connected to some different pins. My point that you can connect it to any random (compatible, otherwise unused) GPIO still stands, though.