AnsweredAssumed Answered

CubeMX 4.1.5 + F7 1.4.0 + FatFS SD

Question asked by Turboman on Jun 27, 2016
Latest reply on Jun 28, 2016 by FTITI.Walid
Trying to get a project with the subject line working in SW4STM32.

However, if I try the fmount function with 0 (mount later), then fopen on a file, I get a not ready error. The same if I specify fmount with 1 (mount now)

I've read the app note for FatFS on ST parts and implemented as directed, but I've got various errors including command response timeout when initialising the card. I've tried different cards too - a 4GB and a 64GB uSD card.

Can anyone suggest any errors in the following CubeMX generated code I've modified:

  /* Initialize all configured peripherals */
  MX_GPIO_Init();
  MX_SDMMC1_SD_Init();


  /* USER CODE BEGIN 2 */
  BSP_SD_Init();
     //     Fatfs sanity check code
  /* Register work area to the default drive */
  fr = f_mount(&FatFs, SD_Path, 1);     //     Mount immediately


  /* Open a text file */
  fr = f_open(&fil, "message.txt", FA_READ);

Outcomes