GD32 microcontrollers lack a straightforward graphical clock tree like STM32, and the clock tree in the chip manual often mismatches the code. Users need to manually check frequencies on buses after division and multiplication, using enumerations and macros such as HXTAL_VALUE in header files for external crystal frequency setup.
A Simple Way to Check the GD32 Clock
Since GD32 doesn't have a simple graphical clock tree like STM32, and the clock tree in the chip manual doesn't seem to match the code either, the actual clock frequencies on each bus after division and multiplication need to be checked separately.
Use the following method:
Other similar clock enumeration values are also available.
Additionally, in a header file named after the chip, such as
gd32f30x.h, theHXTAL_VALUEmacro determines the external crystal oscillator frequency.