Index: ctrl/firmware/Main/CubeMX/Core/Inc/stm32h7xx_hal_conf.h
===================================================================
--- ctrl/firmware/Main/CubeMX/Core/Inc/stm32h7xx_hal_conf.h	(revision 38)
+++ ctrl/firmware/Main/CubeMX/Core/Inc/stm32h7xx_hal_conf.h	(revision 39)
@@ -68,5 +68,5 @@
 /* #define HAL_RAMECC_MODULE_ENABLED   */
 /* #define HAL_RNG_MODULE_ENABLED   */
-/* #define HAL_RTC_MODULE_ENABLED   */
+#define HAL_RTC_MODULE_ENABLED
 /* #define HAL_SAI_MODULE_ENABLED   */
 /* #define HAL_SD_MODULE_ENABLED   */
Index: ctrl/firmware/Main/CubeMX/Core/Src/main.c
===================================================================
--- ctrl/firmware/Main/CubeMX/Core/Src/main.c	(revision 38)
+++ ctrl/firmware/Main/CubeMX/Core/Src/main.c	(revision 39)
@@ -42,4 +42,6 @@
 /* Private variables ---------------------------------------------------------*/
 
+RTC_HandleTypeDef hrtc;
+
 /* USER CODE BEGIN PV */
 
@@ -49,4 +51,6 @@
 void SystemClock_Config(void);
 static void MPU_Config(void);
+static void MX_GPIO_Init(void);
+static void MX_RTC_Init(void);
 /* USER CODE BEGIN PFP */
 
@@ -97,4 +101,6 @@
 
   /* Initialize all configured peripherals */
+  MX_GPIO_Init();
+  MX_RTC_Init();
   /* USER CODE BEGIN 2 */
 
@@ -118,6 +124,6 @@
 void SystemClock_Config(void)
 {
-  RCC_OscInitTypeDef RCC_OscInitStruct {};
-  RCC_ClkInitTypeDef RCC_ClkInitStruct {};
+  RCC_OscInitTypeDef RCC_OscInitStruct = {0};
+  RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
 
   /** Supply configuration update enable
@@ -127,15 +133,29 @@
   /** Configure the main internal regulator output voltage
   */
-  __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE3);
+  __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE2);
 
   while(!__HAL_PWR_GET_FLAG(PWR_FLAG_VOSRDY)) {}
+
+  /** Configure LSE Drive Capability
+  */
+  HAL_PWR_EnableBkUpAccess();
+  __HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_LOW);
 
   /** Initializes the RCC Oscillators according to the specified parameters
   * in the RCC_OscInitTypeDef structure.
   */
-  RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
-  RCC_OscInitStruct.HSIState = RCC_HSI_DIV1;
-  RCC_OscInitStruct.HSICalibrationValue = 64;
-  RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
+  RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE|RCC_OSCILLATORTYPE_LSE;
+  RCC_OscInitStruct.HSEState = RCC_HSE_ON;
+  RCC_OscInitStruct.LSEState = RCC_LSE_ON;
+  RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
+  RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
+  RCC_OscInitStruct.PLL.PLLM = 25;
+  RCC_OscInitStruct.PLL.PLLN = 200;
+  RCC_OscInitStruct.PLL.PLLP = 2;
+  RCC_OscInitStruct.PLL.PLLQ = 2;
+  RCC_OscInitStruct.PLL.PLLR = 2;
+  RCC_OscInitStruct.PLL.PLLRGE = RCC_PLL1VCIRANGE_0;
+  RCC_OscInitStruct.PLL.PLLVCOSEL = RCC_PLL1VCOMEDIUM;
+  RCC_OscInitStruct.PLL.PLLFRACN = 0;
   if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
   {
@@ -148,5 +168,5 @@
                               |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2
                               |RCC_CLOCKTYPE_D3PCLK1|RCC_CLOCKTYPE_D1PCLK1;
-  RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_HSI;
+  RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
   RCC_ClkInitStruct.SYSCLKDivider = RCC_SYSCLK_DIV1;
   RCC_ClkInitStruct.AHBCLKDivider = RCC_HCLK_DIV1;
@@ -162,4 +182,58 @@
 }
 
