AnsweredAssumed Answered

USB CDC demo on STM32L0 Discovery Board?

Question asked by virzi.joseph on Dec 29, 2014

I am switching an application from RS232-based to USB-based between the host (either Linux or Windows) and a sensor module. I am currently using an STM23L053C8 processor to gather data from sensors and send them to the host. Very simple topology. To simplify matters even more, the RS232 protocol is 9600 8 N 1.

I am new to USB, but have been trying to follow discussions to implement USB. I used the STMCube to generate a USB CDC application, but have no idea where to begin after that. The application compiles fine and downloads to the board via ST-LINK. No problem there.

In the multiple discussions that I have seen, everyone begins with some snippet of code. I need the WHOLE thing to see how it goes together. To be even more of a picky beggar, does anyone have any skeleton code that maybe sends "Hello, world" to the host, and receives data back? Preferably, the code is for my particular DISCOVERY board.

As a side comment, I see many posts where people have to modify code from the STM32Cube program to get things to work. I worry that I would not be able to get to the point that I can see anything. For example,

Also, what is the difference between CDC and VCP? I keep seeing both come up.

Thanks everyone in advance. I know this is a lot to digest, but the most basic of programs would go a long, long way. Think hello.c.


P.S. I am using the Keil microVision tools. There is an excellent example code, in extremely basic form (which is perfect for beginners like me) at