Do not put an LED on a pin that is read at boot (a strap pin)

A strap pin reads its voltage only at the instant reset is released to choose the boot mode, and afterward works as an ordinary GPIO or LED driver. Even one LED is a heavy enough load for the internal pull resistor (tens of kΩ) to push the node into a band that is neither H nor L, and the chip boots in the wrong mode.

Last updated: 2026-10-09 Strap pinGPIOESP32STM32Ethernet PHYBoot

What a strap pin is: voltage read only at reset release

Many ICs sample the voltage on certain pins exactly once, at the moment reset is released (or configuration starts), and decide their later behavior from it. These are strap pins. What happens to the pin after sampling depends on the device.

On the ESP32, GPIO0, GPIO2, GPIO12 (shared with JTAG MTDI) and GPIO15 (shared with MTDO) are read as boot-mode pins only just after startup, and afterward are free GPIOs. It is easy to think they no longer matter once boot ends, but the voltage is decided at the moment of power-up itself. The STM32 BOOT0 (a dedicated pin on many parts) and the configuration-mode pins of many FPGAs (M[2:0] on Xilinx 7 series, MSEL on Intel/Altera and so on) cannot be reused as GPIO, but the behavior is still set by the voltage right after startup.

Ethernet PHY address and mode pins fall in between. The PHY address and operating mode are set by straps read from an external resistor at reset release, and many parts reuse the same pin as an LED driver (LINK/ACT) afterward. The strap and the LED output share one pin, so this is where accidents are most likely in this article.

Example: ESP32 GPIO12 and the flash voltage

The best-known example is ESP32 GPIO12 (the VDD_SDIO strap, shared with MTDI). GPIO12 has an internal pull-down and by default reads L, which sets the internal flash voltage regulator to 3.3V. If it is H at reset release, the regulator selects 1.8V. With a 3.3V flash on the board, 1.8V cannot be read correctly and the result is a board that will not boot, or flash contents that look garbled.

This is a plain H/L decision on one digital input, so an LED that seems unrelated can break it just by being connected to the pin.

Why an LED plus a resistor makes an "in-between" voltage

The internal pull resistor of an MCU is usually about 30 to 50kΩ (made weak on purpose to save current). Add an LED and a resistor and the strap node becomes a divider of the internal pull and the external LED + resistor. An LED is nonlinear, with a forward voltage that changes with current, but treating it as roughly constant shows why accidents happen.

Take an internal pull-down Rpd = 45kΩ, with the external path from 3.3V through Rext and an LED (forward voltage VF ≈ 1.8V) into the node: the common wiring of an LED that lights when the pin is low. The node voltage is V = Rpd(VDD − VF) / (Rpd + Rext) and the LED current is I = V / Rpd.

The current is capped by Rpd (45kΩ) anyway, so even with Rext down to 1kΩ the LED carries only tens of µA. The LED does not visibly light, yet the node voltage moves into the 1V range. "The LED is dim, so it is fine" does not hold on a strap pin. Also, the LED's forward voltage falls at low current, so the real VF at tens of µA is below 1.8V and the node voltage is higher than this estimate. It is not a conservative estimate.

LED + resistor against the internal pull-down: the result depends on RThe external LED + resistor (Rext) forms a divider with the 45kΩ internal pull-down. At Rext = 1kΩ the node rises to 1.47V, in the undefined band. At 47kΩ the node is 0.73V and reads L, but LED current is tens of µA either way and dim. NG: undefined band A value for a usable LED brightness. Node is undefined 3.3V Rext 1kΩ LED IC Pin Rpd 45kΩ V ≈ 1.47V (undefined) LED ≈ 33µA (barely visible) OK (but LED is dim) LED is quite dim, but the node reads L 3.3V Rext 47kΩ LED IC Pin Rpd 45kΩ V ≈ 0.73V (reads L) LED ≈ 16µA (dimmer) Current is capped by the 45kΩ pull, so lowering Rext still passes only tens of µA and the LED does not visibly light. The node voltage still moves strongly with Rext. "The LED is dim, so it is fine" does not hold on a strap pin.
Figure 1: an external LED + resistor forms a divider with the 45kΩ internal pull-down. At R_ext = 1kΩ the node is 1.47V, in the undefined band; at 47kΩ it is 0.73V and reads L. Both pass only tens of µA and look dim.

