ESP32 using USART1

Hello. I want to know whether someone have succesfully used ESP32 USART1? From what I know, ESP32 has 3 USART ports.

If I am correct, USART1 is tied up to the internal flash and not recommended to use.See:

I really need an additional USART for my project.

USART0 is being used for programming the device and logging.
USART1 - not currently used but I want to use it for something else
USART2 - used for communicating with GSM module.

Surely it is being used. As you say yourself

What do you mean with USART?
Esp32 has 3 UART interfaces and ( if I remember correctly) 4 (H)SPI interfaces. The flash is connected by means of a HSPI interface. This cannot be used for other purposes. By default UART1 uses the same pins as the HSPI flash interface. But because on ESP32 every pripheral can be connected freely to (nearly) every pin, it should be possible to rearrange that.

So what is the point of having USART1 if you cannot use it? USART1 pins are used for SPI interfacing with flash memory :smiley: Why even bother naming it USART1

Oh. So you mean I can remap the default USART1 pins GPIO(9/10) to any other free gpio pins and I can use USAR1 without any issues? I am also aware that I can use software usart but I read many negative things about problems that come with it so i would rather not

The serial interfaces on ESP are no USART interfaces. They cannot be used in synchronous mode. They are pure UART interfaces ( asynchronous mode only).

I never rearranged UART1 by myself, but i did it with other peripherals. I see no reason why the GPIO matrix function should not work with UART1. Just try :wink:

But how many serial lines do you need? 2 UARTs are available at free pins. ( one is used to connect to the PC )

1 Like

Thanks for replying and clarifying. I need 2 free UARTs. I do not want to mess with UART0 since it is used for programming and logging hence if I connect something to it, I may have problems with it and will need to spend extra time debugging solving issues that can be avoided in the first place. I can freely use UART2 so I need 1 more. If I can rearange UART1 pins that solves my problem totaly

I think the HardwareSerial class supported pin map changes in begin() function.

Serial1.begin(115200, SERIAL_8N1, 32, 33); // change pin mapping -> rxd=32 / txd=33

But I don't have spare ESP32 now so I can't try it.

1 Like