Hi,
I'm currently working on a project which utilizes a SD card to store files on.
I have been working with the ATA File System provided by TI, but have found it's behavior to be unpredictable.
Being able to create, navigate, and modify files using the ATA File System has proved problematic.
Below are some of the tests I've conducted with the file system and the results.
Performed the following Test:
Opened a file, wrote 512 bytes, rewind, read 512 bytes, close.
Reopened the file, wrote 44 bytes, rewind, read 512 bytes, close.
The filed opened with no issue in Windows, and the data was correct.
Performed the following Test:
Opened a file, wrote 512 bytes, wrote 512 bytes, rewind, read 512 bytes, close.
Reopened the file, wrote 44 bytes, rewind, read 512 bytes, close.
The file was corrupted when opened in Windows.
I have found some work arounds for the issues I've discovered.
For instance, if a file is closed but the file pointer isn't at EOF, then the file will be reported corrupted by Windows when you try to open it.
Work around, put a seek(file, 0xFFFFFFFF) to make sure the file pointer is at EOF before closing.
Additional problem discovered, if a file pointer is at EOF, seek(file, 0xFFFFFFFF) shouldn't be called, instead just close the file, otherwise the file will be reported corrupted by Windows when you try to open it.
Has anybody else seen behavior similar to this?
Also, I based all my tests off of the CSL 3.04 CSL_MMCSD_SdCardFSExtExample project.
Thanks,
Ben
Performed the following Test:
Opened a file, wrote 512 bytes, rewind, read 512 bytes, close.
Reopened the file, wrote 44 bytes, rewind, read 512 bytes, close.
The filed opened with no issue in Windows, and the data was correct.
Performed the following Test:
Opened a file, wrote 512 bytes, wrote 512 bytes, rewind, read 512 bytes, close.
Reopened the file, wrote 44 bytes, rewind, read 512 bytes, close.
The file was corrupted when opened in Windows.