Choosing values: check the node stays inside the VIH/VIL bands

Whether the node reads H or L is set by the pin's VIH (the lowest voltage read as High) and VIL (the highest read as Low). With the general CMOS rule of thumb VIH ≈ 0.7×VDD and VIL ≈ 0.3×VDD, a 3.3V system has VIH = 2.31V and VIL = 0.99V. On real hardware, check the VIH/VIL in that pin's datasheet. Some parts use stricter thresholds, such as a Schmitt trigger with hysteresis.

Here is a table for Rext against the 45kΩ internal pull (VDD = 3.3V, LED VF ≈ 1.8V, simplified).

Node voltage with a 45kΩ internal pull-down plus an external LED (V_F ≈ 1.8V) and resistor R_ext (V_DD = 3.3V, VIH = 2.31V, VIL = 0.99V)
External R_extNode voltageLED currentH/L decision
1kΩ1.47Vabout 33µAUndefined (between VIL and VIH)
10kΩ1.23Vabout 27µAUndefined (between VIL and VIH)
22kΩ1.01Vabout 22µANear the edge (just above VIL 0.99V)
47kΩ0.73Vabout 16µAReads L (LED quite dim)

As the table shows, the resistances that make an LED usefully bright (hundreds of Ω to a few kΩ) almost surely land in the undefined band. A larger resistor leaves the LED dark, so the two goals conflict. The conclusion is not to put an LED directly on a strap pin; if you must, insert one buffer stage so the strap voltage is unaffected.

Another thing to check is whether the node voltage has settled by reset release. A capacitor on the strap net delays settling by the RC time constant with the internal pull. For Rpd = 45kΩ, τ = R×C is 45µs for 1nF (5τ = 0.225ms), 4.5ms for 100nF (5τ = 22.5ms) and 45ms for 1µF (5τ = 225ms). Reset ICs often delay tens to hundreds of ms, so a few hundred pF to a few nF is fine, but a few hundred nF to 1µF added "just in case" brings 5τ close to reset release, and lot, temperature and supply-ramp variation can make the pin be read before it settles.

Inputs of other ICs also push current in

The LED is not the only cause. If a level-shifter or logic-gate input hangs on the same strap net, current flows into and out of the net through that IC's internal pull-up or pull-down and its input protection (ESD) diode. It is dangerous when that IC is on a different supply and powers up in a different order.

For example, if the buffer IC's supply has not risen yet while the strap-side supply (or the pull-up behind it) reaches 3.3V first, current flows through the buffer's input protection diode into its supply rail, still near 0V. Current with nowhere to go raises the rail, the same structure as the protection-diode injection in An LDO cannot sink current. Seen from the strap net, the divider of internal pull and external load gains one more path that current can enter or leave.

Ethernet PHY: the strap and the LED driver are the same pin

Many Ethernet PHYs set the PHY address and operating mode with external resistors at reset release. Many datasheets tell you to make that resistance well below the internal pull (the specified value) so the external resistor's intent surely wins. So far this is the same divider of internal pull and external resistor.

What is specific to PHYs is that many parts reuse the pin after reset release as the output of an LED driver for LINK/ACT. The resistor used for the strap doubles as the LED's current-limiting resistor. This is intended, and fine if designed correctly. The trouble comes when the resistance is chosen only for address setting and the LED does not light, or when it is lowered too far to brighten the LED and the PHY address ends up different from intended: caught from both sides.

Another point is the active H/L direction. Just as connecting the strap resistor to VDD or GND changes the address bit, the LED direction (whether the PHY sinks or sources) must be decided by reading both the strap table and the LED drive description in the datasheet. Reading only one gives a correct address with an LED that stays dark, or the reverse.

