Replies: 1 comment 4 replies
-
@wvthoog The IDF sdcard driver is not currently supported on S2. If you're interested in making this work, the reason is that the S2 doesn't support MMC, and our driver doesn't check that. (It needs to use the It also possibly needs to change some other defaults, see a similar change for S3 support: |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
so i'm trying to get the Lolin SD card shield to work with a Lolin S2 Mini and decided to rebuild the firmware to include it (since it's not enabled by default) I'm using ESP-IDF version 4.4 and the latest clone of Micropython
Then i edited the file mpconfigboard.h in the ports/esp32/boards/LOLIN_S2_MINI directory to enable the sdcard
#define MICROPY_HW_ENABLE_SDCARD (1)
and started the build
idf.py -D MICROPY_BOARD=LOLIN_S2_MINI build
Unfortunately it fails with the following error
/home/wvthoog/projects/other/audiotour/micropython/ports/esp32/machine_sdcard.c: In function 'machine_sdcard_make_new': /home/wvthoog/projects/other/audiotour/micropython/ports/esp32/machine_sdcard.c:185:35: error: implicit declaration of function 'SDMMC_HOST_DEFAULT'; did you mean 'SDSPI_HOST_DEFAULT'? [-Werror=implicit-function-declaration] sdmmc_host_t _temp_host = SDMMC_HOST_DEFAULT(); ^~~~~~~~~~~~~~~~~~ SDSPI_HOST_DEFAULT /home/wvthoog/projects/other/audiotour/micropython/ports/esp32/machine_sdcard.c:185:35: error: invalid initializer /home/wvthoog/projects/other/audiotour/micropython/ports/esp32/machine_sdcard.c:194:50: error: 'VSPI_HOST' undeclared (first use in this function); did you mean 'FSPI_HOST'? self->host.slot = slot_num ? HSPI_HOST : VSPI_HOST; ^~~~~~~~~ FSPI_HOST /home/wvthoog/projects/other/audiotour/micropython/ports/esp32/machine_sdcard.c:194:50: note: each undeclared identifier is reported only once for each function it appears in /home/wvthoog/projects/other/audiotour/micropython/ports/esp32/machine_sdcard.c:222:30: error: 'GPIO_NUM_23' undeclared (first use in this function); did you mean 'GPIO_NUM_43'? .gpio_mosi = GPIO_NUM_23, ^~~~~~~~~~~ GPIO_NUM_43 /home/wvthoog/projects/other/audiotour/micropython/ports/esp32/machine_sdcard.c:248:9: error: unknown type name 'sdmmc_slot_config_t'; did you mean 'sdspi_slot_config_t'? sdmmc_slot_config_t slot_config = SDMMC_SLOT_CONFIG_DEFAULT(); ^~~~~~~~~~~~~~~~~~~ sdspi_slot_config_t /home/wvthoog/projects/other/audiotour/micropython/ports/esp32/machine_sdcard.c:248:43: error: implicit declaration of function 'SDMMC_SLOT_CONFIG_DEFAULT'; did you mean 'SDSPI_SLOT_CONFIG_DEFAULT'? [-Werror=implicit-function-declaration] sdmmc_slot_config_t slot_config = SDMMC_SLOT_CONFIG_DEFAULT(); ^~~~~~~~~~~~~~~~~~~~~~~~~ SDSPI_SLOT_CONFIG_DEFAULT /home/wvthoog/projects/other/audiotour/micropython/ports/esp32/machine_sdcard.c:83:11: error: request for member 'gpio_cd' in something not a structure or union config.pin_var = pin_or_int(arg_vals[arg_id].u_obj) ^ /home/wvthoog/projects/other/audiotour/micropython/ports/esp32/machine_sdcard.c:254:9: note: in expansion of macro 'SET_CONFIG_PIN' SET_CONFIG_PIN(slot_config, gpio_cd, ARG_cd); ^~~~~~~~~~~~~~ /home/wvthoog/projects/other/audiotour/micropython/ports/esp32/machine_sdcard.c:83:11: error: request for member 'gpio_wp' in something not a structure or union config.pin_var = pin_or_int(arg_vals[arg_id].u_obj) ^ /home/wvthoog/projects/other/audiotour/micropython/ports/esp32/machine_sdcard.c:255:9: note: in expansion of macro 'SET_CONFIG_PIN' SET_CONFIG_PIN(slot_config, gpio_wp, ARG_wp); ^~~~~~~~~~~~~~ /home/wvthoog/projects/other/audiotour/micropython/ports/esp32/machine_sdcard.c:259:24: error: request for member 'width' in something not a structure or union slot_config.width = width; ^ /home/wvthoog/projects/other/audiotour/micropython/ports/esp32/machine_sdcard.c:265:23: error: implicit declaration of function 'sdmmc_host_init_slot'; did you mean 'sdspi_host_init_slot'? [-Werror=implicit-function-declaration] check_esp_err(sdmmc_host_init_slot(self->host.slot, &slot_config)); ^~~~~~~~~~~~~~~~~~~~ sdspi_host_init_slot cc1: some warnings being treated as errors [1296/1302] Building C object esp-idf/main/CMakeFiles/__idf_main.dir/home/wvthoog/projects/other/audiotour/micropython/lib/littlefs/lfs2.c.obj ninja: build stopped: subcommand failed. ninja failed with exit code 1
So my question is, does Micropython actually support sd cards for the Lolin S2 Mini ? And secondly, do i need to define more variables in mpconfigboard.h ? If so, which ones
Thanks for reading
Regards,
Wim
Beta Was this translation helpful? Give feedback.
All reactions