diff --git a/components/fatfs/.build-test-rules.yml b/components/fatfs/.build-test-rules.yml index f5ce9a3225..737e82b7db 100644 --- a/components/fatfs/.build-test-rules.yml +++ b/components/fatfs/.build-test-rules.yml @@ -2,10 +2,6 @@ components/fatfs/test_apps/sdcard: disable_test: - - if: IDF_TARGET in ["esp32s3", "esp32c2", "esp32c6"] + - if: IDF_TARGET in ["esp32s3", "esp32c2", "esp32c6", "esp32h2"] temporary: true reason: No sdspi runners for these targets - disable: - - if: IDF_TARGET == "esp32h2" #wait for SDSPI IDF-6244 - temporary: true - reason: esp32h2 not supported diff --git a/components/fatfs/test_apps/sdcard/README.md b/components/fatfs/test_apps/sdcard/README.md index ea5910c71b..639f1d386d 100644 --- a/components/fatfs/test_apps/sdcard/README.md +++ b/components/fatfs/test_apps/sdcard/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-S2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | This test app runs a few FATFS test cases in a FAT-formatted SD card. diff --git a/components/fatfs/test_apps/sdcard/main/test_fatfs_sdspi.c b/components/fatfs/test_apps/sdcard/main/test_fatfs_sdspi.c index a9ee9c1fb0..86c74d8b65 100644 --- a/components/fatfs/test_apps/sdcard/main/test_fatfs_sdspi.c +++ b/components/fatfs/test_apps/sdcard/main/test_fatfs_sdspi.c @@ -40,7 +40,13 @@ #define SDSPI_CLK_PIN 5 #define SDSPI_CS_PIN 1 #define SPI_DMA_CHAN SPI_DMA_CH_AUTO -#endif //CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32C3 +#elif CONFIG_IDF_TARGET_ESP32H2 +#define SDSPI_MISO_PIN 0 +#define SDSPI_MOSI_PIN 5 +#define SDSPI_CLK_PIN 4 +#define SDSPI_CS_PIN 1 +#define SPI_DMA_CHAN SPI_DMA_CH_AUTO +#endif #ifndef SPI_DMA_CHAN #define SPI_DMA_CHAN 1 diff --git a/docs/docs_not_updated/esp32h2.txt b/docs/docs_not_updated/esp32h2.txt index fe90572602..dd7115b173 100644 --- a/docs/docs_not_updated/esp32h2.txt +++ b/docs/docs_not_updated/esp32h2.txt @@ -43,10 +43,8 @@ api-reference/storage/sdmmc api-reference/storage/mass_mfg api-reference/storage/index api-reference/storage/nvs_partition_parse -api-reference/peripherals/sdspi_share api-reference/peripherals/usb_host api-reference/peripherals/usb_device -api-reference/peripherals/sdspi_host api-reference/peripherals/i2s api-reference/peripherals/temp_sensor api-reference/peripherals/spi_features diff --git a/examples/storage/sd_card/sdspi/README.md b/examples/storage/sd_card/sdspi/README.md index 2dc54fab4a..e5676dd587 100644 --- a/examples/storage/sd_card/sdspi/README.md +++ b/examples/storage/sd_card/sdspi/README.md @@ -38,12 +38,12 @@ This example doesn't utilize card detect (CD) and write protect (WP) signals fro The table below shows the default pin assignments. -SD card pin | SPI pin | ESP32 pin | ESP32-S2, ESP32-S3 | ESP32-C3 and other chips | Notes -------------|---------|---------------|--------------------|---------------------------|------------- - D0 | MISO | GPIO2 | GPIO37 | GPIO6 | - D3 | CS | GPIO13 (MTCK) | GPIO34 | GPIO1 | - CLK | SCK | GPIO14 (MTMS) | GPIO36 | GPIO5 | - CMD | MOSI | GPIO15 (MTDO) | GPIO35 | GPIO4 | 10k pullup +SD card pin | SPI pin | ESP32 pin | ESP32-S2, ESP32-S3 | ESP32-H2 | ESP32-C3 and other chips | Notes +------------|---------|---------------|--------------------|----------|---------------------------|------------- + D0 | MISO | GPIO2 | GPIO37 | GPIO0 | GPIO6 | + D3 | CS | GPIO13 (MTCK) | GPIO34 | GPIO1 | GPIO1 | + CLK | SCK | GPIO14 (MTMS) | GPIO36 | GPIO4 | GPIO5 | + CMD | MOSI | GPIO15 (MTDO) | GPIO35 | GPIO5 | GPIO4 | 10k pullup #### ESP32 related notes diff --git a/examples/storage/sd_card/sdspi/main/Kconfig.projbuild b/examples/storage/sd_card/sdspi/main/Kconfig.projbuild index e7dce05f06..71d6d10191 100644 --- a/examples/storage/sd_card/sdspi/main/Kconfig.projbuild +++ b/examples/storage/sd_card/sdspi/main/Kconfig.projbuild @@ -12,6 +12,7 @@ menu "SD SPI Example Configuration" default 15 if IDF_TARGET_ESP32 default 35 if IDF_TARGET_ESP32S2 default 35 if IDF_TARGET_ESP32S3 + default 5 if IDF_TARGET_ESP32H2 default 4 # C3 and others config EXAMPLE_PIN_MISO @@ -19,6 +20,7 @@ menu "SD SPI Example Configuration" default 2 if IDF_TARGET_ESP32 default 37 if IDF_TARGET_ESP32S2 default 37 if IDF_TARGET_ESP32S3 + default 0 if IDF_TARGET_ESP32H2 default 6 # C3 and others config EXAMPLE_PIN_CLK @@ -26,6 +28,7 @@ menu "SD SPI Example Configuration" default 14 if IDF_TARGET_ESP32 default 36 if IDF_TARGET_ESP32S2 default 36 if IDF_TARGET_ESP32S3 + default 4 if IDF_TARGET_ESP32H2 default 5 # C3 and others config EXAMPLE_PIN_CS