FAT32, fat entry not working

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

 

Hi guys,

 

I'm having some trouble with a FAT32 driver I'm writing.  I've created a folder that for all intents looks okay but when I insert the sd card into a pc and click on a folder it comes up with the following error.

 

 

 

And this is the fat entry in disk editor.

 

 

Does anyone have a sugestion? 

 

 

 

 

 

 

 

 

This topic has a solution.
Last Edited: Mon. Apr 15, 2019 - 09:30 PM
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Well for one thing you are using an 8.3 not LFN entry so you CANNOT use lower case. It must be FOLDER1.
.
After that I'd have to sit down and decode the other fields in the entry, like does the attribute say "directory"? Also what does the first cluster field say and what does that entry in the FAT say? Does the FAT chain have an end of chain marker or are there multiple clusters to this directory?

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

The command line still exists in Windows 10 so you can do a

chkdsk F: /v

 

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

perfect clawson.

 

Wm.

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

You mean it really was as simple as "folder1" versus "FOLDER1" then?

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

yup Clawson, it was.

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

I'll bite:  What does this remotely have to do with AVRs or Atmel or Microchip or related?  As I recall, I've posed this before for this poster.

 

[edit] Perhaps OP read

Compilers and General Programming

A forum for discussions about compilers and general programming topics not specifically related to a particular microcontroller.

as being open game, Atmel/AVR or not.  All problems can be solved here?  After all, Windows isn't a "particular microcontroller".  (I've always thought that the mission statement meant a particular model of AVR.)

COMMUNITY FORUMS

Choose a community area below to join the forum discussions.

...

AVR Freaks:  Since 2001! The preeminent AVR community for discussing everything related to Atmel's popular 8- and 32-bit AVR microcontrollers.

View the Discussions

 

  1. Home
  2. » Communities
  3. » AVR Freaks
  4. » Forums
  5. » Tools
  6. » Compilers and General Programming
  7. » FAT32, fat entry not working

 

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

Last Edited: Tue. Apr 16, 2019 - 02:00 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
You mean it really was as simple as "folder1" versus "FOLDER1" then?

Hmmm--nothing to do with the space in the file name?  From the Wikipedia article:

Furthermore, in these systems file and directory names are uppercase, although systems that use the 8.3 standard are usually case-insensitive (hence CamelCap.tpu will be equivalent to the name CAMELCAP.TPU).

The case-insensitive would be my experience, AFAICR.   For example, FATfs:

Legal Characters and Case Sensitivity

On the FAT filesystem, legal characters for object name (file/directory name) are, 0-9 A-Z ! # $ % & ' ( ) - @ ^ _ ` { } ~ and any extended character. The valid character codes of extended characters are depends on the configured code page. Under LFN supported system, also + , ; = [ ] and white space are legal for the object name and the white spaces and dots can be placed anywhere in the path name except for end of the name.

FAT filesystem is case-insensitive to the object names on the volume. Object name on the FAT volume is compared in case-insensitive. For instance, these three names, file.txt, File.Txt and FILE.TXT, are identical. This is applied to extended charactres as well. When an object is created on the FAT volume, up converted name is recorded to the SFN entry, and the raw name is recorded to the LFN entry when LFN function is enabled.

As for the MS-DOS and PC DOS for CJK (DOS/DBCS), extended characters are recorded to the SFN entry without up-case conversion and compared in case-sensitive. This causes a problem on compatibility with Windows system when any object with extended characters is created on the volume by DOS/DBCS system; therfore the object names with DBCS extended characters should not be used on the FAT volume shared by those systems. FatFs works with case-sensitive to the extended characters at only non-LFN with DBCS configuration (DOS/DBCS specs). But at LFN configuration, FatFs works with case-insensitive to the extended character (WindowsNT specs).

 

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

Last Edited: Tue. Apr 16, 2019 - 02:04 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

OK I'll bite. First the thread is "off topic", then you reply to it anyway? Curious.

 

EDIT oh and FatGen103 says:

 

Last Edited: Tue. Apr 16, 2019 - 02:57 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Okay then.  When I create a text file, it will display in windows with the long file name.  However, the folders displays has a 8.3 file name.  why?

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

So you are saying you have implemented LFNs ?

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

clawson wrote:
OK I'll bite. First the thread is "off topic", then you reply to it anyway? Curious.

Well, a moderator had already replied to the post, and did not see fit to address any possible miscreance.  So then the content >>must<< be appropriate, right?  Essentially, a request for clarification.

 

That doesn't stop me from spotting the embedded space in a scroll through the thread.  And indeed, I missed that it was a directory name ("folder 1" -- duh).  IME file names are usually handled as FATfs does it.  Your experience is different -- you used to work on floppy-based STBs, right?

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

