fopen freezing my mbed
Topic last updated
02 Mar 2012, by
Roman Kuzmin.
3 replies
Some days before all is ok, but now after fopen mbed is freezing at all.
fp = fopen("/sd/test.txt", "w");
Please help.
Replies
you need to make sure you close the file too.. eg
FILE* DataFile = fopen ("/sd/data.txt","w"); // create/overwrite file
fclose(DataFile);
hope that helps
I'm getting the same problem. I want to use fopen just to test if the SD card is present at all, but when I call:
FILE *fp = fopen("/sd/log.txt", "a");
usb.printf("it freezes before here");
fclose(fp);
without a disk it freezes before getting to the printf. Shouldn't it give me a negative value for fp? If not, is there a way I can ask if there is an sd card without freezing anything?
Thanks!
SomeRandomBloke
#
02 Mar 2012
I have seen this problem from within the NetServices FSHandler doGet function.
I cant find the source code for the mbed implementation of fopen, anyone know where it is or is the source not available?
Thanks
Andrew
Please log in to post a reply.
Some days before all is ok, but now after fopen mbed is freezing at all.
fp = fopen("/sd/test.txt", "w");
Please help.