Syrlinks FDIR #232

Merged
meierj merged 6 commits from mueller/syrlinks-fdir into develop 2022-04-30 19:03:16 +02:00
18 changed files with 190 additions and 24 deletions
Showing only changes of commit 3d817363e6 - Show all commits

View File

@ -15,8 +15,10 @@ list yields a list of all related PRs for each release.
## Added ## Added
- Custom Syrlinks FDIR which disabled most of the default FDIR functionality - Custom Syrlinks FDIR which disabled most of the default FDIR functionality
## Changed ## Changed
- PCDU handler only called once in PST, but can handle multiple messages now - PCDU handler only called once in PST, but can handle multiple messages now

View File

@ -1,5 +1,6 @@
#include "ObjectFactory.h" #include "ObjectFactory.h"
#include <mission/system/fdir/GomspacePowerFdir.h>
#include <mission/system/fdir/SyrlinksFdir.h> #include <mission/system/fdir/SyrlinksFdir.h>
#include "OBSWConfig.h" #include "OBSWConfig.h"
@ -253,14 +254,22 @@ void ObjectFactory::createPcduComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchI
CspCookie* pdu1CspCookie = new CspCookie(PDU::MAX_REPLY_LENGTH, addresses::PDU1); CspCookie* pdu1CspCookie = new CspCookie(PDU::MAX_REPLY_LENGTH, addresses::PDU1);
CspCookie* pdu2CspCookie = new CspCookie(PDU::MAX_REPLY_LENGTH, addresses::PDU2); CspCookie* pdu2CspCookie = new CspCookie(PDU::MAX_REPLY_LENGTH, addresses::PDU2);
CspCookie* acuCspCookie = new CspCookie(ACU::MAX_REPLY_LENGTH, addresses::ACU); CspCookie* acuCspCookie = new CspCookie(ACU::MAX_REPLY_LENGTH, addresses::ACU);
/* Device Handler */
auto p60Fdir = new GomspacePowerFdir(objects::P60DOCK_HANDLER);
P60DockHandler* p60dockhandler = P60DockHandler* p60dockhandler =
new P60DockHandler(objects::P60DOCK_HANDLER, objects::CSP_COM_IF, p60DockCspCookie); new P60DockHandler(objects::P60DOCK_HANDLER, objects::CSP_COM_IF, p60DockCspCookie, p60Fdir);
auto pdu1Fdir = new GomspacePowerFdir(objects::PDU1_HANDLER);
PDU1Handler* pdu1handler = PDU1Handler* pdu1handler =
new PDU1Handler(objects::PDU1_HANDLER, objects::CSP_COM_IF, pdu1CspCookie); new PDU1Handler(objects::PDU1_HANDLER, objects::CSP_COM_IF, pdu1CspCookie, pdu1Fdir);
auto pdu2Fdir = new GomspacePowerFdir(objects::PDU2_HANDLER);
PDU2Handler* pdu2handler = PDU2Handler* pdu2handler =
new PDU2Handler(objects::PDU2_HANDLER, objects::CSP_COM_IF, pdu2CspCookie); new PDU2Handler(objects::PDU2_HANDLER, objects::CSP_COM_IF, pdu2CspCookie, pdu2Fdir);
ACUHandler* acuhandler = new ACUHandler(objects::ACU_HANDLER, objects::CSP_COM_IF, acuCspCookie);
auto acuFdir = new GomspacePowerFdir(objects::ACU_HANDLER);
ACUHandler* acuhandler =
new ACUHandler(objects::ACU_HANDLER, objects::CSP_COM_IF, acuCspCookie, acuFdir);
auto pcduHandler = new PCDUHandler(objects::PCDU_HANDLER, 50); auto pcduHandler = new PCDUHandler(objects::PCDU_HANDLER, 50);
/** /**

2
fsfw

@ -1 +1 @@
Subproject commit d61fe7db93b37dd6652dbfee5b7c93f400ac5a11 Subproject commit 43aad11859d5ca772d4323b24626d7a94646f3fd

View File

@ -2,8 +2,9 @@
#include "OBSWConfig.h" #include "OBSWConfig.h"
ACUHandler::ACUHandler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie) ACUHandler::ACUHandler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie,
: GomspaceDeviceHandler(objectId, comIF, comCookie, ACU::MAX_CONFIGTABLE_ADDRESS, FailureIsolationBase *customFdir)
: GomspaceDeviceHandler(objectId, comIF, comCookie, customFdir, ACU::MAX_CONFIGTABLE_ADDRESS,
ACU::MAX_HKTABLE_ADDRESS, ACU::HK_TABLE_REPLY_SIZE), ACU::MAX_HKTABLE_ADDRESS, ACU::HK_TABLE_REPLY_SIZE),
acuHkTableDataset(this) {} acuHkTableDataset(this) {}

View File

@ -12,7 +12,8 @@
*/ */
class ACUHandler : public GomspaceDeviceHandler { class ACUHandler : public GomspaceDeviceHandler {
public: public:
ACUHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie); ACUHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie,
FailureIsolationBase* customFdir);
virtual ~ACUHandler(); virtual ~ACUHandler();
void setDebugMode(bool enable); void setDebugMode(bool enable);

