1


I am programming the STM32F0 (Keil uVision 5).

I've tried to use FatFs library to manage a file system (SD card). I've writen every initialization functions and the project is compiling without any errors / warnings. But first function f_mount doesn't work properly. The function call is:

const char sciezka = '0' ;
FATFS *fs = (void *) 0;
fresult= f_mount (fs, &sciezka, 1);

Function doesn't even reach the line with disk_initialize. And I get fresult "FR_NOT_ENABLED" (f_mount -> find_volume : : : : : after line fs = FatFs [vol] fs pointer is still NULL).

FatFs library with the examples is on the fatFs website : http://elm-chan.org/fsw/ff/en/mount.html

Please tell me what I should do with it.

HynHiX
  • 11
  • 1
  • 3

2 Answers2

3

Your FAFTS variable is a null pointer. Use a local variable. Like this.

FATFS fs;
f_mount(&fs, "0:", 1);
veeman
  • 780
  • 1
  • 8
  • 17
0

Also, check the SD card specs, on STM32F407, it does supply at most 2.9-3V. When you use 5V, SD Card module works better.