Files
NeoECU-Firmware/STM32/STM32.ioc
T
h3cx 7502b354dc Implemented "full" ignition timing system
This is a first implementation of a "full" timing system, with proper
handling for cases wher the ignition charge time overlaps with the
compression pulse, the spark has a more complex state machine system
with the option to defer charge from the intake pulse to the compression
pulse, and further defferal of the spark release schedule to the ISR
that triggers when the output compare triggers for the charge

Preliminary error counters have been put in place, they still require
handling error conditions that would force a soft shutdown on the
ignition IC. Alongside this the code still needs to be verified so that
all non critical errors (ie missed charge schedules) reset the state
machine and increment a global spark miss counter to avoid having these
errors breaking the state machine as they can easily be recovered from

Cases where the coil would already be charging and an error occurs
require as stated above a full recovery procedure with soft shutdown of
the ignition IC and a clean cycle of the state machine to ensure a full
recovery
2026-09-26 22:11:51 +02:00

280 lines
12 KiB
Plaintext

#MicroXplorer Configuration settings - do not modify
CAD.formats=
CAD.pinconfig=
CAD.provider=
CORTEX_M7.IPParameters=default_mode_Activation
CORTEX_M7.default_mode_Activation=1
CortexM4.IPs=CORTEX_M4\:I,FATFS_M4\:I,FREERTOS_M4\:I,IWDG2\:I,OPENAMP_M4\:I,PDM2PCM_M4\:I,PWR,RCC,RESMGR_UTILITY,SYS_M4\:I,USB_DEVICE_M4\:I,USB_HOST_M4\:I,VREFBUF,WWDG2\:I,GPIO,DMA,BDMA,MDMA,NVIC2\:I
CortexM7.IPs=CORTEX_M7\:I,FATFS_M7\:I,FREERTOS_M7\:I,IWDG1\:I,OPENAMP_M7\:I,PDM2PCM_M7\:I,PWR\:I,RCC\:I,RESMGR_UTILITY\:I,SYS\:I,USB_DEVICE_M7\:I,USB_HOST_M7\:I,VREFBUF\:I,WWDG1\:I,GPIO\:I,DMA\:I,BDMA\:I,MDMA\:I,NVIC1\:I,DEBUG\:I,TIM2\:I,TIM6\:I
CortexM7.Pins=PI12
FREERTOS_M7.FootprintOK=true
FREERTOS_M7.IPParameters=Tasks01,configENABLE_FPU,FootprintOK
FREERTOS_M7.Tasks01=defaultTask,24,128,StartDefaultTask,Default,NULL,Dynamic,NULL,NULL;crankTask,55,128,crankHandler,As external,NULL,Static,crankTaskBuffer,crankTaskControlBlock;camTask,55,128,camHandler,As external,NULL,Static,camTaskBuffer,camTaskControlBlock
FREERTOS_M7.configENABLE_FPU=1
File.Version=6
GPIO.groupedBy=Group By Peripherals
KeepUserPlacement=false
Mcu.CPN=STM32H747XIH6
Mcu.Context0=CortexM7
Mcu.Context1=CortexM4
Mcu.ContextNb=2
Mcu.Family=STM32H7
Mcu.IP0=CORTEX_M4
Mcu.IP1=CORTEX_M7
Mcu.IP2=FREERTOS_M7
Mcu.IP3=NVIC1
Mcu.IP4=NVIC2
Mcu.IP5=RCC
Mcu.IP6=SYS_M4
Mcu.IP7=SYS
Mcu.IP8=TIM2
Mcu.IPNb=9
Mcu.Name=STM32H747XIHx
Mcu.Package=TFBGA240
Mcu.Pin0=PA14 (JTCK/SWCLK)
Mcu.Pin1=PC15-OSC32_OUT (OSC32_OUT)
Mcu.Pin10=VP_FREERTOS_M7_VS_CMSIS_V2
Mcu.Pin11=VP_SYS_VS_tim6
Mcu.Pin12=VP_SYS_M4_VS_Systick
Mcu.Pin13=VP_TIM2_VS_ClockSourceINT
Mcu.Pin2=PC14-OSC32_IN (OSC32_IN)
Mcu.Pin3=PA13 (JTMS/SWDIO)
Mcu.Pin4=PI12
Mcu.Pin5=PH1-OSC_OUT (PH1)
Mcu.Pin6=PH0-OSC_IN (PH0)
Mcu.Pin7=PA2
Mcu.Pin8=PA1
Mcu.Pin9=PA0
Mcu.PinsNb=14
Mcu.ThirdPartyNb=0
Mcu.UserConstants=
Mcu.UserName=STM32H747XIHx
MxCube.Version=6.17.0
MxDb.Version=DB.6.0.170
NVIC1.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
NVIC1.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
NVIC1.ForceEnableDMAVector=true
NVIC1.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
NVIC1.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
NVIC1.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
NVIC1.PendSV_IRQn=true\:15\:0\:false\:false\:false\:true\:false\:false\:false
NVIC1.PriorityGroup=NVIC_PRIORITYGROUP_4
NVIC1.SVCall_IRQn=true\:0\:0\:false\:false\:false\:false\:false\:false\:false
NVIC1.SavedPendsvIrqHandlerGenerated=true
NVIC1.SavedSvcallIrqHandlerGenerated=true
NVIC1.SavedSystickIrqHandlerGenerated=true
NVIC1.SysTick_IRQn=true\:15\:0\:false\:false\:false\:true\:false\:true\:false
NVIC1.TIM2_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true\:true
NVIC1.TIM6_DAC_IRQn=true\:15\:0\:false\:false\:true\:false\:false\:true\:true
NVIC1.TimeBase=TIM6_DAC_IRQn
NVIC1.TimeBaseIP=TIM6
NVIC1.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
NVIC2.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC2.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC2.ForceEnableDMAVector=true
NVIC2.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC2.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC2.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC2.PendSV_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC2.PriorityGroup=NVIC_PRIORITYGROUP_4
NVIC2.SVCall_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC2.SysTick_IRQn=true\:15\:0\:false\:false\:true\:false\:true\:false
NVIC2.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
PA0.GPIOParameters=GPIO_Label,PinAttribute
PA0.GPIO_Label=TIM2_CRANK
PA0.Locked=true
PA0.PinAttribute=CortexM7
PA0.Signal=S_TIM2_CH1_ETR
PA1.GPIOParameters=GPIO_Label,PinAttribute
PA1.GPIO_Label=TIM2_CAM
PA1.Locked=true
PA1.PinAttribute=CortexM7
PA1.Signal=S_TIM2_CH2
PA13\ (JTMS/SWDIO).GPIOParameters=PinAttribute
PA13\ (JTMS/SWDIO).Locked=true
PA13\ (JTMS/SWDIO).PinAttribute=CortexM7
PA13\ (JTMS/SWDIO).Signal=DEBUG_JTMS-SWDIO
PA14\ (JTCK/SWCLK).GPIOParameters=PinAttribute
PA14\ (JTCK/SWCLK).Locked=true
PA14\ (JTCK/SWCLK).PinAttribute=CortexM7
PA14\ (JTCK/SWCLK).Signal=DEBUG_JTCK-SWCLK
PA2.GPIOParameters=GPIO_Speed,PinAttribute
PA2.GPIO_Speed=GPIO_SPEED_FREQ_LOW
PA2.Locked=true
PA2.PinAttribute=CortexM7
PA2.Signal=S_TIM2_CH3
PC14-OSC32_IN\ (OSC32_IN).GPIOParameters=PinAttribute
PC14-OSC32_IN\ (OSC32_IN).Locked=true
PC14-OSC32_IN\ (OSC32_IN).Mode=LSE-External-Oscillator
PC14-OSC32_IN\ (OSC32_IN).PinAttribute=Free
PC14-OSC32_IN\ (OSC32_IN).Signal=RCC_OSC32_IN
PC15-OSC32_OUT\ (OSC32_OUT).GPIOParameters=PinAttribute
PC15-OSC32_OUT\ (OSC32_OUT).Locked=true
PC15-OSC32_OUT\ (OSC32_OUT).Mode=LSE-External-Oscillator
PC15-OSC32_OUT\ (OSC32_OUT).PinAttribute=Free
PC15-OSC32_OUT\ (OSC32_OUT).Signal=RCC_OSC32_OUT
PH0-OSC_IN\ (PH0).GPIOParameters=PinAttribute
PH0-OSC_IN\ (PH0).Locked=true
PH0-OSC_IN\ (PH0).Mode=HSE-External-Oscillator
PH0-OSC_IN\ (PH0).PinAttribute=Free
PH0-OSC_IN\ (PH0).Signal=RCC_OSC_IN
PH1-OSC_OUT\ (PH1).GPIOParameters=PinAttribute
PH1-OSC_OUT\ (PH1).Locked=true
PH1-OSC_OUT\ (PH1).Mode=HSE-External-Oscillator
PH1-OSC_OUT\ (PH1).PinAttribute=Free
PH1-OSC_OUT\ (PH1).Signal=RCC_OSC_OUT
PI12.ContextOwner=CortexM7
PI12.GPIOParameters=PinState,GPIO_Label,PinAttribute
PI12.GPIO_Label=LED_RED
PI12.Locked=true
PI12.PinAttribute=CortexM7
PI12.PinState=GPIO_PIN_SET
PI12.Signal=GPIO_Output
PinOutPanel.CurrentBGAView=Top
PinOutPanel.RotationAngle=0
ProjectManager.AskForMigrate=true
ProjectManager.BackupPrevious=false
ProjectManager.BootMode=boot0
ProjectManager.CompilerLinker=GCC
ProjectManager.CompilerOptimize=6
ProjectManager.ComputerToolchain=false
ProjectManager.CoupleFile=false
ProjectManager.CustomerFirmwarePackage=
ProjectManager.DefaultFWLocation=true
ProjectManager.DeletePrevious=true
ProjectManager.DeviceId=STM32H747XIHx
ProjectManager.FirmwarePackage=STM32Cube FW_H7 V1.13.0
ProjectManager.FreePins=false
ProjectManager.FreePinsContext=CortexM7
ProjectManager.HalAssertFull=false
ProjectManager.HeapSize=M4-0x200,M7-0x200
ProjectManager.KeepUserCode=true
ProjectManager.LastFirmware=true
ProjectManager.LibraryCopy=1
ProjectManager.MainLocation=Core/Src
ProjectManager.NoMain=false
ProjectManager.PreviousToolchain=
ProjectManager.ProjectBuild=false
ProjectManager.ProjectFileName=STM32.ioc
ProjectManager.ProjectName=STM32
ProjectManager.ProjectStructure=M7\:CortexM7 Project\:true;M4\:CortexM4 Project\:true;
ProjectManager.RegisterCallBack=
ProjectManager.StackSize=M4-0x400,M7-0x400
ProjectManager.TargetToolchain=CMake
ProjectManager.ToolChainLocation=
ProjectManager.UAScriptAfterPath=
ProjectManager.UAScriptBeforePath=
ProjectManager.UnderRoot=false
ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false-CortexM7,2-MX_GPIO_Init-GPIO-false-HAL-true-CortexM7,3-MX_TIM2_Init-TIM2-false-HAL-true-CortexM7,0-MX_CORTEX_M7_Init-CORTEX_M7-false-HAL-true-CortexM7,0-MX_CORTEX_M4_Init-CORTEX_M4-false-HAL-true-CortexM4
RCC.ADCFreq_Value=32250000
RCC.AHB12Freq_Value=200000000
RCC.AHB4Freq_Value=200000000
RCC.APB1Freq_Value=50000000
RCC.APB2Freq_Value=100000000
RCC.APB3Freq_Value=100000000
RCC.APB4Freq_Value=100000000
RCC.AXIClockFreq_Value=200000000
RCC.CECFreq_Value=32000
RCC.CKPERFreq_Value=64000000
RCC.CPU2Freq_Value=200000000
RCC.CPU2SystikFreq_Value=200000000
RCC.CortexFreq_Value=400000000
RCC.CpuClockFreq_Value=400000000
RCC.D1CPREFreq_Value=400000000
RCC.D1PPRE=RCC_APB3_DIV2
RCC.D2PPRE1=RCC_APB1_DIV4
RCC.D2PPRE2=RCC_APB2_DIV2
RCC.D3PPRE=RCC_APB4_DIV2
RCC.DFSDMACLkFreq_Value=400000000
RCC.DFSDMFreq_Value=100000000
RCC.DIVM1=2
RCC.DIVN1=100
RCC.DIVP1Freq_Value=400000000
RCC.DIVP2Freq_Value=32250000
RCC.DIVP3Freq_Value=32250000
RCC.DIVQ1Freq_Value=400000000
RCC.DIVQ2Freq_Value=32250000
RCC.DIVQ3Freq_Value=32250000
RCC.DIVR1Freq_Value=400000000
RCC.DIVR2Freq_Value=32250000
RCC.DIVR3Freq_Value=32250000
RCC.DSIFreq_Value=40000000
RCC.DSITXEscFreq_Value=10000000
RCC.FDCANFreq_Value=400000000
RCC.FMCFreq_Value=200000000
RCC.FamilyName=M
RCC.HCLK3ClockFreq_Value=200000000
RCC.HCLKFreq_Value=200000000
RCC.HPRE=RCC_HCLK_DIV2
RCC.HRTIMFreq_Value=200000000
RCC.HSE_VALUE=16000000
RCC.I2C123Freq_Value=50000000
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,CPU2Freq_Value,CPU2SystikFreq_Value,CortexFreq_Value,CpuClockFreq_Value,D1CPREFreq_Value,D1PPRE,D2PPRE1,D2PPRE2,D3PPRE,DFSDMACLkFreq_Value,DFSDMFreq_Value,DIVM1,DIVN1,DIVP1Freq_Value,DIVP2Freq_Value,DIVP3Freq_Value,DIVQ1Freq_Value,DIVQ2Freq_Value,DIVQ3Freq_Value,DIVR1Freq_Value,DIVR2Freq_Value,DIVR3Freq_Value,DSIFreq_Value,DSITXEscFreq_Value,FDCANFreq_Value,FMCFreq_Value,FamilyName,HCLK3ClockFreq_Value,HCLKFreq_Value,HPRE,HRTIMFreq_Value,HSE_VALUE,I2C123Freq_Value,I2C4Freq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPTIM345Freq_Value,LPUART1Freq_Value,LTDCFreq_Value,MCO1PinFreq_Value,MCO2PinFreq_Value,PLLDSIFreq_Value,PLLDSIVCOFreq_Value,PLLSourceVirtual,PWR_Regulator_Voltage_Scale,QSPIFreq_Value,RNGFreq_Value,RTCFreq_Value,SAI1Freq_Value,SAI23Freq_Value,SAI4AFreq_Value,SAI4BFreq_Value,SDMMCFreq_Value,SPDIFRXFreq_Value,SPI123Freq_Value,SPI45Freq_Value,SPI6Freq_Value,SWPMI1Freq_Value,SYSCLKFreq_VALUE,SYSCLKSource,SupplySource,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=50000000
RCC.LPTIM2Freq_Value=100000000
RCC.LPTIM345Freq_Value=100000000
RCC.LPUART1Freq_Value=100000000
RCC.LTDCFreq_Value=32250000
RCC.MCO1PinFreq_Value=64000000
RCC.MCO2PinFreq_Value=400000000
RCC.PLLDSIFreq_Value=320000000
RCC.PLLDSIVCOFreq_Value=640000000
RCC.PLLSourceVirtual=RCC_PLLSOURCE_HSE
RCC.PWR_Regulator_Voltage_Scale=PWR_REGULATOR_VOLTAGE_SCALE0
RCC.QSPIFreq_Value=200000000
RCC.RNGFreq_Value=48000000
RCC.RTCFreq_Value=32000
RCC.SAI1Freq_Value=400000000
RCC.SAI23Freq_Value=400000000
RCC.SAI4AFreq_Value=400000000
RCC.SAI4BFreq_Value=400000000
RCC.SDMMCFreq_Value=400000000
RCC.SPDIFRXFreq_Value=400000000
RCC.SPI123Freq_Value=400000000
RCC.SPI45Freq_Value=100000000
RCC.SPI6Freq_Value=100000000
RCC.SWPMI1Freq_Value=50000000
RCC.SYSCLKFreq_VALUE=400000000
RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK
RCC.SupplySource=PWR_LDO_SUPPLY
RCC.Tim1OutputFreq_Value=100000000
RCC.Tim2OutputFreq_Value=200000000
RCC.TraceFreq_Value=64000000
RCC.USART16Freq_Value=100000000
RCC.USART234578Freq_Value=50000000
RCC.USBFreq_Value=400000000
RCC.VCO1OutputFreq_Value=800000000
RCC.VCO2OutputFreq_Value=64500000
RCC.VCO3OutputFreq_Value=64500000
RCC.VCOInput1Freq_Value=8000000
RCC.VCOInput2Freq_Value=500000
RCC.VCOInput3Freq_Value=500000
SH.S_TIM2_CH1_ETR.0=TIM2_CH1,Input_Capture1_from_TI1
SH.S_TIM2_CH1_ETR.ConfNb=1
SH.S_TIM2_CH2.0=TIM2_CH2,Input_Capture2_from_TI2
SH.S_TIM2_CH2.ConfNb=1
SH.S_TIM2_CH3.0=TIM2_CH3,Output Compare3 CH3
SH.S_TIM2_CH3.ConfNb=1
SYS.userName=SYS_M7
TIM2.Channel-Input_Capture1_from_TI1=TIM_CHANNEL_1
TIM2.Channel-Input_Capture2_from_TI2=TIM_CHANNEL_2
TIM2.Channel-Output\ Compare3\ CH3=TIM_CHANNEL_3
TIM2.ClockDivision=TIM_CLOCKDIVISION_DIV1
TIM2.ICFilter_CH1=10
TIM2.ICFilter_CH2=10
TIM2.ICPolarity_CH1=TIM_INPUTCHANNELPOLARITY_FALLING
TIM2.IPParameters=ClockDivision,Prescaler,Channel-Input_Capture1_from_TI1,ICPolarity_CH1,Channel-Input_Capture2_from_TI2,ICFilter_CH2,ICFilter_CH1,Channel-Output Compare3 CH3,OCMode_3
TIM2.OCMode_3=TIM_OCMODE_TOGGLE
TIM2.Prescaler=99
VP_FREERTOS_M7_VS_CMSIS_V2.Mode=CMSIS_V2
VP_FREERTOS_M7_VS_CMSIS_V2.Signal=FREERTOS_M7_VS_CMSIS_V2
VP_SYS_M4_VS_Systick.Mode=SysTick
VP_SYS_M4_VS_Systick.Signal=SYS_M4_VS_Systick
VP_SYS_VS_tim6.Mode=TIM6
VP_SYS_VS_tim6.Signal=SYS_VS_tim6
VP_TIM2_VS_ClockSourceINT.Mode=Internal
VP_TIM2_VS_ClockSourceINT.Signal=TIM2_VS_ClockSourceINT
board=custom
rtos.0.ip=FREERTOS_M7