Page 1 of 1

GPIO alternate function trouble

Posted: Wed Jun 03, 2026 2:17 am
by mondo90
Hi,

I am reading thru the Esp32-p4_technical_reference_manual_en and it very unclear even for a simple query. For instance, I see some example code used GPIO14 for SDIO function, however in the documentation there is no alternate function for GPIO14! So how in the world it works?

Re: GPIO alternate function trouble

Posted: Wed Jun 03, 2026 3:13 am
by Sprite
If by 'alternate function', you mean the IOMUX setting of that pin, you'd be correct. SD-card signals are mappable either using the IOMUX functionality of GPIO37-48, or to any GPIO (that is not otherwise used) using the GPIO matrix; the example uses the latter. If you're used to other microcontrollers, it's good to keep in mind that IO allocation isn't nearly as restricted on the ESP32; with a few exceptions (e.g. analog functions, peripherals that need a phy for IO like USB or MIPI and some high-speed periperals like Ethernet) you can allocate any IO function to any GPIO pin.