Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years, 9 months ago.
Absolutely nothing Working?
I have an SD Card board, cheap from amazon, wired up to my Renbed (Its a version of the LPC11U24 mbed). I have wired up as all the tutorials suggest, and have a 2gb microSD in an adapter plugged into it. I have tried 3 tutorials now, every time no file is created on the card. I have added a few lines to change the state of an LED so i can see where the program fails, but it never changes state. The MBED official headers do NOT compile, so i am using another version, which claims to be updated - and it actually compiles. If i plug the SD card into my PC its blank. Any ideas on what could be happening?
Thanks in Advance!!
- include "mbed.h"
- include "SDFileSystem.h"
SDFileSystem sd(p5, p6, p7, p8, "sd"); DigitalOut myled(p21);
int main() { myled = 0;
FILE *file;
file = fopen("/sd/temp_data.txt", "w"); if(file == NULL) { myled = 1; wait(10); } fprintf(file, "Hello SD Card!\n\r");
- DOES a Fast flash but omitted for time being
- fclose(file); while(1) { myled = 1; wait(1); myled = 0; wait(1); }
}
Question relating to:
2 Answers
9 years, 7 months ago.
Try different sd card will help. This library is very picky to card. Even the same brand card cannot work for every card.
9 years, 7 months ago.
Hook up a terminal window to mbed. As I recall it does printf some SD error messages. Also make sure you have the most recent version of the SD library. There are also some comments about newer unofficial versions, if you read the user comments on the SDfilesystem page. The SPI clock rate is different in some of the versions. That should not be as issue unless you have a very old and slow SD card. Make sure the PC shows that it is formatted OK - they come formatted, but could get messed up.
If you ever hook it to 5V - it blows out the SD card - they can only handle 3.3V