Kaynağa Gözat

Document conditional GPIO12 eFuse availability

SybexXx 3 gün önce
ebeveyn
işleme
66fd7fe45c

+ 17 - 18
code/components/jomjol_controlGPIO/BOARD_GPIO_PROFILES.md

@@ -24,30 +24,29 @@ and declares the capabilities that the requested mode needs.
 The current build selects BOARD_ESP32CAM_AITHINKER and defines
 __SD_USE_ONE_LINE_MODE__.
 
-The AI-Thinker profile exposes GPIO13 as one user-configurable digital pin
-when `__SD_USE_ONE_LINE_MODE__` is enabled. Startup order matters: main.cpp
-sets a pull-up on GPIO_SDCARD_D3 before mounting the card, mounts the SD card
-in 1-bit mode, and only later creates the generic GPIO handler. At that point
-DAT3 is not part of the active 1-bit data bus and the handler may reconfigure
-GPIO13 as input or output. The initial pull-up remains in place until the
-handler takes ownership of that pin.
-
-GPIO12 is deliberately still reserved. Although D2 is not assigned to the
-SDMMC host in 1-bit mode (`GPIO_SDCARD_D2 = GPIO_NUM_NC`), the board's SD
-socket still physically connects the card's DAT2 contact to GPIO12. GPIO12
-is also the ESP32 MTDI strapping pin that selects flash supply voltage and is
-sampled before firmware startup. Espressif documents a DAT2 pull-up conflict
-for 3.3 V flash modules, including in the 1-bit SD context. Do not release
-GPIO12 for a generic user function unless the exact module has its 3.3 V flash
-voltage eFuses permanently configured or DAT2 is physically isolated from
-GPIO12 and correctly biased. The firmware must not burn eFuses automatically.
+With `__SD_USE_ONE_LINE_MODE__` enabled, GPIO13 (DAT3) is available after
+SD-card mount. main.cpp sets its pull-up before mounting; the generic GPIO
+handler is created only after the mount has succeeded. DAT3 is not part of the
+active 1-bit data bus, so the handler may then reconfigure GPIO13 as a digital
+input or output.
+
+GPIO12 (DAT2) is also unused by the active 1-bit SDMMC data bus, but it is the
+ESP32 MTDI strapping pin. The AI-Thinker SD socket connects DAT2 to GPIO12, so
+a card-side pull-up can affect the boot-time VDD_SDIO strap. The profile now
+exposes GPIO12 only when the firmware reads all three eFuse fields
+`XPD_SDIO_FORCE`, `XPD_SDIO_REG`, and `XPD_SDIO_TIEH` as set, which forces
+VDD_SDIO to 3.3 V independently of MTDI. Otherwise GPIO12 remains reserved.
+This check is read-only: the firmware never programs eFuses. The 3.3 V setting
+is permanent and must be programmed separately by the owner after confirming
+the module's flash requirements. If the build changes to 4-bit SD mode, both
+DAT2 and DAT3 remain reserved.
 
 GPIO0, GPIO1, GPIO3, GPIO4, GPIO12 and all camera/SD/flash/memory pins are not
 general-purpose user pins. In particular:
 - GPIO0 is the camera XCLK and a boot-strapping pin.
 - GPIO1/GPIO3 are UART0 TX/RX.
 - GPIO4 is the board flash LED.
-- GPIO12 is DAT2 and the MTDI flash-voltage strapping pin.
+- GPIO12 is DAT2/MTDI and is available only when VDD_SDIO is forced to 3.3 V by eFuse.
 - GPIO2, GPIO14 and GPIO15 belong to the active 1-bit SDMMC interface.
 - Camera, flash/PSRAM and board status LED pins remain reserved.