Index: ctrl/firmware/Main/CubeMX/charger.ioc
===================================================================
--- ctrl/firmware/Main/CubeMX/charger.ioc	(revision 106)
+++ ctrl/firmware/Main/CubeMX/charger.ioc	(revision 107)
@@ -70,6 +70,7 @@
 CORTEX_M7.TypeExtField_S-Cortex_Memory_Protection_Unit_Region2_Settings_S=MPU_TEX_LEVEL1
 CORTEX_M7.default_mode_Activation=1
+DAC1.DAC_Channel-DAC_OUT1=DAC_CHANNEL_1
 DAC1.DAC_Channel-DAC_OUT2=DAC_CHANNEL_2
-DAC1.IPParameters=DAC_Channel-DAC_OUT2
+DAC1.IPParameters=DAC_Channel-DAC_OUT2,DAC_Channel-DAC_OUT1
 DTS.IPParameters=RefClock,SamplingTime
 DTS.RefClock=DTS_REFCLKSEL_LSE
@@ -306,80 +307,81 @@
 Mcu.Pin0=PE2
 Mcu.Pin1=PE3
-Mcu.Pin10=PA5
-Mcu.Pin11=PF15
-Mcu.Pin12=PG0
-Mcu.Pin13=PG1
-Mcu.Pin14=PE7
-Mcu.Pin15=PE8
-Mcu.Pin16=PE9
-Mcu.Pin17=PE11
-Mcu.Pin18=PE12
-Mcu.Pin19=PE13
+Mcu.Pin10=PA4
+Mcu.Pin11=PA5
+Mcu.Pin12=PF15
+Mcu.Pin13=PG0
+Mcu.Pin14=PG1
+Mcu.Pin15=PE7
+Mcu.Pin16=PE8
+Mcu.Pin17=PE9
+Mcu.Pin18=PE11
+Mcu.Pin19=PE12
 Mcu.Pin2=PE6
-Mcu.Pin20=PE14
-Mcu.Pin21=PE15
-Mcu.Pin22=PB10
-Mcu.Pin23=PB14
-Mcu.Pin24=PB15
-Mcu.Pin25=PD8
-Mcu.Pin26=PD9
-Mcu.Pin27=PD10
-Mcu.Pin28=PD11
-Mcu.Pin29=PD12
+Mcu.Pin20=PE13
+Mcu.Pin21=PE14
+Mcu.Pin22=PE15
+Mcu.Pin23=PB10
+Mcu.Pin24=PB14
+Mcu.Pin25=PB15
+Mcu.Pin26=PD8
+Mcu.Pin27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)
+Mcu.Pin57=PB6
+Mcu.Pin58=PB7
+Mcu.Pin59=PB8
 Mcu.Pin6=PF1
-Mcu.Pin60=VP_ADC3_TempSens_Input
-Mcu.Pin61=VP_ADC3_Vref_Input
-Mcu.Pin62=VP_ADC3_Vbat_Input
-Mcu.Pin63=VP_DTS_VS-DTS
-Mcu.Pin64=VP_FATFS_VS_SDIO
-Mcu.Pin65=VP_FREERTOS_VS_CMSIS_V2
-Mcu.Pin66=VP_RTC_VS_RTC_Activate
-Mcu.Pin67=VP_RTC_VS_RTC_Calendar
-Mcu.Pin68=VP_SYS_VS_tim7
-Mcu.Pin69=VP_TIM1_VS_ClockSourceINT
+Mcu.Pin60=PB9
+Mcu.Pin61=VP_ADC3_TempSens_Input
+Mcu.Pin62=VP_ADC3_Vref_Input
+Mcu.Pin63=VP_ADC3_Vbat_Input
+Mcu.Pin64=VP_DTS_VS-DTS
+Mcu.Pin65=VP_FATFS_VS_SDIO
+Mcu.Pin66=VP_FREERTOS_VS_CMSIS_V2
+Mcu.Pin67=VP_RTC_VS_RTC_Activate
+Mcu.Pin68=VP_RTC_VS_RTC_Calendar
+Mcu.Pin69=VP_SYS_VS_tim7
 Mcu.Pin7=PH0-OSC_IN
