I’ve been trying to figure this out for a while now. I’d like to have my Mountaineer interact with a desktop application using the onboard USB connector. Is this possible? Is there any sample code for this?
I do not think this is possible like that but you can add a USB-serial module and then you can use it for the data.
Serial to USB with a FTDI chip or cable works like a train for PC communication.
To use the built-in USB port, there are two ways to accomplish this:
If you only need your device to send data to the PC, you could just extend the MFDeploy class. Then whatever you Debug.Print() from your board, you’ll receive on your computer.
Of course, the “right way” to do this is to use the built-in USB client feature in NETMF. Just program the device instantiate itself as a custom HID device; you can send and receive reports that contain any arbitrary data you need. It’s pretty simple to get it going on the Windows side, and although I’ve never done it in NETMF, I’ve done it in native C with several vendor USB frameworks – it’s really not that hard (just very tedious).
I have seen no samples for its use, but the Mountaineer firmware supports the necessary [em]Microsoft.SPOT.Hardware.UsbClient[/em] namespace:
@ Cuno - He will need to rebuild the firmware to debug serially to free up the USB port. Unless there is a way in the standard firmware to switch to serial debugging?
@ Gus - Is there any problem to enable in firmware and use second USB port ?
I never tested it with second post so please let us know if you have it working.
I didn’t try that on Mountaineer board, but i don’t see much difference with the Cerberus firmware. Only problem i experienced, after enabling second USB port, had to squeeze some features in firmware, because of shortage about 40 bytes in RAM after compilation.
That article explains everything.
Would be great, if you can create another WinUSB driver, with different GUID and PID.
Then i think would be possible to work directly with USB streams from desktop applications.
No, there is no such switch.