Index: ctrl/firmware/Main/CubeMX/charger.ioc
===================================================================
--- ctrl/firmware/Main/CubeMX/charger.ioc	(revision 50)
+++ ctrl/firmware/Main/CubeMX/charger.ioc	(revision 51)
@@ -41,23 +41,30 @@
 Mcu.IP5=RCC
 Mcu.IP6=RTC
-Mcu.IP7=SPI4
-Mcu.IP8=SYS
-Mcu.IPNb=9
+Mcu.IP7=SDMMC1
+Mcu.IP8=SPI4
+Mcu.IP9=SYS
+Mcu.IPNb=10
 Mcu.Name=STM32H723ZETx
 Mcu.Package=LQFP144
 Mcu.Pin0=PE6
 Mcu.Pin1=PC14-OSC32_IN
-Mcu.Pin10=PA13(JTMS/SWDIO)
-Mcu.Pin11=PA14(JTCK/SWCLK)
-Mcu.Pin12=PD7
-Mcu.Pin13=PG9
-Mcu.Pin14=PG10
-Mcu.Pin15=PG11
-Mcu.Pin16=PG12
-Mcu.Pin17=PG13
-Mcu.Pin18=VP_RTC_VS_RTC_Activate
-Mcu.Pin19=VP_SYS_VS_Systick
+Mcu.Pin10=PC8
+Mcu.Pin11=PC9
+Mcu.Pin12=PA13(JTMS/SWDIO)
+Mcu.Pin13=PA14(JTCK/SWCLK)
+Mcu.Pin14=PC10
+Mcu.Pin15=PC11
+Mcu.Pin16=PC12
+Mcu.Pin17=PD2
+Mcu.Pin18=PD7
+Mcu.Pin19=PG9
 Mcu.Pin2=PC15-OSC32_OUT
-Mcu.Pin20=VP_MEMORYMAP_VS_MEMORYMAP
+Mcu.Pin20=PG10
+Mcu.Pin21=PG11
+Mcu.Pin22=PG12
+Mcu.Pin23=PG13
+Mcu.Pin24=VP_RTC_VS_RTC_Activate
+Mcu.Pin25=VP_SYS_VS_Systick
+Mcu.Pin26=VP_MEMORYMAP_VS_MEMORYMAP
 Mcu.Pin3=PH0-OSC_IN
 Mcu.Pin4=PH1-OSC_OUT
@@ -67,5 +74,5 @@
 Mcu.Pin8=PE14
 Mcu.Pin9=PE15
-Mcu.PinsNb=21
+Mcu.PinsNb=27
 Mcu.ThirdPartyNb=0
 Mcu.UserConstants=
@@ -82,4 +89,5 @@
 NVIC.PendSV_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
 NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4
+NVIC.SDMMC1_IRQn=true\:0\:0\:false\:false\:true\:true\:true\:true
 NVIC.SPI4_IRQn=true\:0\:0\:false\:false\:true\:false\:true\:true
 NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
@@ -90,8 +98,21 @@
 PA14(JTCK/SWCLK).Mode=Serial_Wire
 PA14(JTCK/SWCLK).Signal=DEBUG_JTCK-SWCLK
+PC10.Mode=SD_4_bits_Wide_bus
+PC10.Signal=SDMMC1_D2
+PC11.Mode=SD_4_bits_Wide_bus
+PC11.Signal=SDMMC1_D3
+PC12.Mode=SD_4_bits_Wide_bus
+PC12.Signal=SDMMC1_CK
 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
+PC8.Locked=true
+PC8.Mode=SD_4_bits_Wide_bus
+PC8.Signal=SDMMC1_D0
+PC9.Mode=SD_4_bits_Wide_bus
+PC9.Signal=SDMMC1_D1
+PD2.Mode=SD_4_bits_Wide_bus
+PD2.Signal=SDMMC1_CMD
 PD7.GPIOParameters=GPIO_Label
 PD7.GPIO_Label=OUTPUT_ON_LED
@@ -195,23 +216,25 @@
 RCC.CpuClockFreq_Value=100000000
 RCC.D1CPREFreq_Value=100000000
-RCC.DFSDMACLkFreq_Value=100000000
+RCC.DFSDMACLkFreq_Value=50000000
 RCC.DFSDMFreq_Value=100000000
 RCC.DIVM1=5
 RCC.DIVM2=3