Ethernet PHY: strap before release, LED driver afterA circuit where the PHY address/mode setting and the LINK/ACT LED drive share one pin. Before reset release an external resistor is read as a strap; afterward the same resistor and pin serve as the LED's current limit and driver. 1. Before release: address/mode strapUse the datasheet resistor (well below the internal pull) so the external intent wins 2. After release: LINK/ACT LED driverThe same resistor limits LED current. Pick a value that meets both needs 3.3V R 1kΩ LED PHY Pin Latches PHY address/mode hereResistance set by the strap table PHY sinks the pin to drive the LEDThe same resistor limits LED current Address registerLatched LINK/ACTLit Before release, the external resistor sets the PHY address and mode.Keep it well below the internal pull and follow the datasheet strap table. After release, many parts use the same pin as a LINK/ACT LED driver.Choosing the resistor for LED brightness alone breaks the address setting.
Figure 2: a PHY strap and LED pin. Before reset release an external resistor sets the address and mode; afterward the same resistor and pin serve as the LED's current limit and driver.

Seeing the instant at startup

The voltage that matters means something only at the instant of reset release. A meter on the steady state, after firmware drives the pin as a GPIO, no longer shows the voltage just after startup. Trigger an oscilloscope on the rising edge of the reset signal (EN, CHIP_PU and so on) and watch the strap net at the same time; this is the only way to confirm on real hardware.

As Figure 3 shows, during reset the node settles at some voltage set by the divider of the internal pull and the external LED, and at release that voltage is latched once. If it lies in the undefined band, whether it reads H or L can change with unit variation, temperature and small supply differences.

The pin voltage is latched at reset release, then the pin is an ordinary GPIOThe node voltage, divided by the 45kΩ internal pull-down and the external LED + resistor, is latched once at reset release. In the undefined band the H/L decision can change with unit variation and temperature. Afterward the pin is an ordinary GPIO. An animation of three states in turn. 1. In reset: the divider sets the node voltageThe internal pull-down and LED + resistor divider settle the node at some voltage. Nothing is latched yet 2. At reset release: this one voltage is latchedIn the undefined band, H or L can change with unit variation and temperature 3. After release: no longer a strap, just a GPIOFirmware now uses the pin freely. If it booted in the wrong mode, it is too late 3.3V Rext LED IC Pin Rpd 45kΩ Internal pull-down (30-50kΩ) Node ≈ 1.2V Node ≈ 1.2V Latch≈ 1.2V: undefinedH/L varies by unit GPIO from here Firmware sets direction Strap meaning is gone In reset, the 45kΩ pull-down and the LED + resistor divide the voltage and the node settles.Nothing is fixed yet. The trouble comes at the next instant. At reset release, only this one voltage is used for the H/L decision.In the undefined band, H and L can swap with production variation and temperature. Afterward the same pin works as a GPIO or LED driver.The strap no longer matters, but if it booted in the wrong mode it is too late.
Figure 3: at reset release the divided node voltage is latched once. In the undefined band the decision can change with unit variation and temperature. Afterward the pin becomes an ordinary GPIO.

In a table: where in the VIH/VIL bands does it land

Figure 4 lines up the four cases from the earlier table against the voltage bands. Only the dim-LED condition at 47kΩ reads L with certainty, and staying out of the undefined band is the basic criterion for choosing values.

Node voltage against the VIH/VIL bands as Rext changesNode voltage for Rext = 1k, 10k, 22k and 47kΩ against a 45kΩ internal pull-down, over the VIH (2.31V) and VIL (0.99V) bands. 1k to 22kΩ are undefined; only 47kΩ falls in the L band. 0V 0.99V 2.31V 3.3V H band (≥ 2.31V) Undefined (VIL to VIH) L band (≤ 0.99V) Node voltage 1.47V Rext 1kΩ 1.23V Rext 10kΩ 1.01V Rext 22kΩ 0.73V Rext 47kΩ Node voltage vs Rext VDD = 3.3V, LED VF ≈ 1.8V, 45kΩ internal pull-down
Figure 4: node voltage for each R_ext over the VIH/VIL bands. 1kΩ to 22kΩ are undefined; only 47kΩ falls in the L band.