-Mcu.Pin70=VP_TIM3_VS_ClockSourceINT
-Mcu.Pin71=VP_TIM6_VS_ClockSourceINT
-Mcu.Pin72=VP_TIM8_VS_ControllerModeReset
-Mcu.Pin73=VP_TIM8_VS_ClockSourceINT
-Mcu.Pin74=VP_VREFBUF_V_VREFBUF
-Mcu.Pin75=VP_MEMORYMAP_VS_MEMORYMAP
-Mcu.Pin76=VP_STMicroelectronics.X-CUBE-EEPRMA1_VS_BoardOoPartJjEEPROM_5.1.0_5.1.0
+Mcu.Pin70=VP_TIM1_VS_ClockSourceINT
+Mcu.Pin71=VP_TIM3_VS_ClockSourceINT
+Mcu.Pin72=VP_TIM6_VS_ClockSourceINT
+Mcu.Pin73=VP_TIM8_VS_ControllerModeReset
+Mcu.Pin74=VP_TIM8_VS_ClockSourceINT
+Mcu.Pin75=VP_VREFBUF_V_VREFBUF
+Mcu.Pin76=VP_MEMORYMAP_VS_MEMORYMAP
+Mcu.Pin77=VP_STMicroelectronics.X-CUBE-EEPRMA1_VS_BoardOoPartJjEEPROM_5.1.0_5.1.0
 Mcu.Pin8=PH1-OSC_OUT
 Mcu.Pin9=PC0
-Mcu.PinsNb=77
+Mcu.PinsNb=78
 Mcu.ThirdParty0=STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0
 Mcu.ThirdParty1=STMicroelectronics.X-CUBE-EEPRMA1.5.1.0
@@ -430,4 +432,7 @@
 PA15(JTDI).Locked=true
 PA15(JTDI).Signal=GPIO_Output
+PA4.GPIOParameters=GPIO_Label
+PA4.GPIO_Label=DAC_LOAD_I_LIMIT
+PA4.Signal=COMP_DAC11_group
 PA5.GPIOParameters=GPIO_Label
 PA5.GPIO_Label=DAC_U_LIMIT
@@ -689,86 +694,91 @@
 RCC.ADCCLockSelection=RCC_ADCCLKSOURCE_PLL3
 RCC.ADCFreq_Value=60000000
-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.AHB12Freq_Value=275000000
+RCC.AHB4Freq_Value=275000000
+RCC.APB1Freq_Value=137500000
+RCC.APB2Freq_Value=137500000
+RCC.APB3Freq_Value=137500000
+RCC.APB4Freq_Value=137500000
+RCC.AXIClockFreq_Value=275000000
 RCC.CECFreq_Value=32000
 RCC.CKPERFreq_Value=64000000
-RCC.CortexFreq_Value=100000000
-RCC.CpuClockFreq_Value=100000000
-RCC.D1CPREFreq_Value=100000000
-RCC.DFSDMACLkFreq_Value=100000000
-RCC.DFSDMFreq_Value=100000000
-RCC.DIVM1=5
+RCC.CortexFreq_Value=275000000
+RCC.CpuClockFreq_Value=275000000
+RCC.D1CPREFreq_Value=275000000
+RCC.D1PPRE=RCC_APB3_DIV2
+RCC.D2PPRE1=RCC_APB1_DIV2
+RCC.D2PPRE2=RCC_APB2_DIV2
+RCC.D3PPRE=RCC_APB4_DIV2
+RCC.DFSDMACLkFreq_Value=275000000
+RCC.DFSDMFreq_Value=137500000
+RCC.DIVM1=2
 RCC.DIVM2=2
 RCC.DIVM3=25
-RCC.DIVN1=40
+RCC.DIVN1=44
 RCC.DIVN2=20
 RCC.DIVN3=180
-RCC.DIVP1Freq_Value=100000000
+RCC.DIVP1Freq_Value=275000000
 RCC.DIVP2Freq_Value=125000000
 RCC.DIVP3Freq_Value=90000000
-RCC.DIVQ1Freq_Value=100000000
+RCC.DIVQ1Freq_Value=275000000
 RCC.DIVQ2=11
 RCC.DIVQ2Freq_Value=22727272.727272727
 RCC.DIVQ3=8
 RCC.DIVQ3Freq_Value=22500000
-RCC.DIVR1Freq_Value=100000000
-RCC.DIVR2=10
-RCC.DIVR2Freq_Value=25000000
+RCC.DIVR1Freq_Value=275000000
+RCC.DIVR2=5
+RCC.DIVR2Freq_Value=50000000
 RCC.DIVR3=3
 RCC.DIVR3Freq_Value=60000000
-RCC.FDCANFreq_Value=100000000
-RCC.FMCFreq_Value=100000000
+RCC.FDCANFreq_Value=275000000
+RCC.FMCFreq_Value=275000000
 RCC.FamilyName=M
-RCC.HCLK3ClockFreq_Value=100000000
-RCC.HCLKFreq_Value=100000000
+RCC.HCLK3ClockFreq_Value=275000000
+RCC.HCLKFreq_Value=275000000
 RCC.I2C123CLockSelection=RCC_I2C1235CLKSOURCE_HSI
 RCC.I2C123Freq_Value=64000000
