FATFS SD/MMC example : does not detect FAT table on SD card

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Please help, this is the only case that does not work  from many code examples I tried from ASF3 library.

ASF3 FATFS example with SD card on SAME70 Xplained board does not recognize the FAT system on the card...

Card is mounted OK but doesn't see FAT table. It failed reading the first signature byte (reading is OK but the byte is not the one expected).  I tried to fake recognition by commenting out the code which reads the signature in ff.c file but the code "outsmarted" me - it failed on all subsequent FAT table readings :)

This is strange because I have SD card RAW example writing/reading binary operations and my PC sees FAT system on all those SD cards which I tried with this example (FAT and FAT32).

I even added f_mkfs() formatting code in the same FATFS with SD example to make sure that FAT table will be acceptable to the FATFS library... yet, after formatting returned with great success, the subsequent FAT table reading failed...

So,

  1. code reports the SD card is mounted OK
  2. number of pre-formated and tested SD cards inserted,
  3. also tried FATFS routine f_mkfs() formatting the card during the initialization, yet
  4. code fails to recognize FAT table (the reading itself did not fail).

Can somebody help please ?

 

Vlad.

Last Edited: Thu. Jul 18, 2019 - 06:30 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi, 

Were you able to solve your problem? If yes, please can you explain to me? I have the same problem.

 

Thanks,

 

Ide: Atmel Studio 7

ASF: version 3.47.0

Example: SD/MMC/SDIO Card FatFs Examle- SAME70-XPLD

Board: SAME70-XPLD

3rd Party: FatFs r0.09

Last Edited: Wed. Feb 19, 2020 - 10:57 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi again,

 

I saw the solution from that post (solution in post #3).  But this solution is not usable for me. Because, my project is include the cache memory. If you have any solution about that,  please feel free to inform me.

 

Thanks.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

 

I had similar problems and it took me weeks to solve them.

The problems disappeared after I replaced the ASF3 framework with the latest version. Older versions where missing a cache invalidate before the DMA transfer from/to the sdcard was initiated. The invalidating in the ASF framework is not really performance optimized because the entire cache gets invalidated. If you are looking for more performance you have to replace it by invalidate_by_address(). All the cache handling functions are part of the CMSIS (also use the latest version).

 

Best Regards

Markus

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi, 

 

Thanks your reply. My project was started lots of time ago by other guys and I'm adding some features to project. Because of that, its seems to difficult for me. But your advice very valuable for me. 

 

Thanks,