Posts

Showing posts from August, 2023

USB with STM32

Image
  USB - basic description: USB is probably the most common interface nowadays. Possibly due to the versatile protocol which can handle many different peripherals: flash drives, printers or keyboards... Also, it is self-configuring (no data format or speed needs to be selected), reliable (no data lost during transfer), and pretty fast. Since this protocol is so versatile software is not simple and it's not trivial to implement it on your own. Fortunately, this is also a reason why there are ready-to-go libraries for this protocol which takes care of all complicated and specific aspects of implementation. In this post, I want to show how to use the STM library for USB and how to modify it to use more than just one class - create a simple "composite" device. How to get STM32 Library: For USB there is always one host and one or more devices connected to it. STM can be programmed as both but for now, we will discuss only the device option. Because the USB standar