My FEZ Domino is connected to my PC through the mini USB Client port. This allow me to program, debug my embedded code. Great.
On my FEZ, there is a USB Host in order to connect some devices. This work great for a GPS/GPRS module I bought few months ago. Great to.
Yesterday, I’ve seen the Arduino connected to a PC using USB wire. This connexion allowed the developper to both deploy its program and after deploying, test his program.
My question will be simple:
Is it possible to do the same without changing anything (don’t want to switch to Virtual Mode by connecting the mode pin to correct value)…
In other words, is it possible to have the PC connected “twice” to the board, one for debugging and the second one (using USB Host) as a “serial” port ?
(I’m afraid this answer will be no, but, admit that it could be sad to have to USB connexion on the FEZ and not be able to play with them as deploy and Serial/USB stuff).
Thanks for your answer
You may have a look here :
I’ve already look at this but this doesn’t provide any real answer to my question…
I know I can use USB Client to communicate with the PC using Virtual CDC, but I’d like to do it by using USB Host…
One USB (client) for deploying and debugging
One USB (Host) for communication stuff
I don’t really understand You want to use the USB host connector only for both debugging/communicating ?
I use the USB Client to connect to the PC for debugging and Deploying…
But, when I want to instantiate a communication between PC Program and FEZ Domino program, I would like to do it without changing anything from a “wire connection” point of view…
I found conveniend yesterday to be able to deploy the code on the arduino using the USB connection and, without CHANGING ANYTHING for the wire, to be able to start a program on my PC to communicate with the board (the board was dealing with Serial communication)…
Then you should use the link I’ve mentionned above. Unless I miss something again ???
When you add the following line of code in your program :
USBC_CDC cdc = USBClientController.StandardDevices.StartCDC_WithDebugging();
and you start debugging, then Windows will find a new device that will be the Domino but in a particular state that will enable you to communicate with it like if it was a “client”.
Did you try the code in the Wiki ?
You’re right. this works fine…
This should be the only way to use the USB Client in both situation, debug and virtual port…
I was just guessing that the USB host could be used to perform the same behavior…
sodit, you probably missed something with the StartCDC_WithDebugging.
It makes the board look like 2 devices to the PC. No wires to change. It creates a debug channel and a virtual serial port over the ONE USB cable.
So you can deploy/debug over the debug channel, and your application can send data over the virtual serial port.
This is called a composite device. It has one USB plug, but the PC thinks it is multiple devices.
For instance, an external harddrive that has a “Backup” button, for the PC looks like a storage device(hard dive) and a keyboard(button). The PC doesn’t know/care that it is just one device.
On a side note. You cant connect a USB host to a USB host, just like you can’t connect a USB device to a USB device.
And a big benefit of this is that the USB host connector is still free for use with other USB devices.
This way, you can debug USB hosts programs running on the Domino. Isn’t life beautiful ?
sure it is.
I suppose that I can, after debugging is done, continue to use CDC without using MODE Pin to ?
In other words, the StartDebugging will still work even if I’m no longer debugging anything and have switch to a “test” phasis ?
USB host connects to USB client port only. You can’t connect host to a host.
Your PC ports are all host ports.
You can add RS232 shield then use serial for debugging. This will free up the USB client port on your FEZ so you can use it to communicate with a PC. You can use the same port to deploy and then to use in your application but then if you are using it in your application then you can no longer debug!
It works fine for me… Now I understand the fact that Host 2 host won’t work.
That’s great that the StartCDC() exists. It provides really great feature without the need of add-on shield (RS232) to dial up with the PC.
Good point for the FEZ team