ESP32-MINI-1-N4 UART1 issue

gschelotto
Posts: 3
Joined: Thu Jan 18, 2024 7:08 pm

ESP32-MINI-1-N4 UART1 issue

Postby gschelotto » Thu Jan 18, 2024 7:36 pm

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
Attachments
IO_MUX.png
IO_MUX Pad Summary
IO_MUX.png (84.89 KiB) Viewed 1765 times

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

Re: ESP32-MINI-1-N4 UART1 issue

Postby ESP_Sprite » 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.

gschelotto
Posts: 3
Joined: Thu Jan 18, 2024 7:08 pm

Re: ESP32-MINI-1-N4 UART1 issue

Postby gschelotto » Fri Jan 19, 2024 7:22 am

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
Attachments
console-output.png
console-output.png (60.46 KiB) Viewed 1606 times

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

Re: ESP32-MINI-1-N4 UART1 issue

Postby ESP_Sprite » Sat Jan 20, 2024 3:15 am

That is a different issue. Can you show your entire code?

gschelotto
Posts: 3
Joined: Thu Jan 18, 2024 7:08 pm

Re: ESP32-MINI-1-N4 UART1 issue

Postby gschelotto » Sat Jan 20, 2024 10:26 am

I've found the issue. I'm calling UART initialization two times...
thanks for your support!
gaston

Tanguy
Posts: 10
Joined: Thu Dec 09, 2021 9:33 pm

Re: ESP32-MINI-1-N4 UART1 issue

Postby Tanguy » Wed Jan 24, 2024 11:14 am

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 ?

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

Re: ESP32-MINI-1-N4 UART1 issue

Postby ESP_Sprite » Thu Jan 25, 2024 6:53 am

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.

Who is online

Users browsing this forum: No registered users and 100 guests