Main Site Documentation

Mountaineer USB - How do I read/write data to the onboard USB connector?


#1

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?


#2

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.


#3

Serial to USB with a FTDI chip or cable works like a train for PC communication.


#4

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).


#5

I have seen no samples for its use, but the Mountaineer firmware supports the necessary [em]Microsoft.SPOT.Hardware.UsbClient[/em] namespace:

http://msdn.microsoft.com/en-us/library/ee436979.aspx


#6

@ 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?


#7

@ Gus - Is there any problem to enable in firmware and use second USB port ?


#8

I never tested it with second post so please let us know if you have it working.


#9

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.

http://guruce.com/blogpost/communicating-with-your-microframework-application-over-usb

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.


#10

No, there is no such switch.