Skip to main content
Sandeep Dhokne
Associate III
December 31, 2017
Question

STM32F405 USB to PC (Win32/64Bit) Communication

  • December 31, 2017
  • 2 replies
  • 3232 views
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.

    This topic has been closed for replies.

    2 replies

    Tesla DeLorean
    Guru
    December 31, 2017
    Posted on December 31, 2017 at 14:04

    Asked the same question three times, don't do that.

    The chip supports USB directly, you must write VCP, MSC, HID, etc code on STM32F4

    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
    Sandeep Dhokne
    Associate III
    January 1, 2018
    Posted on January 01, 2018 at 05:12

    Thank you.

    Its my apology.Due to transmission error i post 3 times.

    Andrew Neil
    Super User
    January 1, 2018
    Posted on January 01, 2018 at 13:31

    I guessed that would be the reason.

    The forum is currently - and has been for a number of weeks - seriously broken!

    Anyhow, it's always worth including a note if you're repeating a post because you're not sure if the previous attempt worked.

    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    Sandeep Dhokne
    Associate III
    January 3, 2018
    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.

    s mcardle
    Visitor II
    January 4, 2018
    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
    Sandeep Dhokne
    Associate III
    January 5, 2018
    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?