cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F407 SDIO FatFs: no connection to the µSD (no f_mount, no f_open)

Jakob Czekansky
Associate II
Posted on November 02, 2017 at 18:40

Hey Guys,

I am setting up some STM32F407VETx on a chinese breakout board with �SD-card-slot. 

I try to read data from the sd card with SDIO (SD 4 bits Wide bus) and FatFs.

The Basic-Project is build with STM32 CubeMx and programmed in the OpenSTM32 Workbench

My Problem: 

The SD Card is ALWAYS in 'FR_NOT_READY'. I am not able to mount  / open / write any data, because the �C is always stuck in the following function:

/**

* @brief Checks for error conditions for R1 response.

* @param hsd SD handle

* @param SD_CMD The sent command index

* @retval SD Card error state

*/

static uint32_t SDMMC_GetCmdResp1(SDIO_TypeDef *SDIOx, uint8_t SD_CMD, uint32_t Timeout)

{

   ...

}

Because of the timeout in this function i get an errorcode '1' (R/W Error ) in diskio.c

I've tried 3 boards, 3 SD-cards - nothing is broken! I have no clue, what to do... 

I am just using the 'basic' fatfs functions, as you can the in the attachment.

Please help me!

:(

Greets!

Ps.: If you need more information, please write some comment!

#sdio #error #sd #stm32f407 #sd-card #fatfs
11 REPLIES 11
Posted on December 02, 2017 at 02:07

Hi Haithem,

I found this post and found the issue, I also posted it to the main forum. Please see:

https://community.st.com/0D50X00009XkXg5SAF

It seems that the write and read interrupt and dma functions had state errors.

Regards,

Piet

Amel NASRI
ST Employee
Posted on December 07, 2017 at 10:13

Hello,

Please refer to

https://community.st.com/0D50X00009bMM8bSAG

and

https://community.st.com/0D50X00009XkXg5SAF

if you face similar issue at your end.

-Amel

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.