update to CubeMX 6.14.0, FW_H7 1.12.1
This commit is contained in:
@ -6,6 +6,11 @@
|
||||
*
|
||||
* This file provides two functions and one global variable to be called from
|
||||
* user application:
|
||||
* - ExitRun0Mode(): Specifies the Power Supply source. This function is
|
||||
* called at startup just after reset and before the call
|
||||
* of SystemInit(). This call is made inside
|
||||
* the "startup_stm32h7xx.s" file.
|
||||
*
|
||||
* - SystemInit(): This function is called at startup just after reset and
|
||||
* before branch to main program. This call is made inside
|
||||
* the "startup_stm32h7xx.s" file.
|
||||
@ -285,12 +290,21 @@ void SystemInit (void)
|
||||
#endif /* USER_VECT_TAB_ADDRESS */
|
||||
|
||||
#else
|
||||
/*
|
||||
* Disable the FMC bank1 (enabled after reset).
|
||||
* This, prevents CPU speculation access on this bank which blocks the use of FMC during
|
||||
* 24us. During this time the others FMC master (such as LTDC) cannot use it!
|
||||
*/
|
||||
FMC_Bank1_R->BTCR[0] = 0x000030D2;
|
||||
if(READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN) == 0U)
|
||||
{
|
||||
/* Enable the FMC interface clock */
|
||||
SET_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN);
|
||||
|
||||
/*
|
||||
* Disable the FMC bank1 (enabled after reset).
|
||||
* This, prevents CPU speculation access on this bank which blocks the use of FMC during
|
||||
* 24us. During this time the others FMC master (such as LTDC) cannot use it!
|
||||
*/
|
||||
FMC_Bank1_R->BTCR[0] = 0x000030D2;
|
||||
|
||||
/* Disable the FMC interface clock */
|
||||
CLEAR_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN);
|
||||
}
|
||||
|
||||
/* Configure the Vector Table location -------------------------------------*/
|
||||
#if defined(USER_VECT_TAB_ADDRESS)
|
||||
@ -301,7 +315,7 @@ void SystemInit (void)
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Update SystemCoreClock variable according to Clock Register Values.
|
||||
* @brief Update SystemCoreClock variable according to Clock Register Values.
|
||||
* The SystemCoreClock variable contains the core clock , it can
|
||||
* be used by the user application to setup the SysTick timer or configure
|
||||
* other parameters.
|
||||
@ -436,6 +450,98 @@ void SystemCoreClockUpdate (void)
|
||||
#endif /* DUAL_CORE && CORE_CM4 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Exit Run* mode and Configure the system Power Supply
|
||||
*
|
||||
* @note This function exits the Run* mode and configures the system power supply
|
||||
* according to the definition to be used at compilation preprocessing level.
|
||||
* The application shall set one of the following configuration option:
|
||||
* - PWR_LDO_SUPPLY
|
||||
* - PWR_DIRECT_SMPS_SUPPLY
|
||||
* - PWR_EXTERNAL_SOURCE_SUPPLY
|
||||
* - PWR_SMPS_1V8_SUPPLIES_LDO
|
||||
* - PWR_SMPS_2V5_SUPPLIES_LDO
|
||||
* - PWR_SMPS_1V8_SUPPLIES_EXT_AND_LDO
|
||||
* - PWR_SMPS_2V5_SUPPLIES_EXT_AND_LDO
|
||||
* - PWR_SMPS_1V8_SUPPLIES_EXT
|
||||
* - PWR_SMPS_2V5_SUPPLIES_EXT
|
||||
*
|
||||
* @note The function modifies the PWR->CR3 register to enable or disable specific
|
||||
* power supply modes and waits until the voltage level flag is set, indicating
|
||||
* that the power supply configuration is stable.
|
||||
*
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void ExitRun0Mode(void)
|
||||
{
|
||||
#if defined(USE_PWR_LDO_SUPPLY)
|
||||
#if defined(SMPS)
|
||||
/* Exit Run* mode by disabling SMPS and enabling LDO */
|
||||
PWR->CR3 = (PWR->CR3 & ~PWR_CR3_SMPSEN) | PWR_CR3_LDOEN;
|
||||
#else
|
||||
/* Enable LDO mode */
|
||||
PWR->CR3 |= PWR_CR3_LDOEN;
|
||||
#endif /* SMPS */
|
||||
/* Wait till voltage level flag is set */
|
||||
while ((PWR->CSR1 & PWR_CSR1_ACTVOSRDY) == 0U)
|
||||
{}
|
||||
#elif defined(USE_PWR_EXTERNAL_SOURCE_SUPPLY)
|
||||
#if defined(SMPS)
|
||||
/* Exit Run* mode */
|
||||
PWR->CR3 = (PWR->CR3 & ~(PWR_CR3_SMPSEN | PWR_CR3_LDOEN)) | PWR_CR3_BYPASS;
|
||||
#else
|
||||
PWR->CR3 = (PWR->CR3 & ~(PWR_CR3_LDOEN)) | PWR_CR3_BYPASS;
|
||||
#endif /* SMPS */
|
||||
/* Wait till voltage level flag is set */
|
||||
while ((PWR->CSR1 & PWR_CSR1_ACTVOSRDY) == 0U)
|
||||
{}
|
||||
#elif defined(USE_PWR_DIRECT_SMPS_SUPPLY) && defined(SMPS)
|
||||
/* Exit Run* mode */
|
||||
PWR->CR3 &= ~(PWR_CR3_LDOEN);
|
||||
/* Wait till voltage level flag is set */
|
||||
while ((PWR->CSR1 & PWR_CSR1_ACTVOSRDY) == 0U)
|
||||
{}
|
||||
#elif defined(USE_PWR_SMPS_1V8_SUPPLIES_LDO) && defined(SMPS)
|
||||
/* Exit Run* mode */
|
||||
PWR->CR3 |= PWR_CR3_SMPSLEVEL_0 | PWR_CR3_SMPSEN | PWR_CR3_LDOEN;
|
||||
/* Wait till voltage level flag is set */
|
||||
while ((PWR->CSR1 & PWR_CSR1_ACTVOSRDY) == 0U)
|
||||
{}
|
||||
#elif defined(USE_PWR_SMPS_2V5_SUPPLIES_LDO) && defined(SMPS)
|
||||
/* Exit Run* mode */
|
||||
PWR->CR3 |= PWR_CR3_SMPSLEVEL_1 | PWR_CR3_SMPSEN | PWR_CR3_LDOEN;
|
||||
/* Wait till voltage level flag is set */
|
||||
while ((PWR->CSR1 & PWR_CSR1_ACTVOSRDY) == 0U)
|
||||
{}
|
||||
#elif defined(USE_PWR_SMPS_1V8_SUPPLIES_EXT_AND_LDO) && defined(SMPS)
|
||||
/* Exit Run* mode */
|
||||
PWR->CR3 |= PWR_CR3_SMPSLEVEL_0 | PWR_CR3_SMPSEXTHP | PWR_CR3_SMPSEN | PWR_CR3_LDOEN;
|
||||
/* Wait till voltage level flag is set */
|
||||
while ((PWR->CSR1 & PWR_CSR1_ACTVOSRDY) == 0U)
|
||||
{}
|
||||
#elif defined(USE_PWR_SMPS_2V5_SUPPLIES_EXT_AND_LDO) && defined(SMPS)
|
||||
/* Exit Run* mode */
|
||||
PWR->CR3 |= PWR_CR3_SMPSLEVEL_1 | PWR_CR3_SMPSEXTHP | PWR_CR3_SMPSEN | PWR_CR3_LDOEN;
|
||||
/* Wait till voltage level flag is set */
|
||||
while ((PWR->CSR1 & PWR_CSR1_ACTVOSRDY) == 0U)
|
||||
{}
|
||||
#elif defined(USE_PWR_SMPS_1V8_SUPPLIES_EXT) && defined(SMPS)
|
||||
/* Exit Run* mode */
|
||||
PWR->CR3 = (PWR->CR3 & ~(PWR_CR3_LDOEN)) | PWR_CR3_SMPSLEVEL_0 | PWR_CR3_SMPSEXTHP | PWR_CR3_SMPSEN | PWR_CR3_BYPASS;
|
||||
/* Wait till voltage level flag is set */
|
||||
while ((PWR->CSR1 & PWR_CSR1_ACTVOSRDY) == 0U)
|
||||
{}
|
||||
#elif defined(USE_PWR_SMPS_2V5_SUPPLIES_EXT) && defined(SMPS)
|
||||
/* Exit Run* mode */
|
||||
PWR->CR3 = (PWR->CR3 & ~(PWR_CR3_LDOEN)) | PWR_CR3_SMPSLEVEL_1 | PWR_CR3_SMPSEXTHP | PWR_CR3_SMPSEN | PWR_CR3_BYPASS;
|
||||
/* Wait till voltage level flag is set */
|
||||
while ((PWR->CSR1 & PWR_CSR1_ACTVOSRDY) == 0U)
|
||||
{}
|
||||
#else
|
||||
/* No system power supply configuration is selected at exit Run* mode */
|
||||
#endif /* USE_PWR_LDO_SUPPLY */
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
Reference in New Issue
Block a user