This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

STM32 FSMC+SDIO

I have MassStorage example for STM32F103VC with SD card by SDIO

If I comment GLCD rutines SD card works.
But when I uncomment GLCD lines fmount always returns fMediaError

int main (void) {

/*  GLCD_Initialize    ();
  GLCD_Clear         (Blue);
  GLCD_SetBackColor  (Blue);
  GLCD_SetTextColor  (White);
  GLCD_DisplayString (0, 0, 1, "    USB Device      ");
  GLCD_DisplayString (1, 0, 1, "    MSC Class       ");
  GLCD_DisplayString (2, 0, 1, "Mass Storage Example");
  GLCD_DisplayString (4, 0, 1, "  USB: Memory Disk  ");
  GLCD_DisplayString (8, 0, 1, "  Keil Tools by ARM ");
  GLCD_DisplayString (9, 0, 1, "    http://www.keil.com    ");*/

fs = finit              ("M0:");           /* Initialize SD Card 0               */
if (fs == fsOK)
 fs = fmount             ("M0:");           /* Mount SD Card 0                    */
  if(fs == fsOK)
  {
    USBD_Initialize    (0);               /* USB Device 0 Initialization        */
    USBD_Connect       (0);               /* USB Device 0 Connect               */
  }

  osThreadTerminate  (osThreadGetId());
}

Parents
  • It is original Keil example without modification.(only added chesk function results).
    SDIO use PC8,9,10,11,12 and PD2

    FSMC use GPIOE 1,7,8,9,10,11,12,13,14,15, GPIOD 0,1,4,5,7,8,9,10,11,14,15

    fmount returns fsMediaError and after that GPIOC->CRH = 0x444B444B;
    So alternative function pins are only PC8 (SDIO_D0) and PC12 (SDIO_CK)

    if I remove GLCD lines GPIOC->CRH = 0x444BBBBB after fmount returns fsOK

    PS : I tried all FSMC and SDIO traces on pcb.(my board) Everything OK

Reply
  • It is original Keil example without modification.(only added chesk function results).
    SDIO use PC8,9,10,11,12 and PD2

    FSMC use GPIOE 1,7,8,9,10,11,12,13,14,15, GPIOD 0,1,4,5,7,8,9,10,11,14,15

    fmount returns fsMediaError and after that GPIOC->CRH = 0x444B444B;
    So alternative function pins are only PC8 (SDIO_D0) and PC12 (SDIO_CK)

    if I remove GLCD lines GPIOC->CRH = 0x444BBBBB after fmount returns fsOK

    PS : I tried all FSMC and SDIO traces on pcb.(my board) Everything OK

Children
No data