View File

@ -7,9 +7,10 @@
#include "devicedefinitions/powerDefinitions.h" #include "devicedefinitions/powerDefinitions.h"
GomspaceDeviceHandler::GomspaceDeviceHandler(object_id_t objectId, object_id_t comIF, GomspaceDeviceHandler::GomspaceDeviceHandler(object_id_t objectId, object_id_t comIF,
CookieIF* comCookie, uint16_t maxConfigTableAddress, CookieIF* comCookie, FailureIsolationBase* customFdir,
uint16_t maxConfigTableAddress,
uint16_t maxHkTableAddress, uint16_t hkTableReplySize) uint16_t maxHkTableAddress, uint16_t hkTableReplySize)
: DeviceHandlerBase(objectId, comIF, comCookie), : DeviceHandlerBase(objectId, comIF, comCookie, customFdir),
maxConfigTableAddress(maxConfigTableAddress), maxConfigTableAddress(maxConfigTableAddress),
maxHkTableAddress(maxHkTableAddress), maxHkTableAddress(maxHkTableAddress),
hkTableReplySize(hkTableReplySize) { hkTableReplySize(hkTableReplySize) {

View File

@ -38,8 +38,8 @@ class GomspaceDeviceHandler : public DeviceHandlerBase {
* device. * device.
*/ */
GomspaceDeviceHandler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie, GomspaceDeviceHandler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie,
uint16_t maxConfigTableAddress, uint16_t maxHkTableAddress, FailureIsolationBase *customFdir, uint16_t maxConfigTableAddress,
uint16_t hkTableReplySize); uint16_t maxHkTableAddress, uint16_t hkTableReplySize);
virtual ~GomspaceDeviceHandler(); virtual ~GomspaceDeviceHandler();
/** /**

View File

@ -4,9 +4,11 @@
#include "OBSWConfig.h" #include "OBSWConfig.h"
P60DockHandler::P60DockHandler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie) P60DockHandler::P60DockHandler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie,
: GomspaceDeviceHandler(objectId, comIF, comCookie, P60Dock::MAX_CONFIGTABLE_ADDRESS, FailureIsolationBase *customFdir)
P60Dock::MAX_HKTABLE_ADDRESS, P60Dock::HK_TABLE_REPLY_SIZE), : GomspaceDeviceHandler(objectId, comIF, comCookie, customFdir,
P60Dock::MAX_CONFIGTABLE_ADDRESS, P60Dock::MAX_HKTABLE_ADDRESS,
P60Dock::HK_TABLE_REPLY_SIZE),
coreHk(this), coreHk(this),
auxHk(this) {} auxHk(this) {}

View File

@ -21,7 +21,8 @@ class P60DockHandler : public GomspaceDeviceHandler {
//! [EXPORT] : [COMMENT] Battery mode has changed. P1: Old mode. P2: New mode //! [EXPORT] : [COMMENT] Battery mode has changed. P1: Old mode. P2: New mode
static constexpr Event BATT_MODE_CHANGED = event::makeEvent(SUBSYSTEM_ID, 2, severity::MEDIUM); static constexpr Event BATT_MODE_CHANGED = event::makeEvent(SUBSYSTEM_ID, 2, severity::MEDIUM);
P60DockHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie); P60DockHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie,
FailureIsolationBase* customFdir);
virtual ~P60DockHandler(); virtual ~P60DockHandler();
void setDebugMode(bool enable); void setDebugMode(bool enable);

View File

@ -5,8 +5,9 @@
#include "devices/powerSwitcherList.h" #include "devices/powerSwitcherList.h"
PDU1Handler::PDU1Handler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie) PDU1Handler::PDU1Handler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie,
: GomspaceDeviceHandler(objectId, comIF, comCookie, PDU::MAX_CONFIGTABLE_ADDRESS, FailureIsolationBase *customFdir)
: GomspaceDeviceHandler(objectId, comIF, comCookie, customFdir, PDU::MAX_CONFIGTABLE_ADDRESS,
PDU::MAX_HKTABLE_ADDRESS, PDU::HK_TABLE_REPLY_SIZE), PDU::MAX_HKTABLE_ADDRESS, PDU::HK_TABLE_REPLY_SIZE),
coreHk(this), coreHk(this),
auxHk(this) {} auxHk(this) {}

View File

@ -21,7 +21,8 @@
*/ */
class PDU1Handler : public GomspaceDeviceHandler { class PDU1Handler : public GomspaceDeviceHandler {
public: public:
PDU1Handler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie); PDU1Handler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie,
FailureIsolationBase* customFdir);
virtual ~PDU1Handler(); virtual ~PDU1Handler();
virtual ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap, virtual ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,

View File

@ -5,8 +5,9 @@
#include "devices/powerSwitcherList.h" #include "devices/powerSwitcherList.h"
PDU2Handler::PDU2Handler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie) PDU2Handler::PDU2Handler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie,
: GomspaceDeviceHandler(objectId, comIF, comCookie, PDU::MAX_CONFIGTABLE_ADDRESS, FailureIsolationBase *customFdir)
: GomspaceDeviceHandler(objectId, comIF, comCookie, customFdir, PDU::MAX_CONFIGTABLE_ADDRESS,
PDU::MAX_HKTABLE_ADDRESS, PDU::HK_TABLE_REPLY_SIZE), PDU::MAX_HKTABLE_ADDRESS, PDU::HK_TABLE_REPLY_SIZE),
coreHk(this), coreHk(this),
auxHk(this) {} auxHk(this) {}

