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

microsd does not init

Hi, I followed the process of finit using stm32f4 discovery board (connected to microsd) and Kiel rtx, and received an error on finit but was able to format the microsd using the ARM in the next line. Anybody had such experience?

The only thing I did was change the pin assignment of cd (chip detect) from gpioh15 to gpioe15 because the chip did not have gpioh15.

Thx

Parents
  • There was no compile error, just that could not succesfully initialize when I do fnit, the error flag turns on as below

    while (finit(NULL)!= 0) { /* Wait until the Card is ready*/ if (!(count--)) { error_finit=1; break;
    }

    The good thing is that I was able to successfully format after that line as below
    fformat("M:SD_CARD / FAT32"); //format drive

    Which tells me the chip detect pin which I changed to port E does not work, so I'm trying to debug that.

    Thx

Reply
  • There was no compile error, just that could not succesfully initialize when I do fnit, the error flag turns on as below

    while (finit(NULL)!= 0) { /* Wait until the Card is ready*/ if (!(count--)) { error_finit=1; break;
    }

    The good thing is that I was able to successfully format after that line as below
    fformat("M:SD_CARD / FAT32"); //format drive

    Which tells me the chip detect pin which I changed to port E does not work, so I'm trying to debug that.

    Thx

Children
  • You haven't said what filesystem you're using.

    while( finit(NULL) != 0 )
    {
       /* Wait until the Card is ready */
       if( !(count--) )
       {
          error_finit=1;
          break;
       }
    }
    


    Doesn't finit() return a value to indicate the nature of the error?

    Or, is there some kind of global error variable, or a function to get the "last error"?

    If you have the source for the filesystem, have you stepped into finit() to see exactly where it's failing, and how?