From 196823b2e0511a1fea1d33be2b88b89fc7d2c46e Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 13 Jun 2023 07:48:32 +0200 Subject: [PATCH] relax sus fdir --- CHANGELOG.md | 8 ++++++++ bsp_hosted/fsfwconfig/events/translateEvents.cpp | 7 +++++-- .../fsfwconfig/objects/translateObjects.cpp | 2 +- common/config/eive/eventSubsystemIds.h | 1 + generators/bsp_hosted_events.csv | 1 + generators/bsp_hosted_subsystems.csv | 1 + generators/bsp_q7s_events.csv | 1 + generators/bsp_q7s_subsystems.csv | 1 + generators/events/translateEvents.cpp | 7 +++++-- generators/objects/translateObjects.cpp | 2 +- linux/acs/SusPolling.cpp | 14 +++++--------- linux/fsfwconfig/events/translateEvents.cpp | 7 +++++-- linux/fsfwconfig/objects/translateObjects.cpp | 2 +- mission/acs/SusHandler.cpp | 15 +++++++++++++++ mission/acs/SusHandler.h | 5 ++++- mission/controller/acs/ActuatorCmd.h | 1 - tmtc | 2 +- 17 files changed, 56 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 17ac5d5d..d3828799 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,14 @@ will consitute of a breaking change warranting a new major release: # [v4.0.0] to be released +# [v3.1.0] to be released + +## Changed + +- Relaxed SUS FDIR. The devices have shown to be glitchy in orbit, but still see to deliver + sensible raw values most of the time. Some further testing is necessary, but some changes in the + code should cause the SUS devices to remain healthy for now. + # [v3.0.0] to be released ## Changed diff --git a/bsp_hosted/fsfwconfig/events/translateEvents.cpp b/bsp_hosted/fsfwconfig/events/translateEvents.cpp index 9a93fe4c..fff05cce 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 295 translations. + * @brief Auto-generated event translation file. Contains 296 translations. * @details - * Generated on: 2023-05-17 17:15:34 + * Generated on: 2023-06-13 07:42:34 */ #include "translateEvents.h" @@ -300,6 +300,7 @@ const char *DUMP_NOK_CANCELLED_STRING = "DUMP_NOK_CANCELLED"; const char *DUMP_MISC_CANCELLED_STRING = "DUMP_MISC_CANCELLED"; const char *DUMP_HK_CANCELLED_STRING = "DUMP_HK_CANCELLED"; const char *DUMP_CFDP_CANCELLED_STRING = "DUMP_CFDP_CANCELLED"; +const char *TEMPERATURE_IS_ALL_ONES_STRING = "TEMPERATURE_IS_ALL_ONES"; const char *translateEvents(Event event) { switch ((event & 0xFFFF)) { @@ -893,6 +894,8 @@ const char *translateEvents(Event event) { return DUMP_HK_CANCELLED_STRING; case (14314): return DUMP_CFDP_CANCELLED_STRING; + case (14500): + return TEMPERATURE_IS_ALL_ONES_STRING; default: return "UNKNOWN_EVENT"; } diff --git a/bsp_hosted/fsfwconfig/objects/translateObjects.cpp b/bsp_hosted/fsfwconfig/objects/translateObjects.cpp index 34edfa41..4139e392 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-05-17 17:15:34 + * Generated on: 2023-06-13 07:42:34 */ #include "translateObjects.h" diff --git a/common/config/eive/eventSubsystemIds.h b/common/config/eive/eventSubsystemIds.h index 624cd317..84ac42d5 100644 --- a/common/config/eive/eventSubsystemIds.h +++ b/common/config/eive/eventSubsystemIds.h @@ -40,6 +40,7 @@ enum : uint8_t { COM_SUBSYSTEM = 142, PERSISTENT_TM_STORE = 143, SYRLINKS_COM = 144, + SUS_HANDLER = 145, COMMON_SUBSYSTEM_ID_END }; diff --git a/generators/bsp_hosted_events.csv b/generators/bsp_hosted_events.csv index 9dc26e07..a3812490 100644 --- a/generators/bsp_hosted_events.csv +++ b/generators/bsp_hosted_events.csv @@ -294,3 +294,4 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 14312;0x37e8;DUMP_MISC_CANCELLED;LOW;P1: Number of dumped packets. P2: Total dumped bytes.;mission/persistentTmStoreDefs.h 14313;0x37e9;DUMP_HK_CANCELLED;LOW;P1: Number of dumped packets. P2: Total dumped bytes.;mission/persistentTmStoreDefs.h 14314;0x37ea;DUMP_CFDP_CANCELLED;LOW;P1: Number of dumped packets. P2: Total dumped bytes.;mission/persistentTmStoreDefs.h +14500;0x38a4;TEMPERATURE_IS_ALL_ONES;LOW;No description;mission/acs/SusHandler.h diff --git a/generators/bsp_hosted_subsystems.csv b/generators/bsp_hosted_subsystems.csv index 83d9bdbc..c9c90629 100644 --- a/generators/bsp_hosted_subsystems.csv +++ b/generators/bsp_hosted_subsystems.csv @@ -60,3 +60,4 @@ 142;COM_SUBSYSTEM 143;PERSISTENT_TM_STORE 144;SYRLINKS_COM +145;SUS_HANDLER diff --git a/generators/bsp_q7s_events.csv b/generators/bsp_q7s_events.csv index 9dc26e07..a3812490 100644 --- a/generators/bsp_q7s_events.csv +++ b/generators/bsp_q7s_events.csv @@ -294,3 +294,4 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 14312;0x37e8;DUMP_MISC_CANCELLED;LOW;P1: Number of dumped packets. P2: Total dumped bytes.;mission/persistentTmStoreDefs.h 14313;0x37e9;DUMP_HK_CANCELLED;LOW;P1: Number of dumped packets. P2: Total dumped bytes.;mission/persistentTmStoreDefs.h 14314;0x37ea;DUMP_CFDP_CANCELLED;LOW;P1: Number of dumped packets. P2: Total dumped bytes.;mission/persistentTmStoreDefs.h +14500;0x38a4;TEMPERATURE_IS_ALL_ONES;LOW;No description;mission/acs/SusHandler.h diff --git a/generators/bsp_q7s_subsystems.csv b/generators/bsp_q7s_subsystems.csv index 83d9bdbc..c9c90629 100644 --- a/generators/bsp_q7s_subsystems.csv +++ b/generators/bsp_q7s_subsystems.csv @@ -60,3 +60,4 @@ 142;COM_SUBSYSTEM 143;PERSISTENT_TM_STORE 144;SYRLINKS_COM +145;SUS_HANDLER diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index 9a93fe4c..fff05cce 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 295 translations. + * @brief Auto-generated event translation file. Contains 296 translations. * @details - * Generated on: 2023-05-17 17:15:34 + * Generated on: 2023-06-13 07:42:34 */ #include "translateEvents.h" @@ -300,6 +300,7 @@ const char *DUMP_NOK_CANCELLED_STRING = "DUMP_NOK_CANCELLED"; const char *DUMP_MISC_CANCELLED_STRING = "DUMP_MISC_CANCELLED"; const char *DUMP_HK_CANCELLED_STRING = "DUMP_HK_CANCELLED"; const char *DUMP_CFDP_CANCELLED_STRING = "DUMP_CFDP_CANCELLED"; +const char *TEMPERATURE_IS_ALL_ONES_STRING = "TEMPERATURE_IS_ALL_ONES"; const char *translateEvents(Event event) { switch ((event & 0xFFFF)) { @@ -893,6 +894,8 @@ const char *translateEvents(Event event) { return DUMP_HK_CANCELLED_STRING; case (14314): return DUMP_CFDP_CANCELLED_STRING; + case (14500): + return TEMPERATURE_IS_ALL_ONES_STRING; default: return "UNKNOWN_EVENT"; } diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index eb2125b4..edcda852 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-05-17 17:15:34 + * Generated on: 2023-06-13 07:42:34 */ #include "translateObjects.h" diff --git a/linux/acs/SusPolling.cpp b/linux/acs/SusPolling.cpp index 2ef02f43..99e4b4e0 100644 --- a/linux/acs/SusPolling.cpp +++ b/linux/acs/SusPolling.cpp @@ -172,16 +172,12 @@ ReturnValue_t SusPolling::handleSusPolling() { susDevs[idx].ownReply.tempRaw = ((rawReply[0] & 0x0f) << 8) | rawReply[1]; // Reply is all ones. Sensor is probably off or faulty when // it should not be. - if (susDevs[idx].ownReply.tempRaw == 0x0fff) { - susDevs[idx].replyResult = returnvalue::FAILED; - } else { - susDevs[idx].replyResult = returnvalue::OK; - for (unsigned chIdx = 0; chIdx < 6; chIdx++) { - susDevs[idx].ownReply.channelsRaw[chIdx] = - (rawReply[chIdx * 2 + 2] << 8) | rawReply[chIdx * 2 + 3]; - } - susDevs[idx].ownReply.dataWasSet = true; + susDevs[idx].replyResult = returnvalue::OK; + for (unsigned chIdx = 0; chIdx < 6; chIdx++) { + susDevs[idx].ownReply.channelsRaw[chIdx] = + (rawReply[chIdx * 2 + 2] << 8) | rawReply[chIdx * 2 + 3]; } + susDevs[idx].ownReply.dataWasSet = true; } } return OK; diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index 9a93fe4c..fff05cce 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 295 translations. + * @brief Auto-generated event translation file. Contains 296 translations. * @details - * Generated on: 2023-05-17 17:15:34 + * Generated on: 2023-06-13 07:42:34 */ #include "translateEvents.h" @@ -300,6 +300,7 @@ const char *DUMP_NOK_CANCELLED_STRING = "DUMP_NOK_CANCELLED"; const char *DUMP_MISC_CANCELLED_STRING = "DUMP_MISC_CANCELLED"; const char *DUMP_HK_CANCELLED_STRING = "DUMP_HK_CANCELLED"; const char *DUMP_CFDP_CANCELLED_STRING = "DUMP_CFDP_CANCELLED"; +const char *TEMPERATURE_IS_ALL_ONES_STRING = "TEMPERATURE_IS_ALL_ONES"; const char *translateEvents(Event event) { switch ((event & 0xFFFF)) { @@ -893,6 +894,8 @@ const char *translateEvents(Event event) { return DUMP_HK_CANCELLED_STRING; case (14314): return DUMP_CFDP_CANCELLED_STRING; + case (14500): + return TEMPERATURE_IS_ALL_ONES_STRING; default: return "UNKNOWN_EVENT"; } diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index eb2125b4..edcda852 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-05-17 17:15:34 + * Generated on: 2023-06-13 07:42:34 */ #include "translateObjects.h" diff --git a/mission/acs/SusHandler.cpp b/mission/acs/SusHandler.cpp index c347020f..9a3014f3 100644 --- a/mission/acs/SusHandler.cpp +++ b/mission/acs/SusHandler.cpp @@ -87,6 +87,21 @@ ReturnValue_t SusHandler::interpretDeviceReply(DeviceCommandId_t id, const uint8 commandExecuted = true; } PoolReadGuard pg(&dataset); + // In a previous stricter FDIR variant, this was considered faulty communication and was already + // handled in the communication interface. However, the SUS devices probably glitch in orbit, + // so the FDIR was relaxed. The fault case check previously used now only leads to the dataset + // being marked invalid, shifting more responsibility of determining and setting SUS devices + // faulty to the operator. + + // UPDATE: Step1: First determine how often and whether this happens at all + if (reply->tempRaw == 0xfff) { + if (faultyDataEventCd.hasTimedOut()) { + triggerEvent(TEMPERATURE_IS_ALL_ONES); + faultyDataEventCd.resetTimer(); + } + // dataset.setValidity(false, true); + // return returnvalue::OK; + } dataset.setValidity(true, true); dataset.tempC = max1227::getTemperature(reply->tempRaw); std::memcpy(dataset.channels.value, reply->channelsRaw, sizeof(reply->channelsRaw)); diff --git a/mission/acs/SusHandler.h b/mission/acs/SusHandler.h index ad7d7a17..3a699b08 100644 --- a/mission/acs/SusHandler.h +++ b/mission/acs/SusHandler.h @@ -15,7 +15,9 @@ class SusHandler : public DeviceHandlerBase { static constexpr DeviceCommandId_t REPLY = 0x77; static const uint8_t INTERFACE_ID = CLASS_ID::SUS_HANDLER; - static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::SUS_BOARD_ASS; + static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::SUS_HANDLER; + + static constexpr Event TEMPERATURE_IS_ALL_ONES = event::makeEvent(SUBSYSTEM_ID, 0, severity::LOW); SusHandler(uint32_t objectId, uint8_t susIdx, object_id_t deviceCommunication, CookieIF *comCookie); @@ -43,6 +45,7 @@ class SusHandler : public DeviceHandlerBase { LocalPoolDataSetBase *getDataSetHandle(sid_t sid) override; private: + Countdown faultyDataEventCd = Countdown(60000); susMax1227::SusDataset dataset; acs::SusRequest request{}; uint8_t susIdx; diff --git a/mission/controller/acs/ActuatorCmd.h b/mission/controller/acs/ActuatorCmd.h index 6a1b3dbb..b14a4a25 100644 --- a/mission/controller/acs/ActuatorCmd.h +++ b/mission/controller/acs/ActuatorCmd.h @@ -3,7 +3,6 @@ #include - class ActuatorCmd { public: ActuatorCmd(); diff --git a/tmtc b/tmtc index 6182369e..00205f0e 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 6182369e4f40872c5c26e59be25d5fa79339176a +Subproject commit 00205f0e759970dda3bdd06150bbe85297f9d176