From 88ed32483d2af67cb6231cc89f36d2e78e370771 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=82=E3=81=8F?= Date: Wed, 6 Jan 2021 23:03:37 +0300 Subject: [PATCH] Power: set smps clock according to used inductor. RTC: do not reset clock on each start. (#281) --- firmware/targets/f4/Src/main.c | 2 +- firmware/targets/f4/Src/rtc.c | 2 +- firmware/targets/f4/f4.ioc | 11 ++++++----- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/firmware/targets/f4/Src/main.c b/firmware/targets/f4/Src/main.c index 423e5d6b..7aff506f 100644 --- a/firmware/targets/f4/Src/main.c +++ b/firmware/targets/f4/Src/main.c @@ -215,7 +215,7 @@ void SystemClock_Config(void) PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE; PeriphClkInitStruct.RFWakeUpClockSelection = RCC_RFWKPCLKSOURCE_LSE; PeriphClkInitStruct.SmpsClockSelection = RCC_SMPSCLKSOURCE_HSE; - PeriphClkInitStruct.SmpsDivSelection = RCC_SMPSCLKDIV_RANGE0; + PeriphClkInitStruct.SmpsDivSelection = RCC_SMPSCLKDIV_RANGE1; if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK) { Error_Handler(); diff --git a/firmware/targets/f4/Src/rtc.c b/firmware/targets/f4/Src/rtc.c index a09cd28b..8b7aea42 100644 --- a/firmware/targets/f4/Src/rtc.c +++ b/firmware/targets/f4/Src/rtc.c @@ -48,7 +48,7 @@ void MX_RTC_Init(void) } /* USER CODE BEGIN Check_RTC_BKUP */ - + return; /* USER CODE END Check_RTC_BKUP */ /** Initialize RTC and set the Time and Date diff --git a/firmware/targets/f4/f4.ioc b/firmware/targets/f4/f4.ioc index 14041721..52b6389c 100644 --- a/firmware/targets/f4/f4.ioc +++ b/firmware/targets/f4/f4.ioc @@ -123,6 +123,7 @@ PB13.Mode=Output Compare1 CH1N TIM16.Prescaler=500 - 1 PC15-OSC32_OUT.GPIOParameters=GPIO_Label I2C1.CustomTiming=Disabled +RCC.SMPSDivider=4 PA4.GPIO_Label=PA4 ProjectManager.CustomerFirmwarePackage= PC4.GPIOParameters=GPIO_PuPd,GPIO_Label,GPIO_ModeDefaultEXTI @@ -134,8 +135,8 @@ SH.GPXTI10.0=GPIO_EXTI10 PCC.Ble.Mode=NOT_SELECTED PC4.GPIO_ModeDefaultEXTI=GPIO_MODE_IT_RISING_FALLING RCC.PLLQoutputFreq_Value=64000000 -ProjectManager.ProjectFileName=f3-1.ioc -RCC.SMPSFreq_Value=8000000 +ProjectManager.ProjectFileName=f4.ioc +RCC.SMPSFreq_Value=4000000 PA3.GPIO_ModeDefaultOutputPP=GPIO_MODE_OUTPUT_OD FREERTOS.Tasks01=defaultTask,24,1024,StartDefaultTask,Default,NULL,Dynamic,NULL,NULL;app_main,8,1024,app,As external,NULL,Dynamic,NULL,NULL ADC1.Rank-0\#ChannelRegularConversion=1 @@ -426,7 +427,7 @@ PE4.Signal=GPIO_Output PB0.Locked=true FREERTOS.configTOTAL_HEAP_SIZE=40960 PC14-OSC32_IN.GPIOParameters=GPIO_Label -ProjectManager.ProjectName=f3-1 +ProjectManager.ProjectName=f4 RCC.APB3Freq_Value=16000000 PA6.Signal=GPIO_Analog TIM2.Channel-Input_Capture2_from_TI1=TIM_CHANNEL_2 @@ -518,7 +519,7 @@ RCC.SMPSCLockSelectionVirtual=RCC_SMPSCLKSOURCE_HSE board=custom SH.GPXTI3.0=GPIO_EXTI3 RCC.VCOOutputFreq_Value=128000000 -RCC.SMPS1Freq_Value=16000000 +RCC.SMPS1Freq_Value=8000000 PB15.Mode=Full_Duplex_Master TIM16.Period=291 NVIC.SavedSystickIrqHandlerGenerated=true @@ -540,7 +541,7 @@ OSC_OUT.Locked=true PA4.GPIOParameters=GPIO_Label PH3-BOOT0.GPIO_ModeDefaultEXTI=GPIO_MODE_IT_RISING_FALLING PB15.GPIOParameters=GPIO_Label -RCC.IPParameters=ADCFreq_Value,AHB2CLKDivider,AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,APB3Freq_Value,Cortex2Freq_Value,CortexFreq_Value,EnableCSSLSE,EnbaleCSS,FCLK2Freq_Value,FCLKCortexFreq_Value,FamilyName,HCLK2Freq_Value,HCLK3Freq_Value,HCLKFreq_Value,HCLKRFFreq_Value,HSE_VALUE,HSI48_VALUE,HSI_VALUE,I2C1Freq_Value,I2C3Freq_Value,LCDFreq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPUART1Freq_Value,LSCOPinFreq_Value,LSE_Drive_Capability,LSE_Timout,LSI_VALUE,MCO1PinFreq_Value,MSIOscState,PLLM,PLLPoutputFreq_Value,PLLQoutputFreq_Value,PLLRCLKFreq_Value,PLLSAI1N,PLLSAI1PoutputFreq_Value,PLLSAI1QoutputFreq_Value,PLLSAI1RoutputFreq_Value,PLLSourceVirtual,PREFETCH_ENABLE,PWRFreq_Value,RFWKPClockSelection,RFWKPFreq_Value,RNGCLockSelection,RNGFreq_Value,RTCClockSelection,RTCFreq_Value,SAI1Freq_Value,SMPS1Freq_Value,SMPSCLockSelectionVirtual,SMPSFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,USART1Freq_Value,USBFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAI1OutputFreq_Value +RCC.IPParameters=ADCFreq_Value,AHB2CLKDivider,AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,APB3Freq_Value,Cortex2Freq_Value,CortexFreq_Value,EnableCSSLSE,EnbaleCSS,FCLK2Freq_Value,FCLKCortexFreq_Value,FamilyName,HCLK2Freq_Value,HCLK3Freq_Value,HCLKFreq_Value,HCLKRFFreq_Value,HSE_VALUE,HSI48_VALUE,HSI_VALUE,I2C1Freq_Value,I2C3Freq_Value,LCDFreq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPUART1Freq_Value,LSCOPinFreq_Value,LSE_Drive_Capability,LSE_Timout,LSI_VALUE,MCO1PinFreq_Value,MSIOscState,PLLM,PLLPoutputFreq_Value,PLLQoutputFreq_Value,PLLRCLKFreq_Value,PLLSAI1N,PLLSAI1PoutputFreq_Value,PLLSAI1QoutputFreq_Value,PLLSAI1RoutputFreq_Value,PLLSourceVirtual,PREFETCH_ENABLE,PWRFreq_Value,RFWKPClockSelection,RFWKPFreq_Value,RNGCLockSelection,RNGFreq_Value,RTCClockSelection,RTCFreq_Value,SAI1Freq_Value,SMPS1Freq_Value,SMPSCLockSelectionVirtual,SMPSDivider,SMPSFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,USART1Freq_Value,USBFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAI1OutputFreq_Value ProjectManager.AskForMigrate=true Mcu.Name=STM32WB55RGVx NVIC.SavedPendsvIrqHandlerGenerated=false