Changeset 39 for ctrl/firmware/Main/CubeMX
- Timestamp:
- Dec 2, 2024, 10:55:02 AM (8 weeks ago)
- Location:
- ctrl/firmware/Main/CubeMX
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified ctrl/firmware/Main/CubeMX/Core/Inc/stm32h7xx_hal_conf.h ¶
r13 r39 68 68 /* #define HAL_RAMECC_MODULE_ENABLED */ 69 69 /* #define HAL_RNG_MODULE_ENABLED */ 70 /* #define HAL_RTC_MODULE_ENABLED */ 70 #define HAL_RTC_MODULE_ENABLED 71 71 /* #define HAL_SAI_MODULE_ENABLED */ 72 72 /* #define HAL_SD_MODULE_ENABLED */ -
TabularUnified ctrl/firmware/Main/CubeMX/Core/Src/main.c ¶
r38 r39 42 42 /* Private variables ---------------------------------------------------------*/ 43 43 44 RTC_HandleTypeDef hrtc; 45 44 46 /* USER CODE BEGIN PV */ 45 47 … … 49 51 void SystemClock_Config(void); 50 52 static void MPU_Config(void); 53 static void MX_GPIO_Init(void); 54 static void MX_RTC_Init(void); 51 55 /* USER CODE BEGIN PFP */ 52 56 … … 97 101 98 102 /* Initialize all configured peripherals */ 103 MX_GPIO_Init(); 104 MX_RTC_Init(); 99 105 /* USER CODE BEGIN 2 */ 100 106 … … 118 124 void SystemClock_Config(void) 119 125 { 120 RCC_OscInitTypeDef RCC_OscInitStruct {};121 RCC_ClkInitTypeDef RCC_ClkInitStruct {};126 RCC_OscInitTypeDef RCC_OscInitStruct = {0}; 127 RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; 122 128 123 129 /** Supply configuration update enable … … 127 133 /** Configure the main internal regulator output voltage 128 134 */ 129 __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE 3);135 __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE2); 130 136 131 137 while(!__HAL_PWR_GET_FLAG(PWR_FLAG_VOSRDY)) {} 138 139 /** Configure LSE Drive Capability 140 */ 141 HAL_PWR_EnableBkUpAccess(); 142 __HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_LOW); 132 143 133 144 /** Initializes the RCC Oscillators according to the specified parameters 134 145 * in the RCC_OscInitTypeDef structure. 135 146 */ 136 RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI; 137 RCC_OscInitStruct.HSIState = RCC_HSI_DIV1; 138 RCC_OscInitStruct.HSICalibrationValue = 64; 139 RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE; 147 RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE|RCC_OSCILLATORTYPE_LSE; 148 RCC_OscInitStruct.HSEState = RCC_HSE_ON; 149 RCC_OscInitStruct.LSEState = RCC_LSE_ON; 150 RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; 151 RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; 152 RCC_OscInitStruct.PLL.PLLM = 25; 153 RCC_OscInitStruct.PLL.PLLN = 200; 154 RCC_OscInitStruct.PLL.PLLP = 2; 155 RCC_OscInitStruct.PLL.PLLQ = 2; 156 RCC_OscInitStruct.PLL.PLLR = 2; 157 RCC_OscInitStruct.PLL.PLLRGE = RCC_PLL1VCIRANGE_0; 158 RCC_OscInitStruct.PLL.PLLVCOSEL = RCC_PLL1VCOMEDIUM; 159 RCC_OscInitStruct.PLL.PLLFRACN = 0; 140 160 if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) 141 161 { … … 148 168 |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2 149 169 |RCC_CLOCKTYPE_D3PCLK1|RCC_CLOCKTYPE_D1PCLK1; 150 RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_ HSI;170 RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; 151 171 RCC_ClkInitStruct.SYSCLKDivider = RCC_SYSCLK_DIV1; 152 172 RCC_ClkInitStruct.AHBCLKDivider = RCC_HCLK_DIV1; … … 162 182 } 163 183 184 /** 185 * @brief RTC Initialization Function 186 * @param None 187 * @retval None 188 */ 189 static void MX_RTC_Init(void) 190 { 191 192 /* USER CODE BEGIN RTC_Init 0 */ 193 194 /* USER CODE END RTC_Init 0 */ 195 196 /* USER CODE BEGIN RTC_Init 1 */ 197 198 /* USER CODE END RTC_Init 1 */ 199 200 /** Initialize RTC Only 201 */ 202 hrtc.Instance = RTC; 203 hrtc.Init.HourFormat = RTC_HOURFORMAT_24; 204 hrtc.Init.AsynchPrediv = 127; 205 hrtc.Init.SynchPrediv = 255; 206 hrtc.Init.OutPut = RTC_OUTPUT_DISABLE; 207 hrtc.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH; 208 hrtc.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN; 209 hrtc.Init.OutPutRemap = RTC_OUTPUT_REMAP_NONE; 210 if (HAL_RTC_Init(&hrtc) != HAL_OK) 211 { 212 Error_Handler(); 213 } 214 /* USER CODE BEGIN RTC_Init 2 */ 215 216 /* USER CODE END RTC_Init 2 */ 217 218 } 219 220 /** 221 * @brief GPIO Initialization Function 222 * @param None 223 * @retval None 224 */ 225 static void MX_GPIO_Init(void) 226 { 227 /* USER CODE BEGIN MX_GPIO_Init_1 */ 228 /* USER CODE END MX_GPIO_Init_1 */ 229 230 /* GPIO Ports Clock Enable */ 231 __HAL_RCC_GPIOC_CLK_ENABLE(); 232 __HAL_RCC_GPIOH_CLK_ENABLE(); 233 234 /* USER CODE BEGIN MX_GPIO_Init_2 */ 235 /* USER CODE END MX_GPIO_Init_2 */ 236 } 237 164 238 /* USER CODE BEGIN 4 */ 165 239 … … 170 244 void MPU_Config(void) 171 245 { 172 MPU_Region_InitTypeDef MPU_InitStruct {};246 MPU_Region_InitTypeDef MPU_InitStruct = {0}; 173 247 174 248 /* Disables the MPU */ -
TabularUnified ctrl/firmware/Main/CubeMX/Core/Src/stm32h7xx_hal_msp.c ¶
r13 r39 77 77 } 78 78 79 /** 80 * @brief RTC MSP Initialization 81 * This function configures the hardware resources used in this example 82 * @param hrtc: RTC handle pointer 83 * @retval None 84 */ 85 void HAL_RTC_MspInit(RTC_HandleTypeDef* hrtc) 86 { 87 RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0}; 88 if(hrtc->Instance==RTC) 89 { 90 /* USER CODE BEGIN RTC_MspInit 0 */ 91 92 /* USER CODE END RTC_MspInit 0 */ 93 94 /** Initializes the peripherals clock 95 */ 96 PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_RTC; 97 PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE; 98 if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK) 99 { 100 Error_Handler(); 101 } 102 103 /* Peripheral clock enable */ 104 __HAL_RCC_RTC_ENABLE(); 105 /* USER CODE BEGIN RTC_MspInit 1 */ 106 107 /* USER CODE END RTC_MspInit 1 */ 108 109 } 110 111 } 112 113 /** 114 * @brief RTC MSP De-Initialization 115 * This function freeze the hardware resources used in this example 116 * @param hrtc: RTC handle pointer 117 * @retval None 118 */ 119 void HAL_RTC_MspDeInit(RTC_HandleTypeDef* hrtc) 120 { 121 if(hrtc->Instance==RTC) 122 { 123 /* USER CODE BEGIN RTC_MspDeInit 0 */ 124 125 /* USER CODE END RTC_MspDeInit 0 */ 126 /* Peripheral clock disable */ 127 __HAL_RCC_RTC_DISABLE(); 128 /* USER CODE BEGIN RTC_MspDeInit 1 */ 129 130 /* USER CODE END RTC_MspDeInit 1 */ 131 } 132 133 } 134 79 135 /* USER CODE BEGIN 1 */ 80 136 -
TabularUnified ctrl/firmware/Main/CubeMX/charger.ioc ¶
r38 r39 18 18 Mcu.IP2=NVIC 19 19 Mcu.IP3=RCC 20 Mcu.IP4=SYS 21 Mcu.IPNb=5 20 Mcu.IP4=RTC 21 Mcu.IP5=SYS 22 Mcu.IPNb=6 22 23 Mcu.Name=STM32H723ZETx 23 24 Mcu.Package=LQFP144 24 Mcu.Pin0=VP_SYS_VS_Systick 25 Mcu.Pin1=VP_MEMORYMAP_VS_MEMORYMAP 26 Mcu.PinsNb=2 25 Mcu.Pin0=PC14-OSC32_IN 26 Mcu.Pin1=PC15-OSC32_OUT 27 Mcu.Pin2=PH0-OSC_IN 28 Mcu.Pin3=PH1-OSC_OUT 29 Mcu.Pin4=VP_RTC_VS_RTC_Activate 30 Mcu.Pin5=VP_SYS_VS_Systick 31 Mcu.Pin6=VP_MEMORYMAP_VS_MEMORYMAP 32 Mcu.PinsNb=7 27 33 Mcu.ThirdPartyNb=0 28 34 Mcu.UserConstants= … … 41 47 NVIC.SysTick_IRQn=true\:15\:0\:false\:false\:true\:false\:true\:false 42 48 NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false 49 PC14-OSC32_IN.Mode=LSE-External-Oscillator 50 PC14-OSC32_IN.Signal=RCC_OSC32_IN 51 PC15-OSC32_OUT.Mode=LSE-External-Oscillator 52 PC15-OSC32_OUT.Signal=RCC_OSC32_OUT 53 PH0-OSC_IN.Mode=HSE-External-Oscillator 54 PH0-OSC_IN.Signal=RCC_OSC_IN 55 PH1-OSC_OUT.Mode=HSE-External-Oscillator 56 PH1-OSC_OUT.Signal=RCC_OSC_OUT 43 57 PinOutPanel.RotationAngle=0 44 58 ProjectManager.AskForMigrate=true … … 72 86 ProjectManager.UAScriptBeforePath= 73 87 ProjectManager.UnderRoot=false 74 ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false, 0-MX_CORTEX_M7_Init-CORTEX_M7-false-HAL-true75 RCC.ADCFreq_Value=1 2900000076 RCC.AHB12Freq_Value= 6400000077 RCC.AHB4Freq_Value= 6400000078 RCC.APB1Freq_Value= 6400000079 RCC.APB2Freq_Value= 6400000080 RCC.APB3Freq_Value= 6400000081 RCC.APB4Freq_Value= 6400000082 RCC.AXIClockFreq_Value= 6400000088 ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false,2-MX_GPIO_Init-GPIO-false-HAL-true,0-MX_CORTEX_M7_Init-CORTEX_M7-false-HAL-true 89 RCC.ADCFreq_Value=100000000 90 RCC.AHB12Freq_Value=100000000 91 RCC.AHB4Freq_Value=100000000 92 RCC.APB1Freq_Value=100000000 93 RCC.APB2Freq_Value=100000000 94 RCC.APB3Freq_Value=100000000 95 RCC.APB4Freq_Value=100000000 96 RCC.AXIClockFreq_Value=100000000 83 97 RCC.CECFreq_Value=32000 84 98 RCC.CKPERFreq_Value=64000000 85 RCC.CortexFreq_Value=64000000 86 RCC.CpuClockFreq_Value=64000000 87 RCC.D1CPREFreq_Value=64000000 88 RCC.DFSDMACLkFreq_Value=129000000 89 RCC.DFSDMFreq_Value=64000000 90 RCC.DIVP1Freq_Value=129000000 91 RCC.DIVP2Freq_Value=129000000 92 RCC.DIVP3Freq_Value=129000000 93 RCC.DIVQ1Freq_Value=129000000 94 RCC.DIVQ2Freq_Value=129000000 95 RCC.DIVQ3Freq_Value=129000000 96 RCC.DIVR1Freq_Value=129000000 97 RCC.DIVR2Freq_Value=129000000 98 RCC.DIVR3Freq_Value=129000000 99 RCC.FDCANFreq_Value=129000000 100 RCC.FMCFreq_Value=64000000 99 RCC.CortexFreq_Value=100000000 100 RCC.CpuClockFreq_Value=100000000 101 RCC.D1CPREFreq_Value=100000000 102 RCC.DFSDMACLkFreq_Value=100000000 103 RCC.DFSDMFreq_Value=100000000 104 RCC.DIVM1=25 105 RCC.DIVM2=25 106 RCC.DIVM3=25 107 RCC.DIVN1=200 108 RCC.DIVN2=200 109 RCC.DIVN3=200 110 RCC.DIVP1Freq_Value=100000000 111 RCC.DIVP2Freq_Value=100000000 112 RCC.DIVP3Freq_Value=100000000 113 RCC.DIVQ1Freq_Value=100000000 114 RCC.DIVQ2Freq_Value=100000000 115 RCC.DIVQ3Freq_Value=100000000 116 RCC.DIVR1Freq_Value=100000000 117 RCC.DIVR2Freq_Value=100000000 118 RCC.DIVR3Freq_Value=100000000 119 RCC.FDCANFreq_Value=100000000 120 RCC.FMCFreq_Value=100000000 101 121 RCC.FamilyName=M 102 RCC.HCLK3ClockFreq_Value= 64000000103 RCC.HCLKFreq_Value= 64000000104 RCC.I2C123Freq_Value= 64000000105 RCC.I2C4Freq_Value= 64000000106 RCC.IPParameters=ADCFreq_Value,AHB12Freq_Value,AHB4Freq_Value,APB1Freq_Value,APB2Freq_Value,APB3Freq_Value,APB4Freq_Value,AXIClockFreq_Value,CECFreq_Value,CKPERFreq_Value,CortexFreq_Value,CpuClockFreq_Value,D1CPREFreq_Value,DFSDMACLkFreq_Value,DFSDMFreq_Value,DIV P1Freq_Value,DIVP2Freq_Value,DIVP3Freq_Value,DIVQ1Freq_Value,DIVQ2Freq_Value,DIVQ3Freq_Value,DIVR1Freq_Value,DIVR2Freq_Value,DIVR3Freq_Value,FDCANFreq_Value,FMCFreq_Value,FamilyName,HCLK3ClockFreq_Value,HCLKFreq_Value,I2C123Freq_Value,I2C4Freq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPTIM345Freq_Value,LPUART1Freq_Value,LTDCFreq_Value,MCO1PinFreq_Value,MCO2PinFreq_Value,QSPIFreq_Value,RNGFreq_Value,RTCFreq_Value,SAI1Freq_Value,SAI4AFreq_Value,SAI4BFreq_Value,SDMMCFreq_Value,SPDIFRXFreq_Value,SPI123Freq_Value,SPI45Freq_Value,SPI6Freq_Value,SWPMI1Freq_Value,SYSCLKFreq_VALUE,Tim1OutputFreq_Value,Tim2OutputFreq_Value,TraceFreq_Value,USART16Freq_Value,USART234578Freq_Value,USBFreq_Value,VCO1OutputFreq_Value,VCO2OutputFreq_Value,VCO3OutputFreq_Value,VCOInput1Freq_Value,VCOInput2Freq_Value,VCOInput3Freq_Value107 RCC.LPTIM1Freq_Value= 64000000108 RCC.LPTIM2Freq_Value= 64000000109 RCC.LPTIM345Freq_Value= 64000000110 RCC.LPUART1Freq_Value= 64000000111 RCC.LTDCFreq_Value=1 29000000122 RCC.HCLK3ClockFreq_Value=100000000 123 RCC.HCLKFreq_Value=100000000 124 RCC.I2C123Freq_Value=100000000 125 RCC.I2C4Freq_Value=100000000 126 RCC.IPParameters=ADCFreq_Value,AHB12Freq_Value,AHB4Freq_Value,APB1Freq_Value,APB2Freq_Value,APB3Freq_Value,APB4Freq_Value,AXIClockFreq_Value,CECFreq_Value,CKPERFreq_Value,CortexFreq_Value,CpuClockFreq_Value,D1CPREFreq_Value,DFSDMACLkFreq_Value,DFSDMFreq_Value,DIVM1,DIVM2,DIVM3,DIVN1,DIVN2,DIVN3,DIVP1Freq_Value,DIVP2Freq_Value,DIVP3Freq_Value,DIVQ1Freq_Value,DIVQ2Freq_Value,DIVQ3Freq_Value,DIVR1Freq_Value,DIVR2Freq_Value,DIVR3Freq_Value,FDCANFreq_Value,FMCFreq_Value,FamilyName,HCLK3ClockFreq_Value,HCLKFreq_Value,I2C123Freq_Value,I2C4Freq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPTIM345Freq_Value,LPUART1Freq_Value,LTDCFreq_Value,MCO1PinFreq_Value,MCO2PinFreq_Value,PLLSourceVirtual,QSPIFreq_Value,RNGFreq_Value,RTCClockSelection,RTCFreq_Value,SAI1Freq_Value,SAI4AFreq_Value,SAI4BFreq_Value,SDMMCFreq_Value,SPDIFRXFreq_Value,SPI123Freq_Value,SPI45Freq_Value,SPI6Freq_Value,SWPMI1Freq_Value,SYSCLKFreq_VALUE,SYSCLKSource,Tim1OutputFreq_Value,Tim2OutputFreq_Value,TraceFreq_Value,USART16Freq_Value,USART234578Freq_Value,USBFreq_Value,VCO1OutputFreq_Value,VCO2OutputFreq_Value,VCO3OutputFreq_Value,VCOInput1Freq_Value,VCOInput2Freq_Value,VCOInput3Freq_Value 127 RCC.LPTIM1Freq_Value=100000000 128 RCC.LPTIM2Freq_Value=100000000 129 RCC.LPTIM345Freq_Value=100000000 130 RCC.LPUART1Freq_Value=100000000 131 RCC.LTDCFreq_Value=100000000 112 132 RCC.MCO1PinFreq_Value=64000000 113 RCC.MCO2PinFreq_Value=64000000 114 RCC.QSPIFreq_Value=64000000 133 RCC.MCO2PinFreq_Value=100000000 134 RCC.PLLSourceVirtual=RCC_PLLSOURCE_HSE 135 RCC.QSPIFreq_Value=100000000 115 136 RCC.RNGFreq_Value=48000000 116 RCC.RTCFreq_Value=32000 117 RCC.SAI1Freq_Value=129000000 118 RCC.SAI4AFreq_Value=129000000 119 RCC.SAI4BFreq_Value=129000000 120 RCC.SDMMCFreq_Value=129000000 121 RCC.SPDIFRXFreq_Value=129000000 122 RCC.SPI123Freq_Value=129000000 123 RCC.SPI45Freq_Value=64000000 124 RCC.SPI6Freq_Value=64000000 125 RCC.SWPMI1Freq_Value=64000000 126 RCC.SYSCLKFreq_VALUE=64000000 127 RCC.Tim1OutputFreq_Value=64000000 128 RCC.Tim2OutputFreq_Value=64000000 137 RCC.RTCClockSelection=RCC_RTCCLKSOURCE_LSE 138 RCC.RTCFreq_Value=32768 139 RCC.SAI1Freq_Value=100000000 140 RCC.SAI4AFreq_Value=100000000 141 RCC.SAI4BFreq_Value=100000000 142 RCC.SDMMCFreq_Value=100000000 143 RCC.SPDIFRXFreq_Value=100000000 144 RCC.SPI123Freq_Value=100000000 145 RCC.SPI45Freq_Value=100000000 146 RCC.SPI6Freq_Value=100000000 147 RCC.SWPMI1Freq_Value=100000000 148 RCC.SYSCLKFreq_VALUE=100000000 149 RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK 150 RCC.Tim1OutputFreq_Value=100000000 151 RCC.Tim2OutputFreq_Value=100000000 129 152 RCC.TraceFreq_Value=64000000 130 RCC.USART16Freq_Value= 64000000131 RCC.USART234578Freq_Value= 64000000132 RCC.USBFreq_Value=1 29000000133 RCC.VCO1OutputFreq_Value=2 58000000134 RCC.VCO2OutputFreq_Value=2 58000000135 RCC.VCO3OutputFreq_Value=2 58000000136 RCC.VCOInput1Freq_Value= 2000000137 RCC.VCOInput2Freq_Value= 2000000138 RCC.VCOInput3Freq_Value= 2000000153 RCC.USART16Freq_Value=100000000 154 RCC.USART234578Freq_Value=100000000 155 RCC.USBFreq_Value=100000000 156 RCC.VCO1OutputFreq_Value=200000000 157 RCC.VCO2OutputFreq_Value=200000000 158 RCC.VCO3OutputFreq_Value=200000000 159 RCC.VCOInput1Freq_Value=1000000 160 RCC.VCOInput2Freq_Value=1000000 161 RCC.VCOInput3Freq_Value=1000000 139 162 VP_MEMORYMAP_VS_MEMORYMAP.Mode=CurAppReg 140 163 VP_MEMORYMAP_VS_MEMORYMAP.Signal=MEMORYMAP_VS_MEMORYMAP 164 VP_RTC_VS_RTC_Activate.Mode=RTC_Enabled 165 VP_RTC_VS_RTC_Activate.Signal=RTC_VS_RTC_Activate 141 166 VP_SYS_VS_Systick.Mode=SysTick 142 167 VP_SYS_VS_Systick.Signal=SYS_VS_Systick
Note: See TracChangeset
for help on using the changeset viewer.