Windows XP error reading FAT16 SD card

C

Craig

I've got a bizarre problem reading SD cards on Windows XP. The cards
are formatted FAT16 and I am writing data to them from a
microcontroller. When I put the cards into a Windows XP machine, the
directories and files appear with the correct size and date and time
stamps. However, if I try to look at the properties of a file the
dialog that pops up says that it is zero bytes and does not know what
the date and time stamps are. If I try to open the file with Visual
Studio or Matlab I get an error that the file does not exist. But I can
open the drive in a hexeditor and see that the data is written to the
drive (with appropriate FAT and directory entries). I can also take the
SD card over to a Linux machine (I've used both Fedora Core3 and
Knoppix) and read and edit the files without any error messages.

For the record, I have verified that my code matches the Microsoft FAT
standard and I'm only using short file names. I've reformatted the
cards with both Linux and XP to be FAT16 with the appropriate cluster
size and everything. None of the formatting seemed to make a
difference. To speed up writing to the SD card on the microcontroller,
I preallocate the files to fill up all the available clusters in one
sector of the FAT. I've tried various other options for writing the
files with the microcontroller but none of them are fast enough to
support the data rate I need.

So... does anyone know what I'm doing wrong? Why does Linux not have a
problem with the file and WinXP does? Is there a difference in how the
two OS's read the master boot record, BIOS Parameter Block, or FAT? Why
does XP show the appropriate file info when I use My Computer but then
tell me that the files are zero size when I try to look at their
properties. Any help would be appreciated.

Thanks,
Craig
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top