I know this is an old topic, however I just had to deal with this type of issue with an older NUCLEO-STM32F030R8 board. It doesn't provide an external XTAL and I wanted to get an accurate clock. To achieve this without an external XTAL, you can change some solder bridges and get an accurate 8MHz clock from the MCO pin of the STLINK side of the board. I redid my solder bridges according to the UM1724 manual:
UM1724 wrote:• MCO from ST-LINK: MCO output of ST-LINK MCU is used as input clock. This
frequency cannot be changed, it is fixed at 8 MHz and connected to
PF0/PD0/PH0-OSC_IN of the STM32 microcontroller.
The following configuration is needed:
– SB55 OFF and SB54 ON
– SB16 and SB50 ON
– R35 and R37 removed
When configured like this you can then write code to use the HSE as a bypass clock. It works as well as having an external XTAL and as a byproduct gives you one more usable pin. (XTAL OSC OUT).
Depending on your board, it may have the MCO configured by default and you wouldn't have to do any soldering. Based on how old this thread is, most people who have this F103 board probably would have to break out their irons.
UM1724 wrote:There are two possible default configurations of the HSE pins, depending on the version of
the STM32 Nucleo board hardware.
The board version MB1136 C-01 or MB1136 C-02 is mentioned on the sticker, placed on the
bottom side of the PCB.
The board marking MB1136 C-01 corresponds to a board, configured as HSE not used.
The board marking MB1136 C-02 (or higher) corresponds to a board, configured to use
ST-LINK MCO as clock input.