USB on STM32

J7 above is the USB connector on my Hat’s and 44/45 at right is the connection to the MCU. This is all you need to do to have a working USB connected to an STM32.

Software is even easier if you just want a serial port. You just install STM32 Virtual Serial port driver for Windows 10 and check out middleware setting in CubeMX – once the code is downloaded the serial port will just come up. Actually using it is a minimal amount of coding on both sides, but it could hardly have been easier from schematics to working SW. I have not tested other USB classes, but I assume they are equally easy.

The screen above is from CubeMX. To have USB driver included you just wire the pins in the model, select Middleware and enable the USB_Device library and set up parameters to what you want.

Leave a Reply