設計レビューのチェック手順

  1. List the strap pins. Search the datasheets for "strap," "boot mode" and "configuration mode," and write down each pin and whether it returns to GPIO after reset release.
  2. Find every part on that net. Pick up the LEDs, pull resistors, wiring to connectors and other ICs' input pins (including internal pulls and protection diodes) from the schematic.
  3. Check the internal pull value in the datasheet. If it is given as a range, calculate for the worst case (no pull, or the weakest value).
  4. Calculate the node voltage with V = Rpull(VDD − VF) / (Rpull + Rext) and compare it with that pin's own VIH/VIL (not the generic 0.7/0.3×VDD). If the LED has several colors, use the one with the lowest VF (often red).
  5. If there is an external capacitor, calculate τ = Rpull × C and check that 5τ is well below the reset IC's delay.
  6. For pins shared by strap and LED, such as on a PHY, read both the address table and the LED drive description and check that the resistance satisfies both. If it cannot, move the LED to another pin.
  7. On real hardware, trigger on the rising edge of reset and check the strap net on a scope, then vary the supply voltage and temperature to confirm it never touches the undefined band.

What catches people on real boards

"I added one debug LED and it stopped booting" is typical of a status LED on a boot-mode pin such as GPIO0, GPIO2 or GPIO12: normal boot and download mode swap, or the flash voltage no longer matches. Boards that boot on some units and not others come from unit-to-unit and temperature variation in the internal pull, the LED's VF and VIH/VIL; a design right at the edge of the undefined band flips either way with production variation.

If a symptom appears after changing the supply voltage (3.3V to 2.5V, for example), VDD falling lowers the absolute VIH/VIL while the LED's VF stays nearly constant, so the relation to the divider point changes. With several VDD options, recalculate at the lowest one. A noise-suppression capacitor of a few hundred pF is usually harmless, but adding EMI or ESD parts casually can stretch the RC time constant until it misses reset release.

Frequently asked questions

What should I do if I want an LED on a strap pin?
The surest way is not to connect it to that pin at all, and to drive it from another GPIO after reset release. If you must use the same pin, as with a PHY's LED-sharing pin, use the strap resistor value the datasheet specifies and either accept a dimmer LED or insert a buffer (one transistor or one logic gate) to separate the strap node from the LED drive.
What if the datasheet does not give the internal pull value?
It is usually given as a range (for example 30 to 50kΩ), so calculate for the worst case, where the internal pull is weakest. If nothing is given, assume tens of kΩ and make a scope check on real hardware mandatory.
Are there parts with VIH/VIL much tighter than 0.7×VDD and 0.3×VDD?
Yes. Some parts sample the strap with a Schmitt-trigger input or a dedicated comparator, and the datasheet lists separate voltages. 0.7/0.3×VDD is only a general CMOS rule of thumb, so check the pin's own specification.
Is it safe to light the LED after waiting long enough after power-up?
The pin is read as a strap only at the instant of reset release, so lighting the LED afterward is not a problem. The danger is when the LED circuit is already passing current into the pin at that instant and affecting the latched voltage. A design in which firmware changes the GPIO direction before driving the LED is usually safe.
Is adding an external pull-up or pull-down to a strap pin itself a problem?
No. When the internal pull alone is weak and prone to noise and leakage, adding an external pull of the datasheet's value is sometimes recommended. The problem is picking a value such as "10kΩ for now" without calculating, so that the divider with the internal pull lands in the undefined band.

Standards and references

  • Espressif Systems, ESP32 Series Datasheet (Strapping Pins chapter) — The strap function of GPIO0/GPIO2/GPIO12(MTDI)/GPIO15, and the relation between GPIO12 and VDD_SDIO (flash voltage)
  • Espressif Systems, ESP32 Technical Reference Manual — Description of the internal pull-up and pull-down structure
  • STMicroelectronics, reference manuals of each STM32 series, "Boot configuration" — Boot mode selection by the BOOT0 pin
  • AMD/Xilinx, 7 Series FPGAs Configuration User Guide (UG470) — Function of the M[2:0] configuration mode pins
  • Strap pin tables in Ethernet PHY datasheets — PHY address and mode straps, and the pins shared with LED drivers

← All columns