AnsweredAssumed Answered

FATFS STM32F4-Discovery

Question asked by schuch.lucas on Apr 8, 2015
Latest reply on Apr 8, 2015 by schuch.lucas
Hi,

I am trying to do a memory stick reading in the STM32F4-Discovery board.

In order to test it, I am running the application example located in the following path:
STM32Cube\Repository\STM32Cube_FW_F4_V1.5.0\Projects\STM32F4-Discovery\Applications\FatFs\FatFs_USBDisk

My problem is that I am getting the following error when I try to open a file: (File: ff.c Function: find_volume())

/* Find an FAT partition on the drive. Supports only generic partitioning, FDISK and SFD. */
     bsect = 0;
     fmt = check_fs(fs, bsect);                         /* Load sector 0 and check if it is an FAT boot sector as SFD */
     if (fmt == 1 || (!fmt && (LD2PT(vol)))) {     /* Not an FAT boot sector or forced partition number */
          UINT i;
          DWORD br[4];


          for (i = 0; i < 4; i++) {               /* Get partition offset */
               BYTE *pt = fs->win.d8+MBR_Table + i * SZ_PTE;
               br[i] = pt[4] ? LD_DWORD(&pt[8]) : 0;
          }
          i = LD2PT(vol);                              /* Partition number: 0:auto, 1-4:forced */
          if (i) i--;
          do {                                        /* Find an FAT volume */
               bsect = br[i];
               fmt = bsect ? check_fs(fs, bsect) : 2;     /* Check the partition */
          } while (!LD2PT(vol) && fmt && ++i < 4);
     }
     if (fmt == 3) return FR_DISK_ERR;          /* An error occured in the disk I/O layer */
     if (fmt) return FR_NO_FILESYSTEM;          /* No FAT volume is found */


I tried to format my memory stick, but it still is not working.

What "FR_DISK_ERR /* An error occured in the disk I/O" means?
Do you have any clues?

Thanks in advance!



 

Outcomes