UART and GPIO configuration for WroverB

geebou
Posts: 1
Joined: Wed Jan 08, 2020 4:18 pm

UART and GPIO configuration for WroverB

Postby geebou » Wed Jan 08, 2020 4:28 pm

Hi support teams

reading esp32-wrover-b_datasheet_en.pdf and esp32 reference manual, I am not sure which GPIO I can select for RX and TX,
this for UART 1 / 2 (leaving UART 0 for console as default configuration)
correct me if I am wrong : following Table 3: Pin Definitions
SHD/SD2 * 17 I/O GPIO9, SD_DATA2, SPIHD, HS1_DATA2, U1RXD
SWP/SD3 * 18 I/O GPIO10, SD_DATA3, SPIWP, HS1_DATA3, U1TXD
I could use GPIO 17 and 18 for I1 Rx and TX right ?

Thanks for your feeback

with kind regards

G.B

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

Re: UART and GPIO configuration for WroverB

Postby ESP_Sprite » Thu Jan 09, 2020 3:26 am

Yes, you can. In general, you can use any pin that is not hooked up to the internal flash (or psram, for modules that have it) chip. For TX the pin also needs to be output capable, so anything <GPIO34 will work.

Palonso
Posts: 95
Joined: Tue Sep 24, 2019 8:43 pm

Re: UART and GPIO configuration for WroverB

Postby Palonso » Fri May 08, 2020 11:20 pm

I'm having a similar problem, but the thing is that I configured the sdkconfig as DIO mode for the Flash memory.

so that should leave GPIO09 and GPIO10 free and being able to use them as UART1 (on their default configuration) or just some extra Input/Output pins, right? Because my program crashes everytime I try that:

Code: Select all

I (1903) main_code: Setting GPIO

I (1903) main_code: dio[3]: Setting GPIO 9
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x400e7018: ffffffff ffffffff 2a82ad33
0x400e7018: __localeconv_l at /home/$USER/esp/crosstool-NG/.build/xtensa-esp32-elf/src/newlib/newlib/libc/locale/localeconv.c:51

Core 1 register dump:
PC      : 0x400e701c  PS      : 0x00060b30  A0      : 0x800e6184  A1      : 0x3ffc0b20  
0x400e701c: _localeconv_r at /home/$USER/esp/crosstool-NG/.build/xtensa-esp32-elf/src/newlib/newlib/libc/locale/localeconv.c:55

A2      : 0x3ffc0fe4  A3      : 0x3ffae920  A4      : 0x3f403958  A5      : 0x3ffc0ea0  
A6      : 0x3ffc0e70  A7      : 0x0000000c  A8      : 0x800e30eb  A9      : 0x3ffc0df0  
A10     : 0x3ffc0fe4  A11     : 0x00000000  A12     : 0x00000000  A13     : 0x00000000  
A14     : 0x00000001  A15     : 0xff000000  SAR     : 0x00000017  EXCCAUSE: 0x00000000  
EXCVADDR: 0x00000000  LBEG    : 0x400014fd  LEND    : 0x4000150d  LCOUNT  : 0xfffffffd  

ELF file SHA256: ffffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffff

Backtrace: 0x400e7019:0x3ffc0b20 0x400e6181:0x3ffc0e30 0x40086bd1:0x3ffc0e60 0x400d3e70:0x3ffc0ec0 0x4009523d:0x3ffc0ef0
0x400e7019: __localeconv_l at /home/$USER/esp/crosstool-NG/.build/xtensa-esp32-elf/src/newlib/newlib/libc/locale/localeconv.c:51

0x400e6181: vprintf at /home/$USER/esp/crosstool-NG/.build/xtensa-esp32-elf/src/newlib/newlib/libc/stdio/vprintf.c:34

0x40086bd1: esp_log_write at /home/$USER/esp/esp-idf/components/log/log.c:190

0x400d3e70: dio_config_task at /home/$USER/proyect/main/main_code.c:1152

0x4009523d: vPortTaskWrapper at /home/$USER/esp/esp-idf/components/freertos/xtensa/port.c:143


Rebooting...


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

Re: UART and GPIO configuration for WroverB

Postby ESP_Sprite » Sat May 09, 2020 8:20 am

It depends. If you use your own PCB with a raw esp32 chip plus flash on it, that should work. If you're using an existing module, those pins likely are still connected to the flash chip and messing with the levels of those pins will interfere with flash operations.

Palonso
Posts: 95
Joined: Tue Sep 24, 2019 8:43 pm

Re: UART and GPIO configuration for WroverB

Postby Palonso » Mon May 11, 2020 2:24 pm

So in the existing module ESP-WROVER-IB won't be possible to use the GPIO09 and GPIO10 for other purpose except flash memory, right?

On the other hand, I had programmed the WROVER to work in DIO mode, so those pin should have been available to use but I got the "IllegalInstruction" error. What else should I do to actually use those pins or it depends/detect if it has a memory connected to those pins?
(I'm looking forward to manually disconnect those pins from the flash memory in the existing module to try before making my own PCB)

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

Re: UART and GPIO configuration for WroverB

Postby ESP_Sprite » Tue May 12, 2020 8:02 am

On a Wrover module, there's likely not much you can do except opening the module and physically disconnecting the flash pins; if you do that, DIO mode should work and the pins are free to use. Alternatively, just use a small level converter to get the level up to 3.3V so you can use any other random pin.

Palonso
Posts: 95
Joined: Tue Sep 24, 2019 8:43 pm

Re: UART and GPIO configuration for WroverB

Postby Palonso » Wed May 13, 2020 10:42 pm

I liked the level shifter solution, but the problem is with the code, it doesn't let me to set the pins as outputs without panic-ing.

How can I "un-set" that panic option? I have to disconnect those pins from the flash memory even with the level shifter?

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

Re: UART and GPIO configuration for WroverB

Postby ESP_Sprite » Thu May 14, 2020 7:46 am

Yes, so that is why I said you should use another pin than those two GPIOs when you want to use a level shifter. The level shifter is not a solution to make GPIO9/10 work, it's a solution to make any other GPIO work.

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: UART and GPIO configuration for WroverB

Postby WiFive » Thu May 14, 2020 11:55 am

Why is he shifting levels?

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

Re: UART and GPIO configuration for WroverB

Postby ESP_Sprite » Thu May 14, 2020 1:34 pm

Whoops, I confused the topic with another topic that was about using GPIO9/10 to send/receive 1.8V signals. Palonso: ignore the thing I said about 'level shifter' if your UART RxD/Txd are at 3.3V levels. However, my point that you cannot use GPIO9/10 when using a module with integrated flash stays valid, so you may be better off using different GPIOs.

Who is online

Users browsing this forum: No registered users and 65 guests