cancel
Showing results for 
Search instead for 
Did you mean: 

SDMMC FatFS f_open invalid drive -> CubeMX Init

dennis23
Associate II
Posted on May 28, 2016 at 16:40

The original post was too long to process during our migration. Please click on the attachment to read the original post.
5 REPLIES 5
Posted on May 28, 2016 at 17:34

It is impossible for me to answer any topic of this forum... :(

''Sign into forum'' on upper right hand side, and then reply to posts.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
dennis23
Associate II
Posted on May 28, 2016 at 22:27

Hi clive1,

thanks for that hint. A few minutes ago I got an ''unhandled error'' when I try to log in. After a few tries it work for me...

To my µSD problem. Do I have to add

      // SD init

      HAL_SD_ErrorTypedef resSd = HAL_SD_Init(&hsd1, &SDCardInfo1);

      resSd = HAL_SD_WideBusOperation_Config(&hsd1, SDMMC_BUS_WIDE_4B);

because I can't find any of these function calls in the created initialization code. Both of the commands returning error 3 back -> Timeout... The SD clock is internal set to 48 MHz and the prescaler for SD is set to 18 => (48 MHz)/(18 + 2) => 2.4 MHz

I think this is a good frequency to test a debugging system.

I do not know why this is a big problem. The other code is working really good, so the last thing is the µSD card.

tansheyong
Associate
Posted on June 03, 2016 at 09:18

Hi debegr,

Wonder if you successfully solve the issue?

I have ran into the same situation where f_mount returns FR_INVALID_DRIVE.

I am using STM32F7 chip with SW4STM32.

dennis23
Associate II
Posted on June 04, 2016 at 10:43

hi tan.she_yung,

oh glad, I am not the only one.

Well, I think since the last few bugs in CubeMX it is not impossible, that there is an error in the generated code. There is still the error with the F7 microcontrollers, that the SCMMC clock can't be enabled in CubeMX. My currently generated code is based on the CubeMX 4.9.0 and I do not know what the problem is. Where do you put your test code? In the fatfs.c or in the main.c?

There are a few sheets and papers from ST and also from Elm Chan how to test and work with the FatFS but with exactly this code I am not able to write or read files from my SD card.

Hope we can together get this working! Would be very helpful. Please stay in contact! You can also write me private.

petr239955
Associate III
Posted on June 05, 2016 at 17:25

Hi,

do you try this https://my.st.com/c964d235 ?

Petr