+/**
+  * @brief RTC Initialization Function
+  * @param None
+  * @retval None
+  */
+static void MX_RTC_Init(void)
+{
+
+  /* USER CODE BEGIN RTC_Init 0 */
+
+  /* USER CODE END RTC_Init 0 */
+
+  /* USER CODE BEGIN RTC_Init 1 */
+
+  /* USER CODE END RTC_Init 1 */
+
+  /** Initialize RTC Only
+  */
+  hrtc.Instance = RTC;
+  hrtc.Init.HourFormat = RTC_HOURFORMAT_24;
+  hrtc.Init.AsynchPrediv = 127;
+  hrtc.Init.SynchPrediv = 255;
+  hrtc.Init.OutPut = RTC_OUTPUT_DISABLE;
+  hrtc.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH;
+  hrtc.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN;
+  hrtc.Init.OutPutRemap = RTC_OUTPUT_REMAP_NONE;
+  if (HAL_RTC_Init(&hrtc) != HAL_OK)
+  {
+    Error_Handler();
+  }
+  /* USER CODE BEGIN RTC_Init 2 */
+
+  /* USER CODE END RTC_Init 2 */
+
+}
+
+/**
+  * @brief GPIO Initialization Function
+  * @param None
+  * @retval None
+  */
+static void MX_GPIO_Init(void)
+{
+/* USER CODE BEGIN MX_GPIO_Init_1 */
+/* USER CODE END MX_GPIO_Init_1 */
+
+  /* GPIO Ports Clock Enable */
+  __HAL_RCC_GPIOC_CLK_ENABLE();
+  __HAL_RCC_GPIOH_CLK_ENABLE();
+
+/* USER CODE BEGIN MX_GPIO_Init_2 */
+/* USER CODE END MX_GPIO_Init_2 */
+}
+
 /* USER CODE BEGIN 4 */
 
@@ -170,5 +244,5 @@
 void MPU_Config(void)
 {
-  MPU_Region_InitTypeDef MPU_InitStruct {};
+  MPU_Region_InitTypeDef MPU_InitStruct = {0};
 
   /* Disables the MPU */
Index: ctrl/firmware/Main/CubeMX/Core/Src/stm32h7xx_hal_msp.c
===================================================================
--- ctrl/firmware/Main/CubeMX/Core/Src/stm32h7xx_hal_msp.c	(revision 38)
+++ ctrl/firmware/Main/CubeMX/Core/Src/stm32h7xx_hal_msp.c	(revision 39)
@@ -77,4 +77,60 @@
 }
 
+/**
+* @brief RTC MSP Initialization
+* This function configures the hardware resources used in this example
+* @param hrtc: RTC handle pointer
+* @retval None
+*/
+void HAL_RTC_MspInit(RTC_HandleTypeDef* hrtc)
+{
+  RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
+  if(hrtc->Instance==RTC)
+  {
+  /* USER CODE BEGIN RTC_MspInit 0 */
+
+  /* USER CODE END RTC_MspInit 0 */
+
+  /** Initializes the peripherals clock
+  */
+    PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_RTC;
+    PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
+    if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
+    {
+      Error_Handler();
+    }
+
+    /* Peripheral clock enable */
+    __HAL_RCC_RTC_ENABLE();
+  /* USER CODE BEGIN RTC_MspInit 1 */
+
+  /* USER CODE END RTC_MspInit 1 */
+
+  }
+
+}
+
+/**
+* @brief RTC MSP De-Initialization
+* This function freeze the hardware resources used in this example
+* @param hrtc: RTC handle pointer
+* @retval None
+*/
+void HAL_RTC_MspDeInit(RTC_HandleTypeDef* hrtc)
+{
+  if(hrtc->Instance==RTC)
+  {
+  /* USER CODE BEGIN RTC_MspDeInit 0 */
+
+  /* USER CODE END RTC_MspDeInit 0 */
+    /* Peripheral clock disable */
+    __HAL_RCC_RTC_DISABLE();
+  /* USER CODE BEGIN RTC_MspDeInit 1 */
+
+  /* USER CODE END RTC_MspDeInit 1 */
+  }
+
+}
+
 /* USER CODE BEGIN 1 */
 
Index: ctrl/firmware/Main/CubeMX/charger.ioc
===================================================================
--- ctrl/firmware/Main/CubeMX/charger.ioc	(revision 38)
+++ ctrl/firmware/Main/CubeMX/charger.ioc	(revision 39)
@@ -18,11 +18,17 @@
 Mcu.IP2=NVIC
 Mcu.IP3=RCC
-Mcu.IP4=SYS
-Mcu.IPNb=5
+Mcu.IP4=RTC
+Mcu.IP5=SYS
+Mcu.IPNb=6
 Mcu.Name=STM32H723ZETx
 Mcu.Package=LQFP144
