Page 1 of 1

IDF中如何读写文件?

Posted: Mon Sep 05, 2022 9:31 am
by Mars.CN
用fopen打开文件总是返回NULL,不管文件是否存在,都返回NULL
FILE *wp = fopen("/a.txt","w");
或者
FILE *wp = fopen("/a.txt","r");

都不好使
确定flash已经关在到/了

Re: IDF中如何读写文件?

Posted: Tue Sep 06, 2022 8:54 pm
by ESP_igrr
Have you mounted fatfs before calling fopen? If yes, please make sure that the file you are opening is under the mount point. For example, if fatfs has been mounted to /data, the file path has to be /data/a.txt.

Re: IDF中如何读写文件?

Posted: Wed Jan 18, 2023 7:09 am
by linzhe85
你好,遇到同样问题,请问你这边解决了吗