AnsweredAssumed Answered

stm32F0 sd Card FATFS

Question asked by Amor.Ben_amor on Jun 28, 2015
Latest reply on Jun 29, 2015 by Clive One
Hi
I am using stm32f0 to wtrite and read from sd card using FATFS.Every thing is ok  : integration of FATFS files and making the correct hardware connection.I can communicate with the sd card for example to get its properties.
 My problem is that i can't write or read in it.
I make this simple program to read from it:

  memset(&FS32, 0, sizeof(FATFS));
  res = f_mount(0, &FS32);
  res = f_open(&fil,"CONFIG.TXT",FA_READ);
  res = f_read(&fil, Buffer, sizeof(Buffer), &BytesRead);
  res=f_close(&fil);

after debuggging this program :
res = FR_OK
BytesRead =4 (number of caracters in the text file)
Buffer is empty??
I can't see where is the problem.
 NB: the sd card is formatted  FAT32.

Outcomes