This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

f_mkfs returns FR_DISK_ERROR

Hi all,

I my application I am interfacing SD card with nrf52 using FATFS file system. I am observing some weird behavior while doing this. I have two SD cards, one of 2GB sandisk and another of 8 GB Transcend. While using 2GB card all operations are happening properly like formatting card and writing to SD card. But when I am using 8 GB card and trying to format it I am unable to perform the operation. Following is my formatting function

  void sd_format()
  {
  BYTE work[_MAX_SS]; /* Work area (larger is better for processing time) */
  
  /* Create FAT volume */
  ff_result = f_mkfs("", FM_FAT32, 0, work, sizeof work);
  if (ff_result != FR_OK)
  {
      printf("Unable to format Disk\r\n");
      return;
  }
  if (ff_result == FR_OK)
  {
      printf("Format Complete...\r\n");
      return;
  }

}

I am getting FR_DISK_ERROR while executing f_mkfs function. What could be the possible reason for this.

Parents Reply Children
No Data
Related