How to overclock the STM32 MCU and work normally?

According to the definition of Microsoft Academic, the so-called overclocking (OVERCLOCKING) is to force the computer or hardware to run on the clock frequency specified by the manufacturer to achieve higher performance. In layman's terms, it is the last bit of potential to squeeze the hardware.

In fact, not only computers can be overclocked, but MCUs can also be overclocked, with similar working principles.

However, when it comes to MCU overclocking, there will naturally be people pouring cold water, and there will also be some saliva. The reason is of course that stability is the first. However, there are pros and cons for everything in one. This article is not to encourage you to overclock, but to show you the details, such as people drinking water, knowing the temperature and warmth, and knowing it well. Prepare working hardware

This test is going to use the NUCLEO-L073RZ evaluation board as the hardware platform. If it is another STM32 evaluation board, please adjust the relevant parameters appropriately.

Figure 1: NUCLEO-L073RZ

The basic indicators of NUCLEO-L073RZ are as follows. Based on CORTEX-M0+, 32MHZ192KB/20KB FLASH/SRAM combination onboard STLINK/V2-1

Optional other hardware includes logic analyzer and oscilloscope to better test experimental results.

Figure 2: DSLOGIC logic analyzer

DSLOGIC logic analyzer is used to detect PWM signal output.

Figure 3: DSCOPE digital oscilloscope

DSCOPE digital oscilloscope, used to detect MCO output frequency. Note: You can experience the adventure of this article with any STM32 evaluation board, but you need to modify the corresponding hardware settings. This article provides supporting engineering files to help you reproduce test scenarios. Anyone who has designed PC overclocking knows that overclocking is very easy. Either change the FSB, or change the multiplication coefficient, anyway, it is a combination of those values. Then, it was overclocked. Of course there are other situations, such as the CPU being broken!

STM32 series MCUs have their own clock tree. By adjusting some basic parameters of the clock tree, you can set the operating frequency of internal related equipment, especially the MCU.

The STM32 series all have a nominal maximum operating frequency. For example, the product description of NUCLEO-L073RZ indicates that the maximum operating frequency of the MCU is 32MHZ. What happens if this value is exceeded? ST didn't say, you figure it out!

Of course, don't forget that there is a FLASH. As the frequency increases, the waiting state of the FLASH will also change accordingly. Open the reference manual of L073, you will find

The test said a lot of gossip, and finally it's time to test. In order to save space, I won't discuss the original code in length. If you are interested, please ask the author of this article for the complete project code file (including the relevant code that has been configured for COREMARK transplantation).

32MHZ frequency operation

This is the official maximum frequency value. In this case, everything is normal. The following is the terminal output

Pay attention to the compiler optimization flag (the same below). The optimization level here is 3, which is the highest optimization, and at the same time, the optimization is specified for runtime. This flag is included in the information output by the terminal.

PWM output waveform (duty ratio is 10% and 30%, frequency is 1KHZ)

Within the allowable range, repeatedly testing the code fragments of COREMARK, you will find that the internal temperature of the MCU rises slightly, but the increase is not obvious. The figure shows the internal temperature of the MCU after a period of testing.

Because STM32 may not have thought about overclocking at all, its clock configuration is relatively fixed, and there are no fine-tuning parameters to choose from.

Ah, where is the good feeling of overclocking on the PC? By consulting the reference manual, I have the following information

Configuration and operation results

See that the waveform is still beautiful!

However, under the frequency of 48MHZ, the MCO output is severely deformed, which is no longer of reference value. In order to verify, look at the operating frequency value obtained by a hardware simulation.

Go further

In order to further test, break the 96MHZ limit specified by PLLVCO. Specify the value of PLLMUL as 16, so that theoretically the value of SYSCLK will reach 64MHZ! Can the system still run?

The result of the experiment is: finally turned off!

Conclusion So far, I feel a bit tasteless! Compared with the traditional PC overclocking, the frequency configuration parameters provided by STM32 series MCUs are relatively limited, especially the parameters related to fine-tuning are not provided.

But judging from the test results, I think it is quite satisfactory.

The above data shows that the MCU can still work normally when overclocked by about 50%. After all, a high-load operation like the COREMARK test is still representative. In general MCU applications, the amount of calculation is certainly not so large! In addition, from the test results, the PWM output is normal, and the UART output does not produce garbled characters. All this shows that the MCU should be working normally! More importantly, the score of COREMARK is higher and the performance is stronger!

Pure Sine Wave Inverter

Pure Sine Wave Inverter,Off-Grid Pure Sine Wave Solar Inverter,Power Inverter For Solar System,Pure Sine Wave Pv Inverter

Zhejiang Kaimin Electric Co., Ltd. , https://www.ckmineinverter.com

Posted on