-RCC.I2C4Freq_Value=100000000
-RCC.IPParameters=ADCCLockSelection,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,DIVQ2,DIVQ2Freq_Value,DIVQ3,DIVQ3Freq_Value,DIVR1Freq_Value,DIVR2,DIVR2Freq_Value,DIVR3,DIVR3Freq_Value,FDCANFreq_Value,FMCFreq_Value,FamilyName,HCLK3ClockFreq_Value,HCLKFreq_Value,I2C123CLockSelection,I2C123Freq_Value,I2C4Freq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPTIM345Freq_Value,LPUART1Freq_Value,LTDCFreq_Value,MCO1PinFreq_Value,MCO2PinFreq_Value,PLL2FRACN,PLL2_VCI_Range-AdvancedSettings,PLLFRACN,PLLSourceVirtual,QSPIFreq_Value,RNGFreq_Value,RTCClockSelection,RTCFreq_Value,SAI1Freq_Value,SAI4AFreq_Value,SAI4BFreq_Value,SDMMCFreq_Value,SPDIFRXFreq_Value,SPI123CLockSelection,SPI123Freq_Value,SPI45Freq_Value,SPI6Freq_Value,SWPMI1Freq_Value,SYSCLKFreq_VALUE,SYSCLKSource,Spi45ClockSelection,Tim1OutputFreq_Value,Tim2OutputFreq_Value,TraceFreq_Value,USART16CLockSelection,USART16Freq_Value,USART234578CLockSelection,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.I2C4Freq_Value=137500000
+RCC.IPParameters=ADCCLockSelection,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,D1PPRE,D2PPRE1,D2PPRE2,D3PPRE,DFSDMACLkFreq_Value,DFSDMFreq_Value,DIVM1,DIVM2,DIVM3,DIVN1,DIVN2,DIVN3,DIVP1Freq_Value,DIVP2Freq_Value,DIVP3Freq_Value,DIVQ1Freq_Value,DIVQ2,DIVQ2Freq_Value,DIVQ3,DIVQ3Freq_Value,DIVR1Freq_Value,DIVR2,DIVR2Freq_Value,DIVR3,DIVR3Freq_Value,FDCANFreq_Value,FMCFreq_Value,FamilyName,HCLK3ClockFreq_Value,HCLKFreq_Value,I2C123CLockSelection,I2C123Freq_Value,I2C4Freq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPTIM345Freq_Value,LPUART1Freq_Value,LTDCFreq_Value,MCO1PinFreq_Value,MCO2PinFreq_Value,PLL2FRACN,PLL2_VCI_Range-AdvancedSettings,PLLFRACN,PLLSourceVirtual,QSPIFreq_Value,RNGFreq_Value,RTCClockSelection,RTCFreq_Value,SAI1Freq_Value,SAI4AFreq_Value,SAI4BFreq_Value,SDMMC1CLockSelection,SDMMCFreq_Value,SPDIFRXFreq_Value,SPI123CLockSelection,SPI123Freq_Value,SPI45Freq_Value,SPI6Freq_Value,SWPMI1Freq_Value,SYSCLKFreq_VALUE,SYSCLKSource,Spi45ClockSelection,Tim1OutputFreq_Value,Tim2OutputFreq_Value,TraceFreq_Value,USART16CLockSelection,USART16Freq_Value,USART234578CLockSelection,USART234578Freq_Value,USBFreq_Value,VCO1OutputFreq_Value,VCO2OutputFreq_Value,VCO3OutputFreq_Value,VCOInput1Freq_Value,VCOInput2Freq_Value,VCOInput3Freq_Value
+RCC.LPTIM1Freq_Value=137500000
+RCC.LPTIM2Freq_Value=137500000
+RCC.LPTIM345Freq_Value=137500000
+RCC.LPUART1Freq_Value=137500000
 RCC.LTDCFreq_Value=60000000
 RCC.MCO1PinFreq_Value=64000000
-RCC.MCO2PinFreq_Value=100000000
+RCC.MCO2PinFreq_Value=275000000
 RCC.PLL2FRACN=0
 RCC.PLL2_VCI_Range-AdvancedSettings=RCC_PLL2VCIRANGE_3
 RCC.PLLFRACN=0
 RCC.PLLSourceVirtual=RCC_PLLSOURCE_HSE
-RCC.QSPIFreq_Value=100000000
+RCC.QSPIFreq_Value=275000000
 RCC.RNGFreq_Value=48000000
 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.SAI1Freq_Value=275000000
+RCC.SAI4AFreq_Value=275000000
+RCC.SAI4BFreq_Value=275000000
+RCC.SDMMC1CLockSelection=RCC_SDMMCCLKSOURCE_PLL2
+RCC.SDMMCFreq_Value=50000000
+RCC.SPDIFRXFreq_Value=275000000
 RCC.SPI123CLockSelection=RCC_SPI123CLKSOURCE_PLL2
 RCC.SPI123Freq_Value=125000000
 RCC.SPI45Freq_Value=25000000
