ST and third-party tool
provider Keil offer a full range of STM32
code examples (C sources included) for free download. These
ready-to-use samples provide clear examples of the configuration
and use of a range of device peripherals and features including
USB, CAN, I/Os, watchdog, PWM, USART and more. These code samples
can be freely used in customer applications.
Examples are included in the Keil RealView™ Microcontroller
Development Kit release 3.15 or later, or can be downloaded
from Keil.