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

fmount function returns fsNoMedia, error code 0x0A

Hi,

I am using Keil version 5.23 and controller STM32F417IGHx and SD card MicroSD 128MB.
SD card drive M0 is getting initialized using function finit but when I am trying to use function
fmount, function always returns value 0x0A which I think is fsNoMedia = Media device is
not inserted.

SD card is present in its slot on hardware.

Can you guide me why I am getting this issue?

Regards,
Snehal

Parents Reply Children
  • Hi, I see this is quite an old post but you may need to do the following as I had a similar issue:-
    put the following code into the source

    /**
      Callback function used to read Card Detect (CD) pin state when
      Memory Card is used in SPI mode.
      \param[in]  drive_num                Memory Card Drive number
      \return     1:card detected, 0:card not detected, or error
    */
    int32_t fs_mc_read_cd (uint32_t drive_num) {
      (void)drive_num;
    
      return (1);
    }
    
    
    /**
      Callback function used to read Write Protect (WP) pin state when
      Memory Card is used in SPI mode.
      \param[in]  drive_num                Memory Card Drive number
      \return     1:write protected, 0:not write protected, or error
    */
    int32_t fs_mc_read_wp (uint32_t drive_num) {
      (void)drive_num;
    
      return (0);
    }
    

    This will return that the card is present and not write protected.

    Hope this helps