diff --git a/CMakeLists.txt b/CMakeLists.txt index d76b6a73..d16b6f63 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,30 +28,33 @@ if a different toolchain file is set externally" if(NOT FSFW_OSAL) set(FSFW_OSAL - linux - CACHE STRING "OS for the FSFW.") + linux + CACHE STRING "OS for the FSFW.") endif() if(TGT_BSP) if(TGT_BSP MATCHES "arm/q7s" - OR TGT_BSP MATCHES "arm/raspberrypi" - OR TGT_BSP MATCHES "arm/beagleboneblack") + OR TGT_BSP MATCHES "arm/raspberrypi" + OR TGT_BSP MATCHES "arm/beagleboneblack") option(LINUX_CROSS_COMPILE ON) endif() + if(TGT_BSP MATCHES "arm/raspberrypi" OR TGT_BSP MATCHES "arm/beagleboneblack") option(EIVE_BUILD_GPSD_GPS_HANDLER "Build GPSD dependent GPS Handler" OFF) elseif(TGT_BSP MATCHES "arm/q7s") option(EIVE_Q7S_EM "Build configuration for the EM" OFF) option(EIVE_BUILD_GPSD_GPS_HANDLER "Build GPSD dependent GPS Handler" ON) endif() + option(EIVE_CREATE_UNIQUE_OBSW_BIN "Append username to generated binary name" - ON) + ON) else() option(EIVE_CREATE_UNIQUE_OBSW_BIN "Append username to generated binary name" - OFF) + OFF) endif() list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") + # Perform steps like loading toolchain files where applicable. include(PreProjectConfig) pre_project_config() @@ -72,57 +75,58 @@ set(OBSW_MAX_SCHEDULED_TCS 500) if(EIVE_Q7S_EM) set(OBSW_Q7S_EM - 1 - CACHE STRING "Q7S EM configuration") + 1 + CACHE STRING "Q7S EM configuration") set(INIT_VAL 0) else() set(OBSW_Q7S_EM - 0 - CACHE STRING "Q7S FM configuration") + 0 + CACHE STRING "Q7S FM configuration") set(INIT_VAL 1) endif() + set(OBSW_ADD_MGT - ${INIT_VAL} - CACHE STRING "Add MGT module") + ${INIT_VAL} + CACHE STRING "Add MGT module") set(OBSW_ADD_BPX_BATTERY_HANDLER - ${INIT_VAL} - CACHE STRING "Add MGT module") + ${INIT_VAL} + CACHE STRING "Add MGT module") set(OBSW_ADD_STAR_TRACKER - ${INIT_VAL} - CACHE STRING "Add Startracker module") + ${INIT_VAL} + CACHE STRING "Add Startracker module") set(OBSW_ADD_SUN_SENSORS - ${INIT_VAL} - CACHE STRING "Add sun sensor module") + ${INIT_VAL} + CACHE STRING "Add sun sensor module") set(OBSW_ADD_SUS_BOARD_ASS - ${INIT_VAL} - CACHE STRING "Add sun sensor board assembly") + ${INIT_VAL} + CACHE STRING "Add sun sensor board assembly") set(OBSW_ADD_ACS_BOARD - ${INIT_VAL} - CACHE STRING "Add ACS board module") + ${INIT_VAL} + CACHE STRING "Add ACS board module") set(OBSW_ADD_ACS_HANDLERS - ${INIT_VAL} - CACHE STRING "Add ACS handlers") + ${INIT_VAL} + CACHE STRING "Add ACS handlers") set(OBSW_ADD_RTD_DEVICES - ${INIT_VAL} - CACHE STRING "Add RTD devices") + ${INIT_VAL} + CACHE STRING "Add RTD devices") set(OBSW_ADD_RAD_SENSORS - ${INIT_VAL} - CACHE STRING "Add Rad Sensor module") + ${INIT_VAL} + CACHE STRING "Add Rad Sensor module") set(OBSW_ADD_PL_PCDU - ${INIT_VAL} - CACHE STRING "Add Payload PCDU modukle") + ${INIT_VAL} + CACHE STRING "Add Payload PCDU modukle") set(OBSW_ADD_SYRLINKS - ${INIT_VAL} - CACHE STRING "Add Syrlinks module") + ${INIT_VAL} + CACHE STRING "Add Syrlinks module") set(OBSW_ADD_TMP_DEVICES - ${INIT_VAL} - CACHE STRING "Add TMP devices") + ${INIT_VAL} + CACHE STRING "Add TMP devices") set(OBSW_ADD_GOMSPACE_PCDU - ${INIT_VAL} - CACHE STRING "Add GomSpace PCDU modules") + ${INIT_VAL} + CACHE STRING "Add GomSpace PCDU modules") set(OBSW_ADD_RW - ${INIT_VAL} - CACHE STRING "Add RW modules") + ${INIT_VAL} + CACHE STRING "Add RW modules") # ############################################################################## # Pre-Sources preparation @@ -130,33 +134,40 @@ set(OBSW_ADD_RW # Version handling set(GIT_VER_HANDLING_OK FALSE) + if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git) determine_version_with_git("--exclude" "docker_*") set(GIT_INFO - ${GIT_INFO} - CACHE STRING "Version information retrieved with git describe") + ${GIT_INFO} + CACHE STRING "Version information retrieved with git describe") + if(GIT_INFO) set(GIT_INFO - ${GIT_INFO} - CACHE STRING "Version information retrieved with git describe") + ${GIT_INFO} + CACHE STRING "Version information retrieved with git describe") list(GET GIT_INFO 1 OBSW_VERSION_MAJOR) list(GET GIT_INFO 2 OBSW_VERSION_MINOR) list(GET GIT_INFO 3 OBSW_VERSION_REVISION) list(GET GIT_INFO 4 OBSW_VERSION_CST_GIT_SHA1) + if(NOT OBSW_VERSION_MAJOR) set(OBSW_VERSION_MAJOR ${OBSW_VERSION_MAJOR_IF_GIT_FAILS}) endif() + if(NOT OBSW_VERSION_MINOR) set(FSFW_SUBVERSION ${OBSW_VERSION_MINOR_IF_GIT_FAILS}) endif() + if(NOT OBSW_VERSION_REVISION) set(FSFW_REVISION ${OBSW_VERSION_REVISION_IF_GIT_FAILS}) endif() + set(GIT_VER_HANDLING_OK TRUE) else() set(GIT_VER_HANDLING_OK FALSE) endif() endif() + if(NOT GIT_VER_HANDLING_OK) set(OBSW_VERSION_MAJOR ${OBSW_VERSION_MAJOR_IF_GIT_FAILS}) set(OBSW_VERSION_MINOR ${OBSW_VERSION_MINOR_IF_GIT_FAILS}) @@ -164,7 +175,7 @@ if(NOT GIT_VER_HANDLING_OK) endif() # Set names and variables -set(OBSW_NAME ${CMAKE_PROJECT_NAME}) +set(OBSW_NAME ${PROJECT_NAME}) set(WATCHDOG_NAME eive-watchdog) set(SIMPLE_OBSW_NAME eive-simple) set(UNITTEST_NAME eive-unittest) @@ -186,7 +197,7 @@ set(FSFW_PATH fsfw) set(TEST_PATH test) set(UNITTEST_PATH unittest) set(LINUX_PATH linux) -set(COMMON_PATH common) +set(COMMON_PATH ${CMAKE_CURRENT_SOURCE_DIR}/common) set(DUMMY_PATH dummies) set(WATCHDOG_PATH watchdog) set(COMMON_CONFIG_PATH ${COMMON_PATH}/config) @@ -209,16 +220,19 @@ pre_source_hw_os_config() if(TGT_BSP) set(LIBGPS_VERSION_MAJOR 3) + # I assume a newer version than 3.17 will be installed on other Linux board # than the Q7S set(LIBGPS_VERSION_MINOR 20) + if(TGT_BSP MATCHES "arm/q7s" - OR TGT_BSP MATCHES "arm/raspberrypi" - OR TGT_BSP MATCHES "arm/beagleboneblack" - OR TGT_BSP MATCHES "arm/egse" - OR TGT_BSP MATCHES "arm/te0720-1cfa") + OR TGT_BSP MATCHES "arm/raspberrypi" + OR TGT_BSP MATCHES "arm/beagleboneblack" + OR TGT_BSP MATCHES "arm/egse" + OR TGT_BSP MATCHES "arm/te0720-1cfa") find_library(${LIB_GPS} gps) - set(FSFW_CONFIG_PATH "linux/fsfwconfig") + set(FSFW_CONFIG_PATH ${CMAKE_CURRENT_SOURCE_DIR}/linux/fsfwconfig) + if(NOT BUILD_Q7S_SIMPLE_MODE) set(EIVE_ADD_LINUX_FILES TRUE) set(ADD_CSP_LIB TRUE) @@ -266,6 +280,7 @@ endif() configure_file(${COMMON_CONFIG_PATH}/commonConfig.h.in commonConfig.h) configure_file(${FSFW_CONFIG_PATH}/FSFWConfig.h.in FSFWConfig.h) configure_file(${BSP_PATH}/OBSWConfig.h.in OBSWConfig.h) + if(TGT_BSP MATCHES "arm/q7s") configure_file(${BSP_PATH}/boardconfig/q7sConfig.h.in q7sConfig.h) elseif(TGT_BSP MATCHES "arm/raspberrypi" OR TGT_BSP MATCHES "arm/egse") @@ -275,8 +290,9 @@ endif() configure_file(${WATCHDOG_PATH}/watchdogConf.h.in watchdogConf.h) # Set common config path for FSFW -set(FSFW_ADDITIONAL_INC_PATHS "${COMMON_PATH}/config" - ${CMAKE_CURRENT_BINARY_DIR}) +set(FSFW_ADDITIONAL_INC_PATHS "${COMMON_PATH}" + ${COMMON_CONFIG_PATH} + ${CMAKE_CURRENT_BINARY_DIR}) # ############################################################################## # Executable and Sources @@ -304,11 +320,13 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") "-Wshift-overflow=2" # Search for bit left shift overflows (getEnumValues()) { - printf("---enum value %li: \"%s\"\n", iter, param->getEnumDescriptions()[i++]); - } -} -/*void printEnum(HousekeepingEntryIF* param) { - size_t i = 0; - for (auto iter : param->getEnumValues()) { - printf("---enum value %li: \"%s\"\n", iter, param->getEnumDescriptions()[i++]); - } -}*/ - -void printModes(HasModesIF* object) { - const ModeHelper* modeHelper = object->getModeHelper(); - - auto modes = modeHelper->getModes(); - - for (auto mode : modes) { - auto submodes = modeHelper->getSubmodes(mode.first); - if (submodes.size() == 0) { - continue; - } - printf("-mode \"%s\" (%i) with \n", mode.second, mode.first); - for (auto submode : submodes) { - printf("--submode \"%s\" (%i)\n", submode.second, submode.first); - } - } -} - -void printAction(HasActionsIF* actionIf) { - auto actionMap = actionIf->getActionHelper()->getActionMap(); - - for (auto iter = actionMap->begin(); iter != actionMap->end(); iter++) { - printf("-action \"%s\" (%i) with \n", iter->second->getName(), iter->second->getId()); - auto parameterList = iter->second->getParameters(); - for (ParameterIF* param : *parameterList) { - printf("--parameter \"%s\" %.3E, %.3E\n", param->getName(), param->getMinFloating(), - param->getMaxFloating()); - if (param->getType() == Types::ENUM) { - printEnum(param); - } - } - } -} - -/* -void printHousekeeping(HousekeepingIF* housekeepingIF) { - auto dataSets = housekeepingIF->getHousekeepingHelper()->getDataSets(); - - for (auto iter : *dataSets) { - printf("-SID \"%s\" (%i) with:\n", iter.second->getDescription(), iter.first); - for (HousekeepingEntryIF* param : *(iter.second->getVariables())) { - printf("--parameter \"%s\"\n", param->getName()); - if (param->getType() == Types::ENUM) { - printEnum(param); - } - } - } -} - -const char* getClassName(uint8_t classId) { - CLASS_ID::FwClassIds fwClassId(classId); - const char* description = fwClassId.getDescription(); - if (description != nullptr) { - return description; - } - - return "UNKNOWN"; -} - -void printReturnCodes() { - puts("\nReturnvalues"); - for (auto iter : ReturnValueItems::returnValues) { - uint8_t classId = iter.first >> 8; - printf("-\"%s:%s\" (%04x)\n", getClassName(classId), iter.second, iter.first); - } -} - -void printEvents() { - puts("\nEvents"); - for (auto iter : EventItems::events) { - uint8_t classId = iter.first >> 8; - printf("-\"%s:%s\" (%06x)\n", getClassName(classId), iter.second, iter.first); - } -}*/ - - -#endif - - - - - - - - - - - - - void initmission::initMission() { sif::info << "Building global objects.." << std::endl; try { @@ -154,50 +46,6 @@ void initmission::initMission() { std::exit(1); } - #ifdef FSFW_INTROSPECTION - sif::info << "Introspecting.." << std::endl; - ObjectManager::instance()->produce(); - auto objectList = ObjectManager::instance()->getObjectList(); - - sif::info << "Looping.." << std::endl; - for (auto iter : *objectList) { - const char * name = "UNKNOWN"; - objects::commonObjects commonObjectId(iter.first); - if (commonObjectId.isValid()){ - name = commonObjectId.getDescription(); - } - objects::systemObjects systemObject(iter.first); - if( systemObject.isValid()){ - name = systemObject.getDescription(); - } - printf("Object \"%s\" (0x%08x)\n", name, iter.first); - - - HasActionsIF* actionIf = dynamic_cast(iter.second); - if (actionIf != nullptr) { - printAction(actionIf); - } - - HasModesIF* hasmodesIF = dynamic_cast(iter.second); - if (hasmodesIF != nullptr) { - printModes(hasmodesIF); - } - - /* - - HousekeepingIF* hasHousekeeping = dynamic_cast(iter.second); - if (hasHousekeeping != nullptr) { - printHousekeeping(hasHousekeeping); - }*/ - } - - // printReturnCodes(); - - // printEvents(); - - exit(0); - #endif - sif::info << "Initializing all objects.." << std::endl; ObjectManager::instance()->initialize(); diff --git a/linux/fsfwconfig/events/subsystemIdRanges.h b/linux/fsfwconfig/events/subsystemIdRanges.h index f0a0316c..8aa48e2e 100644 --- a/linux/fsfwconfig/events/subsystemIdRanges.h +++ b/linux/fsfwconfig/events/subsystemIdRanges.h @@ -3,7 +3,7 @@ #include -#include "common/config/commonSubsystemIds.h" +#include #include "fsfw/events/fwSubsystemIdRanges.h" /** diff --git a/linux/fsfwconfig/returnvalues/classIds.h b/linux/fsfwconfig/returnvalues/classIds.h index ecfc8ca9..ab53e88c 100644 --- a/linux/fsfwconfig/returnvalues/classIds.h +++ b/linux/fsfwconfig/returnvalues/classIds.h @@ -1,7 +1,7 @@ #ifndef FSFWCONFIG_RETURNVALUES_CLASSIDS_H_ #define FSFWCONFIG_RETURNVALUES_CLASSIDS_H_ -#include +#include #include /**