-Mcu.Pin0=VP_SYS_VS_Systick
-Mcu.Pin1=VP_MEMORYMAP_VS_MEMORYMAP
-Mcu.PinsNb=2
+Mcu.Pin0=PC14-OSC32_IN
+Mcu.Pin1=PC15-OSC32_OUT
+Mcu.Pin2=PH0-OSC_IN
+Mcu.Pin3=PH1-OSC_OUT
+Mcu.Pin4=VP_RTC_VS_RTC_Activate
+Mcu.Pin5=VP_SYS_VS_Systick
+Mcu.Pin6=VP_MEMORYMAP_VS_MEMORYMAP
+Mcu.PinsNb=7
 Mcu.ThirdPartyNb=0
 Mcu.UserConstants=
@@ -41,4 +47,12 @@
 NVIC.SysTick_IRQn=true\:15\:0\:false\:false\:true\:false\:true\:false
 NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
+PC14-OSC32_IN.Mode=LSE-External-Oscillator
+PC14-OSC32_IN.Signal=RCC_OSC32_IN
+PC15-OSC32_OUT.Mode=LSE-External-Oscillator
+PC15-OSC32_OUT.Signal=RCC_OSC32_OUT
+PH0-OSC_IN.Mode=HSE-External-Oscillator
+PH0-OSC_IN.Signal=RCC_OSC_IN
+PH1-OSC_OUT.Mode=HSE-External-Oscillator
+PH1-OSC_OUT.Signal=RCC_OSC_OUT
 PinOutPanel.RotationAngle=0
 ProjectManager.AskForMigrate=true
@@ -72,71 +86,82 @@
 ProjectManager.UAScriptBeforePath=
 ProjectManager.UnderRoot=false
-ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false,0-MX_CORTEX_M7_Init-CORTEX_M7-false-HAL-true
-RCC.ADCFreq_Value=129000000
-RCC.AHB12Freq_Value=64000000
-RCC.AHB4Freq_Value=64000000
-RCC.APB1Freq_Value=64000000
-RCC.APB2Freq_Value=64000000
-RCC.APB3Freq_Value=64000000
-RCC.APB4Freq_Value=64000000
-RCC.AXIClockFreq_Value=64000000
+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
+RCC.ADCFreq_Value=100000000
+RCC.AHB12Freq_Value=100000000
+RCC.AHB4Freq_Value=100000000
+RCC.APB1Freq_Value=100000000
+RCC.APB2Freq_Value=100000000
+RCC.APB3Freq_Value=100000000
+RCC.APB4Freq_Value=100000000
+RCC.AXIClockFreq_Value=100000000
 RCC.CECFreq_Value=32000
 RCC.CKPERFreq_Value=64000000
-RCC.CortexFreq_Value=64000000
-RCC.CpuClockFreq_Value=64000000
-RCC.D1CPREFreq_Value=64000000
-RCC.DFSDMACLkFreq_Value=129000000
-RCC.DFSDMFreq_Value=64000000
-RCC.DIVP1Freq_Value=129000000
-RCC.DIVP2Freq_Value=129000000
-RCC.DIVP3Freq_Value=129000000
-RCC.DIVQ1Freq_Value=129000000
-RCC.DIVQ2Freq_Value=129000000
-RCC.DIVQ3Freq_Value=129000000
-RCC.DIVR1Freq_Value=129000000
-RCC.DIVR2Freq_Value=129000000
-RCC.DIVR3Freq_Value=129000000
-RCC.FDCANFreq_Value=129000000
-RCC.FMCFreq_Value=64000000
+RCC.CortexFreq_Value=100000000
+RCC.CpuClockFreq_Value=100000000
+RCC.D1CPREFreq_Value=100000000
+RCC.DFSDMACLkFreq_Value=100000000
+RCC.DFSDMFreq_Value=100000000
+RCC.DIVM1=25
+RCC.DIVM2=25
+RCC.DIVM3=25
+RCC.DIVN1=200
+RCC.DIVN2=200
+RCC.DIVN3=200
+RCC.DIVP1Freq_Value=100000000
+RCC.DIVP2Freq_Value=100000000
+RCC.DIVP3Freq_Value=100000000
+RCC.DIVQ1Freq_Value=100000000
+RCC.DIVQ2Freq_Value=100000000
+RCC.DIVQ3Freq_Value=100000000
+RCC.DIVR1Freq_Value=100000000
+RCC.DIVR2Freq_Value=100000000
+RCC.DIVR3Freq_Value=100000000
+RCC.FDCANFreq_Value=100000000
+RCC.FMCFreq_Value=100000000
 RCC.FamilyName=M
