I am working on file system middleware component to interface the SD card with lpc1768.I double checked all the resource requirements and configuraton of all the components required.Still, fmount function returns the fsMediaError and is unable to amount the memory drive.I have no clue of the issue. Can anyone please help me out on this ?
Am using the code given below to initialize and mount the sd card.
void sd_init(void) {fsStatus stat; SystemInit(); LPC_GPIO2->FIODIR=0XFFFFFFFF; printf ("Initializing and mounting enabled drives...\n\n"); /* Initialize and mount drive "M0" */ stat = finit ("M0:"); if (stat == fsOK) { stat = fmount ("M0:"); if (stat == fsOK) { LPC_GPIO2->FIOPIN=0xfffffff1; printf ("Drive M0 ready!\n"); } else if (stat == fsNoFileSystem) { /* Format the drive */ LPC_GPIO2->FIOPIN=0xfffffff2; printf ("Drive M0 not formatted!\n"); } else if (stat==fsMmediaError){ printf ("Drive M0 mount failed with error code %d\n", stat); LPC_GPIO2->FIOPIN=0xfffffff3; } } else { printf ("Drive M0 initialization failed!\n"); } printf ("\nDone!\n"); }
Have tried all of this, just cannot get sd card to mount.
I have followed this app note http://www.keil.com/appnotes/files/apnt_273.pdf to the letter but still does not work on spi3.
Has anyone managed to get STM32F407VG working with SD card on spi3?
Likely to be very few in a hijacked LPC1768 thread.
I don't suppose SPI3 is magically different from SPI1 or SPI2 in this context. Try presenting the board/chip specific code, the devil is in the detail.