IDF中如何读写文件?

Mars.CN
Posts: 45
Joined: Tue Jan 11, 2022 1:36 am

IDF中如何读写文件?

Postby Mars.CN » Mon Sep 05, 2022 9:31 am

用fopen打开文件总是返回NULL,不管文件是否存在,都返回NULL
FILE *wp = fopen("/a.txt","w");
或者
FILE *wp = fopen("/a.txt","r");

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

ESP_igrr
Posts: 2071
Joined: Tue Dec 01, 2015 8:37 am

Re: IDF中如何读写文件?

Postby ESP_igrr » Tue Sep 06, 2022 8:54 pm

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.

linzhe85
Posts: 1
Joined: Tue Nov 15, 2022 10:15 am

Re: IDF中如何读写文件?

Postby linzhe85 » Wed Jan 18, 2023 7:09 am

你好,遇到同样问题,请问你这边解决了吗

Who is online

Users browsing this forum: No registered users and 68 guests