[NUCLEO-L476RG] Configure SDMMC peripheral
Posted: Fri Sep 10, 2021 9:42 am
Hi All,
I'm using a STM32 NUCLEO-L476RG board with an external SDCARD shield (that is wired using only CMD, CLK and D0 pins). I've tested this configuration using STM32CubeIDE and C programming (without using micropython) and it works. Next I've cloned micropython from git repo and I've compiled it as it's write in the ports/stm32/readme.md file, and all works fine (REPL, import modules, etc.). Now I'm trying to enable SDMMC periph that it's wired to the external SD shield but I don't understand how I can configure it, I've tried to add the lines:
in the mpconfigboard.h in boards/NUCLEO_L476RG folder, but when the board runs, it waits long time (I think it tries to mount the SD Card) and the message MPY: can't mount SD card is shown before starting the REPL:
I also obtain a OSError: [Errno 19] ENODEV if I try to use the os module to mount a pyb.SDCard object. Can anyone help me to understand how what steps I've to follow to enable the SDMMC peripheral on micropython? Thanks for your support...
I'm using a STM32 NUCLEO-L476RG board with an external SDCARD shield (that is wired using only CMD, CLK and D0 pins). I've tested this configuration using STM32CubeIDE and C programming (without using micropython) and it works. Next I've cloned micropython from git repo and I've compiled it as it's write in the ports/stm32/readme.md file, and all works fine (REPL, import modules, etc.). Now I'm trying to enable SDMMC periph that it's wired to the external SD shield but I don't understand how I can configure it, I've tried to add the lines:
Code: Select all
#define MICROPY_HW_ENABLE_SDCARD (1)
#define MICROPY_HW_SDCARD_SDMMC (1)
// SD card detect switch
#define MICROPY_HW_SDMMC_D0 (pin_C8)
#define MICROPY_HW_SDMMC_D1 (pin_C9)
#define MICROPY_HW_SDMMC_D2 (pin_C10)
#define MICROPY_HW_SDMMC_D3 (pin_C11)
#define MICROPY_HW_SDMMC_CK (pin_C12)
#define MICROPY_HW_SDMMC_CMD (pin_D2)
Code: Select all
MPY: sync filesystems
MPY: soft reboot
MPY: can't mount SD card
MicroPython v1.17-8-gbbbdef4cc-dirty on 2021-09-09; NUCLEO-L476RG with STM32L476RG
Type "help()" for more information.
>>>