Index: ctrl/firmware/Main/CubeMX/charger.ioc
===================================================================
--- ctrl/firmware/Main/CubeMX/charger.ioc	(revision 51)
+++ ctrl/firmware/Main/CubeMX/charger.ioc	(revision 54)
@@ -51,21 +51,25 @@
 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.Pin12=PA8
+Mcu.Pin13=PA13(JTMS/SWDIO)
+Mcu.Pin14=PA14(JTCK/SWCLK)
+Mcu.Pin15=PC10
+Mcu.Pin16=PC11
+Mcu.Pin17=PC12
+Mcu.Pin18=PD2
+Mcu.Pin19=PD7
 Mcu.Pin2=PC15-OSC32_OUT
-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.Pin20=PG9
+Mcu.Pin21=PG10
+Mcu.Pin22=PG11
+Mcu.Pin23=PG12
+Mcu.Pin24=PG13
+Mcu.Pin25=VP_RTC_VS_RTC_Activate
+Mcu.Pin26=VP_SYS_VS_tim7
+Mcu.Pin27=VP_MEMORYMAP_VS_MEMORYMAP
+Mcu.Pin28=VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_RTOSJjThreadX_6.4.0_3.3.0
+Mcu.Pin29=VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_FileOoSystemJjFileX_6.4.0_3.3.0
 Mcu.Pin3=PH0-OSC_IN
+Mcu.Pin30=VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_FileOoSystemJjInterfaces_3.3.0_3.3.0
 Mcu.Pin4=PH1-OSC_OUT
 Mcu.Pin5=PE11
@@ -74,28 +78,40 @@
 Mcu.Pin8=PE14
 Mcu.Pin9=PE15
-Mcu.PinsNb=27
-Mcu.ThirdPartyNb=0
+Mcu.PinsNb=31
+Mcu.ThirdParty0=STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0
+Mcu.ThirdPartyNb=1
 Mcu.UserConstants=
 Mcu.UserName=STM32H723ZETx
 MxCube.Version=6.13.0
 MxDb.Version=DB.6.0.130
-NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
-NVIC.DMA1_Stream0_IRQn=true\:0\:0\:false\:false\:true\:false\:true\:true
-NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
+NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
+NVIC.DMA1_Stream0_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:true\:true
+NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
 NVIC.ForceEnableDMAVector=true
-NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
-NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
-NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
-NVIC.PendSV_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
+NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
+NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
+NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
+NVIC.PendSV_IRQn=true\:0\:0\:false\:false\:false\:false\: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
-NVIC.SysTick_IRQn=true\:15\:0\:false\:false\:true\:false\:true\:false
-NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
+NVIC.SDMMC1_IRQn=true\:0\:0\:false\:false\:true\:false\:true\:true\:true
+NVIC.SPI4_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:true\:true
+NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:false\:false\:false\:false\:false
+NVIC.SavedPendsvIrqHandlerGenerated=true
+NVIC.SavedSvcallIrqHandlerGenerated=true
+NVIC.SavedSystickIrqHandlerGenerated=true
+NVIC.SysTick_IRQn=true\:0\:0\:false\:false\:false\:false\:false\:true\:false
+NVIC.TIM7_IRQn=true\:15\:0\:false\:false\:true\:false\:false\:true\:true
+NVIC.TimeBase=TIM7_IRQn
+NVIC.TimeBaseIP=TIM7
+NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
 PA13(JTMS/SWDIO).Mode=Serial_Wire
 PA13(JTMS/SWDIO).Signal=DEBUG_JTMS-SWDIO
 PA14(JTCK/SWCLK).Mode=Serial_Wire
 PA14(JTCK/SWCLK).Signal=DEBUG_JTCK-SWCLK
+PA8.GPIOParameters=GPIO_PuPd,GPIO_Label
+PA8.GPIO_Label=SD_DETECT
+PA8.GPIO_PuPd=GPIO_PULLDOWN
+PA8.Locked=true
+PA8.Signal=GPIO_Input
 PC10.Mode=SD_4_bits_Wide_bus
 PC10.Signal=SDMMC1_D2
@@ -187,8 +203,8 @@
 ProjectManager.KeepUserCode=true
 ProjectManager.LastFirmware=true
-ProjectManager.LibraryCopy=0
+ProjectManager.LibraryCopy=1
 ProjectManager.MainLocation=Core/Src
 ProjectManager.NoMain=false
-ProjectManager.PreviousToolchain=
+ProjectManager.PreviousToolchain=STM32CubeIDE
 ProjectManager.ProjectBuild=false
 ProjectManager.ProjectFileName=charger.ioc
@@ -197,10 +213,10 @@
 ProjectManager.RegisterCallBack=
 ProjectManager.StackSize=0x400
