[NUCLEO-L476RG] Configure SDMMC peripheral
Posted: Fri Sep 10, 2021 11:11 am
Hi All,
I'm using a STM32 NUCELO-L476RG board with an external SDCARD shield that use the SDMMC peripherl (only CMD, CLK and D0 pins). I've tested the shield with STM32CubeIDE and C programming and it works. Now 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.). I'm trying to enable SDMMC peripheral that it's wired to the shield, but I don't understand how I can configure it, I've tried to add the line
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 get also a OSError: [Errno 19] ENODEV if I try to mount the SD using os module and pyb.SDCard class. Could someone help me to understand how I've to correctly configure the SDMMC peripheral? Thanks all for the support...
I'm using a STM32 NUCELO-L476RG board with an external SDCARD shield that use the SDMMC peripherl (only CMD, CLK and D0 pins). I've tested the shield with STM32CubeIDE and C programming and it works. Now 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.). I'm trying to enable SDMMC peripheral that it's wired to the shield, but I don't understand how I can configure it, I've tried to add the line
Code: Select all
#define MICROPY_HW_ENABLE_SDCARD (1)
#define MICROPY_HW_SDCARD_SDMMC (1)
#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.
>>>