Hi all,..
I have a Micro SD card wired up to my mbed.
Description: Mbed Pin : MicroSD Pin :
Mosi : p5 : 3
Miso : p6 : 7
CLK : p7 : 5
CS : p8 : 2
I've checked and double checked my wiring.
I've got the hello world SD card program.
#include "mbed.h"
#include "SDFileSystem.h"
SDFileSystem sd(p5, p6, p7, p8, "test"); //i, o, clk, cs, const : on the card 3,7,5,2
int main() {
printf("Hello World!\n");
FILE *fp = fopen("/test/ttt.txt", "w");
if(fp == NULL) {
error("Could not open file for write\n");
} else {
fprintf(fp, "Hello SD Card World!");
fclose(fp);
printf("Goodbye World!\n");
}
}
I've got TeraTerm so I can see whats happening.
and all I get is..
Hello World!
Not in idle state
Could not open file for write
I can write to the card with a PC, I've tried 2 different cards, I've tried 2 different mbeds, I've tried 3 different card holders (!! just in case) I've gone crazy with a multimeter to make sure everything is as it should be.
Can anyone verify that the SD Card libraries still work.
I'm half hoping something has broken them.. otherwise I've gone mad !
cheers
Dave.
Hi all,..
I have a Micro SD card wired up to my mbed.
Description: Mbed Pin : MicroSD Pin :
Mosi : p5 : 3
Miso : p6 : 7
CLK : p7 : 5
CS : p8 : 2
I've checked and double checked my wiring.
I've got the hello world SD card program.
#include "mbed.h"
#include "SDFileSystem.h"
SDFileSystem sd(p5, p6, p7, p8, "test"); //i, o, clk, cs, const : on the card 3,7,5,2
int main() {
printf("Hello World!\n");
FILE *fp = fopen("/test/ttt.txt", "w");
if(fp == NULL) {
error("Could not open file for write\n");
} else {
fprintf(fp, "Hello SD Card World!");
fclose(fp);
printf("Goodbye World!\n");
}
}
I've got TeraTerm so I can see whats happening.
and all I get is..
Hello World!
Not in idle state
Could not open file for write
I can write to the card with a PC, I've tried 2 different cards, I've tried 2 different mbeds, I've tried 3 different card holders (!! just in case) I've gone crazy with a multimeter to make sure everything is as it should be.
Can anyone verify that the SD Card libraries still work.
I'm half hoping something has broken them.. otherwise I've gone mad !
cheers
Dave.