Hi clawson, yes, I'm trying to implement long file names.  files display okay but the folders display in windows with the short file name.

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

Fianawarrior wrote:
Hi clawson, yes, I'm trying to implement long file names. 

Just curious -- how much did the license cost you?

I dug this up during an e-mail discussion with Horacio Gutierrez, Microsoft's corporate vice president and deputy general counsel of intellectual property and licensing, Gutierrez said, "We have a history of licensing the patents in this case through patent cross licensing agreements with other leaders in the car navigation space, including Kenwood, Alpine and Pioneer, and through our FAT LFN (File Allocation Table/Long File Name) patent licensing program, where we have 18 licensees to date." This is being done under Microsoft's FAT LFN File System Licensing Program.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

You don’t need a license to implement. To use it commercially you might want one.

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

license

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

Yep! Microsoft have patents on LFN.

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

holy shite! really!

lol, I'm from Ireland, we don't do licenses.

 

Slán

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

Fianawarrior wrote:
we don't do licenses.

Which is why I brought it up.  BTW, "licenses?"  Really?  *I gave you a link.

 

Kartman wrote:
You don’t need a license to implement. To use it commercially you might want one.

So OP is spending all the time to make a seemingly comprehensive LFN implementation, yet it will be one-off and existing implementations are not attractive in any way?

 

 

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

Fianawarrior wrote:

holy shite! really!

lol, I'm from Ireland, we don't do licenses.

 

 

Microsoft have a large office in Ireland, maybe they'll just send around a couple of lads to convince you otherwise!

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

Surely (most of) the long file name

patents have expired by now, no?

--Mike

 

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

Am I reading this right?

 

https://patents.google.com/patent/US5579517?oq=5%2c579%2c517

 

It appears that the patent actually expired today ?!? Or is that just Google being clever enough to say that "on this day the status is expired" ??

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

Anyway guys, clawson, would you have an idea why my long file name is not always being displayed?

 

I'm guessing it is something stupid, like not having the 8.3 name in caps.  Does the long name be padded with spaces and '.'?

Last Edited: Wed. Apr 17, 2019 - 03:21 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Because of the patent thing I have deliberately avoided ever getting involved in LFN. Everything I have done in FAT was done with 8.3 so I'm afraid you are on your own. Except to make the repeated point that FatGen103 is the "law". As long as you adhere to what it dictates you will create a FAT compatible system.

 

Obviously one way to do this also is to try and create whatever it is you are trying to create in both MCU and also either Windows/DOS or Linux/vfat then compare the MCU created data to the other. Anything different is wrong.

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

Thanks Clawson for your input.

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

found it, I had to pad the remaining field with 0xff.

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

Fianawarrior wrote:

 

holy shite! really!

lol, I'm from Ireland, we don't do licenses.

 

 

 

 

Microsoft have a large office in Ireland, maybe they'll just send around a couple of lads to convince you otherwise!

Send them round, I'm waiting on them.

EDITED, I have the main FAT routines sorted using long file names.  Just need to create the api...

 

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

Isn't that backward? You design the API first the fill in the implementation.

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

nope, not me.  I like to get in and get dirty with the systems first and then build the API to interface with it.  I never even really do any design on paper first either.

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

It's not a very professional approach. Bad habits can become very hard to shake. :-0

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

writing c for my own enjoyment.

Looks good on a cv too.

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

Fianawarrior wrote:
Looks good on a cv too.

Be sure to include this:

Fianawarrior wrote:

holy shite! really!

lol, I'm from Ireland, we don't do licenses.

 

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

lol

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

For the love and honour of God don't tell them...

Fianawarrior wrote:
I like to get in and get dirty with the systems first and then build the API to interface with it.  I never even really do any design on paper first either.

(but remember they may Google anything traceable you've already posted on the Internet)

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

lmfao, think I've smoked too much the night.  Just glad to have got FAT32 out of the way.  Next up is exFAT.

EDITED: partitons!

Last Edited: Wed. Apr 17, 2019 - 11:57 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Did you watch the football the night clawson?

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

In a my 50 odd years I don't think I've ever voluntarily watched any football! I'd sooner have my eyeballs extracted with rusty nails.

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

‘Ere we go!

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


Kartman wrote:
‘Ere we go!
clawson wrote:
In a my 50 odd years I don't think I've ever voluntarily watched any football! I'd sooner have my eyeballs extracted with rusty nails.

Instead of the rusty nails -- engage in American football and CTE instead.

 

 

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

Last Edited: Thu. Apr 18, 2019 - 11:55 PM