cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F405 USB to PC (Win32/64Bit) Communication

Sandeep Dhokne
Associate II
Posted on December 31, 2017 at 10:30

I'm using STM32F405.Now I need to communicate with PC and controller using USB i.e when I connect the USb to my PC and controller ,when I sends data from the MY PC, the USB understands the those characters and send in to micro controller. how to do it??

I don't want to add any serial to usb converter,there will be direct communication between

PC<->USB<->STM32F4

Thank you.

12 REPLIES 12
Sandeep Dhokne
Associate II
Posted on January 03, 2018 at 04:59

Thank you.

I did this number of times but issue remain persist.

In device manager com port shows STMicroelectronics Virtual Com port but with yellow tag.

When i checked com port properties then i found code error 10.

Posted on January 04, 2018 at 08:46

I have attached a STCubeMX project (for the STMF4Discovery). This compiles (in sw4stm) and is recognidsed as a valid VCP on my Windows 10 system (but does nothing).

If you insert a small bit of code into the endless while loop, it will continually send 'hello' to a terminal on windows (I use Putty).

uint8_t Msg[] = 'hello\r\n';

CDC_Transmit_FS(Msg, strlen((char *)Msg));

________________

Attachments :

aon_vcp.ioc.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HyCw&d=%2Fa%2F0X0000000b4p%2F4itqQ.cVgLW6RFXhX8lqsCbwPB5GkpB.fhYtYJ0xwK4&asPdf=false
Posted on January 05, 2018 at 04:51

Thank you.

Now my code works fine.

When I try to receive a string that time i found received string is in not correct format.

string get shifted.

How to use received function in interrupt mode?