added cube repo, updated CMakelists

This commit is contained in:
Robin Müller 2021-07-12 22:11:03 +02:00
parent 82671539a4
commit 3ba892ae1a
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
3 changed files with 31 additions and 9 deletions

3
.gitmodules vendored
View File

@ -16,3 +16,6 @@
[submodule "fsfw_hal"]
path = fsfw_hal
url = https://egit.irs.uni-stuttgart.de/fsfw/fsfw-hal.git
[submodule "STM32CubeH7"]
path = STM32CubeH7
url = https://github.com/STMicroelectronics/STM32CubeH7.git

View File

@ -1,8 +1,5 @@
################################################################################
# CMake support for the Flight Software Framework
#
# Developed in an effort to replace Make with a modern build system.
#
# Author: R. Mueller
################################################################################
@ -14,11 +11,17 @@ cmake_minimum_required(VERSION 3.13)
# set(CMAKE_VERBOSE TRUE)
set(CMAKE_SCRIPT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
set(STM32_CMAKE_PATH "${CMAKE_SCRIPT_PATH}/stm32-cmake")
set(STM32_CUBE_H7_PATH STM32CubeH7)
set(STM32_TOOLCHAIN_PATH $ENV{STM32_TOOLCHAIN_PATH})
set(TARGET_TRIPLET "arm-none-eabi")
if(NOT OS_FSFW)
set(OS_FSFW host CACHE STRING "OS for the FSFW.")
endif()
# This call has to come before the project call
set(CMAKE_TOOLCHAIN_FILE ${STM32_CMAKE_PATH}/cmake/stm32_gcc.cmake)
# Project Name
project(fsfw-example-stm32h7-freertos ASM C CXX)
@ -30,6 +33,12 @@ project(fsfw-example-stm32h7-freertos ASM C CXX)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
find_package(CMSIS COMPONENTS STM32H743ZI STM32H7_M7 RTOS REQUIRED)
find_package(FreeRTOS COMPONENTS STM32H7 ARM_CM7 REQUIRED)
find_package(HAL COMPONENTS STM32H7M7 STM32H743ZI RCC GPIO CORTEX REQUIRED)
set(FREERTOS_NAMESPACE FreeRTOS::STM32::H7::M7)
# Set names and variables
set(TARGET_NAME ${CMAKE_PROJECT_NAME})
set(LIB_FSFW_NAME fsfw)
@ -78,9 +87,6 @@ endif()
add_executable(${TARGET_NAME})
# Add subdirectories
if(LIB_OS_NAME)
add_subdirectory(${LIB_OS_NAME})
endif()
add_subdirectory(${BSP_PATH})
add_subdirectory(${FSFW_PATH})
add_subdirectory(${COMMON_PATH})
@ -91,7 +97,18 @@ add_subdirectory(${COMMON_PATH})
# Add libraries for all sources.
target_link_libraries(${TARGET_NAME} PRIVATE
${LIB_FSFW_NAME}
${LIB_FSFW_NAME}
${FREERTOS_NAMESPACE}::Heap::4
${FREERTOS_NAMESPACE}::ARM_CM7
HAL::STM32::H7::M7::RCC
HAL::STM32::H7::M7::GPIO
HAL::STM32::H7::M7::CORTEX
CMSIS::STM32::H743ZI::M7
STM32::NoSys
STM32::Nano
STM32::Nano::FloatPrint
STM32::Nano::FloatScan
CMSIS::STM32::H7::M7::RTOS
)
# Add include paths for all sources.
@ -144,8 +161,9 @@ string(CONCAT POST_BUILD_COMMENT
"Target Build Type: ${CMAKE_BUILD_TYPE}\n"
"${TARGET_STRING}"
)
# TODO: Generate bin file with stm32-cmake command
# TODO: Print size with stm32-cmake command
include (${CMAKE_SCRIPT_PATH}/BuildType.cmake)
set_build_type()
stm32_print_size_of_target(${TARGET_NAME})
stm32_generate_binary_file(${TARGET_NAME})

1
STM32CubeH7 Submodule

@ -0,0 +1 @@
Subproject commit 5975bffae9358bc2b2890a35a203d940a395efef