-
Notifications
You must be signed in to change notification settings - Fork 7.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UARTs available in ESP32-WROVER-E (and related GPIO pins) (IDFGH-5161) #6939
Comments
Yes using uart_set_pin almost any gpio are usable https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/gpio.html |
Thanks @negativekelvin |
There are three UARTs they are all useable. However unlike other microcontrollers there are some limitations. I recommend checking out technical reference manual to make sure your design will work seamlessly. Here are some issue we have come across. General questions like this are better suited to the esp32 forums. |
Thanks @AshUK . Thanks |
@carlessole its in Table 1: Pin Description, labeled; U0RXD, U0TXD, U1RXD, U1TXD, U2RXD, U2TXD. |
@AshUK, which document are you talking about? I am afraid that you are talking about ESP32-WROOM (NOT -E, and not WROVER): ESP32-WROOM-32 Datasheet I am looking at ESP32-WROVER-E Datasheet because I must use this module. And there, I think Pin Description is in table 3: And there is nothing about U1RXD, U1TXD, U2RXD, U2TXD. There just appear U0RXD, U0TXD: |
@carlessole you are right it is no included as its not routed on this module. Section 12.1 of the WROVER-E data sheet has a list of must read documents. I highly recommend reading through all the documents and resources. |
If the pin you wish to use is not exposed by the module you can use IO multiplexing to assign it to any pin. This is explain in the ESP-32 TRM Chapter 4. Also see https://www.esp32.com/viewtopic.php?t=3569 |
@AshUK thanks for the quick responses. We already read them, but for the ESP32-WROVER-E we have the doubt if the recommended UART1 and UART2 pins are available. So it seems we must use for UART 2 (pins 25,26,32,33) and for UART 1 (pins 28,29,30,31) But then on ESP32-WROVER-E Datasheet (page 20) is like these pins (25..33) are not available in the module (and used by flash and PSRAM) Thanks |
Ok, I will take a look and see if it solves our problem. Thanks |
If it helps we use a WROVER-E module and make use of all three UARTs and we use the following the pins: UART0 is unchanged as exposed by the module. UART1_TX GPIO_NUM_27 UART2_TX GPIO_NUM_2 |
From ESP32 Datasheet
And from https://www.esp32.com/viewtopic.php?t=3569:
So I understand that ideally it is better to work with the mapping done by IO_MUX, that means using pins (25..33). But as in ESP32-WROVER-E these pins are used for other "internal" proposes (flash, PSRAM) it is needed to map other pins to the UARTS, using GPIO mux. This second way (GPIO mux) must work but we could experience some unexpected behaviour (maybe) introduced by that APB clock. |
Thanks! We are gonna try these ones on our prototype. |
Hi There carlessole, Did you manage to resolve it? I'm having similar confusion. At first i though that it i could connect to any GPIO (mapped from ESP32 to ESP32-WROVER-E), but it seems that's not the case. |
Hello @Andres-San , Yes. It has worked for me. My project is currently using following UART setup: Which pins are you trying to use? |
@carlessole Thanks! Im on the Schematic yet, but those same doubts assaulted me every night haha. After reading and reading, i have come to the conclusion that the person who wrote "Any GPIO" in the ESP32 DataSheet is wrong (or atleast missleading), because the IO_MUX shows otherwise. For instance GPIO 15 cant be used as I2C on any of its functions (red), but MTD0, GPIO0, GPIO2 and GPIO4 can (blue). Is this the same conclusion you've come to? Best from Chile! |
@Andres-San gpio mux has limited options but gpio matrix can connect almost any pin to almost any function. Research gpio matrix. |
Hi @Andres-San, As said here: https://www.esp32.com/viewtopic.php?t=3569 "Any GPIO" is true always that your hardware (or module) is not using it for some other reasons. So, if you have the ESP- WROVER module you won't have all the GPIO available because some of them will be routed internally to SPI RAM and other peripherals. Take a look also here: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/uart.html#gpio-lookup-macros: But all the GPIOs accessible from outside de ESP-WROVER can be used as a GPIO if not other use is desired (as JTAG or whatever). Take a look here (https://www.espressif.com/sites/default/files/documentation/esp32-wrover-e_esp32-wrover-ie_datasheet_en.pdf#page=20): |
@negativekelvin and @carlessole Thank you so much for your clarification!, effectively now im missing some direct IO_MUX pins, because i have to use x3 UART, but only one is "wired" directly via IO_MUX (red) into Wrover-E, and for the rest i'll have to use GPIO_Matrix right?
(Information extracted directly from ESP32 and ESP32-WROOVER-E datasheets) Is this reasoning correct? if it is, now i'll have to look further on how to use GPIO matrix while coding. Best! |
Hi @Andres-San , I don't know If I have inderstood you ok, but if your intention is to use GPIO9/10 (UART1) and GPIO16/17(UART2) that is not possible because those GPIOs are not available outside the WROOVER-E module. You need to choose any GPIO available and free. And to use them is it as easy as (https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/uart.html#_CPPv412uart_set_pin11uart_port_tiiii): Instead of GPIO4/0 you can choose the one that you prefer (if it is available on WROOVER-E): For example: GPIO 23, GPIO22, GPIO19, GPIO18..... /!\ GPIO number and PIN number is not the same. You need to use GPIO number. |
Hi @carlessole, Yes thank you for your patience! I fully understand now =) Best from Chile |
Hello everyone. Any help would be very appreciated. I'm running a ESP32-WROVER-IE via Platform.io. My platform.ini looks like this:
When I try using Pin7 (GPIO35) for any serial communication, the board keeps stuck in a reset loop. Other pins work fine. What's the problem here, what am I doing or getting wrong??
|
@markusb237 If you want to use GPIO35, please pass 35 as the 3rd argument to this function: #include <Arduino.h>
void setup() {
Serial2.begin(115200,SERIAL_8N1,35,12); // will use GPIO35 as RXD and GPIO12 as TXD
} (All APIs in Arduino and ESP-IDF use GPIO numbers; In software, we never use the numbers of pins/pads of the chip/module.) |
Doh! - Of course, how could I miss this... Thanks! Regards |
Hello,
We are starting a project using a ESP32-WROVER-E module and we would like to know how many UARTs are available and which pins can be used for that.
After looking the datasheet it seems that there is only one UART available (the UART 0) but I'm pretty sure that two other ones (as it seems looking at esp32 chip datasheet ) must be available:
In some forums we have seen that ANY GPIO can be used as a UART pin. Is that true? Is there no limitations?
And how it has to be configured? Just using uart_set_pin function?
Lot of thanks,
Carles
The text was updated successfully, but these errors were encountered: