From 0854ec878bbb714e70b0cd73d29e59328aba8ab2 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 19 Oct 2023 11:27:21 +0200 Subject: [PATCH 1/5] added CFDP fault handler events --- CHANGELOG.md | 1 + bsp_hosted/fsfwconfig/events/translateEvents.cpp | 7 +++++-- .../fsfwconfig/objects/translateObjects.cpp | 7 +++++-- common/config/eive/eventSubsystemIds.h | 1 + common/config/eive/objects.h | 1 + generators/bsp_hosted_events.csv | 1 + generators/bsp_hosted_objects.csv | 1 + generators/bsp_hosted_subsystems.csv | 1 + generators/bsp_q7s_events.csv | 1 + generators/bsp_q7s_objects.csv | 1 + generators/bsp_q7s_subsystems.csv | 1 + generators/events/translateEvents.cpp | 7 +++++-- generators/objects/translateObjects.cpp | 7 +++++-- linux/fsfwconfig/events/translateEvents.cpp | 7 +++++-- linux/fsfwconfig/objects/translateObjects.cpp | 7 +++++-- mission/cfdp/CfdpFaultHandler.h | 9 ++++++++- mission/cfdp/defs.h | 16 ++++++++++++++++ mission/genericFactory.cpp | 4 ++-- tmtc | 2 +- 19 files changed, 66 insertions(+), 16 deletions(-) create mode 100644 mission/cfdp/defs.h diff --git a/CHANGELOG.md b/CHANGELOG.md index 9308d71d..c84eedc4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ will consitute of a breaking change warranting a new major release: CFDP interface. - Proper back pressure handling for the CFDP handler, where the `LiveTmTask` is able to throttle the CFDP handler. +- Added CFDP fault handler events. ## Fixed diff --git a/bsp_hosted/fsfwconfig/events/translateEvents.cpp b/bsp_hosted/fsfwconfig/events/translateEvents.cpp index 7c04e9f5..8456f7e6 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 314 translations. + * @brief Auto-generated event translation file. Contains 315 translations. * @details - * Generated on: 2023-10-13 15:23:30 + * Generated on: 2023-10-19 11:23:41 */ #include "translateEvents.h" @@ -319,6 +319,7 @@ const char *DUMP_HK_CANCELLED_STRING = "DUMP_HK_CANCELLED"; const char *DUMP_CFDP_CANCELLED_STRING = "DUMP_CFDP_CANCELLED"; const char *TEMPERATURE_ALL_ONES_START_STRING = "TEMPERATURE_ALL_ONES_START"; const char *TEMPERATURE_ALL_ONES_RECOVERY_STRING = "TEMPERATURE_ALL_ONES_RECOVERY"; +const char *FAULT_HANDLER_TRIGGERED_STRING = "FAULT_HANDLER_TRIGGERED"; const char *translateEvents(Event event) { switch ((event & 0xFFFF)) { @@ -950,6 +951,8 @@ const char *translateEvents(Event event) { return TEMPERATURE_ALL_ONES_START_STRING; case (14501): return TEMPERATURE_ALL_ONES_RECOVERY_STRING; + case (14600): + return FAULT_HANDLER_TRIGGERED_STRING; default: return "UNKNOWN_EVENT"; } diff --git a/bsp_hosted/fsfwconfig/objects/translateObjects.cpp b/bsp_hosted/fsfwconfig/objects/translateObjects.cpp index 5cb8e295..500d3c0c 100644 --- a/bsp_hosted/fsfwconfig/objects/translateObjects.cpp +++ b/bsp_hosted/fsfwconfig/objects/translateObjects.cpp @@ -1,8 +1,8 @@ /** * @brief Auto-generated object translation file. * @details - * Contains 174 translations. - * Generated on: 2023-10-13 15:23:30 + * Contains 175 translations. + * Generated on: 2023-10-19 11:23:41 */ #include "translateObjects.h" @@ -161,6 +161,7 @@ const char *PUS_TM_FUNNEL_STRING = "PUS_TM_FUNNEL"; const char *CFDP_TM_FUNNEL_STRING = "CFDP_TM_FUNNEL"; const char *CFDP_HANDLER_STRING = "CFDP_HANDLER"; const char *CFDP_DISTRIBUTOR_STRING = "CFDP_DISTRIBUTOR"; +const char *CFDP_FAULT_HANDLER_STRING = "CFDP_FAULT_HANDLER"; const char *EIVE_SYSTEM_STRING = "EIVE_SYSTEM"; const char *ACS_SUBSYSTEM_STRING = "ACS_SUBSYSTEM"; const char *PL_SUBSYSTEM_STRING = "PL_SUBSYSTEM"; @@ -493,6 +494,8 @@ const char *translateObject(object_id_t object) { return CFDP_HANDLER_STRING; case 0x73000206: return CFDP_DISTRIBUTOR_STRING; + case 0x7300207: + return CFDP_FAULT_HANDLER_STRING; case 0x73010000: return EIVE_SYSTEM_STRING; case 0x73010001: diff --git a/common/config/eive/eventSubsystemIds.h b/common/config/eive/eventSubsystemIds.h index 84ac42d5..370a00b8 100644 --- a/common/config/eive/eventSubsystemIds.h +++ b/common/config/eive/eventSubsystemIds.h @@ -41,6 +41,7 @@ enum : uint8_t { PERSISTENT_TM_STORE = 143, SYRLINKS_COM = 144, SUS_HANDLER = 145, + CFDP_APP = 146, COMMON_SUBSYSTEM_ID_END }; diff --git a/common/config/eive/objects.h b/common/config/eive/objects.h index d6b15b8d..8c6d59fa 100644 --- a/common/config/eive/objects.h +++ b/common/config/eive/objects.h @@ -166,6 +166,7 @@ enum commonObjects : uint32_t { CFDP_TM_FUNNEL = 0x73000102, CFDP_HANDLER = 0x73000205, CFDP_DISTRIBUTOR = 0x73000206, + CFDP_FAULT_HANDLER = 0x7300207, MISC_TM_STORE = 0x73020001, OK_TM_STORE = 0x73020002, NOT_OK_TM_STORE = 0x73020003, diff --git a/generators/bsp_hosted_events.csv b/generators/bsp_hosted_events.csv index 24e48628..eafa7584 100644 --- a/generators/bsp_hosted_events.csv +++ b/generators/bsp_hosted_events.csv @@ -313,3 +313,4 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 14314;0x37ea;DUMP_CFDP_CANCELLED;LOW;P1: Number of dumped packets. P2: Total dumped bytes.;mission/persistentTmStoreDefs.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 +14600;0x3908;FAULT_HANDLER_TRIGGERED;LOW;P1: CFDP fault handler code. P2: CFDP condition code.;mission/cfdp/defs.h diff --git a/generators/bsp_hosted_objects.csv b/generators/bsp_hosted_objects.csv index 689a58f2..8c35f20d 100644 --- a/generators/bsp_hosted_objects.csv +++ b/generators/bsp_hosted_objects.csv @@ -153,6 +153,7 @@ 0x73000102;CFDP_TM_FUNNEL 0x73000205;CFDP_HANDLER 0x73000206;CFDP_DISTRIBUTOR +0x7300207;CFDP_FAULT_HANDLER 0x73010000;EIVE_SYSTEM 0x73010001;ACS_SUBSYSTEM 0x73010002;PL_SUBSYSTEM diff --git a/generators/bsp_hosted_subsystems.csv b/generators/bsp_hosted_subsystems.csv index c9c90629..36828fda 100644 --- a/generators/bsp_hosted_subsystems.csv +++ b/generators/bsp_hosted_subsystems.csv @@ -61,3 +61,4 @@ 143;PERSISTENT_TM_STORE 144;SYRLINKS_COM 145;SUS_HANDLER +146;CFDP_APP diff --git a/generators/bsp_q7s_events.csv b/generators/bsp_q7s_events.csv index 24e48628..eafa7584 100644 --- a/generators/bsp_q7s_events.csv +++ b/generators/bsp_q7s_events.csv @@ -313,3 +313,4 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 14314;0x37ea;DUMP_CFDP_CANCELLED;LOW;P1: Number of dumped packets. P2: Total dumped bytes.;mission/persistentTmStoreDefs.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 +14600;0x3908;FAULT_HANDLER_TRIGGERED;LOW;P1: CFDP fault handler code. P2: CFDP condition code.;mission/cfdp/defs.h diff --git a/generators/bsp_q7s_objects.csv b/generators/bsp_q7s_objects.csv index 10cfed26..5700955a 100644 --- a/generators/bsp_q7s_objects.csv +++ b/generators/bsp_q7s_objects.csv @@ -158,6 +158,7 @@ 0x73000102;CFDP_TM_FUNNEL 0x73000205;CFDP_HANDLER 0x73000206;CFDP_DISTRIBUTOR +0x7300207;CFDP_FAULT_HANDLER 0x73010000;EIVE_SYSTEM 0x73010001;ACS_SUBSYSTEM 0x73010002;PL_SUBSYSTEM diff --git a/generators/bsp_q7s_subsystems.csv b/generators/bsp_q7s_subsystems.csv index c9c90629..36828fda 100644 --- a/generators/bsp_q7s_subsystems.csv +++ b/generators/bsp_q7s_subsystems.csv @@ -61,3 +61,4 @@ 143;PERSISTENT_TM_STORE 144;SYRLINKS_COM 145;SUS_HANDLER +146;CFDP_APP diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index 7c04e9f5..8456f7e6 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 314 translations. + * @brief Auto-generated event translation file. Contains 315 translations. * @details - * Generated on: 2023-10-13 15:23:30 + * Generated on: 2023-10-19 11:23:41 */ #include "translateEvents.h" @@ -319,6 +319,7 @@ const char *DUMP_HK_CANCELLED_STRING = "DUMP_HK_CANCELLED"; const char *DUMP_CFDP_CANCELLED_STRING = "DUMP_CFDP_CANCELLED"; const char *TEMPERATURE_ALL_ONES_START_STRING = "TEMPERATURE_ALL_ONES_START"; const char *TEMPERATURE_ALL_ONES_RECOVERY_STRING = "TEMPERATURE_ALL_ONES_RECOVERY"; +const char *FAULT_HANDLER_TRIGGERED_STRING = "FAULT_HANDLER_TRIGGERED"; const char *translateEvents(Event event) { switch ((event & 0xFFFF)) { @@ -950,6 +951,8 @@ const char *translateEvents(Event event) { return TEMPERATURE_ALL_ONES_START_STRING; case (14501): return TEMPERATURE_ALL_ONES_RECOVERY_STRING; + case (14600): + return FAULT_HANDLER_TRIGGERED_STRING; default: return "UNKNOWN_EVENT"; } diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index 5b99d6f0..3476cf7f 100644 --- a/generators/objects/translateObjects.cpp +++ b/generators/objects/translateObjects.cpp @@ -1,8 +1,8 @@ /** * @brief Auto-generated object translation file. * @details - * Contains 178 translations. - * Generated on: 2023-10-13 15:23:30 + * Contains 179 translations. + * Generated on: 2023-10-19 11:23:41 */ #include "translateObjects.h" @@ -166,6 +166,7 @@ const char *PUS_TM_FUNNEL_STRING = "PUS_TM_FUNNEL"; const char *CFDP_TM_FUNNEL_STRING = "CFDP_TM_FUNNEL"; const char *CFDP_HANDLER_STRING = "CFDP_HANDLER"; const char *CFDP_DISTRIBUTOR_STRING = "CFDP_DISTRIBUTOR"; +const char *CFDP_FAULT_HANDLER_STRING = "CFDP_FAULT_HANDLER"; const char *EIVE_SYSTEM_STRING = "EIVE_SYSTEM"; const char *ACS_SUBSYSTEM_STRING = "ACS_SUBSYSTEM"; const char *PL_SUBSYSTEM_STRING = "PL_SUBSYSTEM"; @@ -507,6 +508,8 @@ const char *translateObject(object_id_t object) { return CFDP_HANDLER_STRING; case 0x73000206: return CFDP_DISTRIBUTOR_STRING; + case 0x7300207: + return CFDP_FAULT_HANDLER_STRING; case 0x73010000: return EIVE_SYSTEM_STRING; case 0x73010001: diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index 7c04e9f5..8456f7e6 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 314 translations. + * @brief Auto-generated event translation file. Contains 315 translations. * @details - * Generated on: 2023-10-13 15:23:30 + * Generated on: 2023-10-19 11:23:41 */ #include "translateEvents.h" @@ -319,6 +319,7 @@ const char *DUMP_HK_CANCELLED_STRING = "DUMP_HK_CANCELLED"; const char *DUMP_CFDP_CANCELLED_STRING = "DUMP_CFDP_CANCELLED"; const char *TEMPERATURE_ALL_ONES_START_STRING = "TEMPERATURE_ALL_ONES_START"; const char *TEMPERATURE_ALL_ONES_RECOVERY_STRING = "TEMPERATURE_ALL_ONES_RECOVERY"; +const char *FAULT_HANDLER_TRIGGERED_STRING = "FAULT_HANDLER_TRIGGERED"; const char *translateEvents(Event event) { switch ((event & 0xFFFF)) { @@ -950,6 +951,8 @@ const char *translateEvents(Event event) { return TEMPERATURE_ALL_ONES_START_STRING; case (14501): return TEMPERATURE_ALL_ONES_RECOVERY_STRING; + case (14600): + return FAULT_HANDLER_TRIGGERED_STRING; default: return "UNKNOWN_EVENT"; } diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index 5b99d6f0..3476cf7f 100644 --- a/linux/fsfwconfig/objects/translateObjects.cpp +++ b/linux/fsfwconfig/objects/translateObjects.cpp @@ -1,8 +1,8 @@ /** * @brief Auto-generated object translation file. * @details - * Contains 178 translations. - * Generated on: 2023-10-13 15:23:30 + * Contains 179 translations. + * Generated on: 2023-10-19 11:23:41 */ #include "translateObjects.h" @@ -166,6 +166,7 @@ const char *PUS_TM_FUNNEL_STRING = "PUS_TM_FUNNEL"; const char *CFDP_TM_FUNNEL_STRING = "CFDP_TM_FUNNEL"; const char *CFDP_HANDLER_STRING = "CFDP_HANDLER"; const char *CFDP_DISTRIBUTOR_STRING = "CFDP_DISTRIBUTOR"; +const char *CFDP_FAULT_HANDLER_STRING = "CFDP_FAULT_HANDLER"; const char *EIVE_SYSTEM_STRING = "EIVE_SYSTEM"; const char *ACS_SUBSYSTEM_STRING = "ACS_SUBSYSTEM"; const char *PL_SUBSYSTEM_STRING = "PL_SUBSYSTEM"; @@ -507,6 +508,8 @@ const char *translateObject(object_id_t object) { return CFDP_HANDLER_STRING; case 0x73000206: return CFDP_DISTRIBUTOR_STRING; + case 0x7300207: + return CFDP_FAULT_HANDLER_STRING; case 0x73010000: return EIVE_SYSTEM_STRING; case 0x73010001: diff --git a/mission/cfdp/CfdpFaultHandler.h b/mission/cfdp/CfdpFaultHandler.h index 565606c6..09ba0847 100644 --- a/mission/cfdp/CfdpFaultHandler.h +++ b/mission/cfdp/CfdpFaultHandler.h @@ -1,28 +1,35 @@ #ifndef MISSION_CFDP_CFDPFAULTHANDLER_H_ #define MISSION_CFDP_CFDPFAULTHANDLER_H_ +#include "defs.h" #include "fsfw/cfdp.h" namespace cfdp { -class EiveFaultHandler : public cfdp::FaultHandlerBase { +class EiveFaultHandler : public cfdp::FaultHandlerBase, public SystemObject { public: + EiveFaultHandler(object_id_t objectId) : SystemObject(objectId) {} + void noticeOfSuspensionCb(cfdp::TransactionId& id, cfdp::ConditionCode code) override { sif::warning << "Notice of suspension detected for transaction " << id << " with condition code: " << cfdp::getConditionCodeString(code) << std::endl; + triggerEvent(cfdp::FAULT_HANDLER_TRIGGERED, FaultHandlerCode::NOTICE_OF_SUSPENSION, code); } void noticeOfCancellationCb(cfdp::TransactionId& id, cfdp::ConditionCode code) override { sif::warning << "Notice of suspension detected for transaction " << id << " with condition code: " << cfdp::getConditionCodeString(code) << std::endl; + triggerEvent(cfdp::FAULT_HANDLER_TRIGGERED, FaultHandlerCode::NOTICE_OF_CANCELLATION, code); } void abandonCb(cfdp::TransactionId& id, cfdp::ConditionCode code) override { sif::warning << "Transaction " << id << " was abandoned, condition code : " << cfdp::getConditionCodeString(code) << std::endl; + triggerEvent(cfdp::FAULT_HANDLER_TRIGGERED, FaultHandlerCode::ABANDON_TRANSACTION, code); } void ignoreCb(cfdp::TransactionId& id, cfdp::ConditionCode code) override { sif::warning << "Fault ignored for transaction " << id << ", condition code: " << cfdp::getConditionCodeString(code) << std::endl; + triggerEvent(cfdp::FAULT_HANDLER_TRIGGERED, FaultHandlerCode::IGNORE_ERROR, code); } }; diff --git a/mission/cfdp/defs.h b/mission/cfdp/defs.h new file mode 100644 index 00000000..249bec04 --- /dev/null +++ b/mission/cfdp/defs.h @@ -0,0 +1,16 @@ +#ifndef MISSION_CFDP_DEFS_H_ +#define MISSION_CFDP_DEFS_H_ + +#include "eive/eventSubsystemIds.h" +#include "fsfw/events/Event.h" + +namespace cfdp { + +static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::CFDP_APP; + +//! [EXPORT] : [COMMENT] P1: CFDP fault handler code. P2: CFDP condition code. +static constexpr Event FAULT_HANDLER_TRIGGERED = event::makeEvent(SUBSYSTEM_ID, 0, severity::LOW); + +} // namespace cfdp + +#endif /* MISSION_CFDP_DEFS_H_ */ diff --git a/mission/genericFactory.cpp b/mission/genericFactory.cpp index 25b59f9b..47cb1a5f 100644 --- a/mission/genericFactory.cpp +++ b/mission/genericFactory.cpp @@ -86,7 +86,6 @@ EntityId REMOTE_CFDP_ID(UnsignedByteField(config::EIVE_GROUND_CFDP_ENT RemoteEntityCfg GROUND_REMOTE_CFG(REMOTE_CFDP_ID); OneRemoteConfigProvider REMOTE_CFG_PROVIDER(GROUND_REMOTE_CFG); HostFilesystem HOST_FS; -EiveFaultHandler EIVE_FAULT_HANDLER; } // namespace cfdp @@ -290,7 +289,8 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_, PusTmFun cfdp::EntityId localId(apid); GROUND_REMOTE_CFG.defaultChecksum = cfdp::ChecksumType::CRC_32; GROUND_REMOTE_CFG.maxFileSegmentLen = config::CFDP_MAX_FILE_SEGMENT_LEN; - CfdpHandlerCfg cfdpCfg(localId, indicationCfg, *eiveUserHandler, EIVE_FAULT_HANDLER, PACKET_LIST, + auto eiveFaultHandler = new EiveFaultHandler(objects::CFDP_FAULT_HANDLER); + CfdpHandlerCfg cfdpCfg(localId, indicationCfg, *eiveUserHandler, *eiveFaultHandler, PACKET_LIST, LOST_SEGMENTS, REMOTE_CFG_PROVIDER); auto* cfdpHandler = new CfdpHandler(params, cfdpCfg, signals::CFDP_CHANNEL_THROTTLE_SIGNAL); // All CFDP packets arrive wrapped inside CCSDS space packets diff --git a/tmtc b/tmtc index 60f7ae54..7a664eea 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 60f7ae5453b387ee5ebcf6a338c34284004dbce7 +Subproject commit 7a664eeab8efbdb01502dacb1777df74bd5dc78a From 7906274204083b657ade34c71d8f2aa3cbe0680c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 19 Oct 2023 11:29:23 +0200 Subject: [PATCH 2/5] obj ID fix --- common/config/eive/objects.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/config/eive/objects.h b/common/config/eive/objects.h index 8c6d59fa..c7e56715 100644 --- a/common/config/eive/objects.h +++ b/common/config/eive/objects.h @@ -166,7 +166,7 @@ enum commonObjects : uint32_t { CFDP_TM_FUNNEL = 0x73000102, CFDP_HANDLER = 0x73000205, CFDP_DISTRIBUTOR = 0x73000206, - CFDP_FAULT_HANDLER = 0x7300207, + CFDP_FAULT_HANDLER = 0x73000207, MISC_TM_STORE = 0x73020001, OK_TM_STORE = 0x73020002, NOT_OK_TM_STORE = 0x73020003, From 3d04fb05eef48ccbbe0e79c3eb08e146ae22be61 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 19 Oct 2023 11:29:52 +0200 Subject: [PATCH 3/5] updated obj ID --- bsp_hosted/fsfwconfig/events/translateEvents.cpp | 2 +- bsp_hosted/fsfwconfig/objects/translateObjects.cpp | 4 ++-- generators/bsp_hosted_objects.csv | 2 +- generators/bsp_q7s_objects.csv | 2 +- generators/events/translateEvents.cpp | 2 +- generators/objects/translateObjects.cpp | 4 ++-- linux/fsfwconfig/events/translateEvents.cpp | 2 +- linux/fsfwconfig/objects/translateObjects.cpp | 4 ++-- tmtc | 2 +- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/bsp_hosted/fsfwconfig/events/translateEvents.cpp b/bsp_hosted/fsfwconfig/events/translateEvents.cpp index 8456f7e6..62dafe33 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 315 translations. * @details - * Generated on: 2023-10-19 11:23:41 + * Generated on: 2023-10-19 11:29:35 */ #include "translateEvents.h" diff --git a/bsp_hosted/fsfwconfig/objects/translateObjects.cpp b/bsp_hosted/fsfwconfig/objects/translateObjects.cpp index 500d3c0c..8a61f2ed 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 175 translations. - * Generated on: 2023-10-19 11:23:41 + * Generated on: 2023-10-19 11:29:35 */ #include "translateObjects.h" @@ -494,7 +494,7 @@ const char *translateObject(object_id_t object) { return CFDP_HANDLER_STRING; case 0x73000206: return CFDP_DISTRIBUTOR_STRING; - case 0x7300207: + case 0x73000207: return CFDP_FAULT_HANDLER_STRING; case 0x73010000: return EIVE_SYSTEM_STRING; diff --git a/generators/bsp_hosted_objects.csv b/generators/bsp_hosted_objects.csv index 8c35f20d..254d093a 100644 --- a/generators/bsp_hosted_objects.csv +++ b/generators/bsp_hosted_objects.csv @@ -153,7 +153,7 @@ 0x73000102;CFDP_TM_FUNNEL 0x73000205;CFDP_HANDLER 0x73000206;CFDP_DISTRIBUTOR -0x7300207;CFDP_FAULT_HANDLER +0x73000207;CFDP_FAULT_HANDLER 0x73010000;EIVE_SYSTEM 0x73010001;ACS_SUBSYSTEM 0x73010002;PL_SUBSYSTEM diff --git a/generators/bsp_q7s_objects.csv b/generators/bsp_q7s_objects.csv index 5700955a..1ada26dd 100644 --- a/generators/bsp_q7s_objects.csv +++ b/generators/bsp_q7s_objects.csv @@ -158,7 +158,7 @@ 0x73000102;CFDP_TM_FUNNEL 0x73000205;CFDP_HANDLER 0x73000206;CFDP_DISTRIBUTOR -0x7300207;CFDP_FAULT_HANDLER +0x73000207;CFDP_FAULT_HANDLER 0x73010000;EIVE_SYSTEM 0x73010001;ACS_SUBSYSTEM 0x73010002;PL_SUBSYSTEM diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index 8456f7e6..62dafe33 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 315 translations. * @details - * Generated on: 2023-10-19 11:23:41 + * Generated on: 2023-10-19 11:29:35 */ #include "translateEvents.h" diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index 3476cf7f..d8046cb8 100644 --- a/generators/objects/translateObjects.cpp +++ b/generators/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 179 translations. - * Generated on: 2023-10-19 11:23:41 + * Generated on: 2023-10-19 11:29:35 */ #include "translateObjects.h" @@ -508,7 +508,7 @@ const char *translateObject(object_id_t object) { return CFDP_HANDLER_STRING; case 0x73000206: return CFDP_DISTRIBUTOR_STRING; - case 0x7300207: + case 0x73000207: return CFDP_FAULT_HANDLER_STRING; case 0x73010000: return EIVE_SYSTEM_STRING; diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index 8456f7e6..62dafe33 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 315 translations. * @details - * Generated on: 2023-10-19 11:23:41 + * Generated on: 2023-10-19 11:29:35 */ #include "translateEvents.h" diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index 3476cf7f..d8046cb8 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 179 translations. - * Generated on: 2023-10-19 11:23:41 + * Generated on: 2023-10-19 11:29:35 */ #include "translateObjects.h" @@ -508,7 +508,7 @@ const char *translateObject(object_id_t object) { return CFDP_HANDLER_STRING; case 0x73000206: return CFDP_DISTRIBUTOR_STRING; - case 0x7300207: + case 0x73000207: return CFDP_FAULT_HANDLER_STRING; case 0x73010000: return EIVE_SYSTEM_STRING; diff --git a/tmtc b/tmtc index 7a664eea..6bd94cc1 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 7a664eeab8efbdb01502dacb1777df74bd5dc78a +Subproject commit 6bd94cc167179fba04ff188d38eb5801496760bc From f4abb3fed6d32ca29c0298a9fd72c1a1f4af05e2 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 19 Oct 2023 13:42:54 +0200 Subject: [PATCH 4/5] instructions unclear, wrote a whole state machine --- mission/system/EiveSystem.cpp | 61 +++++++++++++++++++++-------------- mission/system/EiveSystem.h | 7 ++++ 2 files changed, 43 insertions(+), 25 deletions(-) diff --git a/mission/system/EiveSystem.cpp b/mission/system/EiveSystem.cpp index 0df0fc95..df971355 100644 --- a/mission/system/EiveSystem.cpp +++ b/mission/system/EiveSystem.cpp @@ -70,6 +70,9 @@ void EiveSystem::performChildOperation() { } pdecRecoveryLogic(); i2cRecoveryLogic(); + if (forcePlOffState != ForcePlOffState::NONE) { + forceOffPayload(); + } } ReturnValue_t EiveSystem::initialize() { @@ -203,7 +206,7 @@ void EiveSystem::handleEventMessages() { break; } case power::POWER_LEVEL_LOW: { - forceOffPayload(); + forcePlOffState = ForcePlOffState::FORCE_ALL_EXCEPT_SUPV_OFF; break; } case power::POWER_LEVEL_CRITICAL: @@ -403,37 +406,45 @@ void EiveSystem::pdecRecoveryLogic() { void EiveSystem::forceOffPayload() { CommandMessage msg; + ReturnValue_t result; // set PL to faulty HealthMessage::setHealthMessage(&msg, HealthMessage::HEALTH_SET, HasHealthIF::FAULTY); - ReturnValue_t result = commandQueue->sendMessage(plPcduQueueId, &msg); - if (result != returnvalue::OK) { - sif::error << "EIVE System: Sending FAULTY command to PL PCDU failed" << std::endl; + if (forcePlOffState == ForcePlOffState::FORCE_ALL_EXCEPT_SUPV_OFF) { + result = commandQueue->sendMessage(plocMpsocQueueId, &msg); + if (result != returnvalue::OK) { + sif::error << "EIVE System: Sending FAULTY command to PLOC MPSOC failed" << std::endl; + } + result = commandQueue->sendMessage(cameraQueueId, &msg); + if (result != returnvalue::OK) { + sif::error << "EIVE System: Sending FAULTY command to PL CAM failed" << std::endl; + } + result = commandQueue->sendMessage(scexQueueId, &msg); + if (result != returnvalue::OK) { + sif::error << "EIVE System: Sending FAULTY command to SCEX failed" << std::endl; + } + result = commandQueue->sendMessage(radSensorQueueId, &msg); + if (result != returnvalue::OK) { + sif::error << "EIVE System: Sending FAULTY command to RAD SENSOR failed" << std::endl; + } + result = commandQueue->sendMessage(plPcduQueueId, &msg); + if (result != returnvalue::OK) { + sif::error << "EIVE System: Sending FAULTY command to PL PCDU failed" << std::endl; + } + forcePlOffState = ForcePlOffState::WAITING; + supvOffDelay.resetTimer(); } - result = commandQueue->sendMessage(plocMpsocQueueId, &msg); - if (result != returnvalue::OK) { - sif::error << "EIVE System: Sending FAULTY command to PLOC MPSOC failed" << std::endl; + if (forcePlOffState == ForcePlOffState::WAITING and supvOffDelay.hasTimedOut()) { + forcePlOffState == ForcePlOffState::FORCE_SUPV_OFF; } - result = commandQueue->sendMessage(plocSupervisorQueueId, &msg); - if (result != returnvalue::OK) { - sif::error << "EIVE System: Sending FAULTY command to PLOC SUPERVISOR failed" << std::endl; - } - - result = commandQueue->sendMessage(cameraQueueId, &msg); - if (result != returnvalue::OK) { - sif::error << "EIVE System: Sending FAULTY command to PL CAM failed" << std::endl; - } - - result = commandQueue->sendMessage(scexQueueId, &msg); - if (result != returnvalue::OK) { - sif::error << "EIVE System: Sending FAULTY command to SCEX failed" << std::endl; - } - - result = commandQueue->sendMessage(radSensorQueueId, &msg); - if (result != returnvalue::OK) { - sif::error << "EIVE System: Sending FAULTY command to RAD SENSOR failed" << std::endl; + if (forcePlOffState == ForcePlOffState::FORCE_SUPV_OFF) { + result = commandQueue->sendMessage(plocSupervisorQueueId, &msg); + if (result != returnvalue::OK) { + sif::error << "EIVE System: Sending FAULTY command to PLOC SUPERVISOR failed" << std::endl; + } + forcePlOffState = ForcePlOffState::NONE; } } diff --git a/mission/system/EiveSystem.h b/mission/system/EiveSystem.h index 78f8bdc9..fed5791a 100644 --- a/mission/system/EiveSystem.h +++ b/mission/system/EiveSystem.h @@ -22,6 +22,12 @@ class EiveSystem : public Subsystem, public HasActionsIF { [[nodiscard]] MessageQueueId_t getCommandQueue() const override; private: + enum class ForcePlOffState { + NONE, + FORCE_ALL_EXCEPT_SUPV_OFF, + WAITING, + FORCE_SUPV_OFF + } forcePlOffState = ForcePlOffState::NONE; enum class I2cRebootState { NONE, SYSTEM_MODE_BOOT, @@ -37,6 +43,7 @@ class EiveSystem : public Subsystem, public HasActionsIF { bool alreadyTriedI2cRecovery = false; uint8_t frameDirtyErrorCounter = 0; + Countdown supvOffDelay = Countdown(3000); Countdown frameDirtyCheckCd = Countdown(10000); // If the PDEC reset was already attempted in the last 2 minutes, there is a high chance that // only a full reboot will fix the issue. From 1f203e9f762a2fc6fb4c77c82e09bad736944293 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 19 Oct 2023 14:20:40 +0200 Subject: [PATCH 5/5] improvements for SoC FDIR --- CHANGELOG.md | 7 +++++++ mission/system/EiveSystem.cpp | 9 +++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9308d71d..6575d053 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,8 @@ will consitute of a breaking change warranting a new major release: CFDP interface. - Proper back pressure handling for the CFDP handler, where the `LiveTmTask` is able to throttle the CFDP handler. +- The EIVE system will command the payload OFF explicitely again when receiving the + `power::POWER_LEVEL_CRITICAL` event. ## Fixed @@ -36,6 +38,11 @@ will consitute of a breaking change warranting a new major release: is not in normal mode. - MPSoC debug mode. +## Changed + +- Added a 3 second delay in the EIVE system between commanding all PL components except the SUPV, + and the SUPV itself OFF when the power level becomes low or critical. + # [v7.1.0] 2023-10-11 - Bumped `eive-tmtc` to v5.8.0. diff --git a/mission/system/EiveSystem.cpp b/mission/system/EiveSystem.cpp index df971355..cd450502 100644 --- a/mission/system/EiveSystem.cpp +++ b/mission/system/EiveSystem.cpp @@ -209,7 +209,11 @@ void EiveSystem::handleEventMessages() { forcePlOffState = ForcePlOffState::FORCE_ALL_EXCEPT_SUPV_OFF; break; } - case power::POWER_LEVEL_CRITICAL: + case power::POWER_LEVEL_CRITICAL: { + // Force payload off in any case. It really should not be on when the power level + // becomes critical, but better be safe than sorry.. + forcePlOffState = ForcePlOffState::FORCE_ALL_EXCEPT_SUPV_OFF; + // Also set the STR assembly to faulty, which should cause a fallback to SAFE mode. CommandMessage msg; HealthMessage::setHealthMessage(&msg, HealthMessage::HEALTH_SET, HasHealthIF::FAULTY); ReturnValue_t result = MessageQueueSenderIF::sendMessage( @@ -219,6 +223,7 @@ void EiveSystem::handleEventMessages() { << std::endl; } break; + } } break; default: @@ -436,7 +441,7 @@ void EiveSystem::forceOffPayload() { } if (forcePlOffState == ForcePlOffState::WAITING and supvOffDelay.hasTimedOut()) { - forcePlOffState == ForcePlOffState::FORCE_SUPV_OFF; + forcePlOffState = ForcePlOffState::FORCE_SUPV_OFF; } if (forcePlOffState == ForcePlOffState::FORCE_SUPV_OFF) {