QUERY · ISSUE
how to add sdcard multi partition support on esp32 and esp32 s3
enhancement
Is there any chance to add sdcard multi partition support on ESP32 or esp32 s3?
I noticed that stm32 supports sdcard multi partition
https://github.com/micropython/micropython/issues/2730
Any suggestions will be thanks
CANDIDATE · PULL REQUEST
esp32: Improve machine.SDCard support on newer chips
port-esp32
Summary
Updating the esp32 port machine.SDCard support for other chips:
- Added support for configuring pins in SD/MMC mode on ESP32-S3. Closes #8514. Closes #16526.
- Added support for SDCard in SPI mode on ESP32-S2, C3 and C6. This is a little restrictive on C3 and C6 as they only have one available SPI bus, so can't use this and
machine.SPItogether. Have enabled on all boards by default (the code size impact is about 4KB). - Explicitly disable slot 0 on original ESP32 (and document this). There are effectively zero ESP32 boards in the world that can use slot 0 for SDMMC.
This work was funded through GitHub sponsors
TODO
- Final docs pass
[ ] ESP32-S3 SDCard object should print the additonal pin configEDIT: Actually SDCard has no print support on esp32, so leaving this off.
Testing
Manual testing with SD card breakout module:
- ESP32-S3 in SDMMC mode with custom pins.
- ESP32-S3 in SPI mode on both hosts.
- ESP32-C3 in SPI mode.
- ESP32-C6 in SPI mode.
- ESP32-S2 in SPI mode on both hosts.
- ESP32 in SDMMC and SPI modes.
Note that testing is easier if cherry-picking #16700 fix into the branch.
Trade-offs and Alternatives
- Could drop the commit that enables SDCard on SPI-only chips if preferable, and update docs to suit. Although on balance I think it's still potentially useful.