2021-12-18 10:28 PM
Hi, I am trying to setup SDMMC2 interface with an SD card. I am using the pyboard d series therefore I am using the SWDIO and SWDCLK pins. The schematic of the board is here (https://micropython.org/resources/PYBD_SFxW_schematics.pdf).
According to the schematic, the SWDCLK pin is the same as PSD_DET for the SDMMC2 (pin PA14) which I use to detect the SD card connection to the socket (tested and it works).
I am using the latest version of CubeMX (6.4.0) to generate the code.
I have not setup a UART so I am using the RGB LED for debugging. While attempting to mount the SD card file system, f_mount returns FR_NOT_READY which seems to be a stumbling issue for many people.
I tried the following solutions:
1- Enabled DMA
2- Enabled internal pull-ups on all SDMMC2 pins (except clock)
3- Reduced clock speed
With all the above, f_mount never returned FR_OK.
I have attached the main.c file, the clock configuration and SDMMC2 configuration.
I would like any insights to help overcome the issue.
Thanks.
Extra note: I have been able to setup SDIO for the STM32F405 (used for another pyboard too).
2021-12-19 07:33 AM
The GPIO test is coming from the DISKIO layer, via the SDIO/SDMMC BSP layer.
Just fake the Card Present test in the case where the debugger is active. Perhaps a line or two of code, you have all the source.
2021-12-19 08:54 PM
Thank you for the reply. I am not sure I follow why I need to (or how to ) fake the test. Do you mean that the card is being detected during the debugger's operation?