-RCC.SPI6Freq_Value=100000000
-RCC.SWPMI1Freq_Value=100000000
-RCC.SYSCLKFreq_VALUE=100000000
+RCC.SPI6Freq_Value=137500000
+RCC.SWPMI1Freq_Value=137500000
+RCC.SYSCLKFreq_VALUE=275000000
 RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK
 RCC.Spi45ClockSelection=RCC_SPI45CLKSOURCE_HSE
-RCC.Tim1OutputFreq_Value=100000000
-RCC.Tim2OutputFreq_Value=100000000
-RCC.TraceFreq_Value=100000000
+RCC.Tim1OutputFreq_Value=275000000
+RCC.Tim2OutputFreq_Value=275000000
+RCC.TraceFreq_Value=275000000
 RCC.USART16CLockSelection=RCC_USART16910CLKSOURCE_PLL3
 RCC.USART16Freq_Value=22500000
 RCC.USART234578CLockSelection=RCC_USART234578CLKSOURCE_PLL3
 RCC.USART234578Freq_Value=22500000
-RCC.USBFreq_Value=100000000
-RCC.VCO1OutputFreq_Value=200000000
+RCC.USBFreq_Value=275000000
+RCC.VCO1OutputFreq_Value=550000000
 RCC.VCO2OutputFreq_Value=250000000
 RCC.VCO3OutputFreq_Value=180000000
-RCC.VCOInput1Freq_Value=5000000
+RCC.VCOInput1Freq_Value=12500000
 RCC.VCOInput2Freq_Value=12500000
 RCC.VCOInput3Freq_Value=1000000
@@ -783,4 +793,6 @@
 SH.ADCx_INP10.0=ADC3_INP10,IN10-Single-Ended
 SH.ADCx_INP10.ConfNb=1
+SH.COMP_DAC11_group.0=DAC1_OUT1,DAC_OUT1
+SH.COMP_DAC11_group.ConfNb=1
 SH.COMP_DAC12_group.0=DAC1_OUT2,DAC_OUT2
 SH.COMP_DAC12_group.ConfNb=1
@@ -811,7 +823,7 @@
 SPI4.Direction=SPI_DIRECTION_1LINE
 SPI4.IPParameters=VirtualType,Mode,Direction,CalculateBaudRate,VirtualNSS,DataSize,BaudRatePrescaler,MasterSSIdleness,MasterInterDataIdleness,MasterKeepIOState
-SPI4.MasterInterDataIdleness=SPI_MASTER_INTERDATA_IDLENESS_00CYCLE
+SPI4.MasterInterDataIdleness=SPI_MASTER_INTERDATA_IDLENESS_02CYCLE
 SPI4.MasterKeepIOState=SPI_MASTER_KEEP_IO_STATE_ENABLE
-SPI4.MasterSSIdleness=SPI_MASTER_SS_IDLENESS_02CYCLE
+SPI4.MasterSSIdleness=SPI_MASTER_SS_IDLENESS_00CYCLE
 SPI4.Mode=SPI_MODE_MASTER
 SPI4.VirtualNSS=VM_NSSHARD
@@ -849,5 +861,5 @@
 TIM1.Channel-PWM\ Generation1\ CH1\ CH1N=TIM_CHANNEL_1
 TIM1.Channel-PWM\ Generation3\ CH3=TIM_CHANNEL_3
-TIM1.DeadTime=100
+TIM1.DeadTime=20
 TIM1.IPParameters=Channel-PWM Generation1 CH1 CH1N,Prescaler,Period,AutoReloadPreload,OCNPolarity_1,OCIdleState_1,Pulse-PWM Generation1 CH1 CH1N,BreakState,AutomaticOutput,OffStateRunMode,OffStateIDLEMode,LockLevel,DeadTime,Channel-PWM Generation3 CH3
 TIM1.LockLevel=TIM_LOCKLEVEL_1
@@ -858,5 +870,5 @@
 TIM1.Period=1600
 TIM1.Prescaler=0
-TIM1.Pulse-PWM\ Generation1\ CH1\ CH1N=100
+TIM1.Pulse-PWM\ Generation1\ CH1\ CH1N=50
 TIM3.AutoReloadPreload=TIM_AUTORELOAD_PRELOAD_ENABLE
 TIM3.Channel-PWM\ Generation2\ CH2=TIM_CHANNEL_2
@@ -865,5 +877,5 @@
 TIM3.Period=1000
 TIM3.Prescaler=3
-TIM3.Pulse-PWM\ Generation2\ CH2=200
+TIM3.Pulse-PWM\ Generation2\ CH2=155
 TIM6.AutoReloadPreload=TIM_AUTORELOAD_PRELOAD_ENABLE
 TIM6.IPParameters=AutoReloadPreload,Prescaler
