cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F405 USB Communication with PC Application (.NET C#)

Sandeep Dhokne
Associate II
Posted on January 08, 2018 at 08:05

Hello,

I did USB VCP CDC FS code in STM32F405.

I works fine.i tested it with terminal software.

Now i want to test same with .NET C♯ application software (with USB protocol only).

But unfortunately USB is not detected in .net c♯ application. 

Anybody have some example code for same?@

OR 

Any solution for same so i can proceed with my target.

Thank you.

Turvey.Clive.002

null
4 REPLIES 4
Ben K
Senior III
Posted on January 08, 2018 at 10:31

If you are using the CDC class with Windows, the USB interface is bound to the USB serial driver by default. This means that you can only interact with it as a Serial COM Port, in .NET you have the System.IO.Ports.SerialPort class for that. If you are trying to access this interface with a native USB application (such as LibUsbDotNet), you have to uninstall the serial driver from the USB interface, and set the WinUSB driver for it.

Sandeep Dhokne
Associate II
Posted on January 08, 2018 at 11:26

Thank you.

I did this i uninstalled serial drivers and installed WinUSB Drivers but problem still persist.

Apart from WinUSB drivers what extra should i need for my C#.Net Application programming?

Basically i want STM32F405 to PC base Application software(Developed in C#.Net)communication. 

Posted on January 08, 2018 at 12:03

If you can observe the WinUSB interface in Device Manager then the problem is most likely in your application. It's hard to say anything without any code attached - and this is not the proper forum for .NET USB application development - but I would consider trying all alternative ways of detecting the device, e.g. VID-PID based discovery.

Posted on January 08, 2018 at 16:24

In C we use CreateFile() to open a COM port, ie 'COM8' or '\\.\COM10'

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..