STM32 : FatFs Library - f_mount

久未见 提交于 2020-01-06 19:29:34

问题



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.


回答1:


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

FATFS fs;
f_mount(&fs, "0:", 1);


来源:https://stackoverflow.com/questions/37897576/stm32-fatfs-library-f-mount

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!