fopen freezing my mbed

30 Oct 2011

Some days before all is ok, but now after fopen mbed is freezing at all.

fp = fopen("/sd/test.txt", "w");

Please help.

05 Nov 2011

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

24 Feb 2012

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!

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.