machine.SDCard() fails with OSError: 16 on ESP32-P4 (ESP32_GENERIC_P4 firmware) (Micropython) #188887
-
ESP32-P4
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
|
OSError: 16 is EBUSY — the driver is trying to claim a peripheral that's already in use or not properly released. On the ESP32-P4 this almost certainly means SDMMC support in ESP32_GENERIC_P4 firmware is incomplete or misconfigured for the built-in slot. 1. Force SPI mode with explicit pins (most reliable workaround right now):
Adjust the pin numbers to match your board's pinout — check your ESP32-P4 board schematic for the SD SPI pins. 2. Add a soft reset before initialising:
Sometimes the SDMMC peripheral isn't released cleanly on boot. 4. Check firmware maturity — ESP32-P4 MicroPython support is still relatively new. Check the [MicroPython ESP32 port changelog] (https://github.com/micropython/micropython/blob/master/CHANGELOG.md) and consider building from the latest master branch, as P4 SDMMC fixes may not be in a stable release yet. 5. Report upstream — If SPI mode works but native SDMMC doesn't, this is worth filing as a bug at [micropython/micropython] with (https://github.com/micropython/micropython/issues) test results. The P4 port is actively being developed and your findings would be valuable. |
Beta Was this translation helpful? Give feedback.
-
|
Since you’ve confirmed the hardware is strictly wired for SDMMC and the standard software resets aren't clearing the OSError: 16, it appears we’ve reached the limits of current firmware support. The 'Busy' error on the P4 usually points to a pending fix needed in the MicroPython C-source for this specific port’s IOMUX or power domain initialization. Since we’ve narrowed it down to a driver/firmware limitation rather than a configuration error, could you please mark this as 'Answered' so it can help others troubleshooting the P4 and It will also help the community track which peripherals still need active development. Best of luck with the rest of your project 👍 |
Beta Was this translation helpful? Give feedback.
Since you’ve confirmed the hardware is strictly wired for SDMMC and the standard software resets aren't clearing the OSError: 16, it appears we’ve reached the limits of current firmware support. The 'Busy' error on the P4 usually points to a pending fix needed in the MicroPython C-source for this specific port’s IOMUX or power domain initialization.
Since we’ve narrowed it down to a driver/firmware limitation rather than a configuration error, could you please mark this as 'Answered' so it can help others troubleshooting the P4 and It will also help the community track which peripherals still need active development.
Best of luck with the rest of your project 👍