-RCC.DIVM3=25
+RCC.DIVM3=1
 RCC.DIVN1=40
 RCC.DIVN2=40
-RCC.DIVN3=200
+RCC.DIVN3=4
 RCC.DIVP1Freq_Value=100000000
 RCC.DIVP2Freq_Value=166666666.66666666
-RCC.DIVP3Freq_Value=100000000
-RCC.DIVQ1Freq_Value=100000000
+RCC.DIVP3Freq_Value=50000000
+RCC.DIVQ1=4
+RCC.DIVQ1Freq_Value=50000000
 RCC.DIVQ2=11
 RCC.DIVQ2Freq_Value=30303030.3030303
-RCC.DIVQ3Freq_Value=100000000
+RCC.DIVQ3Freq_Value=50000000
 RCC.DIVR1Freq_Value=100000000
-RCC.DIVR2Freq_Value=166666666.66666666
-RCC.DIVR3Freq_Value=100000000
-RCC.FDCANFreq_Value=100000000
+RCC.DIVR2=10
+RCC.DIVR2Freq_Value=33333333.333333332
+RCC.DIVR3Freq_Value=50000000
+RCC.FDCANFreq_Value=50000000
 RCC.FMCFreq_Value=100000000
 RCC.FamilyName=M
@@ -220,10 +243,10 @@
 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,DIVQ2,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,PLL2FRACN,PLLFRACN,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,Spi45ClockSelection,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.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,DIVQ1,DIVQ1Freq_Value,DIVQ2,DIVQ2Freq_Value,DIVQ3Freq_Value,DIVR1Freq_Value,DIVR2,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,PLL2FRACN,PLLFRACN,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,Spi45ClockSelection,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.LTDCFreq_Value=50000000
 RCC.MCO1PinFreq_Value=64000000
 RCC.MCO2PinFreq_Value=100000000
@@ -235,16 +258,16 @@
 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=30303030.3030303
+RCC.SAI1Freq_Value=50000000
+RCC.SAI4AFreq_Value=50000000
+RCC.SAI4BFreq_Value=50000000
+RCC.SDMMCFreq_Value=50000000
+RCC.SPDIFRXFreq_Value=50000000
+RCC.SPI123Freq_Value=50000000
+RCC.SPI45Freq_Value=25000000
 RCC.SPI6Freq_Value=100000000
 RCC.SWPMI1Freq_Value=100000000
 RCC.SYSCLKFreq_VALUE=100000000
 RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK
-RCC.Spi45ClockSelection=RCC_SPI45CLKSOURCE_PLL2
+RCC.Spi45ClockSelection=RCC_SPI45CLKSOURCE_HSE
 RCC.Tim1OutputFreq_Value=100000000
 RCC.Tim2OutputFreq_Value=100000000
@@ -252,13 +275,16 @@
 RCC.USART16Freq_Value=100000000
 RCC.USART234578Freq_Value=100000000
-RCC.USBFreq_Value=100000000
+RCC.USBFreq_Value=50000000
 RCC.VCO1OutputFreq_Value=200000000
 RCC.VCO2OutputFreq_Value=333333333.3333333
-RCC.VCO3OutputFreq_Value=200000000
+RCC.VCO3OutputFreq_Value=100000000
 RCC.VCOInput1Freq_Value=5000000
 RCC.VCOInput2Freq_Value=8333333.333333333
-RCC.VCOInput3Freq_Value=1000000
+RCC.VCOInput3Freq_Value=25000000
+SDMMC1.ClockPowerSave=SDMMC_CLOCK_POWER_SAVE_ENABLE
+SDMMC1.HardwareFlowControl=SDMMC_HARDWARE_FLOW_CONTROL_ENABLE
+SDMMC1.IPParameters=ClockPowerSave,HardwareFlowControl
 SPI4.BaudRatePrescaler=SPI_BAUDRATEPRESCALER_4
-SPI4.CalculateBaudRate=7.575757 MBits/s
+SPI4.CalculateBaudRate=6.25 MBits/s
 SPI4.DataSize=SPI_DATASIZE_9BIT
 SPI4.Direction=SPI_DIRECTION_1LINE
