 Hello and welcome on Cubemix presentation. I would like to present you clock configuration feature. Before we start, let me explain few abbreviation used in this presentation. RCC Reset Clock Configuration HSI High-Speed Internal Oscillator HSE High-Speed External Oscillator LSE Low-Speed External Oscillator CSS Clock Security System PL Face Locked Loop and MCO Micro-Control Clock Output A stem 32 clock tree is very complex domain with lot of possibilities. As you can see in the picture, there is many configuration options and RCC peripheral has many registers. Additionally, all configuration values must be in line with datasheet of the device. Advantage is that you have a lot of possibilities how to set clock tree, but you must know all details behind. Basically, you must study documentation deeply before you can implement a configuration. Because of that, ST Implement Clock Configuration Tool, which is part of Cubemix, it is graphical tool which helps to set clock configuration more easily without any knowledge of RCC parameters. Here we can see Cubemix Clock Configuration tab of a stem started to F0 device. F0 clock tree is quite basic, but some devices are more complex. Clock tree is composed from these main parts, external parts dedicated to MCO pinout. It is either external clock sources used as input, or a stem 32 device can generate clock output on MCO pin. Then there are internal clock sources available in a stem 32 silicon. Then there is multiplexers and dividers used for frequency tuning. And finally, internal frequencies used for core and peripherals. As mentioned, a stem 32 device can use external oscillators as a clock source. HSI High Speed External Oscillator is used to generate very accurate clock source for the application. LSE Low Speed External Oscillator has the advantage of providing a low power but highly accurate clock source to the real-time clock peripheral or other timing functions. It is also possible to bypass external oscillators by providing precise clock source. For that, there is a possibility to select bypass in RCC configuration. If you would like to have a look how to design oscillators circuit properly, you can have a look to our application node AN2867, Oscillator Design Guide. In the clock configuration, we can see that input frequency of LSE and HSE is gray. It means that it is disabled in Cubemix. We have to go to Pinout and Configuration tab and RCC domain. Here we can enable LSE or HSE resonators. After enabling, we can see that it takes few pins on the Pinout. If we go back to clock configuration, we can see that it is enabled now. And we can also select the input frequency of HSE resonator. For example, 224 MHz. Next parts of clock 3 are multiplexers CSS and PL. Clock configuration has several multiplexers. It gives us a possibility to select various clock sources to drive the system clock. Then there is a CSS option. What does clock security system do? It checks whether HSE oscillators operates properly. If not, clock failure event is sent to the break input of the timers. And an interrupt is generated to inform the software about the failure allowing the MCU to perform rescue operations. Last part is PLL, which is used to multiply the HSI or HSE input clock frequency. Multiplexers and PLL is fully configurable in clock configuration. For example, here we can select the clock source for the system clock. Here we can choose from HSI, HSE or PLL. We select PLL. We can see that the input is still HSI and we have to switch to HSE. If we select the HSE, the PLL is multiplying the input and the output frequency is too high. So we have to reduce the multiplexing. Now we have a right configuration of the clock. A Stem Certificate Cubemix tool has several features which can help with the clock configuration. It shows warnings if something is wrong. It has Resolve Clock Issues function which can automatically resolve recognized issues. Then it is Auto Computation feature. You can write your required value to the box and press Enter and Cubemix will automatically find a solution for you and calculate your required frequency. At the future is a lock. It is a possibility to lock value in the box. If you change configuration which would directly impact locked value, Cubemix trigger warning message. Now let's have a look directly to Cubemix how the features work. For example, if we select higher number of PLL, here we can see warning of the system. It gives you a message which value is wrong. We can either resolve it manually by selecting different number or we can click to button Resolve Clock Issues which automatically find a solution. Another feature is Auto Computation. For example here, if we write right here 24 MHz and click Enter, Cubemix automatically find a solution and put the value here. And the lock mechanism is that we can right click to the value and click lock. Now we can see it is not possible to change it. If we would change some setting which would impact this value for example here, we will get a message that something is wrong. Stem Certitude Device can generate clock signal to one of external PIN. It is called MCO. If you enable this feature in RCC Clock Configuration, it will take one PIN from PIN out and enable MCO Clock Selection in Clock Tree where you can select source of MHz generated on the PIN. At the end of each tree line, there is a frequency used by Peripheral. Clock Tree is different device by device. Here is example of a Stem32F0 device. As you can see, there is a Clock Frequency for Core, DMA, HAB bus, Cystic Frequency, Frequency for Peripherals available on HPB bus and the grade one it is for USARC. It is not enabled in Cubemix, so for this it is gray. Some devices has a dual core. The difference between single and dual core is that Clock Tree has one additional CPU frequency. As you can see here in the picture, there is frequency for CPU1 and CPU2. And additionally, some Stem32 devices have trust zone feature. This is based on Cortex M33. The RCC is able to protect register bitfield from being modified by non-secure and unprivileged access. As you can see in picture, there is a key mark. Parameters mark as key can be protected. At the end, if everything is set, you can generate a code from Cubemix. Cubemix generates a configuration to main.cfile and it is called in main function. If you execute System Clock Config function, how library sets all clock parameters are selected in Cubemix project. Thank you for your attention.