Skip to main content
stefan239955_stm1_stmicro
Associate II
March 10, 2009
Question

USB programming

  • March 10, 2009
  • 2 replies
  • 675 views
Posted on March 10, 2009 at 06:15

USB programming

    This topic has been closed for replies.

    2 replies

    stefan239955_stm1_stmicro
    Associate II
    May 17, 2011
    Posted on May 17, 2011 at 13:05

    I'm trying to write a PC program to control my STM32 via USB. I've to admit that I'm totally new to USB and don't know if I'm on the right track.

    The first thing I did was to look at the source code of the USB HID Demonstrator tool, which is capable of toggling some LEDs and reading values from the potentiometer. But I'm pretty much overwhelmed from that piece of code and didn't understand too much. So I looked into some online documents and the USB 2.0 specification and it seems to me that USB is a pretty ''complicated'' protocol.

    What I'm wondering now is if there's an easier way for USB communication or do I need to learn and implement the protocol specifications.

    As I said before I'm totally new to USB and don't really have a clue. I used USART before, where I just needed to set up a few parameters (COM-port, speed, ...) and then I was able to send/receive messages.

    Maybe someone can give me some more insight on that topic.

    Thanks

    budde2
    Associate III
    May 17, 2011
    Posted on May 17, 2011 at 13:05

    I would recommend to use the Virtual COM Port example to start with the USB programming.

    You can simply adapt this code for your needs.