how to add sdcard multi partition support on esp32 and esp32 s3
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
esp32: support SD card on ESP32C6
Summary
I wanted to use an SD card with my ESP32C6! This required making SDMMC support optional, since the ESP32C6 only has SPI.
I'm not sure about all of this code, especially the slot defaults and the condition combinations that I've implemented here, feedback is very welcome!
Testing
I've tested initialising an SD card and reading and writing data to and from it directly using readblock and writeblock. This seems to behave correctly, but formatting it using vfs.VfsFat.mkfs fails with EIO (and I don't understand why, as all the calls into machine_sdcard.c that I've traced so far have been successful). Maybe someone else can shed some light on this problem?
Trade-offs and Alternatives
This increases size a bit.
before:
bootloader @0x000000 18064 ( 14704 remaining)
partitions @0x008000 3072 ( 1024 remaining)
application @0x010000 1926480 ( 105136 remaining)
total 1992016
after:
bootloader @0x000000 18064 ( 14704 remaining)
partitions @0x008000 3072 ( 1024 remaining)
application @0x010000 1953376 ( 78240 remaining)
total 2018912
I don't think there are any very relevant alternatives besides not implementing SD support.