10 years, 1 month ago.

Issues with the SDCard library and Nucleo F103

I just tested my SDCard and the reader using an Arduino UNO and it works.

I then plugged my KL25Z board in, and used the mbed library for SD cards, and it worked perfectly.

No luck, at all on the Nucleo board. The odd thing is that I can use the Nucleo, and SPI to run a TFT (ILI9341 controller) without any trouble at all. It will not work with the SD card. I can't seem to figure it out.

Any help would be much appreciated. I have dumped several hours into this and it doesn't seem to work. I have even hooked up a logic analyzer and have not been able to figure it out. It just isn't communicating. All params are the same (SPI clock speed, etc).

L293D

I encountered similar experience as you did, ie. I could write to SD card on FRDM KL 46Z but unable to do the same on Nucleo 401RE. ( time out error, not idle state )

posted by samira samilan 23 Apr 2014

2 Answers

7 years, 3 months ago.

Very strange, When I import your project, and compile on F030R8. It works just fine. But using the same library with a newer mbed library doesn't work. Why it should be affected by the mbed library..Do you have any idea? please let me know why

10 years, 1 month ago.

  1. include "mbed.h"
  2. include "SDFileSystem.h" ST Nucleo F030R8 DigitalOut myled(LED1); MOSI, MISO, SCLK, CS, name SDFileSystem sd(PA_7, PA_6, PA_5, PB_6, "sd");

int main() { printf("\nWait for new connection...\n");

mkdir("/sd/mydir", 0777);

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

while(1) {

} }

While I appreciate it, I have tried that code (and every other example I can find)...I can not seem to get it to work on the F103 board. Works like a charm on the KL25Z. Just not the Nucleo.

posted by Jerod Weaver 09 Mar 2014