Page 1 of 1

Strapping Pins explanation

Posted: Mon Jun 04, 2018 7:04 pm
by Humam Helfawi
Hi,
In this reference https://cdn.sparkfun.com/datasheets/IoT ... eet_en.pdf at page 16:
Strapping Pins
ESP32 has 6 strapping pins:
• MTDI/GPIO12: internal pull-down
• GPIO0: internal pull-up
• GPIO2: internal pull-down
• GPIO4: internal pull-down
• MTDO/GPIO15: internal pull-up
• GPIO5: internal pull-up
Software can read the value of these 6 bits from the register ”GPIO_STRAPPING”.
During the chip power-on reset, the latches of the strapping pins sample the voltage level as strapping bits of ”0”
or ”1”, and hold these bits until the chip is powered down or shut down. The strapping bits configure the device
boot mode, the operating voltage of VDD_SDIO and other system initial settings.
Each strapping pin is connected with its internal pull-up/pull-down during the chip reset. Consequently, if a strapping
pin is unconnected or the connected external circuit is high-impendence, the internal weak pull-up/pull-down
will determine the default input level of the strapping pins.
To change the strapping bit values, users can apply the external pull-down/pull-up resistances, or apply the host
MCU’s GPIOs to control the voltage level of these pins when powering on ESP32.
After reset, the strapping pins work as the normal functions pins.
Refer to Table 2 for detailed boot modes configuration by strapping pins.
As I could understand, those 6 pins (GPIOs 12, 0, 2, 4, 15, 5), should be left floating or pulled up or down during booting and flashing stages. Is my understanding correct?

Now, I have some peripherals that are connected to one of those pins (GPIO 12 for example). Connecting a specific pin from the peripherals to one of the ESP32 strapping pins (GPIO 12) denies ESP32 from flashing. What should I do in this case? How should I connect those peripherals to those pins so it works well.

Re: Strapping Pins explanation

Posted: Mon Jun 04, 2018 7:36 pm
by WiFive
0,2, and 12 are the critical ones. A workaround is to put a time delay switch between the gpio and the peripheral so the bootloader can read the strapping pin before the switch connects it to the peripheral.

Re: Strapping Pins explanation

Posted: Wed Jun 06, 2018 12:18 am
by ESP_Angus
Humam Helfawi wrote: Now, I have some peripherals that are connected to one of those pins (GPIO 12 for example). Connecting a specific pin from the peripherals to one of the ESP32 strapping pins (GPIO 12) denies ESP32 from flashing. What should I do in this case? How should I connect those peripherals to those pins so it works well.
Connecting to the pin by itself is not a problem, but if the connection pulls GPIO12 up on reset then this is a problem for flashing.

There are usually ways to make this work, one is the time delay suggested by WiFive. But it really depends on what the peripheral connected is (as current, speed, etc. requirements vary). Can you elaborate at all?

Re: Strapping Pins explanation

Posted: Sat Jan 05, 2019 3:48 pm
by zandam
WiFive wrote:
Mon Jun 04, 2018 7:36 pm
0,2, and 12 are the critical ones. A workaround is to put a time delay switch between the gpio and the peripheral so the bootloader can read the strapping pin before the switch connects it to the peripheral.
Hello, I'd be interested in this solution. How do you put a "time delay switch"? Is it doable by editing (I don't know how) the bootloader?

Re: Strapping Pins explanation

Posted: Wed Apr 22, 2020 6:46 am
by stoikos
you can use a line buffer like SN74AHC125D tied to the EN via a voltage supervisor like MAX810TTRG

Re: Strapping Pins explanation

Posted: Sun Aug 23, 2020 8:55 pm
by edurmz
I found another solution for GPIO12. You have to use "espefuse.py set_flash_voltage 3.3V". See descritpion here: https://github.com/espressif/esptool/wiki/espefuse

This seems to be a nice solution. I just received a new bunch of PCBs based on ESP32 and I implemented GPIO12 as RX for ST3485. Transceiver seems to be fast enough to set HIGH GPIO12, preventing ESP-WROOM-32D to boot Flash with 3.3V.