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
94 lines
4.0 KiB
CMake
94 lines
4.0 KiB
CMake
# File automatically-generated by STM32CubeMX - Do not modify
|
|
cmake_minimum_required(VERSION 3.22)
|
|
# STM32CubeMX generated symbols (macros)
|
|
set(MX_Defines_Syms
|
|
CORE_CM4
|
|
USE_HAL_DRIVER
|
|
STM32H747xx
|
|
USE_PWR_LDO_SUPPLY
|
|
$<$<CONFIG:Debug>:DEBUG>
|
|
)
|
|
# STM32CubeMX generated include paths
|
|
set(MX_Include_Dirs
|
|
${CMAKE_CURRENT_SOURCE_DIR}/Core/Inc
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../Drivers/STM32H7xx_HAL_Driver/Inc
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../Drivers/STM32H7xx_HAL_Driver/Inc/Legacy
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../Drivers/CMSIS/Device/ST/STM32H7xx/Include
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../Drivers/CMSIS/Include
|
|
)
|
|
# STM32CubeMX generated application sources
|
|
set(MX_Application_Src
|
|
${CMAKE_CURRENT_SOURCE_DIR}/Core/Src/main.c
|
|
${CMAKE_CURRENT_SOURCE_DIR}/Core/Src/stm32h7xx_it.c
|
|
${CMAKE_CURRENT_SOURCE_DIR}/Core/Src/stm32h7xx_hal_msp.c
|
|
${CMAKE_CURRENT_SOURCE_DIR}/Core/Src/sysmem.c
|
|
${CMAKE_CURRENT_SOURCE_DIR}/Core/Src/syscalls.c
|
|
${CMAKE_CURRENT_SOURCE_DIR}/Core/Startup/startup_stm32h747xx_CM4.s
|
|
)
|
|
|
|
# STM32 HAL/LL Drivers
|
|
set(STM32_Drivers_Src
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../Common/Src/system_stm32h7xx_dualcore_boot_cm4_cm7.c
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_tim.c
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_tim_ex.c
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_cortex.c
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rcc.c
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rcc_ex.c
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_flash.c
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_flash_ex.c
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_gpio.c
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_hsem.c
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_dma.c
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_dma_ex.c
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_mdma.c
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pwr.c
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pwr_ex.c
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal.c
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_i2c.c
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_i2c_ex.c
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_exti.c
|
|
)
|
|
|
|
# Drivers Midllewares
|
|
|
|
# Link directories setup
|
|
set(MX_LINK_DIRS
|
|
|
|
)
|
|
# Project libraries
|
|
set (MX_LINK_LIBS
|
|
STM32_Drivers
|
|
${TOOLCHAIN_LINK_LIBRARIES}
|
|
|
|
|
|
)
|
|
# Interface library for includes and symbols
|
|
add_library(stm32cubemx INTERFACE)
|
|
target_include_directories(stm32cubemx INTERFACE ${MX_Include_Dirs})
|
|
target_compile_definitions(stm32cubemx INTERFACE ${MX_Defines_Syms})
|
|
|
|
# Create STM32_Drivers static library
|
|
add_library(STM32_Drivers OBJECT)
|
|
target_sources(STM32_Drivers PRIVATE ${STM32_Drivers_Src})
|
|
target_link_libraries(STM32_Drivers PUBLIC stm32cubemx)
|
|
|
|
|
|
# Add STM32CubeMX generated application sources to the project
|
|
target_sources(${CMAKE_PROJECT_NAME} PRIVATE ${MX_Application_Src})
|
|
|
|
# Link directories setup
|
|
target_link_directories(${CMAKE_PROJECT_NAME} PRIVATE ${MX_LINK_DIRS})
|
|
|
|
# Add libraries to the project
|
|
target_link_libraries(${CMAKE_PROJECT_NAME} ${MX_LINK_LIBS})
|
|
|
|
# Add the map file to the list of files to be removed with 'clean' target
|
|
set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES ADDITIONAL_CLEAN_FILES ${CMAKE_PROJECT_NAME}.map)
|
|
|
|
|
|
|
|
|
|
# Validate that STM32CubeMX code is compatible with C standard
|
|
if((CMAKE_C_STANDARD EQUAL 90) OR (CMAKE_C_STANDARD EQUAL 99))
|
|
message(ERROR "Generated code requires C11 or higher")
|
|
endif() |