Nucleo F103RB with external XTAL works out of the box

The official STMicroelectronics Arduino core
Post Reply
Posts: 813
Joined: Mon Apr 27, 2015 11:26 am
Location: Vienna, Austria

Nucleo F103RB with external XTAL works out of the box

Post by madias » Sat Sep 17, 2016 6:03 am

Maybe a useful info:
Ages ago I modified my Nucleo F103RB board not using the internal oscillator but the external XTAL 72MHZ (there is a hack in the manual how to co use the crystal from the ST-Link section, see my manuals about the nucleo). This was done by myself to be compatible with all other boards in the past.
The interesting stuff:
It works with the new core out of the box. Even Serial give the correct baud, it looks like there is no mismatch with the timing.

Maybe this is exactly this, what Slammer wrote:
Slammer wrote:The Nucleo F103RB board uses 8MHz HSE EXT (External Input Clock) generated from the other MCU on board. It is possible to change a bit the clock initialization function to use both HSE sources, eg. to try first with HSE_EXT and if this fails to try again with HSE_XTAL, with this trick the same code will work in Nucleo and other F103 boards with external crystals.
The Nucleo L476RG is different story. The HSE_EXT connection is disconnected on the board, the MCU uses the new internal clock MSI (it is like HSI but much more stable and accurate) at 4 MHz.

User avatar
Posts: 7693
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia

Re: Nucleo F103RB with external XTAL works out of the box

Post by RogerClark » Sat Sep 17, 2016 6:17 am

Thank Matthias

It looks like their focus was getting the Nucleo boards to work, which is good, but...

It also looks like the code structure has not been thought through very well for adding other boards to each series

Rick has had a go at a BluePill variant, but I think it will need to be modified, as it uses #ifdefs and its going to get messy if we have to add an ifdef to some central files for each variant.

Post Reply