Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Problem reading certain filenames using FAT32

Status
Not open for further replies.

JavierMA

New Member
Hi all,

I am reading an SD card formatted with FAT32 and I am able to read the short name (the 8 bytes + the 3 bytes for the extension, all characters in capital letters) of the file or even the long name when there are at least two sequences. Nevertheless, I am not able to read the filename when the name is short (i.e. I have a file named end.txt that I could find as END TXT, but could not find the end.txt text). Is there any attribute or field that tells me the name is in lowercase, so I can get end.txt?


Thanks,
Javier
 
Remember.. FAT libraries need to be written... Microsoft have had a lifetime to get it right.. There are several fat32 libraries I found the one they use on the arduino is good .. Also you can get the fat32 from MicroC, but there are many.... Most are free.... If you let the guy's here know what compiler you are using and which micro, you'll get tons more help.
 
Hi Ian,
I am developing my own library for the Tiva C (TM4C123GH6PM to be more concrete) in Code Composer Studio to be used in future projects and I could find very useful information at https://www.pjrc.com/tech/8051/ide/fat32.html about how FAT32 works and how to read the short filename, but there is no information about long filenames. As you mentioned several libraries, do you have any useful link I can have a look at?


Thanks,
Javier
 
One thing I do remember is FAT8 had to be exact case MSDOS and DRDOS could not differentiate from upper / lower case characters... But I thought this was long gone..

TinyFAT on the sourceforge site is available... Lots of developers use it.. But its 16 not 32.. https://github.com/greiman/SdFat is a starting place.
 
Hi again,

Thank you Pommie and Ian for the links provided. In this case the one provided by Pommie had the key to my answer, so many thanks for it. For what I could see, my problem was that I wasn't reading correctly the information in offset 12 (here it says if either the basename or the extension are in capital letters) when the value at offset 11 is not the 0x0F used for long filenames, as for filenames of exactly 8 bytes + file extension only the short name is stored.

Soon the updates will be available at https://github.com/Javierma/SD-card-TivaC-library


Thanks,
Javier
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top