Hello, I want to initialize the fat32 file system for usb host on at91sam9260.I am having problem in checking the boot signature.My application is to read/write the text file from the mass storage device.I am doing such task (implementing the file system)first time...So plz help me regarding this....Thank you.....
Also let me know the exact steps of enumeration of the newly attached device so that i can check it check it with whatever i hv written...I think i have done it successfully but i jz want to confirm it.......Thank you.....
That would be in the USB spec, surely?
Yeah Its okay,but the main problem m facing is about fat32...Plz let me know how to initialize the fat32 for the usb host on at91sam9260,more deeply m having problem in checking the boot signature...PLz reply ASAP coz i have a deadline to complete the project... Thank you...
If this is a commercial project, then you get payed based on the assumption that you are skilled enough to do the work.
If this is a school project, the plan is that you should either have picked up the required information or have the knowledge and time to search for whatever information you need.
It is trivial to Google to find the information about the boot sector for FAT file systems. So if you can just read a sector, you should be able to check what signatures you see. Don't see any signature? Then your memory isn't formatted, or your read doesn't function as it should.
So exactly where are you stuck?
Hello, I am a Student of Post Graduation,have completed engineering.We are developing the USB host port on the AT91SAM9260 board.Main application is if we connect any mass storage device (pen drive) to the host then it should copy the existing .TXT file to another blank file.so i want to implement the fat file system to read/write the file.so plz guide me on this.... Thank you...
So you still haven't told us where you are stuck. You are basically said that you haven't spent any time looking at the problem but want someone else to guide you.
There are basically two routes to go if you want professional guiding - hire a consultant or take a suitable class.
Another thing here is that you say that you want to implement the FAT file system. That is a sentence that says that you want to write code that processes the data structures of a FAT file system. Obviously, that requires you to read up on all the huge amount of information already available.
If you do not want to implement the FAT file system, then you have to get an existing implementation. Guess what - then you need to read up on what exists.
But whatever you do, you either have to spend own time dividing this into multiple, smaller, steps. Or pay for someone to deliver a turn-key system.
So - what part of this project did you actually plan to do yourself?
> I am a Student of Post Graduation,have completed engineering.We are developing the USB host port on the AT91SAM9260 board.
Is "FAT32 host implementation" your homework assigned by your teacher? Or, is it just a part of a greater project?
If it is your homework, you are supposed to realize the details of four-layered protocols; 1) AT91SAM9260 USB host interface - control/bulk transfer - enumeration 2,3) Mass-Storage Class Bulk-Only Transport - SCSI commands 4) FAT32 file system In this case, we discuss on the way how each protocol works, and the way how the protocols interact each other.
If it is just a part of a project, you are supposed to apply existing libraries to make it quickly. In this case, we'll discuss on available libraries.
Which one?
Tsuneo
Hi Tsuneo, Thanx for the reply.This task is just a part of a greater project.I have code of usb hostlite fat32 implementation for reference.Firstly i want to clear 1 thing..I m using the usb hostlite code for the my usb host implementation(that is for at91sam9260) with respective changes because both are OHCI standered. Is it okay??? And 2nd thing is I am following your advices to implement fat32 on for the same...from the link http://www.keil.com/forum/20503/ Now tell me m i on the right way???
Hello sir, Basically i am trying to initialize the fat32 for usb host but m having problem in checking the boot signature.When i am checking the boot signature, its return value is other than 0xAA55.I don't know how to check again to get the boot signature.In my project i am using RTX RTOS.Plz let me know how to solve the problem... Thank you...
Same exact question you have asked for a number of days now.
No information exactly what you have tried.
No information telling us that you have actually formatted any file system.
No information what you do see instead of that expected boot signature.
Hello sir Thanx for your quick reply. Sorry, i'l explain u every thing... I am using AT91sam9260, there is provision to implement the usb host port.I am using the using the usb host source code for lpc 2468 with respective changes.I have successfully completed up to the mass storage drivers initialization.now i want to implement the file system because in my application i have to read & write the text file. I am new to this ARM family and this is the task i am doing first time.
I read some documents regarding fat32 file system.I come to know that the boot signature for fat32 is 0xAA55 but in my code i got the value representing no file system found. I dont know what exact steps to be followed to do it...and from last few days i was completing the hardware part.So please tel me the exact steps to be followed to implement the file system...
You are repeating yourself.
I did ask specific questions - you are not giving specific answers.
Have anyone formatted the memory media? If not formatted, then it will obviously not exist any signature in the boot sector.
If the memory media has been formatted with a FAT file system - exactly what contents do you see if you read the boot sector?
hello sir, Thanks again for quick reply. sorry but i am confused now and depressed too... memory media is not formatted,please tel me how to do?I will do accordingly.. Thank you....
Are your device needing the ability to format the memory media?
If the answer is no - then maybe insert the memory media in a PC/Mac and format it?
Hello sir, Still i am not able to read the boot sector after the disk formatted with PC.. what should i do now??? I am using usb hostlite code (of lpc 2468)to implement fat32 file system (for at91sam9260),is it okay???
Hello sir, after formatting the memory media in a PC,i checked it but it gives the same result,that is it gives the return value of "No fat volume is found"....Plz tel me what should i do now??? Thank you...
what is the boot sector hex bytes? have you formatted the drive with system file? but disable protection at beginning.
> I m using the usb hostlite code for the my usb host implementation(that is for at91sam9260) with respective changes because both are OHCI standered. Is it okay???
Fine. The code of NXP USBHostLite is well organized. You may easily replace the USB hardware layer (usbhost_lpc2468.c or usbhost_lpc17xx.c) into an other host engine. Also, the FAT support layer may be replaced to FatFs by Chan for FAT32 support.
> that is it gives the return value of "No fat volume is found"....Plz tel me what should i do now???
Sound like the sector read (READ10) fails. Confirm this error first. Just after the enumeration (Host_EnumDev()) in the main(), call MS_BulkRecv() to read the first sector (MBR: Master Boot Record) from the USB stick. Compare the contents of the sector buffer with the sector data read out by a PC. How do these data differ? - For example, the first 64 bytes matches, but latter part differ, etc.
To read out a sector on a 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
Also, I recommend you to try as many USB sticks as you have. The implementation of USB sticks often have anomaly from the standard. Some USB sticks require tweaks to get them run.
Hello sir, Thanx for the reply.. I checked it with the sector data read out by the PC but it completely differ from that whatever sector received in buffer...so what should be the next step to check it???
How about debugging???
You have now come about as far as I suggested one week ago - to verify if there is a file system there, and if your read code is able to correctly read the existing contents.
Debugging is a major part of software development. And something you need to spend own time with. Trying to ask a web forum for every single step isn't a productive route. If you write the flash read code yourself, you have to compare your code with the requirements specified in datasheets. If you have copied the code from some other project, you have to figure out if that other project can correctly read the data. If yes - then you have to figure out why your copied code can't.
Hello, After checking with pen drive having fat32 file system(transend 8 GB pen-drive i am using),but sector buffer does not match with that checked it on PC...is there any problem in initialization process???
You always just write "does not match" or "completely different". That doesn't really tell much.
But exactly _what_ are you seeing? Hints that you read data but it is corrupted? Or always empty data? Or what? Debugging is about looking at whatever clues you have and try to deduce potential error sources. Or trying to figure out how a test can be changed to give better clues.
Hello sir, sector buffer always shows all the fields Zero...
It couldn't have hurt too much to have written that information in one of your first posts? Have you verified that the hardware actually makes an attempt to access the memory? Have you verified that the relevant hardware pins are reacting? That the memory chip is correctly connected? And powered?
Are you using your own hardware design or an existing evaluation board that have sample code to access this flash memory? Does there exist any sample code somewhere that _can_ access the flash memory, even if your specific project seems to fail?
It is obviously not meaningful to consider any FAT16 or FAT32 or other file system until your specific hardware together with your specific memory access code is able to read and write data correctly when accessing the flash. Then, and only then, will it be meaningful to look at the building blocks that depends on working flash access. So FAT32 or USB is irrelevant until read/write of flash sectors works.
Hello sir, I am using my own designed hardware and the hardware actually makes an attempt to access the memory as i checked it after the enumeration process...I think there is problem in passing the drive address on which file system is to be mounted, but i am not sure...by knowing the initialization procedure of fat, i want to check is the problem actually exists or is there any other problem?? Thank you...
View all questions in Keil forum