48 #include "stm32h7xx.h"
50 #if !defined (HSE_VALUE)
51 #define HSE_VALUE ((uint32_t)25000000)
54 #if !defined (CSI_VALUE)
55 #define CSI_VALUE ((uint32_t)4000000)
58 #if !defined (HSI_VALUE)
59 #define HSI_VALUE ((uint32_t)64000000)
86 #define VECT_TAB_OFFSET 0x00000000UL
115 const uint8_t
D1CorePrescTable[16] = {0, 0, 0, 0, 1, 2, 3, 4, 1, 2, 3, 4, 6, 7, 8, 9};
142 #if defined (DATA_IN_D2_SRAM)
143 __IO uint32_t tmpreg;
147 #if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
148 SCB->CPACR |= ((3UL << (10*2))|(3UL << (11*2)));
163 RCC->CFGR = 0x00000000;
166 RCC->CR &= 0xEAF6ED7FU;
175 #if defined(D3_SRAM_BASE)
177 RCC->D1CFGR = 0x00000000;
180 RCC->D2CFGR = 0x00000000;
183 RCC->D3CFGR = 0x00000000;
186 RCC->CDCFGR1 = 0x00000000;
189 RCC->CDCFGR2 = 0x00000000;
192 RCC->SRDCFGR = 0x00000000;
195 RCC->PLLCKSELR = 0x02020200;
198 RCC->PLLCFGR = 0x01FF0000;
200 RCC->PLL1DIVR = 0x01010280;
202 RCC->PLL1FRACR = 0x00000000;
205 RCC->PLL2DIVR = 0x01010280;
209 RCC->PLL2FRACR = 0x00000000;
211 RCC->PLL3DIVR = 0x01010280;
214 RCC->PLL3FRACR = 0x00000000;
217 RCC->CR &= 0xFFFBFFFFU;
220 RCC->CIER = 0x00000000;
222 #if (STM32H7_DEV_ID == 0x450UL)
224 if((
DBGMCU->IDCODE & 0xFFFF0000U) < 0x20000000U)
228 *((
__IO uint32_t*)0x51008108) = 0x000000001U;
232 #if defined (DATA_IN_D2_SRAM)
234 #if defined(RCC_AHB2ENR_D2SRAM3EN)
236 #elif defined(RCC_AHB2ENR_D2SRAM2EN)
239 RCC->AHB2ENR |= (RCC_AHB2ENR_AHBSRAM1EN | RCC_AHB2ENR_AHBSRAM2EN);
242 tmpreg =
RCC->AHB2ENR;
246 #if defined(DUAL_CORE) && defined(CORE_CM4)
313 uint32_t pllp, pllsource, pllm, pllfracen, hsivalue, tmp;
314 uint32_t common_system_clock;
315 float_t fracn1, pllvco;
351 pllvco = ( (float_t)hsivalue / (float_t)pllm) * ((float_t)(uint32_t)(
RCC->PLL1DIVR &
RCC_PLL1DIVR_N1) + (fracn1/(float_t)0x2000) +(float_t)1 );
356 pllvco = ((float_t)
CSI_VALUE / (float_t)pllm) * ((float_t)(uint32_t)(
RCC->PLL1DIVR &
RCC_PLL1DIVR_N1) + (fracn1/(float_t)0x2000) +(float_t)1 );
360 pllvco = ((float_t)
HSE_VALUE / (float_t)pllm) * ((float_t)(uint32_t)(
RCC->PLL1DIVR &
RCC_PLL1DIVR_N1) + (fracn1/(float_t)0x2000) +(float_t)1 );
365 pllvco = ((float_t)hsivalue / (float_t)pllm) * ((float_t)(uint32_t)(
RCC->PLL1DIVR &
RCC_PLL1DIVR_N1) + (fracn1/(float_t)0x2000) +(float_t)1 );
369 common_system_clock = (uint32_t)(float_t)(pllvco/(float_t)pllp);
373 common_system_clock = 0U;
383 #if defined (RCC_D1CFGR_D1CPRE)
387 common_system_clock >>= tmp;
396 common_system_clock >>= tmp;
403 #if defined(DUAL_CORE) && defined(CORE_CM4)