-ProjectManager.TargetToolchain=EWARM V8.50
+ProjectManager.TargetToolchain=STM32CubeIDE
 ProjectManager.ToolChainLocation=
 ProjectManager.UAScriptAfterPath=
 ProjectManager.UAScriptBeforePath=
-ProjectManager.UnderRoot=false
-ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false,2-MX_GPIO_Init-GPIO-false-HAL-true,3-MX_DMA_Init-DMA-false-HAL-true,4-MX_RTC_Init-RTC-false-HAL-true,5-MX_SPI4_Init-SPI4-false-HAL-true,0-MX_CORTEX_M7_Init-CORTEX_M7-false-HAL-true
+ProjectManager.UnderRoot=true
+ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false,2-MX_GPIO_Init-GPIO-false-HAL-true,3-MX_DMA_Init-DMA-false-HAL-true,4-MX_RTC_Init-RTC-false-HAL-true,5-MX_SPI4_Init-SPI4-false-HAL-true,6-MX_SDMMC1_SD_Init-SDMMC1-false-HAL-true,0-MX_CORTEX_M7_Init-CORTEX_M7-false-HAL-true
 RCC.ADCFreq_Value=166666666.66666666
 RCC.AHB12Freq_Value=100000000
@@ -293,9 +309,37 @@
 SPI4.VirtualNSS=VM_NSSHARD
 SPI4.VirtualType=VM_MASTER
+STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.FX_APP_MEM_POOL_SIZE=8192
+STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.FX_DRIVER_SD_INIT=0
+STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.FX_ENABLE_EXFAT=1
+STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.FX_ENABLE_FAULT_TOLERANT=1
+STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.FX_FAULT_TOLERANT=1
+STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.FX_FAULT_TOLERANT_DATA=1
+STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.FileOoSystemJjFileX_Checked=true
+STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.FileOoSystemJjInterfaces_Checked=true
+STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.FileXCcFileOoSystemJjFileXJjCore=true
+STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.IPParameters=TX_APP_MEM_POOL_SIZE,FX_APP_MEM_POOL_SIZE,TX_APP_GENERATE_INIT_CODE,TX_APP_CREATION,TX_ENABLE_STACK_CHECKING,TX_NO_FILEX_POINTER,TX_LOW_POWER,FX_ENABLE_EXFAT,FX_ENABLE_FAULT_TOLERANT,FX_FAULT_TOLERANT,FX_FAULT_TOLERANT_DATA,FX_DRIVER_SD_INIT,ThreadXCcRTOSJjThreadXJjCore,ThreadXCcRTOSJjThreadXJjLowOoPowerOosupport,FileXCcFileOoSystemJjFileXJjCore,InterfacesCcFileOoSystemJjFileXOoSDOointerface
+STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.InterfacesCcFileOoSystemJjFileXOoSDOointerface=true
+STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.RTOSJjThreadX_Checked=true
+STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.TX_APP_CREATION=1
+STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.TX_APP_GENERATE_INIT_CODE=false
+STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.TX_APP_MEM_POOL_SIZE=8192
+STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.TX_ENABLE_STACK_CHECKING=1
+STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.TX_LOW_POWER=1
+STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.TX_NO_FILEX_POINTER=1
+STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.ThreadXCcRTOSJjThreadXJjCore=true
+STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.ThreadXCcRTOSJjThreadXJjLowOoPowerOosupport=true
+STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0_IsAnAzureRtosMw=true
+STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0_SwParameter=InterfacesCcFileOoSystemJjFileXOoSDOointerface\:true;ThreadXCcRTOSJjThreadXJjLowOoPowerOosupport\:true;FileXCcFileOoSystemJjFileXJjCore\:true;ThreadXCcRTOSJjThreadXJjCore\:true;
 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
+VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_FileOoSystemJjFileX_6.4.0_3.3.0.Mode=FileOoSystemJjFileX
+VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_FileOoSystemJjFileX_6.4.0_3.3.0.Signal=STMicroelectronics.X-CUBE-AZRTOS-H7_VS_FileOoSystemJjFileX_6.4.0_3.3.0
+VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_FileOoSystemJjInterfaces_3.3.0_3.3.0.Mode=FileOoSystemJjInterfaces
+VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_FileOoSystemJjInterfaces_3.3.0_3.3.0.Signal=STMicroelectronics.X-CUBE-AZRTOS-H7_VS_FileOoSystemJjInterfaces_3.3.0_3.3.0
+VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_RTOSJjThreadX_6.4.0_3.3.0.Mode=RTOSJjThreadX
+VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_RTOSJjThreadX_6.4.0_3.3.0.Signal=STMicroelectronics.X-CUBE-AZRTOS-H7_VS_RTOSJjThreadX_6.4.0_3.3.0
+VP_SYS_VS_tim7.Mode=TIM7
+VP_SYS_VS_tim7.Signal=SYS_VS_tim7
 board=custom