View File

@ -21,7 +21,8 @@
*/ */
class PDU2Handler : public GomspaceDeviceHandler { class PDU2Handler : public GomspaceDeviceHandler {
public: public:
PDU2Handler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie); PDU2Handler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie,
FailureIsolationBase* customFdir);
virtual ~PDU2Handler(); virtual ~PDU2Handler();
virtual ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap, virtual ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,

View File

@ -3,4 +3,5 @@ target_sources(${LIB_EIVE_MISSION} PRIVATE
RtdFdir.cpp RtdFdir.cpp
SusFdir.cpp SusFdir.cpp
SyrlinksFdir.cpp SyrlinksFdir.cpp
GomspacePowerFdir.cpp
) )

View File

@ -0,0 +1,128 @@
#include "GomspacePowerFdir.h"
#include "fsfw/devicehandlers/DeviceHandlerIF.h"
#include "fsfw/health/HealthTableIF.h"
#include "fsfw/modes/HasModesIF.h"
#include "fsfw/objectmanager/ObjectManager.h"
#include "fsfw/power/Fuse.h"
#include "fsfw/serviceinterface/ServiceInterfaceStream.h"
#include "fsfw/thermal/ThermalComponentIF.h"
#include "mission/devices/devicedefinitions/powerDefinitions.h"
GomspacePowerFdir::GomspacePowerFdir(object_id_t devId, object_id_t parentId)
: DeviceHandlerFailureIsolation(devId, parentId) {}
ReturnValue_t GomspacePowerFdir::eventReceived(EventMessage* event) {
if (isFdirInActionOrAreWeFaulty(event)) {
return RETURN_OK;
}
ReturnValue_t result = RETURN_FAILED;
switch (event->getEvent()) {
case HasModesIF::MODE_TRANSITION_FAILED:
case HasModesIF::OBJECT_IN_INVALID_MODE:
case DeviceHandlerIF::DEVICE_WANTS_HARD_REBOOT:
// We'll try a recovery as long as defined in MAX_REBOOT.
// Might cause some AssemblyBase cycles, so keep number low.
// handleRecovery(event->getEvent());
triggerEvent(power::FDIR_REACTION_IGNORED, event->getEvent(), 0);
break;
case DeviceHandlerIF::DEVICE_INTERPRETING_REPLY_FAILED:
case DeviceHandlerIF::DEVICE_READING_REPLY_FAILED:
case DeviceHandlerIF::DEVICE_UNREQUESTED_REPLY:
case DeviceHandlerIF::DEVICE_UNKNOWN_REPLY: // Some DH's generate generic reply-ids.
case DeviceHandlerIF::DEVICE_BUILDING_COMMAND_FAILED:
// These faults all mean that there were stupid replies from a device.
if (strangeReplyCount.incrementAndCheck()) {
// handleRecovery(event->getEvent());
triggerEvent(power::FDIR_REACTION_IGNORED, event->getEvent(), 0);
}
break;
case DeviceHandlerIF::DEVICE_SENDING_COMMAND_FAILED:
case DeviceHandlerIF::DEVICE_REQUESTING_REPLY_FAILED:
// The two above should never be confirmed.
case DeviceHandlerIF::DEVICE_MISSED_REPLY:
result = sendConfirmationRequest(event);
if (result == HasReturnvaluesIF::RETURN_OK) {
break;
}
// else
if (missedReplyCount.incrementAndCheck()) {
// handleRecovery(event->getEvent());
triggerEvent(power::FDIR_REACTION_IGNORED, event->getEvent(), 0);
}
break;
case StorageManagerIF::GET_DATA_FAILED:
case StorageManagerIF::STORE_DATA_FAILED:
// Rather strange bugs, occur in RAW mode only. Ignore.
break;
case DeviceHandlerIF::INVALID_DEVICE_COMMAND:
// Ignore, is bad configuration. We can't do anything in flight.
break;
case HasHealthIF::HEALTH_INFO:
case HasModesIF::MODE_INFO:
case HasModesIF::CHANGING_MODE:
// Do nothing, but mark as handled.
break;
//****Power*****
case PowerSwitchIF::SWITCH_WENT_OFF:
if (powerConfirmation != MessageQueueIF::NO_QUEUE) {
result = sendConfirmationRequest(event, powerConfirmation);
if (result == RETURN_OK) {
setFdirState(DEVICE_MIGHT_BE_OFF);
}
}
break;
case Fuse::FUSE_WENT_OFF:
// Not so good, because PCDU reacted.
case Fuse::POWER_ABOVE_HIGH_LIMIT:
// Better, because software detected over-current.
setFaulty(event->getEvent());
break;
case Fuse::POWER_BELOW_LOW_LIMIT:
// Device might got stuck during boot, retry.
// handleRecovery(event->getEvent());
triggerEvent(power::FDIR_REACTION_IGNORED, event->getEvent(), 0);
break;
//****Thermal*****
case ThermalComponentIF::COMPONENT_TEMP_LOW:
case ThermalComponentIF::COMPONENT_TEMP_HIGH:
case ThermalComponentIF::COMPONENT_TEMP_OOL_LOW:
case ThermalComponentIF::COMPONENT_TEMP_OOL_HIGH:
// Well, the device is not really faulty, but it is required to stay off as long as possible.
setFaulty(event->getEvent());
break;
case ThermalComponentIF::TEMP_NOT_IN_OP_RANGE:
// Ignore, is information only.
break;
//*******Default monitoring variables. Are currently not used.*****
// case DeviceHandlerIF::MONITORING_LIMIT_EXCEEDED:
// setFaulty(event->getEvent());
// break;
// case DeviceHandlerIF::MONITORING_AMBIGUOUS:
// break;
default:
// We don't know the event, someone else should handle it.
return RETURN_FAILED;
}
return RETURN_OK;
}
void GomspacePowerFdir::eventConfirmed(EventMessage* event) {
switch (event->getEvent()) {
case DeviceHandlerIF::DEVICE_SENDING_COMMAND_FAILED:
case DeviceHandlerIF::DEVICE_REQUESTING_REPLY_FAILED:
case DeviceHandlerIF::DEVICE_MISSED_REPLY:
if (missedReplyCount.incrementAndCheck()) {
// handleRecovery(event->getEvent());
triggerEvent(power::FDIR_REACTION_IGNORED, event->getEvent(), 0);
}
break;
case PowerSwitchIF::SWITCH_WENT_OFF:
// This means the switch went off only for one device.
// handleRecovery(event->getEvent());
triggerEvent(power::FDIR_REACTION_IGNORED, event->getEvent(), 0);
break;
default:
break;
}
}

View File

@ -0,0 +1,15 @@
#ifndef MISSION_SYSTEM_FDIR_GOMSPACEPOWERFDIR_H_
#define MISSION_SYSTEM_FDIR_GOMSPACEPOWERFDIR_H_
#include <fsfw/devicehandlers/DeviceHandlerFailureIsolation.h>
class GomspacePowerFdir : public DeviceHandlerFailureIsolation {
public:
GomspacePowerFdir(object_id_t devId, object_id_t parentId = objects::NO_OBJECT);
private:
ReturnValue_t eventReceived(EventMessage* event) override;
void eventConfirmed(EventMessage* event) override;
};
#endif /* MISSION_SYSTEM_FDIR_GOMSPACEPOWERFDIR_H_ */

1
thirdparty/etl vendored Submodule

@ -0,0 +1 @@
Subproject commit c308dc427b7a34e54f33860fb2e244564b2740b4

2
tmtc

@ -1 +1 @@
Subproject commit 76da8042a4601087e99fa856af241afe9e43695d Subproject commit e939f2b934b20f273a94a7c4d9665f7568cb9cee