diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d318d21..ff47b4df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,10 +16,18 @@ will consitute of a breaking change warranting a new major release: # [unreleased] +# [v2.0.3] 2023-04-17 + ## Fixed - Fixed shadowing within the `SafeCtrl`, which prevented actuator commands to be calculated during eclipse phase. +- EM build idle mode fixes for RW dummy. + +## Added + +- Add `MGT_OVERHEATING` event and fallback to system SAFE mode if the MGT is overheating for + whatever reason. ## Changed diff --git a/bsp_hosted/fsfwconfig/events/translateEvents.cpp b/bsp_hosted/fsfwconfig/events/translateEvents.cpp index 4c1fdb55..f7850a99 100644 --- a/bsp_hosted/fsfwconfig/events/translateEvents.cpp +++ b/bsp_hosted/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 290 translations. + * @brief Auto-generated event translation file. Contains 291 translations. * @details - * Generated on: 2023-04-14 20:23:17 + * Generated on: 2023-04-17 11:34:19 */ #include "translateEvents.h" @@ -280,6 +280,7 @@ const char *OBC_OVERHEATING_STRING = "OBC_OVERHEATING"; const char *CAMERA_OVERHEATING_STRING = "CAMERA_OVERHEATING"; const char *PCDU_SYSTEM_OVERHEATING_STRING = "PCDU_SYSTEM_OVERHEATING"; const char *HEATER_NOT_OFF_FOR_OFF_MODE_STRING = "HEATER_NOT_OFF_FOR_OFF_MODE"; +const char *MGT_OVERHEATING_STRING = "MGT_OVERHEATING"; const char *TX_TIMER_EXPIRED_STRING = "TX_TIMER_EXPIRED"; const char *BIT_LOCK_TX_ON_STRING = "BIT_LOCK_TX_ON"; const char *POSSIBLE_FILE_CORRUPTION_STRING = "POSSIBLE_FILE_CORRUPTION"; @@ -848,6 +849,8 @@ const char *translateEvents(Event event) { return PCDU_SYSTEM_OVERHEATING_STRING; case (14107): return HEATER_NOT_OFF_FOR_OFF_MODE_STRING; + case (14108): + return MGT_OVERHEATING_STRING; case (14201): return TX_TIMER_EXPIRED_STRING; case (14202): diff --git a/bsp_hosted/fsfwconfig/objects/translateObjects.cpp b/bsp_hosted/fsfwconfig/objects/translateObjects.cpp index b89eba11..16235835 100644 --- a/bsp_hosted/fsfwconfig/objects/translateObjects.cpp +++ b/bsp_hosted/fsfwconfig/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 171 translations. - * Generated on: 2023-04-14 20:23:17 + * Generated on: 2023-04-17 11:34:19 */ #include "translateObjects.h" diff --git a/dummies/RwDummy.cpp b/dummies/RwDummy.cpp index 0f97f24a..60652ef7 100644 --- a/dummies/RwDummy.cpp +++ b/dummies/RwDummy.cpp @@ -37,6 +37,9 @@ uint32_t RwDummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return ReturnValue_t RwDummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, LocalDataPoolManager &poolManager) { + localDataPoolMap.emplace(rws::RW_SPEED, &rwSpeed); + localDataPoolMap.emplace(rws::RAMP_TIME, &rampTime); + localDataPoolMap.emplace(rws::TEMPERATURE_C, new PoolEntry({0})); localDataPoolMap.emplace(rws::CURR_SPEED, new PoolEntry({0})); diff --git a/dummies/RwDummy.h b/dummies/RwDummy.h index e5738420..5673717a 100644 --- a/dummies/RwDummy.h +++ b/dummies/RwDummy.h @@ -15,6 +15,9 @@ class RwDummy : public DeviceHandlerBase { virtual ~RwDummy(); protected: + PoolEntry rwSpeed = PoolEntry({0}); + PoolEntry rampTime = PoolEntry({10}); + void doStartUp() override; void doShutDown() override; ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t *id) override; diff --git a/generators/bsp_hosted_events.csv b/generators/bsp_hosted_events.csv index 54233239..2d5f5693 100644 --- a/generators/bsp_hosted_events.csv +++ b/generators/bsp_hosted_events.csv @@ -274,6 +274,7 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 14105;0x3719;CAMERA_OVERHEATING;HIGH;No description;mission/controller/tcsDefs.h 14106;0x371a;PCDU_SYSTEM_OVERHEATING;HIGH;No description;mission/controller/tcsDefs.h 14107;0x371b;HEATER_NOT_OFF_FOR_OFF_MODE;MEDIUM;No description;mission/controller/tcsDefs.h +14108;0x371c;MGT_OVERHEATING;MEDIUM;No description;mission/controller/tcsDefs.h 14201;0x3779;TX_TIMER_EXPIRED;INFO;The transmit timer to protect the Syrlinks expired P1: The current timer value;mission/system/com/ComSubsystem.h 14202;0x377a;BIT_LOCK_TX_ON;INFO;Transmitter will be turned on due to detection of bitlock;mission/system/com/ComSubsystem.h 14300;0x37dc;POSSIBLE_FILE_CORRUPTION;LOW;P1: Result code of TM packet parser. P2: Timestamp of possibly corrupt file as a unix timestamp.;mission/persistentTmStoreDefs.h diff --git a/generators/bsp_q7s_events.csv b/generators/bsp_q7s_events.csv index 54233239..2d5f5693 100644 --- a/generators/bsp_q7s_events.csv +++ b/generators/bsp_q7s_events.csv @@ -274,6 +274,7 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 14105;0x3719;CAMERA_OVERHEATING;HIGH;No description;mission/controller/tcsDefs.h 14106;0x371a;PCDU_SYSTEM_OVERHEATING;HIGH;No description;mission/controller/tcsDefs.h 14107;0x371b;HEATER_NOT_OFF_FOR_OFF_MODE;MEDIUM;No description;mission/controller/tcsDefs.h +14108;0x371c;MGT_OVERHEATING;MEDIUM;No description;mission/controller/tcsDefs.h 14201;0x3779;TX_TIMER_EXPIRED;INFO;The transmit timer to protect the Syrlinks expired P1: The current timer value;mission/system/com/ComSubsystem.h 14202;0x377a;BIT_LOCK_TX_ON;INFO;Transmitter will be turned on due to detection of bitlock;mission/system/com/ComSubsystem.h 14300;0x37dc;POSSIBLE_FILE_CORRUPTION;LOW;P1: Result code of TM packet parser. P2: Timestamp of possibly corrupt file as a unix timestamp.;mission/persistentTmStoreDefs.h diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index 4c1fdb55..f7850a99 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 290 translations. + * @brief Auto-generated event translation file. Contains 291 translations. * @details - * Generated on: 2023-04-14 20:23:17 + * Generated on: 2023-04-17 11:34:19 */ #include "translateEvents.h" @@ -280,6 +280,7 @@ const char *OBC_OVERHEATING_STRING = "OBC_OVERHEATING"; const char *CAMERA_OVERHEATING_STRING = "CAMERA_OVERHEATING"; const char *PCDU_SYSTEM_OVERHEATING_STRING = "PCDU_SYSTEM_OVERHEATING"; const char *HEATER_NOT_OFF_FOR_OFF_MODE_STRING = "HEATER_NOT_OFF_FOR_OFF_MODE"; +const char *MGT_OVERHEATING_STRING = "MGT_OVERHEATING"; const char *TX_TIMER_EXPIRED_STRING = "TX_TIMER_EXPIRED"; const char *BIT_LOCK_TX_ON_STRING = "BIT_LOCK_TX_ON"; const char *POSSIBLE_FILE_CORRUPTION_STRING = "POSSIBLE_FILE_CORRUPTION"; @@ -848,6 +849,8 @@ const char *translateEvents(Event event) { return PCDU_SYSTEM_OVERHEATING_STRING; case (14107): return HEATER_NOT_OFF_FOR_OFF_MODE_STRING; + case (14108): + return MGT_OVERHEATING_STRING; case (14201): return TX_TIMER_EXPIRED_STRING; case (14202): diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index bb0ef28a..1c252ec5 100644 --- a/generators/objects/translateObjects.cpp +++ b/generators/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 175 translations. - * Generated on: 2023-04-14 20:23:17 + * Generated on: 2023-04-17 11:34:19 */ #include "translateObjects.h" diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index 4c1fdb55..f7850a99 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 290 translations. + * @brief Auto-generated event translation file. Contains 291 translations. * @details - * Generated on: 2023-04-14 20:23:17 + * Generated on: 2023-04-17 11:34:19 */ #include "translateEvents.h" @@ -280,6 +280,7 @@ const char *OBC_OVERHEATING_STRING = "OBC_OVERHEATING"; const char *CAMERA_OVERHEATING_STRING = "CAMERA_OVERHEATING"; const char *PCDU_SYSTEM_OVERHEATING_STRING = "PCDU_SYSTEM_OVERHEATING"; const char *HEATER_NOT_OFF_FOR_OFF_MODE_STRING = "HEATER_NOT_OFF_FOR_OFF_MODE"; +const char *MGT_OVERHEATING_STRING = "MGT_OVERHEATING"; const char *TX_TIMER_EXPIRED_STRING = "TX_TIMER_EXPIRED"; const char *BIT_LOCK_TX_ON_STRING = "BIT_LOCK_TX_ON"; const char *POSSIBLE_FILE_CORRUPTION_STRING = "POSSIBLE_FILE_CORRUPTION"; @@ -848,6 +849,8 @@ const char *translateEvents(Event event) { return PCDU_SYSTEM_OVERHEATING_STRING; case (14107): return HEATER_NOT_OFF_FOR_OFF_MODE_STRING; + case (14108): + return MGT_OVERHEATING_STRING; case (14201): return TX_TIMER_EXPIRED_STRING; case (14202): diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index bb0ef28a..1c252ec5 100644 --- a/linux/fsfwconfig/objects/translateObjects.cpp +++ b/linux/fsfwconfig/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 175 translations. - * Generated on: 2023-04-14 20:23:17 + * Generated on: 2023-04-17 11:34:19 */ #include "translateObjects.h" diff --git a/linux/ipcore/PdecHandler.cpp b/linux/ipcore/PdecHandler.cpp index 7506dd11..cc074ddd 100644 --- a/linux/ipcore/PdecHandler.cpp +++ b/linux/ipcore/PdecHandler.cpp @@ -435,8 +435,7 @@ ReturnValue_t PdecHandler::releasePdec() { } ReturnValue_t PdecHandler::pdecToReset() { - ReturnValue_t result = returnvalue::OK; - result = gpioComIF->pullLow(pdecReset); + ReturnValue_t result = gpioComIF->pullLow(pdecReset); if (result != returnvalue::OK) { sif::error << "PdecHandler::pdecToReset: Failed to pull PDEC reset line" " to low" diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index 82efb85c..d916e767 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -20,6 +20,8 @@ #define LOWER_SYRLINKS_UPPER_LIMITS 0 #define LOWER_EBAND_UPPER_LIMITS 0 #define LOWER_PLOC_UPPER_LIMITS 0 +#define LOWER_MGT_UPPER_LIMITS 0 +#define LOWER_RW_UPPER_LIMITS 0 ThermalController::ThermalController(object_id_t objectId, HeaterHandler& heater, const std::atomic_bool& tcsBoardShortUnavailable) @@ -111,7 +113,7 @@ void ThermalController::performControlOperation() { break; } - if (cycles == 50) { + if (cycles == 40) { bool changedLimits = false; #if LOWER_SYRLINKS_UPPER_LIMITS == 1 changedLimits = true; @@ -130,9 +132,21 @@ void ThermalController::performControlOperation() { hpaLimits.cutOffLimit = 0; hpaLimits.opUpperLimit = 0; hpaLimits.nopUpperLimit = 0; +#endif +#if LOWER_MGT_UPPER_LIMITS == 1 + changedLimits = true; + mgtLimits.cutOffLimit = 0; + mgtLimits.opUpperLimit = 0; + mgtLimits.nopUpperLimit = 0; +#endif +#if LOWER_RW_UPPER_LIMITS == 1 + changedLimits = true; + rwLimits.cutOffLimit = 0; + rwLimits.opUpperLimit = 0; + rwLimits.nopUpperLimit = 0; #endif if (changedLimits) { - sif::debug << "ThermalController: changing limits" << std::endl; // TODO: rausschmeissen + sif::debug << "ThermalController: changing limits" << std::endl; } } @@ -1055,7 +1069,12 @@ void ThermalController::ctrlMgt() { numSensors = 3; HeaterContext htrCtx(heater::HEATER_2_ACS_BRD, heater::HEATER_3_PCDU_PDU, mgtLimits); ctrlComponentTemperature(htrCtx); - // TODO: trigger special event + if (componentAboveUpperLimit and not mgtTooHotFlag) { + triggerEvent(tcsCtrl::MGT_OVERHEATING, tempFloatToU32()); + mgtTooHotFlag = true; + } else if (not componentAboveUpperLimit) { + mgtTooHotFlag = false; + } } void ThermalController::ctrlRw() { diff --git a/mission/controller/ThermalController.h b/mission/controller/ThermalController.h index 7aa05b1e..4eb41c67 100644 --- a/mission/controller/ThermalController.h +++ b/mission/controller/ThermalController.h @@ -267,6 +267,7 @@ class ThermalController : public ExtendedControllerBase { bool pcduSystemTooHotFlag = false; bool syrlinksTooHotFlag = false; bool obcTooHotFlag = false; + bool mgtTooHotFlag = false; bool strTooHotFlag = false; bool rwTooHotFlag = false; diff --git a/mission/controller/tcsDefs.h b/mission/controller/tcsDefs.h index 03aa8ffe..bef79f1e 100644 --- a/mission/controller/tcsDefs.h +++ b/mission/controller/tcsDefs.h @@ -17,6 +17,7 @@ static constexpr Event OBC_OVERHEATING = MAKE_EVENT(4, severity::HIGH); static constexpr Event CAMERA_OVERHEATING = MAKE_EVENT(5, severity::HIGH); static constexpr Event PCDU_SYSTEM_OVERHEATING = MAKE_EVENT(6, severity::HIGH); static constexpr Event HEATER_NOT_OFF_FOR_OFF_MODE = MAKE_EVENT(7, severity::MEDIUM); +static constexpr Event MGT_OVERHEATING = MAKE_EVENT(8, severity::MEDIUM); enum SetId : uint32_t { SENSOR_TEMPERATURES = 0, diff --git a/mission/system/EiveSystem.cpp b/mission/system/EiveSystem.cpp index eb1c4101..53bf7a32 100644 --- a/mission/system/EiveSystem.cpp +++ b/mission/system/EiveSystem.cpp @@ -114,6 +114,7 @@ ReturnValue_t EiveSystem::initialize() { manager->subscribeToEvent(eventQueue->getId(), event::getEventId(tcsCtrl::PCDU_SYSTEM_OVERHEATING)); manager->subscribeToEvent(eventQueue->getId(), event::getEventId(tcsCtrl::OBC_OVERHEATING)); + manager->subscribeToEvent(eventQueue->getId(), event::getEventId(tcsCtrl::MGT_OVERHEATING)); manager->subscribeToEvent(eventQueue->getId(), event::getEventId(pdec::INVALID_TC_FRAME)); return Subsystem::initialize(); } @@ -132,6 +133,7 @@ void EiveSystem::handleEventMessages() { break; } case tcsCtrl::OBC_OVERHEATING: + case tcsCtrl::MGT_OVERHEATING: case tcsCtrl::PCDU_SYSTEM_OVERHEATING: { if (isInTransition) { performSafeRecovery = true; diff --git a/tmtc b/tmtc index 3bb0a08e..7eaf6557 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 3bb0a08e951133cc230baccf59f476169b790993 +Subproject commit 7eaf6557ebb886861c819fda0319641855bbb650