Hello, I'm trying to setup the flash-fs library with SPI SD-card on STM32F100 device. I've modified the SPI_STM32F100x.c driver to match with SPI2 device and needed I/O (CS, SD detect..)
The finit(), fformat() and fopen() functions are working. I'm able to format the card, create new files or open an existing file.
The problem comes when I try to write data into a file : nothing is written on the file. However, the fputs() function I'm using is returning 0 (OK).
I'm using RTX and the flash-fs library is used in a task :
/* Wait until the Card is ready*/ retv = finit ("M0:"); if(retv == 0) { // Card initialized sucessfully // Open/create output file fout = fopen("M0:\\test.txt","w"); if (fout != NULL) { // Write text in the file salut = fputs("fhghr", fout); // Close file fclose (fout); } } else if (retv == 1) { // Card not initialized } else if(retv == 2) { // Card is not formatted retv = fformat ("M0:Breitling /FAT32"); if (retv == 0) { // Format OK } else { // Cannot format }
Can someone try to help me?
Thanks and bests regards
Michaël