Main Site Documentation

USBHost questions


#1

Hello,

I was playing with the USBHost class and have some questions that need clarification to me :

  • when I plug a device in the USB host plug, it seems to reboot the Domino. The Led is dimmer for about 3-4 sec, like when I start a debugger session. Is this normal behaviour and does this mean that the board is in fact rebooting ?

  • when I plug a device while debugging , it’s loosing the connection to the debugger. Is it related to the first question ?

  • the DeviceConnected event is raised only when I start a new debugging session, not when I un-plug and then re-plug the device (or another device, but because of question 1 I think). I believe that it’s also raised at boot time when no debugging session is ran ?
    The DeviceDisconnected event is correctly raised when I un-plug the device. No problem here.

  • is there any documentation about using this class except the .html help on your site ? I’m using the GHI Electronics NETMF Documentation available on the download page.

  • some devices do not even show when they are plugged in. What does prevent them from showing ? And, if possible, what can I do to have access to them ? The “BadConnectionEvent” does not raise and no “Unknown device” is present. In fact, if I try to get the list of attached devices via the USBHostController.GetDevices() method, the count is 0.

Contrary to what all this could suggest, I can access many devices : a prolific adapter, 2 mouses, a USB card reader are detected, for example. All exhibit the question 1 behaviour, but does seem to work. I didn’t go further than recognition, but there’s no reason why it wouldn’t work after that step.

Any help or hints or links to some more complete doc would be welcome.

Of course, and I’ve double checked it, I run the latest firmware and SDK :wink:

Best regards,


Christophe

Edit: corrected some typos


#2

Did you try to connect a external power supply?

Could you give an example of a usb product which causes this?


#3

Good point ! This one was the answer to almost all my questions B)

Devices that were not detected are now showing up as HID devices, which they are (essentially Phidgets boards :wink: ).

Now, only a Philips webcam is not seen, but I don’t care as I won’t use it. And maybe webcams are somehow special devices that need something else to work properly ?

Again, thank you very much for your help !

Was this (external power needed) written somewhere else and did I miss it ? If no, then I think it should be put in the help file :wink:


#4

Great to hear that it worked. I do not know if this is described in the documentation, but the usb port has a limited amount of power. I always use external power to power things up :stuck_out_tongue:

As far as I know, webcams are not supported, due to limited memory. (Video is a lot of data). Correct me if I’m wrong with this.

Good luck and I wish you a lot of fun with your Domino!
:wink:

Regards


#5

Video is supported on large devices like ChipworkX. Webcams can be supported on FEZ Domino were you get snapshots, not video. But, we do not support it as of now.

Anyone with good USB knowledge can do it though. Take a look at the video class http://en.wikipedia.org/wiki/USB_video_device_class


#6

I don’t know if it can really apply to Domino, but here’s a list of some UVC devices : http://www.ideasonboard.org/uvc/#devices

Foekie : it seems that the power at the USB host port is very limited, indeed :wink:

And I surely will have fun with this board. It almost reminds me PIC programming, with pins assignations, pull-up/down digital pin (about which I was not aware anymore with Phidgets boards because they have built-in internal pull-ups…), and so on…

This seems really a very nice board to work with. I hope to have something to present in the project contest. Right now, I’ve been playing with Phidgets analog sensors and of course it works almost flawlessly. Though I’ve seen that some of them worked best with 3.3V instead of 5V.

Have a nice day !


Christophe


#7

That can be a contest idea… show how phidget devices/sensors can be used with FEZ


#8

Good to read that usb is working fine but now I’m really jalous because still waiting for my board… the worst is that I received the others parts already (sensors & shield)…

For the contest I think I will create an automatic distributors kick a… ! :wink:

enjoy your toys


#9

Now that USB is working, I will have to see if I can get some useful data from Phidgets USB boards. I think it will take a certain amount of time to get something accurate, depending on the (decoded) stream…

Analog sensors are not hard to deal with and I dont think that a “proof of concept” with such sensors is enough to qualify for the contest.

My first challenge will be to use an digital encoder (this one : http://www.phidgets.com/products.php?category=7&product_id=1052 ) and try to get position and button click from it.

Have a nice day


#10

Hello,

just to let you know : I’ve successfully used the Phidget 1052 digital encoder with the FEZ Domino board ! :slight_smile:

I have the basic functionnalities : digital input state (button pressed or not) and encoder position, along with the direction of the movement (forward/backward).

I will have to investigate a little further because I get exceptions sometimes and I still don’t know why. But I’ve reached my first goal, which is not that bad :wink:


#11

Hello,

I’m still fighting to get a 100% error free test program, but there’s one error I can’t get rid of :frowning:

#### Exception System.Exception - 0xffffffff (4) ####
    #### GHIElectronics.NETMF.USBHost.USBH_RawDevice+Pipe::TransferPipe_Helper [IP: 0000] ####
    #### GHIElectronics.NETMF.USBHost.USBH_RawDevice+Pipe::TransferData [IP: 001c] ####
    #### Test.Program::_EncoderThread [IP: 0022] ####
A first chance exception of type 'System.Exception' occurred in GHIElectronics.NETMF.USBHost.dll
USB ERROR 268435459

I don’t understand the real meaning of this error, in fact. The doc says “CompletionCode_DataToggle” but that doesn’t help much.

Any idea on what can cause this error ?
I have put some test loops that check USB LastError, so that I only deal with data when there’s no error (mainly “busy” errors).

If it can help, this error happens almost always at the first readout of data. It’s then repeating lots of time and all come back to normal behaviour after some incoming data.

Any hint would be welcome here.

Best regards


Christophe


#12

It is usually caused by a bad device or if you are not reading input pipe. In mist cases you can ignore this error. I think we already do that in the xbox controller driver


#13

Hmmm… This seems to imply a knowledge of the complete data stream & structure between host and device. Which is not available, of course.

I will try to investigate further with the input pipe. I may read it but ignore its content, if it’s the only cause of the error. Unless I find some useful data in it, of course :slight_smile:

Thank you for pointing me in this way.