Introduction
When designing the oscillator circuit for an STM32 microcontroller the values for the external buffer capacitors
and the external load resistor are crucial for the high speed clock to work.
ST has published an application note
which introduces the following equation for designing the circuit.

AN2867 Page 9
Where \(C_{L}\) is the load of the crystal (given in the datasheet of the crystal manufacturer).
\(C_{S}\) is the stray capacity of the PCB and can be estimated to 5pF.
Since we want to use two equal buffer capacitors we want to assume them equal (now as \(C_{L_{ext}})\). $$C_{L1} = C_{L2} = C_{L_{ext}}$$ The equation resolves to the following. $$C_{L_{ext}} = 2\times (C_{L}-C_{S})$$ The external resistor value can than be calculated by the following formula. $$R_{ext} = \frac{1}{2\pi fC_{L_{ext}}}$$
Calculator
Enter the crystal load capacity in pF (found in the datasheet).pF
Enter crystal frequency in MHz.
MHz
Press Enter to commit changes.
This leads to the following values:
\(C_{S}= \)xx\(\\pF\)
\(R_{ext}=\)xx\(\Omega\)