From 0063ce0ccd400854a0b4e0fc2aa9f379c2ab6d9d Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 14 Mar 2022 17:52:31 +0100 Subject: [PATCH 1/3] update FSFW and related version handling --- bsp_q7s/core/CoreController.cpp | 17 +++++++++-------- bsp_q7s/core/CoreController.h | 2 +- bsp_q7s/core/CoreDefinitions.h | 13 ++++--------- bsp_q7s/core/ObjectFactory.h | 7 ++++--- fsfw | 2 +- 5 files changed, 19 insertions(+), 22 deletions(-) diff --git a/bsp_q7s/core/CoreController.cpp b/bsp_q7s/core/CoreController.cpp index 805f932f..b0b7213c 100644 --- a/bsp_q7s/core/CoreController.cpp +++ b/bsp_q7s/core/CoreController.cpp @@ -4,9 +4,9 @@ #include "OBSWConfig.h" #include "OBSWVersion.h" -#include "fsfw/FSFWVersion.h" #include "fsfw/serviceinterface/ServiceInterface.h" #include "fsfw/timemanager/Stopwatch.h" +#include "fsfw/version.h" #include "watchdogConf.h" #if OBSW_USE_TMTC_TCP_BRIDGE == 0 #include "fsfw/osal/common/UdpTmTcBridge.h" @@ -72,10 +72,10 @@ ReturnValue_t CoreController::initializeLocalDataPool(localpool::DataPool &local } LocalPoolDataSetBase *CoreController::getDataSetHandle(sid_t sid) { - if (sid.ownerSetId == core::HK_SET_ID) { - return &hkSet; - } - return nullptr; + if (sid.ownerSetId == core::HK_SET_ID) { + return &hkSet; + } + return nullptr; } ReturnValue_t CoreController::initialize() { @@ -618,6 +618,7 @@ ReturnValue_t CoreController::incrementAllocationFailureCount() { } ReturnValue_t CoreController::initVersionFile() { + using namespace fsfw; std::string unameFileName = "/tmp/uname_version.txt"; // TODO: No -v flag for now. If the kernel version is used, need to cut off first few letters std::string unameCmd = "uname -mnrso > " + unameFileName; @@ -634,9 +635,9 @@ ReturnValue_t CoreController::initVersionFile() { std::string fullObswVersionString = "OBSW: v" + std::to_string(SW_VERSION) + "." + std::to_string(SW_SUBVERSION) + "." + std::to_string(SW_REVISION); - std::string fullFsfwVersionString = "FSFW: v" + std::to_string(FSFW_VERSION) + "." + - std::to_string(FSFW_SUBVERSION) + "." + - std::to_string(FSFW_REVISION); + char versionString[16] = {}; + fsfw::FSFW_VERSION.getVersion(versionString, sizeof(versionString)); + std::string fullFsfwVersionString = "FSFW: v" + std::string(versionString); std::string systemString = "System: " + unameLine; std::string mountPrefix = SdCardManager::instance()->getCurrentMountPrefix(); std::string versionFilePath = mountPrefix + VERSION_FILE; diff --git a/bsp_q7s/core/CoreController.h b/bsp_q7s/core/CoreController.h index e890ae51..e31378ef 100644 --- a/bsp_q7s/core/CoreController.h +++ b/bsp_q7s/core/CoreController.h @@ -6,10 +6,10 @@ #include +#include "CoreDefinitions.h" #include "bsp_q7s/memory/SdCardManager.h" #include "events/subsystemIdRanges.h" #include "fsfw/controller/ExtendedControllerBase.h" -#include "CoreDefinitions.h" class Timer; class SdCardManager; diff --git a/bsp_q7s/core/CoreDefinitions.h b/bsp_q7s/core/CoreDefinitions.h index 6439af71..91896301 100644 --- a/bsp_q7s/core/CoreDefinitions.h +++ b/bsp_q7s/core/CoreDefinitions.h @@ -8,18 +8,13 @@ namespace core { static const uint8_t HK_SET_ENTRIES = 3; static const uint32_t HK_SET_ID = 5; -enum PoolIds { - TEMPERATURE, - PS_VOLTAGE, - PL_VOLTAGE -}; +enum PoolIds { TEMPERATURE, PS_VOLTAGE, PL_VOLTAGE }; /** * @brief Set storing OBC internal housekeeping data */ class HkSet : public StaticLocalDataSet { public: - HkSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, HK_SET_ID) {} HkSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, HK_SET_ID)) {} @@ -32,13 +27,13 @@ class HkSet : public StaticLocalDataSet { lp_var_t plVoltage = lp_var_t(sid.objectId, PoolIds::PL_VOLTAGE, this); void printSet() { - sif::info << "HkSet::printSet: On-chip temperature: " << this->temperature - << " °C" << std::endl; + sif::info << "HkSet::printSet: On-chip temperature: " << this->temperature << " °C" + << std::endl; sif::info << "HkSet::printSet: PS voltage: " << this->psVoltage << " mV" << std::endl; sif::info << "HkSet::printSet: PL voltage: " << this->plVoltage << " mV" << std::endl; } }; -} +} // namespace core #endif /* BSP_Q7S_CORE_COREDEFINITIONS_H_ */ diff --git a/bsp_q7s/core/ObjectFactory.h b/bsp_q7s/core/ObjectFactory.h index ecc92f01..d680a7c9 100644 --- a/bsp_q7s/core/ObjectFactory.h +++ b/bsp_q7s/core/ObjectFactory.h @@ -5,6 +5,7 @@ class LinuxLibgpioIF; class UartComIF; class SpiComIF; class I2cComIF; +class PowerSwitchIF; namespace ObjectFactory { @@ -13,13 +14,13 @@ void produce(void* args); void createCommunicationInterfaces(LinuxLibgpioIF** gpioComIF, UartComIF** uartComIF, SpiComIF** spiComIF, I2cComIF** i2cComIF); - +void createPcduComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchIF** pwrSwitcher); void createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF); void createTmpComponents(); -void createPcduComponents(LinuxLibgpioIF* gpioComIF); void createRadSensorComponent(LinuxLibgpioIF* gpioComIF); void createSunSensorComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF); -void createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComIF* uartComIF); +void createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComIF* uartComIF, + PowerSwitchIF* pwrSwitcher); void createHeaterComponents(); void createSolarArrayDeploymentComponents(); void createSyrlinksComponents(); diff --git a/fsfw b/fsfw index 47d15815..5ca5fe40 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 47d158156b9efa0edbca9b3a1694f4132b0b30e5 +Subproject commit 5ca5fe4040189ff8bc6553a9febdb6ffdeb73fe3 From 197d1a4ce06070d613163c33f9d2c7fb8c08ffbf Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 14 Mar 2022 17:53:48 +0100 Subject: [PATCH 2/3] update obsw.cpp file --- bsp_q7s/core/obsw.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bsp_q7s/core/obsw.cpp b/bsp_q7s/core/obsw.cpp index 04163a82..197ca66b 100644 --- a/bsp_q7s/core/obsw.cpp +++ b/bsp_q7s/core/obsw.cpp @@ -6,13 +6,14 @@ #include "InitMission.h" #include "OBSWConfig.h" #include "OBSWVersion.h" -#include "fsfw/FSFWVersion.h" #include "fsfw/tasks/TaskFactory.h" +#include "fsfw/version.h" #include "watchdogConf.h" static int OBSW_ALREADY_RUNNING = -2; int obsw::obsw() { + using namespace fsfw; std::cout << "-- EIVE OBSW --" << std::endl; #if BOARD_TE0720 == 0 std::cout << "-- Compiled for Linux (Xiphos Q7S) --" << std::endl; @@ -20,7 +21,7 @@ int obsw::obsw() { std::cout << "-- Compiled for Linux (TE0720) --" << std::endl; #endif std::cout << "-- OBSW v" << SW_VERSION << "." << SW_SUBVERSION << "." << SW_REVISION << ", FSFW v" - << FSFW_VERSION << "." << FSFW_SUBVERSION << "." << FSFW_REVISION << "--" << std::endl; + << FSFW_VERSION << "--" << std::endl; std::cout << "-- " << __DATE__ << " " << __TIME__ << " --" << std::endl; #if Q7S_CHECK_FOR_ALREADY_RUNNING_IMG == 1 From 08a110100015c8bef350b7972133be20d013e6ad Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 14 Mar 2022 17:55:02 +0100 Subject: [PATCH 3/3] use develop Object Factory --- bsp_q7s/core/ObjectFactory.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bsp_q7s/core/ObjectFactory.h b/bsp_q7s/core/ObjectFactory.h index d680a7c9..ecc92f01 100644 --- a/bsp_q7s/core/ObjectFactory.h +++ b/bsp_q7s/core/ObjectFactory.h @@ -5,7 +5,6 @@ class LinuxLibgpioIF; class UartComIF; class SpiComIF; class I2cComIF; -class PowerSwitchIF; namespace ObjectFactory { @@ -14,13 +13,13 @@ void produce(void* args); void createCommunicationInterfaces(LinuxLibgpioIF** gpioComIF, UartComIF** uartComIF, SpiComIF** spiComIF, I2cComIF** i2cComIF); -void createPcduComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchIF** pwrSwitcher); + void createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF); void createTmpComponents(); +void createPcduComponents(LinuxLibgpioIF* gpioComIF); void createRadSensorComponent(LinuxLibgpioIF* gpioComIF); void createSunSensorComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF); -void createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComIF* uartComIF, - PowerSwitchIF* pwrSwitcher); +void createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComIF* uartComIF); void createHeaterComponents(); void createSolarArrayDeploymentComponents(); void createSyrlinksComponents();