-RCC.HCLK3ClockFreq_Value=64000000
-RCC.HCLKFreq_Value=64000000
-RCC.I2C123Freq_Value=64000000
-RCC.I2C4Freq_Value=64000000
-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,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,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_Value
-RCC.LPTIM1Freq_Value=64000000
-RCC.LPTIM2Freq_Value=64000000
-RCC.LPTIM345Freq_Value=64000000
-RCC.LPUART1Freq_Value=64000000
-RCC.LTDCFreq_Value=129000000
+RCC.HCLK3ClockFreq_Value=100000000
+RCC.HCLKFreq_Value=100000000
+RCC.I2C123Freq_Value=100000000
+RCC.I2C4Freq_Value=100000000
+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
+RCC.LPTIM1Freq_Value=100000000
+RCC.LPTIM2Freq_Value=100000000
+RCC.LPTIM345Freq_Value=100000000
+RCC.LPUART1Freq_Value=100000000
+RCC.LTDCFreq_Value=100000000
 RCC.MCO1PinFreq_Value=64000000
-RCC.MCO2PinFreq_Value=64000000
-RCC.QSPIFreq_Value=64000000
+RCC.MCO2PinFreq_Value=100000000
+RCC.PLLSourceVirtual=RCC_PLLSOURCE_HSE
+RCC.QSPIFreq_Value=100000000
 RCC.RNGFreq_Value=48000000
-RCC.RTCFreq_Value=32000
-RCC.SAI1Freq_Value=129000000
-RCC.SAI4AFreq_Value=129000000
-RCC.SAI4BFreq_Value=129000000
-RCC.SDMMCFreq_Value=129000000
-RCC.SPDIFRXFreq_Value=129000000
-RCC.SPI123Freq_Value=129000000
-RCC.SPI45Freq_Value=64000000
-RCC.SPI6Freq_Value=64000000
-RCC.SWPMI1Freq_Value=64000000
-RCC.SYSCLKFreq_VALUE=64000000
-RCC.Tim1OutputFreq_Value=64000000
-RCC.Tim2OutputFreq_Value=64000000
+RCC.RTCClockSelection=RCC_RTCCLKSOURCE_LSE
+RCC.RTCFreq_Value=32768
+RCC.SAI1Freq_Value=100000000
+RCC.SAI4AFreq_Value=100000000
+RCC.SAI4BFreq_Value=100000000
+RCC.SDMMCFreq_Value=100000000
+RCC.SPDIFRXFreq_Value=100000000
+RCC.SPI123Freq_Value=100000000
+RCC.SPI45Freq_Value=100000000
+RCC.SPI6Freq_Value=100000000
+RCC.SWPMI1Freq_Value=100000000
+RCC.SYSCLKFreq_VALUE=100000000
+RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK
+RCC.Tim1OutputFreq_Value=100000000
+RCC.Tim2OutputFreq_Value=100000000
 RCC.TraceFreq_Value=64000000
-RCC.USART16Freq_Value=64000000
-RCC.USART234578Freq_Value=64000000
-RCC.USBFreq_Value=129000000
-RCC.VCO1OutputFreq_Value=258000000
-RCC.VCO2OutputFreq_Value=258000000
-RCC.VCO3OutputFreq_Value=258000000
-RCC.VCOInput1Freq_Value=2000000
-RCC.VCOInput2Freq_Value=2000000
-RCC.VCOInput3Freq_Value=2000000
+RCC.USART16Freq_Value=100000000
+RCC.USART234578Freq_Value=100000000
+RCC.USBFreq_Value=100000000
+RCC.VCO1OutputFreq_Value=200000000
+RCC.VCO2OutputFreq_Value=200000000
+RCC.VCO3OutputFreq_Value=200000000
+RCC.VCOInput1Freq_Value=1000000
+RCC.VCOInput2Freq_Value=1000000
+RCC.VCOInput3Freq_Value=1000000
 VP_MEMORYMAP_VS_MEMORYMAP.Mode=CurAppReg
 VP_MEMORYMAP_VS_MEMORYMAP.Signal=MEMORYMAP_VS_MEMORYMAP
+VP_RTC_VS_RTC_Activate.Mode=RTC_Enabled
+VP_RTC_VS_RTC_Activate.Signal=RTC_VS_RTC_Activate
 VP_SYS_VS_Systick.Mode=SysTick
 VP_SYS_VS_Systick.Signal=SYS_VS_Systick
