Please read all additional doc’s provided in the
STM32F1/variants/nucleo_f103rb/infos_pdfs
folder in the repo.
On many boards the crystal is NOT connected to “main” STM32F103RB MCU and you won’t have any luck to get the board working with STM32duino.
Thanks
Matthias
On standard boards a crystal along with two 15pF and two 0R resistors need to be installed.
It would be interesting tough, to setup the device to use the internal oscillator. This is what mbed uses.
here you go:
https://github.com/leaflabs/libmaple/bl … /board.cpp
on line 54
namespace priv {
static stm32f1_rcc_pll_data pll_data = {RCC_PLLMUL_9};
rcc_clk w_board_pll_in_clk = RCC_CLK_HSI;
rcc_pll_cfg w_board_pll_cfg = {RCC_PLLSRC_HSI_DIV_2, &pll_data};
}
On standard boards a crystal along with two 15pF and two 0R resistors need to be installed.
It would be interesting tough, to setup the device to use the internal oscillator. This is what mbed uses.
https://github.com/rogerclarkmelbourne/ … up.cpp#L58
Change RCC_PLLSRC_HSE to RCC_PLLSRC_HSI_DIV_2.
The only remaining issue is that now the system clock is 36 iso 72 MHz.
My blink test works, but at the wrong speed, and this is bound to also mess up serial I/O.
Not sure where to bump that PLL multiplier to twice the current value…
On the STM32 the only valid clock’s that can also run USB are 72 and 48 because the USB prescaler only has 2 values ,1.5 and 1.0 (GD32 has 4 values so can run at 48,72,96 or 120 and still have USB)
Also the STM32F1 code presumes a 8Mhz clock, and all the PLL configs are based on that value
It would be possible to change the code so that a F_CLOCK was defined and appropriate changes made, but it would require changes to quite a few places.
Note that USB is not so important on a Nucleo board (a USART is connected to the on-board ST-Link), and the internal RC clock is probably not stable enough for it anyway.
It’s definitely doable, as the Nucleo’s usually run at 72 MHz.
The proper settings can no doubt be found in other projects, such as ChibiOS.
I’ve got a setup running properly at 48 Mhz, including the serial port (usable through the on-board ST-Link v2.1).
Can submit a pull request for it if needed – IMO it’s best to have the F103RB Nucleo work in stock non-xtal mode.
Another change worth considering: Serial is USB on the Nucleo, which is not attached. It might be less confusing
to have the default “Serial” instance be Serial1, which is connected by default (well, at least TX is).
(with these changes, the Nucleo F103RB becomes quite a useful setup: all-in one upload, serial, and debugging)
The Nucleo has been a constant source of problems
I had to add all sorts of extra complication to the core etc to support it.
Re:USB serial
I think Serial should be mapped to the UART connected to the STLINK, there is mapping / setup in its variant files (sorry cant remember which board file it is, but its fairly obvious if you take a quick look
Re:Use internal xtal
we already have people using it with an external xtal, so if we have internal osc, it needs to be an option via a menu in boards.txt I think.
BTW.
@madias is the main man for this board. I dont have one.
(I have a Nucleo F3 but never used it)
All the different boards I tried with ChibiOS worked out of the box. A pretty nice way to compare chips.
Uploads work both the MBED drag-file way, and via st-flash. Serial bridging. And gdb support via st-util.
Well, ok, maybe both with and without external XTAL should be supported, but the one without is really the one as shipped today.
BTW.
@madias is the main man for this board. I dont have one.
(I have a Nucleo F3 but never used it)
I’m sorry, but I don’t understand why Nucleo’s are getting such a bad rap.
(as for no silk screen: use a diagram on-screen or printout on your desk?)
I’m sorry, but I don’t understand why Nucleo’s are getting such a bad rap.
(as for no silk screen: use a diagram on-screen or printout on your desk?)
Do you want two entries, one for a Nucleo F103 with and one without external crystal?
I suggest discussing this further on GitHub.
I like this: -please read the docs – but a clickable link is what I need for a quick start!
So I will simply add a new topic for my actual issue
Jean-Marc
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