Problems using SD cards

27 Aug 2012

Hi all, the following code has worked properly on mbed LPC1768 (embedding tha last firmware version) until update to revision 41 of precomplied build of mbed libraries. The reported error (not existing before the upgrade) is: "No disk, or could not put SD card in to SPI idle state". Please, take in account that the - FatFileSystem library is the one reported at http://mbed.org/users/mbed_unsupported/code/FatFileSystem/ - SDFileSytem library is the one reported at http://mbed.org/users/simon/code/SDFileSystem/

Anyone have any idea what happens?

include "mbed.h"
include "SDFileSystem.h"

int main()
{
    SDFileSystem Logger(p5, p6, p7, p15, "SDCard"); 
    FILE *fp = fopen("/SDCard/trial.txt", "w");
    fprintf(fp, "Hello, World!");
    fclose(fp);
    while (1);
}

Best regards Vincenzo

25 Aug 2012

Please use the code tags for clarity (click on Editing tips)

include "mbed.h" 
include "SDFileSystem.h"

int main() { 
     SDFileSystem Logger(p5, p6, p7, p15, "SDCard"); 
     FILE *fp = fopen("/SDCard/trial.txt", "w"); 
     fprintf(fp, "Hello, World!"); 
     fclose(fp); 
     while (1); 
}

In my projects I also include the FatFilesystem:

#include "FATFileSystem.h"
27 Aug 2012

Tanks Gert.

I tried to adopt your solution. Unfortunately the result is not changed.

Best Regards Vincenzo

27 Aug 2012

Updated my mbed to latest firmware version and checked if it works OK. But.. I am using the SDHCFileSystem library, it is more recent and supports larger cards.

27 Aug 2012

Have you already tried another SD card?

28 Aug 2012

Please take in account that I have updated my firmware to the latest version and an old version of the same code works well. I can try to test the SDHCFileSystem library. It is possible to have the exact URL for this library?

Best regards V

06 Nov 2012

V, did you find a work around to this? I was running code Build 39 just fine. Then when I update to Build 41 all things go to hell and now it won't compile.

07 Nov 2012

Hi oharp. The build 41 is working fine now (I used the SDHCFileSystem library at the URL http://mbed.org/users/shintamainjp/code/SDHCFileSystem/ and the FatFileSystem library at the http://mbed.org/users/mbed_unsupported/code/FatFileSystem/).

Best Regards V

07 Nov 2012

Not sure what changed but using the FatFileSystem library at the http://mbed.org/users/mbed_unsupported/code/FatFileSystem did the trick! Thanks!