Power is provided with VDD (digital). The voltages are typically around +3.3V. Use decoupling capacitors (example: 0.1uF) near STM32. Place the STM32 close to power supply. Use a large trace for power. Read datasheet for more information.
GroundGround is provided with VSS (digital). Use a ground plane or a large trace for ground.
Reset pin is NRST. Typically the pin is connect to VDD with a pull-up resistor. To reset the STM32 set NRST low. Add a decoupling capacitor (example: 0.1uF) near NRST.
Boot pins are typically BOOT0 and BOOT1. Functionality of boot pins.
|X||0||User Flash memory|
|0||1||System memory (boot-loader)|
Add a pull-down resistor (example: 1K ohms) from boot pins to VSS.
Here are the pins for SWD (Serial debug wire):
- VDD power supply
- VSS ground
- NRST reset
Some STM32 requires HSE (high frequency external oscillator) and LSE (low frequency external oscillator) . Pin names have OSCIN and OSCOUT. Steps to design:
- Find if HSE or LSE or both is required in the datasheet
- Find acceptable range of frequencies for crystals (use STM32CubeMX)
- Select crystals from component distributor
- Get load capacitance of crystals
- Find stray capacitance of PCB
- Use load capacitance of crystals to calculate external load capacitors
Where CL = load capacitance of crystal
C1 = external load capacitor
C2 = external load capacitor
Cstray = stray capacitance of PCB
The pins are VDDA and VSSA. They are analog power supply and ground. Design steps:
- Find if STM32 has VDDA or VSSA or both
- If they exist then they must be connected properly
- Find tolerances for VDD
- Design filter circuit using an inductor and capacitor from VDDA to VDD
- Separate VDDA and VDD
- Separate VSSA and VSS
- Use star ground configurations to connect planes of VSSA and VSS
- VDD and VSS must not be noisy
USB uses USB_DM and USB_DP pins. For USB 2.0 low speed/full speed impedance matching and trace length doesn't matter. Some STM32 have pull up resistors from USB_DP to VDD. See USB page for more information.
Boot loaders are used to load user flash. Some STM32 have boot loaders builtin from the factory. Use STLinkV2 or STM32 DFU to flash boot loader.
Unused pins can be configured using the following way:
- Not connected to anything. Make pin output.
- Connect to VSS using a pull down resistor.
- Connect to VDD using a pull up resistor.