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
Check GPIO initialization and functionality related to the "Card Detect" pin associated with the SD card socket in your design/implementation
Thanks for reply. Is it compulsory to have Card detect pin selection? We are using mcbstm32f400 board.
Snehal.
Actually we are using old version MCBSTM32F400 board in which there was no SD card detect pin PH15. Now PH15 pin is already configured for application so we can't use that for SD card detect pin as change in hardware is not possible. Then is it possible to mount drive M0 on SD card? Request to support and reply.
Regards, Snehal.
hi,
I have now enabled card detect pin and now fmount don't give no media error. but now fmount returns fsmediaerror.
Can anyone please suggest what is reason of this error? Do we have to use any specific type of SD card?
I am new to Keil, request to support?
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