Page 1 of 1

SD Card

PostPosted: Wed Oct 22, 2014 10:59 pm
by wpfundstein
Hi,

SD Card is not working. i use mbed compiler.

code (mbed)
Code: Select all
SDFileSystem sd(p16, p15, p13, p17, "sd"); // MOSI, MISO, SCK, CS

    FILE *fp = fopen("/sd/sdtest.txt", "w");
    if (fp) {
        fprintf(fp, "Hello fun SD Card World!");
        fclose(fp);
        pc.printf("write SD card done\r\n");
    } else {
        pc.printf("Could not open file for write\r\n");
    }


if i use the same code on mbed LPC1768 then it works,

the Wifi-DipCortex has two SPI Interfaces. Right? SPI-1 is for the CC3000 and SPI-0 is available for other. is this right?

Werner

Re: SD Card

PostPosted: Sun Oct 26, 2014 9:48 am
by Carl-SolderSplash
Hi,

I've not used that library before.

SPI1 is used by the CC3000, SPI0 is free.

The SD library could be changing part of the SPI peripheral configuration which effects both ports.

To solve this you really need to dig in to the code.

When you say it doesn't work, do you mean at all? so no wifi connection? does it enumerate on USB?

Re: SD Card

PostPosted: Tue Nov 04, 2014 1:00 pm
by wpfundstein
Hi, thanks for answer.

if i power up i can see signals on the spi. the problem is the fopen command. if i use no SD Card i got the error "no sdcard inserteed". otherwise the code hangs on fopen.

Werner