问题描述
我正在编程STM32F0(Keil uVision 5).
我试图使用FatFs库来管理文件系统(SD卡).我已经编写了每个初始化函数,并且该项目正在编译,没有任何错误/警告.但是第一个函数f_mount无法正常工作.函数调用为:
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);
函数甚至没有通过disk_initialize到达那一行.我得到了狂热的"FR_NOT_ENABLED"(f_mount-> find_volume:::::在行fs = FatFs [vol] fs指针仍然为空之后).
带有示例的FatFs库位于fatFs网站上: http://elm-chan.org/fsw/ff/en/mount.html
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
请告诉我该怎么办.
推荐答案
您的FAFTS变量为空指针.使用局部变量.这样.
Your FAFTS variable is a null pointer. Use a local variable. Like this.
FATFS fs;
f_mount(&fs, "0:", 1);
这篇关于STM32:FatFs库-f_mount的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!