Hello Sir,
I am working on usb host using LPC2468 and i am using usb hostlite source code .I converted this source code compatible for FAT32 system.I am facing a problem when I create a file with extension RTF or DOC and try to write data less than 100kb and open this file on PC every thing is ok but when I write data greater than 100kb and try to open this file on PC there is a message on PC.
An unexpected error occurred while reading filename.
In USB hostlite WRITE_SIZE is given 10 * 1000000
what,s the reason for that?
Thanks & Regards Rohit
I'm not sure, what is the direct cause of your troulbe. Get more clues on your problem.
> An unexpected error occurred while reading filename
This error message suggests directory on the media is broken. Confirm it by reading out the directory sector from the media, using a disk utility on PC.
Disk Probe - Included in Windows install CD/DVD, in \Support\Tools folder or - Windows XP Service Pack 2 Support Tools " href= "http://www.theabsolute.net/sware/dskinv.html">www.theabsolute.net/.../dskinv.html
The structures of directory and its entries are described in MS FAT32 System spec msdn.microsoft.com/.../gg463080.aspx
There are easier explanations on the web, for example, www.easeus.com/.../root-directory-management-in-FAT32.htm
Interpret the sector read out, and specify broken field of directory entry.
These functions touch to directory entry.
usbhost_fat.c - FAT_CreateEntry() - make new entry - FAT_PutSFN() - Filename - FAT_UpdateEntry() - File length - FILE_Close() - File length
Now that on debugger, you'll trace why one of these function puts wrong value to the directory entry.
Tsuneo
Thanks Sir for your kind support
Sir, I notice that when i use 100 in place of MAX_BUFFER_SIZE which is 4000 in usbhostlite source code problem occur. but if i use MAX_BUFFER_SIZE equal to 4000 then there is no problem.
One thing more i want to confirm why WRITE_SIZE is (10 * 1000000) is there is any special reason for that?