Hello everyone
I am working on LPC2468 usb host with mass storage class . I am using NXP usb hostlite example as a base. I converted this source code for FAT32 system. It,s working fine for KIGNSTON 8 GB, SANDISK 4 GB pendrive. But when i used Hp 8 GB pendrive , it works fine sometime or sometime not.when I debug through the software the value of HOST_RhscIntr is not changing to 1. What,s the reason behind it.
is the hp pendrive in your pcoket. check the fluff. probably a dirty connector.
Yes, sometimes it remains in my pocket.but it,s connector is covered by a cap.But I cann,t understand how pc detect it without any problem.
So you need to look closer at why it is not changing to 1!
Look at your two examples that do work, and compare what's happening with the one that doesn't work.
"What,s the reason behind it"
There is a bug (or bugs) in your software that you just happen to get away with for the KIGNSTON 8 GB, SANDISK 4 GB pendrives, but your luck runs out with the the HP drive.
This is the big difference between just trying something a couple of times and saying, "it works" - and fully testing it to ensure that it complies with all conditions and requirements!
Either the thumb drives are differently formatted and that trig some issue.
Or there is a difference between they have different power requirements.
Or they may have different timing requirements.
Step 1 is to debug. And the lovely thing is that you have a situation where different memories gives different results - that is very good, because then you can compare. If none of the memories had worked, you would have had a way harder problem to fight.
CAN BE THE BUG IN THUMB DRIVE. LIKE LOTS OF SD CARDS HAVE BAD TIMINGS AND STUFF.
And the lovely thing is that you have a situation where different memories gives different results - that is very good, because then you can compare. lucky you, this means that you can debug your way backwards to find the actual place where the difference originates.
Erik
DON'T SHOUT!
Even if it is a bug in the HP drive, you said yourself that the PC accommodates it!
Far more likely a bug in your firmware.
www.catb.org/.../smart-questions.html
No, no, no no.
Lots of SD cards have not bad timings and stuff.
It is far more likely that lots of card reader software have bad timings and stuff.
Why else is almost all cards working when used in a PC, while lots of embedded equipment (MP3 players, cameras, data loggers etc) have issues with some cards?
If you think that maybe more time was invested in testing for the PC products, then you are close - real close - to the correct answer.
Too much embedded equipment gets released after having been tested with 3-4 different memory cards.
But when you buy memory cards, they are sold in many different speed classes. These speed classes obviously do affect how the card can be used...
Depending on flash type, and number of parallel flash memory chips, they will have different transfer rates. Different cards can also have different flash controllers. The standard do specify limits for timings of different signals - but normally only in one direction.
And there are also many different ways you can legally format a memory card - even two cards of same size. You can have one or two FAT tables. You can have different offset of root directory. You can have different number of root directory entries. You can have different sector size. Different cluster size. With partition table or without.
There are lots of parameters in the master boot record that can be optionally configured differently - and the reading firmware needs to learn to support these differences.
today my pastor said "The PC in church can not read my power point on this pen drive" I said "Is it a HP stick" he replied "yes".
My best guess is that USB is becoming the new RS-232 where the manufacturers (or developers) save a penny by ignoring the specs and just state "this solution works with most".
Thus a HP stick that is 'just' within specs will not work on units that do not (in some respect) TOTALLY adhere.
It would be extremely interesting if the OP (or someone else) would diagnose this fully and find which end of the stick is wrong.
It may, of course. also be that by leaving HP sticks by the wayside, you gain some speed.
True. But rogue cards almost do certainly occur. A while ago I had a collection of same supplier, same part number cards and found that two of that collection failed to work in various pieces of kit. Not just equipment that I had involvement in. They would even fail in some card readers but not others.
Lots of manufacturers buys batches of components when they build cards. So if you buy same article number, you can get totally different contents inside every time you buy.
They should all be working - if the manufacturer isn't directly stupid - but will very different specifications. Some fast, some slow. Some supporting many rewrites, some supporting few. Some having huge tolerances for supply voltages, while some needing very close to 5V.
Quite few card manufacturers have own flash manufacturing or buy same memory chips all the time from the same manufacturer.
Er.. Back to the OP's problem, I have an impression that it may be caused by weak contacts at the USB connectors.
> when I debug through the software the value of HOST_RhscIntr is not changing to 1.
HOST_RhscIntr is set to '1' by the HostLite firmware in Host_Isr() (usbhost_lpc2468.c), when the root hub on the chip detects D+ line voltage change (HcRhPortStatus1 & OR_RH_PORT_CSC).
1) The target pendrive is not powered, because of bad contact at USB VBUS (5V). 2) The D+ line doesn't connect together (D+ bad contact) 3) The target pendrive doesn't assert D+ pull-up.
3) is denied, because the HP pendrive works on a PC.
Maybe, both of USB connectors, on your board and HP pendrive, have weak contacts. Just when these connectors meet with, the problem arises.
To get more clue, try an USB extender cable (A-plug + A-receptacle) between your board and the pendrive, to change the combination of connectors. If this extender cable improves the connection, the connector problem is concluded. Replace the USB connector on the board.
Tsuneo
Sir, Thanks for your kind support As you know usbhostlite is a standard NXP usbhost stack I made two changes in this software firstly I converted FAT16 to FAT32. Since here HOST_RhscIntr is not changing to 1 so i think problem is not related to FAT. Second Since I am also using usb hid device at another port That,s why I combine ISR of usb device and usb Host using USB_HOST_INT pin status.
I think ISR is not working properly in case of HP pendrive.
One think more i want to discuss what should be the voltage level initially at USB_PPWR1 and USB_PWRD1 pin .
In Hostlite source code how to switch off the power when pendrive is ejected. Since I think if we eject pendrive when power is on it may harm pendrive.
Thanks Sir for your kind support
Sir I think you are right because sometimes when i Format HP pendrive from PC. it starts working and worked after this at my board.