diff --git a/CHANGELOG.md b/CHANGELOG.md index 744082ad..fe6a7434 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,42 @@ change warranting a new major release: # [unreleased] +# [v1.27.0] 2023-02-13 + +Added EIVE system top mode component. Currently, only SAFE and IDLE mode are +implemented, and the system does not do more than commanding TCS and ACS +into the correct modes. It does not have a lot of mode tracking capabilities +yet because the ACS controller might alternate between SAFE and DETUMBLE. +It takes around 5-10 seconds for the EIVE system to reach the SAFE mode. + +The new system is used at software boot to command the satellite into safe mode +on each reboot. This behaviour can be disabled with the +`OBSW_SWITCH_TO_NORMAL_MODE_AFTER_STARTUP` flag. + +## Added + +- New EIVE system component like explained above. + +## Changed + +- The satellite now commands itself into SAFE mode on each reboot, which + triggers a lot of events on each SW reboot. The TCS subsystem will commanded + to NORMAL mode immediately while the ACS subsystem will be commanded to + SAFE mode. The payload subsystem will be commanded OFF. +- `RELEASE_BUILD` flag moved to `commonConfig.h` +- The ACS subsystem transitions are now staggered: The SUS board assembly + is commanded as a separate transition. This reduces the risk of long bus lockups. +- No INFO mode event translations for release builds to reduce number of + printouts. +- More granular locking inside the MAX31865 low level read handler. + +## Fixed + +- More DHB thermal module fixes. +- ACS PST frequency extended to 0.8 seconds in debug builds to avoid SPI + bus lockups. +- Local datapool fixes for the `PlocSupervisorHandler` + # [v1.26.4] 2023-02-10 eive-tmtc: v2.12.3 diff --git a/CMakeLists.txt b/CMakeLists.txt index e298c352..d99711b3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -307,6 +307,11 @@ endif() include(BuildType) set_build_type() +set(FSFW_DEBUG_INFO 0) +if(RELEASE_BUILD MATCHES 0) + set(FSFW_DEBUG_INFO 1) +endif() + # Configuration files configure_file(${COMMON_CONFIG_PATH}/commonConfig.h.in commonConfig.h) configure_file(${FSFW_CONFIG_PATH}/FSFWConfig.h.in FSFWConfig.h) diff --git a/bsp_q7s/core/scheduling.cpp b/bsp_q7s/core/scheduling.cpp index 713550c4..e4dcdb2d 100644 --- a/bsp_q7s/core/scheduling.cpp +++ b/bsp_q7s/core/scheduling.cpp @@ -390,7 +390,7 @@ void scheduling::createPstTasks(TaskFactory& factory, TaskDeadlineMissedFunction #ifdef RELEASE_BUILD static constexpr float acsPstPeriod = 0.4; #else - static constexpr float acsPstPeriod = 0.6; + static constexpr float acsPstPeriod = 0.8; #endif FixedTimeslotTaskIF* acsPst = factory.createFixedTimeslotTask( "ACS_PST", 85, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, acsPstPeriod, missedDeadlineFunc); diff --git a/common/config/eive/definitions.h b/common/config/eive/definitions.h index 8e0ac7b7..c572e21a 100644 --- a/common/config/eive/definitions.h +++ b/common/config/eive/definitions.h @@ -53,7 +53,7 @@ static constexpr uint8_t VC3_QUEUE_SIZE = 50; static constexpr uint32_t MAX_PUS_FUNNEL_QUEUE_DEPTH = 100; static constexpr uint32_t MAX_STORED_CMDS_UDP = 120; -static constexpr uint32_t MAX_STORED_CMDS_TCP = 120; +static constexpr uint32_t MAX_STORED_CMDS_TCP = 150; namespace acs { diff --git a/fsfw b/fsfw index 8b4f73a9..dac2d210 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 8b4f73a97b15f27e314932538d468707c57f965a +Subproject commit dac2d210b597adfaf45bd5ae6a4c027599927601 diff --git a/linux/fsfwconfig/FSFWConfig.h.in b/linux/fsfwconfig/FSFWConfig.h.in index 25772ce7..387ef724 100644 --- a/linux/fsfwconfig/FSFWConfig.h.in +++ b/linux/fsfwconfig/FSFWConfig.h.in @@ -34,7 +34,7 @@ #if FSFW_OBJ_EVENT_TRANSLATION == 1 //! Specify whether info events are printed too. -#define FSFW_DEBUG_INFO 1 +#define FSFW_DEBUG_INFO @FSFW_DEBUG_INFO@ #include "objects/translateObjects.h" #include "events/translateEvents.h" #else diff --git a/mission/CMakeLists.txt b/mission/CMakeLists.txt index d3782d4b..f284a675 100644 --- a/mission/CMakeLists.txt +++ b/mission/CMakeLists.txt @@ -8,3 +8,5 @@ add_subdirectory(system) add_subdirectory(csp) add_subdirectory(cfdp) add_subdirectory(config) + +target_sources(${LIB_EIVE_MISSION} PRIVATE acsDefs.cpp) diff --git a/mission/acsDefs.cpp b/mission/acsDefs.cpp new file mode 100644 index 00000000..00686b15 --- /dev/null +++ b/mission/acsDefs.cpp @@ -0,0 +1,40 @@ +#include "acsDefs.h" + +const char* acs::getModeStr(AcsMode mode) { + static const char* modeStr = "UNKNOWN"; + switch (mode) { + case (acs::AcsMode::OFF): { + modeStr = "OFF"; + break; + } + case (acs::AcsMode::SAFE): { + modeStr = "SAFE"; + break; + } + case (acs::AcsMode::DETUMBLE): { + modeStr = "DETUBMLE"; + break; + } + case (acs::AcsMode::PTG_NADIR): { + modeStr = "POITNING NADIR"; + break; + } + case (acs::AcsMode::PTG_IDLE): { + modeStr = "POINTING IDLE"; + break; + } + case (acs::AcsMode::PTG_INERTIAL): { + modeStr = "POINTING INERTIAL"; + break; + } + case (acs::AcsMode::PTG_TARGET): { + modeStr = "POINTING TARGET"; + break; + } + case (acs::AcsMode::PTG_TARGET_GS): { + modeStr = "POINTING TARGET GS"; + break; + } + } + return modeStr; +} diff --git a/mission/acsDefs.h b/mission/acsDefs.h index ac093f6f..57ae4730 100644 --- a/mission/acsDefs.h +++ b/mission/acsDefs.h @@ -7,7 +7,7 @@ namespace acs { // These modes are the submodes of the ACS controller and the modes of the ACS subsystem. -enum AcsMode { +enum AcsMode : Mode_t { OFF = HasModesIF::MODE_OFF, SAFE = 10, DETUMBLE = 11, @@ -24,6 +24,8 @@ static const Event SAFE_RATE_VIOLATION = MAKE_EVENT(0, severity::MEDIUM); //!< The system has recovered from a safe rate rotation violation. static constexpr Event SAFE_RATE_RECOVERY = MAKE_EVENT(1, severity::MEDIUM); +extern const char* getModeStr(AcsMode mode); + } // namespace acs #endif /* MISSION_ACSDEFS_H_ */ diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index 1b4f54a9..b4f015b2 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -566,9 +566,15 @@ ReturnValue_t AcsController::checkModeCommand(Mode_t mode, Submode_t submode, return INVALID_MODE; } -void AcsController::modeChanged(Mode_t mode, Submode_t submode) {} +void AcsController::modeChanged(Mode_t mode, Submode_t submode) { + return ExtendedControllerBase::modeChanged(mode, submode); +} -void AcsController::announceMode(bool recursive) {} +void AcsController::announceMode(bool recursive) { + const char *modeStr = acs::getModeStr(static_cast(mode)); + sif::info << "ACS controller is now in " << modeStr << " mode" << std::endl; + return ExtendedControllerBase::announceMode(recursive); +} void AcsController::copyMgmData() { ACS::SensorValues sensorValues; diff --git a/mission/core/GenericFactory.cpp b/mission/core/GenericFactory.cpp index b833b5db..8c05ed4f 100644 --- a/mission/core/GenericFactory.cpp +++ b/mission/core/GenericFactory.cpp @@ -94,7 +94,7 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_, PusTmFun } { - PoolManager::LocalPoolConfig poolCfg = {{400, 32}, {350, 64}, {200, 128}, + PoolManager::LocalPoolConfig poolCfg = {{400, 32}, {400, 64}, {250, 128}, {150, 512}, {150, 1024}, {150, 2048}}; tmStore = new PoolManager(objects::TM_STORE, poolCfg); } diff --git a/mission/system/objects/AcsSubsystem.cpp b/mission/system/objects/AcsSubsystem.cpp index dcf4e67b..b4ee3d52 100644 --- a/mission/system/objects/AcsSubsystem.cpp +++ b/mission/system/objects/AcsSubsystem.cpp @@ -81,3 +81,9 @@ void AcsSubsystem::handleEventMessages() { } } } + +void AcsSubsystem::announceMode(bool recursive) { + const char* modeStr = acs::getModeStr(static_cast(mode)); + sif::info << "ACS subsystem is now in " << modeStr << " mode" << std::endl; + return Subsystem::announceMode(recursive); +} diff --git a/mission/system/objects/AcsSubsystem.h b/mission/system/objects/AcsSubsystem.h index df5bbbf3..c6c77fef 100644 --- a/mission/system/objects/AcsSubsystem.h +++ b/mission/system/objects/AcsSubsystem.h @@ -10,6 +10,7 @@ class AcsSubsystem : public Subsystem { private: ReturnValue_t initialize() override; void performChildOperation() override; + void announceMode(bool recursive) override; void handleEventMessages(); diff --git a/mission/system/objects/CMakeLists.txt b/mission/system/objects/CMakeLists.txt index 75526486..0290a311 100644 --- a/mission/system/objects/CMakeLists.txt +++ b/mission/system/objects/CMakeLists.txt @@ -4,6 +4,7 @@ target_sources( CamSwitcher.cpp AcsSubsystem.cpp ComSubsystem.cpp + TcsSubsystem.cpp PayloadSubsystem.cpp AcsBoardAssembly.cpp Stack5VHandler.cpp diff --git a/mission/system/objects/EiveSystem.cpp b/mission/system/objects/EiveSystem.cpp index a870214d..26707bf1 100644 --- a/mission/system/objects/EiveSystem.cpp +++ b/mission/system/objects/EiveSystem.cpp @@ -1,5 +1,43 @@ #include "EiveSystem.h" +#include + EiveSystem::EiveSystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables) : Subsystem(setObjectId, maxNumberOfSequences, maxNumberOfTables) {} + +void EiveSystem::announceMode(bool recursive) { + const char* modeStr = "UNKNOWN"; + switch (mode) { + case (acs::AcsMode::OFF): { + modeStr = "OFF"; + break; + } + case (acs::AcsMode::SAFE): { + modeStr = "SAFE"; + break; + } + case (acs::AcsMode::DETUMBLE): { + modeStr = "DETUBMLE"; + break; + } + case (acs::AcsMode::PTG_IDLE): { + modeStr = "POINTING IDLE"; + break; + } + case (acs::AcsMode::PTG_INERTIAL): { + modeStr = "POINTING INERTIAL"; + break; + } + case (acs::AcsMode::PTG_TARGET): { + modeStr = "POINTING TARGET"; + break; + } + case (acs::AcsMode::PTG_TARGET_GS): { + modeStr = "POINTING TARGET GS"; + break; + } + } + sif::info << "EIVE system is now in " << modeStr << " mode" << std::endl; + return Subsystem::announceMode(recursive); +} diff --git a/mission/system/objects/EiveSystem.h b/mission/system/objects/EiveSystem.h index e88d2402..59acf82e 100644 --- a/mission/system/objects/EiveSystem.h +++ b/mission/system/objects/EiveSystem.h @@ -8,6 +8,7 @@ class EiveSystem : public Subsystem { EiveSystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables); private: + void announceMode(bool recursive) override; }; #endif /* MISSION_SYSTEM_EIVESYSTEM_H_ */ diff --git a/mission/system/objects/TcsSubsystem.cpp b/mission/system/objects/TcsSubsystem.cpp new file mode 100644 index 00000000..85cf644d --- /dev/null +++ b/mission/system/objects/TcsSubsystem.cpp @@ -0,0 +1,27 @@ +#include "TcsSubsystem.h" + +#include "fsfw/devicehandlers/DeviceHandlerIF.h" + +TcsSubsystem::TcsSubsystem(object_id_t objectId, uint32_t maxNumberOfSequences, + uint32_t maxNumberOfTables) + : Subsystem(objectId, maxNumberOfSequences, maxNumberOfTables) {} + +void TcsSubsystem::announceMode(bool recursive) { + const char* modeStr = "UNKNOWN"; + switch (mode) { + case (HasModesIF::MODE_OFF): { + modeStr = "OFF"; + break; + } + case (HasModesIF::MODE_ON): { + modeStr = "ON"; + break; + } + case (DeviceHandlerIF::MODE_NORMAL): { + modeStr = "NORMAL"; + break; + } + } + sif::info << "TCS subsystem is now in " << modeStr << " mode" << std::endl; + return Subsystem::announceMode(recursive); +} diff --git a/mission/system/objects/TcsSubsystem.h b/mission/system/objects/TcsSubsystem.h new file mode 100644 index 00000000..4218f9b2 --- /dev/null +++ b/mission/system/objects/TcsSubsystem.h @@ -0,0 +1,13 @@ +#ifndef MISSION_SYSTEM_OBJECTS_TCSSUBSYSTEM_H_ +#define MISSION_SYSTEM_OBJECTS_TCSSUBSYSTEM_H_ +#include + +class TcsSubsystem : public Subsystem { + public: + TcsSubsystem(object_id_t objectId, uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables); + + private: + void announceMode(bool recursive) override; +}; + +#endif /* MISSION_SYSTEM_OBJECTS_TCSSUBSYSTEM_H_ */ diff --git a/mission/system/tree/system.cpp b/mission/system/tree/system.cpp index 3ea56639..69345bf3 100644 --- a/mission/system/tree/system.cpp +++ b/mission/system/tree/system.cpp @@ -76,7 +76,9 @@ void buildSafeSequence(Subsystem& ss, ModeListEntry& eh) { check(sequence.insert(eh), ctxc); }; - iht(objects::ACS_SUBSYSTEM, acs::AcsMode::SAFE, 0, EIVE_TABLE_SAFE_TGT.second); + // Do no track ACS for now because it might jump to detumble mode and back to safe as part of + // normal operations. + // iht(objects::ACS_SUBSYSTEM, acs::AcsMode::SAFE, 0, EIVE_TABLE_SAFE_TGT.second); iht(objects::PL_SUBSYSTEM, OFF, 0, EIVE_TABLE_SAFE_TGT.second); check(ss.addTable(TableEntry(EIVE_TABLE_SAFE_TGT.first, &EIVE_TABLE_SAFE_TGT.second)), ctxc); diff --git a/mission/system/tree/tcsModeTree.cpp b/mission/system/tree/tcsModeTree.cpp index 96b936bf..d411161a 100644 --- a/mission/system/tree/tcsModeTree.cpp +++ b/mission/system/tree/tcsModeTree.cpp @@ -5,7 +5,7 @@ #include "fsfw/subsystem/Subsystem.h" #include "mission/system/tree/util.h" -Subsystem satsystem::tcs::SUBSYSTEM(objects::TCS_SUBSYSTEM, 12, 24); +TcsSubsystem satsystem::tcs::SUBSYSTEM(objects::TCS_SUBSYSTEM, 12, 24); namespace { // Alias for checker function diff --git a/mission/system/tree/tcsModeTree.h b/mission/system/tree/tcsModeTree.h index af10e60b..ca576a6d 100644 --- a/mission/system/tree/tcsModeTree.h +++ b/mission/system/tree/tcsModeTree.h @@ -1,11 +1,12 @@ #ifndef MISSION_SYSTEM_TREE_TCSMODETREE_H_ #define MISSION_SYSTEM_TREE_TCSMODETREE_H_ -#include + +#include namespace satsystem { namespace tcs { -extern Subsystem SUBSYSTEM; +extern TcsSubsystem SUBSYSTEM; Subsystem& init(); } // namespace tcs