3 years, 8 months ago.

Power and Speed

Hello and thanks for the help. I have been reading the "UM1724 STM32 Nucleo 64 boards User Manual " to understand my STM32F091 and I have two questions:

1) POWER: I read that you can power the nucleo with VIN, E5V (which is different than +5V pin) and +3V3 (which I dont know if it is different or not from +3.3V pin) I discarded the 3V3 because apparently you can not reprogram the nucleo if powered by this. So from the other two options, what is the pros and cons of using one or the other?? Also the manual says that VIN has to be 7-12V but the pin layout in this page says 5V-9V, so which is it?? Please recommend me how to power up my nucleo without using the USB

2) SPEED The nucleo announces itself as 48MHz. However I read in the manual that maybe it is using "MCO from ST-link"?? in which the speed is 8MHz?? (No wonder it seems slow!) The SBs and Rs are just as default (from the box) so which is the timing option I am using??? Apparently since SB55is OFF SB16 and SB50 is ON and I dont see any R35 R37 there, this is the option....

Also I read that when not using mbed but system_stm32fxxx.c you can multiply the speed but first I dont know how and second this is not mbed related is it??

Anyway, my question is when using STM32F091 (fresh from the box) and using mbed, which speed and which crystal am I using?

Question relating to:

Affordable and flexible platform to ease prototyping using a STM32F091RCT6 microcontroller.
Comment on this question

1 Answer

3 years, 8 months ago.

regarding the power
you can see from the schematic (Fig 25) that when using VIN, the E5V is generated by a 5V regulator (U3). If you are inputing less that 7V, the regulator may not be able to generate a proper 5V for USB communication.

If your power supply is 5V, you just input it on the E5V pin and bypass the 5V regulator. There is still a 3.3V regulator (U4) generating the supply for the MCU from the 5V (E5V or USV 5V, depending on JP5).

You can choose according to the power source you have available.

Regarding the oscillator
The STM32 has an internal PLL that can be configured by software. This allows to generate whatever frequency is needed from either the internal oscillator HSI (1%) or the external clock or crystal.

On these nucleo boards, the STLink device has a 8MHz crystal which is used to provide a precise 8MHz to the target MCU. MBED initialisation code detect if this clock is present and if it is, use it to generate the 48MHz which is the target frequency for this platform.

In case you want to try without mbed code base, I recommend to use the STM32CubeMx tool + STM32CubeF0 HAL. This allows graphical configuration of the pins and the clock tree and can generate the initialisation code automatically. Of course the generated initialisation code is not compatible with MBED, as mbed does its own initialisation for IOs, clocks and some peripherals.

BR

Thank you very much for your reply. I understand the power item. Thanks. On the speed issue, I understand that you are saying mbed generates 48MHz from the STLink 8MHz crystal?? Also, (well I am not going to do it I think but) what happens if you take out the ST link part of the nucleo? you have to modify the SBs and Rs to get it from say X2?? it wont run as it is now? Also, if power it from external I think there is no problem with powering the STlink part right? (I am almost sure about this but just asking in case) And last, I understand you are saying that mbed generates a initialization that gives 48MHz and I cant change this with mbed. (well not that I would want to because it is the max) but with other incompatible tools, is this right?

Thanks for your very informative reply

posted by Cristian Fuentes 26 Feb 2016

I am not 100% sure about the behavior if the clock is removed, but I think the 48MHz is generated from the HSI internal clock instead (less precise). In case you need high precision, you have the option to populate a crystal in X3 together with c33, c34 and R35 R37. Mbed should use it automatically.

Mbed library configures a lot of things for you so you don't have to know all the details of the platform. It provides a standard interface so you can run the same code on all the platforms. But you can always use your board (or any other..) without using mbed. If you do that, mbed won't be there to initialize everything for you. STM32Cube can help you do so from a graphical interface. It generates the configuration source code consisting in calls to the low level libraries (HAL). This library is the same as than the one used by mbed, so it's not incompatible. But if you try to manually configure a peripheral which is already used by mbed, it could break the mbed function using it.

posted by Maxime TEISSIER 26 Feb 2016