ESP32 Strapping bits - what does GPIO4 do ?

cadrjr1
Posts: 11
Joined: Thu Mar 15, 2018 6:50 pm

ESP32 Strapping bits - what does GPIO4 do ?

Postby cadrjr1 » Tue Jun 19, 2018 10:57 am

From: ESP32 Technical Reference Manual, Version 2.9

"Register 4.13: GPIO_STRAP_REG (0x0038)

GPIO_STRAPPING GPIO strapping results: Bit5-bit0 of boot_sel_chip[5:0] correspond to MTDI,
GPIO0, GPIO2, GPIO4, MTDO, GPIO5, respectively. "

I cannot find a definition for what GPIO4 bit does ?
Does anyone know ?

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: ESP32 Strapping bits - what does GPIO4 do ?

Postby kolban » Tue Jun 19, 2018 3:23 pm

I think you've found a good catch here. We are becoming (correctly) lawyers on these specifications. The ESP32 Data Sheet claims that there are 5 bits available for strapping detection while the technical reference manual says that there are 6 bits available. The 6th bit being GPIO4.

It may simply be that the ESP32 does indeed record the power on status of these 6 pins and makes them available to software ... however, the ESP32 bootloader actually only uses five of them as described in the Data Sheet in its section 2.4. It may simply be that the signal on GPIO4 is indeed remembered at power-on and available for query but the ESP32 doesn't have a need for it and hence it could be left for user code to do something special. I could imagine a button associated with this pin that when held on power-on would set the bit allowing the user code to query "Was the button held at power on?" and hence be a special function.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

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

Re: ESP32 Strapping bits - what does GPIO4 do ?

Postby ESP_Sprite » Wed Jun 20, 2018 2:34 am

It actually is used to select a few options in the more obscure bootstrap methods that the ESP32 has that normally aren't available - things like legacy boot modes, ATE testing modes, diagnostics modes etc. If you use the normal boot modes, the pin is recorded but ignored by the ROM - you probably are actually able to use it in the sense that kolban describes.

Return to “Hardware”

Who is online

Users browsing this forum: No registered users and 4 guests