From c4220b37e59ce38ecb2a73beeae5ec928b0c3be8 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 20 Apr 2022 00:57:37 +0200 Subject: [PATCH 1/3] add option for external toolchain file --- CMakeLists.txt | 7 +++++-- cmake/PreProjectConfig.cmake | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2ef85e12..79813efd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,7 +16,10 @@ set(CMAKE_SCRIPT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") option(EIVE_ADD_ETL_LIB "Add ETL library" ON) option(EIVE_ADD_JSON_LIB "Add JSON library" ON) - +option(EIVE_HARDCODED_TOOLCHAIN_FILE "\ +For Linux Board Target BSPs, a default toolchain file will be set. Should be set to OFF \ +if a different toolchain file is set externally" ON +) option(EIVE_SYSROOT_MAGIC "Perform sysroot magic which might not be necessary" OFF) option(EIVE_CREATE_UNIQUE_OBSW_BIN "Append username to generated binary name" ON) @@ -41,7 +44,7 @@ include(${CMAKE_SCRIPT_PATH}/PreProjectConfig.cmake) pre_project_config() # Check whether the user has already installed Catch2 first. This has to come before -# the project call. We could also exlcude doing this when the Q7S primary OBSW is built.. +# the project call. We could also exclude doing this when the Q7S primary OBSW is built.. find_package(Catch2 3 CONFIG QUIET) # Project Name diff --git a/cmake/PreProjectConfig.cmake b/cmake/PreProjectConfig.cmake index 41dd7de4..e032965a 100644 --- a/cmake/PreProjectConfig.cmake +++ b/cmake/PreProjectConfig.cmake @@ -11,7 +11,7 @@ endif() # Disable compiler checks for cross-compiling. -if(FSFW_OSAL MATCHES linux AND TGT_BSP) +if(FSFW_OSAL MATCHES linux AND TGT_BSP AND NOT EIVE_HARDCODED_TOOLCHAIN_FILE) if(TGT_BSP MATCHES "arm/q7s" OR TGT_BSP MATCHES "arm/te0720-1cfa") set(CMAKE_TOOLCHAIN_FILE "${CMAKE_SCRIPT_PATH}/Zynq7020CrossCompileConfig.cmake" From f23ba7ab7b6518b66771274795ec6ff755d72761 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 20 Apr 2022 01:25:56 +0200 Subject: [PATCH 2/3] always build watchdog for arm q7s now --- CMakeLists.txt | 11 ++++++++--- cmake/PreProjectConfig.cmake | 2 +- fsfw | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 79813efd..9c85453c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -250,8 +250,13 @@ else() endif() set_target_properties(${OBSW_NAME} PROPERTIES OUTPUT_NAME ${OBSW_BIN_NAME}) -#watchdog -add_executable(${WATCHDOG_NAME} EXCLUDE_FROM_ALL) +# Watchdog +if(TGT_BSP MATCHES "arm/q7s") + add_executable(${WATCHDOG_NAME}) +else() + add_executable(${WATCHDOG_NAME} EXCLUDE_FROM_ALL) +endif() + add_subdirectory(${WATCHDOG_PATH}) target_link_libraries(${WATCHDOG_NAME} PUBLIC ${LIB_CXX_FS} @@ -376,7 +381,7 @@ endif() -if(${CMAKE_CROSSCOMPILING}) +if(CMAKE_CROSSCOMPILING) include (${CMAKE_SCRIPT_PATH}/HardwareOsPostConfig.cmake) post_source_hw_os_config() endif() diff --git a/cmake/PreProjectConfig.cmake b/cmake/PreProjectConfig.cmake index e032965a..52a71923 100644 --- a/cmake/PreProjectConfig.cmake +++ b/cmake/PreProjectConfig.cmake @@ -11,7 +11,7 @@ endif() # Disable compiler checks for cross-compiling. -if(FSFW_OSAL MATCHES linux AND TGT_BSP AND NOT EIVE_HARDCODED_TOOLCHAIN_FILE) +if(FSFW_OSAL MATCHES linux AND TGT_BSP AND EIVE_HARDCODED_TOOLCHAIN_FILE) if(TGT_BSP MATCHES "arm/q7s" OR TGT_BSP MATCHES "arm/te0720-1cfa") set(CMAKE_TOOLCHAIN_FILE "${CMAKE_SCRIPT_PATH}/Zynq7020CrossCompileConfig.cmake" diff --git a/fsfw b/fsfw index 96babff6..e68873ec 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 96babff67ea7859cc9802db63c5d07a7f64c8255 +Subproject commit e68873ec924a4d530291a811976379232fde034e From eb0e7c39e4ee96d0498ecf2eaa7cbac4f7ccef2c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 20 Apr 2022 01:27:16 +0200 Subject: [PATCH 3/3] update README --- README.md | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 4d897980..7f9e9d72 100644 --- a/README.md +++ b/README.md @@ -163,23 +163,26 @@ automatically. The EIVE OBSW is the default target if no target is specified. +**Debug** + ```sh mkdir build-Debug-Q7S && cd build-Debug-Q7S cmake -DTGT_BSP=arm/q7s -DCMAKE_BUILD_TYPE=Debug .. cmake --build . -j ``` -### Q7S Watchdog - -To build the EIVE watchdog, the corresponding target must be specified in the build command. -The configure steps do not need to be repeated if the folder has already been configured. +**Release** ```sh -mkdir build-Debug-Watchdog && cd build-Debug-Watchdog -cmake -DTGT_BSP=arm/q7s -DCMAKE_BUILD_TYPE=Debug .. -cmake --build . --target eive-watchdog -j +mkdir build-Release-Q7S && cd build-Release-Q7S +cmake -DTGT_BSP=arm/q7s -DCMAKE_BUILD_TYPE=Release .. +cmake --build . -j ``` +### Q7S Watchdog + +The watchdog will be built along side the primary OBSW binary. + ### Hosted You can also use the FSFW OSAL `host` to build on Windows or for generic OSes.