STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
system_stm32h7xx.c
Go to the documentation of this file.
1/**
2 ******************************************************************************
3 * @file system_stm32h7xx.c
4 * @author MCD Application Team
5 * @brief CMSIS Cortex-Mx Device Peripheral Access Layer System Source File.
6 *
7 * This file provides two functions and one global variable to be called from
8 * user application:
9 * - ExitRun0Mode(): Specifies the Power Supply source. This function is
10 * called at startup just after reset and before the call
11 * of SystemInit(). This call is made inside
12 * the "startup_stm32h7xx.s" file.
13 *
14 * - SystemInit(): This function is called at startup just after reset and
15 * before branch to main program. This call is made inside
16 * the "startup_stm32h7xx.s" file.
17 *
18 * - SystemCoreClock variable: Contains the core clock, it can be used
19 * by the user application to setup the SysTick
20 * timer or configure other parameters.
21 *
22 * - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must
23 * be called whenever the core clock is changed
24 * during program execution.
25 *
26 *
27 ******************************************************************************
28 * @attention
29 *
30 * Copyright (c) 2017 STMicroelectronics.
31 * All rights reserved.
32 *
33 * This software is licensed under terms that can be found in the LICENSE file
34 * in the root directory of this software component.
35 * If no LICENSE file comes with this software, it is provided AS-IS.
36 *
37 ******************************************************************************
38 */
39
40/** @addtogroup CMSIS
41 * @{
42 */
43
44/** @addtogroup stm32h7xx_system
45 * @{
46 */
47
48/** @addtogroup STM32H7xx_System_Private_Includes
49 * @{
50 */
51
52#include "stm32h7xx.h"
53#include <math.h>
54
55#if !defined (HSE_VALUE)
56#define HSE_VALUE ((uint32_t)25000000) /*!< Value of the External oscillator in Hz */
57#endif /* HSE_VALUE */
58
59#if !defined (CSI_VALUE)
60 #define CSI_VALUE ((uint32_t)4000000) /*!< Value of the Internal oscillator in Hz*/
61#endif /* CSI_VALUE */
62
63#if !defined (HSI_VALUE)
64 #define HSI_VALUE ((uint32_t)64000000) /*!< Value of the Internal oscillator in Hz*/
65#endif /* HSI_VALUE */
66
67
68/**
69 * @}
70 */
71
72/** @addtogroup STM32H7xx_System_Private_TypesDefinitions
73 * @{
74 */
75
76/**
77 * @}
78 */
79
80/** @addtogroup STM32H7xx_System_Private_Defines
81 * @{
82 */
83
84/************************* Miscellaneous Configuration ************************/
85/*!< Uncomment the following line if you need to use initialized data in D2 domain SRAM (AHB SRAM) */
86/* #define DATA_IN_D2_SRAM */
87
88/* Note: Following vector table addresses must be defined in line with linker
89 configuration. */
90/*!< Uncomment the following line if you need to relocate the vector table
91 anywhere in FLASH BANK1 or AXI SRAM, else the vector table is kept at the automatic
92 remap of boot address selected */
93/* #define USER_VECT_TAB_ADDRESS */
94
95#if defined(USER_VECT_TAB_ADDRESS)
96#if defined(DUAL_CORE) && defined(CORE_CM4)
97/*!< Uncomment the following line if you need to relocate your vector Table
98 in D2 AXI SRAM else user remap will be done in FLASH BANK2. */
99/* #define VECT_TAB_SRAM */
100#if defined(VECT_TAB_SRAM)
101#define VECT_TAB_BASE_ADDRESS D2_AXISRAM_BASE /*!< Vector Table base address field.
102 This value must be a multiple of 0x400. */
103#else
104#define VECT_TAB_BASE_ADDRESS FLASH_BANK2_BASE /*!< Vector Table base address field.
105 This value must be a multiple of 0x400. */
106#endif /* VECT_TAB_SRAM */
107#else
108/*!< Uncomment the following line if you need to relocate your vector Table
109 in D1 AXI SRAM else user remap will be done in FLASH BANK1. */
110/* #define VECT_TAB_SRAM */
111#if defined(VECT_TAB_SRAM)
112#define VECT_TAB_BASE_ADDRESS D1_AXISRAM_BASE /*!< Vector Table base address field.
113 This value must be a multiple of 0x400. */
114#else
115#define VECT_TAB_BASE_ADDRESS FLASH_BANK1_BASE /*!< Vector Table base address field.
116 This value must be a multiple of 0x400. */
117#endif /* VECT_TAB_SRAM */
118#endif /* DUAL_CORE && CORE_CM4 */
119
120#if !defined(VECT_TAB_OFFSET)
121#define VECT_TAB_OFFSET 0x00000000U /*!< Vector Table base offset field.
122 This value must be a multiple of 0x400. */
123#endif /* VECT_TAB_OFFSET */
124
125#endif /* USER_VECT_TAB_ADDRESS */
126/******************************************************************************/
127
128/**
129 * @}
130 */
131
132/** @addtogroup STM32H7xx_System_Private_Macros
133 * @{
134 */
135
136/**
137 * @}
138 */
139
140/** @addtogroup STM32H7xx_System_Private_Variables
141 * @{
142 */
143 /* This variable is updated in three ways:
144 1) by calling CMSIS function SystemCoreClockUpdate()
145 2) by calling HAL API function HAL_RCC_GetHCLKFreq()
146 3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency
147 Note: If you use this function to configure the system clock; then there
148 is no need to call the 2 first functions listed above, since SystemCoreClock
149 variable is updated automatically.
150 */
151 uint32_t SystemCoreClock = 64000000;
152 uint32_t SystemD2Clock = 64000000;
153 const uint8_t D1CorePrescTable[16] = {0, 0, 0, 0, 1, 2, 3, 4, 1, 2, 3, 4, 6, 7, 8, 9};
154
155/**
156 * @}
157 */
158
159/** @addtogroup STM32H7xx_System_Private_FunctionPrototypes
160 * @{
161 */
162
163/**
164 * @}
165 */
166
167/** @addtogroup STM32H7xx_System_Private_Functions
168 * @{
169 */
170
171/**
172 * @brief Setup the microcontroller system
173 * Initialize the FPU setting and vector table location
174 * configuration.
175 * @param None
176 * @retval None
177 */
178void SystemInit (void)
179{
180#if defined (DATA_IN_D2_SRAM)
181 __IO uint32_t tmpreg;
182#endif /* DATA_IN_D2_SRAM */
183
184 /* FPU settings ------------------------------------------------------------*/
185 #if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
186 SCB->CPACR |= ((3UL << (10*2))|(3UL << (11*2))); /* set CP10 and CP11 Full Access */
187 #endif
188 /* Reset the RCC clock configuration to the default reset state ------------*/
189
190 /* Increasing the CPU frequency */
192 {
193 /* Program the new number of wait states to the LATENCY bits in the FLASH_ACR register */
195 }
196
197 /* Set HSION bit */
198 RCC->CR |= RCC_CR_HSION;
199
200 /* Reset CFGR register */
201 RCC->CFGR = 0x00000000;
202
203 /* Reset HSEON, HSECSSON, CSION, HSI48ON, CSIKERON, PLL1ON, PLL2ON and PLL3ON bits */
204 RCC->CR &= 0xEAF6ED7FU;
205
206 /* Decreasing the number of wait states because of lower CPU frequency */
208 {
209 /* Program the new number of wait states to the LATENCY bits in the FLASH_ACR register */
211 }
212
213#if defined(D3_SRAM_BASE)
214 /* Reset D1CFGR register */
215 RCC->D1CFGR = 0x00000000;
216
217 /* Reset D2CFGR register */
218 RCC->D2CFGR = 0x00000000;
219
220 /* Reset D3CFGR register */
221 RCC->D3CFGR = 0x00000000;
222#else
223 /* Reset CDCFGR1 register */
224 RCC->CDCFGR1 = 0x00000000;
225
226 /* Reset CDCFGR2 register */
227 RCC->CDCFGR2 = 0x00000000;
228
229 /* Reset SRDCFGR register */
230 RCC->SRDCFGR = 0x00000000;
231#endif
232 /* Reset PLLCKSELR register */
233 RCC->PLLCKSELR = 0x02020200;
234
235 /* Reset PLLCFGR register */
236 RCC->PLLCFGR = 0x01FF0000;
237 /* Reset PLL1DIVR register */
238 RCC->PLL1DIVR = 0x01010280;
239 /* Reset PLL1FRACR register */
240 RCC->PLL1FRACR = 0x00000000;
241
242 /* Reset PLL2DIVR register */
243 RCC->PLL2DIVR = 0x01010280;
244
245 /* Reset PLL2FRACR register */
246
247 RCC->PLL2FRACR = 0x00000000;
248 /* Reset PLL3DIVR register */
249 RCC->PLL3DIVR = 0x01010280;
250
251 /* Reset PLL3FRACR register */
252 RCC->PLL3FRACR = 0x00000000;
253
254 /* Reset HSEBYP bit */
255 RCC->CR &= 0xFFFBFFFFU;
256
257 /* Disable all interrupts */
258 RCC->CIER = 0x00000000;
259
260#if (STM32H7_DEV_ID == 0x450UL)
261 /* dual core CM7 or single core line */
262 if((DBGMCU->IDCODE & 0xFFFF0000U) < 0x20000000U)
263 {
264 /* if stm32h7 revY*/
265 /* Change the switch matrix read issuing capability to 1 for the AXI SRAM target (Target 7) */
266 *((__IO uint32_t*)0x51008108) = 0x000000001U;
267 }
268#endif /* STM32H7_DEV_ID */
269
270#if defined(DATA_IN_D2_SRAM)
271 /* in case of initialized data in D2 SRAM (AHB SRAM), enable the D2 SRAM clock (AHB SRAM clock) */
272#if defined(RCC_AHB2ENR_D2SRAM3EN)
273 RCC->AHB2ENR |= (RCC_AHB2ENR_D2SRAM1EN | RCC_AHB2ENR_D2SRAM2EN | RCC_AHB2ENR_D2SRAM3EN);
274#elif defined(RCC_AHB2ENR_D2SRAM2EN)
276#else
277 RCC->AHB2ENR |= (RCC_AHB2ENR_AHBSRAM1EN | RCC_AHB2ENR_AHBSRAM2EN);
278#endif /* RCC_AHB2ENR_D2SRAM3EN */
279
280 tmpreg = RCC->AHB2ENR;
281 (void) tmpreg;
282#endif /* DATA_IN_D2_SRAM */
283
284#if defined(DUAL_CORE) && defined(CORE_CM4)
285 /* Configure the Vector Table location add offset address for cortex-M4 ------------------*/
286#if defined(USER_VECT_TAB_ADDRESS)
287 SCB->VTOR = VECT_TAB_BASE_ADDRESS | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal D2 AXI-RAM or in Internal FLASH */
288#endif /* USER_VECT_TAB_ADDRESS */
289
290#else
291 if(READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN) == 0U)
292 {
293 /* Enable the FMC interface clock */
294 SET_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN);
295
296 /*
297 * Disable the FMC bank1 (enabled after reset).
298 * This, prevents CPU speculation access on this bank which blocks the use of FMC during
299 * 24us. During this time the others FMC master (such as LTDC) cannot use it!
300 */
301 FMC_Bank1_R->BTCR[0] = 0x000030D2;
302
303 /* Disable the FMC interface clock */
305 }
306
307 /* Configure the Vector Table location -------------------------------------*/
308#if defined(USER_VECT_TAB_ADDRESS)
309 SCB->VTOR = VECT_TAB_BASE_ADDRESS | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal D1 AXI-RAM or in Internal FLASH */
310#endif /* USER_VECT_TAB_ADDRESS */
311
312#endif /*DUAL_CORE && CORE_CM4*/
313}
314
315/**
316 * @brief Update SystemCoreClock variable according to Clock Register Values.
317 * The SystemCoreClock variable contains the core clock , it can
318 * be used by the user application to setup the SysTick timer or configure
319 * other parameters.
320 *
321 * @note Each time the core clock changes, this function must be called
322 * to update SystemCoreClock variable value. Otherwise, any configuration
323 * based on this variable will be incorrect.
324 *
325 * @note - The system frequency computed by this function is not the real
326 * frequency in the chip. It is calculated based on the predefined
327 * constant and the selected clock source:
328 *
329 * - If SYSCLK source is CSI, SystemCoreClock will contain the CSI_VALUE(*)
330 * - If SYSCLK source is HSI, SystemCoreClock will contain the HSI_VALUE(**)
331 * - If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(***)
332 * - If SYSCLK source is PLL, SystemCoreClock will contain the CSI_VALUE(*),
333 * HSI_VALUE(**) or HSE_VALUE(***) multiplied/divided by the PLL factors.
334 *
335 * (*) CSI_VALUE is a constant defined in stm32h7xx_hal.h file (default value
336 * 4 MHz) but the real value may vary depending on the variations
337 * in voltage and temperature.
338 * (**) HSI_VALUE is a constant defined in stm32h7xx_hal.h file (default value
339 * 64 MHz) but the real value may vary depending on the variations
340 * in voltage and temperature.
341 *
342 * (***)HSE_VALUE is a constant defined in stm32h7xx_hal.h file (default value
343 * 25 MHz), user has to ensure that HSE_VALUE is same as the real
344 * frequency of the crystal used. Otherwise, this function may
345 * have wrong result.
346 *
347 * - The result of this function could be not correct when using fractional
348 * value for HSE crystal.
349 * @param None
350 * @retval None
351 */
353{
354 uint32_t pllp, pllsource, pllm, pllfracen, hsivalue, tmp;
355 uint32_t common_system_clock;
356 float_t fracn1, pllvco;
357
358
359 /* Get SYSCLK source -------------------------------------------------------*/
360
361 switch (RCC->CFGR & RCC_CFGR_SWS)
362 {
363 case RCC_CFGR_SWS_HSI: /* HSI used as system clock source */
364 common_system_clock = (uint32_t) (HSI_VALUE >> ((RCC->CR & RCC_CR_HSIDIV)>> 3));
365 break;
366
367 case RCC_CFGR_SWS_CSI: /* CSI used as system clock source */
368 common_system_clock = CSI_VALUE;
369 break;
370
371 case RCC_CFGR_SWS_HSE: /* HSE used as system clock source */
372 common_system_clock = HSE_VALUE;
373 break;
374
375 case RCC_CFGR_SWS_PLL1: /* PLL1 used as system clock source */
376
377 /* PLL_VCO = (HSE_VALUE or HSI_VALUE or CSI_VALUE/ PLLM) * PLLN
378 SYSCLK = PLL_VCO / PLLR
379 */
380 pllsource = (RCC->PLLCKSELR & RCC_PLLCKSELR_PLLSRC);
381 pllm = ((RCC->PLLCKSELR & RCC_PLLCKSELR_DIVM1)>> 4) ;
382 pllfracen = ((RCC->PLLCFGR & RCC_PLLCFGR_PLL1FRACEN)>>RCC_PLLCFGR_PLL1FRACEN_Pos);
383 fracn1 = (float_t)(uint32_t)(pllfracen* ((RCC->PLL1FRACR & RCC_PLL1FRACR_FRACN1)>> 3));
384
385 if (pllm != 0U)
386 {
387 switch (pllsource)
388 {
389 case RCC_PLLCKSELR_PLLSRC_HSI: /* HSI used as PLL clock source */
390
391 hsivalue = (HSI_VALUE >> ((RCC->CR & RCC_CR_HSIDIV)>> 3)) ;
392 pllvco = ( (float_t)hsivalue / (float_t)pllm) * ((float_t)(uint32_t)(RCC->PLL1DIVR & RCC_PLL1DIVR_N1) + (fracn1/(float_t)0x2000) +(float_t)1 );
393
394 break;
395
396 case RCC_PLLCKSELR_PLLSRC_CSI: /* CSI used as PLL clock source */
397 pllvco = ((float_t)CSI_VALUE / (float_t)pllm) * ((float_t)(uint32_t)(RCC->PLL1DIVR & RCC_PLL1DIVR_N1) + (fracn1/(float_t)0x2000) +(float_t)1 );
398 break;
399
400 case RCC_PLLCKSELR_PLLSRC_HSE: /* HSE used as PLL clock source */
401 pllvco = ((float_t)HSE_VALUE / (float_t)pllm) * ((float_t)(uint32_t)(RCC->PLL1DIVR & RCC_PLL1DIVR_N1) + (fracn1/(float_t)0x2000) +(float_t)1 );
402 break;
403
404 default:
405 hsivalue = (HSI_VALUE >> ((RCC->CR & RCC_CR_HSIDIV)>> 3)) ;
406 pllvco = ((float_t)hsivalue / (float_t)pllm) * ((float_t)(uint32_t)(RCC->PLL1DIVR & RCC_PLL1DIVR_N1) + (fracn1/(float_t)0x2000) +(float_t)1 );
407 break;
408 }
409 pllp = (((RCC->PLL1DIVR & RCC_PLL1DIVR_P1) >>9) + 1U ) ;
410 common_system_clock = (uint32_t)(float_t)(pllvco/(float_t)pllp);
411 }
412 else
413 {
414 common_system_clock = 0U;
415 }
416 break;
417
418 default:
419 common_system_clock = (uint32_t) (HSI_VALUE >> ((RCC->CR & RCC_CR_HSIDIV)>> 3));
420 break;
421 }
422
423 /* Compute SystemClock frequency --------------------------------------------------*/
424#if defined (RCC_D1CFGR_D1CPRE)
426
427 /* common_system_clock frequency : CM7 CPU frequency */
428 common_system_clock >>= tmp;
429
430 /* SystemD2Clock frequency : CM4 CPU, AXI and AHBs Clock frequency */
431 SystemD2Clock = (common_system_clock >> ((D1CorePrescTable[(RCC->D1CFGR & RCC_D1CFGR_HPRE)>> RCC_D1CFGR_HPRE_Pos]) & 0x1FU));
432
433#else
434 tmp = D1CorePrescTable[(RCC->CDCFGR1 & RCC_CDCFGR1_CDCPRE)>> RCC_CDCFGR1_CDCPRE_Pos];
435
436 /* common_system_clock frequency : CM7 CPU frequency */
437 common_system_clock >>= tmp;
438
439 /* SystemD2Clock frequency : AXI and AHBs Clock frequency */
440 SystemD2Clock = (common_system_clock >> ((D1CorePrescTable[(RCC->CDCFGR1 & RCC_CDCFGR1_HPRE)>> RCC_CDCFGR1_HPRE_Pos]) & 0x1FU));
441
442#endif
443
444#if defined(DUAL_CORE) && defined(CORE_CM4)
446#else
447 SystemCoreClock = common_system_clock;
448#endif /* DUAL_CORE && CORE_CM4 */
449}
450
451/**
452 * @brief Exit Run* mode and Configure the system Power Supply
453 *
454 * @note This function exits the Run* mode and configures the system power supply
455 * according to the definition to be used at compilation preprocessing level.
456 * The application shall set one of the following configuration option:
457 * - PWR_LDO_SUPPLY
458 * - PWR_DIRECT_SMPS_SUPPLY
459 * - PWR_EXTERNAL_SOURCE_SUPPLY
460 * - PWR_SMPS_1V8_SUPPLIES_LDO
461 * - PWR_SMPS_2V5_SUPPLIES_LDO
462 * - PWR_SMPS_1V8_SUPPLIES_EXT_AND_LDO
463 * - PWR_SMPS_2V5_SUPPLIES_EXT_AND_LDO
464 * - PWR_SMPS_1V8_SUPPLIES_EXT
465 * - PWR_SMPS_2V5_SUPPLIES_EXT
466 *
467 * @note The function modifies the PWR->CR3 register to enable or disable specific
468 * power supply modes and waits until the voltage level flag is set, indicating
469 * that the power supply configuration is stable.
470 *
471 * @param None
472 * @retval None
473 */
474void ExitRun0Mode(void)
475{
476#if defined(USE_PWR_LDO_SUPPLY)
477 #if defined(SMPS)
478 /* Exit Run* mode by disabling SMPS and enabling LDO */
479 PWR->CR3 = (PWR->CR3 & ~PWR_CR3_SMPSEN) | PWR_CR3_LDOEN;
480 #else
481 /* Enable LDO mode */
482 PWR->CR3 |= PWR_CR3_LDOEN;
483 #endif /* SMPS */
484 /* Wait till voltage level flag is set */
485 while ((PWR->CSR1 & PWR_CSR1_ACTVOSRDY) == 0U)
486 {}
487#elif defined(USE_PWR_EXTERNAL_SOURCE_SUPPLY)
488 #if defined(SMPS)
489 /* Exit Run* mode */
490 PWR->CR3 = (PWR->CR3 & ~(PWR_CR3_SMPSEN | PWR_CR3_LDOEN)) | PWR_CR3_BYPASS;
491 #else
492 PWR->CR3 = (PWR->CR3 & ~(PWR_CR3_LDOEN)) | PWR_CR3_BYPASS;
493 #endif /* SMPS */
494 /* Wait till voltage level flag is set */
495 while ((PWR->CSR1 & PWR_CSR1_ACTVOSRDY) == 0U)
496 {}
497#elif defined(USE_PWR_DIRECT_SMPS_SUPPLY) && defined(SMPS)
498 /* Exit Run* mode */
499 PWR->CR3 &= ~(PWR_CR3_LDOEN);
500 /* Wait till voltage level flag is set */
501 while ((PWR->CSR1 & PWR_CSR1_ACTVOSRDY) == 0U)
502 {}
503#elif defined(USE_PWR_SMPS_1V8_SUPPLIES_LDO) && defined(SMPS)
504 /* Exit Run* mode */
505 PWR->CR3 |= PWR_CR3_SMPSLEVEL_0 | PWR_CR3_SMPSEN | PWR_CR3_LDOEN;
506 /* Wait till voltage level flag is set */
507 while ((PWR->CSR1 & PWR_CSR1_ACTVOSRDY) == 0U)
508 {}
509#elif defined(USE_PWR_SMPS_2V5_SUPPLIES_LDO) && defined(SMPS)
510 /* Exit Run* mode */
511 PWR->CR3 |= PWR_CR3_SMPSLEVEL_1 | PWR_CR3_SMPSEN | PWR_CR3_LDOEN;
512 /* Wait till voltage level flag is set */
513 while ((PWR->CSR1 & PWR_CSR1_ACTVOSRDY) == 0U)
514 {}
515#elif defined(USE_PWR_SMPS_1V8_SUPPLIES_EXT_AND_LDO) && defined(SMPS)
516 /* Exit Run* mode */
517 PWR->CR3 |= PWR_CR3_SMPSLEVEL_0 | PWR_CR3_SMPSEXTHP | PWR_CR3_SMPSEN | PWR_CR3_LDOEN;
518 /* Wait till voltage level flag is set */
519 while ((PWR->CSR1 & PWR_CSR1_ACTVOSRDY) == 0U)
520 {}
521#elif defined(USE_PWR_SMPS_2V5_SUPPLIES_EXT_AND_LDO) && defined(SMPS)
522 /* Exit Run* mode */
523 PWR->CR3 |= PWR_CR3_SMPSLEVEL_1 | PWR_CR3_SMPSEXTHP | PWR_CR3_SMPSEN | PWR_CR3_LDOEN;
524 /* Wait till voltage level flag is set */
525 while ((PWR->CSR1 & PWR_CSR1_ACTVOSRDY) == 0U)
526 {}
527#elif defined(USE_PWR_SMPS_1V8_SUPPLIES_EXT) && defined(SMPS)
528 /* Exit Run* mode */
529 PWR->CR3 = (PWR->CR3 & ~(PWR_CR3_LDOEN)) | PWR_CR3_SMPSLEVEL_0 | PWR_CR3_SMPSEXTHP | PWR_CR3_SMPSEN | PWR_CR3_BYPASS;
530 /* Wait till voltage level flag is set */
531 while ((PWR->CSR1 & PWR_CSR1_ACTVOSRDY) == 0U)
532 {}
533#elif defined(USE_PWR_SMPS_2V5_SUPPLIES_EXT) && defined(SMPS)
534 /* Exit Run* mode */
535 PWR->CR3 = (PWR->CR3 & ~(PWR_CR3_LDOEN)) | PWR_CR3_SMPSLEVEL_1 | PWR_CR3_SMPSEXTHP | PWR_CR3_SMPSEN | PWR_CR3_BYPASS;
536 /* Wait till voltage level flag is set */
537 while ((PWR->CSR1 & PWR_CSR1_ACTVOSRDY) == 0U)
538 {}
539#else
540 /* No system power supply configuration is selected at exit Run* mode */
541#endif /* USE_PWR_LDO_SUPPLY */
542}
543
544/**
545 * @}
546 */
547
548/**
549 * @}
550 */
551
552/**
553 * @}
554 */
#define __IO
Defines 'read / write' permissions.
#define SCB
SCB configuration struct.
#define CLEAR_BIT(REG, BIT)
Definition stm32h7xx.h:209
#define SET_BIT(REG, BIT)
Definition stm32h7xx.h:207
#define MODIFY_REG(REG, CLEARMASK, SETMASK)
Definition stm32h7xx.h:219
#define READ_BIT(REG, BIT)
Definition stm32h7xx.h:211
#define RCC_CFGR_SWS
SWS[2:0] bits (System Clock Switch Status).
#define PWR_CR3_BYPASS
Power Management Unit bypass.
#define RCC_PLLCKSELR_PLLSRC_CSI
CSI source clock selected.
#define RCC_PLL1DIVR_N1
#define RCC_CR_HSIDIV
Internal High Speed clock divider selection.
#define RCC_PLL1DIVR_P1
#define PWR_CR3_LDOEN
Low Drop Output regulator enable.
#define RCC_D1CFGR_D1CPRE
D1CPRE[2:0] bits (Domain 1 Core prescaler).
#define RCC_PLLCKSELR_PLLSRC_HSI
HSI source clock selected.
#define RCC_AHB2ENR_D2SRAM2EN
#define RCC_PLLCKSELR_PLLSRC
#define RCC_PLLCKSELR_DIVM1
#define RCC_CFGR_SWS_HSI
HSI used as system clock.
#define PWR_CSR1_ACTVOSRDY
Ready bit for current actual used VOS for VDD11 Voltage Scaling.
#define RCC_CFGR_SWS_PLL1
PLL1 used as system clock.
#define FLASH_LATENCY_DEFAULT
#define RCC_PLLCFGR_PLL1FRACEN_Pos
#define RCC_CFGR_SWS_CSI
CSI used as system clock.
#define RCC_D1CFGR_HPRE
HPRE[3:0] bits (AHB3 prescaler).
#define RCC_AHB3ENR_FMCEN
#define RCC_PLLCKSELR_PLLSRC_HSE
HSE source clock selected.
#define RCC_AHB2ENR_D2SRAM1EN
#define RCC_PLLCFGR_PLL1FRACEN
#define RCC_CFGR_SWS_HSE
HSE used as system clock.
#define FLASH_ACR_LATENCY
Read Latency.
#define RCC_PLL1FRACR_FRACN1
#define RCC_D1CFGR_D1CPRE_Pos
#define RCC_CR_HSION
Internal High Speed clock enable.
#define RCC_D1CFGR_HPRE_Pos
< D1HPRE configuration
#define PWR
#define FMC_Bank1_R
#define RCC
#define FLASH
#define DBGMCU
void SystemInit(void)
Setup the microcontroller system Initialize the FPU setting and vector table location configuration.
void ExitRun0Mode(void)
Exit Run* mode and Configure the system Power Supply.
void SystemCoreClockUpdate(void)
Update SystemCoreClock variable according to Clock Register Values.
uint32_t SystemD2Clock
System Domain2 Clock Frequency.
uint32_t SystemCoreClock
System Domain1 Clock Frequency.
const uint8_t D1CorePrescTable[16]
D1CorePrescTable prescalers table values.
CMSIS STM32H7xx Device Peripheral Access Layer Header File.
#define CSI_VALUE
Internal oscillator (CSI) default value.
#define HSI_VALUE
Internal High Speed oscillator (HSI) value.
#define HSE_VALUE
Adjust the value of External High Speed oscillator (HSE) used in your application.