cancel
Showing results for 
Search instead for 
Did you mean: 

SDMMC2 on STM32F767 (pyboard D series) / f_mount returns FR_NOT_READY

MarHash
Associate

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.0693W00000Hp7WTQAZ.png0693W00000Hp7WOQAZ.png 

Extra note: I have been able to setup SDIO for the STM32F405 (used for another pyboard too).

2 REPLIES 2

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
MarHash
Associate

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?