From 196823b2e0511a1fea1d33be2b88b89fc7d2c46e Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 13 Jun 2023 07:48:32 +0200 Subject: [PATCH 01/18] 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 From b2b6e2e7975051b0628d2e95cfa99e08691747c0 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 13 Jun 2023 07:55:00 +0200 Subject: [PATCH 02/18] comment --- bsp_hosted/fsfwconfig/events/translateEvents.cpp | 2 +- bsp_hosted/fsfwconfig/objects/translateObjects.cpp | 2 +- generators/bsp_hosted_events.csv | 2 +- generators/bsp_q7s_events.csv | 2 +- generators/events/translateEvents.cpp | 2 +- generators/objects/translateObjects.cpp | 2 +- linux/fsfwconfig/events/translateEvents.cpp | 2 +- linux/fsfwconfig/objects/translateObjects.cpp | 2 +- mission/acs/SusHandler.cpp | 2 ++ mission/acs/SusHandler.h | 1 + tmtc | 2 +- 11 files changed, 12 insertions(+), 9 deletions(-) diff --git a/bsp_hosted/fsfwconfig/events/translateEvents.cpp b/bsp_hosted/fsfwconfig/events/translateEvents.cpp index fff05cce..79a828f2 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 296 translations. * @details - * Generated on: 2023-06-13 07:42:34 + * Generated on: 2023-06-13 07:54:32 */ #include "translateEvents.h" diff --git a/bsp_hosted/fsfwconfig/objects/translateObjects.cpp b/bsp_hosted/fsfwconfig/objects/translateObjects.cpp index 4139e392..68b13d3b 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-06-13 07:42:34 + * Generated on: 2023-06-13 07:54:32 */ #include "translateObjects.h" diff --git a/generators/bsp_hosted_events.csv b/generators/bsp_hosted_events.csv index a3812490..e6a320b8 100644 --- a/generators/bsp_hosted_events.csv +++ b/generators/bsp_hosted_events.csv @@ -294,4 +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 +14500;0x38a4;TEMPERATURE_IS_ALL_ONES;LOW;Possible indicator that the SUS device is glitchy;mission/acs/SusHandler.h diff --git a/generators/bsp_q7s_events.csv b/generators/bsp_q7s_events.csv index a3812490..e6a320b8 100644 --- a/generators/bsp_q7s_events.csv +++ b/generators/bsp_q7s_events.csv @@ -294,4 +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 +14500;0x38a4;TEMPERATURE_IS_ALL_ONES;LOW;Possible indicator that the SUS device is glitchy;mission/acs/SusHandler.h diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index fff05cce..79a828f2 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 296 translations. * @details - * Generated on: 2023-06-13 07:42:34 + * Generated on: 2023-06-13 07:54:32 */ #include "translateEvents.h" diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index edcda852..f1e7f6c6 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-06-13 07:42:34 + * Generated on: 2023-06-13 07:54:32 */ #include "translateObjects.h" diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index fff05cce..79a828f2 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 296 translations. * @details - * Generated on: 2023-06-13 07:42:34 + * Generated on: 2023-06-13 07:54:32 */ #include "translateEvents.h" diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index edcda852..f1e7f6c6 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-06-13 07:42:34 + * Generated on: 2023-06-13 07:54:32 */ #include "translateObjects.h" diff --git a/mission/acs/SusHandler.cpp b/mission/acs/SusHandler.cpp index 9a3014f3..5fbbca4f 100644 --- a/mission/acs/SusHandler.cpp +++ b/mission/acs/SusHandler.cpp @@ -95,6 +95,8 @@ ReturnValue_t SusHandler::interpretDeviceReply(DeviceCommandId_t id, const uint8 // UPDATE: Step1: First determine how often and whether this happens at all if (reply->tempRaw == 0xfff) { + // Prevent spam if a device is glitchy for prolonged periods by only triggering with a + // maximum interval. if (faultyDataEventCd.hasTimedOut()) { triggerEvent(TEMPERATURE_IS_ALL_ONES); faultyDataEventCd.resetTimer(); diff --git a/mission/acs/SusHandler.h b/mission/acs/SusHandler.h index 3a699b08..5e6a5797 100644 --- a/mission/acs/SusHandler.h +++ b/mission/acs/SusHandler.h @@ -17,6 +17,7 @@ class SusHandler : public DeviceHandlerBase { static const uint8_t INTERFACE_ID = CLASS_ID::SUS_HANDLER; static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::SUS_HANDLER; + //! [EXPORT] : [COMMENT] Possible indicator that the SUS device is glitchy 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, diff --git a/tmtc b/tmtc index 00205f0e..2b2ad0a2 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 00205f0e759970dda3bdd06150bbe85297f9d176 +Subproject commit 2b2ad0a23a8477f81413f10ff4b39053562cabc5 From 0788a3d551d5c955b97a99f5394a21fd14625445 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 13 Jun 2023 07:57:28 +0200 Subject: [PATCH 03/18] changelog typo --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fdf3f952..65f3b444 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,7 +22,7 @@ will consitute of a breaking change warranting a new major release: ## Changed -- Relaxed SUS FDIR. The devices have shown to be glitchy in orbit, but still see to deliver +- Relaxed SUS FDIR. The devices have shown to be glitchy in orbit, but still seem 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. From 8062c5edad416faaa6c21557e824362b72497602 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 13 Jun 2023 07:58:40 +0200 Subject: [PATCH 04/18] removed old comment --- linux/acs/SusPolling.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/linux/acs/SusPolling.cpp b/linux/acs/SusPolling.cpp index 99e4b4e0..a285d26d 100644 --- a/linux/acs/SusPolling.cpp +++ b/linux/acs/SusPolling.cpp @@ -170,8 +170,6 @@ ReturnValue_t SusPolling::handleSusPolling() { } MutexGuard mg(ipcLock); 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. susDevs[idx].replyResult = returnvalue::OK; for (unsigned chIdx = 0; chIdx < 6; chIdx++) { susDevs[idx].ownReply.channelsRaw[chIdx] = From a81eae7726b746eca3e48eccc81d8e2f9f1a5825 Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 6 Sep 2023 14:34:15 +0200 Subject: [PATCH 05/18] exchange nominal and 1st redundancy sensor for ploc mission board --- mission/controller/ThermalController.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index 5f2277a9..2729cec0 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -1372,12 +1372,13 @@ void ThermalController::ctrlPlPcduBoard() { tooHotHandler(objects::PLPCDU_HANDLER, tooHotFlags.eBandTooHotFlag); } +// ToDo: remove one of the following 2 void ThermalController::ctrlPlocMissionBoard() { ctrlCtx.thermalComponent = tcsCtrl::PLOCMISSION_BOARD; - sensors[0].first = sensorTemperatures.plocHeatspreader.isValid(); - sensors[0].second = sensorTemperatures.plocHeatspreader.value; - sensors[1].first = sensorTemperatures.plocMissionboard.isValid(); - sensors[1].second = sensorTemperatures.plocMissionboard.value; + sensors[0].first = sensorTemperatures.plocMissionboard.isValid(); + sensors[0].second = sensorTemperatures.plocMissionboard.value; + sensors[1].first = sensorTemperatures.plocHeatspreader.isValid(); + sensors[1].second = sensorTemperatures.plocHeatspreader.value; sensors[2].first = sensorTemperatures.dacHeatspreader.isValid(); sensors[2].second = sensorTemperatures.dacHeatspreader.value; numSensors = 3; From c709bd08815419118271b8f948ad082b1cc04fe6 Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 6 Sep 2023 14:35:40 +0200 Subject: [PATCH 06/18] changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a3098e4d..6fb13142 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,9 @@ will consitute of a breaking change warranting a new major release: # [unreleased] +## Changed +- The primary and the secondary temperature sensors for the PLOC mission boards are exchanged. + # [v6.4.1] 2023-08-21 ## Fixed From 63b6db258c0fcfed17db1f39b0de49747643bbff Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 6 Sep 2023 14:37:04 +0200 Subject: [PATCH 07/18] params for new safe mode --- mission/controller/acs/AcsParameters.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mission/controller/acs/AcsParameters.h b/mission/controller/acs/AcsParameters.h index 0fb1daa9..a9c9ab5d 100644 --- a/mission/controller/acs/AcsParameters.h +++ b/mission/controller/acs/AcsParameters.h @@ -79,7 +79,7 @@ class AcsParameters : public HasParametersIF { float mgm13variance[3] = {pow(1.5e-8, 2), pow(1.5e-8, 2), pow(1.5e-8, 2)}; float mgm4variance[3] = {pow(1.7e-6, 2), pow(1.7e-6, 2), pow(1.7e-6, 2)}; float mgmVectorFilterWeight = 0.85; - float mgmDerivativeFilterWeight = 0.85; + float mgmDerivativeFilterWeight = 0.99; uint8_t useMgm4 = false; } mgmHandlingParameters; @@ -771,7 +771,7 @@ class AcsParameters : public HasParametersIF { -0.000889232196185857, -0.00168429567131815}}; float susBrightnessThreshold = 0.7; float susVectorFilterWeight = .85; - float susRateFilterWeight = .85; + float susRateFilterWeight = .99; } susHandlingParameters; struct GyrHandlingParameters { @@ -834,15 +834,15 @@ class AcsParameters : public HasParametersIF { double k_alignGyr = 4.0e-5; double k_parallelGyr = 3.75e-4; - double k_orthoSusMgm = 1.1e-2; - double k_alignSusMgm = 2.0e-5; - double k_parallelSusMgm = 4.4e-4; + double k_orthoSusMgm = 4.4e-3; + double k_alignSusMgm = 4.0e-5; + double k_parallelSusMgm = 3.75e-4; double sunTargetDirLeop[3] = {0, sqrt(.5), sqrt(.5)}; double sunTargetDir[3] = {0, 0, 1}; uint8_t useMekf = false; - uint8_t useGyr = true; + uint8_t useGyr = false; uint8_t dampingDuringEclipse = true; float sineLimitSunRotRate = 0.24; From cfbd6d3b1e715e8040b58544153a04621eddf827 Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 6 Sep 2023 14:38:19 +0200 Subject: [PATCH 08/18] changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6fb13142..d0738667 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,7 +17,10 @@ will consitute of a breaking change warranting a new major release: # [unreleased] ## Changed + - The primary and the secondary temperature sensors for the PLOC mission boards are exchanged. +- ACS parameters for the SUSMGM (FLP) safe mode have been adjusted. This safe mode is now the + default one. # [v6.4.1] 2023-08-21 From 58961efb3f36ef44ca969049748aa826ddb54186 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 7 Sep 2023 16:03:36 +0200 Subject: [PATCH 09/18] that should get the job done --- .../fsfwconfig/events/translateEvents.cpp | 11 ++++-- .../fsfwconfig/objects/translateObjects.cpp | 2 +- generators/bsp_hosted_events.csv | 3 +- generators/bsp_q7s_events.csv | 3 +- generators/events/translateEvents.cpp | 11 ++++-- generators/objects/translateObjects.cpp | 2 +- linux/fsfwconfig/events/translateEvents.cpp | 11 ++++-- linux/fsfwconfig/objects/translateObjects.cpp | 2 +- mission/acs/SusHandler.cpp | 39 ++++++++++--------- mission/acs/SusHandler.h | 12 ++++-- mission/acs/susMax1227Helpers.h | 8 ++++ mission/system/acs/SusFdir.cpp | 1 + tmtc | 2 +- 13 files changed, 68 insertions(+), 39 deletions(-) diff --git a/bsp_hosted/fsfwconfig/events/translateEvents.cpp b/bsp_hosted/fsfwconfig/events/translateEvents.cpp index 2f249d3b..282df380 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 305 translations. + * @brief Auto-generated event translation file. Contains 306 translations. * @details - * Generated on: 2023-09-07 15:38:20 + * Generated on: 2023-09-07 16:02:29 */ #include "translateEvents.h" @@ -309,7 +309,8 @@ 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 *TEMPERATURE_ALL_ONES_START_STRING = "TEMPERATURE_ALL_ONES_START"; +const char *TEMPERATURE_ALL_ONES_RECOVERY_STRING = "TEMPERATURE_ALL_ONES_RECOVERY"; const char *translateEvents(Event event) { switch ((event & 0xFFFF)) { @@ -922,7 +923,9 @@ const char *translateEvents(Event event) { case (14314): return DUMP_CFDP_CANCELLED_STRING; case (14500): - return TEMPERATURE_IS_ALL_ONES_STRING; + return TEMPERATURE_ALL_ONES_START_STRING; + case (14501): + return TEMPERATURE_ALL_ONES_RECOVERY_STRING; default: return "UNKNOWN_EVENT"; } diff --git a/bsp_hosted/fsfwconfig/objects/translateObjects.cpp b/bsp_hosted/fsfwconfig/objects/translateObjects.cpp index 41f9789a..a1dd2f05 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-09-07 15:38:20 + * Generated on: 2023-09-07 16:02:29 */ #include "translateObjects.h" diff --git a/generators/bsp_hosted_events.csv b/generators/bsp_hosted_events.csv index d1dc39ea..986374ba 100644 --- a/generators/bsp_hosted_events.csv +++ b/generators/bsp_hosted_events.csv @@ -303,4 +303,5 @@ 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;Possible indicator that the SUS device is glitchy;mission/acs/SusHandler.h +14500;0x38a4;TEMPERATURE_ALL_ONES_START;LOW;Detected invalid values, starting invalid message counting;mission/acs/SusHandler.h +14501;0x38a5;TEMPERATURE_ALL_ONES_RECOVERY;LOW;Detected valid values again, resetting invalid message counter. P1: Invalid message counter.;mission/acs/SusHandler.h diff --git a/generators/bsp_q7s_events.csv b/generators/bsp_q7s_events.csv index d1dc39ea..986374ba 100644 --- a/generators/bsp_q7s_events.csv +++ b/generators/bsp_q7s_events.csv @@ -303,4 +303,5 @@ 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;Possible indicator that the SUS device is glitchy;mission/acs/SusHandler.h +14500;0x38a4;TEMPERATURE_ALL_ONES_START;LOW;Detected invalid values, starting invalid message counting;mission/acs/SusHandler.h +14501;0x38a5;TEMPERATURE_ALL_ONES_RECOVERY;LOW;Detected valid values again, resetting invalid message counter. P1: Invalid message counter.;mission/acs/SusHandler.h diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index 2f249d3b..282df380 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 305 translations. + * @brief Auto-generated event translation file. Contains 306 translations. * @details - * Generated on: 2023-09-07 15:38:20 + * Generated on: 2023-09-07 16:02:29 */ #include "translateEvents.h" @@ -309,7 +309,8 @@ 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 *TEMPERATURE_ALL_ONES_START_STRING = "TEMPERATURE_ALL_ONES_START"; +const char *TEMPERATURE_ALL_ONES_RECOVERY_STRING = "TEMPERATURE_ALL_ONES_RECOVERY"; const char *translateEvents(Event event) { switch ((event & 0xFFFF)) { @@ -922,7 +923,9 @@ const char *translateEvents(Event event) { case (14314): return DUMP_CFDP_CANCELLED_STRING; case (14500): - return TEMPERATURE_IS_ALL_ONES_STRING; + return TEMPERATURE_ALL_ONES_START_STRING; + case (14501): + return TEMPERATURE_ALL_ONES_RECOVERY_STRING; default: return "UNKNOWN_EVENT"; } diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index 32f68bfc..a4150938 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-09-07 15:38:20 + * Generated on: 2023-09-07 16:02:29 */ #include "translateObjects.h" diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index 2f249d3b..282df380 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 305 translations. + * @brief Auto-generated event translation file. Contains 306 translations. * @details - * Generated on: 2023-09-07 15:38:20 + * Generated on: 2023-09-07 16:02:29 */ #include "translateEvents.h" @@ -309,7 +309,8 @@ 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 *TEMPERATURE_ALL_ONES_START_STRING = "TEMPERATURE_ALL_ONES_START"; +const char *TEMPERATURE_ALL_ONES_RECOVERY_STRING = "TEMPERATURE_ALL_ONES_RECOVERY"; const char *translateEvents(Event event) { switch ((event & 0xFFFF)) { @@ -922,7 +923,9 @@ const char *translateEvents(Event event) { case (14314): return DUMP_CFDP_CANCELLED_STRING; case (14500): - return TEMPERATURE_IS_ALL_ONES_STRING; + return TEMPERATURE_ALL_ONES_START_STRING; + case (14501): + return TEMPERATURE_ALL_ONES_RECOVERY_STRING; default: return "UNKNOWN_EVENT"; } diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index 32f68bfc..a4150938 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-09-07 15:38:20 + * Generated on: 2023-09-07 16:02:29 */ #include "translateObjects.h" diff --git a/mission/acs/SusHandler.cpp b/mission/acs/SusHandler.cpp index 7a9e7d4f..9877ace0 100644 --- a/mission/acs/SusHandler.cpp +++ b/mission/acs/SusHandler.cpp @@ -20,6 +20,9 @@ void SusHandler::doStartUp() { } if (internalState == InternalState::STARTUP) { if (commandExecuted) { + if (waitingForRecovery) { + waitingForRecovery = false; + } setMode(MODE_ON); internalState = InternalState::NONE; commandExecuted = false; @@ -88,26 +91,26 @@ 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) { - // Prevent spam if a device is glitchy for prolonged periods by only triggering with a - // maximum interval. - if (faultyDataEventCd.hasTimedOut()) { - triggerEvent(TEMPERATURE_IS_ALL_ONES); - faultyDataEventCd.resetTimer(); + // Simple FDIR variant to make the handler more robust to invalid messages which + // appear sometimes for the SUS device: Allow invalid message up to a certain threshold + // before triggering FDIR reactions. + if (reply->tempRaw == 0xfff and not waitingForRecovery) { + if (invalidMsgCounter == 0) { + triggerEvent(TEMPERATURE_ALL_ONES_START); + } else if (invalidMsgCounter == susMax1227::MAX_INVALID_MSG_COUNT) { + triggerEvent(DeviceHandlerIF::DEVICE_WANTS_HARD_REBOOT); + waitingForRecovery = true; + } else { + invalidMsgCounter++; } - // dataset.setValidity(false, true); - // return returnvalue::OK; + dataset.setValidity(false, true); + dataset.tempC = thermal::INVALID_TEMPERATURE; + std::memset(dataset.channels.value, 0, sizeof(dataset.channels.value)); + } else { + dataset.setValidity(true, true); + dataset.tempC = max1227::getTemperature(reply->tempRaw); + std::memcpy(dataset.channels.value, reply->channelsRaw, sizeof(reply->channelsRaw)); } - dataset.setValidity(true, true); - dataset.tempC = max1227::getTemperature(reply->tempRaw); - std::memcpy(dataset.channels.value, reply->channelsRaw, sizeof(reply->channelsRaw)); } return returnvalue::OK; } diff --git a/mission/acs/SusHandler.h b/mission/acs/SusHandler.h index 5e6a5797..ead34e72 100644 --- a/mission/acs/SusHandler.h +++ b/mission/acs/SusHandler.h @@ -17,8 +17,13 @@ class SusHandler : public DeviceHandlerBase { static const uint8_t INTERFACE_ID = CLASS_ID::SUS_HANDLER; static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::SUS_HANDLER; - //! [EXPORT] : [COMMENT] Possible indicator that the SUS device is glitchy - static constexpr Event TEMPERATURE_IS_ALL_ONES = event::makeEvent(SUBSYSTEM_ID, 0, severity::LOW); + //! [EXPORT] : [COMMENT] Detected invalid values, starting invalid message counting + static constexpr Event TEMPERATURE_ALL_ONES_START = + event::makeEvent(SUBSYSTEM_ID, 0, severity::LOW); + //! [EXPORT] : [COMMENT] Detected valid values again, resetting invalid message counter. + //! P1: Invalid message counter. + static constexpr Event TEMPERATURE_ALL_ONES_RECOVERY = + event::makeEvent(SUBSYSTEM_ID, 1, severity::LOW); SusHandler(uint32_t objectId, uint8_t susIdx, object_id_t deviceCommunication, CookieIF *comCookie); @@ -46,10 +51,11 @@ class SusHandler : public DeviceHandlerBase { LocalPoolDataSetBase *getDataSetHandle(sid_t sid) override; private: - Countdown faultyDataEventCd = Countdown(60000); susMax1227::SusDataset dataset; acs::SusRequest request{}; uint8_t susIdx; + bool waitingForRecovery = true; + uint32_t invalidMsgCounter = 0; uint32_t transitionDelay = 1000; bool goToNormalMode = false; diff --git a/mission/acs/susMax1227Helpers.h b/mission/acs/susMax1227Helpers.h index 292db6e4..0314b834 100644 --- a/mission/acs/susMax1227Helpers.h +++ b/mission/acs/susMax1227Helpers.h @@ -8,6 +8,14 @@ namespace susMax1227 { +// This is 16 seconds for a polling frequency of 0.4 seconds. +static constexpr uint32_t MAX_INVALID_MSG_COUNT = 40; +// Using a decrement time of 32 seconds should cause faulty device incrementation to best faster +// the decrementation, so that FDIR reactions will eventuall be triggered. +// NOTE: Not used currently, we perform the strange reply check logic in the handler and trigger +// a reboot directly using the appropriate event. +static constexpr uint32_t FAULTY_COM_DECREMENT_TIME_MS = 32000; + static const DeviceCommandId_t NONE = 0x0; // Set when no command is pending static const DeviceCommandId_t WRITE_SETUP = 1; diff --git a/mission/system/acs/SusFdir.cpp b/mission/system/acs/SusFdir.cpp index 894b92cb..de8eccc7 100644 --- a/mission/system/acs/SusFdir.cpp +++ b/mission/system/acs/SusFdir.cpp @@ -1,6 +1,7 @@ #include "SusFdir.h" #include "eive/objects.h" +#include "mission/acs/susMax1227Helpers.h" SusFdir::SusFdir(object_id_t sensorId) : DeviceHandlerFailureIsolation(sensorId, objects::SUS_BOARD_ASS) {} diff --git a/tmtc b/tmtc index 957d756d..d285b1ca 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 957d756d1e0c9862ae18798b4c27f8f0da8a349b +Subproject commit d285b1caeca01709004983a4d2e795898325effb From c51fbb90745c79f50592e9017a0108f088d86ed1 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 7 Sep 2023 16:05:51 +0200 Subject: [PATCH 10/18] add recovery handling --- mission/acs/SusHandler.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mission/acs/SusHandler.cpp b/mission/acs/SusHandler.cpp index 9877ace0..287e4d2e 100644 --- a/mission/acs/SusHandler.cpp +++ b/mission/acs/SusHandler.cpp @@ -107,6 +107,10 @@ ReturnValue_t SusHandler::interpretDeviceReply(DeviceCommandId_t id, const uint8 dataset.tempC = thermal::INVALID_TEMPERATURE; std::memset(dataset.channels.value, 0, sizeof(dataset.channels.value)); } else { + if (invalidMsgCounter > 0) { + triggerEvent(TEMPERATURE_ALL_ONES_RECOVERY, invalidMsgCounter); + invalidMsgCounter = 0; + } dataset.setValidity(true, true); dataset.tempC = max1227::getTemperature(reply->tempRaw); std::memcpy(dataset.channels.value, reply->channelsRaw, sizeof(reply->channelsRaw)); From 5a1b2470f0b3194bc88af0c80f8fafa0ab6199de Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 7 Sep 2023 16:07:59 +0200 Subject: [PATCH 11/18] some structure clean up --- mission/acs/SusHandler.cpp | 59 +++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/mission/acs/SusHandler.cpp b/mission/acs/SusHandler.cpp index 287e4d2e..f61dc3a0 100644 --- a/mission/acs/SusHandler.cpp +++ b/mission/acs/SusHandler.cpp @@ -86,36 +86,37 @@ ReturnValue_t SusHandler::scanForReply(const uint8_t *start, size_t len, DeviceC } ReturnValue_t SusHandler::interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) { const auto *reply = reinterpret_cast(packet); - if (reply->dataWasSet) { - if (internalState == InternalState::STARTUP) { - commandExecuted = true; - } - PoolReadGuard pg(&dataset); - // Simple FDIR variant to make the handler more robust to invalid messages which - // appear sometimes for the SUS device: Allow invalid message up to a certain threshold - // before triggering FDIR reactions. - if (reply->tempRaw == 0xfff and not waitingForRecovery) { - if (invalidMsgCounter == 0) { - triggerEvent(TEMPERATURE_ALL_ONES_START); - } else if (invalidMsgCounter == susMax1227::MAX_INVALID_MSG_COUNT) { - triggerEvent(DeviceHandlerIF::DEVICE_WANTS_HARD_REBOOT); - waitingForRecovery = true; - } else { - invalidMsgCounter++; - } - dataset.setValidity(false, true); - dataset.tempC = thermal::INVALID_TEMPERATURE; - std::memset(dataset.channels.value, 0, sizeof(dataset.channels.value)); - } else { - if (invalidMsgCounter > 0) { - triggerEvent(TEMPERATURE_ALL_ONES_RECOVERY, invalidMsgCounter); - invalidMsgCounter = 0; - } - dataset.setValidity(true, true); - dataset.tempC = max1227::getTemperature(reply->tempRaw); - std::memcpy(dataset.channels.value, reply->channelsRaw, sizeof(reply->channelsRaw)); - } + if (!reply->dataWasSet) { + return returnvalue::OK; } + if (internalState == InternalState::STARTUP) { + commandExecuted = true; + } + PoolReadGuard pg(&dataset); + // Simple FDIR variant to make the handler more robust to invalid messages which + // appear sometimes for the SUS device: Allow invalid message up to a certain threshold + // before triggering FDIR reactions. + if (reply->tempRaw == 0xfff and not waitingForRecovery) { + if (invalidMsgCounter == 0) { + triggerEvent(TEMPERATURE_ALL_ONES_START); + } else if (invalidMsgCounter == susMax1227::MAX_INVALID_MSG_COUNT) { + triggerEvent(DeviceHandlerIF::DEVICE_WANTS_HARD_REBOOT); + waitingForRecovery = true; + } else { + invalidMsgCounter++; + } + dataset.setValidity(false, true); + dataset.tempC = thermal::INVALID_TEMPERATURE; + std::memset(dataset.channels.value, 0, sizeof(dataset.channels.value)); + return returnvalue::OK; + } + if (invalidMsgCounter > 0) { + triggerEvent(TEMPERATURE_ALL_ONES_RECOVERY, invalidMsgCounter); + invalidMsgCounter = 0; + } + dataset.setValidity(true, true); + dataset.tempC = max1227::getTemperature(reply->tempRaw); + std::memcpy(dataset.channels.value, reply->channelsRaw, sizeof(reply->channelsRaw)); return returnvalue::OK; } From 03371041733f611370a2a969f244984ecdb54405 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 7 Sep 2023 16:09:43 +0200 Subject: [PATCH 12/18] another small bugfix --- mission/acs/SusHandler.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mission/acs/SusHandler.cpp b/mission/acs/SusHandler.cpp index f61dc3a0..4b9778e5 100644 --- a/mission/acs/SusHandler.cpp +++ b/mission/acs/SusHandler.cpp @@ -102,9 +102,8 @@ ReturnValue_t SusHandler::interpretDeviceReply(DeviceCommandId_t id, const uint8 } else if (invalidMsgCounter == susMax1227::MAX_INVALID_MSG_COUNT) { triggerEvent(DeviceHandlerIF::DEVICE_WANTS_HARD_REBOOT); waitingForRecovery = true; - } else { - invalidMsgCounter++; } + invalidMsgCounter++; dataset.setValidity(false, true); dataset.tempC = thermal::INVALID_TEMPERATURE; std::memset(dataset.channels.value, 0, sizeof(dataset.channels.value)); From 55dcb3595b8de7cd0d0e7ad39a84c6016e773dd9 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 7 Sep 2023 16:28:55 +0200 Subject: [PATCH 13/18] this might fix the device --- CHANGELOG.md | 2 ++ linux/acs/AcsBoardPolling.cpp | 3 +++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d0738667..3e92e2f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,8 @@ will consitute of a breaking change warranting a new major release: - The primary and the secondary temperature sensors for the PLOC mission boards are exchanged. - ACS parameters for the SUSMGM (FLP) safe mode have been adjusted. This safe mode is now the default one. +- MGM3100 Startup Configuration: Ignore bit 1 of the CMM reply, which is sometimes set to + 1 in the reply for some reason. # [v6.4.1] 2023-08-21 diff --git a/linux/acs/AcsBoardPolling.cpp b/linux/acs/AcsBoardPolling.cpp index 1ba55357..6919907a 100644 --- a/linux/acs/AcsBoardPolling.cpp +++ b/linux/acs/AcsBoardPolling.cpp @@ -767,6 +767,9 @@ void AcsBoardPolling::mgmRm3100Handler(MgmRm3100& mgm) { mgm.replyResult = result; return; } + // For some reason, bit 1 is sometimes set on the reply, even if it is not set for the + // command.. Ignore it for now by clearing it. + rawReply[1] &= ~(1 << 1); if (rawReply[1] != mgmRm3100::CMM_VALUE) { sif::error << "AcsBoardPolling: MGM RM3100 read back CMM invalid" << std::endl; mgm.replyResult = result; From e26338e4cb3540da3d1a499110e967da211424eb Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 11 Sep 2023 15:39:21 +0200 Subject: [PATCH 14/18] adapt event severities --- mission/acs/SusHandler.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mission/acs/SusHandler.h b/mission/acs/SusHandler.h index ead34e72..88e2b163 100644 --- a/mission/acs/SusHandler.h +++ b/mission/acs/SusHandler.h @@ -19,11 +19,11 @@ class SusHandler : public DeviceHandlerBase { //! [EXPORT] : [COMMENT] Detected invalid values, starting invalid message counting static constexpr Event TEMPERATURE_ALL_ONES_START = - event::makeEvent(SUBSYSTEM_ID, 0, severity::LOW); + event::makeEvent(SUBSYSTEM_ID, 0, severity::MEDIUM); //! [EXPORT] : [COMMENT] Detected valid values again, resetting invalid message counter. //! P1: Invalid message counter. static constexpr Event TEMPERATURE_ALL_ONES_RECOVERY = - event::makeEvent(SUBSYSTEM_ID, 1, severity::LOW); + event::makeEvent(SUBSYSTEM_ID, 1, severity::INFO); SusHandler(uint32_t objectId, uint8_t susIdx, object_id_t deviceCommunication, CookieIF *comCookie); From fc23438e5d22be54e4172a6334362e2eaa9aec4e Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 12 Sep 2023 10:07:00 +0200 Subject: [PATCH 15/18] update gen files --- bsp_hosted/fsfwconfig/events/translateEvents.cpp | 2 +- bsp_hosted/fsfwconfig/objects/translateObjects.cpp | 2 +- generators/bsp_hosted_events.csv | 4 ++-- generators/bsp_q7s_events.csv | 4 ++-- generators/events/translateEvents.cpp | 2 +- generators/objects/translateObjects.cpp | 2 +- linux/fsfwconfig/events/translateEvents.cpp | 2 +- linux/fsfwconfig/objects/translateObjects.cpp | 2 +- tmtc | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/bsp_hosted/fsfwconfig/events/translateEvents.cpp b/bsp_hosted/fsfwconfig/events/translateEvents.cpp index 282df380..3322209d 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 306 translations. * @details - * Generated on: 2023-09-07 16:02:29 + * Generated on: 2023-09-12 10:05:17 */ #include "translateEvents.h" diff --git a/bsp_hosted/fsfwconfig/objects/translateObjects.cpp b/bsp_hosted/fsfwconfig/objects/translateObjects.cpp index a1dd2f05..988be097 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-09-07 16:02:29 + * Generated on: 2023-09-12 10:05:17 */ #include "translateObjects.h" diff --git a/generators/bsp_hosted_events.csv b/generators/bsp_hosted_events.csv index 986374ba..08626f32 100644 --- a/generators/bsp_hosted_events.csv +++ b/generators/bsp_hosted_events.csv @@ -303,5 +303,5 @@ 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_ALL_ONES_START;LOW;Detected invalid values, starting invalid message counting;mission/acs/SusHandler.h -14501;0x38a5;TEMPERATURE_ALL_ONES_RECOVERY;LOW;Detected valid values again, resetting invalid message counter. P1: Invalid message counter.;mission/acs/SusHandler.h +14500;0x38a4;TEMPERATURE_ALL_ONES_START;MEDIUM;Detected invalid values, starting invalid message counting;mission/acs/SusHandler.h +14501;0x38a5;TEMPERATURE_ALL_ONES_RECOVERY;INFO;Detected valid values again, resetting invalid message counter. P1: Invalid message counter.;mission/acs/SusHandler.h diff --git a/generators/bsp_q7s_events.csv b/generators/bsp_q7s_events.csv index 986374ba..08626f32 100644 --- a/generators/bsp_q7s_events.csv +++ b/generators/bsp_q7s_events.csv @@ -303,5 +303,5 @@ 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_ALL_ONES_START;LOW;Detected invalid values, starting invalid message counting;mission/acs/SusHandler.h -14501;0x38a5;TEMPERATURE_ALL_ONES_RECOVERY;LOW;Detected valid values again, resetting invalid message counter. P1: Invalid message counter.;mission/acs/SusHandler.h +14500;0x38a4;TEMPERATURE_ALL_ONES_START;MEDIUM;Detected invalid values, starting invalid message counting;mission/acs/SusHandler.h +14501;0x38a5;TEMPERATURE_ALL_ONES_RECOVERY;INFO;Detected valid values again, resetting invalid message counter. P1: Invalid message counter.;mission/acs/SusHandler.h diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index 282df380..3322209d 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 306 translations. * @details - * Generated on: 2023-09-07 16:02:29 + * Generated on: 2023-09-12 10:05:17 */ #include "translateEvents.h" diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index a4150938..390dfd87 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-09-07 16:02:29 + * Generated on: 2023-09-12 10:05:17 */ #include "translateObjects.h" diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index 282df380..3322209d 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 306 translations. * @details - * Generated on: 2023-09-07 16:02:29 + * Generated on: 2023-09-12 10:05:17 */ #include "translateEvents.h" diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index a4150938..390dfd87 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-09-07 16:02:29 + * Generated on: 2023-09-12 10:05:17 */ #include "translateObjects.h" diff --git a/tmtc b/tmtc index d285b1ca..af5e8115 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit d285b1caeca01709004983a4d2e795898325effb +Subproject commit af5e81158cb6d0cce09694a7fc921abb1675f03d From 3cb9cd124d316c3588c8b6776ea25ac46f91e15c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 12 Sep 2023 10:08:28 +0200 Subject: [PATCH 16/18] bump tmtc --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index af5e8115..e56f8732 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit af5e81158cb6d0cce09694a7fc921abb1675f03d +Subproject commit e56f8732be52766bf73c1b7e222eff8cef114da5 From c209c71d5f271c1a79280725145b64f5c1c4fae2 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 12 Sep 2023 10:17:29 +0200 Subject: [PATCH 17/18] prep v6.5.0 --- CHANGELOG.md | 2 ++ CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d494a330..55f548be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ will consitute of a breaking change warranting a new major release: # [unreleased] +# [v6.5.0] 2023-09-12 + ## Changed - Relaxed SUS FDIR. The devices have shown to be glitchy in orbit, but still seem to deliver diff --git a/CMakeLists.txt b/CMakeLists.txt index ff115a2c..ba4289c2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,7 @@ cmake_minimum_required(VERSION 3.13) set(OBSW_VERSION_MAJOR 6) -set(OBSW_VERSION_MINOR 4) +set(OBSW_VERSION_MINOR 5) set(OBSW_VERSION_REVISION 1) # set(CMAKE_VERBOSE TRUE) From 1bda30773ff623007e36e2b659cfe23a8dad4ff3 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 12 Sep 2023 13:08:16 +0200 Subject: [PATCH 18/18] prep next patch --- CHANGELOG.md | 4 ++++ tmtc | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 55f548be..550901d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,10 @@ will consitute of a breaking change warranting a new major release: # [unreleased] +# [v6.5.1] 2023-09-12 + +- Bumped `eive-tmtc` to v5.5.0. + # [v6.5.0] 2023-09-12 ## Changed diff --git a/tmtc b/tmtc index e56f8732..d23cc683 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit e56f8732be52766bf73c1b7e222eff8cef114da5 +Subproject commit d23cc6834ad0895c230d2378b0c8d9ba4f374f8d