diff --git a/.gitmodules b/.gitmodules index 44a86d86..6bde354a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -9,7 +9,7 @@ url = https://egit.irs.uni-stuttgart.de/eive/fsfw.git [submodule "tmtc"] path = tmtc - url = https://egit.irs.uni-stuttgart.de/eive/eive_tmtc.git + url = https://egit.irs.uni-stuttgart.de/eive/eive-tmtc.git [submodule "thirdparty/lwgps"] path = thirdparty/lwgps url = https://github.com/rmspacefish/lwgps.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 33c6edfc..10c3a349 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,6 +15,10 @@ cmake_minimum_required(VERSION 3.13) set(CMAKE_SCRIPT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") +if(TGT_BSP MATCHES "arm/q7s") + option(Q7S_SIMPLE_MODE OFF "Simple mode with a minimal main function") +endif() + option(ADD_ETL_LIB "Add ETL library" ON) if(NOT OS_FSFW) set(OS_FSFW host CACHE STRING "OS for the FSFW.") @@ -74,9 +78,11 @@ if(TGT_BSP) OR ${TGT_BSP} MATCHES "arm/beagleboneblack" ) set(FSFW_CONFIG_PATH "linux/fsfwconfig") - set(ADD_LINUX_FILES TRUE) - set(ADD_CSP_LIB TRUE) - set(FSFW_HAL_ADD_LINUX ON) + if(NOT Q7S_SIMPLE_MODE) + set(ADD_LINUX_FILES TRUE) + set(ADD_CSP_LIB TRUE) + set(FSFW_HAL_ADD_LINUX ON) + endif() endif() if(${TGT_BSP} MATCHES "arm/raspberrypi") @@ -133,27 +139,33 @@ if(ADD_LINUX_FILES) add_subdirectory(${LINUX_PATH}) endif() -add_subdirectory(${LWGPS_LIB_PATH}) add_subdirectory(${BSP_PATH}) -add_subdirectory(${FSFW_PATH}) -add_subdirectory(${MISSION_PATH}) -add_subdirectory(${TEST_PATH}) -add_subdirectory(${FSFW_HAL_LIB_PATH}) add_subdirectory(${COMMON_PATH}) +if(NOT Q7S_SIMPLE_MODE) + add_subdirectory(${LWGPS_LIB_PATH}) + add_subdirectory(${FSFW_PATH}) + add_subdirectory(${MISSION_PATH}) + add_subdirectory(${TEST_PATH}) + add_subdirectory(${FSFW_HAL_LIB_PATH}) +endif() + + ################################################################################ # Post-Sources preparation ################################################################################ set_property(CACHE OS_FSFW PROPERTY STRINGS host linux) -# Add libraries for all sources. -target_link_libraries(${TARGET_NAME} PRIVATE - ${LIB_FSFW_NAME} - ${LIB_OS_NAME} - ${LIB_LWGPS_NAME} - ${LIB_FSFW_HAL_NAME} -) +if(NOT Q7S_SIMPLE_MODE) + # Add libraries for all sources. + target_link_libraries(${TARGET_NAME} PRIVATE + ${LIB_FSFW_NAME} + ${LIB_OS_NAME} + ${LIB_LWGPS_NAME} + ${LIB_FSFW_HAL_NAME} + ) +endif() if(ADD_ETL_LIB) target_link_libraries(${TARGET_NAME} PRIVATE @@ -243,8 +255,3 @@ add_custom_command( include (${CMAKE_SCRIPT_PATH}/BuildType.cmake) set_build_type() - - - - - diff --git a/bsp_q7s/CMakeLists.txt b/bsp_q7s/CMakeLists.txt index ce790656..bc027af0 100644 --- a/bsp_q7s/CMakeLists.txt +++ b/bsp_q7s/CMakeLists.txt @@ -1,11 +1,13 @@ target_sources(${TARGET_NAME} PUBLIC - InitMission.cpp main.cpp - ObjectFactory.cpp ) -add_subdirectory(boardconfig) -add_subdirectory(comIF) -add_subdirectory(boardtest) -add_subdirectory(gpio) -add_subdirectory(core) +if(Q7S_SIMPLE_MODE) + add_subdirectory(simple) +else() + add_subdirectory(boardconfig) + add_subdirectory(comIF) + add_subdirectory(boardtest) + add_subdirectory(gpio) + add_subdirectory(core) +endif() diff --git a/bsp_q7s/boardconfig/q7sConfig.h.in b/bsp_q7s/boardconfig/q7sConfig.h.in index 81b96a7e..6ee84821 100644 --- a/bsp_q7s/boardconfig/q7sConfig.h.in +++ b/bsp_q7s/boardconfig/q7sConfig.h.in @@ -1,6 +1,7 @@ #ifndef BSP_Q7S_BOARDCONFIG_Q7S_CONFIG_H_ #define BSP_Q7S_BOARDCONFIG_Q7S_CONFIG_H_ +#cmakedefine01 Q7S_SIMPLE_MODE #define Q7S_ADD_RTD_DEVICES 0 /* Only one of those 2 should be enabled! */ diff --git a/bsp_q7s/bsp_q7s.mk b/bsp_q7s/bsp_q7s.mk deleted file mode 100644 index 93bfdc78..00000000 --- a/bsp_q7s/bsp_q7s.mk +++ /dev/null @@ -1,6 +0,0 @@ -CXXSRC += $(wildcard $(CURRENTPATH)/*.cpp) -CXXSRC += $(wildcard $(CURRENTPATH)/comIF/cookies/*.cpp) -CXXSRC += $(wildcard $(CURRENTPATH)/comIF/*.cpp) -CSRC += $(wildcard $(CURRENTPATH)/*.c) - -CSRC += $(wildcard $(CURRENTPATH)/boardconfig/*.c) \ No newline at end of file diff --git a/bsp_q7s/core/CMakeLists.txt b/bsp_q7s/core/CMakeLists.txt index 4b2364c1..fc397f2f 100644 --- a/bsp_q7s/core/CMakeLists.txt +++ b/bsp_q7s/core/CMakeLists.txt @@ -1,3 +1,6 @@ target_sources(${TARGET_NAME} PRIVATE CoreController.cpp + obsw.cpp + InitMission.cpp + ObjectFactory.cpp ) diff --git a/bsp_q7s/InitMission.cpp b/bsp_q7s/core/InitMission.cpp similarity index 97% rename from bsp_q7s/InitMission.cpp rename to bsp_q7s/core/InitMission.cpp index 25cd6abf..3e655255 100644 --- a/bsp_q7s/InitMission.cpp +++ b/bsp_q7s/core/InitMission.cpp @@ -104,10 +104,14 @@ void initmission::initTasks() { PeriodicTaskIF* pusEvents = factory->createPeriodicTask( "PUS_EVENTS", 60, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, missedDeadlineFunc); - result = pusVerification->addComponent(objects::PUS_SERVICE_5_EVENT_REPORTING); + result = pusEvents->addComponent(objects::PUS_SERVICE_5_EVENT_REPORTING); if(result != HasReturnvaluesIF::RETURN_OK) { initmission::printAddObjectError("PUS_EVENTS", objects::PUS_SERVICE_5_EVENT_REPORTING); } + result = pusEvents->addComponent(objects::EVENT_MANAGER); + if(result != HasReturnvaluesIF::RETURN_OK) { + initmission::printAddObjectError("PUS_MGMT", objects::EVENT_MANAGER); + } PeriodicTaskIF* pusHighPrio = factory->createPeriodicTask( "PUS_HIGH_PRIO", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, missedDeadlineFunc); diff --git a/bsp_q7s/InitMission.h b/bsp_q7s/core/InitMission.h similarity index 100% rename from bsp_q7s/InitMission.h rename to bsp_q7s/core/InitMission.h diff --git a/bsp_q7s/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp similarity index 100% rename from bsp_q7s/ObjectFactory.cpp rename to bsp_q7s/core/ObjectFactory.cpp diff --git a/bsp_q7s/ObjectFactory.h b/bsp_q7s/core/ObjectFactory.h similarity index 100% rename from bsp_q7s/ObjectFactory.h rename to bsp_q7s/core/ObjectFactory.h diff --git a/bsp_q7s/core/obsw.cpp b/bsp_q7s/core/obsw.cpp new file mode 100644 index 00000000..f813bcae --- /dev/null +++ b/bsp_q7s/core/obsw.cpp @@ -0,0 +1,25 @@ +#include "obsw.h" +#include "OBSWVersion.h" +#include "InitMission.h" +#include "fsfw/tasks/TaskFactory.h" +#include + +int obsw::obsw() { + std::cout << "-- EIVE OBSW --" << std::endl; +#if TE0720 == 0 + std::cout << "-- Compiled for Linux (Xiphos Q7S) --" << std::endl; +#else + std::cout << "-- Compiled for Linux (TE0720) --" << std::endl; +#endif + std::cout << "-- Software version " << SW_NAME << " v" << SW_VERSION << "." + << SW_SUBVERSION << "." << SW_SUBSUBVERSION << " -- " << std::endl; + std::cout << "-- " << __DATE__ << " " << __TIME__ << " --" << std::endl; + + initmission::initMission(); + + for(;;) { + /* Suspend main thread by sleeping it. */ + TaskFactory::delayTask(5000); + } + return 0; +} diff --git a/bsp_q7s/core/obsw.h b/bsp_q7s/core/obsw.h new file mode 100644 index 00000000..c2d974ae --- /dev/null +++ b/bsp_q7s/core/obsw.h @@ -0,0 +1,10 @@ +#ifndef BSP_Q7S_CORE_OBSW_H_ +#define BSP_Q7S_CORE_OBSW_H_ + +namespace obsw { + +int obsw(); + +}; + +#endif /* BSP_Q7S_CORE_OBSW_H_ */ diff --git a/bsp_q7s/main.cpp b/bsp_q7s/main.cpp index 06f454c2..93968b76 100644 --- a/bsp_q7s/main.cpp +++ b/bsp_q7s/main.cpp @@ -1,11 +1,10 @@ -#include "InitMission.h" -#include -#include -#include "OBSWConfig.h" +#include "q7sConfig.h" -#include - -#include +#if Q7S_SIMPLE_MODE == 0 +#include "core/obsw.h" +#else +#include "simple/simple.h" +#endif /** * @brief This is the main program for the target hardware. @@ -13,22 +12,9 @@ */ int main(void) { - std::cout << "-- EIVE OBSW --" << std::endl; -#if TE0720 == 0 - std::cout << "-- Compiled for Linux (Xiphos Q7S) --" << std::endl; +#if Q7S_SIMPLE_MODE == 0 + return obsw::obsw(); #else - std::cout << "-- Compiled for Linux (TE0720) --" << std::endl; + return simple::simple(); #endif - std::cout << "-- Software version " << SW_NAME << " v" << SW_VERSION << "." - << SW_SUBVERSION << "." << SW_SUBSUBVERSION << " -- " << std::endl; - std::cout << "-- " << __DATE__ << " " << __TIME__ << " --" << std::endl; - - initmission::initMission(); - - for(;;) { - /* Suspend main thread by sleeping it. */ - TaskFactory::delayTask(5000); - } } - - diff --git a/bsp_q7s/simple/CMakeLists.txt b/bsp_q7s/simple/CMakeLists.txt new file mode 100644 index 00000000..399a1dd3 --- /dev/null +++ b/bsp_q7s/simple/CMakeLists.txt @@ -0,0 +1,3 @@ +target_sources(${TARGET_NAME} PRIVATE + simple.cpp +) diff --git a/bsp_q7s/simple/simple.cpp b/bsp_q7s/simple/simple.cpp new file mode 100644 index 00000000..6261bfe3 --- /dev/null +++ b/bsp_q7s/simple/simple.cpp @@ -0,0 +1,5 @@ +#include "simple.h" + +int simple::simple() { + return 0; +} diff --git a/bsp_q7s/simple/simple.h b/bsp_q7s/simple/simple.h new file mode 100644 index 00000000..096a7b7c --- /dev/null +++ b/bsp_q7s/simple/simple.h @@ -0,0 +1,10 @@ +#ifndef BSP_Q7S_SIMPLE_SIMPLE_H_ +#define BSP_Q7S_SIMPLE_SIMPLE_H_ + +namespace simple { + +int simple(); + +} + +#endif /* BSP_Q7S_SIMPLE_SIMPLE_H_ */ diff --git a/cmake/scripts/Linux/create_cmake_debug_cfg.sh b/cmake/scripts/Linux/create_cmake_debug_cfg.sh index 1207884e..8c626bf4 100755 --- a/cmake/scripts/Linux/create_cmake_debug_cfg.sh +++ b/cmake/scripts/Linux/create_cmake_debug_cfg.sh @@ -17,9 +17,15 @@ fi build_generator="Unix Makefiles" os_fsfw="linux" builddir="build-Debug-Host" +if [ "${OS}" = "Windows_NT" ]; then + python="py" +# Could be other OS but this works for now. +else + python="python3" +fi echo "Running command (without the leading +):" set -x # Print command -python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "debug" -l "${builddir}" +${python} cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "debug" -l "${builddir}" # Use this if commands are added which should not be printed # set +x diff --git a/cmake/scripts/Linux/create_cmake_release_cfg.sh b/cmake/scripts/Linux/create_cmake_release_cfg.sh index 4412e671..95d87e70 100755 --- a/cmake/scripts/Linux/create_cmake_release_cfg.sh +++ b/cmake/scripts/Linux/create_cmake_release_cfg.sh @@ -17,9 +17,15 @@ fi build_generator="Unix Makefiles" os_fsfw="linux" builddir="build-Release-Host" +if [ "${OS}" = "Windows_NT" ]; then + python="py" +# Could be other OS but this works for now. +else + python="python3" +fi echo "Running command (without the leading +):" set -x # Print command -python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "debug" -l "${builddir}" +${python} cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "release" -l "${builddir}" # Use this if commands are added which should not be printed # set +x diff --git a/cmake/scripts/Q7S/make_debug_cfg.sh b/cmake/scripts/Q7S/make_debug_cfg.sh index 4875c59a..4613d36a 100755 --- a/cmake/scripts/Q7S/make_debug_cfg.sh +++ b/cmake/scripts/Q7S/make_debug_cfg.sh @@ -20,10 +20,16 @@ build_dir="build-Debug-Q7S" build_generator="" if [ "${OS}" = "Windows_NT" ]; then build_generator="MinGW Makefiles" + python="py" # Could be other OS but this works for now. else build_generator="Unix Makefiles" + python="python3" fi -python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" \ +echo "Running command (without the leading +):" +set -x # Print command +${python} cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" \ -l"${build_dir}" +# set +x + diff --git a/cmake/scripts/Q7S/make_release_cfg.sh b/cmake/scripts/Q7S/make_release_cfg.sh index 0e2c543c..9d7992f3 100755 --- a/cmake/scripts/Q7S/make_release_cfg.sh +++ b/cmake/scripts/Q7S/make_release_cfg.sh @@ -16,14 +16,19 @@ fi os_fsfw="linux" tgt_bsp="arm/q7s" -build_dir="build-Release-Q7S" +build_dir="build-Debug-Q7S" build_generator="" if [ "${OS}" = "Windows_NT" ]; then build_generator="MinGW Makefiles" + python="py" # Could be other OS but this works for now. else build_generator="Unix Makefiles" + python="python3" fi -python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "release" -t "${tgt_bsp}" \ - -l"${build_dir}" +echo "Running command (without the leading +):" +set -x # Print command +${python} cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" \ + -l"${build_dir}" +# set +x diff --git a/cmake/scripts/Q7S/ninja_debug_cfg.sh b/cmake/scripts/Q7S/ninja_debug_cfg.sh index 3a8ac631..2d3b333f 100755 --- a/cmake/scripts/Q7S/ninja_debug_cfg.sh +++ b/cmake/scripts/Q7S/ninja_debug_cfg.sh @@ -18,6 +18,16 @@ os_fsfw="linux" tgt_bsp="arm/q7s" build_dir="build-Debug-Q7S" build_generator="Ninja" +if [ "${OS}" = "Windows_NT" ]; then + python="py" +# Could be other OS but this works for now. +else + python="python3" +fi -python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" \ +echo "Running command (without the leading +):" +set -x # Print command +${python} cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" \ -l"${build_dir}" +# set +x + diff --git a/cmake/scripts/Q7S/make_reldeb_cfg.sh b/cmake/scripts/Q7S/simple/simple_make_debug_cfg.sh similarity index 59% rename from cmake/scripts/Q7S/make_reldeb_cfg.sh rename to cmake/scripts/Q7S/simple/simple_make_debug_cfg.sh index 121f2d7e..b692184a 100755 --- a/cmake/scripts/Q7S/make_reldeb_cfg.sh +++ b/cmake/scripts/Q7S/simple/simple_make_debug_cfg.sh @@ -16,14 +16,20 @@ fi os_fsfw="linux" tgt_bsp="arm/q7s" -build_dir="build-Release-Q7S" +build_dir="build-Simple-Q7S" build_generator="" +definitions="Q7S_SIMPLE_MODE=On" if [ "${OS}" = "Windows_NT" ]; then build_generator="MinGW Makefiles" + python="py" # Could be other OS but this works for now. else build_generator="Unix Makefiles" + python="python3" fi -python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "reldeb" -t "${tgt_bsp}" \ - -l"${build_dir}" +echo "Running command (without the leading +):" +set -x # Print command +${python} cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" \ + -l"${build_dir}" -d "${definitions}" +# set +x diff --git a/cmake/scripts/Q7S/simple/simple_ninja_debug_cfg.sh b/cmake/scripts/Q7S/simple/simple_ninja_debug_cfg.sh new file mode 100755 index 00000000..a3a55521 --- /dev/null +++ b/cmake/scripts/Q7S/simple/simple_ninja_debug_cfg.sh @@ -0,0 +1,34 @@ +#!/bin/sh +counter=0 +while [ ${counter} -lt 5 ] +do + cd .. + if [ -f "cmake_build_config.py" ];then + break + fi + counter=$((counter=counter + 1)) +done + +if [ "${counter}" -ge 5 ];then + echo "cmake_build_config.py not found in upper directories!" + exit 1 +fi + +os_fsfw="linux" +tgt_bsp="arm/q7s" +build_dir="build-Simple-Q7S" +build_generator="Ninja" +definitions="Q7S_SIMPLE_MODE=On" +if [ "${OS}" = "Windows_NT" ]; then + python="py" +# Could be other OS but this works for now. +else + python="python3" +fi + +echo "Running command (without the leading +):" +set -x # Print command +${python} cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" \ + -l"${build_dir}" -d "${definitions}" +# set +x + diff --git a/cmake/scripts/RPi/make_debug_cfg.sh b/cmake/scripts/RPi/make_debug_cfg.sh index 57561846..dbb178de 100755 --- a/cmake/scripts/RPi/make_debug_cfg.sh +++ b/cmake/scripts/RPi/make_debug_cfg.sh @@ -20,10 +20,16 @@ build_generator="" build_dir="build-Debug-RPi" if [ "${OS}" = "Windows_NT" ]; then build_generator="MinGW Makefiles" + python="py" # Could be other OS but this works for now. else build_generator="Unix Makefiles" + python="python3" fi -python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" \ - -l"${build_dir}" +echo "Running command (without the leading +):" +set -x # Print command +${python} cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" \ + -l"${build_dir}" +# set +x + diff --git a/cmake/scripts/RPi/make_reldeb_cfg.sh b/cmake/scripts/RPi/make_reldeb_cfg.sh deleted file mode 100755 index de7651a7..00000000 --- a/cmake/scripts/RPi/make_reldeb_cfg.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -counter=0 -while [ ${counter} -lt 5 ] -do - cd .. - if [ -f "cmake_build_config.py" ];then - break - fi - counter=$((counter=counter + 1)) -done - -if [ "${counter}" -ge 5 ];then - echo "cmake_build_config.py not found in upper directories!" - exit 1 -fi - -os_fsfw="linux" -tgt_bsp="arm/raspberrypi" -build_generator="" -build_dir="RelWithDeb-RPi" -if [ "${OS}" = "Windows_NT" ]; then - build_generator="MinGW Makefiles" -# Could be other OS but this works for now. -else - build_generator="Unix Makefiles" -fi - -python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "reldeb" -t "${tgt_bsp}" \ - -l"${build_dir}" diff --git a/cmake/scripts/RPi/ninja_debug_cfg.sh b/cmake/scripts/RPi/ninja_debug_cfg.sh index c05ae446..3fa0e5f4 100755 --- a/cmake/scripts/RPi/ninja_debug_cfg.sh +++ b/cmake/scripts/RPi/ninja_debug_cfg.sh @@ -18,6 +18,16 @@ os_fsfw="linux" tgt_bsp="arm/raspberrypi" build_generator="Ninja" build_dir="build-Debug-RPi" +if [ "${OS}" = "Windows_NT" ]; then + python="py" +# Could be other OS but this works for now. +else + python="python3" +fi + +echo "Running command (without the leading +):" +set -x # Print command +${python} cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" \ + -l"${build_dir}" +# set +x -python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" \ - -l"${build_dir}" diff --git a/fsfw_hal b/fsfw_hal index 2533af3b..0f0fc0c2 160000 --- a/fsfw_hal +++ b/fsfw_hal @@ -1 +1 @@ -Subproject commit 2533af3b53804bc68436236370911e013a2b8f64 +Subproject commit 0f0fc0c2a69494de78856d956b679d9ee6ec339f diff --git a/misc/eclipse/.cproject b/misc/eclipse/.cproject index 22a4a09c..a562e7b2 100644 --- a/misc/eclipse/.cproject +++ b/misc/eclipse/.cproject @@ -234,7 +234,7 @@ - + @@ -250,7 +250,7 @@ - + - + @@ -405,7 +405,7 @@ - + - + @@ -562,7 +562,7 @@ - + - + @@ -720,7 +720,7 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -869,6 +1028,9 @@ + + + @@ -876,9 +1038,9 @@ - - + + diff --git a/tmtc b/tmtc index 2a986248..9d98eb6b 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 2a9862489d57e2ccbf8b9ca5017f5e89395acddf +Subproject commit 9d98eb6b606b40fa26aad12786894d1a99cb726c