cancel
Showing results for 
Search instead for 
Did you mean: 

sdio fatfs problem

elec_st
Associate III
Posted on January 17, 2014 at 01:56

i use fatfs with sdio

but i have problem with this

SD_Init(); return 0 good

disk_initialize(0);  return 0 good

 disk_status(0) ; return 2 error

disk_read(0,inbuf,0,1);  return 3 error

 
6 REPLIES 6
Posted on January 17, 2014 at 02:13

Looks to be throwing a not ready error, have you set up the pin for the Card Detect (CD) input that is tested by SD_Detect().

Presumably you have the source, and could track this down?
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
chen
Associate II
Posted on January 17, 2014 at 10:49

Hi

Silly question....

Is the SD card formatted (FAT16 or FAT32)?

elec_st
Associate III
Posted on January 17, 2014 at 15:13

SD_Detect();  return 1 error

uint8_t SD_Detect(void)

{

  __IO uint8_t status = SD_PRESENT;

  /*!< Check GPIO to detect SD */

  if (GPIO_ReadInputDataBit(SD_DETECT_GPIO_PORT, SD_DETECT_PIN) != Bit_RESET)

  {

    status = SD_NOT_PRESENT;

  }

  return 0;    // i modified this to return 0

}

now

SD_Detect();  return 0 good

SD_Init(); return 0 good

disk_initialize(0);  return 0 good

 disk_status(0) ; return 2 error

disk_read(0,inbuf,0,1);  return 3 error

Posted on January 17, 2014 at 16:17

Then you'll need to do some debugging of your code, and hardware attachment. I have nothing to work with here.

Validate that your SDIO code is functioning outside of FatFs properly.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
elec_st
Associate III
Posted on January 17, 2014 at 17:54

The original post was too long to process during our migration. Please click on the provided URL to read the original post. https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I6nK&d=%2Fa%2F0X0000000bvc%2Fwsx6IjShfUmnSUw0sbzzqYzIXXBrTebAwNDi5QkLddY&asPdf=false
elec_st
Associate III
Posted on January 17, 2014 at 18:40

thank you clive1 no fatfs work with me my mistake i make  SD_Detect returnt with zero

but i make it return with 1 no it work thank you.

uint8_t SD_Detect(void)

{

  __IO uint8_t status = SD_PRESENT;

  return 1;

}