Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion boards/esp32s3-usb-otg/Makefile.dep
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ ifneq (,$(filter vfs_default,$(USEMODULE)))
endif

ifneq (,$(filter mtd,$(USEMODULE)))
USEMODULE += mtd_sdcard_default
ifneq (,$(filter sdcard_spi,$(USEMODULE)))
# use SD Card in SPI mode if sdcard_spi is explicitly enabled
USEMODULE += mtd_sdcard_default
else
# use SDMMC host for the SD Card otherwise
USEMODULE += mtd_sdmmc_default
endif
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this need an "else" case to include mtd_sdcard_default?

Copy link
Contributor Author

@gschorcht gschorcht May 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had the else branch in the initial commit d1774e6, but I had to remove it with commit 9960a62 because the compilation of tests/pkg/fatfs failed because both mtd_sdmmc_default and mtd_sdcard_default were enabled for this application.

BOARD=esp32s3-usb-otg make -j4 -C tests/pkg/fatfs info-modules
...
mtd
mtd_sdcard
mtd_sdcard_default
mtd_sdmmc
mtd_sdmmc_default

The reason seems to be that the Makefile of this application enables mtd_sdcard unconditionally. We should probably change this Makefile in near future. But for this PR, it works in that way and it is defined in same way for the esp32-wrover-kit board.

Copy link
Contributor Author

@gschorcht gschorcht May 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same problem is given for tests/pkg/fatfs_vfs.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I see. I'd feel comfortable merging this intermediate solution if you opened a second PR or issue, so that we don't lose track of it and possibly introduce unforeseen behavior.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@crasbe I just provided PR #21478 which should fix the dependency problem for default MTDs in these test applications. Once PR #21478 is merged, rebasing this PR should fix the dependency problems.

endif

ifneq (,$(filter disp_dev,$(USEMODULE)))
Expand Down
1 change: 1 addition & 0 deletions boards/esp32s3-usb-otg/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ include $(RIOTBOARD)/common/esp32s3/Makefile.features
# additional features provided by the board
FEATURES_PROVIDED += periph_adc
FEATURES_PROVIDED += periph_pwm
FEATURES_PROVIDED += periph_sdmmc
FEATURES_PROVIDED += periph_spi
FEATURES_PROVIDED += periph_uart
FEATURES_PROVIDED += periph_usbdev
Expand Down
8 changes: 7 additions & 1 deletion boards/esp32s3-usb-otg/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ The main features of the board are:
| 8 MByte Flash | yes |
| USB Type-A Host Interface | no |
| USB Type-A Device Interface | yes |
| SD Card Slot | yes (SPI mode) |
| SD Card Slot | yes |
| LCD Color Display 240 x 240 | yes |

## Hardware {#esp32s3_usb_otg_hardware}
Expand Down Expand Up @@ -108,6 +108,12 @@ UART_DEV(0):RxD | GPIO44 | USB-to-UART bridge | \ref esp32_uart_interfaces "UA
</center>
\n

@note
SPI_DEV(1) is only configured if the `sdcard_spi` module is explicitly added to
the `USEMODULE` in the application's Makefile to access the SD card in SPI mode.
By default, the SDMMC host is configured and used by the `periph_sdmmc`
module to access the SD card.

For detailed information about the peripheral configurations of ESP32-S3
boards, see section \ref esp32_peripherals "Common Peripherals".

Expand Down
24 changes: 24 additions & 0 deletions boards/esp32s3-usb-otg/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,30 @@ extern "C" {
#endif
/** @} */

/**
* @name SD/MMC host controller configuration
* @{
*/

/** SDMMC devices */
static const sdmmc_conf_t sdmmc_config[] = {
{
.slot = SDMMC_SLOT_1,
.cd = GPIO_UNDEF,
.wp = GPIO_UNDEF,
.clk = GPIO36,
.cmd = GPIO35,
.dat0 = GPIO37,
.dat1 = GPIO38,
.dat2 = GPIO33,
.dat3 = GPIO34,
},
};

/** Number of configured SDMMC devices */
#define SDMMC_CONFIG_NUMOF 1
/** @} */

/**
* @name SPI configuration
*
Expand Down