From 809d25890e8f24c4e7746669e30b13cecba6aa7f Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 7 Jun 2023 11:33:09 +0200 Subject: [PATCH 001/257] init --- common/config/eive/objects.h | 1 + linux/ObjectFactory.cpp | 6 +++ mission/controller/PowerController.cpp | 54 ++++++++++++++++++++++++++ mission/controller/PowerController.h | 38 ++++++++++++++++++ 4 files changed, 99 insertions(+) create mode 100644 mission/controller/PowerController.cpp create mode 100644 mission/controller/PowerController.h diff --git a/common/config/eive/objects.h b/common/config/eive/objects.h index 0cc4b9d9..ca741c77 100644 --- a/common/config/eive/objects.h +++ b/common/config/eive/objects.h @@ -26,6 +26,7 @@ enum commonObjects : uint32_t { THERMAL_CONTROLLER = 0x43400001, ACS_CONTROLLER = 0x43000002, CORE_CONTROLLER = 0x43000003, + POWER_CONTROLLER = 0x43000004, GLOBAL_JSON_CFG = 0x43000006, /* 0x44 ('D') for device handlers */ diff --git a/linux/ObjectFactory.cpp b/linux/ObjectFactory.cpp index 766b5ca2..b74057c1 100644 --- a/linux/ObjectFactory.cpp +++ b/linux/ObjectFactory.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -337,6 +338,11 @@ AcsController* ObjectFactory::createAcsController(bool connectSubsystem, bool en return acsCtrl; } +PowerController* ObjectFactory::createPowerController(bool enableHkSets) { + auto pwrCtrl = new PowerController(objects::POWER_CONTROLLER, enableHkSets); + return pwrCtrl; +} + void ObjectFactory::gpioChecker(ReturnValue_t result, std::string output) { if (result != returnvalue::OK) { sif::error << "ObjectFactory: Adding GPIOs failed for " << output << std::endl; diff --git a/mission/controller/PowerController.cpp b/mission/controller/PowerController.cpp new file mode 100644 index 00000000..84a6a33f --- /dev/null +++ b/mission/controller/PowerController.cpp @@ -0,0 +1,54 @@ +#include +#include + +PowerController::PowerController(object_id_t objectId, bool enableHkSets) + : ExtendedControllerBase(objectId), enableHkSets(enableHkSets) {} + +ReturnValue_t PowerController::initialize() { + ReturnValue_t result = parameterHelper.initialize(); + if (result != returnvalue::OK) { + return result; + } + return ExtendedControllerBase::initialize(); +} + +ReturnValue_t PowerController::handleCommandMessage(CommandMessage *message) { + ReturnValue_t result = actionHelper.handleActionMessage(message); + if (result == returnvalue::OK) { + return result; + } + result = parameterHelper.handleParameterMessage(message); + if (result == returnvalue::OK) { + return result; + } + return result; +} + +void PowerController::performControlOperation() { + switch (internalState) { + case InternalState::STARTUP: { + initialCountdown.resetTimer(); + internalState = InternalState::INITIAL_DELAY; + return; + } + case InternalState::INITIAL_DELAY: { + if (initialCountdown.hasTimedOut()) { + internalState = InternalState::READY; + } + return; + } + case InternalState::READY: { + if (mode != MODE_OFF) { + // do something + } + break; + } + default: + break; + } +} + +ReturnValue_t PowerController::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, + LocalDataPoolManager &poolManager) { + return returnvalue::OK; +} diff --git a/mission/controller/PowerController.h b/mission/controller/PowerController.h new file mode 100644 index 00000000..70d13401 --- /dev/null +++ b/mission/controller/PowerController.h @@ -0,0 +1,38 @@ +#ifndef MISSION_CONTROLLER_POWERCONTROLLER_H_ +#define MISSION_CONTROLLER_POWERCONTROLLER_H_ + +#include +#include +#include +#include + +class PowerController : public ExtendedControllerBase, public ReceivesParameterMessagesIF { + public: + static constexpr dur_millis_t INIT_DELAY = 500; + + PowerController(object_id_t objectId, bool enableHkSets); + + MessageQueueId_t getCommandQueue() const; + ReturnValue_t getParameter(uint8_t domainId, uint8_t parameterId, + ParameterWrapper* parameterWrapper, const ParameterWrapper* newValues, + uint16_t startAtIndex) override; + + private: + bool enableHkSets = false; + ParameterHelper parameterHelper; + + enum class InternalState { STARTUP, INITIAL_DELAY, READY }; + InternalState internalState = InternalState::STARTUP; + + // Initial delay to make sure all pool variables have been initialized their owners + Countdown initialCountdown = Countdown(INIT_DELAY); + + ReturnValue_t initialize() override; + ReturnValue_t handleCommandMessage(CommandMessage* message) override; + ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap, + LocalDataPoolManager& poolManager) override; + LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override; + void performControlOperation() override; +}; + +#endif /* MISSION_CONTROLLER_POWERCONTROLLER_H_ */ From 1dd38acee4d103be9dfc8657d2d39e3cc7fc7848 Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 7 Jun 2023 14:30:58 +0200 Subject: [PATCH 002/257] object factory stuff --- bsp_q7s/em/emObjectFactory.cpp | 1 + bsp_q7s/fmObjectFactory.cpp | 1 + linux/ObjectFactory.h | 2 ++ mission/controller/CMakeLists.txt | 3 ++- mission/controller/PowerController.cpp | 3 ++- mission/controller/PowerController.h | 2 ++ 6 files changed, 10 insertions(+), 2 deletions(-) diff --git a/bsp_q7s/em/emObjectFactory.cpp b/bsp_q7s/em/emObjectFactory.cpp index 5b2935b7..cbf1d34a 100644 --- a/bsp_q7s/em/emObjectFactory.cpp +++ b/bsp_q7s/em/emObjectFactory.cpp @@ -155,5 +155,6 @@ void ObjectFactory::produce(void* args) { HeaterHandler* heaterHandler; createHeaterComponents(gpioComIF, pwrSwitcher, healthTable, heaterHandler); createThermalController(*heaterHandler); + createPowerController(enableHkSets); satsystem::init(); } diff --git a/bsp_q7s/fmObjectFactory.cpp b/bsp_q7s/fmObjectFactory.cpp index df0bbc91..fa94aeec 100644 --- a/bsp_q7s/fmObjectFactory.cpp +++ b/bsp_q7s/fmObjectFactory.cpp @@ -113,5 +113,6 @@ void ObjectFactory::produce(void* args) { createMiscComponents(); createThermalController(*heaterHandler); createAcsController(true, enableHkSets); + createPowerC satsystem::init(); } diff --git a/linux/ObjectFactory.h b/linux/ObjectFactory.h index 16801ba9..d8605f48 100644 --- a/linux/ObjectFactory.h +++ b/linux/ObjectFactory.h @@ -16,6 +16,7 @@ class GpioIF; class SpiComIF; class PowerSwitchIF; class AcsController; +class PowerController; namespace ObjectFactory { @@ -31,5 +32,6 @@ void createScexComponents(std::string uartDev, PowerSwitchIF* pwrSwitcher, void gpioChecker(ReturnValue_t result, std::string output); AcsController* createAcsController(bool connectSubsystem, bool enableHkSets); +PowerController* createPowerController(bool enableHkSets); } // namespace ObjectFactory diff --git a/mission/controller/CMakeLists.txt b/mission/controller/CMakeLists.txt index 6177a14b..901decc0 100644 --- a/mission/controller/CMakeLists.txt +++ b/mission/controller/CMakeLists.txt @@ -1,6 +1,7 @@ if(TGT_BSP MATCHES "arm/q7s" OR TGT_BSP MATCHES "") target_sources(${LIB_EIVE_MISSION} PRIVATE ThermalController.cpp - AcsController.cpp) + AcsController.cpp + PowerController.cpp) endif() add_subdirectory(acs) diff --git a/mission/controller/PowerController.cpp b/mission/controller/PowerController.cpp index 84a6a33f..9264deeb 100644 --- a/mission/controller/PowerController.cpp +++ b/mission/controller/PowerController.cpp @@ -2,13 +2,14 @@ #include PowerController::PowerController(object_id_t objectId, bool enableHkSets) - : ExtendedControllerBase(objectId), enableHkSets(enableHkSets) {} + : ExtendedControllerBase(objectId), enableHkSets(enableHkSets), parameterHelper(this) {} ReturnValue_t PowerController::initialize() { ReturnValue_t result = parameterHelper.initialize(); if (result != returnvalue::OK) { return result; } + sif::debug << "fuck you" << std::endl; return ExtendedControllerBase::initialize(); } diff --git a/mission/controller/PowerController.h b/mission/controller/PowerController.h index 70d13401..8e2f6339 100644 --- a/mission/controller/PowerController.h +++ b/mission/controller/PowerController.h @@ -32,6 +32,8 @@ class PowerController : public ExtendedControllerBase, public ReceivesParameterM ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap, LocalDataPoolManager& poolManager) override; LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override; + ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode, + uint32_t* msToReachTheMode) override; void performControlOperation() override; }; From 824f445ee1a60ddcc2dcbb674888730fcd440042 Mon Sep 17 00:00:00 2001 From: meggert Date: Sat, 10 Jun 2023 15:14:20 +0200 Subject: [PATCH 003/257] boop --- bsp_q7s/fmObjectFactory.cpp | 2 +- mission/controller/PowerController.cpp | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/bsp_q7s/fmObjectFactory.cpp b/bsp_q7s/fmObjectFactory.cpp index fa94aeec..b040810c 100644 --- a/bsp_q7s/fmObjectFactory.cpp +++ b/bsp_q7s/fmObjectFactory.cpp @@ -113,6 +113,6 @@ void ObjectFactory::produce(void* args) { createMiscComponents(); createThermalController(*heaterHandler); createAcsController(true, enableHkSets); - createPowerC + createPowerController(enableHkSets); satsystem::init(); } diff --git a/mission/controller/PowerController.cpp b/mission/controller/PowerController.cpp index 9264deeb..c817eb21 100644 --- a/mission/controller/PowerController.cpp +++ b/mission/controller/PowerController.cpp @@ -53,3 +53,23 @@ ReturnValue_t PowerController::initializeLocalDataPool(localpool::DataPool &loca LocalDataPoolManager &poolManager) { return returnvalue::OK; } + +LocalPoolDataSetBase *PowerController::getDataSetHandle(sid_t sid) { + switch (sid.ownerSetId) { + default: + return nullptr; + } + return nullptr; +} + +ReturnValue_t PowerController::checkModeCommand(Mode_t mode, Submode_t submode, + uint32_t *msToReachTheMode) { + if (mode == MODE_OFF) { + if (submode == SUBMODE_NONE) { + return returnvalue::OK; + } else { + return INVALID_SUBMODE; + } + } + return INVALID_MODE; +} From a53f1be7105b57a1cf15b788a6bbc2a2019c613a Mon Sep 17 00:00:00 2001 From: meggert Date: Thu, 15 Jun 2023 17:51:32 +0200 Subject: [PATCH 004/257] guess i never pushed this --- mission/controller/PowerController.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mission/controller/PowerController.cpp b/mission/controller/PowerController.cpp index c817eb21..1b22bbb2 100644 --- a/mission/controller/PowerController.cpp +++ b/mission/controller/PowerController.cpp @@ -25,6 +25,15 @@ ReturnValue_t PowerController::handleCommandMessage(CommandMessage *message) { return result; } +MessageQueueId_t PowerController::getCommandQueue() const { return commandQueue->getId(); } + +ReturnValue_t PowerController::getParameter(uint8_t domainId, uint8_t parameterId, + ParameterWrapper *parameterWrapper, + const ParameterWrapper *newValues, + uint16_t startAtIndex) { + return returnvalue::FAILED; +} + void PowerController::performControlOperation() { switch (internalState) { case InternalState::STARTUP: { From 72ca1be6e2856049d65b90c1e78adcb9526ec3a6 Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 26 Jul 2023 10:08:40 +0200 Subject: [PATCH 005/257] I was told this was not nice --- mission/controller/PowerController.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mission/controller/PowerController.cpp b/mission/controller/PowerController.cpp index 1b22bbb2..bfecc67c 100644 --- a/mission/controller/PowerController.cpp +++ b/mission/controller/PowerController.cpp @@ -9,7 +9,7 @@ ReturnValue_t PowerController::initialize() { if (result != returnvalue::OK) { return result; } - sif::debug << "fuck you" << std::endl; + sif::debug << "Rush B, no stop" << std::endl; return ExtendedControllerBase::initialize(); } From 2480229dcb3228fecf1ccf8b41ded0e373733e61 Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 26 Jul 2023 10:37:41 +0200 Subject: [PATCH 006/257] objectFactory and scheduling --- bsp_q7s/em/emObjectFactory.cpp | 1 + bsp_q7s/fmObjectFactory.cpp | 1 + common/config/eive/definitions.h | 3 +++ mission/pollingSeqTables.cpp | 3 +++ 4 files changed, 8 insertions(+) diff --git a/bsp_q7s/em/emObjectFactory.cpp b/bsp_q7s/em/emObjectFactory.cpp index 3a1f7ac5..f887ad6f 100644 --- a/bsp_q7s/em/emObjectFactory.cpp +++ b/bsp_q7s/em/emObjectFactory.cpp @@ -167,6 +167,7 @@ void ObjectFactory::produce(void* args) { power::Switches::PDU1_CH5_SOLAR_CELL_EXP_5V); #endif createAcsController(true, enableHkSets); + createPowerController(enableHkSets); HeaterHandler* heaterHandler; createHeaterComponents(gpioComIF, pwrSwitcher, healthTable, heaterHandler); createThermalController(*heaterHandler, true); diff --git a/bsp_q7s/fmObjectFactory.cpp b/bsp_q7s/fmObjectFactory.cpp index e43e3551..718f9bcd 100644 --- a/bsp_q7s/fmObjectFactory.cpp +++ b/bsp_q7s/fmObjectFactory.cpp @@ -130,5 +130,6 @@ void ObjectFactory::produce(void* args) { createMiscComponents(); createThermalController(*heaterHandler, false); createAcsController(true, enableHkSets); + createPowerController(enableHkSets); satsystem::init(false); } diff --git a/common/config/eive/definitions.h b/common/config/eive/definitions.h index b369f512..2653ee74 100644 --- a/common/config/eive/definitions.h +++ b/common/config/eive/definitions.h @@ -79,6 +79,7 @@ static constexpr uint32_t SCHED_BLOCK_RTD = 150; static constexpr uint32_t SCHED_BLOCK_7_RW_READ_MS = 300; static constexpr uint32_t SCHED_BLOCK_8_PLPCDU_MS = 320; static constexpr uint32_t SCHED_BLOCK_9_RAD_SENS_MS = 340; +static constexpr uint32_t SCHED_BLOCK_10_EPS_CTRL_MS = 350; // 15 ms for FM static constexpr float SCHED_BLOCK_1_PERIOD = static_cast(SCHED_BLOCK_1_SUS_READ_MS) / 400.0; @@ -94,6 +95,8 @@ static constexpr float SCHED_BLOCK_RTD_PERIOD = static_cast(SCHED_BLOCK_R static constexpr float SCHED_BLOCK_7_PERIOD = static_cast(SCHED_BLOCK_7_RW_READ_MS) / 400.0; static constexpr float SCHED_BLOCK_8_PERIOD = static_cast(SCHED_BLOCK_8_PLPCDU_MS) / 400.0; static constexpr float SCHED_BLOCK_9_PERIOD = static_cast(SCHED_BLOCK_9_RAD_SENS_MS) / 400.0; +static constexpr float SCHED_BLOCK_10_PERIOD = + static_cast(SCHED_BLOCK_10_EPS_CTRL_MS) / 400.0; } // namespace spiSched diff --git a/mission/pollingSeqTables.cpp b/mission/pollingSeqTables.cpp index 4896d8db..8f052e77 100644 --- a/mission/pollingSeqTables.cpp +++ b/mission/pollingSeqTables.cpp @@ -591,6 +591,9 @@ ReturnValue_t pst::pstTcsAndAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg thisSequence->addSlot(objects::BPX_BATT_HANDLER, length * config::spiSched::SCHED_BLOCK_9_PERIOD, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::POWER_CONTROLLER, length * config::spiSched::SCHED_BLOCK_10_PERIOD, + 0); + /* Radiation sensor */ thisSequence->addSlot(objects::RAD_SENSOR, length * config::spiSched::SCHED_BLOCK_9_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); From 5a69b52b20f296847fb04091a8ac6e583626900b Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 26 Jul 2023 11:18:15 +0200 Subject: [PATCH 007/257] datasets --- mission/controller/PowerController.cpp | 12 +++++--- mission/controller/PowerController.h | 12 ++++++++ .../PowerCtrlDefinitions.h | 29 +++++++++++++++++++ 3 files changed, 49 insertions(+), 4 deletions(-) create mode 100644 mission/controller/controllerdefinitions/PowerCtrlDefinitions.h diff --git a/mission/controller/PowerController.cpp b/mission/controller/PowerController.cpp index bfecc67c..595a74f2 100644 --- a/mission/controller/PowerController.cpp +++ b/mission/controller/PowerController.cpp @@ -2,7 +2,10 @@ #include PowerController::PowerController(object_id_t objectId, bool enableHkSets) - : ExtendedControllerBase(objectId), enableHkSets(enableHkSets), parameterHelper(this) {} + : ExtendedControllerBase(objectId), + enableHkSets(enableHkSets), + parameterHelper(this), + stateOfChargeData(this) {} ReturnValue_t PowerController::initialize() { ReturnValue_t result = parameterHelper.initialize(); @@ -48,9 +51,10 @@ void PowerController::performControlOperation() { return; } case InternalState::READY: { - if (mode != MODE_OFF) { - // do something - } + // if (mode != MODE_OFF) { + sif::debug << "oh shit, now i gotta do something" << std::endl; + // do something + //} break; } default: diff --git a/mission/controller/PowerController.h b/mission/controller/PowerController.h index 8e2f6339..70a7b297 100644 --- a/mission/controller/PowerController.h +++ b/mission/controller/PowerController.h @@ -5,6 +5,9 @@ #include #include #include +#include +#include +#include class PowerController : public ExtendedControllerBase, public ReceivesParameterMessagesIF { public: @@ -35,6 +38,15 @@ class PowerController : public ExtendedControllerBase, public ReceivesParameterM ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode, uint32_t* msToReachTheMode) override; void performControlOperation() override; + + // HK Datasets for Calculation + BpxBatteryHk bpxBatteryHk = BpxBatteryHk(objects::BPX_BATT_HANDLER); + P60Dock::CoreHkSet p60CoreHk = P60Dock::CoreHkSet(objects::P60DOCK_HANDLER); + PDU1::Pdu1CoreHk pdu1CoreHk = PDU1::Pdu1CoreHk(objects::PDU1_HANDLER); + PDU2::Pdu2CoreHk pdu2CoreHk = PDU2::Pdu2CoreHk(objects::PDU2_HANDLER); + ACU::CoreHk acuCoreHk = ACU::CoreHk(objects::ACU_HANDLER); + // Output Dataset + pwrctrl::StateOfChargedData stateOfChargeData; }; #endif /* MISSION_CONTROLLER_POWERCONTROLLER_H_ */ diff --git a/mission/controller/controllerdefinitions/PowerCtrlDefinitions.h b/mission/controller/controllerdefinitions/PowerCtrlDefinitions.h new file mode 100644 index 00000000..d4eeeed0 --- /dev/null +++ b/mission/controller/controllerdefinitions/PowerCtrlDefinitions.h @@ -0,0 +1,29 @@ +#ifndef MISSION_CONTROLLER_CONTROLLERDEFINITIONS_POWERCTRLDEFINITIONS_H_ +#define MISSION_CONTROLLER_CONTROLLERDEFINITIONS_POWERCTRLDEFINITIONS_H_ + +#include +#include + +#include + +namespace pwrctrl { + +enum SetIds : uint32_t { STATE_OF_CHARGE_DATA }; + +enum PoolIds : lp_id_t { + +}; + +static constexpr uint8_t STATE_OF_CHARGE_ENTRIES = 6; + +class StateOfChargedData : public StaticLocalDataSet { + public: + StateOfChargedData(HasLocalDataPoolIF* hkOwner) + : StaticLocalDataSet(hkOwner, STATE_OF_CHARGE_DATA) {} + + private: +}; + +} // namespace pwrctrl + +#endif /* MISSION_CONTROLLER_CONTROLLERDEFINITIONS_POWERCTRLDEFINITIONS_H_ */ From 88a89691425d4b5ce563a3179e1f7391c550593b Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 26 Jul 2023 17:01:48 +0200 Subject: [PATCH 008/257] basics --- mission/controller/PowerController.cpp | 101 +++++++++++++++++- mission/controller/PowerController.h | 52 +++++++++ .../PowerCtrlDefinitions.h | 10 +- mission/pollingSeqTables.cpp | 6 +- 4 files changed, 163 insertions(+), 6 deletions(-) diff --git a/mission/controller/PowerController.cpp b/mission/controller/PowerController.cpp index 595a74f2..38db8847 100644 --- a/mission/controller/PowerController.cpp +++ b/mission/controller/PowerController.cpp @@ -34,7 +34,20 @@ ReturnValue_t PowerController::getParameter(uint8_t domainId, uint8_t parameterI ParameterWrapper *parameterWrapper, const ParameterWrapper *newValues, uint16_t startAtIndex) { - return returnvalue::FAILED; + switch (domainId) { + case 0x0: // direct members + switch (parameterId) { + case 0x0: + parameterWrapper->set(batteryInternalResistance); + break; + default: + return INVALID_IDENTIFIER_ID; + } + break; + default: + return INVALID_DOMAIN_ID; + }; + return returnvalue::OK; } void PowerController::performControlOperation() { @@ -53,6 +66,7 @@ void PowerController::performControlOperation() { case InternalState::READY: { // if (mode != MODE_OFF) { sif::debug << "oh shit, now i gotta do something" << std::endl; + calculateStateOfCharge(); // do something //} break; @@ -69,6 +83,8 @@ ReturnValue_t PowerController::initializeLocalDataPool(localpool::DataPool &loca LocalPoolDataSetBase *PowerController::getDataSetHandle(sid_t sid) { switch (sid.ownerSetId) { + case pwrctrl::STATE_OF_CHARGE_DATA: + return &stateOfChargeData; default: return nullptr; } @@ -86,3 +102,86 @@ ReturnValue_t PowerController::checkModeCommand(Mode_t mode, Submode_t submode, } return INVALID_MODE; } + +void PowerController::calculateStateOfCharge() { + // get time + timeval now; + Clock::getClock_timeval(&now); + + // update EPS hk values + ReturnValue_t result = updateEpsData(); + + float iBat = p60CoreHk.batteryCurrent.value + bpxBatteryHk.heaterCurrent.value + + bpxBatteryHk.dischargeCurrent.value; + + // Open Circuit Voltage Charge + // ToDo: battery heater and battery discharge currents missing + float vBatCorrected = p60CoreHk.batteryVoltage.value - iBat * batteryInternalResistance; + uint8_t lookUpTableIdx; + for (lookUpTableIdx = 24; lookUpTableIdx > 0; lookUpTableIdx--) { + if (lookUpTableOcv[1][lookUpTableIdx] < vBatCorrected) { + break; + } + } + // ToDo: check indexing + float openCircuitVoltageCharge = + lookUpTableOcv[0][lookUpTableIdx] + + (vBatCorrected - lookUpTableOcv[1][lookUpTableIdx]) * + (lookUpTableOcv[1][lookUpTableIdx + 1] - lookUpTableOcv[1][lookUpTableIdx]) / + (lookUpTableOcv[0][lookUpTableIdx + 1] - lookUpTableOcv[0][lookUpTableIdx]); + + // Coulomb Counter + float coulombCounterCharge = 0; + if (stateOfChargeData.coulombCounterCharge.value == 0) + coulombCounterCharge = openCircuitVoltageCharge; + else { + double timeDiff = timevalOperations::toDouble(now - oldTime); + coulombCounterCharge = stateOfChargeData.coulombCounterCharge.value + iBat * timeDiff; + } + + // commit TM + { + PoolReadGuard pg(&stateOfChargeData); + stateOfChargeData.openCircuitVoltageCharge.value = + charge2stateOfCharge(openCircuitVoltageCharge); + stateOfChargeData.coulombCounterCharge.value = charge2stateOfCharge(coulombCounterCharge); + stateOfChargeData.setValidity(true, true); + } + + // store time for next run + oldTime = now; +} + +ReturnValue_t PowerController::updateEpsData() { + std::vector results; + { + PoolReadGuard pgBat(&bpxBatteryHk); + results.push_back(pgBat.getReadResult()); + } + { + PoolReadGuard pgP60(&p60CoreHk); + results.push_back(pgP60.getReadResult()); + } + { + PoolReadGuard pgPdu1(&pdu1CoreHk); + results.push_back(pgPdu1.getReadResult()); + } + { + PoolReadGuard pgPdu2(&pdu2CoreHk); + results.push_back(pgPdu2.getReadResult()); + } + { + PoolReadGuard pgAcu(&acuCoreHk); + results.push_back(pgAcu.getReadResult()); + } + for (const auto &result : results) { + if (result != returnvalue::OK) { + return result; + } + } + return returnvalue::OK; +} + +float PowerController::charge2stateOfCharge(float capacity) { + return capacity / batteryMaximumCapacity; +} diff --git a/mission/controller/PowerController.h b/mission/controller/PowerController.h index 70a7b297..e49e6b71 100644 --- a/mission/controller/PowerController.h +++ b/mission/controller/PowerController.h @@ -3,12 +3,15 @@ #include #include +#include #include #include #include #include #include +#include + class PowerController : public ExtendedControllerBase, public ReceivesParameterMessagesIF { public: static constexpr dur_millis_t INIT_DELAY = 500; @@ -39,6 +42,55 @@ class PowerController : public ExtendedControllerBase, public ReceivesParameterM uint32_t* msToReachTheMode) override; void performControlOperation() override; + void calculateStateOfCharge(); + ReturnValue_t updateEpsData(); + float charge2stateOfCharge(float capacity); + + // Parameters + float batteryInternalResistance = 70 / 2 / 1000; // [Ohm] + float batteryMaximumCapacity = 2.6 * 2; // [Ah] + + // OCV Look-up-Table + float lookUpTableOcv[2][25] = { + {0.00000000e+00, 3.16227766e-04, 4.52809661e-04, 6.48382625e-04, 9.28425483e-04, + 1.32942162e-03, 1.90361194e-03, 2.72580074e-03, 3.90310099e-03, 5.58888885e-03, + 8.00278514e-03, 1.14592671e-02, 1.64086377e-02, 2.34956903e-02, 3.36437110e-02, + 4.81747620e-02, 6.89819174e-02, 9.87758887e-02, 1.41438170e-01, 2.02526713e-01, + 2.90000000e-01, 3.00000000e-01, 3.62820513e-01, 4.25641026e-01, 4.88461538e-01, + 5.51282051e-01, 6.14102564e-01, 6.76923077e-01, 7.39743590e-01, 8.02564103e-01, + 8.65384615e-01, 9.28205128e-01, 9.91025641e-01, 1.05384615e+00, 1.11666667e+00, + 1.17948718e+00, 1.24230769e+00, 1.30512821e+00, 1.36794872e+00, 1.43076923e+00, + 1.49358974e+00, 1.55641026e+00, 1.61923077e+00, 1.68205128e+00, 1.74487179e+00, + 1.80769231e+00, 1.87051282e+00, 1.93333333e+00, 1.99615385e+00, 2.05897436e+00, + 2.12179487e+00, 2.18461538e+00, 2.24743590e+00, 2.31025641e+00, 2.37307692e+00, + 2.43589744e+00, 2.49871795e+00, 2.56153846e+00, 2.62435897e+00, 2.68717949e+00, + 2.75000000e+00, 2.81282051e+00, 2.87564103e+00, 2.93846154e+00, 3.00128205e+00, + 3.06410256e+00, 3.12692308e+00, 3.18974359e+00, 3.25256410e+00, 3.31538462e+00, + 3.37820513e+00, 3.44102564e+00, 3.50384615e+00, 3.56666667e+00, 3.62948718e+00, + 3.69230769e+00, 3.75512821e+00, 3.81794872e+00, 3.88076923e+00, 3.94358974e+00, + 4.00641026e+00, 4.06923077e+00, 4.13205128e+00, 4.19487179e+00, 4.25769231e+00, + 4.32051282e+00, 4.38333333e+00, 4.44615385e+00, 4.50897436e+00, 4.57179487e+00, + 4.63461538e+00, 4.69743590e+00, 4.76025641e+00, 4.82307692e+00, 4.88589744e+00, + 4.94871795e+00, 5.01153846e+00, 5.07435897e+00, 5.13717949e+00, 5.20000000e+00}, + {12.52033533, 12.58720948, 12.61609309, 12.65612591, 12.67105282, 12.69242681, 12.72303245, + 12.76685696, 12.80313768, 12.83600741, 12.8830739, 12.94720576, 13.00112629, 13.07833563, + 13.17486308, 13.27128842, 13.37713879, 13.49275604, 13.60395193, 13.68708863, 13.75196335, + 13.7582376, 13.79298643, 13.82885799, 13.87028849, 13.91585718, 13.96701874, 14.02343574, + 14.07665641, 14.12626342, 14.1675095, 14.20582917, 14.23342159, 14.25724476, 14.27264301, + 14.28922389, 14.30898535, 14.32750837, 14.34358057, 14.35965277, 14.37698366, 14.3943261, + 14.41079196, 14.42679817, 14.44261008, 14.45771025, 14.47281042, 14.48751461, 14.50193089, + 14.5164887, 14.53193477, 14.54738084, 14.56341235, 14.58054578, 14.59799552, 14.61632769, + 14.63716465, 14.66935073, 14.70511347, 14.74315094, 14.77251031, 14.80005585, 14.8315427, + 14.86078285, 14.89444687, 14.93495892, 14.97114013, 15.01055751, 15.0538516, 15.09698825, + 15.14850029, 15.18947994, 15.24249483, 15.28521713, 15.335695, 15.37950723, 15.43241224, + 15.48082213, 15.53314287, 15.58907248, 15.64030253, 15.68385331, 15.74149122, 15.80051882, + 15.84959348, 15.90443241, 15.95743724, 16.01283068, 16.07629253, 16.13470801, 16.1890518, + 16.24200781, 16.30521118, 16.37368429, 16.43661267, 16.49604875, 16.56223813, 16.62741412, + 16.67249918, 16.74926904}}; + + // Variables + timeval oldTime; + // HK Datasets for Calculation BpxBatteryHk bpxBatteryHk = BpxBatteryHk(objects::BPX_BATT_HANDLER); P60Dock::CoreHkSet p60CoreHk = P60Dock::CoreHkSet(objects::P60DOCK_HANDLER); diff --git a/mission/controller/controllerdefinitions/PowerCtrlDefinitions.h b/mission/controller/controllerdefinitions/PowerCtrlDefinitions.h index d4eeeed0..770889c1 100644 --- a/mission/controller/controllerdefinitions/PowerCtrlDefinitions.h +++ b/mission/controller/controllerdefinitions/PowerCtrlDefinitions.h @@ -11,16 +11,22 @@ namespace pwrctrl { enum SetIds : uint32_t { STATE_OF_CHARGE_DATA }; enum PoolIds : lp_id_t { - + OPEN_CIRCUIT_VOLTAGE_CHARGE, + COULOMB_COUNTER_CHARGE, }; -static constexpr uint8_t STATE_OF_CHARGE_ENTRIES = 6; +static constexpr uint8_t STATE_OF_CHARGE_ENTRIES = 2; class StateOfChargedData : public StaticLocalDataSet { public: StateOfChargedData(HasLocalDataPoolIF* hkOwner) : StaticLocalDataSet(hkOwner, STATE_OF_CHARGE_DATA) {} + lp_var_t openCircuitVoltageCharge = + lp_var_t(sid.objectId, OPEN_CIRCUIT_VOLTAGE_CHARGE, this); + lp_var_t coulombCounterCharge = + lp_var_t(sid.objectId, COULOMB_COUNTER_CHARGE, this); + private: }; diff --git a/mission/pollingSeqTables.cpp b/mission/pollingSeqTables.cpp index 8f052e77..e2517abd 100644 --- a/mission/pollingSeqTables.cpp +++ b/mission/pollingSeqTables.cpp @@ -133,6 +133,9 @@ ReturnValue_t pst::pstGompaceCan(FixedTimeslotTaskIF *thisSequence) { thisSequence->addSlot(objects::PDU1_HANDLER, length * 0.5, DeviceHandlerIF::GET_READ); thisSequence->addSlot(objects::PDU2_HANDLER, length * 0.5, DeviceHandlerIF::GET_READ); thisSequence->addSlot(objects::ACU_HANDLER, length * 0.5, DeviceHandlerIF::GET_READ); + + thisSequence->addSlot(objects::POWER_CONTROLLER, length * 0.6, 0); + if (thisSequence->checkSequence() != returnvalue::OK) { sif::error << "GomSpace PST initialization failed" << std::endl; return returnvalue::FAILED; @@ -591,9 +594,6 @@ ReturnValue_t pst::pstTcsAndAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg thisSequence->addSlot(objects::BPX_BATT_HANDLER, length * config::spiSched::SCHED_BLOCK_9_PERIOD, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::POWER_CONTROLLER, length * config::spiSched::SCHED_BLOCK_10_PERIOD, - 0); - /* Radiation sensor */ thisSequence->addSlot(objects::RAD_SENSOR, length * config::spiSched::SCHED_BLOCK_9_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); From a0025030f103c6998984c909cc9c2fa81a5b1ca5 Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 28 Jul 2023 11:36:20 +0200 Subject: [PATCH 009/257] first bits of cleanup --- mission/controller/PowerController.cpp | 109 +++++++++++------- mission/controller/PowerController.h | 17 ++- .../PowerCtrlDefinitions.h | 14 ++- mission/power/defs.h | 7 ++ 4 files changed, 99 insertions(+), 48 deletions(-) diff --git a/mission/controller/PowerController.cpp b/mission/controller/PowerController.cpp index 38db8847..fa6ab403 100644 --- a/mission/controller/PowerController.cpp +++ b/mission/controller/PowerController.cpp @@ -1,11 +1,11 @@ -#include + #include PowerController::PowerController(object_id_t objectId, bool enableHkSets) : ExtendedControllerBase(objectId), enableHkSets(enableHkSets), parameterHelper(this), - stateOfChargeData(this) {} + pwrCtrlCoreHk(this) {} ReturnValue_t PowerController::initialize() { ReturnValue_t result = parameterHelper.initialize(); @@ -40,6 +40,9 @@ ReturnValue_t PowerController::getParameter(uint8_t domainId, uint8_t parameterI case 0x0: parameterWrapper->set(batteryInternalResistance); break; + case 0x1: + parameterWrapper->set(batteryMaximumCapacity); + break; default: return INVALID_IDENTIFIER_ID; } @@ -78,13 +81,18 @@ void PowerController::performControlOperation() { ReturnValue_t PowerController::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, LocalDataPoolManager &poolManager) { + localDataPoolMap.emplace(pwrctrl::PoolIds::TOTAL_BATTERY_CURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(pwrctrl::PoolIds::OPEN_CIRCUIT_VOLTAGE_CHARGE, + new PoolEntry({0.0})); + localDataPoolMap.emplace(pwrctrl::PoolIds::COULOMB_COUNTER_CHARGE, new PoolEntry({0.0})); + poolManager.subscribeForRegularPeriodicPacket({pwrCtrlCoreHk.getSid(), enableHkSets, 60.0}); return returnvalue::OK; } LocalPoolDataSetBase *PowerController::getDataSetHandle(sid_t sid) { switch (sid.ownerSetId) { - case pwrctrl::STATE_OF_CHARGE_DATA: - return &stateOfChargeData; + case pwrctrl::CORE_HK: + return &pwrCtrlCoreHk; default: return nullptr; } @@ -105,53 +113,72 @@ ReturnValue_t PowerController::checkModeCommand(Mode_t mode, Submode_t submode, void PowerController::calculateStateOfCharge() { // get time - timeval now; Clock::getClock_timeval(&now); - // update EPS hk values + // update EPS HK values ReturnValue_t result = updateEpsData(); - - float iBat = p60CoreHk.batteryCurrent.value + bpxBatteryHk.heaterCurrent.value + - bpxBatteryHk.dischargeCurrent.value; - - // Open Circuit Voltage Charge - // ToDo: battery heater and battery discharge currents missing - float vBatCorrected = p60CoreHk.batteryVoltage.value - iBat * batteryInternalResistance; - uint8_t lookUpTableIdx; - for (lookUpTableIdx = 24; lookUpTableIdx > 0; lookUpTableIdx--) { - if (lookUpTableOcv[1][lookUpTableIdx] < vBatCorrected) { - break; - } - } - // ToDo: check indexing - float openCircuitVoltageCharge = - lookUpTableOcv[0][lookUpTableIdx] + - (vBatCorrected - lookUpTableOcv[1][lookUpTableIdx]) * - (lookUpTableOcv[1][lookUpTableIdx + 1] - lookUpTableOcv[1][lookUpTableIdx]) / - (lookUpTableOcv[0][lookUpTableIdx + 1] - lookUpTableOcv[0][lookUpTableIdx]); - - // Coulomb Counter - float coulombCounterCharge = 0; - if (stateOfChargeData.coulombCounterCharge.value == 0) - coulombCounterCharge = openCircuitVoltageCharge; - else { - double timeDiff = timevalOperations::toDouble(now - oldTime); - coulombCounterCharge = stateOfChargeData.coulombCounterCharge.value + iBat * timeDiff; + if (result != returnvalue::OK) { + triggerEvent(power::DATASET_READ_FAILED); + sif::info << "Power Controller::Reading of Datasets has failed" << std::endl; + return; } - // commit TM + // calculate total battery current + iBat = p60CoreHk.batteryCurrent.value + bpxBatteryHk.heaterCurrent.value + + bpxBatteryHk.dischargeCurrent.value; + + calculateOpenCircuitVoltageCharge(); + calculateCoulombCounterCharge(); + + // commit to dataset { - PoolReadGuard pg(&stateOfChargeData); - stateOfChargeData.openCircuitVoltageCharge.value = - charge2stateOfCharge(openCircuitVoltageCharge); - stateOfChargeData.coulombCounterCharge.value = charge2stateOfCharge(coulombCounterCharge); - stateOfChargeData.setValidity(true, true); + PoolReadGuard pg(&pwrCtrlCoreHk); + if (pg.getReadResult() == returnvalue::OK) { + pwrCtrlCoreHk.totalBatteryCurrent.value = iBat; + pwrCtrlCoreHk.openCircuitVoltageCharge.value = charge2stateOfCharge(openCircuitVoltageCharge); + pwrCtrlCoreHk.coulombCounterCharge.value = charge2stateOfCharge(coulombCounterCharge); + pwrCtrlCoreHk.setValidity(true, true); + } } // store time for next run oldTime = now; } +void PowerController::calculateOpenCircuitVoltageCharge() { + float vBatCorrected = p60CoreHk.batteryVoltage.value - iBat * batteryInternalResistance; + if (vBatCorrected >= lookUpTableOcv[1][100]) { + triggerEvent(power::VOLTAGE_OUT_OF_BOUNDS, 0); + sif::error << "Power Controller::Voltage is too high" << std::endl; + return; + } else if (vBatCorrected <= lookUpTableOcv[1][0]) { + triggerEvent(power::VOLTAGE_OUT_OF_BOUNDS, 1); + sif::error << "Power Controller::Voltage is too low" << std::endl; + return; + } + uint8_t lookUpTableIdx = 99; + while (lookUpTableOcv[1][lookUpTableIdx] > vBatCorrected) { + lookUpTableIdx--; + } + + openCircuitVoltageCharge = linearInterpolation( + vBatCorrected, lookUpTableOcv[1][lookUpTableIdx], lookUpTableOcv[1][lookUpTableIdx + 1], + lookUpTableOcv[0][lookUpTableIdx], lookUpTableOcv[0][lookUpTableIdx + 1]); +} + +void PowerController::calculateCoulombCounterCharge() { + if ((pwrCtrlCoreHk.coulombCounterCharge.value == 0) or + (p60CoreHk.batteryVoltage.value > coulombCounterVoltageUpperThreshold and + pwrCtrlCoreHk.coulombCounterCharge.value >= )) { + coulombCounterCharge = openCircuitVoltageCharge; + } + + else { + double timeDiff = timevalOperations::toDouble(now - oldTime); + coulombCounterCharge = pwrCtrlCoreHk.coulombCounterCharge.value + iBat * timeDiff; + } +} + ReturnValue_t PowerController::updateEpsData() { std::vector results; { @@ -185,3 +212,7 @@ ReturnValue_t PowerController::updateEpsData() { float PowerController::charge2stateOfCharge(float capacity) { return capacity / batteryMaximumCapacity; } + +float PowerController::linearInterpolation(float x, float x0, float x1, float y0, float y1) { + return y0 + (x - x0) * (y1 - y0) / (x1 - x0); +} diff --git a/mission/controller/PowerController.h b/mission/controller/PowerController.h index e49e6b71..d255af7b 100644 --- a/mission/controller/PowerController.h +++ b/mission/controller/PowerController.h @@ -43,15 +43,19 @@ class PowerController : public ExtendedControllerBase, public ReceivesParameterM void performControlOperation() override; void calculateStateOfCharge(); + void calculateOpenCircuitVoltageCharge(); + void calculateCoulombCounterCharge(); ReturnValue_t updateEpsData(); float charge2stateOfCharge(float capacity); + float linearInterpolation(float x, float x0, float x1, float y0, float y1); // Parameters - float batteryInternalResistance = 70 / 2 / 1000; // [Ohm] - float batteryMaximumCapacity = 2.6 * 2; // [Ah] + float batteryInternalResistance = 70.0 / 2.0 / 1000.0; // [Ohm] + float batteryMaximumCapacity = 2.6 * 2; // [Ah] + float coulombCounterVoltageUpperThreshold = 16.2e3; // [mV] // OCV Look-up-Table - float lookUpTableOcv[2][25] = { + float lookUpTableOcv[2][100] = { {0.00000000e+00, 3.16227766e-04, 4.52809661e-04, 6.48382625e-04, 9.28425483e-04, 1.32942162e-03, 1.90361194e-03, 2.72580074e-03, 3.90310099e-03, 5.58888885e-03, 8.00278514e-03, 1.14592671e-02, 1.64086377e-02, 2.34956903e-02, 3.36437110e-02, @@ -89,7 +93,12 @@ class PowerController : public ExtendedControllerBase, public ReceivesParameterM 16.67249918, 16.74926904}}; // Variables + timeval now; timeval oldTime; + int16_t iBat = 0.0; // [mA] + float openCircuitVoltageCharge = 0.0; // [mC] + float coulombCounterCharge = 0; // [mC] + float coulombCounterChargeUpperThreshold = 0.0; // [mC] // HK Datasets for Calculation BpxBatteryHk bpxBatteryHk = BpxBatteryHk(objects::BPX_BATT_HANDLER); @@ -98,7 +107,7 @@ class PowerController : public ExtendedControllerBase, public ReceivesParameterM PDU2::Pdu2CoreHk pdu2CoreHk = PDU2::Pdu2CoreHk(objects::PDU2_HANDLER); ACU::CoreHk acuCoreHk = ACU::CoreHk(objects::ACU_HANDLER); // Output Dataset - pwrctrl::StateOfChargedData stateOfChargeData; + pwrctrl::CoreHk pwrCtrlCoreHk; }; #endif /* MISSION_CONTROLLER_POWERCONTROLLER_H_ */ diff --git a/mission/controller/controllerdefinitions/PowerCtrlDefinitions.h b/mission/controller/controllerdefinitions/PowerCtrlDefinitions.h index 770889c1..f7cce708 100644 --- a/mission/controller/controllerdefinitions/PowerCtrlDefinitions.h +++ b/mission/controller/controllerdefinitions/PowerCtrlDefinitions.h @@ -1,27 +1,31 @@ #ifndef MISSION_CONTROLLER_CONTROLLERDEFINITIONS_POWERCTRLDEFINITIONS_H_ #define MISSION_CONTROLLER_CONTROLLERDEFINITIONS_POWERCTRLDEFINITIONS_H_ +#include #include #include +#include #include namespace pwrctrl { -enum SetIds : uint32_t { STATE_OF_CHARGE_DATA }; +enum SetIds : uint32_t { CORE_HK }; enum PoolIds : lp_id_t { + TOTAL_BATTERY_CURRENT, OPEN_CIRCUIT_VOLTAGE_CHARGE, COULOMB_COUNTER_CHARGE, }; -static constexpr uint8_t STATE_OF_CHARGE_ENTRIES = 2; +static constexpr uint8_t CORE_HK_ENTRIES = 3; -class StateOfChargedData : public StaticLocalDataSet { +class CoreHk : public StaticLocalDataSet { public: - StateOfChargedData(HasLocalDataPoolIF* hkOwner) - : StaticLocalDataSet(hkOwner, STATE_OF_CHARGE_DATA) {} + CoreHk(HasLocalDataPoolIF* hkOwner) : StaticLocalDataSet(hkOwner, CORE_HK) {} + lp_var_t totalBatteryCurrent = + lp_var_t(sid.objectId, TOTAL_BATTERY_CURRENT, this); lp_var_t openCircuitVoltageCharge = lp_var_t(sid.objectId, OPEN_CIRCUIT_VOLTAGE_CHARGE, this); lp_var_t coulombCounterCharge = diff --git a/mission/power/defs.h b/mission/power/defs.h index 13e5e63f..682be614 100644 --- a/mission/power/defs.h +++ b/mission/power/defs.h @@ -47,6 +47,13 @@ static constexpr Event SWITCHING_Q7S_DENIED = event::makeEvent(SUBSYSTEM_ID, 2, static constexpr Event FDIR_REACTION_IGNORED = event::makeEvent(SUBSYSTEM_ID, 3, severity::MEDIUM); +//! [EXPORT] : [COMMENT] The dataset read for the inputs of the Power Controller has failed. +static constexpr Event DATASET_READ_FAILED = event::makeEvent(SUBSYSTEM_ID, 4, severity::INFO); +//! [EXPORT] : [COMMENT] The battery voltage read is out of the bounds in which it is supposed to +//! be. +//! P1: 1 too high, 0 too low +static constexpr Event VOLTAGE_OUT_OF_BOUNDS = event::makeEvent(SUBSYSTEM_ID, 5, severity::HIGH); + enum class States { IDLE, SWITCHING_POWER, CHECKING_POWER, MODE_COMMANDING }; enum class OpCodes { NONE, TO_OFF_DONE, TO_NOT_OFF_DONE, TIMEOUT_OCCURED }; From 0bfd31bc7e54a5f6817ec5f96dc17e8f9d191526 Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 28 Jul 2023 11:38:35 +0200 Subject: [PATCH 010/257] missed that one --- mission/controller/PowerController.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mission/controller/PowerController.cpp b/mission/controller/PowerController.cpp index fa6ab403..eea251e0 100644 --- a/mission/controller/PowerController.cpp +++ b/mission/controller/PowerController.cpp @@ -169,7 +169,7 @@ void PowerController::calculateOpenCircuitVoltageCharge() { void PowerController::calculateCoulombCounterCharge() { if ((pwrCtrlCoreHk.coulombCounterCharge.value == 0) or (p60CoreHk.batteryVoltage.value > coulombCounterVoltageUpperThreshold and - pwrCtrlCoreHk.coulombCounterCharge.value >= )) { + pwrCtrlCoreHk.coulombCounterCharge.value >= coulombCounterChargeUpperThreshold)) { coulombCounterCharge = openCircuitVoltageCharge; } From bc9bb06f2d741e590a4526ed279def6acad93507 Mon Sep 17 00:00:00 2001 From: meggert Date: Mon, 31 Jul 2023 11:51:03 +0200 Subject: [PATCH 011/257] further improvements --- mission/controller/PowerController.cpp | 77 ++++++++++++++++++++------ mission/controller/PowerController.h | 9 ++- 2 files changed, 67 insertions(+), 19 deletions(-) diff --git a/mission/controller/PowerController.cpp b/mission/controller/PowerController.cpp index eea251e0..289e70b8 100644 --- a/mission/controller/PowerController.cpp +++ b/mission/controller/PowerController.cpp @@ -43,6 +43,12 @@ ReturnValue_t PowerController::getParameter(uint8_t domainId, uint8_t parameterI case 0x1: parameterWrapper->set(batteryMaximumCapacity); break; + case 0x2: + parameterWrapper->set(coulombCounterVoltageUpperThreshold); + break; + case 0x3: + parameterWrapper->set(maxAllowedTimeDiff); + break; default: return INVALID_IDENTIFIER_ID; } @@ -119,7 +125,16 @@ void PowerController::calculateStateOfCharge() { ReturnValue_t result = updateEpsData(); if (result != returnvalue::OK) { triggerEvent(power::DATASET_READ_FAILED); - sif::info << "Power Controller::Reading of Datasets has failed" << std::endl; + sif::error << "Power Controller::Reading of Datasets has failed" << std::endl; + { + PoolReadGuard pg(&pwrCtrlCoreHk); + if (pg.getReadResult() == returnvalue::OK) { + pwrCtrlCoreHk.totalBatteryCurrent.value = INVALID_TOTAL_BATTERY_CURRENT; + pwrCtrlCoreHk.openCircuitVoltageCharge.value = INVALID_SOC; + pwrCtrlCoreHk.coulombCounterCharge.value = INVALID_SOC; + pwrCtrlCoreHk.setValidity(false, true); + } + } return; } @@ -127,7 +142,22 @@ void PowerController::calculateStateOfCharge() { iBat = p60CoreHk.batteryCurrent.value + bpxBatteryHk.heaterCurrent.value + bpxBatteryHk.dischargeCurrent.value; - calculateOpenCircuitVoltageCharge(); + result = calculateOpenCircuitVoltageCharge(); + if (result != returnvalue::OK) { + // notifying events have already been triggered + { + PoolReadGuard pg(&pwrCtrlCoreHk); + if (pg.getReadResult() == returnvalue::OK) { + pwrCtrlCoreHk.totalBatteryCurrent.value = iBat; + pwrCtrlCoreHk.totalBatteryCurrent.setValid(true); + pwrCtrlCoreHk.openCircuitVoltageCharge.value = INVALID_SOC; + pwrCtrlCoreHk.openCircuitVoltageCharge.setValid(false); + pwrCtrlCoreHk.coulombCounterCharge.value = INVALID_SOC; + pwrCtrlCoreHk.coulombCounterCharge.setValid(false); + } + } + return; + } calculateCoulombCounterCharge(); // commit to dataset @@ -145,38 +175,35 @@ void PowerController::calculateStateOfCharge() { oldTime = now; } -void PowerController::calculateOpenCircuitVoltageCharge() { +ReturnValue_t PowerController::calculateOpenCircuitVoltageCharge() { float vBatCorrected = p60CoreHk.batteryVoltage.value - iBat * batteryInternalResistance; - if (vBatCorrected >= lookUpTableOcv[1][100]) { - triggerEvent(power::VOLTAGE_OUT_OF_BOUNDS, 0); - sif::error << "Power Controller::Voltage is too high" << std::endl; - return; - } else if (vBatCorrected <= lookUpTableOcv[1][0]) { - triggerEvent(power::VOLTAGE_OUT_OF_BOUNDS, 1); - sif::error << "Power Controller::Voltage is too low" << std::endl; - return; - } uint8_t lookUpTableIdx = 99; - while (lookUpTableOcv[1][lookUpTableIdx] > vBatCorrected) { - lookUpTableIdx--; + ReturnValue_t result = lookUpTableOcvIdxFinder(vBatCorrected, lookUpTableIdx); + if (result != returnvalue::OK) { + return result; } - openCircuitVoltageCharge = linearInterpolation( vBatCorrected, lookUpTableOcv[1][lookUpTableIdx], lookUpTableOcv[1][lookUpTableIdx + 1], lookUpTableOcv[0][lookUpTableIdx], lookUpTableOcv[0][lookUpTableIdx + 1]); + return returnvalue::OK; } -void PowerController::calculateCoulombCounterCharge() { +ReturnValue_t PowerController::calculateCoulombCounterCharge() { if ((pwrCtrlCoreHk.coulombCounterCharge.value == 0) or (p60CoreHk.batteryVoltage.value > coulombCounterVoltageUpperThreshold and pwrCtrlCoreHk.coulombCounterCharge.value >= coulombCounterChargeUpperThreshold)) { coulombCounterCharge = openCircuitVoltageCharge; + return returnvalue::OK; } else { double timeDiff = timevalOperations::toDouble(now - oldTime); - coulombCounterCharge = pwrCtrlCoreHk.coulombCounterCharge.value + iBat * timeDiff; + if (timeDiff < maxAllowedTimeDiff) { + coulombCounterCharge = pwrCtrlCoreHk.coulombCounterCharge.value + iBat * timeDiff; + return returnvalue::OK; + } } + return returnvalue::FAILED; } ReturnValue_t PowerController::updateEpsData() { @@ -216,3 +243,19 @@ float PowerController::charge2stateOfCharge(float capacity) { float PowerController::linearInterpolation(float x, float x0, float x1, float y0, float y1) { return y0 + (x - x0) * (y1 - y0) / (x1 - x0); } + +ReturnValue_t PowerController::lookUpTableOcvIdxFinder(float voltage, uint8_t &idx) { + if (voltage >= lookUpTableOcv[1][100]) { + triggerEvent(power::VOLTAGE_OUT_OF_BOUNDS, 0); + sif::error << "Power Controller::Voltage is too high" << std::endl; + return returnvalue::FAILED; + } else if (voltage <= lookUpTableOcv[1][0]) { + triggerEvent(power::VOLTAGE_OUT_OF_BOUNDS, 1); + sif::error << "Power Controller::Voltage is too low" << std::endl; + return returnvalue::FAILED; + } + while (lookUpTableOcv[1][idx] > voltage) { + idx--; + } + return returnvalue::OK; +} diff --git a/mission/controller/PowerController.h b/mission/controller/PowerController.h index d255af7b..971bc0af 100644 --- a/mission/controller/PowerController.h +++ b/mission/controller/PowerController.h @@ -43,16 +43,18 @@ class PowerController : public ExtendedControllerBase, public ReceivesParameterM void performControlOperation() override; void calculateStateOfCharge(); - void calculateOpenCircuitVoltageCharge(); - void calculateCoulombCounterCharge(); + ReturnValue_t calculateOpenCircuitVoltageCharge(); + ReturnValue_t calculateCoulombCounterCharge(); ReturnValue_t updateEpsData(); float charge2stateOfCharge(float capacity); + ReturnValue_t lookUpTableOcvIdxFinder(float voltage, uint8_t& idx); float linearInterpolation(float x, float x0, float x1, float y0, float y1); // Parameters float batteryInternalResistance = 70.0 / 2.0 / 1000.0; // [Ohm] float batteryMaximumCapacity = 2.6 * 2; // [Ah] float coulombCounterVoltageUpperThreshold = 16.2e3; // [mV] + double maxAllowedTimeDiff = 0.5; // [s] // OCV Look-up-Table float lookUpTableOcv[2][100] = { @@ -100,6 +102,9 @@ class PowerController : public ExtendedControllerBase, public ReceivesParameterM float coulombCounterCharge = 0; // [mC] float coulombCounterChargeUpperThreshold = 0.0; // [mC] + static constexpr float INVALID_TOTAL_BATTERY_CURRENT = 0; + static constexpr float INVALID_SOC = -1; + // HK Datasets for Calculation BpxBatteryHk bpxBatteryHk = BpxBatteryHk(objects::BPX_BATT_HANDLER); P60Dock::CoreHkSet p60CoreHk = P60Dock::CoreHkSet(objects::P60DOCK_HANDLER); From 40ee5ddade994b8e475dc2e51f63c7d1e63c219c Mon Sep 17 00:00:00 2001 From: meggert Date: Mon, 31 Jul 2023 13:14:04 +0200 Subject: [PATCH 012/257] what if everyone was a returnvalue --- mission/controller/PowerController.cpp | 59 +++++++++++++++++++------- mission/controller/PowerController.h | 1 + mission/power/defs.h | 3 ++ 3 files changed, 48 insertions(+), 15 deletions(-) diff --git a/mission/controller/PowerController.cpp b/mission/controller/PowerController.cpp index 289e70b8..21e3ad3d 100644 --- a/mission/controller/PowerController.cpp +++ b/mission/controller/PowerController.cpp @@ -158,7 +158,26 @@ void PowerController::calculateStateOfCharge() { } return; } - calculateCoulombCounterCharge(); + + result = calculateCoulombCounterCharge(); + // store time for next run + oldTime = now; + if (result != returnvalue::OK) { + // notifying events have already been triggered + { + PoolReadGuard pg(&pwrCtrlCoreHk); + if (pg.getReadResult() == returnvalue::OK) { + pwrCtrlCoreHk.totalBatteryCurrent.value = iBat; + pwrCtrlCoreHk.totalBatteryCurrent.setValid(true); + pwrCtrlCoreHk.openCircuitVoltageCharge.value = + charge2stateOfCharge(openCircuitVoltageCharge); + pwrCtrlCoreHk.openCircuitVoltageCharge.setValid(true); + pwrCtrlCoreHk.coulombCounterCharge.value = INVALID_SOC; + pwrCtrlCoreHk.coulombCounterCharge.setValid(false); + } + } + return; + } // commit to dataset { @@ -170,9 +189,6 @@ void PowerController::calculateStateOfCharge() { pwrCtrlCoreHk.setValidity(true, true); } } - - // store time for next run - oldTime = now; } ReturnValue_t PowerController::calculateOpenCircuitVoltageCharge() { @@ -189,21 +205,20 @@ ReturnValue_t PowerController::calculateOpenCircuitVoltageCharge() { } ReturnValue_t PowerController::calculateCoulombCounterCharge() { - if ((pwrCtrlCoreHk.coulombCounterCharge.value == 0) or + double timeDiff = timevalOperations::toDouble(now - oldTime); + if (timeDiff > maxAllowedTimeDiff) { + triggerEvent(power::TIMEDELTA_OUT_OF_BOUNDS); + sif::error << "Power Controller::Time delta too large for Coulomb Counter" << std::endl; + return returnvalue::FAILED; + } + if ((not pwrCtrlCoreHk.coulombCounterCharge.isValid()) or (p60CoreHk.batteryVoltage.value > coulombCounterVoltageUpperThreshold and pwrCtrlCoreHk.coulombCounterCharge.value >= coulombCounterChargeUpperThreshold)) { coulombCounterCharge = openCircuitVoltageCharge; - return returnvalue::OK; + } else { + coulombCounterCharge = pwrCtrlCoreHk.coulombCounterCharge.value + iBat * timeDiff; } - - else { - double timeDiff = timevalOperations::toDouble(now - oldTime); - if (timeDiff < maxAllowedTimeDiff) { - coulombCounterCharge = pwrCtrlCoreHk.coulombCounterCharge.value + iBat * timeDiff; - return returnvalue::OK; - } - } - return returnvalue::FAILED; + return returnvalue::OK; } ReturnValue_t PowerController::updateEpsData() { @@ -259,3 +274,17 @@ ReturnValue_t PowerController::lookUpTableOcvIdxFinder(float voltage, uint8_t &i } return returnvalue::OK; } + +ReturnValue_t PowerController::calculateCoulombCounterChargeUpperThreshold() { + uint8_t lookUpTableIdx = 99; + ReturnValue_t result = + lookUpTableOcvIdxFinder(coulombCounterVoltageUpperThreshold, lookUpTableIdx); + if (result != returnvalue::OK) { + return result; + } + coulombCounterChargeUpperThreshold = + linearInterpolation(coulombCounterVoltageUpperThreshold, lookUpTableOcv[1][lookUpTableIdx], + lookUpTableOcv[1][lookUpTableIdx + 1], lookUpTableOcv[0][lookUpTableIdx], + lookUpTableOcv[0][lookUpTableIdx + 1]); + return returnvalue::OK; +} diff --git a/mission/controller/PowerController.h b/mission/controller/PowerController.h index 971bc0af..0f15363b 100644 --- a/mission/controller/PowerController.h +++ b/mission/controller/PowerController.h @@ -49,6 +49,7 @@ class PowerController : public ExtendedControllerBase, public ReceivesParameterM float charge2stateOfCharge(float capacity); ReturnValue_t lookUpTableOcvIdxFinder(float voltage, uint8_t& idx); float linearInterpolation(float x, float x0, float x1, float y0, float y1); + ReturnValue_t calculateCoulombCounterChargeUpperThreshold(); // Parameters float batteryInternalResistance = 70.0 / 2.0 / 1000.0; // [Ohm] diff --git a/mission/power/defs.h b/mission/power/defs.h index 682be614..87fc3f08 100644 --- a/mission/power/defs.h +++ b/mission/power/defs.h @@ -53,6 +53,9 @@ static constexpr Event DATASET_READ_FAILED = event::makeEvent(SUBSYSTEM_ID, 4, s //! be. //! P1: 1 too high, 0 too low static constexpr Event VOLTAGE_OUT_OF_BOUNDS = event::makeEvent(SUBSYSTEM_ID, 5, severity::HIGH); +//! [EXPORT] : [COMMENT] Time difference for Coulomb Counter was too large. +static constexpr Event TIMEDELTA_OUT_OF_BOUNDS = + event::makeEvent(SUBSYSTEM_ID, 6, severity::MEDIUM); enum class States { IDLE, SWITCHING_POWER, CHECKING_POWER, MODE_COMMANDING }; enum class OpCodes { NONE, TO_OFF_DONE, TO_NOT_OFF_DONE, TIMEOUT_OCCURED }; From f8a7179de634a96606d0b898d6b83f196d6b3a80 Mon Sep 17 00:00:00 2001 From: meggert Date: Mon, 31 Jul 2023 13:27:14 +0200 Subject: [PATCH 013/257] this is overengineered af --- mission/controller/PowerController.cpp | 12 ++++++++++++ mission/controller/PowerController.h | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/mission/controller/PowerController.cpp b/mission/controller/PowerController.cpp index 21e3ad3d..e08fc9eb 100644 --- a/mission/controller/PowerController.cpp +++ b/mission/controller/PowerController.cpp @@ -44,7 +44,12 @@ ReturnValue_t PowerController::getParameter(uint8_t domainId, uint8_t parameterI parameterWrapper->set(batteryMaximumCapacity); break; case 0x2: + float oldCoulombCounterVoltageUpperThreshold = coulombCounterVoltageUpperThreshold; parameterWrapper->set(coulombCounterVoltageUpperThreshold); + ReturnValue_t result = calculateCoulombCounterChargeUpperThreshold(); + if (result != returnvalue::OK) { + coulombCounterVoltageUpperThreshold = oldCoulombCounterVoltageUpperThreshold; + } break; case 0x3: parameterWrapper->set(maxAllowedTimeDiff); @@ -68,6 +73,13 @@ void PowerController::performControlOperation() { } case InternalState::INITIAL_DELAY: { if (initialCountdown.hasTimedOut()) { + internalState = InternalState::INIT; + } + return; + } + case InternalState::INIT: { + ReturnValue_t result = calculateCoulombCounterChargeUpperThreshold(); + if (result == returnvalue::OK) { internalState = InternalState::READY; } return; diff --git a/mission/controller/PowerController.h b/mission/controller/PowerController.h index 0f15363b..e7f9383c 100644 --- a/mission/controller/PowerController.h +++ b/mission/controller/PowerController.h @@ -27,7 +27,7 @@ class PowerController : public ExtendedControllerBase, public ReceivesParameterM bool enableHkSets = false; ParameterHelper parameterHelper; - enum class InternalState { STARTUP, INITIAL_DELAY, READY }; + enum class InternalState { STARTUP, INITIAL_DELAY, INIT, READY }; InternalState internalState = InternalState::STARTUP; // Initial delay to make sure all pool variables have been initialized their owners From 2eba5d52da86c2d423e49400f34cef21fabbe8b6 Mon Sep 17 00:00:00 2001 From: meggert Date: Mon, 31 Jul 2023 13:28:54 +0200 Subject: [PATCH 014/257] don't need those anymore --- common/config/eive/definitions.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/common/config/eive/definitions.h b/common/config/eive/definitions.h index 2653ee74..b369f512 100644 --- a/common/config/eive/definitions.h +++ b/common/config/eive/definitions.h @@ -79,7 +79,6 @@ static constexpr uint32_t SCHED_BLOCK_RTD = 150; static constexpr uint32_t SCHED_BLOCK_7_RW_READ_MS = 300; static constexpr uint32_t SCHED_BLOCK_8_PLPCDU_MS = 320; static constexpr uint32_t SCHED_BLOCK_9_RAD_SENS_MS = 340; -static constexpr uint32_t SCHED_BLOCK_10_EPS_CTRL_MS = 350; // 15 ms for FM static constexpr float SCHED_BLOCK_1_PERIOD = static_cast(SCHED_BLOCK_1_SUS_READ_MS) / 400.0; @@ -95,8 +94,6 @@ static constexpr float SCHED_BLOCK_RTD_PERIOD = static_cast(SCHED_BLOCK_R static constexpr float SCHED_BLOCK_7_PERIOD = static_cast(SCHED_BLOCK_7_RW_READ_MS) / 400.0; static constexpr float SCHED_BLOCK_8_PERIOD = static_cast(SCHED_BLOCK_8_PLPCDU_MS) / 400.0; static constexpr float SCHED_BLOCK_9_PERIOD = static_cast(SCHED_BLOCK_9_RAD_SENS_MS) / 400.0; -static constexpr float SCHED_BLOCK_10_PERIOD = - static_cast(SCHED_BLOCK_10_EPS_CTRL_MS) / 400.0; } // namespace spiSched From f1cb2caa3a96cf0a64ae44ab4403e7396de0042d Mon Sep 17 00:00:00 2001 From: meggert Date: Mon, 31 Jul 2023 13:32:40 +0200 Subject: [PATCH 015/257] cool --- mission/controller/PowerController.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mission/controller/PowerController.cpp b/mission/controller/PowerController.cpp index e08fc9eb..58177313 100644 --- a/mission/controller/PowerController.cpp +++ b/mission/controller/PowerController.cpp @@ -43,7 +43,7 @@ ReturnValue_t PowerController::getParameter(uint8_t domainId, uint8_t parameterI case 0x1: parameterWrapper->set(batteryMaximumCapacity); break; - case 0x2: + case 0x2: { float oldCoulombCounterVoltageUpperThreshold = coulombCounterVoltageUpperThreshold; parameterWrapper->set(coulombCounterVoltageUpperThreshold); ReturnValue_t result = calculateCoulombCounterChargeUpperThreshold(); @@ -51,6 +51,7 @@ ReturnValue_t PowerController::getParameter(uint8_t domainId, uint8_t parameterI coulombCounterVoltageUpperThreshold = oldCoulombCounterVoltageUpperThreshold; } break; + } case 0x3: parameterWrapper->set(maxAllowedTimeDiff); break; From c63093d6cfb45d7df6ab8f74350c10f8ad7377b3 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 14 Aug 2023 14:57:18 +0200 Subject: [PATCH 016/257] bump fsfw --- fsfw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsfw b/fsfw index d575da85..67c38f32 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit d575da85407e029dabecaffa5368f0c9f1034941 +Subproject commit 67c38f327ed22afacecf3e2a6fdc589c6812f77f From 88286eaca01c22862c512912bcb4b58b8d0d0019 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 14 Aug 2023 15:58:12 +0200 Subject: [PATCH 017/257] this compiles --- bsp_q7s/em/emObjectFactory.cpp | 1 + fsfw | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bsp_q7s/em/emObjectFactory.cpp b/bsp_q7s/em/emObjectFactory.cpp index 3c3ba290..976602d4 100644 --- a/bsp_q7s/em/emObjectFactory.cpp +++ b/bsp_q7s/em/emObjectFactory.cpp @@ -111,6 +111,7 @@ void ObjectFactory::produce(void* args) { new CoreController(objects::CORE_CONTROLLER, enableHkSets); auto* stackHandler = new Stack5VHandler(*pwrSwitcher); + static_cast(stackHandler); // Initialize chip select to avoid SPI bus issues. createRadSensorChipSelect(gpioComIF); diff --git a/fsfw b/fsfw index 67c38f32..036667a9 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 67c38f327ed22afacecf3e2a6fdc589c6812f77f +Subproject commit 036667a969c82272eeb65adfdb068e34e318ef75 From ede0805ee8af7221651b01afbff6be56f24d51b6 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 14 Aug 2023 16:29:51 +0200 Subject: [PATCH 018/257] instantiated source handler --- mission/cfdp/CfdpHandler.cpp | 22 +++++++++++----------- mission/cfdp/CfdpHandler.h | 8 ++++++++ tmtc | 2 +- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/mission/cfdp/CfdpHandler.cpp b/mission/cfdp/CfdpHandler.cpp index fa35535c..8a9e155e 100644 --- a/mission/cfdp/CfdpHandler.cpp +++ b/mission/cfdp/CfdpHandler.cpp @@ -9,17 +9,17 @@ using namespace returnvalue; using namespace cfdp; -CfdpHandler::CfdpHandler(const FsfwHandlerParams& fsfwParams, const CfdpHandlerCfg& cfdpCfg) - : SystemObject(fsfwParams.objectId), - msgQueue(fsfwParams.msgQueue), - destHandler( - DestHandlerParams(LocalEntityCfg(cfdpCfg.id, cfdpCfg.indicCfg, cfdpCfg.faultHandler), - cfdpCfg.userHandler, cfdpCfg.remoteCfgProvider, cfdpCfg.packetInfoList, - cfdpCfg.lostSegmentsList), - FsfwParams(fsfwParams.packetDest, nullptr, this, fsfwParams.tcStore, - fsfwParams.tmStore)) { - destHandler.setMsgQueue(msgQueue); -} +CfdpHandler::CfdpHandler(const FsfwHandlerParams& fsfwHandlerParams, const CfdpHandlerCfg& cfdpCfg) + : SystemObject(fsfwHandlerParams.objectId), + msgQueue(fsfwHandlerParams.msgQueue), + localCfg(cfdpCfg.id, cfdpCfg.indicCfg, cfdpCfg.faultHandler), + fsfwParams(fsfwHandlerParams.packetDest, &fsfwHandlerParams.msgQueue, this, + fsfwHandlerParams.tcStore, fsfwHandlerParams.tmStore), + destHandler(DestHandlerParams(localCfg, cfdpCfg.userHandler, cfdpCfg.remoteCfgProvider, + cfdpCfg.packetInfoList, cfdpCfg.lostSegmentsList), + this->fsfwParams), + srcHandler(SourceHandlerParams(localCfg, cfdpCfg.userHandler, seqCntProvider), + this->fsfwParams) {} [[nodiscard]] const char* CfdpHandler::getName() const { return "CFDP Handler"; } diff --git a/mission/cfdp/CfdpHandler.h b/mission/cfdp/CfdpHandler.h index 2de9f7dd..c7f71eda 100644 --- a/mission/cfdp/CfdpHandler.h +++ b/mission/cfdp/CfdpHandler.h @@ -1,6 +1,8 @@ #ifndef FSFW_EXAMPLE_HOSTED_CFDPHANDLER_H #define FSFW_EXAMPLE_HOSTED_CFDPHANDLER_H +#include + #include #include "fsfw/cfdp/handler/DestHandler.h" @@ -8,6 +10,7 @@ #include "fsfw/tasks/ExecutableObjectIF.h" #include "fsfw/tmtcservices/AcceptsTelecommandsIF.h" #include "fsfw/tmtcservices/TmTcMessage.h" +#include "fsfw/util/SeqCountProvider.h" struct FsfwHandlerParams { FsfwHandlerParams(object_id_t objectId, HasFileSystemIF& vfs, AcceptsTelemetryIF& packetDest, @@ -61,7 +64,12 @@ class CfdpHandler : public SystemObject, public ExecutableObjectIF, public Accep private: MessageQueueIF& msgQueue; + cfdp::LocalEntityCfg localCfg; + cfdp::FsfwParams fsfwParams; + SeqCountProviderU16 seqCntProvider; cfdp::DestHandler destHandler; + cfdp::SourceHandler srcHandler; + StorageManagerIF* tcStore = nullptr; StorageManagerIF* tmStore = nullptr; diff --git a/tmtc b/tmtc index 4b054b76..fd3a7990 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 4b054b7628e43975e2401c7db10c358824f7a2d3 +Subproject commit fd3a799019f6910cbbb4447cc9605340d66c2703 From 360911e5eb789af3462fdfe0f0ce3209043cb8ef Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 14 Aug 2023 20:48:37 +0200 Subject: [PATCH 019/257] continue source handler integration --- fsfw | 2 +- mission/cfdp/CfdpHandler.cpp | 21 +++++++++++++-------- mission/cfdp/CfdpHandler.h | 12 ++++++++---- mission/cfdp/Config.h | 13 +++++++++++-- mission/genericFactory.cpp | 10 ++++++---- 5 files changed, 39 insertions(+), 19 deletions(-) diff --git a/fsfw b/fsfw index b39e1c7e..60dcacf4 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit b39e1c7e076914d18fbb78716d3b5b9b12b8504b +Subproject commit 60dcacf432aa0a7b739f8fdf8bf4aaa37ac614e5 diff --git a/mission/cfdp/CfdpHandler.cpp b/mission/cfdp/CfdpHandler.cpp index 8a9e155e..2badd560 100644 --- a/mission/cfdp/CfdpHandler.cpp +++ b/mission/cfdp/CfdpHandler.cpp @@ -11,9 +11,10 @@ using namespace cfdp; CfdpHandler::CfdpHandler(const FsfwHandlerParams& fsfwHandlerParams, const CfdpHandlerCfg& cfdpCfg) : SystemObject(fsfwHandlerParams.objectId), - msgQueue(fsfwHandlerParams.msgQueue), + tmtcQueue(fsfwHandlerParams.tmtcQueue), + cfdpRequestQueue(fsfwHandlerParams.cfdpQueue), localCfg(cfdpCfg.id, cfdpCfg.indicCfg, cfdpCfg.faultHandler), - fsfwParams(fsfwHandlerParams.packetDest, &fsfwHandlerParams.msgQueue, this, + fsfwParams(fsfwHandlerParams.packetDest, &fsfwHandlerParams.tmtcQueue, this, fsfwHandlerParams.tcStore, fsfwHandlerParams.tmStore), destHandler(DestHandlerParams(localCfg, cfdpCfg.userHandler, cfdpCfg.remoteCfgProvider, cfdpCfg.packetInfoList, cfdpCfg.lostSegmentsList), @@ -27,7 +28,7 @@ CfdpHandler::CfdpHandler(const FsfwHandlerParams& fsfwHandlerParams, const CfdpH return destHandler.getDestHandlerParams().cfg.localId.getValue(); } -[[nodiscard]] MessageQueueId_t CfdpHandler::getRequestQueue() const { return msgQueue.getId(); } +[[nodiscard]] MessageQueueId_t CfdpHandler::getRequestQueue() const { return tmtcQueue.getId(); } ReturnValue_t CfdpHandler::initialize() { ReturnValue_t result = destHandler.initialize(); @@ -46,19 +47,23 @@ ReturnValue_t CfdpHandler::performOperation(uint8_t operationCode) { ReturnValue_t status; ReturnValue_t result = OK; TmTcMessage tmtcMsg; - for (status = msgQueue.receiveMessage(&tmtcMsg); status == returnvalue::OK; - status = msgQueue.receiveMessage(&tmtcMsg)) { + for (status = tmtcQueue.receiveMessage(&tmtcMsg); status == returnvalue::OK; + status = tmtcQueue.receiveMessage(&tmtcMsg)) { result = handleCfdpPacket(tmtcMsg); if (result != OK) { status = result; } } - auto& fsmRes = destHandler.performStateMachine(); + const DestHandler::FsmResult& destResult = destHandler.stateMachine(); // TODO: Error handling? - while (fsmRes.callStatus == CallStatus::CALL_AGAIN) { - destHandler.performStateMachine(); + while (destResult.callStatus == CallStatus::CALL_AGAIN) { + destHandler.stateMachine(); // TODO: Error handling? } + const SourceHandler::FsmResult& srcResult = srcHandler.stateMachine(); + while (srcResult.callStatus == CallStatus::CALL_AGAIN) { + srcHandler.stateMachine(); + } return status; } diff --git a/mission/cfdp/CfdpHandler.h b/mission/cfdp/CfdpHandler.h index c7f71eda..da526590 100644 --- a/mission/cfdp/CfdpHandler.h +++ b/mission/cfdp/CfdpHandler.h @@ -14,19 +14,22 @@ struct FsfwHandlerParams { FsfwHandlerParams(object_id_t objectId, HasFileSystemIF& vfs, AcceptsTelemetryIF& packetDest, - StorageManagerIF& tcStore, StorageManagerIF& tmStore, MessageQueueIF& msgQueue) + StorageManagerIF& tcStore, StorageManagerIF& tmStore, MessageQueueIF& tmtcQueue, + MessageQueueIF& cfdpQueue) : objectId(objectId), vfs(vfs), packetDest(packetDest), tcStore(tcStore), tmStore(tmStore), - msgQueue(msgQueue) {} + tmtcQueue(tmtcQueue), + cfdpQueue(cfdpQueue) {} object_id_t objectId{}; HasFileSystemIF& vfs; AcceptsTelemetryIF& packetDest; StorageManagerIF& tcStore; StorageManagerIF& tmStore; - MessageQueueIF& msgQueue; + MessageQueueIF& tmtcQueue; + MessageQueueIF& cfdpQueue; }; struct CfdpHandlerCfg { @@ -63,7 +66,8 @@ class CfdpHandler : public SystemObject, public ExecutableObjectIF, public Accep ReturnValue_t performOperation(uint8_t operationCode) override; private: - MessageQueueIF& msgQueue; + MessageQueueIF& tmtcQueue; + MessageQueueIF& cfdpRequestQueue; cfdp::LocalEntityCfg localCfg; cfdp::FsfwParams fsfwParams; SeqCountProviderU16 seqCntProvider; diff --git a/mission/cfdp/Config.h b/mission/cfdp/Config.h index 45f84155..89a3cdd1 100644 --- a/mission/cfdp/Config.h +++ b/mission/cfdp/Config.h @@ -7,8 +7,13 @@ namespace cfdp { class EiveUserHandler : public cfdp::UserBase { public: - explicit EiveUserHandler(HasFileSystemIF& vfs) : cfdp::UserBase(vfs) {} - virtual ~EiveUserHandler() = default; + explicit EiveUserHandler(HasFileSystemIF& vfs, MessageQueueId_t cfdpRequestId) + : cfdp::UserBase(vfs) { + userQueue = QueueFactory::instance()->createMessageQueue(10); + userQueue->setDefaultDestination(cfdpRequestId); + } + + virtual ~EiveUserHandler() { QueueFactory::instance()->deleteMessageQueue(userQueue); } void transactionIndication(const cfdp::TransactionId& id) override {} void eofSentIndication(const cfdp::TransactionId& id) override {} @@ -16,6 +21,7 @@ class EiveUserHandler : public cfdp::UserBase { sif::info << "File transaction finished for transaction with " << params.id << std::endl; } void metadataRecvdIndication(const cfdp::MetadataRecvdParams& params) override { + // TODO: Parse user messages and convert them into put requests where applicable. sif::info << "Metadata received for transaction with " << params.id << std::endl; } void fileSegmentRecvdIndication(const cfdp::FileSegmentRecvdParams& params) override {} @@ -29,6 +35,9 @@ class EiveUserHandler : public cfdp::UserBase { void eofRecvIndication(const cfdp::TransactionId& id) override { sif::info << "EOF PDU received for transaction with " << id << std::endl; } + + private: + MessageQueueIF* userQueue; }; class EiveFaultHandler : public cfdp::FaultHandlerBase { diff --git a/mission/genericFactory.cpp b/mission/genericFactory.cpp index 3d9d0c81..79035f9c 100644 --- a/mission/genericFactory.cpp +++ b/mission/genericFactory.cpp @@ -85,7 +85,7 @@ 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; -EiveUserHandler USER_HANDLER(HOST_FS); +// EiveUserHandler USER_HANDLER(HOST_FS); EiveFaultHandler EIVE_FAULT_HANDLER; } // namespace cfdp @@ -274,14 +274,16 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_, PusTmFun CfdpDistribCfg distribCfg(objects::CFDP_DISTRIBUTOR, *tcStore, cfdpMsgQueue); new CfdpDistributor(distribCfg); - auto* msgQueue = QueueFactory::instance()->createMessageQueue(32); + auto* tmtcQueue = QueueFactory::instance()->createMessageQueue(32); + auto* cfdpQueue = QueueFactory::instance()->createMessageQueue(16); + auto eiveUserHandler = new EiveUserHandler(HOST_FS, cfdpQueue->getId()); FsfwHandlerParams params(objects::CFDP_HANDLER, HOST_FS, **cfdpFunnel, *tcStore, **tmStore, - *msgQueue); + *tmtcQueue, *cfdpQueue); cfdp::IndicationCfg indicationCfg; UnsignedByteField apid(config::EIVE_LOCAL_CFDP_ENTITY_ID); cfdp::EntityId localId(apid); GROUND_REMOTE_CFG.defaultChecksum = cfdp::ChecksumType::CRC_32; - CfdpHandlerCfg cfdpCfg(localId, indicationCfg, USER_HANDLER, EIVE_FAULT_HANDLER, PACKET_LIST, + CfdpHandlerCfg cfdpCfg(localId, indicationCfg, *eiveUserHandler, EIVE_FAULT_HANDLER, PACKET_LIST, LOST_SEGMENTS, REMOTE_CFG_PROVIDER); auto* cfdpHandler = new CfdpHandler(params, cfdpCfg); // All CFDP packets arrive wrapped inside CCSDS space packets From d2ae8e93624fbd9b3cff1af498415aede861ca2b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 14 Aug 2023 21:06:49 +0200 Subject: [PATCH 020/257] better naming --- fsfw | 2 +- mission/cfdp/CfdpHandler.cpp | 12 ++++++------ mission/cfdp/CfdpHandler.h | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/fsfw b/fsfw index 60dcacf4..cb1aaea6 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 60dcacf432aa0a7b739f8fdf8bf4aaa37ac614e5 +Subproject commit cb1aaea6cd10f34bf46adf8f91f86af1fb42041a diff --git a/mission/cfdp/CfdpHandler.cpp b/mission/cfdp/CfdpHandler.cpp index 2badd560..72a54a88 100644 --- a/mission/cfdp/CfdpHandler.cpp +++ b/mission/cfdp/CfdpHandler.cpp @@ -11,7 +11,7 @@ using namespace cfdp; CfdpHandler::CfdpHandler(const FsfwHandlerParams& fsfwHandlerParams, const CfdpHandlerCfg& cfdpCfg) : SystemObject(fsfwHandlerParams.objectId), - tmtcQueue(fsfwHandlerParams.tmtcQueue), + pduQueue(fsfwHandlerParams.tmtcQueue), cfdpRequestQueue(fsfwHandlerParams.cfdpQueue), localCfg(cfdpCfg.id, cfdpCfg.indicCfg, cfdpCfg.faultHandler), fsfwParams(fsfwHandlerParams.packetDest, &fsfwHandlerParams.tmtcQueue, this, @@ -28,7 +28,7 @@ CfdpHandler::CfdpHandler(const FsfwHandlerParams& fsfwHandlerParams, const CfdpH return destHandler.getDestHandlerParams().cfg.localId.getValue(); } -[[nodiscard]] MessageQueueId_t CfdpHandler::getRequestQueue() const { return tmtcQueue.getId(); } +[[nodiscard]] MessageQueueId_t CfdpHandler::getRequestQueue() const { return pduQueue.getId(); } ReturnValue_t CfdpHandler::initialize() { ReturnValue_t result = destHandler.initialize(); @@ -47,9 +47,9 @@ ReturnValue_t CfdpHandler::performOperation(uint8_t operationCode) { ReturnValue_t status; ReturnValue_t result = OK; TmTcMessage tmtcMsg; - for (status = tmtcQueue.receiveMessage(&tmtcMsg); status == returnvalue::OK; - status = tmtcQueue.receiveMessage(&tmtcMsg)) { - result = handleCfdpPacket(tmtcMsg); + for (status = pduQueue.receiveMessage(&tmtcMsg); status == returnvalue::OK; + status = pduQueue.receiveMessage(&tmtcMsg)) { + result = handlePduPacket(tmtcMsg); if (result != OK) { status = result; } @@ -67,7 +67,7 @@ ReturnValue_t CfdpHandler::performOperation(uint8_t operationCode) { return status; } -ReturnValue_t CfdpHandler::handleCfdpPacket(TmTcMessage& msg) { +ReturnValue_t CfdpHandler::handlePduPacket(TmTcMessage& msg) { auto accessorPair = tcStore->getData(msg.getStorageId()); if (accessorPair.first != OK) { return accessorPair.first; diff --git a/mission/cfdp/CfdpHandler.h b/mission/cfdp/CfdpHandler.h index da526590..6ee4b07b 100644 --- a/mission/cfdp/CfdpHandler.h +++ b/mission/cfdp/CfdpHandler.h @@ -66,7 +66,7 @@ class CfdpHandler : public SystemObject, public ExecutableObjectIF, public Accep ReturnValue_t performOperation(uint8_t operationCode) override; private: - MessageQueueIF& tmtcQueue; + MessageQueueIF& pduQueue; MessageQueueIF& cfdpRequestQueue; cfdp::LocalEntityCfg localCfg; cfdp::FsfwParams fsfwParams; @@ -77,7 +77,7 @@ class CfdpHandler : public SystemObject, public ExecutableObjectIF, public Accep StorageManagerIF* tcStore = nullptr; StorageManagerIF* tmStore = nullptr; - ReturnValue_t handleCfdpPacket(TmTcMessage& msg); + ReturnValue_t handlePduPacket(TmTcMessage& msg); }; #endif // FSFW_EXAMPLE_HOSTED_CFDPHANDLER_H From c09c0ee9471a23b919fcca2b55d1219be71e1acf Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 14 Aug 2023 21:22:01 +0200 Subject: [PATCH 021/257] clean up handler a bit --- fsfw | 2 +- mission/cfdp/CfdpHandler.cpp | 56 +++++++++++++++++++++++++++++------- mission/cfdp/CfdpHandler.h | 4 +++ 3 files changed, 50 insertions(+), 12 deletions(-) diff --git a/fsfw b/fsfw index cb1aaea6..8c116852 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit cb1aaea6cd10f34bf46adf8f91f86af1fb42041a +Subproject commit 8c1168524049ef0e5b2144b6c04aeb01538053c2 diff --git a/mission/cfdp/CfdpHandler.cpp b/mission/cfdp/CfdpHandler.cpp index 72a54a88..7545aa11 100644 --- a/mission/cfdp/CfdpHandler.cpp +++ b/mission/cfdp/CfdpHandler.cpp @@ -1,5 +1,7 @@ #include "CfdpHandler.h" +#include + #include "fsfw/cfdp/pdu/AckPduReader.h" #include "fsfw/cfdp/pdu/PduHeaderReader.h" #include "fsfw/globalfunctions/arrayprinter.h" @@ -42,17 +44,14 @@ ReturnValue_t CfdpHandler::initialize() { } ReturnValue_t CfdpHandler::performOperation(uint8_t operationCode) { - // TODO: Receive TC packets and route them to source and dest handler, depending on which is - // correct or more appropriate - ReturnValue_t status; - ReturnValue_t result = OK; - TmTcMessage tmtcMsg; - for (status = pduQueue.receiveMessage(&tmtcMsg); status == returnvalue::OK; - status = pduQueue.receiveMessage(&tmtcMsg)) { - result = handlePduPacket(tmtcMsg); - if (result != OK) { - status = result; - } + ReturnValue_t status = OK; + ReturnValue_t result = handlePduPacketMessages(); + if (result != OK) { + status = result; + } + result = handleCfdpMessages(); + if (result != OK) { + status = result; } const DestHandler::FsmResult& destResult = destHandler.stateMachine(); // TODO: Error handling? @@ -139,3 +138,38 @@ ReturnValue_t CfdpHandler::handlePduPacket(TmTcMessage& msg) { } return result; } + +ReturnValue_t CfdpHandler::handleCfdpRequest(CommandMessage& msg) { + // TODO: Handle CFDP requests here, most importantly put requests. If a put request is received, + // check whether one is pending. If none are, start a transaction with the put request, otherwise + // store for put request inside a FIFO for later processing. + return OK; +} + +ReturnValue_t CfdpHandler::handlePduPacketMessages() { + ReturnValue_t status; + ReturnValue_t result = OK; + TmTcMessage pduMsg; + for (status = pduQueue.receiveMessage(&pduMsg); status == returnvalue::OK; + status = pduQueue.receiveMessage(&pduMsg)) { + result = handlePduPacket(pduMsg); + if (result != OK) { + status = result; + } + } + return status; +} + +ReturnValue_t CfdpHandler::handleCfdpMessages() { + ReturnValue_t status; + ReturnValue_t result; + CommandMessage cfdpMsg; + for (status = cfdpRequestQueue.receiveMessage(&cfdpMsg); status == returnvalue::OK; + status = cfdpRequestQueue.receiveMessage(&cfdpMsg)) { + result = handleCfdpRequest(cfdpMsg); + if (result != OK) { + status = result; + } + } + return status; +} diff --git a/mission/cfdp/CfdpHandler.h b/mission/cfdp/CfdpHandler.h index 6ee4b07b..4bea5b95 100644 --- a/mission/cfdp/CfdpHandler.h +++ b/mission/cfdp/CfdpHandler.h @@ -2,6 +2,7 @@ #define FSFW_EXAMPLE_HOSTED_CFDPHANDLER_H #include +#include #include @@ -77,7 +78,10 @@ class CfdpHandler : public SystemObject, public ExecutableObjectIF, public Accep StorageManagerIF* tcStore = nullptr; StorageManagerIF* tmStore = nullptr; + ReturnValue_t handlePduPacketMessages(); ReturnValue_t handlePduPacket(TmTcMessage& msg); + ReturnValue_t handleCfdpRequest(CommandMessage& msg); + ReturnValue_t handleCfdpMessages(); }; #endif // FSFW_EXAMPLE_HOSTED_CFDPHANDLER_H From 952e1c16e537a2fd713a371d4044d93550f20d64 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 16 Aug 2023 11:38:00 +0200 Subject: [PATCH 022/257] improve structure of CFPD mission code --- mission/cfdp/CMakeLists.txt | 2 +- mission/cfdp/CfdpFaultHandler.h | 31 ++++++++++++++++ mission/cfdp/CfdpUser.cpp | 42 +++++++++++++++++++++ mission/cfdp/CfdpUser.h | 34 +++++++++++++++++ mission/cfdp/Config.h | 66 --------------------------------- mission/genericFactory.cpp | 5 ++- tmtc | 2 +- 7 files changed, 112 insertions(+), 70 deletions(-) create mode 100644 mission/cfdp/CfdpFaultHandler.h create mode 100644 mission/cfdp/CfdpUser.cpp create mode 100644 mission/cfdp/CfdpUser.h delete mode 100644 mission/cfdp/Config.h diff --git a/mission/cfdp/CMakeLists.txt b/mission/cfdp/CMakeLists.txt index 71d62ce8..418b66eb 100644 --- a/mission/cfdp/CMakeLists.txt +++ b/mission/cfdp/CMakeLists.txt @@ -1 +1 @@ -target_sources(${LIB_EIVE_MISSION} PRIVATE CfdpHandler.cpp) +target_sources(${LIB_EIVE_MISSION} PRIVATE CfdpHandler.cpp CfdpUser.cpp) diff --git a/mission/cfdp/CfdpFaultHandler.h b/mission/cfdp/CfdpFaultHandler.h new file mode 100644 index 00000000..565606c6 --- /dev/null +++ b/mission/cfdp/CfdpFaultHandler.h @@ -0,0 +1,31 @@ +#ifndef MISSION_CFDP_CFDPFAULTHANDLER_H_ +#define MISSION_CFDP_CFDPFAULTHANDLER_H_ + +#include "fsfw/cfdp.h" + +namespace cfdp { + +class EiveFaultHandler : public cfdp::FaultHandlerBase { + public: + 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; + } + 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; + } + void abandonCb(cfdp::TransactionId& id, cfdp::ConditionCode code) override { + sif::warning << "Transaction " << id + << " was abandoned, condition code : " << cfdp::getConditionCodeString(code) + << std::endl; + } + void ignoreCb(cfdp::TransactionId& id, cfdp::ConditionCode code) override { + sif::warning << "Fault ignored for transaction " << id + << ", condition code: " << cfdp::getConditionCodeString(code) << std::endl; + } +}; + +} // namespace cfdp + +#endif /* MISSION_CFDP_CFDPFAULTHANDLER_H_ */ diff --git a/mission/cfdp/CfdpUser.cpp b/mission/cfdp/CfdpUser.cpp new file mode 100644 index 00000000..65c1f456 --- /dev/null +++ b/mission/cfdp/CfdpUser.cpp @@ -0,0 +1,42 @@ +#include "CfdpUser.h" + +#include + +namespace cfdp { + +EiveUserHandler::EiveUserHandler(HasFileSystemIF& vfs, MessageQueueId_t cfdpRequestId) + : cfdp::UserBase(vfs) { + userQueue = QueueFactory::instance()->createMessageQueue(10); + userQueue->setDefaultDestination(cfdpRequestId); +} + +EiveUserHandler::~EiveUserHandler() { + QueueFactory::instance()->deleteMessageQueue(userQueue); +} + +void EiveUserHandler::transactionIndication(const cfdp::TransactionId& id) {} +void EiveUserHandler::eofSentIndication(const cfdp::TransactionId& id) {} +void EiveUserHandler::transactionFinishedIndication( + const cfdp::TransactionFinishedParams& params) { + sif::info << "File transaction finished for transaction with " << params.id << std::endl; +} +void EiveUserHandler::metadataRecvdIndication(const cfdp::MetadataRecvdParams& params) { + // TODO: Parse user messages and convert them into put requests where applicable. + sif::info << "Metadata received for transaction with " << params.id << std::endl; +} +void EiveUserHandler::fileSegmentRecvdIndication( + const cfdp::FileSegmentRecvdParams& params) {} +void EiveUserHandler::reportIndication(const cfdp::TransactionId& id, + cfdp::StatusReportIF& report) {} +void EiveUserHandler::suspendedIndication(const cfdp::TransactionId& id, + cfdp::ConditionCode code) {} +void EiveUserHandler::resumedIndication(const cfdp::TransactionId& id, size_t progress) {} +void EiveUserHandler::faultIndication(const cfdp::TransactionId& id, cfdp::ConditionCode code, + size_t progress) {} +void EiveUserHandler::abandonedIndication(const cfdp::TransactionId& id, cfdp::ConditionCode code, + size_t progress) {} +void EiveUserHandler::eofRecvIndication(const cfdp::TransactionId& id) { + sif::info << "EOF PDU received for transaction with " << id << std::endl; +} + +} // namespace cfdp diff --git a/mission/cfdp/CfdpUser.h b/mission/cfdp/CfdpUser.h new file mode 100644 index 00000000..fa4d0485 --- /dev/null +++ b/mission/cfdp/CfdpUser.h @@ -0,0 +1,34 @@ +#ifndef MISSION_CFDP_CFDPUSER_H_ +#define MISSION_CFDP_CFDPUSER_H_ + +#include + +namespace cfdp { + +class EiveUserHandler : public cfdp::UserBase { + public: + explicit EiveUserHandler(HasFileSystemIF& vfs, MessageQueueId_t cfdpRequestId); + + virtual ~EiveUserHandler(); + + void transactionIndication(const cfdp::TransactionId& id) override; + void eofSentIndication(const cfdp::TransactionId& id) override; + void transactionFinishedIndication(const cfdp::TransactionFinishedParams& params) override; + void metadataRecvdIndication(const cfdp::MetadataRecvdParams& params) override; + void fileSegmentRecvdIndication(const cfdp::FileSegmentRecvdParams& params) override; + void reportIndication(const cfdp::TransactionId& id, cfdp::StatusReportIF& report) override; + void suspendedIndication(const cfdp::TransactionId& id, cfdp::ConditionCode code); + void resumedIndication(const cfdp::TransactionId& id, size_t progress) override; + void faultIndication(const cfdp::TransactionId& id, cfdp::ConditionCode code, + size_t progress) override; + void abandonedIndication(const cfdp::TransactionId& id, cfdp::ConditionCode code, + size_t progress) override; + void eofRecvIndication(const cfdp::TransactionId& id) override; + + private: + MessageQueueIF* userQueue; +}; + +} // namespace cfdp + +#endif /* MISSION_CFDP_CFDPUSER_H_ */ diff --git a/mission/cfdp/Config.h b/mission/cfdp/Config.h deleted file mode 100644 index 89a3cdd1..00000000 --- a/mission/cfdp/Config.h +++ /dev/null @@ -1,66 +0,0 @@ -#ifndef MISSION_CFDP_CONFIG_H_ -#define MISSION_CFDP_CONFIG_H_ - -#include "fsfw/cfdp.h" - -namespace cfdp { - -class EiveUserHandler : public cfdp::UserBase { - public: - explicit EiveUserHandler(HasFileSystemIF& vfs, MessageQueueId_t cfdpRequestId) - : cfdp::UserBase(vfs) { - userQueue = QueueFactory::instance()->createMessageQueue(10); - userQueue->setDefaultDestination(cfdpRequestId); - } - - virtual ~EiveUserHandler() { QueueFactory::instance()->deleteMessageQueue(userQueue); } - - void transactionIndication(const cfdp::TransactionId& id) override {} - void eofSentIndication(const cfdp::TransactionId& id) override {} - void transactionFinishedIndication(const cfdp::TransactionFinishedParams& params) override { - sif::info << "File transaction finished for transaction with " << params.id << std::endl; - } - void metadataRecvdIndication(const cfdp::MetadataRecvdParams& params) override { - // TODO: Parse user messages and convert them into put requests where applicable. - sif::info << "Metadata received for transaction with " << params.id << std::endl; - } - void fileSegmentRecvdIndication(const cfdp::FileSegmentRecvdParams& params) override {} - void reportIndication(const cfdp::TransactionId& id, cfdp::StatusReportIF& report) override {} - void suspendedIndication(const cfdp::TransactionId& id, cfdp::ConditionCode code) override {} - void resumedIndication(const cfdp::TransactionId& id, size_t progress) override {} - void faultIndication(const cfdp::TransactionId& id, cfdp::ConditionCode code, - size_t progress) override {} - void abandonedIndication(const cfdp::TransactionId& id, cfdp::ConditionCode code, - size_t progress) override {} - void eofRecvIndication(const cfdp::TransactionId& id) override { - sif::info << "EOF PDU received for transaction with " << id << std::endl; - } - - private: - MessageQueueIF* userQueue; -}; - -class EiveFaultHandler : public cfdp::FaultHandlerBase { - public: - 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; - } - 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; - } - void abandonCb(cfdp::TransactionId& id, cfdp::ConditionCode code) override { - sif::warning << "Transaction " << id - << " was abandoned, condition code : " << cfdp::getConditionCodeString(code) - << std::endl; - } - void ignoreCb(cfdp::TransactionId& id, cfdp::ConditionCode code) override { - sif::warning << "Fault ignored for transaction " << id - << ", condition code: " << cfdp::getConditionCodeString(code) << std::endl; - } -}; - -} // namespace cfdp - -#endif /* MISSION_CFDP_CONFIG_H_ */ diff --git a/mission/genericFactory.cpp b/mission/genericFactory.cpp index 79035f9c..9bd000c7 100644 --- a/mission/genericFactory.cpp +++ b/mission/genericFactory.cpp @@ -22,7 +22,9 @@ #include #include #include +#include #include +#include #include #include #include @@ -44,7 +46,6 @@ #include "devices/gpioIds.h" #include "eive/definitions.h" #include "fsfw/pus/Service11TelecommandScheduling.h" -#include "mission/cfdp/Config.h" #include "mission/system/acs/RwAssembly.h" #include "mission/system/acs/acsModeTree.h" #include "mission/system/tcs/tcsModeTree.h" @@ -276,7 +277,7 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_, PusTmFun auto* tmtcQueue = QueueFactory::instance()->createMessageQueue(32); auto* cfdpQueue = QueueFactory::instance()->createMessageQueue(16); - auto eiveUserHandler = new EiveUserHandler(HOST_FS, cfdpQueue->getId()); + auto eiveUserHandler = new cfdp::EiveUserHandler(HOST_FS, cfdpQueue->getId()); FsfwHandlerParams params(objects::CFDP_HANDLER, HOST_FS, **cfdpFunnel, *tcStore, **tmStore, *tmtcQueue, *cfdpQueue); cfdp::IndicationCfg indicationCfg; diff --git a/tmtc b/tmtc index fd3a7990..b50c75c1 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit fd3a799019f6910cbbb4447cc9605340d66c2703 +Subproject commit b50c75c13cdbbc3d34d2f072d2bf1cb2fbe734b5 From f62a4ee2b4311e79ffa9c0c73ce290ade27dba06 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 16 Aug 2023 13:16:14 +0200 Subject: [PATCH 023/257] this should make proxy op forwarding work --- fsfw | 2 +- mission/cfdp/CfdpUser.cpp | 35 ++++++++++++++++++++++------------- mission/cfdp/CfdpUser.h | 5 ++++- mission/genericFactory.cpp | 2 +- 4 files changed, 28 insertions(+), 16 deletions(-) diff --git a/fsfw b/fsfw index 8c116852..9ef63825 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 8c1168524049ef0e5b2144b6c04aeb01538053c2 +Subproject commit 9ef63825f3d8486b05c3f6193ae0503833e6f8a4 diff --git a/mission/cfdp/CfdpUser.cpp b/mission/cfdp/CfdpUser.cpp index 65c1f456..c2e6024d 100644 --- a/mission/cfdp/CfdpUser.cpp +++ b/mission/cfdp/CfdpUser.cpp @@ -2,34 +2,43 @@ #include +using namespace returnvalue; + namespace cfdp { -EiveUserHandler::EiveUserHandler(HasFileSystemIF& vfs, MessageQueueId_t cfdpRequestId) - : cfdp::UserBase(vfs) { - userQueue = QueueFactory::instance()->createMessageQueue(10); +EiveUserHandler::EiveUserHandler(HasFileSystemIF& vfs, StorageManagerIF& ipcStore, + MessageQueueId_t cfdpRequestId) + : cfdp::UserBase(vfs), userQueue(QueueFactory::instance()->createMessageQueue(10)) { + if (userQueue == nullptr) { + sif::error << "EiveUserHandler: Queue creation failed" << std::endl; + return; + } userQueue->setDefaultDestination(cfdpRequestId); + reservedMsgParser = new ReservedMessageParser(ipcStore, *userQueue, cfdpRequestId); } -EiveUserHandler::~EiveUserHandler() { - QueueFactory::instance()->deleteMessageQueue(userQueue); -} +EiveUserHandler::~EiveUserHandler() { QueueFactory::instance()->deleteMessageQueue(userQueue); } void EiveUserHandler::transactionIndication(const cfdp::TransactionId& id) {} void EiveUserHandler::eofSentIndication(const cfdp::TransactionId& id) {} -void EiveUserHandler::transactionFinishedIndication( - const cfdp::TransactionFinishedParams& params) { +void EiveUserHandler::transactionFinishedIndication(const cfdp::TransactionFinishedParams& params) { sif::info << "File transaction finished for transaction with " << params.id << std::endl; } void EiveUserHandler::metadataRecvdIndication(const cfdp::MetadataRecvdParams& params) { - // TODO: Parse user messages and convert them into put requests where applicable. sif::info << "Metadata received for transaction with " << params.id << std::endl; + if (params.numberOfMsgsToUser > 0 and params.msgsToUserArray != nullptr) { + ReturnValue_t result = + reservedMsgParser->parse(params.msgsToUserArray, params.numberOfMsgsToUser); + if (result != OK) { + sif::warning << "EiveUserHandler: Parsing reserved CFDP messages failed" << std::endl; + } + } } -void EiveUserHandler::fileSegmentRecvdIndication( - const cfdp::FileSegmentRecvdParams& params) {} +void EiveUserHandler::fileSegmentRecvdIndication(const cfdp::FileSegmentRecvdParams& params) {} void EiveUserHandler::reportIndication(const cfdp::TransactionId& id, cfdp::StatusReportIF& report) {} -void EiveUserHandler::suspendedIndication(const cfdp::TransactionId& id, - cfdp::ConditionCode code) {} +void EiveUserHandler::suspendedIndication(const cfdp::TransactionId& id, cfdp::ConditionCode code) { +} void EiveUserHandler::resumedIndication(const cfdp::TransactionId& id, size_t progress) {} void EiveUserHandler::faultIndication(const cfdp::TransactionId& id, cfdp::ConditionCode code, size_t progress) {} diff --git a/mission/cfdp/CfdpUser.h b/mission/cfdp/CfdpUser.h index fa4d0485..ba981cf1 100644 --- a/mission/cfdp/CfdpUser.h +++ b/mission/cfdp/CfdpUser.h @@ -1,13 +1,15 @@ #ifndef MISSION_CFDP_CFDPUSER_H_ #define MISSION_CFDP_CFDPUSER_H_ +#include #include namespace cfdp { class EiveUserHandler : public cfdp::UserBase { public: - explicit EiveUserHandler(HasFileSystemIF& vfs, MessageQueueId_t cfdpRequestId); + explicit EiveUserHandler(HasFileSystemIF& vfs, StorageManagerIF& ipcStore, + MessageQueueId_t cfdpRequestId); virtual ~EiveUserHandler(); @@ -27,6 +29,7 @@ class EiveUserHandler : public cfdp::UserBase { private: MessageQueueIF* userQueue; + ReservedMessageParser* reservedMsgParser; }; } // namespace cfdp diff --git a/mission/genericFactory.cpp b/mission/genericFactory.cpp index 9bd000c7..73645f79 100644 --- a/mission/genericFactory.cpp +++ b/mission/genericFactory.cpp @@ -277,7 +277,7 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_, PusTmFun auto* tmtcQueue = QueueFactory::instance()->createMessageQueue(32); auto* cfdpQueue = QueueFactory::instance()->createMessageQueue(16); - auto eiveUserHandler = new cfdp::EiveUserHandler(HOST_FS, cfdpQueue->getId()); + auto eiveUserHandler = new cfdp::EiveUserHandler(HOST_FS, **ipcStore, cfdpQueue->getId()); FsfwHandlerParams params(objects::CFDP_HANDLER, HOST_FS, **cfdpFunnel, *tcStore, **tmStore, *tmtcQueue, *cfdpQueue); cfdp::IndicationCfg indicationCfg; From 8186a3ef4fe2b2287d8e85752a9c63adb83a9dd5 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 16 Aug 2023 13:22:05 +0200 Subject: [PATCH 024/257] proxy request should now arrive at the handler --- mission/cfdp/CfdpHandler.cpp | 7 ++++++- mission/cfdp/CfdpHandler.h | 6 +++++- mission/genericFactory.cpp | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/mission/cfdp/CfdpHandler.cpp b/mission/cfdp/CfdpHandler.cpp index 7545aa11..b2121022 100644 --- a/mission/cfdp/CfdpHandler.cpp +++ b/mission/cfdp/CfdpHandler.cpp @@ -1,5 +1,6 @@ #include "CfdpHandler.h" +#include #include #include "fsfw/cfdp/pdu/AckPduReader.h" @@ -22,7 +23,8 @@ CfdpHandler::CfdpHandler(const FsfwHandlerParams& fsfwHandlerParams, const CfdpH cfdpCfg.packetInfoList, cfdpCfg.lostSegmentsList), this->fsfwParams), srcHandler(SourceHandlerParams(localCfg, cfdpCfg.userHandler, seqCntProvider), - this->fsfwParams) {} + this->fsfwParams), + ipcStore(fsfwHandlerParams.ipcStore) {} [[nodiscard]] const char* CfdpHandler::getName() const { return "CFDP Handler"; } @@ -143,6 +145,9 @@ ReturnValue_t CfdpHandler::handleCfdpRequest(CommandMessage& msg) { // TODO: Handle CFDP requests here, most importantly put requests. If a put request is received, // check whether one is pending. If none are, start a transaction with the put request, otherwise // store for put request inside a FIFO for later processing. + auto accessorPair = ipcStore.getData(CfdpMessage::getStoreId(&msg)); + + sif::info << "received CFDP request" << std::endl; return OK; } diff --git a/mission/cfdp/CfdpHandler.h b/mission/cfdp/CfdpHandler.h index 4bea5b95..45314d40 100644 --- a/mission/cfdp/CfdpHandler.h +++ b/mission/cfdp/CfdpHandler.h @@ -15,13 +15,15 @@ struct FsfwHandlerParams { FsfwHandlerParams(object_id_t objectId, HasFileSystemIF& vfs, AcceptsTelemetryIF& packetDest, - StorageManagerIF& tcStore, StorageManagerIF& tmStore, MessageQueueIF& tmtcQueue, + StorageManagerIF& tcStore, StorageManagerIF& tmStore, + StorageManagerIF& ipcStore, MessageQueueIF& tmtcQueue, MessageQueueIF& cfdpQueue) : objectId(objectId), vfs(vfs), packetDest(packetDest), tcStore(tcStore), tmStore(tmStore), + ipcStore(ipcStore), tmtcQueue(tmtcQueue), cfdpQueue(cfdpQueue) {} object_id_t objectId{}; @@ -29,6 +31,7 @@ struct FsfwHandlerParams { AcceptsTelemetryIF& packetDest; StorageManagerIF& tcStore; StorageManagerIF& tmStore; + StorageManagerIF& ipcStore; MessageQueueIF& tmtcQueue; MessageQueueIF& cfdpQueue; }; @@ -75,6 +78,7 @@ class CfdpHandler : public SystemObject, public ExecutableObjectIF, public Accep cfdp::DestHandler destHandler; cfdp::SourceHandler srcHandler; + StorageManagerIF& ipcStore; StorageManagerIF* tcStore = nullptr; StorageManagerIF* tmStore = nullptr; diff --git a/mission/genericFactory.cpp b/mission/genericFactory.cpp index 73645f79..e2c4511e 100644 --- a/mission/genericFactory.cpp +++ b/mission/genericFactory.cpp @@ -279,7 +279,7 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_, PusTmFun auto* cfdpQueue = QueueFactory::instance()->createMessageQueue(16); auto eiveUserHandler = new cfdp::EiveUserHandler(HOST_FS, **ipcStore, cfdpQueue->getId()); FsfwHandlerParams params(objects::CFDP_HANDLER, HOST_FS, **cfdpFunnel, *tcStore, **tmStore, - *tmtcQueue, *cfdpQueue); + **ipcStore, *tmtcQueue, *cfdpQueue); cfdp::IndicationCfg indicationCfg; UnsignedByteField apid(config::EIVE_LOCAL_CFDP_ENTITY_ID); cfdp::EntityId localId(apid); From d6fd28e124dd83662b586740aa2f9a94f74fa5ac Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 16 Aug 2023 13:35:09 +0200 Subject: [PATCH 025/257] fix hosted build --- bsp_hosted/ObjectFactory.cpp | 2 ++ bsp_hosted/scheduling.cpp | 2 +- dummies/helperFactory.cpp | 4 ++-- mission/scheduling.cpp | 9 +++++---- mission/scheduling.h | 2 +- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/bsp_hosted/ObjectFactory.cpp b/bsp_hosted/ObjectFactory.cpp index 4873bc58..2f43393f 100644 --- a/bsp_hosted/ObjectFactory.cpp +++ b/bsp_hosted/ObjectFactory.cpp @@ -105,6 +105,8 @@ void ObjectFactory::produce(void* args) { #endif dummy::DummyCfg cfg; + cfg.addPlPcduDummy = true; + cfg.addCamSwitcherDummy = true; dummy::createDummies(cfg, *dummySwitcher, dummyGpioIF, enableHkSets); HeaterHandler* heaterHandler = nullptr; diff --git a/bsp_hosted/scheduling.cpp b/bsp_hosted/scheduling.cpp index 5fd53906..e82748f4 100644 --- a/bsp_hosted/scheduling.cpp +++ b/bsp_hosted/scheduling.cpp @@ -201,7 +201,7 @@ void scheduling::initTasks() { PeriodicTaskIF* dummyTask = factory->createPeriodicTask( "DUMMY_TASK", 35, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.8, missedDeadlineFunc); dummyTask->addComponent(objects::THERMAL_TEMP_INSERTER); - scheduling::scheduleTmpTempSensors(dummyTask); + scheduling::scheduleTmpTempSensors(dummyTask, true); scheduling::scheduleRtdSensors(dummyTask); dummyTask->addComponent(objects::SUS_0_N_LOC_XFYFZM_PT_XF); dummyTask->addComponent(objects::SUS_1_N_LOC_XBYFZM_PT_XB); diff --git a/dummies/helperFactory.cpp b/dummies/helperFactory.cpp index b23720b4..42ec1eec 100644 --- a/dummies/helperFactory.cpp +++ b/dummies/helperFactory.cpp @@ -95,7 +95,7 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitcher, GpioIF* gpio } if (cfg.addAcsBoardDummies) { - std::array assemblyDhbs; + std::array assemblyDhbs{}; assemblyDhbs[0] = new MgmLIS3MDLDummy(objects::MGM_0_LIS3_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); assemblyDhbs[1] = @@ -117,7 +117,7 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitcher, GpioIF* gpio } if (cfg.addSusDummies) { - std::array suses; + std::array suses{}; suses[0] = new SusDummy(objects::SUS_0_N_LOC_XFYFZM_PT_XF, objects::DUMMY_COM_IF, comCookieDummy); suses[1] = diff --git a/mission/scheduling.cpp b/mission/scheduling.cpp index 27a6417c..b23f8b0c 100644 --- a/mission/scheduling.cpp +++ b/mission/scheduling.cpp @@ -4,13 +4,14 @@ #include "fsfw/tasks/PeriodicTaskIF.h" -void scheduling::scheduleTmpTempSensors(PeriodicTaskIF* tmpTask) { - const std::array tmpIds = {objects::TMP1075_HANDLER_TCS_0, +void scheduling::scheduleTmpTempSensors(PeriodicTaskIF* tmpTask, bool schedulePlPcdu1) { + std::vector tmpIds = {objects::TMP1075_HANDLER_TCS_0, objects::TMP1075_HANDLER_TCS_1, objects::TMP1075_HANDLER_PLPCDU_0, - // damaged. - // objects::TMP1075_HANDLER_PLPCDU_1, objects::TMP1075_HANDLER_IF_BOARD}; + if(schedulePlPcdu1) { + tmpIds.push_back(objects::TMP1075_HANDLER_PLPCDU_1); + } for (const auto& tmpId : tmpIds) { tmpTask->addComponent(tmpId, DeviceHandlerIF::PERFORM_OPERATION); tmpTask->addComponent(tmpId, DeviceHandlerIF::SEND_WRITE); diff --git a/mission/scheduling.h b/mission/scheduling.h index 6023d5df..947164e7 100644 --- a/mission/scheduling.h +++ b/mission/scheduling.h @@ -4,7 +4,7 @@ class PeriodicTaskIF; namespace scheduling { -void scheduleTmpTempSensors(PeriodicTaskIF* tmpSensors); +void scheduleTmpTempSensors(PeriodicTaskIF* tmpSensors, bool schedulePlPcdu1); void scheduleRtdSensors(PeriodicTaskIF* periodicTask); } // namespace scheduling From 2b5dcf99dce0273728d6aaf682eef5afa7e4f703 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 16 Aug 2023 13:36:34 +0200 Subject: [PATCH 026/257] changelog --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5357e831..6150a955 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,14 @@ will consitute of a breaking change warranting a new major release: # [unreleased] +## Added + +- CFDP source handler, which allow file downlink. + +## Fixed + +- Host build fixes + # [v6.4.0] 2023-08-16 - `eive-tmtc`: v5.4.3 From 033babf50a3ac29a69cc5a7c80c334ca4f63a7f8 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 17 Aug 2023 16:45:29 +0200 Subject: [PATCH 027/257] bump tmtc --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index b50c75c1..55624f04 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit b50c75c13cdbbc3d34d2f072d2bf1cb2fbe734b5 +Subproject commit 55624f044759beacd26d82bb60210f77234dbcb7 From 2acb6d81320be74df8eb4ca942deadd046f86551 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 30 Aug 2023 10:56:32 +0200 Subject: [PATCH 028/257] bump tmtc --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index 55624f04..8d6ca602 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 55624f044759beacd26d82bb60210f77234dbcb7 +Subproject commit 8d6ca602f2ab8dd6b38e88546f23dd8e809211c2 From 0c1eae3382c66332081bcaddd1390540465f2c88 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 30 Aug 2023 11:35:06 +0200 Subject: [PATCH 029/257] auto-formatting --- fsfw | 2 +- mission/scheduling.cpp | 9 ++++----- tmtc | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/fsfw b/fsfw index 9ef63825..fb1500e0 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 9ef63825f3d8486b05c3f6193ae0503833e6f8a4 +Subproject commit fb1500e041c4d89316a9bceabc89ed870c8032be diff --git a/mission/scheduling.cpp b/mission/scheduling.cpp index b23f8b0c..4dc5bade 100644 --- a/mission/scheduling.cpp +++ b/mission/scheduling.cpp @@ -5,11 +5,10 @@ #include "fsfw/tasks/PeriodicTaskIF.h" void scheduling::scheduleTmpTempSensors(PeriodicTaskIF* tmpTask, bool schedulePlPcdu1) { - std::vector tmpIds = {objects::TMP1075_HANDLER_TCS_0, - objects::TMP1075_HANDLER_TCS_1, - objects::TMP1075_HANDLER_PLPCDU_0, - objects::TMP1075_HANDLER_IF_BOARD}; - if(schedulePlPcdu1) { + std::vector tmpIds = {objects::TMP1075_HANDLER_TCS_0, objects::TMP1075_HANDLER_TCS_1, + objects::TMP1075_HANDLER_PLPCDU_0, + objects::TMP1075_HANDLER_IF_BOARD}; + if (schedulePlPcdu1) { tmpIds.push_back(objects::TMP1075_HANDLER_PLPCDU_1); } for (const auto& tmpId : tmpIds) { diff --git a/tmtc b/tmtc index 8d6ca602..f9f8f948 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 8d6ca602f2ab8dd6b38e88546f23dd8e809211c2 +Subproject commit f9f8f9481fe78aec60a4ad121a72d2011d18363f From 2f6565621b5d742f213298703492a6e510db210b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 30 Aug 2023 11:38:01 +0200 Subject: [PATCH 030/257] bump tmtc for bugfix --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index f9f8f948..c2bed714 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit f9f8f9481fe78aec60a4ad121a72d2011d18363f +Subproject commit c2bed714dc43bc4a8ef4954fe72ae7c98b8bc2c8 From b6b342bf9972f5815245476620a49731d55fe3e1 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 30 Aug 2023 11:47:39 +0200 Subject: [PATCH 031/257] introduce queue for put requests --- mission/cfdp/CfdpHandler.cpp | 21 +++++++++++++++++---- mission/cfdp/CfdpHandler.h | 2 ++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/mission/cfdp/CfdpHandler.cpp b/mission/cfdp/CfdpHandler.cpp index b2121022..92a3827b 100644 --- a/mission/cfdp/CfdpHandler.cpp +++ b/mission/cfdp/CfdpHandler.cpp @@ -143,11 +143,22 @@ ReturnValue_t CfdpHandler::handlePduPacket(TmTcMessage& msg) { ReturnValue_t CfdpHandler::handleCfdpRequest(CommandMessage& msg) { // TODO: Handle CFDP requests here, most importantly put requests. If a put request is received, - // check whether one is pending. If none are, start a transaction with the put request, otherwise - // store for put request inside a FIFO for later processing. + // check whether one is pending. If none are, start a transaction with the put request, + // otherwise store for put request inside a FIFO for later processing. auto accessorPair = ipcStore.getData(CfdpMessage::getStoreId(&msg)); - - sif::info << "received CFDP request" << std::endl; + if (msg.getCommand() == CfdpMessage::PUT_REQUEST) { + sif::info << "Received CFDP put request" << std::endl; + if (srcHandler.getState() != CfdpState::IDLE) { + if (putRequestQueue.full()) { + // TODO: Trigger event and discard request. Queue is full, too many requests. + return FAILED; + } + putRequestQueue.push(CfdpMessage::getStoreId(&msg)); + } else { + // TODO: Retrieve put request and remote configuration. + // srcHandler.transactionStart() + } + } return OK; } @@ -159,6 +170,7 @@ ReturnValue_t CfdpHandler::handlePduPacketMessages() { status = pduQueue.receiveMessage(&pduMsg)) { result = handlePduPacket(pduMsg); if (result != OK) { + // TODO: Maybe add printout with context specific information? status = result; } } @@ -173,6 +185,7 @@ ReturnValue_t CfdpHandler::handleCfdpMessages() { status = cfdpRequestQueue.receiveMessage(&cfdpMsg)) { result = handleCfdpRequest(cfdpMsg); if (result != OK) { + // TODO: Maybe add printout with context specific information? status = result; } } diff --git a/mission/cfdp/CfdpHandler.h b/mission/cfdp/CfdpHandler.h index 45314d40..2a840fb2 100644 --- a/mission/cfdp/CfdpHandler.h +++ b/mission/cfdp/CfdpHandler.h @@ -1,6 +1,7 @@ #ifndef FSFW_EXAMPLE_HOSTED_CFDPHANDLER_H #define FSFW_EXAMPLE_HOSTED_CFDPHANDLER_H +#include #include #include @@ -77,6 +78,7 @@ class CfdpHandler : public SystemObject, public ExecutableObjectIF, public Accep SeqCountProviderU16 seqCntProvider; cfdp::DestHandler destHandler; cfdp::SourceHandler srcHandler; + etl::queue putRequestQueue; StorageManagerIF& ipcStore; StorageManagerIF* tcStore = nullptr; From fa43c5480bdc6486ce0e7179f8a4df49a8c61245 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 30 Aug 2023 11:58:21 +0200 Subject: [PATCH 032/257] that should cause a transaction start --- mission/cfdp/CfdpHandler.cpp | 19 +++++++++++++++++-- mission/cfdp/CfdpHandler.h | 1 + 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/mission/cfdp/CfdpHandler.cpp b/mission/cfdp/CfdpHandler.cpp index 92a3827b..a5ab231d 100644 --- a/mission/cfdp/CfdpHandler.cpp +++ b/mission/cfdp/CfdpHandler.cpp @@ -17,6 +17,7 @@ CfdpHandler::CfdpHandler(const FsfwHandlerParams& fsfwHandlerParams, const CfdpH pduQueue(fsfwHandlerParams.tmtcQueue), cfdpRequestQueue(fsfwHandlerParams.cfdpQueue), localCfg(cfdpCfg.id, cfdpCfg.indicCfg, cfdpCfg.faultHandler), + remoteCfgProvider(cfdpCfg.remoteCfgProvider), fsfwParams(fsfwHandlerParams.packetDest, &fsfwHandlerParams.tmtcQueue, this, fsfwHandlerParams.tcStore, fsfwHandlerParams.tmStore), destHandler(DestHandlerParams(localCfg, cfdpCfg.userHandler, cfdpCfg.remoteCfgProvider, @@ -145,7 +146,6 @@ ReturnValue_t CfdpHandler::handleCfdpRequest(CommandMessage& msg) { // TODO: Handle CFDP requests here, most importantly put requests. If a put request is received, // check whether one is pending. If none are, start a transaction with the put request, // otherwise store for put request inside a FIFO for later processing. - auto accessorPair = ipcStore.getData(CfdpMessage::getStoreId(&msg)); if (msg.getCommand() == CfdpMessage::PUT_REQUEST) { sif::info << "Received CFDP put request" << std::endl; if (srcHandler.getState() != CfdpState::IDLE) { @@ -156,7 +156,22 @@ ReturnValue_t CfdpHandler::handleCfdpRequest(CommandMessage& msg) { putRequestQueue.push(CfdpMessage::getStoreId(&msg)); } else { // TODO: Retrieve put request and remote configuration. - // srcHandler.transactionStart() + PutRequest putRequest; + auto accessorPair = ipcStore.getData(CfdpMessage::getStoreId(&msg)); + const uint8_t* dataPtr = accessorPair.second.data(); + size_t dataSize = accessorPair.second.size(); + ReturnValue_t result = + putRequest.deSerialize(&dataPtr, &dataSize, SerializeIF::Endianness::MACHINE); + if (result != OK) { + return result; + } + RemoteEntityCfg* remoteCfg; + remoteCfgProvider.getRemoteCfg(putRequest.getDestId(), &remoteCfg); + if (remoteCfg == nullptr) { + // TODO: Trigger event + return FAILED; + } + return srcHandler.transactionStart(putRequest, *remoteCfg); } } return OK; diff --git a/mission/cfdp/CfdpHandler.h b/mission/cfdp/CfdpHandler.h index 2a840fb2..18cf46b7 100644 --- a/mission/cfdp/CfdpHandler.h +++ b/mission/cfdp/CfdpHandler.h @@ -74,6 +74,7 @@ class CfdpHandler : public SystemObject, public ExecutableObjectIF, public Accep MessageQueueIF& pduQueue; MessageQueueIF& cfdpRequestQueue; cfdp::LocalEntityCfg localCfg; + cfdp::RemoteConfigTableIF& remoteCfgProvider; cfdp::FsfwParams fsfwParams; SeqCountProviderU16 seqCntProvider; cfdp::DestHandler destHandler; From ea2a137aecad485953b06f642dd9c80b6fda0df1 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 30 Aug 2023 13:10:51 +0200 Subject: [PATCH 033/257] add error message --- mission/cfdp/CfdpHandler.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mission/cfdp/CfdpHandler.cpp b/mission/cfdp/CfdpHandler.cpp index a5ab231d..5f3b11e2 100644 --- a/mission/cfdp/CfdpHandler.cpp +++ b/mission/cfdp/CfdpHandler.cpp @@ -168,6 +168,8 @@ ReturnValue_t CfdpHandler::handleCfdpRequest(CommandMessage& msg) { RemoteEntityCfg* remoteCfg; remoteCfgProvider.getRemoteCfg(putRequest.getDestId(), &remoteCfg); if (remoteCfg == nullptr) { + sif::error << "CfdpHandler: No remote configuration found for destination ID " << + putRequest.getDestId() << std::endl; // TODO: Trigger event return FAILED; } From 6f2eaee50a13fa82889fcb952d90a70d42d7b54e Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 31 Aug 2023 15:10:43 +0200 Subject: [PATCH 034/257] trigger a useful event --- .../fsfwconfig/events/translateEvents.cpp | 7 +- .../fsfwconfig/objects/translateObjects.cpp | 2 +- fsfw | 2 +- generators/bsp_hosted_events.csv | 1 + generators/bsp_hosted_returnvalues.csv | 387 ++++++------ generators/bsp_q7s_events.csv | 1 + generators/bsp_q7s_returnvalues.csv | 579 +++++++++--------- generators/events/translateEvents.cpp | 7 +- generators/objects/translateObjects.cpp | 2 +- linux/fsfwconfig/events/translateEvents.cpp | 7 +- linux/fsfwconfig/objects/translateObjects.cpp | 2 +- mission/cfdp/CfdpHandler.cpp | 4 + tmtc | 2 +- 13 files changed, 516 insertions(+), 487 deletions(-) diff --git a/bsp_hosted/fsfwconfig/events/translateEvents.cpp b/bsp_hosted/fsfwconfig/events/translateEvents.cpp index 55158be2..0aaf5e9b 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 304 translations. + * @brief Auto-generated event translation file. Contains 305 translations. * @details - * Generated on: 2023-08-15 13:27:11 + * Generated on: 2023-08-31 15:00:35 */ #include "translateEvents.h" @@ -92,6 +92,7 @@ const char *MSG_QUEUE_ERROR_STRING = "MSG_QUEUE_ERROR"; const char *SERIALIZATION_ERROR_STRING = "SERIALIZATION_ERROR"; const char *FILESTORE_ERROR_STRING = "FILESTORE_ERROR"; const char *FILENAME_TOO_LARGE_ERROR_STRING = "FILENAME_TOO_LARGE_ERROR"; +const char *HANDLING_CFDP_REQUEST_FAILED_STRING = "HANDLING_CFDP_REQUEST_FAILED"; const char *SAFE_RATE_VIOLATION_STRING = "SAFE_RATE_VIOLATION"; const char *SAFE_RATE_RECOVERY_STRING = "SAFE_RATE_RECOVERY"; const char *MULTIPLE_RW_INVALID_STRING = "MULTIPLE_RW_INVALID"; @@ -486,6 +487,8 @@ const char *translateEvents(Event event) { return FILESTORE_ERROR_STRING; case (10804): return FILENAME_TOO_LARGE_ERROR_STRING; + case (10805): + return HANDLING_CFDP_REQUEST_FAILED_STRING; case (11200): return SAFE_RATE_VIOLATION_STRING; case (11201): diff --git a/bsp_hosted/fsfwconfig/objects/translateObjects.cpp b/bsp_hosted/fsfwconfig/objects/translateObjects.cpp index c7eb075d..e9d99a44 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-08-15 13:27:11 + * Generated on: 2023-08-31 15:00:35 */ #include "translateObjects.h" diff --git a/fsfw b/fsfw index fb1500e0..dfcfb035 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit fb1500e041c4d89316a9bceabc89ed870c8032be +Subproject commit dfcfb035bed4469aad2dad034567309d0dda7d29 diff --git a/generators/bsp_hosted_events.csv b/generators/bsp_hosted_events.csv index b00c56b2..9ac8e0b8 100644 --- a/generators/bsp_hosted_events.csv +++ b/generators/bsp_hosted_events.csv @@ -86,6 +86,7 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 10802;0x2a32;SERIALIZATION_ERROR;LOW;No description;fsfw/src/fsfw/cfdp/handler/defs.h 10803;0x2a33;FILESTORE_ERROR;LOW;No description;fsfw/src/fsfw/cfdp/handler/defs.h 10804;0x2a34;FILENAME_TOO_LARGE_ERROR;LOW;P1: Transaction step ID, P2: 0 for source file name, 1 for dest file name;fsfw/src/fsfw/cfdp/handler/defs.h +10805;0x2a35;HANDLING_CFDP_REQUEST_FAILED;LOW;CFDP request handling failed. P2: Returncode.;fsfw/src/fsfw/cfdp/handler/defs.h 11200;0x2bc0;SAFE_RATE_VIOLATION;MEDIUM;The limits for the rotation in safe mode were violated.;mission/acs/defs.h 11201;0x2bc1;SAFE_RATE_RECOVERY;MEDIUM;The system has recovered from a safe rate rotation violation.;mission/acs/defs.h 11202;0x2bc2;MULTIPLE_RW_INVALID;HIGH;Multiple RWs are invalid, uncommandable and therefore higher ACS modes cannot be maintained.;mission/acs/defs.h diff --git a/generators/bsp_hosted_returnvalues.csv b/generators/bsp_hosted_returnvalues.csv index 50a86ae3..e7b1109a 100644 --- a/generators/bsp_hosted_returnvalues.csv +++ b/generators/bsp_hosted_returnvalues.csv @@ -322,193 +322,200 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x3405;DC_NotActive;No description;5;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h 0x3406;DC_TooMuchData;No description;6;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h 0x3407;DC_Busy;No description;7;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h -0x3601;CFDP_InvalidTlvType;No description;1;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x3602;CFDP_InvalidDirectiveField;No description;2;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x3603;CFDP_InvalidPduDatafieldLen;No description;3;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x3604;CFDP_InvalidAckDirectiveFields;No description;4;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x3605;CFDP_MetadataCantParseOptions;No description;5;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x3606;CFDP_NakCantParseOptions;No description;6;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x3607;CFDP_FinishedCantParseFsResponses;No description;7;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x3608;CFDP_FilestoreRequiresSecondFile;No description;8;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x3609;CFDP_FilestoreResponseCantParseFsMessage;No description;9;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x360a;CFDP_InvalidPduFormat;No description;10;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x3701;TSI_BadTimestamp;No description;1;TIME_STAMPER_IF;fsfw/src/fsfw/timemanager/TimeStampIF.h -0x38a1;SGP4_InvalidEccentricity;No description;161;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h -0x38a2;SGP4_InvalidMeanMotion;No description;162;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h -0x38a3;SGP4_InvalidPerturbationElements;No description;163;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h -0x38a4;SGP4_InvalidSemiLatusRectum;No description;164;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h -0x38a5;SGP4_InvalidEpochElements;No description;165;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h -0x38a6;SGP4_SatelliteHasDecayed;No description;166;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h -0x38b1;SGP4_TleTooOld;No description;177;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h -0x38b2;SGP4_TleNotInitialized;No description;178;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h -0x3901;MUX_NotEnoughResources;No description;1;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3902;MUX_InsufficientMemory;No description;2;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3903;MUX_NoPrivilege;No description;3;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3904;MUX_WrongAttributeSetting;No description;4;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3905;MUX_MutexAlreadyLocked;No description;5;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3906;MUX_MutexNotFound;No description;6;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3907;MUX_MutexMaxLocks;No description;7;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3908;MUX_CurrThreadAlreadyOwnsMutex;No description;8;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3909;MUX_CurrThreadDoesNotOwnMutex;No description;9;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x390a;MUX_MutexTimeout;No description;10;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x390b;MUX_MutexInvalidId;No description;11;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x390c;MUX_MutexDestroyedWhileWaiting;No description;12;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3a01;MQI_Empty;No description;1;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h -0x3a02;MQI_Full;No space left for more messages;2;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h -0x3a03;MQI_NoReplyPartner;Returned if a reply method was called without partner;3;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h -0x3a04;MQI_DestinationInvalid;Returned if the target destination is invalid.;4;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h -0x3b00;SPH_ConnBroken;No description;0;SEMAPHORE_IF;fsfw/src/fsfw/osal/common/TcpTmTcServer.h -0x3b01;SPH_SemaphoreTimeout;No description;1;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h -0x3b02;SPH_SemaphoreNotOwned;No description;2;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h -0x3b03;SPH_SemaphoreInvalid;No description;3;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h -0x3c00;LPIF_PoolEntryNotFound;No description;0;LOCAL_POOL_OWNER_IF;fsfw/src/fsfw/datapoollocal/localPoolDefinitions.h -0x3c01;LPIF_PoolEntryTypeConflict;No description;1;LOCAL_POOL_OWNER_IF;fsfw/src/fsfw/datapoollocal/localPoolDefinitions.h -0x3da0;PVA_InvalidReadWriteMode;No description;160;POOL_VARIABLE_IF;fsfw/src/fsfw/datapool/PoolVariableIF.h -0x3da1;PVA_InvalidPoolEntry;No description;161;POOL_VARIABLE_IF;fsfw/src/fsfw/datapool/PoolVariableIF.h -0x3e00;HKM_QueueOrDestinationInvalid;No description;0;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h -0x3e01;HKM_WrongHkPacketType;No description;1;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h -0x3e02;HKM_ReportingStatusUnchanged;No description;2;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h -0x3e03;HKM_PeriodicHelperInvalid;No description;3;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h -0x3e04;HKM_PoolobjectNotFound;No description;4;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h -0x3e05;HKM_DatasetNotFound;No description;5;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h -0x3f01;DLEE_StreamTooShort;No description;1;DLE_ENCODER;fsfw/src/fsfw/globalfunctions/DleEncoder.h -0x3f02;DLEE_DecodingError;No description;2;DLE_ENCODER;fsfw/src/fsfw/globalfunctions/DleEncoder.h -0x4201;PUS11_InvalidTypeTimeWindow;No description;1;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h -0x4202;PUS11_InvalidTimeWindow;No description;2;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h -0x4203;PUS11_TimeshiftingNotPossible;No description;3;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h -0x4204;PUS11_InvalidRelativeTime;No description;4;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h -0x4205;PUS11_ContainedTcTooSmall;No description;5;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h -0x4206;PUS11_ContainedTcCrcMissmatch;No description;6;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h -0x4300;FILS_GenericFileError;No description;0;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x4301;FILS_GenericDirError;No description;1;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x4302;FILS_FilesystemInactive;No description;2;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x4303;FILS_GenericRenameError;No description;3;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x4304;FILS_IsBusy;No description;4;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x4305;FILS_InvalidParameters;No description;5;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x430a;FILS_FileDoesNotExist;No description;10;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x430b;FILS_FileAlreadyExists;No description;11;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x430c;FILS_NotAFile;No description;12;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x430d;FILS_FileLocked;No description;13;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x430e;FILS_PermissionDenied;No description;14;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x4315;FILS_DirectoryDoesNotExist;No description;21;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x4316;FILS_DirectoryAlreadyExists;No description;22;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x4317;FILS_NotADirectory;No description;23;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x4318;FILS_DirectoryNotEmpty;No description;24;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x431e;FILS_SequencePacketMissingWrite;No description;30;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x431f;FILS_SequencePacketMissingRead;No description;31;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x4400;UXOS_ExecutionFinished;Execution of the current command has finished;0;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h -0x4401;UXOS_CommandPending;Command is pending. This will also be returned if the user tries to load another command but a command is still pending;1;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h -0x4402;UXOS_BytesRead;Some bytes have been read from the executing process;2;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h -0x4403;UXOS_CommandError;Command execution failed;3;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h -0x4404;UXOS_NoCommandLoadedOrPending;;4;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h -0x4406;UXOS_PcloseCallError;No description;6;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h -0x4500;HSPI_OpeningFileFailed;No description;0;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h -0x4501;HSPI_FullDuplexTransferFailed;No description;1;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h -0x4502;HSPI_HalfDuplexTransferFailed;No description;2;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h -0x4503;HSPI_Timeout;No description;3;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h -0x4504;HSPI_Busy;No description;4;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h -0x4505;HSPI_GenericError;No description;5;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h -0x4601;HURT_UartReadFailure;No description;1;HAL_UART;fsfw/src/fsfw_hal/linux/serial/SerialComIF.h -0x4602;HURT_UartReadSizeMissmatch;No description;2;HAL_UART;fsfw/src/fsfw_hal/linux/serial/SerialComIF.h -0x4603;HURT_UartRxBufferTooSmall;No description;3;HAL_UART;fsfw/src/fsfw_hal/linux/serial/SerialComIF.h -0x4801;HGIO_UnknownGpioId;No description;1;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4802;HGIO_DriveGpioFailure;No description;2;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4803;HGIO_GpioTypeFailure;No description;3;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4804;HGIO_GpioInvalidInstance;No description;4;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4805;HGIO_GpioDuplicateDetected;No description;5;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4806;HGIO_GpioInitFailed;No description;6;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4807;HGIO_GpioGetValueFailed;No description;7;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4c00;SPPA_NoPacketFound;No description;0;SPACE_PACKET_PARSER;fsfw/src/fsfw/tmtcservices/SpacePacketParser.h -0x4c01;SPPA_SplitPacket;No description;1;SPACE_PACKET_PARSER;fsfw/src/fsfw/tmtcservices/SpacePacketParser.h -0x4fa1;HEATER_CommandNotSupported;No description;161;HEATER_HANDLER;mission/tcs/HeaterHandler.h -0x4fa2;HEATER_InitFailed;No description;162;HEATER_HANDLER;mission/tcs/HeaterHandler.h -0x4fa3;HEATER_InvalidSwitchNr;No description;163;HEATER_HANDLER;mission/tcs/HeaterHandler.h -0x4fa4;HEATER_MainSwitchSetTimeout;No description;164;HEATER_HANDLER;mission/tcs/HeaterHandler.h -0x4fa5;HEATER_CommandAlreadyWaiting;No description;165;HEATER_HANDLER;mission/tcs/HeaterHandler.h -0x50a0;SYRLINKS_CrcFailure;No description;160;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h -0x50a1;SYRLINKS_UartFraminOrParityErrorAck;No description;161;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h -0x50a2;SYRLINKS_BadCharacterAck;No description;162;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h -0x50a3;SYRLINKS_BadParameterValueAck;No description;163;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h -0x50a4;SYRLINKS_BadEndOfFrameAck;No description;164;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h -0x50a5;SYRLINKS_UnknownCommandIdAck;No description;165;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h -0x50a6;SYRLINKS_BadCrcAck;No description;166;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h -0x50a7;SYRLINKS_ReplyWrongSize;No description;167;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h -0x50a8;SYRLINKS_MissingStartFrameCharacter;No description;168;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h -0x5100;IMTQ_InvalidCommandCode;No description;0;IMTQ_HANDLER;mission/acs/imtqHelpers.h -0x5101;IMTQ_MgmMeasurementLowLevelError;No description;1;IMTQ_HANDLER;mission/acs/imtqHelpers.h -0x5102;IMTQ_ActuateCmdLowLevelError;No description;2;IMTQ_HANDLER;mission/acs/imtqHelpers.h -0x5103;IMTQ_ParameterMissing;No description;3;IMTQ_HANDLER;mission/acs/imtqHelpers.h -0x5104;IMTQ_ParameterInvalid;No description;4;IMTQ_HANDLER;mission/acs/imtqHelpers.h -0x5105;IMTQ_CcUnavailable;No description;5;IMTQ_HANDLER;mission/acs/imtqHelpers.h -0x5106;IMTQ_InternalProcessingError;No description;6;IMTQ_HANDLER;mission/acs/imtqHelpers.h -0x5107;IMTQ_RejectedWithoutReason;No description;7;IMTQ_HANDLER;mission/acs/imtqHelpers.h -0x5108;IMTQ_CmdErrUnknown;No description;8;IMTQ_HANDLER;mission/acs/imtqHelpers.h -0x5109;IMTQ_StartupCfgError;No description;9;IMTQ_HANDLER;mission/acs/imtqHelpers.h -0x510a;IMTQ_UnexpectedSelfTestReply;The status reply to a self test command was received but no self test command has been sent. This should normally never happen.;10;IMTQ_HANDLER;mission/acs/imtqHelpers.h -0x52b0;RWHA_SpiWriteFailure;No description;176;RW_HANDLER;mission/acs/rwHelpers.h -0x52b1;RWHA_SpiReadFailure;Used by the spi send function to tell a failing read call;177;RW_HANDLER;mission/acs/rwHelpers.h -0x52b2;RWHA_MissingStartSign;Can be used by the HDLC decoding mechanism to inform about a missing start sign 0x7E;178;RW_HANDLER;mission/acs/rwHelpers.h -0x52b3;RWHA_InvalidSubstitute;Can be used by the HDLC decoding mechanism to inform about an invalid substitution combination;179;RW_HANDLER;mission/acs/rwHelpers.h -0x52b4;RWHA_MissingEndSign;HDLC decoding mechanism never receives the end sign 0x7E;180;RW_HANDLER;mission/acs/rwHelpers.h -0x52b5;RWHA_NoReply;Reaction wheel only responds with empty frames.;181;RW_HANDLER;mission/acs/rwHelpers.h -0x52b6;RWHA_NoStartMarker;Expected a start marker as first byte;182;RW_HANDLER;mission/acs/rwHelpers.h -0x52b7;RWHA_SpiReadTimeout;Timeout when reading reply;183;RW_HANDLER;mission/acs/rwHelpers.h -0x53a0;STRH_TemperatureReqFailed;Status in temperature reply signals error;160;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x53a1;STRH_PingFailed;Ping command failed;161;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x53a2;STRH_VersionReqFailed;Status in version reply signals error;162;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x53a3;STRH_InterfaceReqFailed;Status in interface reply signals error;163;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x53a4;STRH_PowerReqFailed;Status in power reply signals error;164;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x53a5;STRH_SetParamFailed;Status of reply to parameter set command signals error;165;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x53a6;STRH_ActionFailed;Status of reply to action command signals error;166;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x53a7;STRH_FilePathTooLong;Received invalid path string. Exceeds allowed length;167;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x53a8;STRH_FilenameTooLong;Name of file received with command is too long;168;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x53a9;STRH_InvalidProgram;Received version reply with invalid program ID;169;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x53aa;STRH_ReplyError;Status field reply signals error;170;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x53ab;STRH_CommandTooShort;Received command which is too short (some data is missing for proper execution);171;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x53ac;STRH_InvalidLength;Received command with invalid length (too few or too many parameters);172;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x53ad;STRH_RegionMismatch;Region mismatch between send and received data;173;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x53ae;STRH_AddressMismatch;Address mismatch between send and received data;174;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x53af;STRH_LengthMismatch;Length field mismatch between send and received data;175;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x53b0;STRH_FileNotExists;Specified file does not exist;176;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x53b1;STRH_InvalidType;Download blob pixel command has invalid type field;177;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x53b2;STRH_InvalidId;Received FPGA action command with invalid ID;178;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x53b3;STRH_ReplyTooShort;Received reply is too short;179;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x53b4;STRH_CrcFailure;Received reply with invalid CRC;180;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x53b5;STRH_StrHelperExecuting;Star tracker handler currently executing a command and using the communication interface;181;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x53b6;STRH_StartrackerAlreadyBooted;Star tracker is already in firmware mode;182;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x53b7;STRH_StartrackerNotRunningFirmware;Star tracker must be in firmware mode to run this command;183;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x53b8;STRH_StartrackerNotRunningBootloader;Star tracker must be in bootloader mode to run this command;184;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x58a0;SUSS_InvalidSpeed;Action Message with invalid speed was received. Valid speeds must be in the range of [-65000, 1000] or [1000, 65000];160;SUS_HANDLER;mission/acs/RwHandler.h -0x58a1;SUSS_InvalidRampTime;Action Message with invalid ramp time was received.;161;SUS_HANDLER;mission/acs/RwHandler.h -0x58a2;SUSS_SetSpeedCommandInvalidLength;Received set speed command has invalid length. Should be 6.;162;SUS_HANDLER;mission/acs/RwHandler.h -0x58a3;SUSS_ExecutionFailed;Command execution failed;163;SUS_HANDLER;mission/acs/RwHandler.h -0x58a4;SUSS_CrcError;Reaction wheel reply has invalid crc;164;SUS_HANDLER;mission/acs/RwHandler.h -0x58a5;SUSS_ValueNotRead;No description;165;SUS_HANDLER;mission/acs/RwHandler.h -0x5d00;GOMS_PacketTooLong;No description;0;GOM_SPACE_HANDLER;mission/power/GomspaceDeviceHandler.h -0x5d01;GOMS_InvalidTableId;No description;1;GOM_SPACE_HANDLER;mission/power/GomspaceDeviceHandler.h -0x5d02;GOMS_InvalidAddress;No description;2;GOM_SPACE_HANDLER;mission/power/GomspaceDeviceHandler.h -0x5d03;GOMS_InvalidParamSize;No description;3;GOM_SPACE_HANDLER;mission/power/GomspaceDeviceHandler.h -0x5d04;GOMS_InvalidPayloadSize;No description;4;GOM_SPACE_HANDLER;mission/power/GomspaceDeviceHandler.h -0x5d05;GOMS_UnknownReplyId;No description;5;GOM_SPACE_HANDLER;mission/power/GomspaceDeviceHandler.h -0x60a0;CCSDS_CommandNotImplemented;Received action message with unknown action id;160;CCSDS_HANDLER;mission/com/CcsdsIpCoreHandler.h -0x6201;JSONBASE_JsonFileNotExists;Specified json file does not exist;1;ARCSEC_JSON_BASE;mission/acs/str/ArcsecJsonParamBase.h -0x6202;JSONBASE_SetNotExists;Requested set does not exist in json file;2;ARCSEC_JSON_BASE;mission/acs/str/ArcsecJsonParamBase.h -0x6203;JSONBASE_ParamNotExists;Requested parameter does not exist in json file;3;ARCSEC_JSON_BASE;mission/acs/str/ArcsecJsonParamBase.h -0x63a0;NVMB_KeyNotExists;Specified key does not exist in json file;160;NVM_PARAM_BASE;mission/memory/NvmParameterBase.h -0x66a0;SADPL_CommandNotSupported;No description;160;SA_DEPL_HANDLER;mission/SolarArrayDeploymentHandler.h -0x66a1;SADPL_DeploymentAlreadyExecuting;No description;161;SA_DEPL_HANDLER;mission/SolarArrayDeploymentHandler.h -0x66a2;SADPL_MainSwitchTimeoutFailure;No description;162;SA_DEPL_HANDLER;mission/SolarArrayDeploymentHandler.h -0x66a3;SADPL_SwitchingDeplSa1Failed;No description;163;SA_DEPL_HANDLER;mission/SolarArrayDeploymentHandler.h -0x66a4;SADPL_SwitchingDeplSa2Failed;No description;164;SA_DEPL_HANDLER;mission/SolarArrayDeploymentHandler.h -0x6900;ACSCTRL_FileDeletionFailed;File deletion failed and at least one file is still existent.;0;ACS_CTRL;mission/controller/AcsController.h -0x6a02;ACSMEKF_MekfUninitialized;No description;2;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h -0x6a03;ACSMEKF_MekfNoGyrData;No description;3;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h -0x6a04;ACSMEKF_MekfNoModelVectors;No description;4;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h -0x6a05;ACSMEKF_MekfNoSusMgmStrData;No description;5;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h -0x6a06;ACSMEKF_MekfCovarianceInversionFailed;No description;6;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h -0x6a07;ACSMEKF_MekfNotFinite;No description;7;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h -0x6a08;ACSMEKF_MekfInitialized;No description;8;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h -0x6a09;ACSMEKF_MekfRunning;No description;9;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h -0x6d00;PTM_DumpDone;No description;0;PERSISTENT_TM_STORE;mission/tmtc/PersistentTmStore.h -0x6d01;PTM_BusyDumping;No description;1;PERSISTENT_TM_STORE;mission/tmtc/PersistentTmStore.h -0x6e00;TMS_IsBusy;No description;0;TM_SINK;mission/tmtc/DirectTmSinkIF.h +0x3601;CFDP_InvalidTlvType;No description;1;CFDP_BASE;fsfw/src/fsfw/cfdp/definitions.h +0x3602;CFDP_InvalidDirectiveField;No description;2;CFDP_BASE;fsfw/src/fsfw/cfdp/definitions.h +0x3603;CFDP_InvalidPduDatafieldLen;No description;3;CFDP_BASE;fsfw/src/fsfw/cfdp/definitions.h +0x3604;CFDP_InvalidAckDirectiveFields;No description;4;CFDP_BASE;fsfw/src/fsfw/cfdp/definitions.h +0x3605;CFDP_MetadataCantParseOptions;No description;5;CFDP_BASE;fsfw/src/fsfw/cfdp/definitions.h +0x3606;CFDP_NakCantParseOptions;No description;6;CFDP_BASE;fsfw/src/fsfw/cfdp/definitions.h +0x3607;CFDP_FinishedCantParseFsResponses;No description;7;CFDP_BASE;fsfw/src/fsfw/cfdp/definitions.h +0x3608;CFDP_FilestoreRequiresSecondFile;No description;8;CFDP_BASE;fsfw/src/fsfw/cfdp/definitions.h +0x3609;CFDP_FilestoreResponseCantParseFsMessage;No description;9;CFDP_BASE;fsfw/src/fsfw/cfdp/definitions.h +0x360a;CFDP_InvalidPduFormat;No description;10;CFDP_BASE;fsfw/src/fsfw/cfdp/definitions.h +0x3700;CFDP_SourceTransactionPending;No description;0;CFDP_HANDLER;fsfw/src/fsfw/cfdp/handler/defs.h +0x3701;CFDP_FileDoesNotExist;No description;1;CFDP_HANDLER;fsfw/src/fsfw/cfdp/handler/defs.h +0x3702;CFDP_FileSegmentLenInvalid;No description;2;CFDP_HANDLER;fsfw/src/fsfw/cfdp/handler/defs.h +0x3703;CFDP_SourceNameEmpty;No description;3;CFDP_HANDLER;fsfw/src/fsfw/cfdp/handler/defs.h +0x3704;CFDP_DestNameEmpty;No description;4;CFDP_HANDLER;fsfw/src/fsfw/cfdp/handler/defs.h +0x3705;CFDP_WrongRemoteCfgEntityId;No description;5;CFDP_HANDLER;fsfw/src/fsfw/cfdp/handler/defs.h +0x3706;CFDP_TargetMsgQueueFull;No description;6;CFDP_HANDLER;fsfw/src/fsfw/cfdp/handler/defs.h +0x3801;TSI_BadTimestamp;No description;1;TIME_STAMPER_IF;fsfw/src/fsfw/timemanager/TimeStampIF.h +0x39a1;SGP4_InvalidEccentricity;No description;161;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x39a2;SGP4_InvalidMeanMotion;No description;162;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x39a3;SGP4_InvalidPerturbationElements;No description;163;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x39a4;SGP4_InvalidSemiLatusRectum;No description;164;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x39a5;SGP4_InvalidEpochElements;No description;165;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x39a6;SGP4_SatelliteHasDecayed;No description;166;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x39b1;SGP4_TleTooOld;No description;177;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x39b2;SGP4_TleNotInitialized;No description;178;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x3a01;MUX_NotEnoughResources;No description;1;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3a02;MUX_InsufficientMemory;No description;2;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3a03;MUX_NoPrivilege;No description;3;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3a04;MUX_WrongAttributeSetting;No description;4;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3a05;MUX_MutexAlreadyLocked;No description;5;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3a06;MUX_MutexNotFound;No description;6;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3a07;MUX_MutexMaxLocks;No description;7;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3a08;MUX_CurrThreadAlreadyOwnsMutex;No description;8;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3a09;MUX_CurrThreadDoesNotOwnMutex;No description;9;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3a0a;MUX_MutexTimeout;No description;10;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3a0b;MUX_MutexInvalidId;No description;11;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3a0c;MUX_MutexDestroyedWhileWaiting;No description;12;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3b01;MQI_Empty;No description;1;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h +0x3b02;MQI_Full;No space left for more messages;2;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h +0x3b03;MQI_NoReplyPartner;Returned if a reply method was called without partner;3;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h +0x3b04;MQI_DestinationInvalid;Returned if the target destination is invalid.;4;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h +0x3c00;SPH_ConnBroken;No description;0;SEMAPHORE_IF;fsfw/src/fsfw/osal/common/TcpTmTcServer.h +0x3c01;SPH_SemaphoreTimeout;No description;1;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h +0x3c02;SPH_SemaphoreNotOwned;No description;2;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h +0x3c03;SPH_SemaphoreInvalid;No description;3;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h +0x3d00;LPIF_PoolEntryNotFound;No description;0;LOCAL_POOL_OWNER_IF;fsfw/src/fsfw/datapoollocal/localPoolDefinitions.h +0x3d01;LPIF_PoolEntryTypeConflict;No description;1;LOCAL_POOL_OWNER_IF;fsfw/src/fsfw/datapoollocal/localPoolDefinitions.h +0x3ea0;PVA_InvalidReadWriteMode;No description;160;POOL_VARIABLE_IF;fsfw/src/fsfw/datapool/PoolVariableIF.h +0x3ea1;PVA_InvalidPoolEntry;No description;161;POOL_VARIABLE_IF;fsfw/src/fsfw/datapool/PoolVariableIF.h +0x3f00;HKM_QueueOrDestinationInvalid;No description;0;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h +0x3f01;HKM_WrongHkPacketType;No description;1;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h +0x3f02;HKM_ReportingStatusUnchanged;No description;2;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h +0x3f03;HKM_PeriodicHelperInvalid;No description;3;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h +0x3f04;HKM_PoolobjectNotFound;No description;4;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h +0x3f05;HKM_DatasetNotFound;No description;5;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h +0x4001;DLEE_StreamTooShort;No description;1;DLE_ENCODER;fsfw/src/fsfw/globalfunctions/DleEncoder.h +0x4002;DLEE_DecodingError;No description;2;DLE_ENCODER;fsfw/src/fsfw/globalfunctions/DleEncoder.h +0x4301;PUS11_InvalidTypeTimeWindow;No description;1;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h +0x4302;PUS11_InvalidTimeWindow;No description;2;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h +0x4303;PUS11_TimeshiftingNotPossible;No description;3;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h +0x4304;PUS11_InvalidRelativeTime;No description;4;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h +0x4305;PUS11_ContainedTcTooSmall;No description;5;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h +0x4306;PUS11_ContainedTcCrcMissmatch;No description;6;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h +0x4400;FILS_GenericFileError;No description;0;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4401;FILS_GenericDirError;No description;1;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4402;FILS_FilesystemInactive;No description;2;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4403;FILS_GenericRenameError;No description;3;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4404;FILS_IsBusy;No description;4;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4405;FILS_InvalidParameters;No description;5;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x440a;FILS_FileDoesNotExist;No description;10;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x440b;FILS_FileAlreadyExists;No description;11;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x440c;FILS_NotAFile;No description;12;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x440d;FILS_FileLocked;No description;13;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x440e;FILS_PermissionDenied;No description;14;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4415;FILS_DirectoryDoesNotExist;No description;21;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4416;FILS_DirectoryAlreadyExists;No description;22;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4417;FILS_NotADirectory;No description;23;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4418;FILS_DirectoryNotEmpty;No description;24;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x441e;FILS_SequencePacketMissingWrite;No description;30;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x441f;FILS_SequencePacketMissingRead;No description;31;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4500;UXOS_ExecutionFinished;Execution of the current command has finished;0;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h +0x4501;UXOS_CommandPending;Command is pending. This will also be returned if the user tries to load another command but a command is still pending;1;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h +0x4502;UXOS_BytesRead;Some bytes have been read from the executing process;2;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h +0x4503;UXOS_CommandError;Command execution failed;3;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h +0x4504;UXOS_NoCommandLoadedOrPending;;4;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h +0x4506;UXOS_PcloseCallError;No description;6;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h +0x4600;HSPI_OpeningFileFailed;No description;0;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h +0x4601;HSPI_FullDuplexTransferFailed;No description;1;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h +0x4602;HSPI_HalfDuplexTransferFailed;No description;2;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h +0x4603;HSPI_Timeout;No description;3;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h +0x4604;HSPI_Busy;No description;4;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h +0x4605;HSPI_GenericError;No description;5;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h +0x4701;HURT_UartReadFailure;No description;1;HAL_UART;fsfw/src/fsfw_hal/linux/serial/SerialComIF.h +0x4702;HURT_UartReadSizeMissmatch;No description;2;HAL_UART;fsfw/src/fsfw_hal/linux/serial/SerialComIF.h +0x4703;HURT_UartRxBufferTooSmall;No description;3;HAL_UART;fsfw/src/fsfw_hal/linux/serial/SerialComIF.h +0x4901;HGIO_UnknownGpioId;No description;1;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4902;HGIO_DriveGpioFailure;No description;2;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4903;HGIO_GpioTypeFailure;No description;3;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4904;HGIO_GpioInvalidInstance;No description;4;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4905;HGIO_GpioDuplicateDetected;No description;5;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4906;HGIO_GpioInitFailed;No description;6;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4907;HGIO_GpioGetValueFailed;No description;7;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4d00;SPPA_NoPacketFound;No description;0;SPACE_PACKET_PARSER;fsfw/src/fsfw/tmtcservices/SpacePacketParser.h +0x4d01;SPPA_SplitPacket;No description;1;SPACE_PACKET_PARSER;fsfw/src/fsfw/tmtcservices/SpacePacketParser.h +0x50a1;HEATER_CommandNotSupported;No description;161;HEATER_HANDLER;mission/tcs/HeaterHandler.h +0x50a2;HEATER_InitFailed;No description;162;HEATER_HANDLER;mission/tcs/HeaterHandler.h +0x50a3;HEATER_InvalidSwitchNr;No description;163;HEATER_HANDLER;mission/tcs/HeaterHandler.h +0x50a4;HEATER_MainSwitchSetTimeout;No description;164;HEATER_HANDLER;mission/tcs/HeaterHandler.h +0x50a5;HEATER_CommandAlreadyWaiting;No description;165;HEATER_HANDLER;mission/tcs/HeaterHandler.h +0x51a0;SYRLINKS_CrcFailure;No description;160;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h +0x51a1;SYRLINKS_UartFraminOrParityErrorAck;No description;161;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h +0x51a2;SYRLINKS_BadCharacterAck;No description;162;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h +0x51a3;SYRLINKS_BadParameterValueAck;No description;163;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h +0x51a4;SYRLINKS_BadEndOfFrameAck;No description;164;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h +0x51a5;SYRLINKS_UnknownCommandIdAck;No description;165;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h +0x51a6;SYRLINKS_BadCrcAck;No description;166;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h +0x51a7;SYRLINKS_ReplyWrongSize;No description;167;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h +0x51a8;SYRLINKS_MissingStartFrameCharacter;No description;168;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h +0x5200;IMTQ_InvalidCommandCode;No description;0;IMTQ_HANDLER;mission/acs/imtqHelpers.h +0x5201;IMTQ_MgmMeasurementLowLevelError;No description;1;IMTQ_HANDLER;mission/acs/imtqHelpers.h +0x5202;IMTQ_ActuateCmdLowLevelError;No description;2;IMTQ_HANDLER;mission/acs/imtqHelpers.h +0x5203;IMTQ_ParameterMissing;No description;3;IMTQ_HANDLER;mission/acs/imtqHelpers.h +0x5204;IMTQ_ParameterInvalid;No description;4;IMTQ_HANDLER;mission/acs/imtqHelpers.h +0x5205;IMTQ_CcUnavailable;No description;5;IMTQ_HANDLER;mission/acs/imtqHelpers.h +0x5206;IMTQ_InternalProcessingError;No description;6;IMTQ_HANDLER;mission/acs/imtqHelpers.h +0x5207;IMTQ_RejectedWithoutReason;No description;7;IMTQ_HANDLER;mission/acs/imtqHelpers.h +0x5208;IMTQ_CmdErrUnknown;No description;8;IMTQ_HANDLER;mission/acs/imtqHelpers.h +0x5209;IMTQ_StartupCfgError;No description;9;IMTQ_HANDLER;mission/acs/imtqHelpers.h +0x520a;IMTQ_UnexpectedSelfTestReply;The status reply to a self test command was received but no self test command has been sent. This should normally never happen.;10;IMTQ_HANDLER;mission/acs/imtqHelpers.h +0x53b0;RWHA_SpiWriteFailure;No description;176;RW_HANDLER;mission/acs/rwHelpers.h +0x53b1;RWHA_SpiReadFailure;Used by the spi send function to tell a failing read call;177;RW_HANDLER;mission/acs/rwHelpers.h +0x53b2;RWHA_MissingStartSign;Can be used by the HDLC decoding mechanism to inform about a missing start sign 0x7E;178;RW_HANDLER;mission/acs/rwHelpers.h +0x53b3;RWHA_InvalidSubstitute;Can be used by the HDLC decoding mechanism to inform about an invalid substitution combination;179;RW_HANDLER;mission/acs/rwHelpers.h +0x53b4;RWHA_MissingEndSign;HDLC decoding mechanism never receives the end sign 0x7E;180;RW_HANDLER;mission/acs/rwHelpers.h +0x53b5;RWHA_NoReply;Reaction wheel only responds with empty frames.;181;RW_HANDLER;mission/acs/rwHelpers.h +0x53b6;RWHA_NoStartMarker;Expected a start marker as first byte;182;RW_HANDLER;mission/acs/rwHelpers.h +0x53b7;RWHA_SpiReadTimeout;Timeout when reading reply;183;RW_HANDLER;mission/acs/rwHelpers.h +0x54a0;STRH_TemperatureReqFailed;Status in temperature reply signals error;160;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x54a1;STRH_PingFailed;Ping command failed;161;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x54a2;STRH_VersionReqFailed;Status in version reply signals error;162;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x54a3;STRH_InterfaceReqFailed;Status in interface reply signals error;163;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x54a4;STRH_PowerReqFailed;Status in power reply signals error;164;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x54a5;STRH_SetParamFailed;Status of reply to parameter set command signals error;165;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x54a6;STRH_ActionFailed;Status of reply to action command signals error;166;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x54a7;STRH_FilePathTooLong;Received invalid path string. Exceeds allowed length;167;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x54a8;STRH_FilenameTooLong;Name of file received with command is too long;168;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x54a9;STRH_InvalidProgram;Received version reply with invalid program ID;169;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x54aa;STRH_ReplyError;Status field reply signals error;170;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x54ab;STRH_CommandTooShort;Received command which is too short (some data is missing for proper execution);171;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x54ac;STRH_InvalidLength;Received command with invalid length (too few or too many parameters);172;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x54ad;STRH_RegionMismatch;Region mismatch between send and received data;173;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x54ae;STRH_AddressMismatch;Address mismatch between send and received data;174;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x54af;STRH_LengthMismatch;Length field mismatch between send and received data;175;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x54b0;STRH_FileNotExists;Specified file does not exist;176;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x54b1;STRH_InvalidType;Download blob pixel command has invalid type field;177;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x54b2;STRH_InvalidId;Received FPGA action command with invalid ID;178;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x54b3;STRH_ReplyTooShort;Received reply is too short;179;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x54b4;STRH_CrcFailure;Received reply with invalid CRC;180;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x54b5;STRH_StrHelperExecuting;Star tracker handler currently executing a command and using the communication interface;181;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x54b6;STRH_StartrackerAlreadyBooted;Star tracker is already in firmware mode;182;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x54b7;STRH_StartrackerNotRunningFirmware;Star tracker must be in firmware mode to run this command;183;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x54b8;STRH_StartrackerNotRunningBootloader;Star tracker must be in bootloader mode to run this command;184;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x59a0;SUSS_InvalidSpeed;Action Message with invalid speed was received. Valid speeds must be in the range of [-65000, 1000] or [1000, 65000];160;SUS_HANDLER;mission/acs/RwHandler.h +0x59a1;SUSS_InvalidRampTime;Action Message with invalid ramp time was received.;161;SUS_HANDLER;mission/acs/RwHandler.h +0x59a2;SUSS_SetSpeedCommandInvalidLength;Received set speed command has invalid length. Should be 6.;162;SUS_HANDLER;mission/acs/RwHandler.h +0x59a3;SUSS_ExecutionFailed;Command execution failed;163;SUS_HANDLER;mission/acs/RwHandler.h +0x59a4;SUSS_CrcError;Reaction wheel reply has invalid crc;164;SUS_HANDLER;mission/acs/RwHandler.h +0x59a5;SUSS_ValueNotRead;No description;165;SUS_HANDLER;mission/acs/RwHandler.h +0x5e00;GOMS_PacketTooLong;No description;0;GOM_SPACE_HANDLER;mission/power/GomspaceDeviceHandler.h +0x5e01;GOMS_InvalidTableId;No description;1;GOM_SPACE_HANDLER;mission/power/GomspaceDeviceHandler.h +0x5e02;GOMS_InvalidAddress;No description;2;GOM_SPACE_HANDLER;mission/power/GomspaceDeviceHandler.h +0x5e03;GOMS_InvalidParamSize;No description;3;GOM_SPACE_HANDLER;mission/power/GomspaceDeviceHandler.h +0x5e04;GOMS_InvalidPayloadSize;No description;4;GOM_SPACE_HANDLER;mission/power/GomspaceDeviceHandler.h +0x5e05;GOMS_UnknownReplyId;No description;5;GOM_SPACE_HANDLER;mission/power/GomspaceDeviceHandler.h +0x61a0;CCSDS_CommandNotImplemented;Received action message with unknown action id;160;CCSDS_HANDLER;mission/com/CcsdsIpCoreHandler.h +0x6301;JSONBASE_JsonFileNotExists;Specified json file does not exist;1;ARCSEC_JSON_BASE;mission/acs/str/ArcsecJsonParamBase.h +0x6302;JSONBASE_SetNotExists;Requested set does not exist in json file;2;ARCSEC_JSON_BASE;mission/acs/str/ArcsecJsonParamBase.h +0x6303;JSONBASE_ParamNotExists;Requested parameter does not exist in json file;3;ARCSEC_JSON_BASE;mission/acs/str/ArcsecJsonParamBase.h +0x64a0;NVMB_KeyNotExists;Specified key does not exist in json file;160;NVM_PARAM_BASE;mission/memory/NvmParameterBase.h +0x67a0;SADPL_CommandNotSupported;No description;160;SA_DEPL_HANDLER;mission/SolarArrayDeploymentHandler.h +0x67a1;SADPL_DeploymentAlreadyExecuting;No description;161;SA_DEPL_HANDLER;mission/SolarArrayDeploymentHandler.h +0x67a2;SADPL_MainSwitchTimeoutFailure;No description;162;SA_DEPL_HANDLER;mission/SolarArrayDeploymentHandler.h +0x67a3;SADPL_SwitchingDeplSa1Failed;No description;163;SA_DEPL_HANDLER;mission/SolarArrayDeploymentHandler.h +0x67a4;SADPL_SwitchingDeplSa2Failed;No description;164;SA_DEPL_HANDLER;mission/SolarArrayDeploymentHandler.h +0x6a00;ACSCTRL_FileDeletionFailed;File deletion failed and at least one file is still existent.;0;ACS_CTRL;mission/controller/AcsController.h +0x6b02;ACSMEKF_MekfUninitialized;No description;2;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h +0x6b03;ACSMEKF_MekfNoGyrData;No description;3;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h +0x6b04;ACSMEKF_MekfNoModelVectors;No description;4;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h +0x6b05;ACSMEKF_MekfNoSusMgmStrData;No description;5;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h +0x6b06;ACSMEKF_MekfCovarianceInversionFailed;No description;6;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h +0x6b07;ACSMEKF_MekfNotFinite;No description;7;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h +0x6b08;ACSMEKF_MekfInitialized;No description;8;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h +0x6b09;ACSMEKF_MekfRunning;No description;9;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h +0x6e00;PTM_DumpDone;No description;0;PERSISTENT_TM_STORE;mission/tmtc/PersistentTmStore.h +0x6e01;PTM_BusyDumping;No description;1;PERSISTENT_TM_STORE;mission/tmtc/PersistentTmStore.h +0x6f00;TMS_IsBusy;No description;0;TM_SINK;mission/tmtc/DirectTmSinkIF.h diff --git a/generators/bsp_q7s_events.csv b/generators/bsp_q7s_events.csv index b00c56b2..9ac8e0b8 100644 --- a/generators/bsp_q7s_events.csv +++ b/generators/bsp_q7s_events.csv @@ -86,6 +86,7 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 10802;0x2a32;SERIALIZATION_ERROR;LOW;No description;fsfw/src/fsfw/cfdp/handler/defs.h 10803;0x2a33;FILESTORE_ERROR;LOW;No description;fsfw/src/fsfw/cfdp/handler/defs.h 10804;0x2a34;FILENAME_TOO_LARGE_ERROR;LOW;P1: Transaction step ID, P2: 0 for source file name, 1 for dest file name;fsfw/src/fsfw/cfdp/handler/defs.h +10805;0x2a35;HANDLING_CFDP_REQUEST_FAILED;LOW;CFDP request handling failed. P2: Returncode.;fsfw/src/fsfw/cfdp/handler/defs.h 11200;0x2bc0;SAFE_RATE_VIOLATION;MEDIUM;The limits for the rotation in safe mode were violated.;mission/acs/defs.h 11201;0x2bc1;SAFE_RATE_RECOVERY;MEDIUM;The system has recovered from a safe rate rotation violation.;mission/acs/defs.h 11202;0x2bc2;MULTIPLE_RW_INVALID;HIGH;Multiple RWs are invalid, uncommandable and therefore higher ACS modes cannot be maintained.;mission/acs/defs.h diff --git a/generators/bsp_q7s_returnvalues.csv b/generators/bsp_q7s_returnvalues.csv index 1bc91860..355ce26b 100644 --- a/generators/bsp_q7s_returnvalues.csv +++ b/generators/bsp_q7s_returnvalues.csv @@ -322,289 +322,296 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x3405;DC_NotActive;No description;5;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h 0x3406;DC_TooMuchData;No description;6;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h 0x3407;DC_Busy;No description;7;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h -0x3601;CFDP_InvalidTlvType;No description;1;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x3602;CFDP_InvalidDirectiveField;No description;2;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x3603;CFDP_InvalidPduDatafieldLen;No description;3;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x3604;CFDP_InvalidAckDirectiveFields;No description;4;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x3605;CFDP_MetadataCantParseOptions;No description;5;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x3606;CFDP_NakCantParseOptions;No description;6;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x3607;CFDP_FinishedCantParseFsResponses;No description;7;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x3608;CFDP_FilestoreRequiresSecondFile;No description;8;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x3609;CFDP_FilestoreResponseCantParseFsMessage;No description;9;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x360a;CFDP_InvalidPduFormat;No description;10;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x3701;TSI_BadTimestamp;No description;1;TIME_STAMPER_IF;fsfw/src/fsfw/timemanager/TimeStampIF.h -0x38a1;SGP4_InvalidEccentricity;No description;161;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h -0x38a2;SGP4_InvalidMeanMotion;No description;162;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h -0x38a3;SGP4_InvalidPerturbationElements;No description;163;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h -0x38a4;SGP4_InvalidSemiLatusRectum;No description;164;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h -0x38a5;SGP4_InvalidEpochElements;No description;165;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h -0x38a6;SGP4_SatelliteHasDecayed;No description;166;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h -0x38b1;SGP4_TleTooOld;No description;177;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h -0x38b2;SGP4_TleNotInitialized;No description;178;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h -0x3901;MUX_NotEnoughResources;No description;1;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3902;MUX_InsufficientMemory;No description;2;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3903;MUX_NoPrivilege;No description;3;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3904;MUX_WrongAttributeSetting;No description;4;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3905;MUX_MutexAlreadyLocked;No description;5;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3906;MUX_MutexNotFound;No description;6;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3907;MUX_MutexMaxLocks;No description;7;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3908;MUX_CurrThreadAlreadyOwnsMutex;No description;8;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3909;MUX_CurrThreadDoesNotOwnMutex;No description;9;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x390a;MUX_MutexTimeout;No description;10;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x390b;MUX_MutexInvalidId;No description;11;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x390c;MUX_MutexDestroyedWhileWaiting;No description;12;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3a01;MQI_Empty;No description;1;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h -0x3a02;MQI_Full;No space left for more messages;2;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h -0x3a03;MQI_NoReplyPartner;Returned if a reply method was called without partner;3;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h -0x3a04;MQI_DestinationInvalid;Returned if the target destination is invalid.;4;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h -0x3b00;SPH_ConnBroken;No description;0;SEMAPHORE_IF;fsfw/src/fsfw/osal/common/TcpTmTcServer.h -0x3b01;SPH_SemaphoreTimeout;No description;1;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h -0x3b02;SPH_SemaphoreNotOwned;No description;2;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h -0x3b03;SPH_SemaphoreInvalid;No description;3;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h -0x3c00;LPIF_PoolEntryNotFound;No description;0;LOCAL_POOL_OWNER_IF;fsfw/src/fsfw/datapoollocal/localPoolDefinitions.h -0x3c01;LPIF_PoolEntryTypeConflict;No description;1;LOCAL_POOL_OWNER_IF;fsfw/src/fsfw/datapoollocal/localPoolDefinitions.h -0x3da0;PVA_InvalidReadWriteMode;No description;160;POOL_VARIABLE_IF;fsfw/src/fsfw/datapool/PoolVariableIF.h -0x3da1;PVA_InvalidPoolEntry;No description;161;POOL_VARIABLE_IF;fsfw/src/fsfw/datapool/PoolVariableIF.h -0x3e00;HKM_QueueOrDestinationInvalid;No description;0;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h -0x3e01;HKM_WrongHkPacketType;No description;1;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h -0x3e02;HKM_ReportingStatusUnchanged;No description;2;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h -0x3e03;HKM_PeriodicHelperInvalid;No description;3;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h -0x3e04;HKM_PoolobjectNotFound;No description;4;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h -0x3e05;HKM_DatasetNotFound;No description;5;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h -0x3f01;DLEE_StreamTooShort;No description;1;DLE_ENCODER;fsfw/src/fsfw/globalfunctions/DleEncoder.h -0x3f02;DLEE_DecodingError;No description;2;DLE_ENCODER;fsfw/src/fsfw/globalfunctions/DleEncoder.h -0x4201;PUS11_InvalidTypeTimeWindow;No description;1;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h -0x4202;PUS11_InvalidTimeWindow;No description;2;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h -0x4203;PUS11_TimeshiftingNotPossible;No description;3;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h -0x4204;PUS11_InvalidRelativeTime;No description;4;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h -0x4205;PUS11_ContainedTcTooSmall;No description;5;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h -0x4206;PUS11_ContainedTcCrcMissmatch;No description;6;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h -0x4300;FILS_GenericFileError;No description;0;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x4301;FILS_GenericDirError;No description;1;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x4302;FILS_FilesystemInactive;No description;2;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x4303;FILS_GenericRenameError;No description;3;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x4304;FILS_IsBusy;No description;4;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x4305;FILS_InvalidParameters;No description;5;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x430a;FILS_FileDoesNotExist;No description;10;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x430b;FILS_FileAlreadyExists;No description;11;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x430c;FILS_NotAFile;No description;12;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x430d;FILS_FileLocked;No description;13;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x430e;FILS_PermissionDenied;No description;14;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x4315;FILS_DirectoryDoesNotExist;No description;21;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x4316;FILS_DirectoryAlreadyExists;No description;22;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x4317;FILS_NotADirectory;No description;23;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x4318;FILS_DirectoryNotEmpty;No description;24;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x431e;FILS_SequencePacketMissingWrite;No description;30;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x431f;FILS_SequencePacketMissingRead;No description;31;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x4400;UXOS_ExecutionFinished;Execution of the current command has finished;0;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h -0x4401;UXOS_CommandPending;Command is pending. This will also be returned if the user tries to load another command but a command is still pending;1;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h -0x4402;UXOS_BytesRead;Some bytes have been read from the executing process;2;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h -0x4403;UXOS_CommandError;Command execution failed;3;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h -0x4404;UXOS_NoCommandLoadedOrPending;;4;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h -0x4406;UXOS_PcloseCallError;No description;6;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h -0x4500;HSPI_OpeningFileFailed;No description;0;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h -0x4501;HSPI_FullDuplexTransferFailed;No description;1;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h -0x4502;HSPI_HalfDuplexTransferFailed;No description;2;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h -0x4503;HSPI_Timeout;No description;3;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h -0x4504;HSPI_Busy;No description;4;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h -0x4505;HSPI_GenericError;No description;5;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h -0x4601;HURT_UartReadFailure;No description;1;HAL_UART;fsfw/src/fsfw_hal/linux/serial/SerialComIF.h -0x4602;HURT_UartReadSizeMissmatch;No description;2;HAL_UART;fsfw/src/fsfw_hal/linux/serial/SerialComIF.h -0x4603;HURT_UartRxBufferTooSmall;No description;3;HAL_UART;fsfw/src/fsfw_hal/linux/serial/SerialComIF.h -0x4801;HGIO_UnknownGpioId;No description;1;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4802;HGIO_DriveGpioFailure;No description;2;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4803;HGIO_GpioTypeFailure;No description;3;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4804;HGIO_GpioInvalidInstance;No description;4;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4805;HGIO_GpioDuplicateDetected;No description;5;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4806;HGIO_GpioInitFailed;No description;6;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4807;HGIO_GpioGetValueFailed;No description;7;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4c00;SPPA_NoPacketFound;No description;0;SPACE_PACKET_PARSER;fsfw/src/fsfw/tmtcservices/SpacePacketParser.h -0x4c01;SPPA_SplitPacket;No description;1;SPACE_PACKET_PARSER;fsfw/src/fsfw/tmtcservices/SpacePacketParser.h -0x4fa1;HEATER_CommandNotSupported;No description;161;HEATER_HANDLER;mission/tcs/HeaterHandler.h -0x4fa2;HEATER_InitFailed;No description;162;HEATER_HANDLER;mission/tcs/HeaterHandler.h -0x4fa3;HEATER_InvalidSwitchNr;No description;163;HEATER_HANDLER;mission/tcs/HeaterHandler.h -0x4fa4;HEATER_MainSwitchSetTimeout;No description;164;HEATER_HANDLER;mission/tcs/HeaterHandler.h -0x4fa5;HEATER_CommandAlreadyWaiting;No description;165;HEATER_HANDLER;mission/tcs/HeaterHandler.h -0x50a0;SYRLINKS_CrcFailure;No description;160;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h -0x50a1;SYRLINKS_UartFraminOrParityErrorAck;No description;161;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h -0x50a2;SYRLINKS_BadCharacterAck;No description;162;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h -0x50a3;SYRLINKS_BadParameterValueAck;No description;163;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h -0x50a4;SYRLINKS_BadEndOfFrameAck;No description;164;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h -0x50a5;SYRLINKS_UnknownCommandIdAck;No description;165;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h -0x50a6;SYRLINKS_BadCrcAck;No description;166;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h -0x50a7;SYRLINKS_ReplyWrongSize;No description;167;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h -0x50a8;SYRLINKS_MissingStartFrameCharacter;No description;168;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h -0x5100;IMTQ_InvalidCommandCode;No description;0;IMTQ_HANDLER;mission/acs/imtqHelpers.h -0x5101;IMTQ_MgmMeasurementLowLevelError;No description;1;IMTQ_HANDLER;mission/acs/imtqHelpers.h -0x5102;IMTQ_ActuateCmdLowLevelError;No description;2;IMTQ_HANDLER;mission/acs/imtqHelpers.h -0x5103;IMTQ_ParameterMissing;No description;3;IMTQ_HANDLER;mission/acs/imtqHelpers.h -0x5104;IMTQ_ParameterInvalid;No description;4;IMTQ_HANDLER;mission/acs/imtqHelpers.h -0x5105;IMTQ_CcUnavailable;No description;5;IMTQ_HANDLER;mission/acs/imtqHelpers.h -0x5106;IMTQ_InternalProcessingError;No description;6;IMTQ_HANDLER;mission/acs/imtqHelpers.h -0x5107;IMTQ_RejectedWithoutReason;No description;7;IMTQ_HANDLER;mission/acs/imtqHelpers.h -0x5108;IMTQ_CmdErrUnknown;No description;8;IMTQ_HANDLER;mission/acs/imtqHelpers.h -0x5109;IMTQ_StartupCfgError;No description;9;IMTQ_HANDLER;mission/acs/imtqHelpers.h -0x510a;IMTQ_UnexpectedSelfTestReply;The status reply to a self test command was received but no self test command has been sent. This should normally never happen.;10;IMTQ_HANDLER;mission/acs/imtqHelpers.h -0x52b0;RWHA_SpiWriteFailure;No description;176;RW_HANDLER;mission/acs/rwHelpers.h -0x52b1;RWHA_SpiReadFailure;Used by the spi send function to tell a failing read call;177;RW_HANDLER;mission/acs/rwHelpers.h -0x52b2;RWHA_MissingStartSign;Can be used by the HDLC decoding mechanism to inform about a missing start sign 0x7E;178;RW_HANDLER;mission/acs/rwHelpers.h -0x52b3;RWHA_InvalidSubstitute;Can be used by the HDLC decoding mechanism to inform about an invalid substitution combination;179;RW_HANDLER;mission/acs/rwHelpers.h -0x52b4;RWHA_MissingEndSign;HDLC decoding mechanism never receives the end sign 0x7E;180;RW_HANDLER;mission/acs/rwHelpers.h -0x52b5;RWHA_NoReply;Reaction wheel only responds with empty frames.;181;RW_HANDLER;mission/acs/rwHelpers.h -0x52b6;RWHA_NoStartMarker;Expected a start marker as first byte;182;RW_HANDLER;mission/acs/rwHelpers.h -0x52b7;RWHA_SpiReadTimeout;Timeout when reading reply;183;RW_HANDLER;mission/acs/rwHelpers.h -0x53a0;STRH_TemperatureReqFailed;Status in temperature reply signals error;160;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x53a1;STRH_PingFailed;Ping command failed;161;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x53a2;STRH_VersionReqFailed;Status in version reply signals error;162;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x53a3;STRH_InterfaceReqFailed;Status in interface reply signals error;163;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x53a4;STRH_PowerReqFailed;Status in power reply signals error;164;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x53a5;STRH_SetParamFailed;Status of reply to parameter set command signals error;165;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x53a6;STRH_ActionFailed;Status of reply to action command signals error;166;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x53a7;STRH_FilePathTooLong;Received invalid path string. Exceeds allowed length;167;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x53a8;STRH_FilenameTooLong;Name of file received with command is too long;168;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x53a9;STRH_InvalidProgram;Received version reply with invalid program ID;169;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x53aa;STRH_ReplyError;Status field reply signals error;170;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x53ab;STRH_CommandTooShort;Received command which is too short (some data is missing for proper execution);171;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x53ac;STRH_InvalidLength;Received command with invalid length (too few or too many parameters);172;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x53ad;STRH_RegionMismatch;Region mismatch between send and received data;173;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x53ae;STRH_AddressMismatch;Address mismatch between send and received data;174;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x53af;STRH_LengthMismatch;Length field mismatch between send and received data;175;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x53b0;STRH_FileNotExists;Specified file does not exist;176;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x53b1;STRH_InvalidType;Download blob pixel command has invalid type field;177;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x53b2;STRH_InvalidId;Received FPGA action command with invalid ID;178;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x53b3;STRH_ReplyTooShort;Received reply is too short;179;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x53b4;STRH_CrcFailure;Received reply with invalid CRC;180;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x53b5;STRH_StrHelperExecuting;Star tracker handler currently executing a command and using the communication interface;181;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x53b6;STRH_StartrackerAlreadyBooted;Star tracker is already in firmware mode;182;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x53b7;STRH_StartrackerNotRunningFirmware;Star tracker must be in firmware mode to run this command;183;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x53b8;STRH_StartrackerNotRunningBootloader;Star tracker must be in bootloader mode to run this command;184;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x54e0;DWLPWRON_InvalidMode;Received command has invalid JESD mode (valid modes are 0 - 5);224;DWLPWRON_CMD;linux/payload/plocMpsocHelpers.h -0x54e1;DWLPWRON_InvalidLaneRate;Received command has invalid lane rate (valid lane rate are 0 - 9);225;DWLPWRON_CMD;linux/payload/plocMpsocHelpers.h -0x5700;PLSPVhLP_RequestDone;No description;0;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h -0x5701;PLSPVhLP_NoPacketFound;No description;1;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h -0x5702;PLSPVhLP_DecodeBufTooSmall;No description;2;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h -0x5703;PLSPVhLP_PossiblePacketLossConsecutiveStart;No description;3;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h -0x5704;PLSPVhLP_PossiblePacketLossConsecutiveEnd;No description;4;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h -0x5705;PLSPVhLP_HdlcError;No description;5;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h -0x57a0;PLSPVhLP_FileClosedAccidentally;File accidentally close;160;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h -0x57a1;PLSPVhLP_ProcessTerminated;Process has been terminated by command;161;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h -0x57a2;PLSPVhLP_PathNotExists;Received command with invalid pathname;162;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h -0x57a3;PLSPVhLP_EventBufferReplyInvalidApid;Expected event buffer TM but received space packet with other APID;163;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h -0x58a0;SUSS_InvalidSpeed;Action Message with invalid speed was received. Valid speeds must be in the range of [-65000, 1000] or [1000, 65000];160;SUS_HANDLER;mission/acs/RwHandler.h -0x58a1;SUSS_InvalidRampTime;Action Message with invalid ramp time was received.;161;SUS_HANDLER;mission/acs/RwHandler.h -0x58a2;SUSS_SetSpeedCommandInvalidLength;Received set speed command has invalid length. Should be 6.;162;SUS_HANDLER;mission/acs/RwHandler.h -0x58a3;SUSS_ExecutionFailed;Command execution failed;163;SUS_HANDLER;mission/acs/RwHandler.h -0x58a4;SUSS_CrcError;Reaction wheel reply has invalid crc;164;SUS_HANDLER;mission/acs/RwHandler.h -0x58a5;SUSS_ValueNotRead;No description;165;SUS_HANDLER;mission/acs/RwHandler.h -0x59a0;IPCI_PapbBusy;No description;160;CCSDS_IP_CORE_BRIDGE;linux/ipcore/PapbVcInterface.h -0x5aa0;PTME_UnknownVcId;No description;160;PTME;linux/ipcore/Ptme.h -0x5c01;STRHLP_SdNotMounted;SD card specified in path string not mounted;1;STR_HELPER;linux/acs/StrComHandler.h -0x5c02;STRHLP_FileNotExists;Specified file does not exist on filesystem;2;STR_HELPER;linux/acs/StrComHandler.h -0x5c03;STRHLP_PathNotExists;Specified path does not exist;3;STR_HELPER;linux/acs/StrComHandler.h -0x5c04;STRHLP_FileCreationFailed;Failed to create download image or read flash file;4;STR_HELPER;linux/acs/StrComHandler.h -0x5c05;STRHLP_RegionMismatch;Region in flash write/read reply does not match expected region;5;STR_HELPER;linux/acs/StrComHandler.h -0x5c06;STRHLP_AddressMismatch;Address in flash write/read reply does not match expected address;6;STR_HELPER;linux/acs/StrComHandler.h -0x5c07;STRHLP_LengthMismatch;Length in flash write/read reply does not match expected length;7;STR_HELPER;linux/acs/StrComHandler.h -0x5c08;STRHLP_StatusError;Status field in reply signals error;8;STR_HELPER;linux/acs/StrComHandler.h -0x5c09;STRHLP_InvalidTypeId;Reply has invalid type ID (should be of action reply type);9;STR_HELPER;linux/acs/StrComHandler.h -0x5c0a;STRHLP_ReceptionTimeout;No description;10;STR_HELPER;linux/acs/StrComHandler.h -0x5c0b;STRHLP_DecodingError;No description;11;STR_HELPER;linux/acs/StrComHandler.h -0x5d00;GOMS_PacketTooLong;No description;0;GOM_SPACE_HANDLER;mission/power/GomspaceDeviceHandler.h -0x5d01;GOMS_InvalidTableId;No description;1;GOM_SPACE_HANDLER;mission/power/GomspaceDeviceHandler.h -0x5d02;GOMS_InvalidAddress;No description;2;GOM_SPACE_HANDLER;mission/power/GomspaceDeviceHandler.h -0x5d03;GOMS_InvalidParamSize;No description;3;GOM_SPACE_HANDLER;mission/power/GomspaceDeviceHandler.h -0x5d04;GOMS_InvalidPayloadSize;No description;4;GOM_SPACE_HANDLER;mission/power/GomspaceDeviceHandler.h -0x5d05;GOMS_UnknownReplyId;No description;5;GOM_SPACE_HANDLER;mission/power/GomspaceDeviceHandler.h -0x5ea0;PLMEMDUMP_MramAddressTooHigh;The capacity of the MRAM amounts to 512 kB. Thus the maximum address must not be higher than 0x7d000.;160;PLOC_MEMORY_DUMPER;linux/payload/PlocMemoryDumper.h -0x5ea1;PLMEMDUMP_MramInvalidAddressCombination;The specified end address is lower than the start address;161;PLOC_MEMORY_DUMPER;linux/payload/PlocMemoryDumper.h -0x5fa0;PDEC_AbandonedCltuRetval;No description;160;PDEC_HANDLER;linux/ipcore/pdec.h -0x5fa1;PDEC_FrameDirtyRetval;No description;161;PDEC_HANDLER;linux/ipcore/pdec.h -0x5fa2;PDEC_FrameIllegalMultipleReasons;No description;162;PDEC_HANDLER;linux/ipcore/pdec.h -0x5fa3;PDEC_AdDiscardedLockoutRetval;No description;163;PDEC_HANDLER;linux/ipcore/pdec.h -0x5fa4;PDEC_AdDiscardedWaitRetval;No description;164;PDEC_HANDLER;linux/ipcore/pdec.h -0x5fa5;PDEC_AdDiscardedNsVs;No description;165;PDEC_HANDLER;linux/ipcore/pdec.h -0x5fa6;PDEC_NoReportRetval;No description;166;PDEC_HANDLER;linux/ipcore/pdec.h -0x5fa7;PDEC_ErrorVersionNumberRetval;No description;167;PDEC_HANDLER;linux/ipcore/pdec.h -0x5fa8;PDEC_IllegalCombinationRetval;No description;168;PDEC_HANDLER;linux/ipcore/pdec.h -0x5fa9;PDEC_InvalidScIdRetval;No description;169;PDEC_HANDLER;linux/ipcore/pdec.h -0x5faa;PDEC_InvalidVcIdMsbRetval;No description;170;PDEC_HANDLER;linux/ipcore/pdec.h -0x5fab;PDEC_InvalidVcIdLsbRetval;No description;171;PDEC_HANDLER;linux/ipcore/pdec.h -0x5fac;PDEC_NsNotZeroRetval;No description;172;PDEC_HANDLER;linux/ipcore/pdec.h -0x5fae;PDEC_InvalidBcCc;No description;174;PDEC_HANDLER;linux/ipcore/pdec.h -0x5fb0;PDEC_CommandNotImplemented;Received action message with unknown action id;176;PDEC_HANDLER;linux/ipcore/pdec.h -0x60a0;CCSDS_CommandNotImplemented;Received action message with unknown action id;160;CCSDS_HANDLER;mission/com/CcsdsIpCoreHandler.h -0x61a0;RS_RateNotSupported;The commanded rate is not supported by the current FPGA design;160;RATE_SETTER;linux/ipcore/PtmeConfig.h -0x61a1;RS_BadBitRate;Bad bitrate has been commanded (e.g. 0);161;RATE_SETTER;linux/ipcore/PtmeConfig.h -0x61a2;RS_ClkInversionFailed;Failed to invert clock and thus change the time the data is updated with respect to the tx clock;162;RATE_SETTER;linux/ipcore/PtmeConfig.h -0x61a3;RS_TxManipulatorConfigFailed;Failed to change configuration bit of tx clock manipulator;163;RATE_SETTER;linux/ipcore/PtmeConfig.h -0x6201;JSONBASE_JsonFileNotExists;Specified json file does not exist;1;ARCSEC_JSON_BASE;mission/acs/str/ArcsecJsonParamBase.h -0x6202;JSONBASE_SetNotExists;Requested set does not exist in json file;2;ARCSEC_JSON_BASE;mission/acs/str/ArcsecJsonParamBase.h -0x6203;JSONBASE_ParamNotExists;Requested parameter does not exist in json file;3;ARCSEC_JSON_BASE;mission/acs/str/ArcsecJsonParamBase.h -0x63a0;NVMB_KeyNotExists;Specified key does not exist in json file;160;NVM_PARAM_BASE;mission/memory/NvmParameterBase.h -0x64a0;FSHLP_SdNotMounted;SD card specified with path string not mounted;160;FILE_SYSTEM_HELPER;bsp_q7s/fs/FilesystemHelper.h -0x64a1;FSHLP_FileNotExists;Specified file does not exist on filesystem;161;FILE_SYSTEM_HELPER;bsp_q7s/fs/FilesystemHelper.h -0x65a0;PLMPHLP_FileWriteError;File error occured for file transfers from OBC to the MPSoC.;160;PLOC_MPSOC_HELPER;linux/payload/PlocMpsocSpecialComHelper.h -0x65a1;PLMPHLP_FileReadError;File error occured for file transfers from MPSoC to OBC.;161;PLOC_MPSOC_HELPER;linux/payload/PlocMpsocSpecialComHelper.h -0x66a0;SADPL_CommandNotSupported;No description;160;SA_DEPL_HANDLER;mission/SolarArrayDeploymentHandler.h -0x66a1;SADPL_DeploymentAlreadyExecuting;No description;161;SA_DEPL_HANDLER;mission/SolarArrayDeploymentHandler.h -0x66a2;SADPL_MainSwitchTimeoutFailure;No description;162;SA_DEPL_HANDLER;mission/SolarArrayDeploymentHandler.h -0x66a3;SADPL_SwitchingDeplSa1Failed;No description;163;SA_DEPL_HANDLER;mission/SolarArrayDeploymentHandler.h -0x66a4;SADPL_SwitchingDeplSa2Failed;No description;164;SA_DEPL_HANDLER;mission/SolarArrayDeploymentHandler.h -0x67a0;MPSOCRTVIF_CrcFailure;Space Packet received from PLOC has invalid CRC;160;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h -0x67a1;MPSOCRTVIF_ReceivedAckFailure;Received ACK failure reply from PLOC;161;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h -0x67a2;MPSOCRTVIF_ReceivedExeFailure;Received execution failure reply from PLOC;162;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h -0x67a3;MPSOCRTVIF_InvalidApid;Received space packet with invalid APID from PLOC;163;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h -0x67a4;MPSOCRTVIF_InvalidLength;Received command with invalid length;164;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h -0x67a5;MPSOCRTVIF_FilenameTooLong;Filename of file in OBC filesystem is too long;165;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h -0x67a6;MPSOCRTVIF_MpsocHelperExecuting;MPSoC helper is currently executing a command;166;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h -0x67a7;MPSOCRTVIF_MpsocFilenameTooLong;Filename of MPSoC file is to long (max. 256 bytes);167;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h -0x67a8;MPSOCRTVIF_InvalidParameter;Command has invalid parameter;168;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h -0x67a9;MPSOCRTVIF_NameTooLong;Received command has file string with invalid length;169;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h -0x68a0;SPVRTVIF_CrcFailure;Space Packet received from PLOC supervisor has invalid CRC;160;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h -0x68a1;SPVRTVIF_InvalidServiceId;No description;161;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h -0x68a2;SPVRTVIF_ReceivedAckFailure;Received ACK failure reply from PLOC supervisor;162;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h -0x68a3;SPVRTVIF_ReceivedExeFailure;Received execution failure reply from PLOC supervisor;163;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h -0x68a4;SPVRTVIF_InvalidApid;Received space packet with invalid APID from PLOC supervisor;164;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h -0x68a5;SPVRTVIF_GetTimeFailure;Failed to read current system time;165;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h -0x68a6;SPVRTVIF_InvalidWatchdog;Received command with invalid watchdog parameter. Valid watchdogs are 0 for PS, 1 for PL and 2 for INT;166;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h -0x68a7;SPVRTVIF_InvalidWatchdogTimeout;Received watchdog timeout config command with invalid timeout. Valid timeouts must be in the range between 1000 and 360000 ms.;167;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h -0x68a8;SPVRTVIF_InvalidLatchupId;Received latchup config command with invalid latchup ID;168;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h -0x68a9;SPVRTVIF_SweepPeriodTooSmall;Received set adc sweep period command with invalid sweep period. Must be larger than 21.;169;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h -0x68aa;SPVRTVIF_InvalidTestParam;Receive auto EM test command with invalid test param. Valid params are 1 and 2.;170;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h -0x68ab;SPVRTVIF_MramPacketParsingFailure;Returned when scanning for MRAM dump packets failed.;171;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h -0x68ac;SPVRTVIF_InvalidMramAddresses;Returned when the start and stop addresses of the MRAM dump or MRAM wipe commands are invalid (e.g. start address bigger than stop address);172;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h -0x68ad;SPVRTVIF_NoMramPacket;Expect reception of an MRAM dump packet but received space packet with other apid.;173;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h -0x68ae;SPVRTVIF_PathDoesNotExist;Path to PLOC directory on SD card does not exist;174;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h -0x68af;SPVRTVIF_MramFileNotExists;MRAM dump file does not exists. The file should actually already have been created with the reception of the first dump packet.;175;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h -0x68b0;SPVRTVIF_InvalidReplyLength;No description;176;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h -0x68b1;SPVRTVIF_InvalidLength;Received action command has invalid length;177;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h -0x68b2;SPVRTVIF_FilenameTooLong;Filename too long;178;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h -0x68b3;SPVRTVIF_UpdateStatusReportInvalidLength;Received update status report with invalid packet length field;179;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h -0x68b4;SPVRTVIF_UpdateCrcFailure;Update status report does not contain expected CRC. There might be a bit flip in the update memory region.;180;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h -0x68b5;SPVRTVIF_SupvHelperExecuting;Supervisor helper task ist currently executing a command (wait until helper tas has finished or interrupt by sending the terminate command);181;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h -0x68c0;SPVRTVIF_BufTooSmall;No description;192;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h -0x68c1;SPVRTVIF_NoReplyTimeout;No description;193;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h -0x6900;ACSCTRL_FileDeletionFailed;File deletion failed and at least one file is still existent.;0;ACS_CTRL;mission/controller/AcsController.h -0x6a02;ACSMEKF_MekfUninitialized;No description;2;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h -0x6a03;ACSMEKF_MekfNoGyrData;No description;3;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h -0x6a04;ACSMEKF_MekfNoModelVectors;No description;4;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h -0x6a05;ACSMEKF_MekfNoSusMgmStrData;No description;5;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h -0x6a06;ACSMEKF_MekfCovarianceInversionFailed;No description;6;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h -0x6a07;ACSMEKF_MekfNotFinite;No description;7;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h -0x6a08;ACSMEKF_MekfInitialized;No description;8;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h -0x6a09;ACSMEKF_MekfRunning;No description;9;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h -0x6b00;SDMA_OpOngoing;No description;0;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h -0x6b01;SDMA_AlreadyOn;No description;1;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h -0x6b02;SDMA_AlreadyMounted;No description;2;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h -0x6b03;SDMA_AlreadyOff;No description;3;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h -0x6b0a;SDMA_StatusFileNexists;No description;10;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h -0x6b0b;SDMA_StatusFileFormatInvalid;No description;11;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h -0x6b0c;SDMA_MountError;No description;12;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h -0x6b0d;SDMA_UnmountError;No description;13;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h -0x6b0e;SDMA_SystemCallError;No description;14;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h -0x6b0f;SDMA_PopenCallError;No description;15;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h -0x6c00;LPH_SdNotReady;No description;0;LOCAL_PARAM_HANDLER;bsp_q7s/memory/LocalParameterHandler.h -0x6d00;PTM_DumpDone;No description;0;PERSISTENT_TM_STORE;mission/tmtc/PersistentTmStore.h -0x6d01;PTM_BusyDumping;No description;1;PERSISTENT_TM_STORE;mission/tmtc/PersistentTmStore.h -0x6e00;TMS_IsBusy;No description;0;TM_SINK;mission/tmtc/DirectTmSinkIF.h -0x7000;SCBU_KeyNotFound;No description;0;SCRATCH_BUFFER;bsp_q7s/memory/scratchApi.h +0x3601;CFDP_InvalidTlvType;No description;1;CFDP_BASE;fsfw/src/fsfw/cfdp/definitions.h +0x3602;CFDP_InvalidDirectiveField;No description;2;CFDP_BASE;fsfw/src/fsfw/cfdp/definitions.h +0x3603;CFDP_InvalidPduDatafieldLen;No description;3;CFDP_BASE;fsfw/src/fsfw/cfdp/definitions.h +0x3604;CFDP_InvalidAckDirectiveFields;No description;4;CFDP_BASE;fsfw/src/fsfw/cfdp/definitions.h +0x3605;CFDP_MetadataCantParseOptions;No description;5;CFDP_BASE;fsfw/src/fsfw/cfdp/definitions.h +0x3606;CFDP_NakCantParseOptions;No description;6;CFDP_BASE;fsfw/src/fsfw/cfdp/definitions.h +0x3607;CFDP_FinishedCantParseFsResponses;No description;7;CFDP_BASE;fsfw/src/fsfw/cfdp/definitions.h +0x3608;CFDP_FilestoreRequiresSecondFile;No description;8;CFDP_BASE;fsfw/src/fsfw/cfdp/definitions.h +0x3609;CFDP_FilestoreResponseCantParseFsMessage;No description;9;CFDP_BASE;fsfw/src/fsfw/cfdp/definitions.h +0x360a;CFDP_InvalidPduFormat;No description;10;CFDP_BASE;fsfw/src/fsfw/cfdp/definitions.h +0x3700;CFDP_SourceTransactionPending;No description;0;CFDP_HANDLER;fsfw/src/fsfw/cfdp/handler/defs.h +0x3701;CFDP_FileDoesNotExist;No description;1;CFDP_HANDLER;fsfw/src/fsfw/cfdp/handler/defs.h +0x3702;CFDP_FileSegmentLenInvalid;No description;2;CFDP_HANDLER;fsfw/src/fsfw/cfdp/handler/defs.h +0x3703;CFDP_SourceNameEmpty;No description;3;CFDP_HANDLER;fsfw/src/fsfw/cfdp/handler/defs.h +0x3704;CFDP_DestNameEmpty;No description;4;CFDP_HANDLER;fsfw/src/fsfw/cfdp/handler/defs.h +0x3705;CFDP_WrongRemoteCfgEntityId;No description;5;CFDP_HANDLER;fsfw/src/fsfw/cfdp/handler/defs.h +0x3706;CFDP_TargetMsgQueueFull;No description;6;CFDP_HANDLER;fsfw/src/fsfw/cfdp/handler/defs.h +0x3801;TSI_BadTimestamp;No description;1;TIME_STAMPER_IF;fsfw/src/fsfw/timemanager/TimeStampIF.h +0x39a1;SGP4_InvalidEccentricity;No description;161;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x39a2;SGP4_InvalidMeanMotion;No description;162;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x39a3;SGP4_InvalidPerturbationElements;No description;163;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x39a4;SGP4_InvalidSemiLatusRectum;No description;164;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x39a5;SGP4_InvalidEpochElements;No description;165;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x39a6;SGP4_SatelliteHasDecayed;No description;166;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x39b1;SGP4_TleTooOld;No description;177;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x39b2;SGP4_TleNotInitialized;No description;178;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x3a01;MUX_NotEnoughResources;No description;1;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3a02;MUX_InsufficientMemory;No description;2;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3a03;MUX_NoPrivilege;No description;3;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3a04;MUX_WrongAttributeSetting;No description;4;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3a05;MUX_MutexAlreadyLocked;No description;5;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3a06;MUX_MutexNotFound;No description;6;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3a07;MUX_MutexMaxLocks;No description;7;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3a08;MUX_CurrThreadAlreadyOwnsMutex;No description;8;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3a09;MUX_CurrThreadDoesNotOwnMutex;No description;9;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3a0a;MUX_MutexTimeout;No description;10;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3a0b;MUX_MutexInvalidId;No description;11;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3a0c;MUX_MutexDestroyedWhileWaiting;No description;12;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3b01;MQI_Empty;No description;1;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h +0x3b02;MQI_Full;No space left for more messages;2;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h +0x3b03;MQI_NoReplyPartner;Returned if a reply method was called without partner;3;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h +0x3b04;MQI_DestinationInvalid;Returned if the target destination is invalid.;4;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h +0x3c00;SPH_ConnBroken;No description;0;SEMAPHORE_IF;fsfw/src/fsfw/osal/common/TcpTmTcServer.h +0x3c01;SPH_SemaphoreTimeout;No description;1;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h +0x3c02;SPH_SemaphoreNotOwned;No description;2;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h +0x3c03;SPH_SemaphoreInvalid;No description;3;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h +0x3d00;LPIF_PoolEntryNotFound;No description;0;LOCAL_POOL_OWNER_IF;fsfw/src/fsfw/datapoollocal/localPoolDefinitions.h +0x3d01;LPIF_PoolEntryTypeConflict;No description;1;LOCAL_POOL_OWNER_IF;fsfw/src/fsfw/datapoollocal/localPoolDefinitions.h +0x3ea0;PVA_InvalidReadWriteMode;No description;160;POOL_VARIABLE_IF;fsfw/src/fsfw/datapool/PoolVariableIF.h +0x3ea1;PVA_InvalidPoolEntry;No description;161;POOL_VARIABLE_IF;fsfw/src/fsfw/datapool/PoolVariableIF.h +0x3f00;HKM_QueueOrDestinationInvalid;No description;0;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h +0x3f01;HKM_WrongHkPacketType;No description;1;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h +0x3f02;HKM_ReportingStatusUnchanged;No description;2;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h +0x3f03;HKM_PeriodicHelperInvalid;No description;3;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h +0x3f04;HKM_PoolobjectNotFound;No description;4;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h +0x3f05;HKM_DatasetNotFound;No description;5;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h +0x4001;DLEE_StreamTooShort;No description;1;DLE_ENCODER;fsfw/src/fsfw/globalfunctions/DleEncoder.h +0x4002;DLEE_DecodingError;No description;2;DLE_ENCODER;fsfw/src/fsfw/globalfunctions/DleEncoder.h +0x4301;PUS11_InvalidTypeTimeWindow;No description;1;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h +0x4302;PUS11_InvalidTimeWindow;No description;2;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h +0x4303;PUS11_TimeshiftingNotPossible;No description;3;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h +0x4304;PUS11_InvalidRelativeTime;No description;4;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h +0x4305;PUS11_ContainedTcTooSmall;No description;5;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h +0x4306;PUS11_ContainedTcCrcMissmatch;No description;6;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h +0x4400;FILS_GenericFileError;No description;0;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4401;FILS_GenericDirError;No description;1;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4402;FILS_FilesystemInactive;No description;2;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4403;FILS_GenericRenameError;No description;3;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4404;FILS_IsBusy;No description;4;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4405;FILS_InvalidParameters;No description;5;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x440a;FILS_FileDoesNotExist;No description;10;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x440b;FILS_FileAlreadyExists;No description;11;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x440c;FILS_NotAFile;No description;12;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x440d;FILS_FileLocked;No description;13;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x440e;FILS_PermissionDenied;No description;14;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4415;FILS_DirectoryDoesNotExist;No description;21;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4416;FILS_DirectoryAlreadyExists;No description;22;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4417;FILS_NotADirectory;No description;23;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4418;FILS_DirectoryNotEmpty;No description;24;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x441e;FILS_SequencePacketMissingWrite;No description;30;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x441f;FILS_SequencePacketMissingRead;No description;31;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4500;UXOS_ExecutionFinished;Execution of the current command has finished;0;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h +0x4501;UXOS_CommandPending;Command is pending. This will also be returned if the user tries to load another command but a command is still pending;1;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h +0x4502;UXOS_BytesRead;Some bytes have been read from the executing process;2;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h +0x4503;UXOS_CommandError;Command execution failed;3;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h +0x4504;UXOS_NoCommandLoadedOrPending;;4;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h +0x4506;UXOS_PcloseCallError;No description;6;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h +0x4600;HSPI_OpeningFileFailed;No description;0;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h +0x4601;HSPI_FullDuplexTransferFailed;No description;1;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h +0x4602;HSPI_HalfDuplexTransferFailed;No description;2;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h +0x4603;HSPI_Timeout;No description;3;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h +0x4604;HSPI_Busy;No description;4;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h +0x4605;HSPI_GenericError;No description;5;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h +0x4701;HURT_UartReadFailure;No description;1;HAL_UART;fsfw/src/fsfw_hal/linux/serial/SerialComIF.h +0x4702;HURT_UartReadSizeMissmatch;No description;2;HAL_UART;fsfw/src/fsfw_hal/linux/serial/SerialComIF.h +0x4703;HURT_UartRxBufferTooSmall;No description;3;HAL_UART;fsfw/src/fsfw_hal/linux/serial/SerialComIF.h +0x4901;HGIO_UnknownGpioId;No description;1;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4902;HGIO_DriveGpioFailure;No description;2;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4903;HGIO_GpioTypeFailure;No description;3;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4904;HGIO_GpioInvalidInstance;No description;4;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4905;HGIO_GpioDuplicateDetected;No description;5;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4906;HGIO_GpioInitFailed;No description;6;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4907;HGIO_GpioGetValueFailed;No description;7;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4d00;SPPA_NoPacketFound;No description;0;SPACE_PACKET_PARSER;fsfw/src/fsfw/tmtcservices/SpacePacketParser.h +0x4d01;SPPA_SplitPacket;No description;1;SPACE_PACKET_PARSER;fsfw/src/fsfw/tmtcservices/SpacePacketParser.h +0x50a1;HEATER_CommandNotSupported;No description;161;HEATER_HANDLER;mission/tcs/HeaterHandler.h +0x50a2;HEATER_InitFailed;No description;162;HEATER_HANDLER;mission/tcs/HeaterHandler.h +0x50a3;HEATER_InvalidSwitchNr;No description;163;HEATER_HANDLER;mission/tcs/HeaterHandler.h +0x50a4;HEATER_MainSwitchSetTimeout;No description;164;HEATER_HANDLER;mission/tcs/HeaterHandler.h +0x50a5;HEATER_CommandAlreadyWaiting;No description;165;HEATER_HANDLER;mission/tcs/HeaterHandler.h +0x51a0;SYRLINKS_CrcFailure;No description;160;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h +0x51a1;SYRLINKS_UartFraminOrParityErrorAck;No description;161;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h +0x51a2;SYRLINKS_BadCharacterAck;No description;162;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h +0x51a3;SYRLINKS_BadParameterValueAck;No description;163;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h +0x51a4;SYRLINKS_BadEndOfFrameAck;No description;164;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h +0x51a5;SYRLINKS_UnknownCommandIdAck;No description;165;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h +0x51a6;SYRLINKS_BadCrcAck;No description;166;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h +0x51a7;SYRLINKS_ReplyWrongSize;No description;167;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h +0x51a8;SYRLINKS_MissingStartFrameCharacter;No description;168;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h +0x5200;IMTQ_InvalidCommandCode;No description;0;IMTQ_HANDLER;mission/acs/imtqHelpers.h +0x5201;IMTQ_MgmMeasurementLowLevelError;No description;1;IMTQ_HANDLER;mission/acs/imtqHelpers.h +0x5202;IMTQ_ActuateCmdLowLevelError;No description;2;IMTQ_HANDLER;mission/acs/imtqHelpers.h +0x5203;IMTQ_ParameterMissing;No description;3;IMTQ_HANDLER;mission/acs/imtqHelpers.h +0x5204;IMTQ_ParameterInvalid;No description;4;IMTQ_HANDLER;mission/acs/imtqHelpers.h +0x5205;IMTQ_CcUnavailable;No description;5;IMTQ_HANDLER;mission/acs/imtqHelpers.h +0x5206;IMTQ_InternalProcessingError;No description;6;IMTQ_HANDLER;mission/acs/imtqHelpers.h +0x5207;IMTQ_RejectedWithoutReason;No description;7;IMTQ_HANDLER;mission/acs/imtqHelpers.h +0x5208;IMTQ_CmdErrUnknown;No description;8;IMTQ_HANDLER;mission/acs/imtqHelpers.h +0x5209;IMTQ_StartupCfgError;No description;9;IMTQ_HANDLER;mission/acs/imtqHelpers.h +0x520a;IMTQ_UnexpectedSelfTestReply;The status reply to a self test command was received but no self test command has been sent. This should normally never happen.;10;IMTQ_HANDLER;mission/acs/imtqHelpers.h +0x53b0;RWHA_SpiWriteFailure;No description;176;RW_HANDLER;mission/acs/rwHelpers.h +0x53b1;RWHA_SpiReadFailure;Used by the spi send function to tell a failing read call;177;RW_HANDLER;mission/acs/rwHelpers.h +0x53b2;RWHA_MissingStartSign;Can be used by the HDLC decoding mechanism to inform about a missing start sign 0x7E;178;RW_HANDLER;mission/acs/rwHelpers.h +0x53b3;RWHA_InvalidSubstitute;Can be used by the HDLC decoding mechanism to inform about an invalid substitution combination;179;RW_HANDLER;mission/acs/rwHelpers.h +0x53b4;RWHA_MissingEndSign;HDLC decoding mechanism never receives the end sign 0x7E;180;RW_HANDLER;mission/acs/rwHelpers.h +0x53b5;RWHA_NoReply;Reaction wheel only responds with empty frames.;181;RW_HANDLER;mission/acs/rwHelpers.h +0x53b6;RWHA_NoStartMarker;Expected a start marker as first byte;182;RW_HANDLER;mission/acs/rwHelpers.h +0x53b7;RWHA_SpiReadTimeout;Timeout when reading reply;183;RW_HANDLER;mission/acs/rwHelpers.h +0x54a0;STRH_TemperatureReqFailed;Status in temperature reply signals error;160;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x54a1;STRH_PingFailed;Ping command failed;161;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x54a2;STRH_VersionReqFailed;Status in version reply signals error;162;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x54a3;STRH_InterfaceReqFailed;Status in interface reply signals error;163;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x54a4;STRH_PowerReqFailed;Status in power reply signals error;164;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x54a5;STRH_SetParamFailed;Status of reply to parameter set command signals error;165;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x54a6;STRH_ActionFailed;Status of reply to action command signals error;166;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x54a7;STRH_FilePathTooLong;Received invalid path string. Exceeds allowed length;167;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x54a8;STRH_FilenameTooLong;Name of file received with command is too long;168;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x54a9;STRH_InvalidProgram;Received version reply with invalid program ID;169;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x54aa;STRH_ReplyError;Status field reply signals error;170;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x54ab;STRH_CommandTooShort;Received command which is too short (some data is missing for proper execution);171;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x54ac;STRH_InvalidLength;Received command with invalid length (too few or too many parameters);172;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x54ad;STRH_RegionMismatch;Region mismatch between send and received data;173;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x54ae;STRH_AddressMismatch;Address mismatch between send and received data;174;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x54af;STRH_LengthMismatch;Length field mismatch between send and received data;175;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x54b0;STRH_FileNotExists;Specified file does not exist;176;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x54b1;STRH_InvalidType;Download blob pixel command has invalid type field;177;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x54b2;STRH_InvalidId;Received FPGA action command with invalid ID;178;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x54b3;STRH_ReplyTooShort;Received reply is too short;179;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x54b4;STRH_CrcFailure;Received reply with invalid CRC;180;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x54b5;STRH_StrHelperExecuting;Star tracker handler currently executing a command and using the communication interface;181;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x54b6;STRH_StartrackerAlreadyBooted;Star tracker is already in firmware mode;182;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x54b7;STRH_StartrackerNotRunningFirmware;Star tracker must be in firmware mode to run this command;183;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x54b8;STRH_StartrackerNotRunningBootloader;Star tracker must be in bootloader mode to run this command;184;STR_HANDLER;mission/acs/str/StarTrackerHandler.h +0x55e0;DWLPWRON_InvalidMode;Received command has invalid JESD mode (valid modes are 0 - 5);224;DWLPWRON_CMD;linux/payload/plocMpsocHelpers.h +0x55e1;DWLPWRON_InvalidLaneRate;Received command has invalid lane rate (valid lane rate are 0 - 9);225;DWLPWRON_CMD;linux/payload/plocMpsocHelpers.h +0x5800;PLSPVhLP_RequestDone;No description;0;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h +0x5801;PLSPVhLP_NoPacketFound;No description;1;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h +0x5802;PLSPVhLP_DecodeBufTooSmall;No description;2;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h +0x5803;PLSPVhLP_PossiblePacketLossConsecutiveStart;No description;3;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h +0x5804;PLSPVhLP_PossiblePacketLossConsecutiveEnd;No description;4;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h +0x5805;PLSPVhLP_HdlcError;No description;5;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h +0x58a0;PLSPVhLP_FileClosedAccidentally;File accidentally close;160;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h +0x58a1;PLSPVhLP_ProcessTerminated;Process has been terminated by command;161;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h +0x58a2;PLSPVhLP_PathNotExists;Received command with invalid pathname;162;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h +0x58a3;PLSPVhLP_EventBufferReplyInvalidApid;Expected event buffer TM but received space packet with other APID;163;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h +0x59a0;SUSS_InvalidSpeed;Action Message with invalid speed was received. Valid speeds must be in the range of [-65000, 1000] or [1000, 65000];160;SUS_HANDLER;mission/acs/RwHandler.h +0x59a1;SUSS_InvalidRampTime;Action Message with invalid ramp time was received.;161;SUS_HANDLER;mission/acs/RwHandler.h +0x59a2;SUSS_SetSpeedCommandInvalidLength;Received set speed command has invalid length. Should be 6.;162;SUS_HANDLER;mission/acs/RwHandler.h +0x59a3;SUSS_ExecutionFailed;Command execution failed;163;SUS_HANDLER;mission/acs/RwHandler.h +0x59a4;SUSS_CrcError;Reaction wheel reply has invalid crc;164;SUS_HANDLER;mission/acs/RwHandler.h +0x59a5;SUSS_ValueNotRead;No description;165;SUS_HANDLER;mission/acs/RwHandler.h +0x5aa0;IPCI_PapbBusy;No description;160;CCSDS_IP_CORE_BRIDGE;linux/ipcore/PapbVcInterface.h +0x5ba0;PTME_UnknownVcId;No description;160;PTME;linux/ipcore/Ptme.h +0x5d01;STRHLP_SdNotMounted;SD card specified in path string not mounted;1;STR_HELPER;linux/acs/StrComHandler.h +0x5d02;STRHLP_FileNotExists;Specified file does not exist on filesystem;2;STR_HELPER;linux/acs/StrComHandler.h +0x5d03;STRHLP_PathNotExists;Specified path does not exist;3;STR_HELPER;linux/acs/StrComHandler.h +0x5d04;STRHLP_FileCreationFailed;Failed to create download image or read flash file;4;STR_HELPER;linux/acs/StrComHandler.h +0x5d05;STRHLP_RegionMismatch;Region in flash write/read reply does not match expected region;5;STR_HELPER;linux/acs/StrComHandler.h +0x5d06;STRHLP_AddressMismatch;Address in flash write/read reply does not match expected address;6;STR_HELPER;linux/acs/StrComHandler.h +0x5d07;STRHLP_LengthMismatch;Length in flash write/read reply does not match expected length;7;STR_HELPER;linux/acs/StrComHandler.h +0x5d08;STRHLP_StatusError;Status field in reply signals error;8;STR_HELPER;linux/acs/StrComHandler.h +0x5d09;STRHLP_InvalidTypeId;Reply has invalid type ID (should be of action reply type);9;STR_HELPER;linux/acs/StrComHandler.h +0x5d0a;STRHLP_ReceptionTimeout;No description;10;STR_HELPER;linux/acs/StrComHandler.h +0x5d0b;STRHLP_DecodingError;No description;11;STR_HELPER;linux/acs/StrComHandler.h +0x5e00;GOMS_PacketTooLong;No description;0;GOM_SPACE_HANDLER;mission/power/GomspaceDeviceHandler.h +0x5e01;GOMS_InvalidTableId;No description;1;GOM_SPACE_HANDLER;mission/power/GomspaceDeviceHandler.h +0x5e02;GOMS_InvalidAddress;No description;2;GOM_SPACE_HANDLER;mission/power/GomspaceDeviceHandler.h +0x5e03;GOMS_InvalidParamSize;No description;3;GOM_SPACE_HANDLER;mission/power/GomspaceDeviceHandler.h +0x5e04;GOMS_InvalidPayloadSize;No description;4;GOM_SPACE_HANDLER;mission/power/GomspaceDeviceHandler.h +0x5e05;GOMS_UnknownReplyId;No description;5;GOM_SPACE_HANDLER;mission/power/GomspaceDeviceHandler.h +0x5fa0;PLMEMDUMP_MramAddressTooHigh;The capacity of the MRAM amounts to 512 kB. Thus the maximum address must not be higher than 0x7d000.;160;PLOC_MEMORY_DUMPER;linux/payload/PlocMemoryDumper.h +0x5fa1;PLMEMDUMP_MramInvalidAddressCombination;The specified end address is lower than the start address;161;PLOC_MEMORY_DUMPER;linux/payload/PlocMemoryDumper.h +0x60a0;PDEC_AbandonedCltuRetval;No description;160;PDEC_HANDLER;linux/ipcore/pdec.h +0x60a1;PDEC_FrameDirtyRetval;No description;161;PDEC_HANDLER;linux/ipcore/pdec.h +0x60a2;PDEC_FrameIllegalMultipleReasons;No description;162;PDEC_HANDLER;linux/ipcore/pdec.h +0x60a3;PDEC_AdDiscardedLockoutRetval;No description;163;PDEC_HANDLER;linux/ipcore/pdec.h +0x60a4;PDEC_AdDiscardedWaitRetval;No description;164;PDEC_HANDLER;linux/ipcore/pdec.h +0x60a5;PDEC_AdDiscardedNsVs;No description;165;PDEC_HANDLER;linux/ipcore/pdec.h +0x60a6;PDEC_NoReportRetval;No description;166;PDEC_HANDLER;linux/ipcore/pdec.h +0x60a7;PDEC_ErrorVersionNumberRetval;No description;167;PDEC_HANDLER;linux/ipcore/pdec.h +0x60a8;PDEC_IllegalCombinationRetval;No description;168;PDEC_HANDLER;linux/ipcore/pdec.h +0x60a9;PDEC_InvalidScIdRetval;No description;169;PDEC_HANDLER;linux/ipcore/pdec.h +0x60aa;PDEC_InvalidVcIdMsbRetval;No description;170;PDEC_HANDLER;linux/ipcore/pdec.h +0x60ab;PDEC_InvalidVcIdLsbRetval;No description;171;PDEC_HANDLER;linux/ipcore/pdec.h +0x60ac;PDEC_NsNotZeroRetval;No description;172;PDEC_HANDLER;linux/ipcore/pdec.h +0x60ae;PDEC_InvalidBcCc;No description;174;PDEC_HANDLER;linux/ipcore/pdec.h +0x60b0;PDEC_CommandNotImplemented;Received action message with unknown action id;176;PDEC_HANDLER;linux/ipcore/pdec.h +0x61a0;CCSDS_CommandNotImplemented;Received action message with unknown action id;160;CCSDS_HANDLER;mission/com/CcsdsIpCoreHandler.h +0x62a0;RS_RateNotSupported;The commanded rate is not supported by the current FPGA design;160;RATE_SETTER;linux/ipcore/PtmeConfig.h +0x62a1;RS_BadBitRate;Bad bitrate has been commanded (e.g. 0);161;RATE_SETTER;linux/ipcore/PtmeConfig.h +0x62a2;RS_ClkInversionFailed;Failed to invert clock and thus change the time the data is updated with respect to the tx clock;162;RATE_SETTER;linux/ipcore/PtmeConfig.h +0x62a3;RS_TxManipulatorConfigFailed;Failed to change configuration bit of tx clock manipulator;163;RATE_SETTER;linux/ipcore/PtmeConfig.h +0x6301;JSONBASE_JsonFileNotExists;Specified json file does not exist;1;ARCSEC_JSON_BASE;mission/acs/str/ArcsecJsonParamBase.h +0x6302;JSONBASE_SetNotExists;Requested set does not exist in json file;2;ARCSEC_JSON_BASE;mission/acs/str/ArcsecJsonParamBase.h +0x6303;JSONBASE_ParamNotExists;Requested parameter does not exist in json file;3;ARCSEC_JSON_BASE;mission/acs/str/ArcsecJsonParamBase.h +0x64a0;NVMB_KeyNotExists;Specified key does not exist in json file;160;NVM_PARAM_BASE;mission/memory/NvmParameterBase.h +0x65a0;FSHLP_SdNotMounted;SD card specified with path string not mounted;160;FILE_SYSTEM_HELPER;bsp_q7s/fs/FilesystemHelper.h +0x65a1;FSHLP_FileNotExists;Specified file does not exist on filesystem;161;FILE_SYSTEM_HELPER;bsp_q7s/fs/FilesystemHelper.h +0x66a0;PLMPHLP_FileWriteError;File error occured for file transfers from OBC to the MPSoC.;160;PLOC_MPSOC_HELPER;linux/payload/PlocMpsocSpecialComHelper.h +0x66a1;PLMPHLP_FileReadError;File error occured for file transfers from MPSoC to OBC.;161;PLOC_MPSOC_HELPER;linux/payload/PlocMpsocSpecialComHelper.h +0x67a0;SADPL_CommandNotSupported;No description;160;SA_DEPL_HANDLER;mission/SolarArrayDeploymentHandler.h +0x67a1;SADPL_DeploymentAlreadyExecuting;No description;161;SA_DEPL_HANDLER;mission/SolarArrayDeploymentHandler.h +0x67a2;SADPL_MainSwitchTimeoutFailure;No description;162;SA_DEPL_HANDLER;mission/SolarArrayDeploymentHandler.h +0x67a3;SADPL_SwitchingDeplSa1Failed;No description;163;SA_DEPL_HANDLER;mission/SolarArrayDeploymentHandler.h +0x67a4;SADPL_SwitchingDeplSa2Failed;No description;164;SA_DEPL_HANDLER;mission/SolarArrayDeploymentHandler.h +0x68a0;MPSOCRTVIF_CrcFailure;Space Packet received from PLOC has invalid CRC;160;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h +0x68a1;MPSOCRTVIF_ReceivedAckFailure;Received ACK failure reply from PLOC;161;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h +0x68a2;MPSOCRTVIF_ReceivedExeFailure;Received execution failure reply from PLOC;162;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h +0x68a3;MPSOCRTVIF_InvalidApid;Received space packet with invalid APID from PLOC;163;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h +0x68a4;MPSOCRTVIF_InvalidLength;Received command with invalid length;164;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h +0x68a5;MPSOCRTVIF_FilenameTooLong;Filename of file in OBC filesystem is too long;165;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h +0x68a6;MPSOCRTVIF_MpsocHelperExecuting;MPSoC helper is currently executing a command;166;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h +0x68a7;MPSOCRTVIF_MpsocFilenameTooLong;Filename of MPSoC file is to long (max. 256 bytes);167;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h +0x68a8;MPSOCRTVIF_InvalidParameter;Command has invalid parameter;168;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h +0x68a9;MPSOCRTVIF_NameTooLong;Received command has file string with invalid length;169;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h +0x69a0;SPVRTVIF_CrcFailure;Space Packet received from PLOC supervisor has invalid CRC;160;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h +0x69a1;SPVRTVIF_InvalidServiceId;No description;161;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h +0x69a2;SPVRTVIF_ReceivedAckFailure;Received ACK failure reply from PLOC supervisor;162;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h +0x69a3;SPVRTVIF_ReceivedExeFailure;Received execution failure reply from PLOC supervisor;163;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h +0x69a4;SPVRTVIF_InvalidApid;Received space packet with invalid APID from PLOC supervisor;164;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h +0x69a5;SPVRTVIF_GetTimeFailure;Failed to read current system time;165;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h +0x69a6;SPVRTVIF_InvalidWatchdog;Received command with invalid watchdog parameter. Valid watchdogs are 0 for PS, 1 for PL and 2 for INT;166;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h +0x69a7;SPVRTVIF_InvalidWatchdogTimeout;Received watchdog timeout config command with invalid timeout. Valid timeouts must be in the range between 1000 and 360000 ms.;167;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h +0x69a8;SPVRTVIF_InvalidLatchupId;Received latchup config command with invalid latchup ID;168;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h +0x69a9;SPVRTVIF_SweepPeriodTooSmall;Received set adc sweep period command with invalid sweep period. Must be larger than 21.;169;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h +0x69aa;SPVRTVIF_InvalidTestParam;Receive auto EM test command with invalid test param. Valid params are 1 and 2.;170;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h +0x69ab;SPVRTVIF_MramPacketParsingFailure;Returned when scanning for MRAM dump packets failed.;171;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h +0x69ac;SPVRTVIF_InvalidMramAddresses;Returned when the start and stop addresses of the MRAM dump or MRAM wipe commands are invalid (e.g. start address bigger than stop address);172;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h +0x69ad;SPVRTVIF_NoMramPacket;Expect reception of an MRAM dump packet but received space packet with other apid.;173;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h +0x69ae;SPVRTVIF_PathDoesNotExist;Path to PLOC directory on SD card does not exist;174;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h +0x69af;SPVRTVIF_MramFileNotExists;MRAM dump file does not exists. The file should actually already have been created with the reception of the first dump packet.;175;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h +0x69b0;SPVRTVIF_InvalidReplyLength;No description;176;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h +0x69b1;SPVRTVIF_InvalidLength;Received action command has invalid length;177;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h +0x69b2;SPVRTVIF_FilenameTooLong;Filename too long;178;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h +0x69b3;SPVRTVIF_UpdateStatusReportInvalidLength;Received update status report with invalid packet length field;179;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h +0x69b4;SPVRTVIF_UpdateCrcFailure;Update status report does not contain expected CRC. There might be a bit flip in the update memory region.;180;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h +0x69b5;SPVRTVIF_SupvHelperExecuting;Supervisor helper task ist currently executing a command (wait until helper tas has finished or interrupt by sending the terminate command);181;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h +0x69c0;SPVRTVIF_BufTooSmall;No description;192;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h +0x69c1;SPVRTVIF_NoReplyTimeout;No description;193;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h +0x6a00;ACSCTRL_FileDeletionFailed;File deletion failed and at least one file is still existent.;0;ACS_CTRL;mission/controller/AcsController.h +0x6b02;ACSMEKF_MekfUninitialized;No description;2;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h +0x6b03;ACSMEKF_MekfNoGyrData;No description;3;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h +0x6b04;ACSMEKF_MekfNoModelVectors;No description;4;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h +0x6b05;ACSMEKF_MekfNoSusMgmStrData;No description;5;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h +0x6b06;ACSMEKF_MekfCovarianceInversionFailed;No description;6;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h +0x6b07;ACSMEKF_MekfNotFinite;No description;7;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h +0x6b08;ACSMEKF_MekfInitialized;No description;8;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h +0x6b09;ACSMEKF_MekfRunning;No description;9;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h +0x6c00;SDMA_OpOngoing;No description;0;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h +0x6c01;SDMA_AlreadyOn;No description;1;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h +0x6c02;SDMA_AlreadyMounted;No description;2;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h +0x6c03;SDMA_AlreadyOff;No description;3;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h +0x6c0a;SDMA_StatusFileNexists;No description;10;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h +0x6c0b;SDMA_StatusFileFormatInvalid;No description;11;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h +0x6c0c;SDMA_MountError;No description;12;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h +0x6c0d;SDMA_UnmountError;No description;13;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h +0x6c0e;SDMA_SystemCallError;No description;14;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h +0x6c0f;SDMA_PopenCallError;No description;15;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h +0x6d00;LPH_SdNotReady;No description;0;LOCAL_PARAM_HANDLER;bsp_q7s/memory/LocalParameterHandler.h +0x6e00;PTM_DumpDone;No description;0;PERSISTENT_TM_STORE;mission/tmtc/PersistentTmStore.h +0x6e01;PTM_BusyDumping;No description;1;PERSISTENT_TM_STORE;mission/tmtc/PersistentTmStore.h +0x6f00;TMS_IsBusy;No description;0;TM_SINK;mission/tmtc/DirectTmSinkIF.h +0x7100;SCBU_KeyNotFound;No description;0;SCRATCH_BUFFER;bsp_q7s/memory/scratchApi.h diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index 55158be2..0aaf5e9b 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 304 translations. + * @brief Auto-generated event translation file. Contains 305 translations. * @details - * Generated on: 2023-08-15 13:27:11 + * Generated on: 2023-08-31 15:00:35 */ #include "translateEvents.h" @@ -92,6 +92,7 @@ const char *MSG_QUEUE_ERROR_STRING = "MSG_QUEUE_ERROR"; const char *SERIALIZATION_ERROR_STRING = "SERIALIZATION_ERROR"; const char *FILESTORE_ERROR_STRING = "FILESTORE_ERROR"; const char *FILENAME_TOO_LARGE_ERROR_STRING = "FILENAME_TOO_LARGE_ERROR"; +const char *HANDLING_CFDP_REQUEST_FAILED_STRING = "HANDLING_CFDP_REQUEST_FAILED"; const char *SAFE_RATE_VIOLATION_STRING = "SAFE_RATE_VIOLATION"; const char *SAFE_RATE_RECOVERY_STRING = "SAFE_RATE_RECOVERY"; const char *MULTIPLE_RW_INVALID_STRING = "MULTIPLE_RW_INVALID"; @@ -486,6 +487,8 @@ const char *translateEvents(Event event) { return FILESTORE_ERROR_STRING; case (10804): return FILENAME_TOO_LARGE_ERROR_STRING; + case (10805): + return HANDLING_CFDP_REQUEST_FAILED_STRING; case (11200): return SAFE_RATE_VIOLATION_STRING; case (11201): diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index 53be3a34..f62f47e1 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-08-15 13:27:11 + * Generated on: 2023-08-31 15:00:35 */ #include "translateObjects.h" diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index 55158be2..0aaf5e9b 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 304 translations. + * @brief Auto-generated event translation file. Contains 305 translations. * @details - * Generated on: 2023-08-15 13:27:11 + * Generated on: 2023-08-31 15:00:35 */ #include "translateEvents.h" @@ -92,6 +92,7 @@ const char *MSG_QUEUE_ERROR_STRING = "MSG_QUEUE_ERROR"; const char *SERIALIZATION_ERROR_STRING = "SERIALIZATION_ERROR"; const char *FILESTORE_ERROR_STRING = "FILESTORE_ERROR"; const char *FILENAME_TOO_LARGE_ERROR_STRING = "FILENAME_TOO_LARGE_ERROR"; +const char *HANDLING_CFDP_REQUEST_FAILED_STRING = "HANDLING_CFDP_REQUEST_FAILED"; const char *SAFE_RATE_VIOLATION_STRING = "SAFE_RATE_VIOLATION"; const char *SAFE_RATE_RECOVERY_STRING = "SAFE_RATE_RECOVERY"; const char *MULTIPLE_RW_INVALID_STRING = "MULTIPLE_RW_INVALID"; @@ -486,6 +487,8 @@ const char *translateEvents(Event event) { return FILESTORE_ERROR_STRING; case (10804): return FILENAME_TOO_LARGE_ERROR_STRING; + case (10805): + return HANDLING_CFDP_REQUEST_FAILED_STRING; case (11200): return SAFE_RATE_VIOLATION_STRING; case (11201): diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index 53be3a34..f62f47e1 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-08-15 13:27:11 + * Generated on: 2023-08-31 15:00:35 */ #include "translateObjects.h" diff --git a/mission/cfdp/CfdpHandler.cpp b/mission/cfdp/CfdpHandler.cpp index 5f3b11e2..c531b975 100644 --- a/mission/cfdp/CfdpHandler.cpp +++ b/mission/cfdp/CfdpHandler.cpp @@ -173,6 +173,7 @@ ReturnValue_t CfdpHandler::handleCfdpRequest(CommandMessage& msg) { // TODO: Trigger event return FAILED; } + sif::info << "starting transfer" << std::endl; return srcHandler.transactionStart(putRequest, *remoteCfg); } } @@ -202,6 +203,9 @@ ReturnValue_t CfdpHandler::handleCfdpMessages() { status = cfdpRequestQueue.receiveMessage(&cfdpMsg)) { result = handleCfdpRequest(cfdpMsg); if (result != OK) { + sif::warning << "Handling CFDP request failed with code 0x" << std::setw(4) << std::hex << + result << std::dec << std::endl; + triggerEvent(cfdp::events::HANDLING_CFDP_REQUEST_FAILED, 0, result); // TODO: Maybe add printout with context specific information? status = result; } diff --git a/tmtc b/tmtc index c2bed714..d72b7d9d 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit c2bed714dc43bc4a8ef4954fe72ae7c98b8bc2c8 +Subproject commit d72b7d9d663013ac75350728edffa15f7a379039 From 7e9648eabfc8a4720ea57e561de138d9e847116d Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 31 Aug 2023 15:20:19 +0200 Subject: [PATCH 035/257] CFDP handler --- mission/cfdp/CfdpHandler.cpp | 12 +++++++----- tmtc | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/mission/cfdp/CfdpHandler.cpp b/mission/cfdp/CfdpHandler.cpp index c531b975..e1c70c72 100644 --- a/mission/cfdp/CfdpHandler.cpp +++ b/mission/cfdp/CfdpHandler.cpp @@ -168,12 +168,14 @@ ReturnValue_t CfdpHandler::handleCfdpRequest(CommandMessage& msg) { RemoteEntityCfg* remoteCfg; remoteCfgProvider.getRemoteCfg(putRequest.getDestId(), &remoteCfg); if (remoteCfg == nullptr) { - sif::error << "CfdpHandler: No remote configuration found for destination ID " << - putRequest.getDestId() << std::endl; + sif::error << "CfdpHandler: No remote configuration found for destination ID " + << putRequest.getDestId() << std::endl; // TODO: Trigger event return FAILED; } - sif::info << "starting transfer" << std::endl; + sif::info << "Starting file copy operation for source file " + << putRequest.getSourceName().getString() << " and dest file " + << putRequest.getDestName().getString() << std::endl; return srcHandler.transactionStart(putRequest, *remoteCfg); } } @@ -203,8 +205,8 @@ ReturnValue_t CfdpHandler::handleCfdpMessages() { status = cfdpRequestQueue.receiveMessage(&cfdpMsg)) { result = handleCfdpRequest(cfdpMsg); if (result != OK) { - sif::warning << "Handling CFDP request failed with code 0x" << std::setw(4) << std::hex << - result << std::dec << std::endl; + sif::warning << "Handling CFDP request failed with code 0x" << std::setw(4) << std::hex + << result << std::dec << std::endl; triggerEvent(cfdp::events::HANDLING_CFDP_REQUEST_FAILED, 0, result); // TODO: Maybe add printout with context specific information? status = result; diff --git a/tmtc b/tmtc index d72b7d9d..7f79ef6c 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit d72b7d9d663013ac75350728edffa15f7a379039 +Subproject commit 7f79ef6c12604fcf827890c7f47aec823f7d3efc From c7b27c009266ec9a3b06f84a3059b57df1a2be43 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 4 Sep 2023 11:03:32 +0200 Subject: [PATCH 036/257] source transactions now working --- fsfw | 2 +- mission/cfdp/CfdpHandler.cpp | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/fsfw b/fsfw index dfcfb035..470f589b 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit dfcfb035bed4469aad2dad034567309d0dda7d29 +Subproject commit 470f589bde405c39f5a7fbf191b11b8b48058128 diff --git a/mission/cfdp/CfdpHandler.cpp b/mission/cfdp/CfdpHandler.cpp index e1c70c72..e8fb7b6c 100644 --- a/mission/cfdp/CfdpHandler.cpp +++ b/mission/cfdp/CfdpHandler.cpp @@ -109,16 +109,19 @@ ReturnValue_t CfdpHandler::handlePduPacket(TmTcMessage& msg) { auto passToDestHandler = [&]() { accessorPair.second.release(); PacketInfo info(type, msg.getStorageId(), directive); - result = destHandler.passPacket(info); + return destHandler.passPacket(info); }; auto passToSourceHandler = [&]() { - + accessorPair.second.release(); + PacketInfo info(type, msg.getStorageId(), directive); + // Implement this function. + // result = srcHandler.passPacket(info); }; if (directive == FileDirective::METADATA or directive == FileDirective::EOF_DIRECTIVE or directive == FileDirective::PROMPT) { // Section b) of 4.5.3: These PDUs should always be targeted towards the file receiver a.k.a. // the destination handler - passToDestHandler(); + return passToDestHandler(); } else if (directive == FileDirective::FINISH or directive == FileDirective::NAK or directive == FileDirective::KEEP_ALIVE) { // Section c) of 4.5.3: These PDUs should always be targeted towards the file sender a.k.a. @@ -135,7 +138,7 @@ ReturnValue_t CfdpHandler::handlePduPacket(TmTcMessage& msg) { if (ackedDirective == FileDirective::EOF_DIRECTIVE) { passToSourceHandler(); } else if (ackedDirective == FileDirective::FINISH) { - passToDestHandler(); + return passToDestHandler(); } } } From b7558e95421edb3a22733cb43d0c235e2dafb957 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 4 Sep 2023 11:20:21 +0200 Subject: [PATCH 037/257] update retvals --- bsp_hosted/fsfwconfig/events/translateEvents.cpp | 2 +- bsp_hosted/fsfwconfig/objects/translateObjects.cpp | 2 +- generators/bsp_hosted_returnvalues.csv | 1 - generators/bsp_q7s_returnvalues.csv | 1 - 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, 7 insertions(+), 9 deletions(-) diff --git a/bsp_hosted/fsfwconfig/events/translateEvents.cpp b/bsp_hosted/fsfwconfig/events/translateEvents.cpp index 0aaf5e9b..1718df9d 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. * @details - * Generated on: 2023-08-31 15:00:35 + * Generated on: 2023-09-04 11:19:49 */ #include "translateEvents.h" diff --git a/bsp_hosted/fsfwconfig/objects/translateObjects.cpp b/bsp_hosted/fsfwconfig/objects/translateObjects.cpp index e9d99a44..9a211be6 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-08-31 15:00:35 + * Generated on: 2023-09-04 11:19:49 */ #include "translateObjects.h" diff --git a/generators/bsp_hosted_returnvalues.csv b/generators/bsp_hosted_returnvalues.csv index e7b1109a..8eefe64f 100644 --- a/generators/bsp_hosted_returnvalues.csv +++ b/generators/bsp_hosted_returnvalues.csv @@ -364,7 +364,6 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x3b02;MQI_Full;No space left for more messages;2;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h 0x3b03;MQI_NoReplyPartner;Returned if a reply method was called without partner;3;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h 0x3b04;MQI_DestinationInvalid;Returned if the target destination is invalid.;4;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h -0x3c00;SPH_ConnBroken;No description;0;SEMAPHORE_IF;fsfw/src/fsfw/osal/common/TcpTmTcServer.h 0x3c01;SPH_SemaphoreTimeout;No description;1;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h 0x3c02;SPH_SemaphoreNotOwned;No description;2;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h 0x3c03;SPH_SemaphoreInvalid;No description;3;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h diff --git a/generators/bsp_q7s_returnvalues.csv b/generators/bsp_q7s_returnvalues.csv index 355ce26b..bad1177a 100644 --- a/generators/bsp_q7s_returnvalues.csv +++ b/generators/bsp_q7s_returnvalues.csv @@ -364,7 +364,6 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x3b02;MQI_Full;No space left for more messages;2;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h 0x3b03;MQI_NoReplyPartner;Returned if a reply method was called without partner;3;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h 0x3b04;MQI_DestinationInvalid;Returned if the target destination is invalid.;4;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h -0x3c00;SPH_ConnBroken;No description;0;SEMAPHORE_IF;fsfw/src/fsfw/osal/common/TcpTmTcServer.h 0x3c01;SPH_SemaphoreTimeout;No description;1;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h 0x3c02;SPH_SemaphoreNotOwned;No description;2;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h 0x3c03;SPH_SemaphoreInvalid;No description;3;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index 0aaf5e9b..1718df9d 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 305 translations. * @details - * Generated on: 2023-08-31 15:00:35 + * Generated on: 2023-09-04 11:19:49 */ #include "translateEvents.h" diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index f62f47e1..15a545c0 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-08-31 15:00:35 + * Generated on: 2023-09-04 11:19:49 */ #include "translateObjects.h" diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index 0aaf5e9b..1718df9d 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. * @details - * Generated on: 2023-08-31 15:00:35 + * Generated on: 2023-09-04 11:19:49 */ #include "translateEvents.h" diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index f62f47e1..15a545c0 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-08-31 15:00:35 + * Generated on: 2023-09-04 11:19:49 */ #include "translateObjects.h" diff --git a/tmtc b/tmtc index 7f79ef6c..25377ccf 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 7f79ef6c12604fcf827890c7f47aec823f7d3efc +Subproject commit 25377ccfa227fb77f4cab3d593f7953516b88bf9 From 9c36898dcd376062e619914d1c1179d8e44bce15 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 5 Sep 2023 16:05:28 +0200 Subject: [PATCH 038/257] increase TM store size a bit --- fsfw | 2 +- mission/genericFactory.cpp | 7 ++++--- tmtc | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/fsfw b/fsfw index 470f589b..448fbd0d 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 470f589bde405c39f5a7fbf191b11b8b48058128 +Subproject commit 448fbd0d388fe0b19de9b65ee7853681306fd546 diff --git a/mission/genericFactory.cpp b/mission/genericFactory.cpp index e2c4511e..9d2778f3 100644 --- a/mission/genericFactory.cpp +++ b/mission/genericFactory.cpp @@ -112,19 +112,19 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_, PusTmFun StorageManagerIF* tcStore; { PoolManager::LocalPoolConfig poolCfg = {{250, 16}, {250, 32}, {250, 64}, - {150, 128}, {120, 1024}, {120, 2048}}; + {150, 128}, {120, 1200}, {120, 2048}}; tcStore = new PoolManager(objects::TC_STORE, poolCfg); } { PoolManager::LocalPoolConfig poolCfg = {{600, 32}, {400, 64}, {400, 128}, - {300, 512}, {250, 1024}, {150, 2048}}; + {300, 512}, {300, 1200}, {120, 2048}}; *tmStore = new PoolManager(objects::TM_STORE, poolCfg); } { PoolManager::LocalPoolConfig poolCfg = {{300, 16}, {250, 32}, {150, 64}, {150, 128}, - {100, 256}, {50, 512}, {50, 1024}, {10, 2048}}; + {100, 256}, {50, 512}, {50, 1200}, {10, 2048}}; *ipcStore = new PoolManager(objects::IPC_STORE, poolCfg); } PoolManager::LocalPoolConfig poolCfg = {{300, 32}, {400, 64}, {250, 128}, @@ -284,6 +284,7 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_, PusTmFun UnsignedByteField apid(config::EIVE_LOCAL_CFDP_ENTITY_ID); cfdp::EntityId localId(apid); GROUND_REMOTE_CFG.defaultChecksum = cfdp::ChecksumType::CRC_32; + GROUND_REMOTE_CFG.maxFileSegmentLen = 990; CfdpHandlerCfg cfdpCfg(localId, indicationCfg, *eiveUserHandler, EIVE_FAULT_HANDLER, PACKET_LIST, LOST_SEGMENTS, REMOTE_CFG_PROVIDER); auto* cfdpHandler = new CfdpHandler(params, cfdpCfg); diff --git a/tmtc b/tmtc index 25377ccf..1b0a7aea 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 25377ccfa227fb77f4cab3d593f7953516b88bf9 +Subproject commit 1b0a7aeabda128cb6ae1092541f100df288d38b1 From a7ac38342309a9d13be5d7c9b9ba1db2f61bf2ad Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 6 Sep 2023 10:11:33 +0200 Subject: [PATCH 039/257] stooopid stuff --- fsfw | 2 +- mission/cfdp/CfdpHandler.cpp | 1 + mission/tmtc/PusLiveDemux.cpp | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/fsfw b/fsfw index 448fbd0d..c1431984 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 448fbd0d388fe0b19de9b65ee7853681306fd546 +Subproject commit c1431984947275f7c2c33c1e671b0e4d17c77f71 diff --git a/mission/cfdp/CfdpHandler.cpp b/mission/cfdp/CfdpHandler.cpp index e8fb7b6c..e64bd5df 100644 --- a/mission/cfdp/CfdpHandler.cpp +++ b/mission/cfdp/CfdpHandler.cpp @@ -64,6 +64,7 @@ ReturnValue_t CfdpHandler::performOperation(uint8_t operationCode) { } const SourceHandler::FsmResult& srcResult = srcHandler.stateMachine(); while (srcResult.callStatus == CallStatus::CALL_AGAIN) { + sif::debug << "calling fsm" << std::endl; srcHandler.stateMachine(); } return status; diff --git a/mission/tmtc/PusLiveDemux.cpp b/mission/tmtc/PusLiveDemux.cpp index 8ba69e07..6e9899d4 100644 --- a/mission/tmtc/PusLiveDemux.cpp +++ b/mission/tmtc/PusLiveDemux.cpp @@ -22,6 +22,8 @@ ReturnValue_t PusLiveDemux::demultiplexPackets(StorageManagerIF& tmStore, #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "PusLiveDemux::handlePacket: Store too full to create data copy" << std::endl; #endif + tmStore.deleteData(origStoreId); + break; } } else { message.setStorageId(origStoreId); From c64f1f869332ea27d6b64ce142d28d3edf7a4058 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 6 Sep 2023 13:40:38 +0200 Subject: [PATCH 040/257] a lot of good stuff --- bsp_hosted/CMakeLists.txt | 2 +- bsp_hosted/OBSWConfig.h.in | 2 +- .../{ObjectFactory.cpp => objectFactory.cpp} | 6 +- .../{ObjectFactory.h => objectFactory.h} | 0 bsp_hosted/scheduling.cpp | 38 ++++++++++- common/config/eive/definitions.h | 14 ++++- fsfw | 2 +- mission/cfdp/CfdpHandler.cpp | 63 ++++++++++++------- mission/cfdp/CfdpHandler.h | 2 +- mission/genericFactory.cpp | 22 ++++--- mission/genericFactory.h | 2 +- mission/tmtc/CfdpTmFunnel.cpp | 26 +++++--- mission/tmtc/CfdpTmFunnel.h | 4 +- mission/tmtc/PusLiveDemux.cpp | 17 ++++- tmtc | 2 +- 15 files changed, 145 insertions(+), 57 deletions(-) rename bsp_hosted/{ObjectFactory.cpp => objectFactory.cpp} (97%) rename bsp_hosted/{ObjectFactory.h => objectFactory.h} (100%) diff --git a/bsp_hosted/CMakeLists.txt b/bsp_hosted/CMakeLists.txt index ec2016b4..1300375e 100644 --- a/bsp_hosted/CMakeLists.txt +++ b/bsp_hosted/CMakeLists.txt @@ -1,4 +1,4 @@ -target_sources(${OBSW_NAME} PUBLIC scheduling.cpp main.cpp ObjectFactory.cpp) +target_sources(${OBSW_NAME} PUBLIC scheduling.cpp main.cpp objectFactory.cpp) add_subdirectory(fsfwconfig) add_subdirectory(boardconfig) diff --git a/bsp_hosted/OBSWConfig.h.in b/bsp_hosted/OBSWConfig.h.in index 5e6fcc2c..6e525e5a 100644 --- a/bsp_hosted/OBSWConfig.h.in +++ b/bsp_hosted/OBSWConfig.h.in @@ -101,7 +101,7 @@ /** CMake Defines */ /*******************************************************************/ -#define OBSW_ADD_TMTC_UDP_SERVER 1 +#define OBSW_ADD_TMTC_UDP_SERVER 0 #define OBSW_ADD_TMTC_TCP_SERVER 1 #cmakedefine EIVE_BUILD_GPSD_GPS_HANDLER diff --git a/bsp_hosted/ObjectFactory.cpp b/bsp_hosted/objectFactory.cpp similarity index 97% rename from bsp_hosted/ObjectFactory.cpp rename to bsp_hosted/objectFactory.cpp index 2f43393f..0f785e70 100644 --- a/bsp_hosted/ObjectFactory.cpp +++ b/bsp_hosted/objectFactory.cpp @@ -1,4 +1,4 @@ -#include "ObjectFactory.h" +#include "objectFactory.h" #include #include @@ -61,14 +61,14 @@ void ObjectFactory::produce(void* args) { CfdpTmFunnel* cfdpFunnel; StorageManagerIF* tmStore; StorageManagerIF* ipcStore; - PersistentTmStores persistentStores; + PersistentTmStores persistentStores{}; bool enableHkSets = false; #if OBSW_ENABLE_PERIODIC_HK == 1 enableHkSets = true; #endif auto sdcMan = new DummySdCardManager("/tmp"); ObjectFactory::produceGenericObjects(nullptr, &pusFunnel, &cfdpFunnel, *sdcMan, &ipcStore, - &tmStore, persistentStores, 120, enableHkSets); + &tmStore, persistentStores, 120, enableHkSets, false); new TmFunnelHandler(objects::LIVE_TM_TASK, *pusFunnel, *cfdpFunnel); auto* dummyGpioIF = new DummyGpioIF(); diff --git a/bsp_hosted/ObjectFactory.h b/bsp_hosted/objectFactory.h similarity index 100% rename from bsp_hosted/ObjectFactory.h rename to bsp_hosted/objectFactory.h diff --git a/bsp_hosted/scheduling.cpp b/bsp_hosted/scheduling.cpp index e82748f4..95da8ea1 100644 --- a/bsp_hosted/scheduling.cpp +++ b/bsp_hosted/scheduling.cpp @@ -13,8 +13,8 @@ #include #include "OBSWConfig.h" -#include "ObjectFactory.h" #include "mission/scheduling.h" +#include "objectFactory.h" #include "scheduling.h" #ifdef LINUX @@ -69,21 +69,25 @@ void scheduling::initTasks() { if (result != returnvalue::OK) { sif::error << "Adding CFDP distributor failed" << std::endl; } +#if OBSW_ADD_TMTC_UDP_SERVER == 1 result = tmtcDistributor->addComponent(objects::UDP_TMTC_SERVER); if (result != returnvalue::OK) { sif::error << "adding UDP server failed" << std::endl; } +#endif result = tmtcDistributor->addComponent(objects::TCP_TMTC_SERVER); if (result != returnvalue::OK) { sif::error << "adding TCP server failed" << std::endl; } +#if OBSW_ADD_TMTC_UDP_SERVER == 1 PeriodicTaskIF* udpPollingTask = factory->createPeriodicTask( "UDP_POLLING", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc); result = udpPollingTask->addComponent(objects::UDP_TMTC_POLLING_TASK); if (result != returnvalue::OK) { sif::error << "Add component UDP Polling failed" << std::endl; } +#endif PeriodicTaskIF* tcpPollingTask = factory->createPeriodicTask( "TCP_POLLING", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc); result = tcpPollingTask->addComponent(objects::TCP_TMTC_POLLING_TASK); @@ -92,7 +96,7 @@ void scheduling::initTasks() { } PeriodicTaskIF* liveTmTask = factory->createPeriodicTask( - "LIVE_TM", 55, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.4, nullptr, &RR_SCHEDULING); + "LIVE_TM", 55, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, nullptr, &RR_SCHEDULING); result = liveTmTask->addComponent(objects::LIVE_TM_TASK); if (result != returnvalue::OK) { scheduling::printAddObjectError("LIVE_TM", objects::LIVE_TM_TASK); @@ -179,6 +183,28 @@ void scheduling::initTasks() { } #endif + // If those are added at a later stage.. + /* + PeriodicTaskIF* logTmTask = factory->createPeriodicTask( + "LOG_PSTORE", 0, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.0, nullptr); + result = logTmTask->addComponent(objects::LOG_STORE_AND_TM_TASK); + if (result != returnvalue::OK) { + scheduling::printAddObjectError("LOG_STORE_AND_TM", objects::LOG_STORE_AND_TM_TASK); + } + PeriodicTaskIF* hkTmTask = + factory->createPeriodicTask("HK_PSTORE", 0, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.0, nullptr); + result = hkTmTask->addComponent(objects::HK_STORE_AND_TM_TASK); + if (result != returnvalue::OK) { + scheduling::printAddObjectError("HK_STORE_AND_TM", objects::HK_STORE_AND_TM_TASK); + } + PeriodicTaskIF* cfdpTmTask = factory->createPeriodicTask( + "CFDP_PSTORE", 0, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.0, nullptr); + result = cfdpTmTask->addComponent(objects::CFDP_STORE_AND_TM_TASK); + if (result != returnvalue::OK) { + scheduling::printAddObjectError("CFDP_STORE_AND_TM", objects::CFDP_STORE_AND_TM_TASK); + } + */ + #if OBSW_ADD_PLOC_SUPERVISOR == 1 PeriodicTaskIF* supvHelperTask = factory->createPeriodicTask( "PLOC_SUPV_HELPER", 20, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.0, missedDeadlineFunc); @@ -218,7 +244,9 @@ void scheduling::initTasks() { sif::info << "Starting tasks.." << std::endl; tmtcDistributor->startTask(); +#if OBSW_ADD_TMTC_UDP_SERVER == 1 udpPollingTask->startTask(); +#endif tcpPollingTask->startTask(); liveTmTask->startTask(); @@ -228,6 +256,12 @@ void scheduling::initTasks() { pstTask->startTask(); thermalTask->startTask(); dummyTask->startTask(); + + // If those are added at a later stage.. + //logTmTask->startTask(); + //cfdpTmTask->startTask(); + //hkTmTask->startTask(); + #if OBSW_ADD_PLOC_SUPERVISOR == 1 supvHelperTask->startTask(); #endif diff --git a/common/config/eive/definitions.h b/common/config/eive/definitions.h index b369f512..d5ebe674 100644 --- a/common/config/eive/definitions.h +++ b/common/config/eive/definitions.h @@ -58,14 +58,22 @@ static constexpr uint32_t NOK_STORE_QUEUE_SIZE = 350; static constexpr uint32_t HK_STORE_QUEUE_SIZE = 300; static constexpr uint32_t CFDP_STORE_QUEUE_SIZE = 300; +static constexpr uint32_t CFDP_MAX_FSM_CALL_COUNT_SRC_HANDLER = 50; +static constexpr uint32_t CFDP_MAX_FSM_CALL_COUNT_DEST_HANDLER = 300; +static constexpr uint32_t CFDP_SHORT_DELAY_MS = 100; +static constexpr uint32_t CFDP_REGULAR_DELAY_MS = 200; + static constexpr uint32_t MAX_PUS_FUNNEL_QUEUE_DEPTH = 100; -static constexpr uint32_t MAX_CFDP_FUNNEL_QUEUE_DEPTH = 80; +static constexpr uint32_t MAX_CFDP_FUNNEL_QUEUE_DEPTH = 150; static constexpr uint32_t VERIFICATION_SERVICE_QUEUE_DEPTH = 120; static constexpr uint32_t HK_SERVICE_QUEUE_DEPTH = 60; static constexpr uint32_t ACTION_SERVICE_QUEUE_DEPTH = 60; -static constexpr uint32_t MAX_STORED_CMDS_UDP = 150; -static constexpr uint32_t MAX_STORED_CMDS_TCP = 180; +static constexpr uint32_t UDP_MAX_STORED_CMDS = 200; +static constexpr uint32_t UDP_MSG_QUEUE_DEPTH = UDP_MAX_STORED_CMDS; +static constexpr uint32_t TCP_MAX_STORED_CMDS = 300; +static constexpr uint32_t TCP_MSG_QUEUE_DEPTH = TCP_MAX_STORED_CMDS; +static constexpr uint32_t TCP_MAX_NUMBER_TMS_SENT_PER_CYCLE = TCP_MSG_QUEUE_DEPTH; namespace spiSched { diff --git a/fsfw b/fsfw index c1431984..c199cbed 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit c1431984947275f7c2c33c1e671b0e4d17c77f71 +Subproject commit c199cbedaa4b7f6ba0b88fae26412cfa65f36739 diff --git a/mission/cfdp/CfdpHandler.cpp b/mission/cfdp/CfdpHandler.cpp index e64bd5df..cc400b9a 100644 --- a/mission/cfdp/CfdpHandler.cpp +++ b/mission/cfdp/CfdpHandler.cpp @@ -3,10 +3,12 @@ #include #include +#include "eive/definitions.h" #include "fsfw/cfdp/pdu/AckPduReader.h" #include "fsfw/cfdp/pdu/PduHeaderReader.h" #include "fsfw/globalfunctions/arrayprinter.h" #include "fsfw/ipc/QueueFactory.h" +#include "fsfw/tasks/TaskFactory.h" #include "fsfw/tmtcservices/TmTcMessage.h" using namespace returnvalue; @@ -46,28 +48,47 @@ ReturnValue_t CfdpHandler::initialize() { return SystemObject::initialize(); } -ReturnValue_t CfdpHandler::performOperation(uint8_t operationCode) { - ReturnValue_t status = OK; - ReturnValue_t result = handlePduPacketMessages(); - if (result != OK) { - status = result; +[[noreturn]] ReturnValue_t CfdpHandler::performOperation(uint8_t operationCode) { + while (true) { + bool shortDelay = false; + ReturnValue_t result = handlePduPacketMessages(); + if (result != OK) { + } + result = handleCfdpMessages(); + if (result != OK) { + } + uint32_t fsmCount = 0; + const DestHandler::FsmResult& destResult = destHandler.stateMachine(); + while (destResult.callStatus == CallStatus::CALL_AGAIN) { + if (fsmCount == config::CFDP_MAX_FSM_CALL_COUNT_DEST_HANDLER) { + shortDelay = true; + break; + } + destHandler.stateMachine(); + fsmCount++; + } + fsmCount = 0; + const SourceHandler::FsmResult& srcResult = srcHandler.stateMachine(); + while (srcResult.callStatus == CallStatus::CALL_AGAIN) { + // Limit number of messages. + if (fsmCount == config::CFDP_MAX_FSM_CALL_COUNT_SRC_HANDLER) { + shortDelay = true; + break; + } + srcHandler.stateMachine(); + if(srcResult.result == cfdp::TM_STORE_FULL) { + sif::warning << "CFDP Source Handler: TM store is full" << std::endl; + } else if(srcResult.result == cfdp::TARGET_MSG_QUEUE_FULL) { + sif::warning << "CFDP Source Handler: TM queue is full" << std::endl; + } + fsmCount++; + } + if (shortDelay) { + TaskFactory::delayTask(config::CFDP_SHORT_DELAY_MS); + continue; + } + TaskFactory::delayTask(config::CFDP_REGULAR_DELAY_MS); } - result = handleCfdpMessages(); - if (result != OK) { - status = result; - } - const DestHandler::FsmResult& destResult = destHandler.stateMachine(); - // TODO: Error handling? - while (destResult.callStatus == CallStatus::CALL_AGAIN) { - destHandler.stateMachine(); - // TODO: Error handling? - } - const SourceHandler::FsmResult& srcResult = srcHandler.stateMachine(); - while (srcResult.callStatus == CallStatus::CALL_AGAIN) { - sif::debug << "calling fsm" << std::endl; - srcHandler.stateMachine(); - } - return status; } ReturnValue_t CfdpHandler::handlePduPacket(TmTcMessage& msg) { diff --git a/mission/cfdp/CfdpHandler.h b/mission/cfdp/CfdpHandler.h index 18cf46b7..d409d6bd 100644 --- a/mission/cfdp/CfdpHandler.h +++ b/mission/cfdp/CfdpHandler.h @@ -68,7 +68,7 @@ class CfdpHandler : public SystemObject, public ExecutableObjectIF, public Accep [[nodiscard]] MessageQueueId_t getRequestQueue() const override; ReturnValue_t initialize() override; - ReturnValue_t performOperation(uint8_t operationCode) override; + [[noreturn]] ReturnValue_t performOperation(uint8_t operationCode) override; private: MessageQueueIF& pduQueue; diff --git a/mission/genericFactory.cpp b/mission/genericFactory.cpp index 9d2778f3..ea7a8bcb 100644 --- a/mission/genericFactory.cpp +++ b/mission/genericFactory.cpp @@ -99,7 +99,8 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_, PusTmFun CfdpTmFunnel** cfdpFunnel, SdCardMountedIF& sdcMan, StorageManagerIF** ipcStore, StorageManagerIF** tmStore, PersistentTmStores& stores, - uint32_t eventManagerQueueDepth, bool enableHkSets) { + uint32_t eventManagerQueueDepth, bool enableHkSets, + bool routeToPersistentStores) { // Framework objects new EventManager(objects::EVENT_MANAGER, eventManagerQueueDepth); auto healthTable = new HealthTable(objects::HEALTH_TABLE); @@ -118,7 +119,7 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_, PusTmFun { PoolManager::LocalPoolConfig poolCfg = {{600, 32}, {400, 64}, {400, 128}, - {300, 512}, {300, 1200}, {120, 2048}}; + {350, 512}, {500, 1200}, {100, 2048}}; *tmStore = new PoolManager(objects::TM_STORE, poolCfg); } @@ -128,28 +129,29 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_, PusTmFun *ipcStore = new PoolManager(objects::IPC_STORE, poolCfg); } PoolManager::LocalPoolConfig poolCfg = {{300, 32}, {400, 64}, {250, 128}, - {150, 512}, {150, 1024}, {150, 2048}}; + {150, 512}, {400, 1200}, {150, 2048}}; auto* ramToFileStore = new PoolManager(objects::DOWNLINK_RAM_STORE, poolCfg); #if OBSW_ADD_TCPIP_SERVERS == 1 #if OBSW_ADD_TMTC_UDP_SERVER == 1 auto udpBridge = - new UdpTmTcBridge(objects::UDP_TMTC_SERVER, objects::CCSDS_PACKET_DISTRIBUTOR, 120); + new UdpTmTcBridge(objects::UDP_TMTC_SERVER, objects::CCSDS_PACKET_DISTRIBUTOR, config::UDP_MSG_QUEUE_DEPTH); new UdpTcPollingTask(objects::UDP_TMTC_POLLING_TASK, objects::UDP_TMTC_SERVER); sif::info << "Created UDP server for TMTC commanding with listener port " << udpBridge->getUdpPort() << std::endl; - udpBridge->setMaxNumberOfPacketsStored(config::MAX_STORED_CMDS_UDP); + udpBridge->setMaxNumberOfPacketsStored(config::UDP_MAX_STORED_CMDS); #endif #if OBSW_ADD_TMTC_TCP_SERVER == 1 auto tcpBridge = - new TcpTmTcBridge(objects::TCP_TMTC_SERVER, objects::CCSDS_PACKET_DISTRIBUTOR, 120); + new TcpTmTcBridge(objects::TCP_TMTC_SERVER, objects::CCSDS_PACKET_DISTRIBUTOR, config::TCP_MSG_QUEUE_DEPTH); TcpTmTcServer::TcpConfig cfg(true, true); auto tcpServer = new TcpTmTcServer(objects::TCP_TMTC_POLLING_TASK, objects::TCP_TMTC_SERVER, cfg); // TCP is stream based. Use packet ID as start marker when parsing for space packets tcpServer->setSpacePacketParsingOptions({common::PUS_PACKET_ID, common::CFDP_PACKET_ID}); sif::info << "Created TCP server for TMTC commanding with listener port " << tcpServer->getTcpPort() << std::endl; - tcpBridge->setMaxNumberOfPacketsStored(config::MAX_STORED_CMDS_TCP); + tcpBridge->setMaxNumberOfPacketsStored(config::TCP_MAX_STORED_CMDS); + tcpBridge->setNumberOfSentPacketsPerCycle(config::TCP_MAX_NUMBER_TMS_SENT_PER_CYCLE); #endif /* OBSW_USE_TMTC_TCP_BRIDGE == 0 */ #endif /* OBSW_ADD_TCPIP_BRIDGE == 1 */ @@ -224,7 +226,11 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_, PusTmFun **ipcStore, config::MAX_CFDP_FUNNEL_QUEUE_DEPTH, sdcMan, config::CFDP_SEQUENCE_COUNT_FILE, core::SAVE_CFDP_SEQUENCE_COUNT); - *cfdpFunnel = new CfdpTmFunnel(cfdpFunnelCfg, stores.cfdpStore->getReportReceptionQueue(0), + std::optional fileStoreDest {}; + if(routeToPersistentStores) { + fileStoreDest = stores.cfdpStore->getReportReceptionQueue(0); + } + *cfdpFunnel = new CfdpTmFunnel(cfdpFunnelCfg, fileStoreDest, *ramToFileStore, config::EIVE_CFDP_APID); #if OBSW_ADD_TCPIP_SERVERS == 1 diff --git a/mission/genericFactory.h b/mission/genericFactory.h index 7845c140..f6c2bf1b 100644 --- a/mission/genericFactory.h +++ b/mission/genericFactory.h @@ -46,7 +46,7 @@ void produceGenericObjects(HealthTableIF** healthTable, PusTmFunnel** pusFunnel, CfdpTmFunnel** cfdpFunnel, SdCardMountedIF& sdcMan, StorageManagerIF** ipcStore, StorageManagerIF** tmStore, PersistentTmStores& stores, uint32_t eventManagerQueueDepth, - bool enableHkSets); + bool enableHkSets, bool routeToPersistentStores); void createGenericHeaterComponents(GpioIF& gpioIF, PowerSwitchIF& pwrSwitcher, HeaterHandler*& heaterHandler); diff --git a/mission/tmtc/CfdpTmFunnel.cpp b/mission/tmtc/CfdpTmFunnel.cpp index 93c294a4..b5408a49 100644 --- a/mission/tmtc/CfdpTmFunnel.cpp +++ b/mission/tmtc/CfdpTmFunnel.cpp @@ -4,7 +4,7 @@ #include "fsfw/tmtcpacket/ccsds/SpacePacketCreator.h" #include "fsfw/tmtcservices/TmTcMessage.h" -CfdpTmFunnel::CfdpTmFunnel(TmFunnelBase::FunnelCfg cfg, MessageQueueId_t fileStoreDest, +CfdpTmFunnel::CfdpTmFunnel(TmFunnelBase::FunnelCfg cfg, std::optional fileStoreDest, StorageManagerIF& ramToFileStore, uint16_t cfdpInCcsdsApid) : TmFunnelBase(cfg), fileStoreDest(fileStoreDest), @@ -25,7 +25,9 @@ ReturnValue_t CfdpTmFunnel::performOperation(uint8_t) { saveSequenceCount = false; } status = tmQueue->receiveMessage(¤tMessage); + uint32_t handledPackets = 0; while (status == returnvalue::OK) { + handledPackets++; status = handlePacket(currentMessage); if (status != returnvalue::OK) { sif::warning << "CfdpTmFunnel packet handling failed" << std::endl; @@ -38,6 +40,10 @@ ReturnValue_t CfdpTmFunnel::performOperation(uint8_t) { } status = tmQueue->receiveMessage(¤tMessage); } + if (handledPackets > 0) { + // Very useful for profiling and debugging + //sif::debug << "CfdpFunnel: Handled " << handledPackets << " packets in one cycle" << std::endl; + } if (status == MessageQueueIF::EMPTY) { return returnvalue::OK; @@ -88,14 +94,16 @@ ReturnValue_t CfdpTmFunnel::handlePacket(TmTcMessage& msg) { msg.setStorageId(newStoreId); store_address_t origStoreId = newStoreId; - store_address_t storageId; - result = ramToFileStore.addData(&storageId, newPacketData, packetLen); - TmTcMessage fileMsg(storageId); - if (result != returnvalue::OK) { - sif::error << "PusLiveDemux::handlePacket: Store too full to create data copy" << std::endl; - } else { - tmQueue->sendMessage(fileStoreDest, &fileMsg); - } + if(fileStoreDest.has_value()) { + store_address_t storageId; + result = ramToFileStore.addData(&storageId, newPacketData, packetLen); + TmTcMessage fileMsg(storageId); + if (result == returnvalue::OK) { + tmQueue->sendMessage(fileStoreDest.value(), &fileMsg); + } else if(result == StorageManagerIF::DATA_STORAGE_FULL) { + sif::error << "CfdpTmFunnel::handlePacket: RAM to File Store too full to create data copy" << std::endl; + } + } return demultiplexLivePackets(origStoreId, newPacketData, packetLen); } diff --git a/mission/tmtc/CfdpTmFunnel.h b/mission/tmtc/CfdpTmFunnel.h index 7b9efd34..5bb5d95b 100644 --- a/mission/tmtc/CfdpTmFunnel.h +++ b/mission/tmtc/CfdpTmFunnel.h @@ -13,7 +13,7 @@ class CfdpTmFunnel : public TmFunnelBase { public: - CfdpTmFunnel(TmFunnelBase::FunnelCfg cfg, MessageQueueId_t fileStoreDest, + CfdpTmFunnel(TmFunnelBase::FunnelCfg cfg, std::optional fileStoreDest, StorageManagerIF& ramToFileStore, uint16_t cfdpInCcsdsApid); [[nodiscard]] const char* getName() const override; ReturnValue_t performOperation(uint8_t opCode); @@ -22,7 +22,7 @@ class CfdpTmFunnel : public TmFunnelBase { private: ReturnValue_t handlePacket(TmTcMessage& msg); - MessageQueueId_t fileStoreDest; + std::optional fileStoreDest; StorageManagerIF& ramToFileStore; uint16_t cfdpInCcsdsApid; }; diff --git a/mission/tmtc/PusLiveDemux.cpp b/mission/tmtc/PusLiveDemux.cpp index 6e9899d4..23d20eff 100644 --- a/mission/tmtc/PusLiveDemux.cpp +++ b/mission/tmtc/PusLiveDemux.cpp @@ -9,6 +9,7 @@ ReturnValue_t PusLiveDemux::demultiplexPackets(StorageManagerIF& tmStore, store_address_t origStoreId, const uint8_t* tmData, size_t tmSize) { ReturnValue_t result = returnvalue::OK; + // sif::debug << "tm size: " << tmSize << " for " << destinations.size() << " destinations" << std::endl; for (unsigned int idx = 0; idx < destinations.size(); idx++) { const auto& dest = destinations[idx]; if ((destinations.size() > 1) and (idx < (destinations.size() - 1))) { @@ -18,12 +19,22 @@ ReturnValue_t PusLiveDemux::demultiplexPackets(StorageManagerIF& tmStore, result = tmStore.addData(&storeId, tmData, tmSize); if (result == returnvalue::OK) { message.setStorageId(storeId); - } else { + } else if (result == StorageManagerIF::DATA_STORAGE_FULL) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "PusLiveDemux::handlePacket: Store too full to create data copy" << std::endl; + uint8_t fillCounts[10]; + uint8_t written = 0; + tmStore.getFillCount(fillCounts, &written); + sif::error << "Fill counts: "; + for(uint8_t fillIdx = 0; fillIdx < written; fillIdx++) { + sif::error << fillCounts[fillIdx]; + if(fillIdx < written - 1) { + sif::error << ", "; + } + } + sif::error << std::endl; #endif - tmStore.deleteData(origStoreId); - break; + continue; } } else { message.setStorageId(origStoreId); diff --git a/tmtc b/tmtc index 1b0a7aea..649deac8 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 1b0a7aeabda128cb6ae1092541f100df288d38b1 +Subproject commit 649deac81bbc59d70f0cd1f2e442f434d089bbef From 48f3ff05dc0bfb6f4dc186b0335ee2051ae0c9a9 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 6 Sep 2023 20:54:45 +0200 Subject: [PATCH 041/257] bump fsfw --- fsfw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsfw b/fsfw index c199cbed..42a0b153 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit c199cbedaa4b7f6ba0b88fae26412cfa65f36739 +Subproject commit 42a0b153031e90191fb11606c23a51a6c3576aaf From 0fb837323d74485486d51fea48977ca5e3b27a51 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 6 Sep 2023 21:03:08 +0200 Subject: [PATCH 042/257] works properly now --- common/config/eive/definitions.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/config/eive/definitions.h b/common/config/eive/definitions.h index d5ebe674..d5e23edc 100644 --- a/common/config/eive/definitions.h +++ b/common/config/eive/definitions.h @@ -60,7 +60,7 @@ static constexpr uint32_t CFDP_STORE_QUEUE_SIZE = 300; static constexpr uint32_t CFDP_MAX_FSM_CALL_COUNT_SRC_HANDLER = 50; static constexpr uint32_t CFDP_MAX_FSM_CALL_COUNT_DEST_HANDLER = 300; -static constexpr uint32_t CFDP_SHORT_DELAY_MS = 100; +static constexpr uint32_t CFDP_SHORT_DELAY_MS = 50; static constexpr uint32_t CFDP_REGULAR_DELAY_MS = 200; static constexpr uint32_t MAX_PUS_FUNNEL_QUEUE_DEPTH = 100; From 4af406b294bd589be6b2df86369e0382f1a739d1 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 7 Sep 2023 16:14:20 +0200 Subject: [PATCH 043/257] changelog --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f5461bd3..84b6332d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,8 @@ will consitute of a breaking change warranting a new major release: ## Added -- CFDP source handler, which allow file downlink. +- CFDP source handler, which allow file downlink using the standardized + CFDP interface. ## Fixed From 2b841d2f371e7e254b47499fb4d3f24e267206b5 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 7 Sep 2023 16:19:01 +0200 Subject: [PATCH 044/257] some tweaks for error handling code --- mission/tmtc/PusLiveDemux.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mission/tmtc/PusLiveDemux.cpp b/mission/tmtc/PusLiveDemux.cpp index e900c540..4d78a188 100644 --- a/mission/tmtc/PusLiveDemux.cpp +++ b/mission/tmtc/PusLiveDemux.cpp @@ -23,19 +23,18 @@ ReturnValue_t PusLiveDemux::demultiplexPackets(StorageManagerIF& tmStore, } else if (result == StorageManagerIF::DATA_STORAGE_FULL) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "PusLiveDemux::handlePacket: Store too full to create data copy" << std::endl; - uint8_t fillCounts[10]; + uint8_t fillCounts[16]; uint8_t written = 0; tmStore.getFillCount(fillCounts, &written); - sif::error << "Fill counts: "; + sif::error << "Fill counts: ["; for (uint8_t fillIdx = 0; fillIdx < written; fillIdx++) { sif::error << fillCounts[fillIdx]; if (fillIdx < written - 1) { sif::error << ", "; } } - sif::error << std::endl; + sif::error << "]" << std::endl; #endif - continue; } } else { message.setStorageId(origStoreId); From 101cf54745d3406db6e4d46eead28a7745f4b7d4 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 7 Sep 2023 16:20:31 +0200 Subject: [PATCH 045/257] fix Q7S builds --- bsp_q7s/em/emObjectFactory.cpp | 2 +- bsp_q7s/fmObjectFactory.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bsp_q7s/em/emObjectFactory.cpp b/bsp_q7s/em/emObjectFactory.cpp index 976602d4..0f1c7707 100644 --- a/bsp_q7s/em/emObjectFactory.cpp +++ b/bsp_q7s/em/emObjectFactory.cpp @@ -39,7 +39,7 @@ void ObjectFactory::produce(void* args) { readFirmwareVersion(); ObjectFactory::produceGenericObjects(&healthTable, &pusFunnel, &cfdpFunnel, *SdCardManager::instance(), &ipcStore, &tmStore, stores, 200, - enableHkSets); + enableHkSets, true); LinuxLibgpioIF* gpioComIF = nullptr; SerialComIF* uartComIF = nullptr; diff --git a/bsp_q7s/fmObjectFactory.cpp b/bsp_q7s/fmObjectFactory.cpp index a3ab6bba..0ffa328b 100644 --- a/bsp_q7s/fmObjectFactory.cpp +++ b/bsp_q7s/fmObjectFactory.cpp @@ -36,7 +36,7 @@ void ObjectFactory::produce(void* args) { readFirmwareVersion(); ObjectFactory::produceGenericObjects(&healthTable, &pusFunnel, &cfdpFunnel, *SdCardManager::instance(), &ipcStore, &tmStore, stores, 200, - true); + true, true); LinuxLibgpioIF* gpioComIF = nullptr; SerialComIF* uartComIF = nullptr; From 33d503aef9b106382ca204855359d66d1f559010 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 11 Sep 2023 16:23:52 +0200 Subject: [PATCH 046/257] bump fsfw --- fsfw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsfw b/fsfw index 42a0b153..5bd02019 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 42a0b153031e90191fb11606c23a51a6c3576aaf +Subproject commit 5bd020193bb5a2a1b9e5ceadb12234f1cf75dd44 From 6fe4c71cee6aceddb75355ac41a7352789d5e5d6 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 11 Sep 2023 19:23:48 +0200 Subject: [PATCH 047/257] this is useable --- bsp_q7s/objectFactory.cpp | 4 ++-- mission/sysDefs.h | 5 +++++ mission/system/systemTree.cpp | 4 +++- mission/tmtc/CfdpTmFunnel.cpp | 6 ++++++ mission/tmtc/CfdpTmFunnel.h | 2 ++ mission/tmtc/PusLiveDemux.cpp | 20 ++++++++++++++++++-- mission/tmtc/PusLiveDemux.h | 5 ++++- mission/tmtc/TmFunnelBase.cpp | 7 ++++--- mission/tmtc/TmFunnelBase.h | 5 +++-- 9 files changed, 47 insertions(+), 11 deletions(-) diff --git a/bsp_q7s/objectFactory.cpp b/bsp_q7s/objectFactory.cpp index 39271628..d1eadb57 100644 --- a/bsp_q7s/objectFactory.cpp +++ b/bsp_q7s/objectFactory.cpp @@ -134,7 +134,7 @@ using gpio::Levels; ResetArgs RESET_ARGS_GNSS; std::atomic_bool LINK_STATE = CcsdsIpCoreHandler::LINK_DOWN; std::atomic_bool PTME_LOCKED = false; -std::atomic_uint16_t I2C_FATAL_ERRORS = 0; +std::atomic_uint16_t signals::I2C_FATAL_ERRORS = 0; uint8_t core::FW_VERSION_MAJOR = 0; uint8_t core::FW_VERSION_MINOR = 0; uint8_t core::FW_VERSION_REVISION = 0; @@ -953,7 +953,7 @@ void ObjectFactory::createImtqComponents(PowerSwitchIF* pwrSwitcher, bool enable auto* imtqAssy = new ImtqAssembly(objects::IMTQ_ASSY); imtqAssy->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM); - new ImtqPollingTask(objects::IMTQ_POLLING, I2C_FATAL_ERRORS); + new ImtqPollingTask(objects::IMTQ_POLLING, signals::I2C_FATAL_ERRORS); I2cCookie* imtqI2cCookie = new I2cCookie(addresses::IMTQ, imtq::MAX_REPLY_SIZE, i2cDev); auto imtqHandler = new ImtqHandler(objects::IMTQ_HANDLER, objects::IMTQ_POLLING, imtqI2cCookie, power::Switches::PDU1_CH3_MGT_5V, enableHkSets); diff --git a/mission/sysDefs.h b/mission/sysDefs.h index 4a53a76d..00a5635f 100644 --- a/mission/sysDefs.h +++ b/mission/sysDefs.h @@ -9,8 +9,13 @@ #include #include +namespace signals { + +extern std::atomic_bool CFDP_CHANNEL_THROTTLE_SIGNAL; extern std::atomic_uint16_t I2C_FATAL_ERRORS; +} // namespace signals + namespace satsystem { enum Mode : Mode_t { diff --git a/mission/system/systemTree.cpp b/mission/system/systemTree.cpp index 10c40617..8eb693ef 100644 --- a/mission/system/systemTree.cpp +++ b/mission/system/systemTree.cpp @@ -10,6 +10,7 @@ #include "eive/objects.h" #include "mission/com/defs.h" +#include "mission/sysDefs.h" #include "mission/system/acs/acsModeTree.h" #include "mission/system/tcs/tcsModeTree.h" #include "mission/system/tree/payloadModeTree.h" @@ -51,7 +52,8 @@ void satsystem::init(bool commandPlPcdu1) { EIVE_SYSTEM.setInitialMode(satsystem::Mode::BOOT, 0); } -EiveSystem satsystem::EIVE_SYSTEM = EiveSystem(objects::EIVE_SYSTEM, 12, 24, I2C_FATAL_ERRORS); +EiveSystem satsystem::EIVE_SYSTEM = + EiveSystem(objects::EIVE_SYSTEM, 12, 24, signals::I2C_FATAL_ERRORS); auto EIVE_SEQUENCE_BOOT = std::make_pair(satsystem::Mode::BOOT, FixedArrayList()); auto EIVE_TABLE_BOOT_TGT = diff --git a/mission/tmtc/CfdpTmFunnel.cpp b/mission/tmtc/CfdpTmFunnel.cpp index d4ea76ba..e50250e8 100644 --- a/mission/tmtc/CfdpTmFunnel.cpp +++ b/mission/tmtc/CfdpTmFunnel.cpp @@ -3,6 +3,7 @@ #include "fsfw/ipc/QueueFactory.h" #include "fsfw/tmtcpacket/ccsds/SpacePacketCreator.h" #include "fsfw/tmtcservices/TmTcMessage.h" +#include "mission/sysDefs.h" CfdpTmFunnel::CfdpTmFunnel(TmFunnelBase::FunnelCfg cfg, std::optional fileStoreDest, @@ -109,3 +110,8 @@ ReturnValue_t CfdpTmFunnel::handlePacket(TmTcMessage& msg) { } return demultiplexLivePackets(origStoreId, newPacketData, packetLen); } + +void CfdpTmFunnel::addLiveDestination(const char* name, + const AcceptsTelemetryIF& downlinkDestination, uint8_t vcid) { + uint32_t listIndex = TmFunnelBase::addLiveDestination(name, downlinkDestination, vcid); +} diff --git a/mission/tmtc/CfdpTmFunnel.h b/mission/tmtc/CfdpTmFunnel.h index 5bb5d95b..45642c4a 100644 --- a/mission/tmtc/CfdpTmFunnel.h +++ b/mission/tmtc/CfdpTmFunnel.h @@ -16,6 +16,8 @@ class CfdpTmFunnel : public TmFunnelBase { CfdpTmFunnel(TmFunnelBase::FunnelCfg cfg, std::optional fileStoreDest, StorageManagerIF& ramToFileStore, uint16_t cfdpInCcsdsApid); [[nodiscard]] const char* getName() const override; + void addLiveDestination(const char* name, const AcceptsTelemetryIF& downlinkDestination, + uint8_t vcid = 0) override; ReturnValue_t performOperation(uint8_t opCode); ReturnValue_t initialize() override; diff --git a/mission/tmtc/PusLiveDemux.cpp b/mission/tmtc/PusLiveDemux.cpp index 4d78a188..12c8ccb3 100644 --- a/mission/tmtc/PusLiveDemux.cpp +++ b/mission/tmtc/PusLiveDemux.cpp @@ -13,6 +13,9 @@ ReturnValue_t PusLiveDemux::demultiplexPackets(StorageManagerIF& tmStore, // std::endl; for (unsigned int idx = 0; idx < destinations.size(); idx++) { const auto& dest = destinations[idx]; + if (dest.isFull) { + continue; + } if ((destinations.size() > 1) and (idx < (destinations.size() - 1))) { // Create copy of data to ensure each TM recipient has its own copy. That way, we don't need // to bother with send order and where the data is deleted. @@ -52,8 +55,21 @@ ReturnValue_t PusLiveDemux::demultiplexPackets(StorageManagerIF& tmStore, return result; } -void PusLiveDemux::addDestination(const char* name, const AcceptsTelemetryIF& downlinkDestination, - uint8_t vcid) { +uint32_t PusLiveDemux::addDestination(const char* name, + const AcceptsTelemetryIF& downlinkDestination, uint8_t vcid) { auto queueId = downlinkDestination.getReportReceptionQueue(vcid); destinations.emplace_back(name, queueId, vcid); + return destinations.size() - 1; +} + +void PusLiveDemux::setDestFull(uint32_t listIndex) { + if (destinations.size() > 0 and listIndex <= destinations.size() - 1) { + destinations[listIndex].isFull = true; + } +} + +void PusLiveDemux::setDestAvailable(uint32_t listIndex) { + if (destinations.size() > 0 and listIndex <= destinations.size() - 1) { + destinations[listIndex].isFull = false; + } } diff --git a/mission/tmtc/PusLiveDemux.h b/mission/tmtc/PusLiveDemux.h index b9af04ff..f4f83958 100644 --- a/mission/tmtc/PusLiveDemux.h +++ b/mission/tmtc/PusLiveDemux.h @@ -14,8 +14,10 @@ class PusLiveDemux { ReturnValue_t demultiplexPackets(StorageManagerIF& tmStore, store_address_t origStoreId, const uint8_t* tmData, size_t tmSize); - void addDestination(const char* name, const AcceptsTelemetryIF& downlinkDestination, + uint32_t addDestination(const char* name, const AcceptsTelemetryIF& downlinkDestination, uint8_t vcid = 0); + void setDestFull(uint32_t listIndex); + void setDestAvailable(uint32_t listIndex); private: struct Destination { @@ -24,6 +26,7 @@ class PusLiveDemux { const char* name; MessageQueueId_t queueId; + bool isFull = false; uint8_t virtualChannel = 0; }; diff --git a/mission/tmtc/TmFunnelBase.cpp b/mission/tmtc/TmFunnelBase.cpp index fc2e4b76..4a17984a 100644 --- a/mission/tmtc/TmFunnelBase.cpp +++ b/mission/tmtc/TmFunnelBase.cpp @@ -30,9 +30,10 @@ MessageQueueId_t TmFunnelBase::getReportReceptionQueue(uint8_t virtualChannel) c return tmQueue->getId(); } -void TmFunnelBase::addLiveDestination(const char *name, - const AcceptsTelemetryIF &downlinkDestination, uint8_t vcid) { - liveDemux.addDestination(name, downlinkDestination, vcid); +uint32_t TmFunnelBase::addLiveDestination(const char *name, + const AcceptsTelemetryIF &downlinkDestination, + uint8_t vcid) { + return liveDemux.addDestination(name, downlinkDestination, vcid); } ReturnValue_t TmFunnelBase::initialize() { diff --git a/mission/tmtc/TmFunnelBase.h b/mission/tmtc/TmFunnelBase.h index 72d91103..7495af4a 100644 --- a/mission/tmtc/TmFunnelBase.h +++ b/mission/tmtc/TmFunnelBase.h @@ -37,8 +37,9 @@ class TmFunnelBase : public AcceptsTelemetryIF, public SystemObject { }; explicit TmFunnelBase(FunnelCfg cfg); [[nodiscard]] MessageQueueId_t getReportReceptionQueue(uint8_t virtualChannel) const override; - void addLiveDestination(const char* name, const AcceptsTelemetryIF& downlinkDestination, - uint8_t vcid = 0); + virtual uint32_t addLiveDestination(const char* name, + const AcceptsTelemetryIF& downlinkDestination, + uint8_t vcid = 0); ReturnValue_t demultiplexLivePackets(store_address_t origStoreId, const uint8_t* tmData, size_t tmSize); ReturnValue_t initialize() override; From 5d8b81e131173e0c5014355bfa0f34db19e0206f Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 11 Sep 2023 19:27:39 +0200 Subject: [PATCH 048/257] miight be able to work with this --- mission/tmtc/CfdpTmFunnel.cpp | 7 ++++--- mission/tmtc/CfdpTmFunnel.h | 4 ++-- mission/tmtc/PusLiveDemux.h | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/mission/tmtc/CfdpTmFunnel.cpp b/mission/tmtc/CfdpTmFunnel.cpp index e50250e8..268d2d3f 100644 --- a/mission/tmtc/CfdpTmFunnel.cpp +++ b/mission/tmtc/CfdpTmFunnel.cpp @@ -111,7 +111,8 @@ ReturnValue_t CfdpTmFunnel::handlePacket(TmTcMessage& msg) { return demultiplexLivePackets(origStoreId, newPacketData, packetLen); } -void CfdpTmFunnel::addLiveDestination(const char* name, - const AcceptsTelemetryIF& downlinkDestination, uint8_t vcid) { - uint32_t listIndex = TmFunnelBase::addLiveDestination(name, downlinkDestination, vcid); +uint32_t CfdpTmFunnel::addLiveDestination(const char* name, + const AcceptsTelemetryIF& downlinkDestination, + uint8_t vcid) { + return TmFunnelBase::addLiveDestination(name, downlinkDestination, vcid); } diff --git a/mission/tmtc/CfdpTmFunnel.h b/mission/tmtc/CfdpTmFunnel.h index 45642c4a..b3f0948b 100644 --- a/mission/tmtc/CfdpTmFunnel.h +++ b/mission/tmtc/CfdpTmFunnel.h @@ -16,8 +16,8 @@ class CfdpTmFunnel : public TmFunnelBase { CfdpTmFunnel(TmFunnelBase::FunnelCfg cfg, std::optional fileStoreDest, StorageManagerIF& ramToFileStore, uint16_t cfdpInCcsdsApid); [[nodiscard]] const char* getName() const override; - void addLiveDestination(const char* name, const AcceptsTelemetryIF& downlinkDestination, - uint8_t vcid = 0) override; + uint32_t addLiveDestination(const char* name, const AcceptsTelemetryIF& downlinkDestination, + uint8_t vcid = 0) override; ReturnValue_t performOperation(uint8_t opCode); ReturnValue_t initialize() override; diff --git a/mission/tmtc/PusLiveDemux.h b/mission/tmtc/PusLiveDemux.h index f4f83958..a6ba2c8f 100644 --- a/mission/tmtc/PusLiveDemux.h +++ b/mission/tmtc/PusLiveDemux.h @@ -15,7 +15,7 @@ class PusLiveDemux { const uint8_t* tmData, size_t tmSize); uint32_t addDestination(const char* name, const AcceptsTelemetryIF& downlinkDestination, - uint8_t vcid = 0); + uint8_t vcid = 0); void setDestFull(uint32_t listIndex); void setDestAvailable(uint32_t listIndex); From 6771d656bb5627ba0d6fb8627fa8f2627c1821b6 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 11 Sep 2023 20:16:54 +0200 Subject: [PATCH 049/257] beautiful --- bsp_q7s/em/emObjectFactory.cpp | 8 +++--- bsp_q7s/objectFactory.cpp | 11 +++++---- bsp_q7s/objectFactory.h | 3 ++- common/config/eive/definitions.h | 3 +++ mission/cfdp/CfdpHandler.cpp | 41 ++++++++++++++++++++++--------- mission/cfdp/CfdpHandler.h | 4 +++ mission/com/LiveTmTask.cpp | 42 +++++++++++++++++++++++++++----- mission/com/LiveTmTask.h | 12 +++++++-- mission/tmtc/PusLiveDemux.cpp | 10 +++++--- mission/tmtc/PusLiveDemux.h | 2 ++ mission/tmtc/TmFunnelBase.cpp | 6 +++++ mission/tmtc/TmFunnelBase.h | 2 ++ 12 files changed, 113 insertions(+), 31 deletions(-) diff --git a/bsp_q7s/em/emObjectFactory.cpp b/bsp_q7s/em/emObjectFactory.cpp index 0f1c7707..97ed4c0a 100644 --- a/bsp_q7s/em/emObjectFactory.cpp +++ b/bsp_q7s/em/emObjectFactory.cpp @@ -163,9 +163,11 @@ void ObjectFactory::produce(void* args) { &ipCoreHandler); createCcsdsComponents(ccsdsArgs); #if OBSW_TM_TO_PTME == 1 - if (ccsdsArgs.liveDestination != nullptr) { - pusFunnel->addLiveDestination("VC0 LIVE TM", *ccsdsArgs.liveDestination, 0); - cfdpFunnel->addLiveDestination("VC0 LIVE TM", *ccsdsArgs.liveDestination, 0); + if (ccsdsArgs.normalLiveTmDest != MessageQueueIF::NO_QUEUE) { + pusFunnel->addLiveDestinationByRawId("VC0 NORMAL LIVE TM", ccsdsArgs.normalLiveTmDest, 0); + } + if (ccsdsArgs.cfdpLiveTmDest != MessageQueueIF::NO_QUEUE) { + cfdpFunnel->addLiveDestinationByRawId("VC0 CFDP LIVE TM", ccsdsArgs.cfdpLiveTmDest, 0); } #endif #endif /* OBSW_ADD_CCSDS_IP_CORES == 1 */ diff --git a/bsp_q7s/objectFactory.cpp b/bsp_q7s/objectFactory.cpp index d1eadb57..2522a7c0 100644 --- a/bsp_q7s/objectFactory.cpp +++ b/bsp_q7s/objectFactory.cpp @@ -777,12 +777,13 @@ ReturnValue_t ObjectFactory::createCcsdsComponents(CcsdsComponentArgs& args) { new CcsdsIpCoreHandler(objects::CCSDS_HANDLER, objects::CCSDS_PACKET_DISTRIBUTOR, *ptmeConfig, LINK_STATE, &args.gpioComIF, gpios, PTME_LOCKED); // This VC will receive all live TM - auto* vcWithQueue = - new VirtualChannelWithQueue(objects::PTME_VC0_LIVE_TM, ccsds::VC0, "PTME VC0 LIVE TM", *ptme, - LINK_STATE, args.tmStore, 500); - args.liveDestination = vcWithQueue; + auto* vcWithQueue = new VirtualChannel(objects::PTME_VC0_LIVE_TM, ccsds::VC0, "PTME VC0 LIVE TM", + *ptme, LINK_STATE); auto* liveTask = new LiveTmTask(objects::LIVE_TM_TASK, args.pusFunnel, args.cfdpFunnel, - *vcWithQueue, PTME_LOCKED); + *vcWithQueue, PTME_LOCKED, config::LIVE_CHANNEL_NORMAL_QUEUE_SIZE, + config::LIVE_CHANNEL_CFDP_QUEUE_SIZE); + args.normalLiveTmDest = liveTask->getNormalLiveQueueId(); + args.cfdpLiveTmDest = liveTask->getCfdpLiveQueueId(); liveTask->connectModeTreeParent(satsystem::com::SUBSYSTEM); // Set up log store. diff --git a/bsp_q7s/objectFactory.h b/bsp_q7s/objectFactory.h index 491720ac..bccbdd17 100644 --- a/bsp_q7s/objectFactory.h +++ b/bsp_q7s/objectFactory.h @@ -46,7 +46,8 @@ struct CcsdsComponentArgs { PusTmFunnel& pusFunnel; CfdpTmFunnel& cfdpFunnel; CcsdsIpCoreHandler** ipCoreHandler; - AcceptsTelemetryIF* liveDestination = nullptr; + MessageQueueId_t normalLiveTmDest = MessageQueueIF::NO_QUEUE; + MessageQueueId_t cfdpLiveTmDest = MessageQueueIF::NO_QUEUE; }; void setStatics(); diff --git a/common/config/eive/definitions.h b/common/config/eive/definitions.h index d5e23edc..e62a90aa 100644 --- a/common/config/eive/definitions.h +++ b/common/config/eive/definitions.h @@ -58,6 +58,9 @@ static constexpr uint32_t NOK_STORE_QUEUE_SIZE = 350; static constexpr uint32_t HK_STORE_QUEUE_SIZE = 300; static constexpr uint32_t CFDP_STORE_QUEUE_SIZE = 300; +static constexpr uint32_t LIVE_CHANNEL_NORMAL_QUEUE_SIZE = 300; +static constexpr uint32_t LIVE_CHANNEL_CFDP_QUEUE_SIZE = 300; + static constexpr uint32_t CFDP_MAX_FSM_CALL_COUNT_SRC_HANDLER = 50; static constexpr uint32_t CFDP_MAX_FSM_CALL_COUNT_DEST_HANDLER = 300; static constexpr uint32_t CFDP_SHORT_DELAY_MS = 50; diff --git a/mission/cfdp/CfdpHandler.cpp b/mission/cfdp/CfdpHandler.cpp index c3cde752..8ca37de0 100644 --- a/mission/cfdp/CfdpHandler.cpp +++ b/mission/cfdp/CfdpHandler.cpp @@ -10,6 +10,7 @@ #include "fsfw/ipc/QueueFactory.h" #include "fsfw/tasks/TaskFactory.h" #include "fsfw/tmtcservices/TmTcMessage.h" +#include "mission/sysDefs.h" using namespace returnvalue; using namespace cfdp; @@ -68,20 +69,38 @@ ReturnValue_t CfdpHandler::initialize() { fsmCount++; } fsmCount = 0; - const SourceHandler::FsmResult& srcResult = srcHandler.stateMachine(); - while (srcResult.callStatus == CallStatus::CALL_AGAIN) { - // Limit number of messages. - if (fsmCount == config::CFDP_MAX_FSM_CALL_COUNT_SRC_HANDLER) { + if (signals::CFDP_CHANNEL_THROTTLE_SIGNAL) { + throttlePeriodSourceHandler.resetTimer(); + throttlePeriodOngoing = true; + signals::CFDP_CHANNEL_THROTTLE_SIGNAL = false; + } + + if (throttlePeriodOngoing) { + if (throttlePeriodSourceHandler.hasTimedOut()) { + throttlePeriodOngoing = false; + + } else { shortDelay = true; - break; } - srcHandler.stateMachine(); - if (srcResult.result == cfdp::TM_STORE_FULL) { - sif::warning << "CFDP Source Handler: TM store is full" << std::endl; - } else if (srcResult.result == cfdp::TARGET_MSG_QUEUE_FULL) { - sif::warning << "CFDP Source Handler: TM queue is full" << std::endl; + } + // CFDP can be throttled by the slowest live TM handler to handle back pressure in a sensible + // way without requiring huge amounts of memory for large files. + if (!throttlePeriodOngoing) { + const SourceHandler::FsmResult& srcResult = srcHandler.stateMachine(); + while (srcResult.callStatus == CallStatus::CALL_AGAIN) { + // Limit number of messages. + if (fsmCount == config::CFDP_MAX_FSM_CALL_COUNT_SRC_HANDLER) { + shortDelay = true; + break; + } + srcHandler.stateMachine(); + if (srcResult.result == cfdp::TM_STORE_FULL) { + sif::warning << "CFDP Source Handler: TM store is full" << std::endl; + } else if (srcResult.result == cfdp::TARGET_MSG_QUEUE_FULL) { + sif::warning << "CFDP Source Handler: TM queue is full" << std::endl; + } + fsmCount++; } - fsmCount++; } if (shortDelay) { TaskFactory::delayTask(config::CFDP_SHORT_DELAY_MS); diff --git a/mission/cfdp/CfdpHandler.h b/mission/cfdp/CfdpHandler.h index d409d6bd..46631ac5 100644 --- a/mission/cfdp/CfdpHandler.h +++ b/mission/cfdp/CfdpHandler.h @@ -4,6 +4,7 @@ #include #include #include +#include #include @@ -73,6 +74,9 @@ class CfdpHandler : public SystemObject, public ExecutableObjectIF, public Accep private: MessageQueueIF& pduQueue; MessageQueueIF& cfdpRequestQueue; + Countdown throttlePeriodSourceHandler = Countdown(80); + bool throttlePeriodOngoing = false; + cfdp::LocalEntityCfg localCfg; cfdp::RemoteConfigTableIF& remoteCfgProvider; cfdp::FsfwParams fsfwParams; diff --git a/mission/com/LiveTmTask.cpp b/mission/com/LiveTmTask.cpp index 39648c15..14706705 100644 --- a/mission/com/LiveTmTask.cpp +++ b/mission/com/LiveTmTask.cpp @@ -5,8 +5,13 @@ #include #include +#include "mission/sysDefs.h" + +std::atomic_bool signals::CFDP_CHANNEL_THROTTLE_SIGNAL = false; + LiveTmTask::LiveTmTask(object_id_t objectId, PusTmFunnel& pusFunnel, CfdpTmFunnel& cfdpFunnel, - VirtualChannelWithQueue& channel, const std::atomic_bool& ptmeLocked) + VirtualChannel& channel, const std::atomic_bool& ptmeLocked, + uint32_t regularTmQueueDepth, uint32_t cfdpQueueDepth) : SystemObject(objectId), modeHelper(this), pusFunnel(pusFunnel), @@ -14,17 +19,34 @@ LiveTmTask::LiveTmTask(object_id_t objectId, PusTmFunnel& pusFunnel, CfdpTmFunne channel(channel), ptmeLocked(ptmeLocked) { requestQueue = QueueFactory::instance()->createMessageQueue(); + cfdpTmQueue = QueueFactory::instance()->createMessageQueue(cfdpQueueDepth); + regularTmQueue = QueueFactory::instance()->createMessageQueue(regularTmQueueDepth); } ReturnValue_t LiveTmTask::performOperation(uint8_t opCode) { readCommandQueue(); + bool handledTm; + ReturnValue_t result; while (true) { - // The funnel tasks are scheduled here directly as well. - ReturnValue_t result = channel.handleNextTm(!ptmeLocked); - if (result == DirectTmSinkIF::IS_BUSY) { - sif::error << "Lost live TM, PAPB busy" << std::endl; + // TODO: Must read CFDP TM queue and regular TM queue and forward them. Handle regular queue + // first. + handledTm = false; + if (!channel.isBusy()) { + result = handleRegularTmQueue(); + if (result == MessageQueueIF::EMPTY) { + result = handleCfdpTmQueue(); + } + if (result == returnvalue::OK) { + handledTm = true; + } } - if (result == MessageQueueIF::EMPTY) { + if (channel.isBusy()) { + // Throttle CFDP packet creator. It is by far the most relevant data creator, so throttling + // it is the easiest way to handle back pressure for now in a sensible way. It is cleared + // by the data creator. + signals::CFDP_CHANNEL_THROTTLE_SIGNAL = true; + } + if (!handledTm) { if (tmFunnelCd.hasTimedOut()) { pusFunnel.performOperation(0); cfdpFunnel.performOperation(0); @@ -94,9 +116,17 @@ void LiveTmTask::readCommandQueue(void) { } } +ReturnValue_t LiveTmTask::handleRegularTmQueue() { return returnvalue::OK; } + +ReturnValue_t LiveTmTask::handleCfdpTmQueue() { return returnvalue::OK; } + ModeTreeChildIF& LiveTmTask::getModeTreeChildIF() { return *this; } ReturnValue_t LiveTmTask::initialize() { modeHelper.initialize(); return returnvalue::OK; } + +MessageQueueId_t LiveTmTask::getNormalLiveQueueId() const { return regularTmQueue->getId(); } + +MessageQueueId_t LiveTmTask::getCfdpLiveQueueId() const { return cfdpTmQueue->getId(); } diff --git a/mission/com/LiveTmTask.h b/mission/com/LiveTmTask.h index c203f1de..d1173ccc 100644 --- a/mission/com/LiveTmTask.h +++ b/mission/com/LiveTmTask.h @@ -18,25 +18,33 @@ class LiveTmTask : public SystemObject, public ModeTreeConnectionIF { public: LiveTmTask(object_id_t objectId, PusTmFunnel& pusFunnel, CfdpTmFunnel& cfdpFunnel, - VirtualChannelWithQueue& channel, const std::atomic_bool& ptmeLocked); + VirtualChannel& channel, const std::atomic_bool& ptmeLocked, + uint32_t regularTmQueueDepth, uint32_t cfdpQueueDepth); + MessageQueueId_t getNormalLiveQueueId() const; + MessageQueueId_t getCfdpLiveQueueId() const; ReturnValue_t performOperation(uint8_t opCode) override; ReturnValue_t initialize() override; ReturnValue_t connectModeTreeParent(HasModeTreeChildrenIF& parent) override; private: MessageQueueIF* requestQueue; + MessageQueueIF* cfdpTmQueue; + MessageQueueIF* regularTmQueue; ModeHelper modeHelper; Mode_t mode = HasModesIF::MODE_OFF; Countdown tmFunnelCd = Countdown(100); PusTmFunnel& pusFunnel; CfdpTmFunnel& cfdpFunnel; - VirtualChannelWithQueue& channel; + VirtualChannel& channel; uint32_t packetCounter = 0; const std::atomic_bool& ptmeLocked; void readCommandQueue(void); + ReturnValue_t handleRegularTmQueue(); + ReturnValue_t handleCfdpTmQueue(); + MessageQueueId_t getCommandQueue() const override; void getMode(Mode_t* mode, Submode_t* submode) override; diff --git a/mission/tmtc/PusLiveDemux.cpp b/mission/tmtc/PusLiveDemux.cpp index 12c8ccb3..6a30d780 100644 --- a/mission/tmtc/PusLiveDemux.cpp +++ b/mission/tmtc/PusLiveDemux.cpp @@ -57,9 +57,7 @@ ReturnValue_t PusLiveDemux::demultiplexPackets(StorageManagerIF& tmStore, uint32_t PusLiveDemux::addDestination(const char* name, const AcceptsTelemetryIF& downlinkDestination, uint8_t vcid) { - auto queueId = downlinkDestination.getReportReceptionQueue(vcid); - destinations.emplace_back(name, queueId, vcid); - return destinations.size() - 1; + return addDestinationByRawId(name, downlinkDestination.getReportReceptionQueue(vcid), vcid); } void PusLiveDemux::setDestFull(uint32_t listIndex) { @@ -73,3 +71,9 @@ void PusLiveDemux::setDestAvailable(uint32_t listIndex) { destinations[listIndex].isFull = false; } } + +uint32_t PusLiveDemux::addDestinationByRawId(const char* name, MessageQueueId_t downlinkDestination, + uint8_t vcid) { + destinations.emplace_back(name, downlinkDestination, vcid); + return destinations.size() - 1; +} diff --git a/mission/tmtc/PusLiveDemux.h b/mission/tmtc/PusLiveDemux.h index a6ba2c8f..d565c194 100644 --- a/mission/tmtc/PusLiveDemux.h +++ b/mission/tmtc/PusLiveDemux.h @@ -14,6 +14,8 @@ class PusLiveDemux { ReturnValue_t demultiplexPackets(StorageManagerIF& tmStore, store_address_t origStoreId, const uint8_t* tmData, size_t tmSize); + uint32_t addDestinationByRawId(const char* name, MessageQueueId_t downlinkDestination, + uint8_t vcid = 0); uint32_t addDestination(const char* name, const AcceptsTelemetryIF& downlinkDestination, uint8_t vcid = 0); void setDestFull(uint32_t listIndex); diff --git a/mission/tmtc/TmFunnelBase.cpp b/mission/tmtc/TmFunnelBase.cpp index 4a17984a..c19afd02 100644 --- a/mission/tmtc/TmFunnelBase.cpp +++ b/mission/tmtc/TmFunnelBase.cpp @@ -70,3 +70,9 @@ ReturnValue_t TmFunnelBase::saveSequenceCountToFile() { ofile << sourceSequenceCount << "\n"; return returnvalue::OK; } + +uint32_t TmFunnelBase::addLiveDestinationByRawId(const char *name, + MessageQueueId_t downlinkDestination, + uint8_t vcid) { + return liveDemux.addDestinationByRawId(name, downlinkDestination, vcid); +} diff --git a/mission/tmtc/TmFunnelBase.h b/mission/tmtc/TmFunnelBase.h index 7495af4a..bc36d7f5 100644 --- a/mission/tmtc/TmFunnelBase.h +++ b/mission/tmtc/TmFunnelBase.h @@ -37,6 +37,8 @@ class TmFunnelBase : public AcceptsTelemetryIF, public SystemObject { }; explicit TmFunnelBase(FunnelCfg cfg); [[nodiscard]] MessageQueueId_t getReportReceptionQueue(uint8_t virtualChannel) const override; + virtual uint32_t addLiveDestinationByRawId(const char* name, MessageQueueId_t downlinkDestination, + uint8_t vcid = 0); virtual uint32_t addLiveDestination(const char* name, const AcceptsTelemetryIF& downlinkDestination, uint8_t vcid = 0); From 52ae402594d282e6ffe37e426bb1b4252599920e Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 11 Sep 2023 20:21:14 +0200 Subject: [PATCH 050/257] missing include --- mission/sysDefs.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mission/sysDefs.h b/mission/sysDefs.h index 00a5635f..e1259c5c 100644 --- a/mission/sysDefs.h +++ b/mission/sysDefs.h @@ -1,6 +1,8 @@ #ifndef MISSION_SYSDEFS_H_ #define MISSION_SYSDEFS_H_ +#include "eive/eventSubsystemIds.h" + #include #include #include From fdd635e43f672c7bdac60a70aa2e5bebbcd1750a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 12 Sep 2023 10:52:47 +0200 Subject: [PATCH 051/257] bump tmtc --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index 68138c6e..1860b754 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 68138c6e798537dee7dbf6f9956af6235cd65d6d +Subproject commit 1860b754cee61b298832ea83d918499c8a3d6e51 From cdf63f0d42d976e6fe5b1df4e445b4fdffb4c9d7 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 12 Sep 2023 12:54:24 +0200 Subject: [PATCH 052/257] PDEC DTB update --- linux/ipcore/PdecConfig.cpp | 2 ++ linux/ipcore/PdecHandler.cpp | 29 ++++++++++++++++++----------- linux/ipcore/PdecHandler.h | 4 ++++ 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/linux/ipcore/PdecConfig.cpp b/linux/ipcore/PdecConfig.cpp index 19423862..b5e71a28 100644 --- a/linux/ipcore/PdecConfig.cpp +++ b/linux/ipcore/PdecConfig.cpp @@ -190,6 +190,7 @@ ReturnValue_t PdecConfig::createFirstWord(uint32_t* word) { return result; } *word |= static_cast(positiveWindow); + printf("Word 1: 0x%08x\n", *word); return returnvalue::OK; } @@ -205,6 +206,7 @@ ReturnValue_t PdecConfig::createSecondWord(uint32_t* word) { *word |= (static_cast(negativeWindow) << 24); *word |= (HIGH_AU_MAP_ID << 16); *word |= (ENABLE_DERANDOMIZER << 8); + printf("Word 2: 0x%08x\n", *word); return returnvalue::OK; } diff --git a/linux/ipcore/PdecHandler.cpp b/linux/ipcore/PdecHandler.cpp index c7266710..34f045a5 100644 --- a/linux/ipcore/PdecHandler.cpp +++ b/linux/ipcore/PdecHandler.cpp @@ -53,23 +53,30 @@ ReturnValue_t PdecHandler::initialize() { return ObjectManagerIF::CHILD_INIT_FAILED; } - ReturnValue_t result = returnvalue::OK; - UioMapper regMapper(uioNames.registers); - result = regMapper.getMappedAdress(®isterBaseAddress, UioMapper::Permissions::READ_WRITE); + ReturnValue_t result = + regMapper.getMappedAdress(®isterBaseAddress, UioMapper::Permissions::READ_WRITE); if (result != returnvalue::OK) { return ObjectManagerIF::CHILD_INIT_FAILED; } - UioMapper configMemMapper(uioNames.configMemory); - result = configMemMapper.getMappedAdress(&memoryBaseAddress, UioMapper::Permissions::READ_WRITE); - if (result != returnvalue::OK) { + + int fd = 0; + if ((fd = open("/dev/mem", O_RDWR | O_SYNC)) == -1) { + sif::error << "PdecHandler::initialize: Opening /dev/mem failed" << std::endl; + return ObjectManagerIF::CHILD_INIT_FAILED; + }; + memoryBaseAddress = static_cast( + mmap(0, PDEC_CFG_MEM_SIZE, static_cast(UioMapper::Permissions::READ_WRITE), MAP_SHARED, + fd, PDEC_RAM_PHY_ADDR)); + if (memoryBaseAddress == nullptr) { return ObjectManagerIF::CHILD_INIT_FAILED; - } else { - pdecConfig.setMemoryBaseAddress(memoryBaseAddress); } - UioMapper ramMapper(uioNames.ramMemory); - result = ramMapper.getMappedAdress(&ramBaseAddress, UioMapper::Permissions::READ_WRITE); - if (result != returnvalue::OK) { + pdecConfig.setMemoryBaseAddress(memoryBaseAddress); + + ramBaseAddress = static_cast(mmap(0, PDEC_RAM_SIZE, + static_cast(UioMapper::Permissions::READ_WRITE), + MAP_SHARED, fd, PDEC_RAM_PHY_ADDR)); + if (ramBaseAddress == nullptr) { return ObjectManagerIF::CHILD_INIT_FAILED; } diff --git a/linux/ipcore/PdecHandler.h b/linux/ipcore/PdecHandler.h index 11ae4de3..19968da6 100644 --- a/linux/ipcore/PdecHandler.h +++ b/linux/ipcore/PdecHandler.h @@ -51,6 +51,10 @@ class PdecHandler : public SystemObject, public ReceivesParameterMessagesIF { public: static constexpr dur_millis_t IRQ_TIMEOUT_MS = 500; + static constexpr uint32_t PDEC_CFG_MEM_SIZE = 0x1000; + static constexpr uint32_t PDEC_CFG_MEM_PHY_ADDR = 0x24000000; + static constexpr uint32_t PDEC_RAM_SIZE = 0x10000; + static constexpr uint32_t PDEC_RAM_PHY_ADDR = 0x26000000; enum class Modes { POLLED, IRQ }; From a697368297cd86b38639c6752b486bffb9c87927 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 12 Sep 2023 13:18:49 +0200 Subject: [PATCH 053/257] remove diagnostic printouts --- linux/ipcore/PdecConfig.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/linux/ipcore/PdecConfig.cpp b/linux/ipcore/PdecConfig.cpp index b5e71a28..19423862 100644 --- a/linux/ipcore/PdecConfig.cpp +++ b/linux/ipcore/PdecConfig.cpp @@ -190,7 +190,6 @@ ReturnValue_t PdecConfig::createFirstWord(uint32_t* word) { return result; } *word |= static_cast(positiveWindow); - printf("Word 1: 0x%08x\n", *word); return returnvalue::OK; } @@ -206,7 +205,6 @@ ReturnValue_t PdecConfig::createSecondWord(uint32_t* word) { *word |= (static_cast(negativeWindow) << 24); *word |= (HIGH_AU_MAP_ID << 16); *word |= (ENABLE_DERANDOMIZER << 8); - printf("Word 2: 0x%08x\n", *word); return returnvalue::OK; } From 695f5fa5bc49fe2204762d8bc9b506ea85413c30 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 12 Sep 2023 13:31:03 +0200 Subject: [PATCH 054/257] changelog --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 550901d9..34b83251 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,13 @@ will consitute of a breaking change warranting a new major release: # [unreleased] +## Changed + +- Changed the memory initialized for the PDEC Config Memory and the PDEC RAM by using `mmap` + directly and ignoring UIO. This makes the OBSW compatible to a device tree update, where those + memory segments are marked reserved and are thus not properly accessible through the UIO API + anymore. This change should be downwards compatible to older device trees. + # [v6.5.1] 2023-09-12 - Bumped `eive-tmtc` to v5.5.0. From 0a455183f44d2168babece387767160c1da621d9 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 12 Sep 2023 14:22:18 +0200 Subject: [PATCH 055/257] fix FM build --- bsp_q7s/fmObjectFactory.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bsp_q7s/fmObjectFactory.cpp b/bsp_q7s/fmObjectFactory.cpp index 0ffa328b..bff510d7 100644 --- a/bsp_q7s/fmObjectFactory.cpp +++ b/bsp_q7s/fmObjectFactory.cpp @@ -113,9 +113,11 @@ void ObjectFactory::produce(void* args) { &ipCoreHandler); createCcsdsComponents(ccsdsArgs); #if OBSW_TM_TO_PTME == 1 - if (ccsdsArgs.liveDestination != nullptr) { - pusFunnel->addLiveDestination("VC0 LIVE TM", *ccsdsArgs.liveDestination, 0); - cfdpFunnel->addLiveDestination("VC0 LIVE TM", *ccsdsArgs.liveDestination, 0); + if (ccsdsArgs.normalLiveTmDest != MessageQueueIF::NO_QUEUE) { + pusFunnel->addLiveDestinationByRawId("VC0 NORMAL LIVE TM", ccsdsArgs.normalLiveTmDest, 0); + } + if (ccsdsArgs.cfdpLiveTmDest != MessageQueueIF::NO_QUEUE) { + cfdpFunnel->addLiveDestinationByRawId("VC0 CFDP LIVE TM", ccsdsArgs.cfdpLiveTmDest, 0); } #endif #endif /* OBSW_ADD_CCSDS_IP_CORES == 1 */ From 24de9510381694f4d829aa5af99e51e01ff021a6 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 12 Sep 2023 14:27:14 +0200 Subject: [PATCH 056/257] reduce duplicate code --- bsp_q7s/em/emObjectFactory.cpp | 9 +-------- bsp_q7s/fmObjectFactory.cpp | 13 +------------ bsp_q7s/objectFactory.cpp | 15 +++++++++++++++ bsp_q7s/objectFactory.h | 1 + mission/sysDefs.h | 4 ++-- 5 files changed, 20 insertions(+), 22 deletions(-) diff --git a/bsp_q7s/em/emObjectFactory.cpp b/bsp_q7s/em/emObjectFactory.cpp index 97ed4c0a..223d27dc 100644 --- a/bsp_q7s/em/emObjectFactory.cpp +++ b/bsp_q7s/em/emObjectFactory.cpp @@ -162,15 +162,8 @@ void ObjectFactory::produce(void* args) { CcsdsComponentArgs ccsdsArgs(*gpioComIF, *ipcStore, *tmStore, stores, *pusFunnel, *cfdpFunnel, &ipCoreHandler); createCcsdsComponents(ccsdsArgs); -#if OBSW_TM_TO_PTME == 1 - if (ccsdsArgs.normalLiveTmDest != MessageQueueIF::NO_QUEUE) { - pusFunnel->addLiveDestinationByRawId("VC0 NORMAL LIVE TM", ccsdsArgs.normalLiveTmDest, 0); - } - if (ccsdsArgs.cfdpLiveTmDest != MessageQueueIF::NO_QUEUE) { - cfdpFunnel->addLiveDestinationByRawId("VC0 CFDP LIVE TM", ccsdsArgs.cfdpLiveTmDest, 0); - } -#endif #endif /* OBSW_ADD_CCSDS_IP_CORES == 1 */ + /* Test Task */ #if OBSW_ADD_TEST_CODE == 1 createTestComponents(gpioComIF); diff --git a/bsp_q7s/fmObjectFactory.cpp b/bsp_q7s/fmObjectFactory.cpp index bff510d7..68589752 100644 --- a/bsp_q7s/fmObjectFactory.cpp +++ b/bsp_q7s/fmObjectFactory.cpp @@ -108,18 +108,7 @@ void ObjectFactory::produce(void* args) { #endif /* OBSW_ADD_STAR_TRACKER == 1 */ #if OBSW_ADD_CCSDS_IP_CORES == 1 - CcsdsIpCoreHandler* ipCoreHandler = nullptr; - CcsdsComponentArgs ccsdsArgs(*gpioComIF, *ipcStore, *tmStore, stores, *pusFunnel, *cfdpFunnel, - &ipCoreHandler); - createCcsdsComponents(ccsdsArgs); -#if OBSW_TM_TO_PTME == 1 - if (ccsdsArgs.normalLiveTmDest != MessageQueueIF::NO_QUEUE) { - pusFunnel->addLiveDestinationByRawId("VC0 NORMAL LIVE TM", ccsdsArgs.normalLiveTmDest, 0); - } - if (ccsdsArgs.cfdpLiveTmDest != MessageQueueIF::NO_QUEUE) { - cfdpFunnel->addLiveDestinationByRawId("VC0 CFDP LIVE TM", ccsdsArgs.cfdpLiveTmDest, 0); - } -#endif + createCcsdsIpCoreComponents(); #endif /* OBSW_ADD_CCSDS_IP_CORES == 1 */ #if OBSW_ADD_SCEX_DEVICE == 1 diff --git a/bsp_q7s/objectFactory.cpp b/bsp_q7s/objectFactory.cpp index 2522a7c0..f54e8dce 100644 --- a/bsp_q7s/objectFactory.cpp +++ b/bsp_q7s/objectFactory.cpp @@ -1057,3 +1057,18 @@ ReturnValue_t ObjectFactory::readFirmwareVersion() { } return returnvalue::OK; } + +ReturnValue_t ObjectFactory::readCcsdsIpCoreComponents(CcsdsComponentArgs& ccsdsArgs) { + CcsdsIpCoreHandler* ipCoreHandler = nullptr; + ReturnValue_t result = createCcsdsComponents(ccsdsArgs); +#if OBSW_TM_TO_PTME == 1 + if (ccsdsArgs.normalLiveTmDest != MessageQueueIF::NO_QUEUE) { + ccsdsArgs.pusFunnel.addLiveDestinationByRawId("VC0 NORMAL LIVE TM", ccsdsArgs.normalLiveTmDest, + 0); + } + if (ccsdsArgs.cfdpLiveTmDest != MessageQueueIF::NO_QUEUE) { + ccsdsArgs.cfdpFunnel.addLiveDestinationByRawId("VC0 CFDP LIVE TM", ccsdsArgs.cfdpLiveTmDest, 0); + } +#endif + return result; +} diff --git a/bsp_q7s/objectFactory.h b/bsp_q7s/objectFactory.h index bccbdd17..60a2ff6d 100644 --- a/bsp_q7s/objectFactory.h +++ b/bsp_q7s/objectFactory.h @@ -83,6 +83,7 @@ void createTestComponents(LinuxLibgpioIF* gpioComIF); void createPlI2cResetGpio(LinuxLibgpioIF* gpioComIF); void testAcsBrdAss(AcsBoardAssembly* assAss); +ReturnValue_t readCcsdsIpCoreComponents(CcsdsComponentArgs& args); }; // namespace ObjectFactory diff --git a/mission/sysDefs.h b/mission/sysDefs.h index e1259c5c..b7cbd4e0 100644 --- a/mission/sysDefs.h +++ b/mission/sysDefs.h @@ -1,8 +1,6 @@ #ifndef MISSION_SYSDEFS_H_ #define MISSION_SYSDEFS_H_ -#include "eive/eventSubsystemIds.h" - #include #include #include @@ -11,6 +9,8 @@ #include #include +#include "eive/eventSubsystemIds.h" + namespace signals { extern std::atomic_bool CFDP_CHANNEL_THROTTLE_SIGNAL; From b6f28eb239511911850c28a03e649100b5ebe449 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 12 Sep 2023 14:29:42 +0200 Subject: [PATCH 057/257] wrong API call --- bsp_q7s/em/emObjectFactory.cpp | 2 +- bsp_q7s/fmObjectFactory.cpp | 5 ++++- bsp_q7s/objectFactory.cpp | 2 +- bsp_q7s/objectFactory.h | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/bsp_q7s/em/emObjectFactory.cpp b/bsp_q7s/em/emObjectFactory.cpp index 223d27dc..074eb438 100644 --- a/bsp_q7s/em/emObjectFactory.cpp +++ b/bsp_q7s/em/emObjectFactory.cpp @@ -161,7 +161,7 @@ void ObjectFactory::produce(void* args) { CcsdsIpCoreHandler* ipCoreHandler = nullptr; CcsdsComponentArgs ccsdsArgs(*gpioComIF, *ipcStore, *tmStore, stores, *pusFunnel, *cfdpFunnel, &ipCoreHandler); - createCcsdsComponents(ccsdsArgs); + createCcsdsIpComponentsAddTmRouting(ccsdsArgs); #endif /* OBSW_ADD_CCSDS_IP_CORES == 1 */ /* Test Task */ diff --git a/bsp_q7s/fmObjectFactory.cpp b/bsp_q7s/fmObjectFactory.cpp index 68589752..f5cad932 100644 --- a/bsp_q7s/fmObjectFactory.cpp +++ b/bsp_q7s/fmObjectFactory.cpp @@ -108,7 +108,10 @@ void ObjectFactory::produce(void* args) { #endif /* OBSW_ADD_STAR_TRACKER == 1 */ #if OBSW_ADD_CCSDS_IP_CORES == 1 - createCcsdsIpCoreComponents(); + CcsdsIpCoreHandler* ipCoreHandler = nullptr; + CcsdsComponentArgs ccsdsArgs(*gpioComIF, *ipcStore, *tmStore, stores, *pusFunnel, *cfdpFunnel, + &ipCoreHandler); + createCcsdsIpComponentsAddTmRouting(ccsdsArgs); #endif /* OBSW_ADD_CCSDS_IP_CORES == 1 */ #if OBSW_ADD_SCEX_DEVICE == 1 diff --git a/bsp_q7s/objectFactory.cpp b/bsp_q7s/objectFactory.cpp index f54e8dce..6aa007a3 100644 --- a/bsp_q7s/objectFactory.cpp +++ b/bsp_q7s/objectFactory.cpp @@ -1058,7 +1058,7 @@ ReturnValue_t ObjectFactory::readFirmwareVersion() { return returnvalue::OK; } -ReturnValue_t ObjectFactory::readCcsdsIpCoreComponents(CcsdsComponentArgs& ccsdsArgs) { +ReturnValue_t ObjectFactory::createCcsdsIpComponentsAddTmRouting(CcsdsComponentArgs& ccsdsArgs) { CcsdsIpCoreHandler* ipCoreHandler = nullptr; ReturnValue_t result = createCcsdsComponents(ccsdsArgs); #if OBSW_TM_TO_PTME == 1 diff --git a/bsp_q7s/objectFactory.h b/bsp_q7s/objectFactory.h index 60a2ff6d..223031e6 100644 --- a/bsp_q7s/objectFactory.h +++ b/bsp_q7s/objectFactory.h @@ -75,6 +75,7 @@ void createSolarArrayDeploymentComponents(PowerSwitchIF& pwrSwitcher, GpioIF& gp void createSyrlinksComponents(PowerSwitchIF* pwrSwitcher); void createPayloadComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchIF& pwrSwitcher); void createReactionWheelComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchIF* pwrSwitcher); +ReturnValue_t createCcsdsIpComponentsAddTmRouting(CcsdsComponentArgs& args); ReturnValue_t createCcsdsComponents(CcsdsComponentArgs& args); ReturnValue_t readFirmwareVersion(); void createMiscComponents(); @@ -83,7 +84,6 @@ void createTestComponents(LinuxLibgpioIF* gpioComIF); void createPlI2cResetGpio(LinuxLibgpioIF* gpioComIF); void testAcsBrdAss(AcsBoardAssembly* assAss); -ReturnValue_t readCcsdsIpCoreComponents(CcsdsComponentArgs& args); }; // namespace ObjectFactory From 51dafa56be9106fda6be997e7811f9ba82e81b3c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 12 Sep 2023 14:32:11 +0200 Subject: [PATCH 058/257] remove obsolete TODOs --- mission/cfdp/CfdpHandler.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/mission/cfdp/CfdpHandler.cpp b/mission/cfdp/CfdpHandler.cpp index 8ca37de0..07fbecb1 100644 --- a/mission/cfdp/CfdpHandler.cpp +++ b/mission/cfdp/CfdpHandler.cpp @@ -187,9 +187,6 @@ ReturnValue_t CfdpHandler::handlePduPacket(TmTcMessage& msg) { } ReturnValue_t CfdpHandler::handleCfdpRequest(CommandMessage& msg) { - // TODO: Handle CFDP requests here, most importantly put requests. If a put request is received, - // check whether one is pending. If none are, start a transaction with the put request, - // otherwise store for put request inside a FIFO for later processing. if (msg.getCommand() == CfdpMessage::PUT_REQUEST) { sif::info << "Received CFDP put request" << std::endl; if (srcHandler.getState() != CfdpState::IDLE) { @@ -199,7 +196,6 @@ ReturnValue_t CfdpHandler::handleCfdpRequest(CommandMessage& msg) { } putRequestQueue.push(CfdpMessage::getStoreId(&msg)); } else { - // TODO: Retrieve put request and remote configuration. PutRequest putRequest; auto accessorPair = ipcStore.getData(CfdpMessage::getStoreId(&msg)); const uint8_t* dataPtr = accessorPair.second.data(); From 8871146e887eb67d354fcf6a143ca4a8fa768829 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 12 Sep 2023 14:35:10 +0200 Subject: [PATCH 059/257] remove commented code --- mission/genericFactory.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/mission/genericFactory.cpp b/mission/genericFactory.cpp index 70363557..006b295a 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; -// EiveUserHandler USER_HANDLER(HOST_FS); EiveFaultHandler EIVE_FAULT_HANDLER; } // namespace cfdp From 98e1beafdf671027d89536ce6627b53d0dbeef18 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 13 Sep 2023 13:09:07 +0200 Subject: [PATCH 060/257] implemented missing queue handling --- mission/com/LiveTmTask.cpp | 34 ++++++++++++++++++++++++++++++++-- mission/com/LiveTmTask.h | 2 ++ mission/sysDefs.h | 4 ++-- 3 files changed, 36 insertions(+), 4 deletions(-) diff --git a/mission/com/LiveTmTask.cpp b/mission/com/LiveTmTask.cpp index 14706705..e9dcc84b 100644 --- a/mission/com/LiveTmTask.cpp +++ b/mission/com/LiveTmTask.cpp @@ -116,14 +116,44 @@ void LiveTmTask::readCommandQueue(void) { } } -ReturnValue_t LiveTmTask::handleRegularTmQueue() { return returnvalue::OK; } +ReturnValue_t LiveTmTask::handleRegularTmQueue() { return handleGenericTmQueue(*regularTmQueue); } -ReturnValue_t LiveTmTask::handleCfdpTmQueue() { return returnvalue::OK; } +ReturnValue_t LiveTmTask::handleCfdpTmQueue() { return handleGenericTmQueue(*cfdpTmQueue); } + +ReturnValue_t LiveTmTask::handleGenericTmQueue(MessageQueueIF& queue) { + TmTcMessage message; + ReturnValue_t result = queue.receiveMessage(&message); + if (result == MessageQueueIF::EMPTY) { + return result; + } + store_address_t storeId = message.getStorageId(); + const uint8_t* data = nullptr; + size_t size = 0; + result = tmStore->getData(storeId, &data, &size); + if (result != returnvalue::OK) { + sif::warning << "VirtualChannel::performOperation: Failed to read data from TM store" + << std::endl; + tmStore->deleteData(storeId); + return result; + } + + if (ptmeLocked) { + result = channel.write(data, size); + } + // Try delete in any case, ignore failures (which should not happen), it is more important to + // propagate write errors. + tmStore->deleteData(storeId); + return result; +} ModeTreeChildIF& LiveTmTask::getModeTreeChildIF() { return *this; } ReturnValue_t LiveTmTask::initialize() { modeHelper.initialize(); + tmStore = ObjectManager::instance()->get(objects::TM_STORE); + if (tmStore == nullptr) { + return ObjectManagerIF::CHILD_INIT_FAILED; + } return returnvalue::OK; } diff --git a/mission/com/LiveTmTask.h b/mission/com/LiveTmTask.h index d1173ccc..a271b327 100644 --- a/mission/com/LiveTmTask.h +++ b/mission/com/LiveTmTask.h @@ -31,6 +31,7 @@ class LiveTmTask : public SystemObject, MessageQueueIF* requestQueue; MessageQueueIF* cfdpTmQueue; MessageQueueIF* regularTmQueue; + StorageManagerIF* tmStore = nullptr; ModeHelper modeHelper; Mode_t mode = HasModesIF::MODE_OFF; Countdown tmFunnelCd = Countdown(100); @@ -44,6 +45,7 @@ class LiveTmTask : public SystemObject, ReturnValue_t handleRegularTmQueue(); ReturnValue_t handleCfdpTmQueue(); + ReturnValue_t handleGenericTmQueue(MessageQueueIF& queue); MessageQueueId_t getCommandQueue() const override; diff --git a/mission/sysDefs.h b/mission/sysDefs.h index e1259c5c..b7cbd4e0 100644 --- a/mission/sysDefs.h +++ b/mission/sysDefs.h @@ -1,8 +1,6 @@ #ifndef MISSION_SYSDEFS_H_ #define MISSION_SYSDEFS_H_ -#include "eive/eventSubsystemIds.h" - #include #include #include @@ -11,6 +9,8 @@ #include #include +#include "eive/eventSubsystemIds.h" + namespace signals { extern std::atomic_bool CFDP_CHANNEL_THROTTLE_SIGNAL; From 6fa2cbbbb137132a6ed7aa604031ef85edbfb63c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 13 Sep 2023 13:38:40 +0200 Subject: [PATCH 061/257] large regular live channel queue size --- common/config/eive/definitions.h | 2 +- tmtc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common/config/eive/definitions.h b/common/config/eive/definitions.h index e62a90aa..d746c97d 100644 --- a/common/config/eive/definitions.h +++ b/common/config/eive/definitions.h @@ -58,7 +58,7 @@ static constexpr uint32_t NOK_STORE_QUEUE_SIZE = 350; static constexpr uint32_t HK_STORE_QUEUE_SIZE = 300; static constexpr uint32_t CFDP_STORE_QUEUE_SIZE = 300; -static constexpr uint32_t LIVE_CHANNEL_NORMAL_QUEUE_SIZE = 300; +static constexpr uint32_t LIVE_CHANNEL_NORMAL_QUEUE_SIZE = 400; static constexpr uint32_t LIVE_CHANNEL_CFDP_QUEUE_SIZE = 300; static constexpr uint32_t CFDP_MAX_FSM_CALL_COUNT_SRC_HANDLER = 50; diff --git a/tmtc b/tmtc index 8b45dd8b..8d28b321 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 8b45dd8bff5c0a31cdb2f56edc082624bf1fb936 +Subproject commit 8d28b321d4a1fa4ba7f375bbb0cb36d843c7dcf5 From 634f6c60019c7836cb1bd1394868d31942a230c8 Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 13 Sep 2023 14:34:10 +0200 Subject: [PATCH 062/257] introduction of eps subsystem object --- common/config/eive/objects.h | 1 + mission/system/power/EpsSubsystem.cpp | 27 +++++++++++++++++ mission/system/power/EpsSubsystem.h | 13 +++++++++ mission/system/power/epsModeTree.cpp | 42 +++++++++++++++++++++++++++ mission/system/power/epsModeTree.h | 15 ++++++++++ mission/system/systemTree.cpp | 3 ++ 6 files changed, 101 insertions(+) create mode 100644 mission/system/power/EpsSubsystem.cpp create mode 100644 mission/system/power/EpsSubsystem.h create mode 100644 mission/system/power/epsModeTree.cpp create mode 100644 mission/system/power/epsModeTree.h diff --git a/common/config/eive/objects.h b/common/config/eive/objects.h index ca741c77..5d93dffc 100644 --- a/common/config/eive/objects.h +++ b/common/config/eive/objects.h @@ -158,6 +158,7 @@ enum commonObjects : uint32_t { PL_SUBSYSTEM = 0x73010002, TCS_SUBSYSTEM = 0x73010003, COM_SUBSYSTEM = 0x73010004, + EPS_SUBSYSTEM = 0x73010005, TM_FUNNEL = 0x73000100, PUS_TM_FUNNEL = 0x73000101, diff --git a/mission/system/power/EpsSubsystem.cpp b/mission/system/power/EpsSubsystem.cpp new file mode 100644 index 00000000..8d402553 --- /dev/null +++ b/mission/system/power/EpsSubsystem.cpp @@ -0,0 +1,27 @@ +#include + +#include "fsfw/devicehandlers/DeviceHandlerIF.h" + +EpsSubsystem::EpsSubsystem(object_id_t objectId, uint32_t maxNumberOfSequences, + uint32_t maxNumberOfTables) + : Subsystem(objectId, maxNumberOfSequences, maxNumberOfTables) {} + +void EpsSubsystem::announceMode(bool recursive) { + const char* modeStr = "UNKNOWN"; + switch (mode) { + case (HasModesIF::MODE_OFF): { + modeStr = "OFF"; + break; + } + case (HasModesIF::MODE_ON): { + modeStr = "ON"; + break; + } + case (DeviceHandlerIF::MODE_NORMAL): { + modeStr = "NORMAL"; + break; + } + } + sif::info << "EPS subsystem is now in " << modeStr << " mode" << std::endl; + return Subsystem::announceMode(recursive); +} diff --git a/mission/system/power/EpsSubsystem.h b/mission/system/power/EpsSubsystem.h new file mode 100644 index 00000000..33f24d46 --- /dev/null +++ b/mission/system/power/EpsSubsystem.h @@ -0,0 +1,13 @@ +#ifndef MISSION_SYSTEM_OBJECTS_EPSSUBSYSTEM_H_ +#define MISSION_SYSTEM_OBJECTS_EPSSUBSYSTEM_H_ +#include + +class EpsSubsystem : public Subsystem { + public: + EpsSubsystem(object_id_t objectId, uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables); + + private: + void announceMode(bool recursive) override; +}; + +#endif /* MISSION_SYSTEM_OBJECTS_EPSSUBSYSTEM_H_ */ diff --git a/mission/system/power/epsModeTree.cpp b/mission/system/power/epsModeTree.cpp new file mode 100644 index 00000000..feeb6e5d --- /dev/null +++ b/mission/system/power/epsModeTree.cpp @@ -0,0 +1,42 @@ +#include + +#include "eive/objects.h" +#include "fsfw/devicehandlers/DeviceHandlerIF.h" +#include "fsfw/subsystem/Subsystem.h" +#include "mission/system/treeUtil.h" + +EpsSubsystem satsystem::eps::SUBSYSTEM(objects::EPS_SUBSYSTEM, 12, 24); + +namespace { +// Alias for checker function +const auto check = subsystem::checkInsert; +void buildOffSequence(Subsystem& ss, ModeListEntry& eh); +void buildNormalSequence(Subsystem& ss, ModeListEntry& eh); +} // namespace + +static const auto OFF = HasModesIF::MODE_OFF; +static const auto NML = DeviceHandlerIF::MODE_NORMAL; + +auto EPS_SEQUENCE_OFF = std::make_pair(OFF, FixedArrayList()); +auto EPS_TABLE_OFF_TGT = std::make_pair((OFF << 24) | 1, FixedArrayList()); +auto EPS_TABLE_OFF_TRANS_0 = std::make_pair((OFF << 24) | 2, FixedArrayList()); +auto EPS_TABLE_OFF_TRANS_1 = std::make_pair((OFF << 24) | 3, FixedArrayList()); + +auto EPS_SEQUENCE_NORMAL = std::make_pair(NML, FixedArrayList()); +auto EPS_TABLE_NORMAL_TGT = std::make_pair((NML << 24) | 1, FixedArrayList()); +auto EPS_TABLE_NORMAL_TRANS_0 = std::make_pair((NML << 24) | 2, FixedArrayList()); +auto EPS_TABLE_NORMAL_TRANS_1 = std::make_pair((NML << 24) | 3, FixedArrayList()); + +Subsystem& satsystem::eps::init() { + ModeListEntry entry; + buildOffSequence(SUBSYSTEM, entry); + buildNormalSequence(SUBSYSTEM, entry); + SUBSYSTEM.setInitialMode(OFF); + return SUBSYSTEM; +} + +namespace { + +void buildOffSequence(Subsystem& ss, ModeListEntry& eh) {} + +void buildNormalSequence(Subsystem& ss, ModeListEntry& eh) {} // namespace diff --git a/mission/system/power/epsModeTree.h b/mission/system/power/epsModeTree.h new file mode 100644 index 00000000..3bf6708a --- /dev/null +++ b/mission/system/power/epsModeTree.h @@ -0,0 +1,15 @@ +#ifndef MISSION_SYSTEM_TREE_EPSMODETREE_H_ +#define MISSION_SYSTEM_TREE_EPSMODETREE_H_ + +#include + +namespace satsystem { +namespace eps { + +extern EpsSubsystem SUBSYSTEM; +Subsystem& init(); + +} // namespace eps +} // namespace satsystem + +#endif /* MISSION_SYSTEM_TREE_EPSMODETREE_H_ */ diff --git a/mission/system/systemTree.cpp b/mission/system/systemTree.cpp index 10c40617..6c45a813 100644 --- a/mission/system/systemTree.cpp +++ b/mission/system/systemTree.cpp @@ -11,6 +11,7 @@ #include "eive/objects.h" #include "mission/com/defs.h" #include "mission/system/acs/acsModeTree.h" +#include "mission/system/power/epsModeTree.h" #include "mission/system/tcs/tcsModeTree.h" #include "mission/system/tree/payloadModeTree.h" #include "treeUtil.h" @@ -40,6 +41,8 @@ void satsystem::init(bool commandPlPcdu1) { tcsSubsystem.connectModeTreeParent(EIVE_SYSTEM); auto& comSubsystem = com::init(); comSubsystem.connectModeTreeParent(EIVE_SYSTEM); + auto& epsSubsystem = eps::init(); + epsSubsystem.connectModeTreeParent(EIVE_SYSTEM); ModeListEntry entry; buildBootSequence(EIVE_SYSTEM, entry); buildSafeSequence(EIVE_SYSTEM, entry); From a1a1c3aef9959001f679f8e29e4127c3f93e6e64 Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 13 Sep 2023 16:29:54 +0200 Subject: [PATCH 063/257] biggest changes possible --- mission/controller/PowerController.cpp | 12 +++++++++--- mission/controller/PowerController.h | 2 ++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/mission/controller/PowerController.cpp b/mission/controller/PowerController.cpp index 58177313..d10f233c 100644 --- a/mission/controller/PowerController.cpp +++ b/mission/controller/PowerController.cpp @@ -1,4 +1,3 @@ - #include PowerController::PowerController(object_id_t objectId, bool enableHkSets) @@ -89,6 +88,9 @@ void PowerController::performControlOperation() { // if (mode != MODE_OFF) { sif::debug << "oh shit, now i gotta do something" << std::endl; calculateStateOfCharge(); + if (mode == MODE_NORMAL) { + watchStateOfCharge(); + } // do something //} break; @@ -204,9 +206,13 @@ void PowerController::calculateStateOfCharge() { } } +void PowerController::watchStateOfCharge() { + // ToDo: FDIR +} + ReturnValue_t PowerController::calculateOpenCircuitVoltageCharge() { float vBatCorrected = p60CoreHk.batteryVoltage.value - iBat * batteryInternalResistance; - uint8_t lookUpTableIdx = 99; + uint8_t lookUpTableIdx = LOOK_UP_TABLE_MAX_IDX; ReturnValue_t result = lookUpTableOcvIdxFinder(vBatCorrected, lookUpTableIdx); if (result != returnvalue::OK) { return result; @@ -289,7 +295,7 @@ ReturnValue_t PowerController::lookUpTableOcvIdxFinder(float voltage, uint8_t &i } ReturnValue_t PowerController::calculateCoulombCounterChargeUpperThreshold() { - uint8_t lookUpTableIdx = 99; + uint8_t lookUpTableIdx = LOOK_UP_TABLE_MAX_IDX; ReturnValue_t result = lookUpTableOcvIdxFinder(coulombCounterVoltageUpperThreshold, lookUpTableIdx); if (result != returnvalue::OK) { diff --git a/mission/controller/PowerController.h b/mission/controller/PowerController.h index e7f9383c..700860bc 100644 --- a/mission/controller/PowerController.h +++ b/mission/controller/PowerController.h @@ -43,6 +43,7 @@ class PowerController : public ExtendedControllerBase, public ReceivesParameterM void performControlOperation() override; void calculateStateOfCharge(); + void watchStateOfCharge(); ReturnValue_t calculateOpenCircuitVoltageCharge(); ReturnValue_t calculateCoulombCounterCharge(); ReturnValue_t updateEpsData(); @@ -58,6 +59,7 @@ class PowerController : public ExtendedControllerBase, public ReceivesParameterM double maxAllowedTimeDiff = 0.5; // [s] // OCV Look-up-Table + static constexpr uint8_t LOOK_UP_TABLE_MAX_IDX = 99; float lookUpTableOcv[2][100] = { {0.00000000e+00, 3.16227766e-04, 4.52809661e-04, 6.48382625e-04, 9.28425483e-04, 1.32942162e-03, 1.90361194e-03, 2.72580074e-03, 3.90310099e-03, 5.58888885e-03, From ca4e90ad97125eb4df8365189c34c07f4f23653c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 13 Sep 2023 18:13:16 +0200 Subject: [PATCH 064/257] important fix --- linux/ipcore/PdecHandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/ipcore/PdecHandler.cpp b/linux/ipcore/PdecHandler.cpp index 34f045a5..8f86ee9c 100644 --- a/linux/ipcore/PdecHandler.cpp +++ b/linux/ipcore/PdecHandler.cpp @@ -67,7 +67,7 @@ ReturnValue_t PdecHandler::initialize() { }; memoryBaseAddress = static_cast( mmap(0, PDEC_CFG_MEM_SIZE, static_cast(UioMapper::Permissions::READ_WRITE), MAP_SHARED, - fd, PDEC_RAM_PHY_ADDR)); + fd, PDEC_CFG_MEM_PHY_ADDR)); if (memoryBaseAddress == nullptr) { return ObjectManagerIF::CHILD_INIT_FAILED; } From 9243f917ccfa7227a3c9e4862403a7339931f982 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 14 Sep 2023 10:23:00 +0200 Subject: [PATCH 065/257] STOOOPID bug --- mission/com/LiveTmTask.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mission/com/LiveTmTask.cpp b/mission/com/LiveTmTask.cpp index e9dcc84b..638f2e43 100644 --- a/mission/com/LiveTmTask.cpp +++ b/mission/com/LiveTmTask.cpp @@ -137,7 +137,7 @@ ReturnValue_t LiveTmTask::handleGenericTmQueue(MessageQueueIF& queue) { return result; } - if (ptmeLocked) { + if (!ptmeLocked) { result = channel.write(data, size); } // Try delete in any case, ignore failures (which should not happen), it is more important to From 8071a5713f7518b7134aa6d14282f97b72f75913 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 14 Sep 2023 10:38:43 +0200 Subject: [PATCH 066/257] these queue sizes are sufficient --- bsp_q7s/objectFactory.cpp | 1 - common/config/eive/definitions.h | 4 ++-- mission/com/LiveTmTask.cpp | 24 ++++++++++++++++++++++++ 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/bsp_q7s/objectFactory.cpp b/bsp_q7s/objectFactory.cpp index 6aa007a3..211aa071 100644 --- a/bsp_q7s/objectFactory.cpp +++ b/bsp_q7s/objectFactory.cpp @@ -1059,7 +1059,6 @@ ReturnValue_t ObjectFactory::readFirmwareVersion() { } ReturnValue_t ObjectFactory::createCcsdsIpComponentsAddTmRouting(CcsdsComponentArgs& ccsdsArgs) { - CcsdsIpCoreHandler* ipCoreHandler = nullptr; ReturnValue_t result = createCcsdsComponents(ccsdsArgs); #if OBSW_TM_TO_PTME == 1 if (ccsdsArgs.normalLiveTmDest != MessageQueueIF::NO_QUEUE) { diff --git a/common/config/eive/definitions.h b/common/config/eive/definitions.h index d746c97d..b90f6adb 100644 --- a/common/config/eive/definitions.h +++ b/common/config/eive/definitions.h @@ -58,8 +58,8 @@ static constexpr uint32_t NOK_STORE_QUEUE_SIZE = 350; static constexpr uint32_t HK_STORE_QUEUE_SIZE = 300; static constexpr uint32_t CFDP_STORE_QUEUE_SIZE = 300; -static constexpr uint32_t LIVE_CHANNEL_NORMAL_QUEUE_SIZE = 400; -static constexpr uint32_t LIVE_CHANNEL_CFDP_QUEUE_SIZE = 300; +static constexpr uint32_t LIVE_CHANNEL_NORMAL_QUEUE_SIZE = 250; +static constexpr uint32_t LIVE_CHANNEL_CFDP_QUEUE_SIZE = 250; static constexpr uint32_t CFDP_MAX_FSM_CALL_COUNT_SRC_HANDLER = 50; static constexpr uint32_t CFDP_MAX_FSM_CALL_COUNT_DEST_HANDLER = 300; diff --git a/mission/com/LiveTmTask.cpp b/mission/com/LiveTmTask.cpp index 638f2e43..042104c4 100644 --- a/mission/com/LiveTmTask.cpp +++ b/mission/com/LiveTmTask.cpp @@ -7,6 +7,7 @@ #include "mission/sysDefs.h" +static constexpr bool DEBUG_TM_QUEUE_SPEED = false; std::atomic_bool signals::CFDP_CHANNEL_THROTTLE_SIGNAL = false; LiveTmTask::LiveTmTask(object_id_t objectId, PusTmFunnel& pusFunnel, CfdpTmFunnel& cfdpFunnel, @@ -27,7 +28,11 @@ ReturnValue_t LiveTmTask::performOperation(uint8_t opCode) { readCommandQueue(); bool handledTm; ReturnValue_t result; + uint32_t consecutiveRegularCounter = 0; + uint32_t consecutiveCfdpCounter = 0; + bool isCfdp = false; while (true) { + isCfdp = false; // TODO: Must read CFDP TM queue and regular TM queue and forward them. Handle regular queue // first. handledTm = false; @@ -35,9 +40,17 @@ ReturnValue_t LiveTmTask::performOperation(uint8_t opCode) { result = handleRegularTmQueue(); if (result == MessageQueueIF::EMPTY) { result = handleCfdpTmQueue(); + isCfdp = true; } if (result == returnvalue::OK) { handledTm = true; + if (DEBUG_TM_QUEUE_SPEED) { + if (isCfdp) { + consecutiveCfdpCounter++; + } else { + consecutiveRegularCounter++; + } + } } } if (channel.isBusy()) { @@ -54,6 +67,17 @@ ReturnValue_t LiveTmTask::performOperation(uint8_t opCode) { } // Read command queue during idle times. readCommandQueue(); + if (DEBUG_TM_QUEUE_SPEED) { + if (consecutiveCfdpCounter > 0) { + sif::debug << "Concecutive CFDP TM handled: " << consecutiveCfdpCounter << std::endl; + } + if (consecutiveRegularCounter > 0) { + sif::debug << "Concecutive regular TM handled: " << consecutiveRegularCounter + << std::endl; + } + consecutiveRegularCounter = 0; + consecutiveCfdpCounter = 0; + } // 40 ms IDLE delay. Might tweak this in the future. TaskFactory::delayTask(40); } else { From fa7443d4a9e121be5c9052d6b6ce4019f19c6ce5 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 14 Sep 2023 12:28:40 +0200 Subject: [PATCH 067/257] bump tmtc, small tweaks --- mission/com/LiveTmTask.cpp | 4 +--- mission/com/LiveTmTask.h | 1 - tmtc | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/mission/com/LiveTmTask.cpp b/mission/com/LiveTmTask.cpp index 042104c4..74d79d4d 100644 --- a/mission/com/LiveTmTask.cpp +++ b/mission/com/LiveTmTask.cpp @@ -53,7 +53,7 @@ ReturnValue_t LiveTmTask::performOperation(uint8_t opCode) { } } } - if (channel.isBusy()) { + if (channel.isBusy() and not signals::CFDP_CHANNEL_THROTTLE_SIGNAL) { // Throttle CFDP packet creator. It is by far the most relevant data creator, so throttling // it is the easiest way to handle back pressure for now in a sensible way. It is cleared // by the data creator. @@ -80,8 +80,6 @@ ReturnValue_t LiveTmTask::performOperation(uint8_t opCode) { } // 40 ms IDLE delay. Might tweak this in the future. TaskFactory::delayTask(40); - } else { - packetCounter++; } } } diff --git a/mission/com/LiveTmTask.h b/mission/com/LiveTmTask.h index a271b327..63831158 100644 --- a/mission/com/LiveTmTask.h +++ b/mission/com/LiveTmTask.h @@ -38,7 +38,6 @@ class LiveTmTask : public SystemObject, PusTmFunnel& pusFunnel; CfdpTmFunnel& cfdpFunnel; VirtualChannel& channel; - uint32_t packetCounter = 0; const std::atomic_bool& ptmeLocked; void readCommandQueue(void); diff --git a/tmtc b/tmtc index 8d28b321..bf399c3d 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 8d28b321d4a1fa4ba7f375bbb0cb36d843c7dcf5 +Subproject commit bf399c3d910a034112121f3bfb08494f40d46bf2 From 592561b287e5ff2dfe05b1c24a0426c672309100 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 14 Sep 2023 12:29:11 +0200 Subject: [PATCH 068/257] changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 88fb953f..9db182aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ will consitute of a breaking change warranting a new major release: # [unreleased] +`eive-tmtc` v5.6.0 + ## Added - CFDP source handler, which allow file downlink using the standardized From 09951edbbadf46ce8fcf9bb12dcb573ba0a8b187 Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 15 Sep 2023 10:05:04 +0200 Subject: [PATCH 069/257] removed deprecated input --- mission/controller/PowerController.cpp | 12 ------------ mission/controller/PowerController.h | 3 --- 2 files changed, 15 deletions(-) diff --git a/mission/controller/PowerController.cpp b/mission/controller/PowerController.cpp index d10f233c..c87da007 100644 --- a/mission/controller/PowerController.cpp +++ b/mission/controller/PowerController.cpp @@ -250,18 +250,6 @@ ReturnValue_t PowerController::updateEpsData() { PoolReadGuard pgP60(&p60CoreHk); results.push_back(pgP60.getReadResult()); } - { - PoolReadGuard pgPdu1(&pdu1CoreHk); - results.push_back(pgPdu1.getReadResult()); - } - { - PoolReadGuard pgPdu2(&pdu2CoreHk); - results.push_back(pgPdu2.getReadResult()); - } - { - PoolReadGuard pgAcu(&acuCoreHk); - results.push_back(pgAcu.getReadResult()); - } for (const auto &result : results) { if (result != returnvalue::OK) { return result; diff --git a/mission/controller/PowerController.h b/mission/controller/PowerController.h index 700860bc..cd984840 100644 --- a/mission/controller/PowerController.h +++ b/mission/controller/PowerController.h @@ -111,9 +111,6 @@ class PowerController : public ExtendedControllerBase, public ReceivesParameterM // HK Datasets for Calculation BpxBatteryHk bpxBatteryHk = BpxBatteryHk(objects::BPX_BATT_HANDLER); P60Dock::CoreHkSet p60CoreHk = P60Dock::CoreHkSet(objects::P60DOCK_HANDLER); - PDU1::Pdu1CoreHk pdu1CoreHk = PDU1::Pdu1CoreHk(objects::PDU1_HANDLER); - PDU2::Pdu2CoreHk pdu2CoreHk = PDU2::Pdu2CoreHk(objects::PDU2_HANDLER); - ACU::CoreHk acuCoreHk = ACU::CoreHk(objects::ACU_HANDLER); // Output Dataset pwrctrl::CoreHk pwrCtrlCoreHk; }; From d4a87ee7898db0e5bf98ee50711d2a2943b685f9 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 18 Sep 2023 16:32:22 +0200 Subject: [PATCH 070/257] prep v6.6.0 --- CHANGELOG.md | 2 ++ CMakeLists.txt | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 34b83251..8403fcf2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ will consitute of a breaking change warranting a new major release: # [unreleased] +# [v6.6.0] 2023-09-18 + ## Changed - Changed the memory initialized for the PDEC Config Memory and the PDEC RAM by using `mmap` diff --git a/CMakeLists.txt b/CMakeLists.txt index ba4289c2..65038b76 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,8 +10,8 @@ cmake_minimum_required(VERSION 3.13) set(OBSW_VERSION_MAJOR 6) -set(OBSW_VERSION_MINOR 5) -set(OBSW_VERSION_REVISION 1) +set(OBSW_VERSION_MINOR 6) +set(OBSW_VERSION_REVISION 0) # set(CMAKE_VERBOSE TRUE) From f2e15bb13447fb7b8dea1c98a019db50eedb7149 Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 20 Sep 2023 09:18:52 +0200 Subject: [PATCH 071/257] fixed wrong type --- mission/controller/PowerController.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mission/controller/PowerController.h b/mission/controller/PowerController.h index cd984840..bfb28b52 100644 --- a/mission/controller/PowerController.h +++ b/mission/controller/PowerController.h @@ -105,7 +105,7 @@ class PowerController : public ExtendedControllerBase, public ReceivesParameterM float coulombCounterCharge = 0; // [mC] float coulombCounterChargeUpperThreshold = 0.0; // [mC] - static constexpr float INVALID_TOTAL_BATTERY_CURRENT = 0; + static constexpr int16_t INVALID_TOTAL_BATTERY_CURRENT = 0; static constexpr float INVALID_SOC = -1; // HK Datasets for Calculation From 5036836b442cd309fc8079cd445e8ab9a3bd056a Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 20 Sep 2023 09:19:09 +0200 Subject: [PATCH 072/257] use bpx voltage instead --- mission/controller/PowerController.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mission/controller/PowerController.cpp b/mission/controller/PowerController.cpp index c87da007..c4bd6ae6 100644 --- a/mission/controller/PowerController.cpp +++ b/mission/controller/PowerController.cpp @@ -211,7 +211,7 @@ void PowerController::watchStateOfCharge() { } ReturnValue_t PowerController::calculateOpenCircuitVoltageCharge() { - float vBatCorrected = p60CoreHk.batteryVoltage.value - iBat * batteryInternalResistance; + float vBatCorrected = bpxBatteryHk.battVoltage.value - iBat * batteryInternalResistance; uint8_t lookUpTableIdx = LOOK_UP_TABLE_MAX_IDX; ReturnValue_t result = lookUpTableOcvIdxFinder(vBatCorrected, lookUpTableIdx); if (result != returnvalue::OK) { @@ -231,7 +231,7 @@ ReturnValue_t PowerController::calculateCoulombCounterCharge() { return returnvalue::FAILED; } if ((not pwrCtrlCoreHk.coulombCounterCharge.isValid()) or - (p60CoreHk.batteryVoltage.value > coulombCounterVoltageUpperThreshold and + (bpxBatteryHk.battVoltage.value > coulombCounterVoltageUpperThreshold and pwrCtrlCoreHk.coulombCounterCharge.value >= coulombCounterChargeUpperThreshold)) { coulombCounterCharge = openCircuitVoltageCharge; } else { From 6b9e19198888d2f02710c34fea736a277853e38c Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 22 Sep 2023 10:08:04 +0200 Subject: [PATCH 073/257] fixed voltage bugs --- mission/controller/PowerController.cpp | 5 +++-- mission/controller/PowerController.h | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/mission/controller/PowerController.cpp b/mission/controller/PowerController.cpp index c4bd6ae6..475c026b 100644 --- a/mission/controller/PowerController.cpp +++ b/mission/controller/PowerController.cpp @@ -211,7 +211,8 @@ void PowerController::watchStateOfCharge() { } ReturnValue_t PowerController::calculateOpenCircuitVoltageCharge() { - float vBatCorrected = bpxBatteryHk.battVoltage.value - iBat * batteryInternalResistance; + float vBatCorrected = + (bpxBatteryHk.battVoltage.value - iBat * batteryInternalResistance) * MILLIVOLT2VOLT; uint8_t lookUpTableIdx = LOOK_UP_TABLE_MAX_IDX; ReturnValue_t result = lookUpTableOcvIdxFinder(vBatCorrected, lookUpTableIdx); if (result != returnvalue::OK) { @@ -267,7 +268,7 @@ float PowerController::linearInterpolation(float x, float x0, float x1, float y0 } ReturnValue_t PowerController::lookUpTableOcvIdxFinder(float voltage, uint8_t &idx) { - if (voltage >= lookUpTableOcv[1][100]) { + if (voltage >= lookUpTableOcv[1][99]) { triggerEvent(power::VOLTAGE_OUT_OF_BOUNDS, 0); sif::error << "Power Controller::Voltage is too high" << std::endl; return returnvalue::FAILED; diff --git a/mission/controller/PowerController.h b/mission/controller/PowerController.h index bfb28b52..c26e9382 100644 --- a/mission/controller/PowerController.h +++ b/mission/controller/PowerController.h @@ -105,6 +105,8 @@ class PowerController : public ExtendedControllerBase, public ReceivesParameterM float coulombCounterCharge = 0; // [mC] float coulombCounterChargeUpperThreshold = 0.0; // [mC] + static constexpr float MILLIVOLT2VOLT = 1e-3; + static constexpr int16_t INVALID_TOTAL_BATTERY_CURRENT = 0; static constexpr float INVALID_SOC = -1; From 0ad3f508a905f5579983c228d01e3c2a5472ae77 Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 22 Sep 2023 16:07:26 +0200 Subject: [PATCH 074/257] further fixes --- mission/controller/PowerController.cpp | 5 +++-- mission/controller/PowerController.h | 13 +++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/mission/controller/PowerController.cpp b/mission/controller/PowerController.cpp index 475c026b..c47e2c21 100644 --- a/mission/controller/PowerController.cpp +++ b/mission/controller/PowerController.cpp @@ -212,7 +212,7 @@ void PowerController::watchStateOfCharge() { ReturnValue_t PowerController::calculateOpenCircuitVoltageCharge() { float vBatCorrected = - (bpxBatteryHk.battVoltage.value - iBat * batteryInternalResistance) * MILLIVOLT2VOLT; + (bpxBatteryHk.battVoltage.value - iBat * batteryInternalResistance) * CONVERT_FROM_MILLI; uint8_t lookUpTableIdx = LOOK_UP_TABLE_MAX_IDX; ReturnValue_t result = lookUpTableOcvIdxFinder(vBatCorrected, lookUpTableIdx); if (result != returnvalue::OK) { @@ -236,7 +236,8 @@ ReturnValue_t PowerController::calculateCoulombCounterCharge() { pwrCtrlCoreHk.coulombCounterCharge.value >= coulombCounterChargeUpperThreshold)) { coulombCounterCharge = openCircuitVoltageCharge; } else { - coulombCounterCharge = pwrCtrlCoreHk.coulombCounterCharge.value + iBat * timeDiff; + coulombCounterCharge = + coulombCounterCharge + iBat * CONVERT_FROM_MILLI * timeDiff * SECONDS_TO_HOURS; } return returnvalue::OK; } diff --git a/mission/controller/PowerController.h b/mission/controller/PowerController.h index c26e9382..fbd2709b 100644 --- a/mission/controller/PowerController.h +++ b/mission/controller/PowerController.h @@ -58,7 +58,7 @@ class PowerController : public ExtendedControllerBase, public ReceivesParameterM float coulombCounterVoltageUpperThreshold = 16.2e3; // [mV] double maxAllowedTimeDiff = 0.5; // [s] - // OCV Look-up-Table + // OCV Look-up-Table {[Ah],[V]} static constexpr uint8_t LOOK_UP_TABLE_MAX_IDX = 99; float lookUpTableOcv[2][100] = { {0.00000000e+00, 3.16227766e-04, 4.52809661e-04, 6.48382625e-04, 9.28425483e-04, @@ -100,12 +100,13 @@ class PowerController : public ExtendedControllerBase, public ReceivesParameterM // Variables timeval now; timeval oldTime; - int16_t iBat = 0.0; // [mA] - float openCircuitVoltageCharge = 0.0; // [mC] - float coulombCounterCharge = 0; // [mC] - float coulombCounterChargeUpperThreshold = 0.0; // [mC] + int16_t iBat = 0; // [mA] + float openCircuitVoltageCharge = 0.0; // [Ah] + float coulombCounterCharge = 0.0; // [Ah] + float coulombCounterChargeUpperThreshold = 0.0; // [Ah] - static constexpr float MILLIVOLT2VOLT = 1e-3; + static constexpr float CONVERT_FROM_MILLI = 1e-3; + static constexpr float SECONDS_TO_HOURS = 1. / (60. * 60.); static constexpr int16_t INVALID_TOTAL_BATTERY_CURRENT = 0; static constexpr float INVALID_SOC = -1; From 35fd2c72d8e602a9c57ae091d27f7df9b63ed429 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 25 Sep 2023 15:17:09 +0200 Subject: [PATCH 075/257] slightly better printout --- linux/payload/PlocMpsocHandler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux/payload/PlocMpsocHandler.cpp b/linux/payload/PlocMpsocHandler.cpp index cdf59c52..4cae65dd 100644 --- a/linux/payload/PlocMpsocHandler.cpp +++ b/linux/payload/PlocMpsocHandler.cpp @@ -1271,8 +1271,8 @@ void PlocMpsocHandler::dataReceived(ActionId_t actionId, const uint8_t* data, ui void PlocMpsocHandler::completionSuccessfulReceived(ActionId_t actionId) { if (actionId != supv::EXE_REPORT) { - sif::debug << "PlocMPSoCHandler::completionSuccessfulReceived: Did not expect this action " - << "ID" << std::endl; + sif::warning << "PlocMPSoCHandler::completionSuccessfulReceived: Did not expect this action " + << "ID " << actionId << std::endl; return; } switch (powerState) { From 0d0a98220a86f37ad543f86091eac01ed4500aad Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 25 Sep 2023 16:36:35 +0200 Subject: [PATCH 076/257] improve MPSoC boot and shutdown process --- linux/payload/PlocMpsocHandler.cpp | 169 ++++++++++++++---------- linux/payload/PlocMpsocHandler.h | 14 +- linux/payload/PlocSupervisorHandler.cpp | 6 + linux/payload/plocSupvDefs.h | 3 + 4 files changed, 120 insertions(+), 72 deletions(-) diff --git a/linux/payload/PlocMpsocHandler.cpp b/linux/payload/PlocMpsocHandler.cpp index 4cae65dd..47e63d57 100644 --- a/linux/payload/PlocMpsocHandler.cpp +++ b/linux/payload/PlocMpsocHandler.cpp @@ -188,72 +188,27 @@ void PlocMpsocHandler::doStartUp() { startupState = StartupState::HW_INIT; } if (startupState == StartupState::HW_INIT) { -#ifdef XIPHOS_Q7S -#if not OBSW_MPSOC_JTAG_BOOT == 1 - switch (powerState) { - case PowerState::OFF: - commandActionHelper.commandAction(supervisorHandler, supv::START_MPSOC); - powerState = PowerState::BOOTING; - return; - case PowerState::ON: - uartIsolatorSwitch.pullHigh(); - startupState = StartupState::WAIT_CYCLES; - break; - default: - return; - } -#else - uartIsolatorSwitch.pullHigh(); - startupState = StartupState::WAIT_CYCLES; -#endif /* not MSPOC_JTAG_BOOT == 1 */ -#else - startupState = StartupState::WAIT_CYCLES; - powerState = PowerState::ON; -#endif /* XIPHOS_Q7S */ - } - // Need to wait, MPSoC still not booted properly, requesting HK without these wait cycles does - // not work, no replies.. - if (startupState == StartupState::WAIT_CYCLES) { - waitCycles++; - if (waitCycles >= 8) { + if (handleHwStartup()) { startupState = StartupState::DONE; - waitCycles = 0; } } if (startupState == StartupState::DONE) { setMode(_MODE_TO_ON); hkReport.setReportingEnabled(true); + powerState = PowerState::IDLE; startupState = StartupState::IDLE; } } void PlocMpsocHandler::doShutDown() { -#ifdef XIPHOS_Q7S -#if not OBSW_MPSOC_JTAG_BOOT == 1 - if (powerState == PowerState::ON) { - uartIsolatorSwitch.pullLow(); - commandActionHelper.commandAction(supervisorHandler, supv::SHUTDOWN_MPSOC); - powerState = PowerState::SHUTDOWN; - return; - } else if (powerState == PowerState::SHUTDOWN) { - // Wait till power state is OFF. - return; + if (handleHwShutdown()) { + hkReport.setReportingEnabled(false); + setMode(_MODE_POWER_DOWN); + commandIsPending = false; + sequenceCount = 0; + powerState = PowerState::IDLE; + startupState = StartupState::IDLE; } -#else - uartIsolatorSwitch.pullLow(); - powerState = PowerState::OFF; -#endif -#endif - - if (specialComHelper != nullptr) { - specialComHelper->stopProcess(); - } - hkReport.setReportingEnabled(false); - setMode(_MODE_POWER_DOWN); - commandIsPending = false; - sequenceCount = 0; - specialComHelperExecuting = false; - startupState = StartupState::IDLE; } ReturnValue_t PlocMpsocHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) { @@ -1247,15 +1202,11 @@ void PlocMpsocHandler::stepFailedReceived(ActionId_t actionId, uint8_t step, switch (actionId) { case supv::START_MPSOC: { sif::warning << "PlocMPSoCHandler::stepFailedReceived: Failed to start MPSoC" << std::endl; - // This usually happens when the supervisor handler is in off mode - powerState = PowerState::OFF; - setMode(MODE_OFF); break; } case supv::SHUTDOWN_MPSOC: { triggerEvent(MPSOC_SHUTDOWN_FAILED); sif::warning << "PlocMPSoCHandler::stepFailedReceived: Failed to shutdown MPSoC" << std::endl; - powerState = PowerState::OFF; break; } default: @@ -1263,6 +1214,7 @@ void PlocMpsocHandler::stepFailedReceived(ActionId_t actionId, uint8_t step, << std::endl; break; } + powerState = PowerState::SUPV_FAILED; } void PlocMpsocHandler::dataReceived(ActionId_t actionId, const uint8_t* data, uint32_t size) { @@ -1272,16 +1224,14 @@ void PlocMpsocHandler::dataReceived(ActionId_t actionId, const uint8_t* data, ui void PlocMpsocHandler::completionSuccessfulReceived(ActionId_t actionId) { if (actionId != supv::EXE_REPORT) { sif::warning << "PlocMPSoCHandler::completionSuccessfulReceived: Did not expect this action " - << "ID " << actionId << std::endl; + << "ID " << actionId << std::endl; return; } switch (powerState) { - case PowerState::BOOTING: { - powerState = PowerState::ON; - break; - } - case PowerState::SHUTDOWN: { - powerState = PowerState::OFF; + case PowerState::PENDING_STARTUP: + case PowerState::PENDING_SHUTDOWN: { + // sif::debug << "power switching done" << std::endl; + powerState = PowerState::DONE; break; } default: { @@ -1409,6 +1359,88 @@ void PlocMpsocHandler::disableExeReportReply() { info->command->second.expectedReplies = 0; } +void PlocMpsocHandler::stopSpecialComHelper() { + if (specialComHelper != nullptr) { + specialComHelper->stopProcess(); + } + specialComHelperExecuting = false; +} + +bool PlocMpsocHandler::handleHwStartup() { +#if OBSW_MPSOC_JTAG_BOOT == 1 + uartIsolatorSwitch.pullHigh(); + startupState = StartupState::WAIT_CYCLES; + return true; +#endif + if (powerState == PowerState::IDLE) { + if (supv::SUPV_ON) { + commandActionHelper.commandAction(supervisorHandler, supv::START_MPSOC); + supvTransitionCd.resetTimer(); + powerState = PowerState::PENDING_STARTUP; + } else { + triggerEvent(SUPV_NOT_ON, 1); + // Set back to OFF for now, failing the transition. + setMode(MODE_OFF); + } + } + if (powerState == PowerState::SUPV_FAILED) { + setMode(MODE_OFF); + powerState = PowerState::IDLE; + return false; + } + if (powerState == PowerState::PENDING_STARTUP) { + if (supvTransitionCd.hasTimedOut()) { + // Process with transition nonetheless.. + triggerEvent(SUPV_REPLY_TIMEOUT); + powerState = PowerState::DONE; + } else { + return false; + } + } + if (powerState == PowerState::DONE) { + if (not !supvTransitionCd.hasTimedOut()) { + // Wait a bit for the MPSoC to fully boot. We re-use the SUPV transition countdown + // for this. + return false; + } + uartIsolatorSwitch.pullHigh(); + powerState = PowerState::IDLE; + } + return true; +} + +bool PlocMpsocHandler::handleHwShutdown() { + stopSpecialComHelper(); + uartIsolatorSwitch.pullLow(); +#if OBSW_MPSOC_JTAG_BOOT == 1 + powerState = PowerState::DONE; + return true; +#endif + + if (powerState == PowerState::IDLE) { + if (supv::SUPV_ON) { + commandActionHelper.commandAction(supervisorHandler, supv::SHUTDOWN_MPSOC); + supvTransitionCd.resetTimer(); + powerState = PowerState::PENDING_SHUTDOWN; + } else { + triggerEvent(SUPV_NOT_ON, 0); + powerState = PowerState::DONE; + } + } + if (powerState == PowerState::PENDING_SHUTDOWN) { + if (supvTransitionCd.hasTimedOut()) { + powerState = PowerState::DONE; + // Process with transition nonetheless.. + triggerEvent(SUPV_REPLY_TIMEOUT); + return true; + } else { + // Wait till power state is OFF. + return false; + } + } + return true; +} + void PlocMpsocHandler::handleActionCommandFailure(ActionId_t actionId) { switch (actionId) { case supv::ACK_REPORT: @@ -1420,25 +1452,24 @@ void PlocMpsocHandler::handleActionCommandFailure(ActionId_t actionId) { return; } switch (powerState) { - case PowerState::BOOTING: { + case PowerState::PENDING_STARTUP: { sif::info << "PlocMPSoCHandler::handleActionCommandFailure: MPSoC boot command failed" << std::endl; // This is commonly the case when the MPSoC is already operational. Thus the power state is // set to on here - powerState = PowerState::ON; break; } - case PowerState::SHUTDOWN: { + case PowerState::PENDING_SHUTDOWN: { // FDIR will intercept event and switch PLOC power off triggerEvent(MPSOC_SHUTDOWN_FAILED); sif::warning << "PlocMPSoCHandler::handleActionCommandFailure: Failed to shutdown MPSoC" << std::endl; - powerState = PowerState::OFF; break; } default: break; } + powerState = PowerState::SUPV_FAILED; return; } diff --git a/linux/payload/PlocMpsocHandler.h b/linux/payload/PlocMpsocHandler.h index a82623b0..2e84fc7c 100644 --- a/linux/payload/PlocMpsocHandler.h +++ b/linux/payload/PlocMpsocHandler.h @@ -103,11 +103,16 @@ class PlocMpsocHandler : public DeviceHandlerBase, public CommandsActionsIF { //! [EXPORT] : [COMMENT] Supervisor fails to shutdown MPSoC. Requires to power off the PLOC and //! thus also to shutdown the supervisor. static const Event MPSOC_SHUTDOWN_FAILED = MAKE_EVENT(6, severity::HIGH); + //! [EXPORT] : [COMMENT] SUPV not on for boot or shutdown process. P1: 0 for OFF transition, 1 for + //! ON transition. + static constexpr Event SUPV_NOT_ON = event::makeEvent(SUBSYSTEM_ID, 6, severity::LOW); + static constexpr Event SUPV_REPLY_TIMEOUT = event::makeEvent(SUBSYSTEM_ID, 7, severity::LOW); static const uint16_t APID_MASK = 0x7FF; static const uint16_t PACKET_SEQUENCE_COUNT_MASK = 0x3FFF; mpsoc::HkReport hkReport; + Countdown supvTransitionCd = Countdown(3000); MessageQueueIF* eventQueue = nullptr; MessageQueueIF* commandActionHelperQueue = nullptr; @@ -188,10 +193,10 @@ class PlocMpsocHandler : public DeviceHandlerBase, public CommandsActionsIF { TelemetryBuffer tmBuffer; uint32_t waitCycles = 0; - enum class StartupState { IDLE, HW_INIT, WAIT_CYCLES, DONE } startupState = StartupState::IDLE; - enum class PowerState { OFF, BOOTING, SHUTDOWN, ON }; + enum class StartupState { IDLE, HW_INIT, DONE } startupState = StartupState::IDLE; + enum class PowerState { IDLE, PENDING_STARTUP, PENDING_SHUTDOWN, SUPV_FAILED, DONE }; - PowerState powerState = PowerState::OFF; + PowerState powerState = PowerState::IDLE; /** * @brief Handles events received from the PLOC MPSoC helper @@ -299,6 +304,9 @@ class PlocMpsocHandler : public DeviceHandlerBase, public CommandsActionsIF { ReturnValue_t prepareTcModeReplay(); void cmdDoneHandler(bool success, ReturnValue_t result); + bool handleHwStartup(); + bool handleHwShutdown(); + void stopSpecialComHelper(); void handleActionCommandFailure(ActionId_t actionId); }; diff --git a/linux/payload/PlocSupervisorHandler.cpp b/linux/payload/PlocSupervisorHandler.cpp index d4a3a1c0..9e0d43d7 100644 --- a/linux/payload/PlocSupervisorHandler.cpp +++ b/linux/payload/PlocSupervisorHandler.cpp @@ -19,6 +19,8 @@ using namespace supv; using namespace returnvalue; +std::atomic_bool supv::SUPV_ON = false; + PlocSupervisorHandler::PlocSupervisorHandler(object_id_t objectId, CookieIF* comCookie, Gpio uartIsolatorSwitch, power::Switch_t powerSwitch, PlocSupvUartManager& supvHelper) @@ -156,6 +158,7 @@ void PlocSupervisorHandler::doStartUp() { } if (startupState == StartupState::ON) { hkset.setReportingEnabled(true); + supv::SUPV_ON = true; setMode(_MODE_TO_ON); } } @@ -169,6 +172,7 @@ void PlocSupervisorHandler::doShutDown() { nextReplyId = supv::NONE; uartManager.stop(); uartIsolatorSwitch.pullLow(); + supv::SUPV_ON = false; startupState = StartupState::OFF; } @@ -202,11 +206,13 @@ ReturnValue_t PlocSupervisorHandler::buildCommandFromCommand(DeviceCommandId_t d break; } case START_MPSOC: { + sif::info << "PLOC SUPV: Starting MPSoC" << std::endl; prepareEmptyCmd(Apid::BOOT_MAN, static_cast(tc::BootManId::START_MPSOC)); result = returnvalue::OK; break; } case SHUTDOWN_MPSOC: { + sif::info << "PLOC SUPV: Shutting down MPSoC" << std::endl; prepareEmptyCmd(Apid::BOOT_MAN, static_cast(tc::BootManId::SHUTDOWN_MPSOC)); result = returnvalue::OK; break; diff --git a/linux/payload/plocSupvDefs.h b/linux/payload/plocSupvDefs.h index 907bfe0c..115cfe60 100644 --- a/linux/payload/plocSupvDefs.h +++ b/linux/payload/plocSupvDefs.h @@ -10,12 +10,15 @@ #include #include +#include #include #include "eive/resultClassIds.h" namespace supv { +extern std::atomic_bool SUPV_ON; + namespace result { static const uint8_t INTERFACE_ID = CLASS_ID::SUPV_RETURN_VALUES_IF; From a2246f9d3d7964c6721b7575d08113eb89f03c56 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 25 Sep 2023 16:44:10 +0200 Subject: [PATCH 077/257] this is odd --- linux/payload/PlocMpsocHandler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux/payload/PlocMpsocHandler.cpp b/linux/payload/PlocMpsocHandler.cpp index 47e63d57..5c4d7f07 100644 --- a/linux/payload/PlocMpsocHandler.cpp +++ b/linux/payload/PlocMpsocHandler.cpp @@ -1223,14 +1223,14 @@ void PlocMpsocHandler::dataReceived(ActionId_t actionId, const uint8_t* data, ui void PlocMpsocHandler::completionSuccessfulReceived(ActionId_t actionId) { if (actionId != supv::EXE_REPORT) { - sif::warning << "PlocMPSoCHandler::completionSuccessfulReceived: Did not expect this action " + sif::warning << "PlocMPSoCHandler::completionSuccessfulReceived: Did not expect the action " << "ID " << actionId << std::endl; return; } switch (powerState) { case PowerState::PENDING_STARTUP: case PowerState::PENDING_SHUTDOWN: { - // sif::debug << "power switching done" << std::endl; + sif::debug << "power switching done" << std::endl; powerState = PowerState::DONE; break; } From 75f08175f65c93b5f1e4b0c00ddd200bce5e62e1 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 25 Sep 2023 17:10:13 +0200 Subject: [PATCH 078/257] more debugging necessary here --- linux/payload/PlocMpsocHandler.cpp | 20 ++++++++++++-------- linux/payload/PlocMpsocHandler.h | 1 + 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/linux/payload/PlocMpsocHandler.cpp b/linux/payload/PlocMpsocHandler.cpp index 5c4d7f07..b8e8afe9 100644 --- a/linux/payload/PlocMpsocHandler.cpp +++ b/linux/payload/PlocMpsocHandler.cpp @@ -1222,15 +1222,19 @@ void PlocMpsocHandler::dataReceived(ActionId_t actionId, const uint8_t* data, ui } void PlocMpsocHandler::completionSuccessfulReceived(ActionId_t actionId) { + sif::debug << "recv completion of action " << actionId << std::endl; if (actionId != supv::EXE_REPORT) { sif::warning << "PlocMPSoCHandler::completionSuccessfulReceived: Did not expect the action " << "ID " << actionId << std::endl; return; } switch (powerState) { - case PowerState::PENDING_STARTUP: + case PowerState::PENDING_STARTUP: { + mpsocBootTransitionCd.resetTimer(); + powerState = PowerState::DONE; + break; + } case PowerState::PENDING_SHUTDOWN: { - sif::debug << "power switching done" << std::endl; powerState = PowerState::DONE; break; } @@ -1398,13 +1402,13 @@ bool PlocMpsocHandler::handleHwStartup() { } } if (powerState == PowerState::DONE) { - if (not !supvTransitionCd.hasTimedOut()) { - // Wait a bit for the MPSoC to fully boot. We re-use the SUPV transition countdown - // for this. + if (mpsocBootTransitionCd.hasTimedOut()) { + // Wait a bit for the MPSoC to fully boot. + uartIsolatorSwitch.pullHigh(); + powerState = PowerState::IDLE; + } else { return false; } - uartIsolatorSwitch.pullHigh(); - powerState = PowerState::IDLE; } return true; } @@ -1447,7 +1451,7 @@ void PlocMpsocHandler::handleActionCommandFailure(ActionId_t actionId) { case supv::EXE_REPORT: break; default: - sif::debug << "PlocMPSoCHandler::handleActionCommandFailure: Did not expect this action ID " + sif::debug << "PlocMPSoCHandler::handleActionCommandFailure: Did not expect the action ID " << std::endl; return; } diff --git a/linux/payload/PlocMpsocHandler.h b/linux/payload/PlocMpsocHandler.h index 2e84fc7c..8e654bab 100644 --- a/linux/payload/PlocMpsocHandler.h +++ b/linux/payload/PlocMpsocHandler.h @@ -112,6 +112,7 @@ class PlocMpsocHandler : public DeviceHandlerBase, public CommandsActionsIF { static const uint16_t PACKET_SEQUENCE_COUNT_MASK = 0x3FFF; mpsoc::HkReport hkReport; + Countdown mpsocBootTransitionCd = Countdown(5000); Countdown supvTransitionCd = Countdown(3000); MessageQueueIF* eventQueue = nullptr; From ff7e4753918bcd6ba08b6c661ca09d55874827ef Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 25 Sep 2023 17:21:28 +0200 Subject: [PATCH 079/257] this appears to be the boot time --- linux/payload/PlocMpsocHandler.cpp | 10 +++++++--- linux/payload/PlocMpsocHandler.h | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/linux/payload/PlocMpsocHandler.cpp b/linux/payload/PlocMpsocHandler.cpp index b8e8afe9..21c1ed62 100644 --- a/linux/payload/PlocMpsocHandler.cpp +++ b/linux/payload/PlocMpsocHandler.cpp @@ -1222,9 +1222,13 @@ void PlocMpsocHandler::dataReceived(ActionId_t actionId, const uint8_t* data, ui } void PlocMpsocHandler::completionSuccessfulReceived(ActionId_t actionId) { - sif::debug << "recv completion of action " << actionId << std::endl; - if (actionId != supv::EXE_REPORT) { - sif::warning << "PlocMPSoCHandler::completionSuccessfulReceived: Did not expect the action " + if (actionId == supv::ACK_REPORT) { + sif::warning + << "PlocMpsocHandler::completionSuccessfulReceived: Only received ACK report. Consider " + "increasing the MPSoC boot timer." + << std::endl; + } else if (actionId != supv::EXE_REPORT) { + sif::warning << "PlocMpsocHandler::completionSuccessfulReceived: Did not expect the action " << "ID " << actionId << std::endl; return; } diff --git a/linux/payload/PlocMpsocHandler.h b/linux/payload/PlocMpsocHandler.h index 8e654bab..0a8a45f1 100644 --- a/linux/payload/PlocMpsocHandler.h +++ b/linux/payload/PlocMpsocHandler.h @@ -112,7 +112,7 @@ class PlocMpsocHandler : public DeviceHandlerBase, public CommandsActionsIF { static const uint16_t PACKET_SEQUENCE_COUNT_MASK = 0x3FFF; mpsoc::HkReport hkReport; - Countdown mpsocBootTransitionCd = Countdown(5000); + Countdown mpsocBootTransitionCd = Countdown(6000); Countdown supvTransitionCd = Countdown(3000); MessageQueueIF* eventQueue = nullptr; From 244d59e6c08b6bd156fdebb51b88a92a6d0cb806 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 25 Sep 2023 17:42:26 +0200 Subject: [PATCH 080/257] bump tmtc --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index d23cc683..783bdd29 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit d23cc6834ad0895c230d2378b0c8d9ba4f374f8d +Subproject commit 783bdd297a931a96c8b077ec2c2456a203b23ffc From 624d45446401b91b18ee4628f71af06ed14f90a0 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 25 Sep 2023 17:43:54 +0200 Subject: [PATCH 081/257] delete wait cycles member --- linux/payload/PlocMpsocHandler.h | 1 - 1 file changed, 1 deletion(-) diff --git a/linux/payload/PlocMpsocHandler.h b/linux/payload/PlocMpsocHandler.h index 0a8a45f1..2d6646e5 100644 --- a/linux/payload/PlocMpsocHandler.h +++ b/linux/payload/PlocMpsocHandler.h @@ -192,7 +192,6 @@ class PlocMpsocHandler : public DeviceHandlerBase, public CommandsActionsIF { size_t foundPacketLen = 0; TelemetryBuffer tmBuffer; - uint32_t waitCycles = 0; enum class StartupState { IDLE, HW_INIT, DONE } startupState = StartupState::IDLE; enum class PowerState { IDLE, PENDING_STARTUP, PENDING_SHUTDOWN, SUPV_FAILED, DONE }; From 08dbab9daaa06dec7db04f9f39cbabea5ce3b9de Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 25 Sep 2023 17:48:30 +0200 Subject: [PATCH 082/257] another missing small tweak --- linux/payload/PlocMpsocHandler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux/payload/PlocMpsocHandler.cpp b/linux/payload/PlocMpsocHandler.cpp index 21c1ed62..2421fcaa 100644 --- a/linux/payload/PlocMpsocHandler.cpp +++ b/linux/payload/PlocMpsocHandler.cpp @@ -1455,8 +1455,8 @@ void PlocMpsocHandler::handleActionCommandFailure(ActionId_t actionId) { case supv::EXE_REPORT: break; default: - sif::debug << "PlocMPSoCHandler::handleActionCommandFailure: Did not expect the action ID " - << std::endl; + sif::warning << "PlocMPSoCHandler::handleActionCommandFailure: Did not expect the action ID " + << actionId << std::endl; return; } switch (powerState) { From b3233abde9f3dc1516d991954ec31f6a3dd20ee3 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 25 Sep 2023 17:50:13 +0200 Subject: [PATCH 083/257] update tmtc and gen files --- bsp_hosted/fsfwconfig/events/translateEvents.cpp | 10 ++++++++-- bsp_hosted/fsfwconfig/objects/translateObjects.cpp | 2 +- generators/bsp_hosted_events.csv | 2 ++ generators/bsp_q7s_events.csv | 2 ++ generators/events/translateEvents.cpp | 10 ++++++++-- generators/objects/translateObjects.cpp | 2 +- linux/fsfwconfig/events/translateEvents.cpp | 10 ++++++++-- linux/fsfwconfig/objects/translateObjects.cpp | 2 +- linux/payload/PlocMpsocHandler.h | 4 ++-- tmtc | 2 +- 10 files changed, 34 insertions(+), 12 deletions(-) diff --git a/bsp_hosted/fsfwconfig/events/translateEvents.cpp b/bsp_hosted/fsfwconfig/events/translateEvents.cpp index 3322209d..d7a9d6aa 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. + * @brief Auto-generated event translation file. Contains 308 translations. * @details - * Generated on: 2023-09-12 10:05:17 + * Generated on: 2023-09-25 17:49:54 */ #include "translateEvents.h" @@ -128,6 +128,8 @@ const char *EXE_FAILURE_STRING = "EXE_FAILURE"; const char *MPSOC_HANDLER_CRC_FAILURE_STRING = "MPSOC_HANDLER_CRC_FAILURE"; const char *MPSOC_HANDLER_SEQUENCE_COUNT_MISMATCH_STRING = "MPSOC_HANDLER_SEQUENCE_COUNT_MISMATCH"; const char *MPSOC_SHUTDOWN_FAILED_STRING = "MPSOC_SHUTDOWN_FAILED"; +const char *SUPV_NOT_ON_STRING = "SUPV_NOT_ON"; +const char *SUPV_REPLY_TIMEOUT_STRING = "SUPV_REPLY_TIMEOUT"; const char *SELF_TEST_I2C_FAILURE_STRING = "SELF_TEST_I2C_FAILURE"; const char *SELF_TEST_SPI_FAILURE_STRING = "SELF_TEST_SPI_FAILURE"; const char *SELF_TEST_ADC_FAILURE_STRING = "SELF_TEST_ADC_FAILURE"; @@ -560,6 +562,10 @@ const char *translateEvents(Event event) { return MPSOC_HANDLER_SEQUENCE_COUNT_MISMATCH_STRING; case (11606): return MPSOC_SHUTDOWN_FAILED_STRING; + case (11607): + return SUPV_NOT_ON_STRING; + case (11608): + return SUPV_REPLY_TIMEOUT_STRING; case (11701): return SELF_TEST_I2C_FAILURE_STRING; case (11702): diff --git a/bsp_hosted/fsfwconfig/objects/translateObjects.cpp b/bsp_hosted/fsfwconfig/objects/translateObjects.cpp index 988be097..ab0c8cec 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-12 10:05:17 + * Generated on: 2023-09-25 17:49:54 */ #include "translateObjects.h" diff --git a/generators/bsp_hosted_events.csv b/generators/bsp_hosted_events.csv index 08626f32..4d762f0e 100644 --- a/generators/bsp_hosted_events.csv +++ b/generators/bsp_hosted_events.csv @@ -122,6 +122,8 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 11604;0x2d54;MPSOC_HANDLER_CRC_FAILURE;LOW;PLOC reply has invalid crc;linux/payload/PlocMpsocHandler.h 11605;0x2d55;MPSOC_HANDLER_SEQUENCE_COUNT_MISMATCH;LOW;Packet sequence count in received space packet does not match expected count P1: Expected sequence count P2: Received sequence count;linux/payload/PlocMpsocHandler.h 11606;0x2d56;MPSOC_SHUTDOWN_FAILED;HIGH;Supervisor fails to shutdown MPSoC. Requires to power off the PLOC and thus also to shutdown the supervisor.;linux/payload/PlocMpsocHandler.h +11607;0x2d57;SUPV_NOT_ON;LOW;SUPV not on for boot or shutdown process. P1: 0 for OFF transition, 1 for ON transition.;linux/payload/PlocMpsocHandler.h +11608;0x2d58;SUPV_REPLY_TIMEOUT;LOW;No description;linux/payload/PlocMpsocHandler.h 11701;0x2db5;SELF_TEST_I2C_FAILURE;LOW;Get self test result returns I2C failure P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/acs/ImtqHandler.h 11702;0x2db6;SELF_TEST_SPI_FAILURE;LOW;Get self test result returns SPI failure. This concerns the MTM connectivity. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/acs/ImtqHandler.h 11703;0x2db7;SELF_TEST_ADC_FAILURE;LOW;Get self test result returns failure in measurement of current and temperature. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/acs/ImtqHandler.h diff --git a/generators/bsp_q7s_events.csv b/generators/bsp_q7s_events.csv index 08626f32..4d762f0e 100644 --- a/generators/bsp_q7s_events.csv +++ b/generators/bsp_q7s_events.csv @@ -122,6 +122,8 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 11604;0x2d54;MPSOC_HANDLER_CRC_FAILURE;LOW;PLOC reply has invalid crc;linux/payload/PlocMpsocHandler.h 11605;0x2d55;MPSOC_HANDLER_SEQUENCE_COUNT_MISMATCH;LOW;Packet sequence count in received space packet does not match expected count P1: Expected sequence count P2: Received sequence count;linux/payload/PlocMpsocHandler.h 11606;0x2d56;MPSOC_SHUTDOWN_FAILED;HIGH;Supervisor fails to shutdown MPSoC. Requires to power off the PLOC and thus also to shutdown the supervisor.;linux/payload/PlocMpsocHandler.h +11607;0x2d57;SUPV_NOT_ON;LOW;SUPV not on for boot or shutdown process. P1: 0 for OFF transition, 1 for ON transition.;linux/payload/PlocMpsocHandler.h +11608;0x2d58;SUPV_REPLY_TIMEOUT;LOW;No description;linux/payload/PlocMpsocHandler.h 11701;0x2db5;SELF_TEST_I2C_FAILURE;LOW;Get self test result returns I2C failure P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/acs/ImtqHandler.h 11702;0x2db6;SELF_TEST_SPI_FAILURE;LOW;Get self test result returns SPI failure. This concerns the MTM connectivity. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/acs/ImtqHandler.h 11703;0x2db7;SELF_TEST_ADC_FAILURE;LOW;Get self test result returns failure in measurement of current and temperature. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/acs/ImtqHandler.h diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index 3322209d..d7a9d6aa 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 306 translations. + * @brief Auto-generated event translation file. Contains 308 translations. * @details - * Generated on: 2023-09-12 10:05:17 + * Generated on: 2023-09-25 17:49:54 */ #include "translateEvents.h" @@ -128,6 +128,8 @@ const char *EXE_FAILURE_STRING = "EXE_FAILURE"; const char *MPSOC_HANDLER_CRC_FAILURE_STRING = "MPSOC_HANDLER_CRC_FAILURE"; const char *MPSOC_HANDLER_SEQUENCE_COUNT_MISMATCH_STRING = "MPSOC_HANDLER_SEQUENCE_COUNT_MISMATCH"; const char *MPSOC_SHUTDOWN_FAILED_STRING = "MPSOC_SHUTDOWN_FAILED"; +const char *SUPV_NOT_ON_STRING = "SUPV_NOT_ON"; +const char *SUPV_REPLY_TIMEOUT_STRING = "SUPV_REPLY_TIMEOUT"; const char *SELF_TEST_I2C_FAILURE_STRING = "SELF_TEST_I2C_FAILURE"; const char *SELF_TEST_SPI_FAILURE_STRING = "SELF_TEST_SPI_FAILURE"; const char *SELF_TEST_ADC_FAILURE_STRING = "SELF_TEST_ADC_FAILURE"; @@ -560,6 +562,10 @@ const char *translateEvents(Event event) { return MPSOC_HANDLER_SEQUENCE_COUNT_MISMATCH_STRING; case (11606): return MPSOC_SHUTDOWN_FAILED_STRING; + case (11607): + return SUPV_NOT_ON_STRING; + case (11608): + return SUPV_REPLY_TIMEOUT_STRING; case (11701): return SELF_TEST_I2C_FAILURE_STRING; case (11702): diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index 390dfd87..19e0bf82 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-12 10:05:17 + * Generated on: 2023-09-25 17:49:54 */ #include "translateObjects.h" diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index 3322209d..d7a9d6aa 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. + * @brief Auto-generated event translation file. Contains 308 translations. * @details - * Generated on: 2023-09-12 10:05:17 + * Generated on: 2023-09-25 17:49:54 */ #include "translateEvents.h" @@ -128,6 +128,8 @@ const char *EXE_FAILURE_STRING = "EXE_FAILURE"; const char *MPSOC_HANDLER_CRC_FAILURE_STRING = "MPSOC_HANDLER_CRC_FAILURE"; const char *MPSOC_HANDLER_SEQUENCE_COUNT_MISMATCH_STRING = "MPSOC_HANDLER_SEQUENCE_COUNT_MISMATCH"; const char *MPSOC_SHUTDOWN_FAILED_STRING = "MPSOC_SHUTDOWN_FAILED"; +const char *SUPV_NOT_ON_STRING = "SUPV_NOT_ON"; +const char *SUPV_REPLY_TIMEOUT_STRING = "SUPV_REPLY_TIMEOUT"; const char *SELF_TEST_I2C_FAILURE_STRING = "SELF_TEST_I2C_FAILURE"; const char *SELF_TEST_SPI_FAILURE_STRING = "SELF_TEST_SPI_FAILURE"; const char *SELF_TEST_ADC_FAILURE_STRING = "SELF_TEST_ADC_FAILURE"; @@ -560,6 +562,10 @@ const char *translateEvents(Event event) { return MPSOC_HANDLER_SEQUENCE_COUNT_MISMATCH_STRING; case (11606): return MPSOC_SHUTDOWN_FAILED_STRING; + case (11607): + return SUPV_NOT_ON_STRING; + case (11608): + return SUPV_REPLY_TIMEOUT_STRING; case (11701): return SELF_TEST_I2C_FAILURE_STRING; case (11702): diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index 390dfd87..19e0bf82 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-12 10:05:17 + * Generated on: 2023-09-25 17:49:54 */ #include "translateObjects.h" diff --git a/linux/payload/PlocMpsocHandler.h b/linux/payload/PlocMpsocHandler.h index 2d6646e5..76640900 100644 --- a/linux/payload/PlocMpsocHandler.h +++ b/linux/payload/PlocMpsocHandler.h @@ -105,8 +105,8 @@ class PlocMpsocHandler : public DeviceHandlerBase, public CommandsActionsIF { static const Event MPSOC_SHUTDOWN_FAILED = MAKE_EVENT(6, severity::HIGH); //! [EXPORT] : [COMMENT] SUPV not on for boot or shutdown process. P1: 0 for OFF transition, 1 for //! ON transition. - static constexpr Event SUPV_NOT_ON = event::makeEvent(SUBSYSTEM_ID, 6, severity::LOW); - static constexpr Event SUPV_REPLY_TIMEOUT = event::makeEvent(SUBSYSTEM_ID, 7, severity::LOW); + static constexpr Event SUPV_NOT_ON = event::makeEvent(SUBSYSTEM_ID, 7, severity::LOW); + static constexpr Event SUPV_REPLY_TIMEOUT = event::makeEvent(SUBSYSTEM_ID, 8, severity::LOW); static const uint16_t APID_MASK = 0x7FF; static const uint16_t PACKET_SEQUENCE_COUNT_MASK = 0x3FFF; diff --git a/tmtc b/tmtc index 783bdd29..22a42108 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 783bdd297a931a96c8b077ec2c2456a203b23ffc +Subproject commit 22a42108b431bafa707de2b3a24cad9de95b70d0 From eb538a789af4162ec0bdd7c626fc636e33dc4e18 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 25 Sep 2023 17:53:25 +0200 Subject: [PATCH 084/257] changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8403fcf2..71a73eda 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,12 @@ will consitute of a breaking change warranting a new major release: # [unreleased] +## Changed + +- Changed internals for MPSoC boot process to make the code more understandable and some + parameters better configurable. This should not affect the behaviour of the OBSW, but might + make it more reliable and fix some corner cases. + # [v6.6.0] 2023-09-18 ## Changed From 50809e35a93fffa16d8493a21546c2c783342e90 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 25 Sep 2023 18:07:28 +0200 Subject: [PATCH 085/257] some nullptr checks --- CHANGELOG.md | 4 ++++ linux/payload/PlocSupervisorHandler.cpp | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 71a73eda..1ae7901e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,10 @@ will consitute of a breaking change warranting a new major release: parameters better configurable. This should not affect the behaviour of the OBSW, but might make it more reliable and fix some corner cases. +## Fixed + +- Missing `nullptr` checks for PLOC Supervisor handler, which could lead to crashes. + # [v6.6.0] 2023-09-18 ## Changed diff --git a/linux/payload/PlocSupervisorHandler.cpp b/linux/payload/PlocSupervisorHandler.cpp index 9e0d43d7..0aaa7cfb 100644 --- a/linux/payload/PlocSupervisorHandler.cpp +++ b/linux/payload/PlocSupervisorHandler.cpp @@ -1533,7 +1533,13 @@ void PlocSupervisorHandler::disableAllReplies() { /* Disable ack reply */ iter = deviceReplyMap.find(ACK_REPORT); + if (iter == deviceReplyMap.end()) { + return; + } DeviceReplyInfo* info = &(iter->second); + if (info == nullptr) { + return; + } info->delayCycles = 0; info->command = deviceCommandMap.end(); From 4ba3e394f9af151432251d724facc1578bdca279 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 25 Sep 2023 18:07:54 +0200 Subject: [PATCH 086/257] increase boot time slightly --- linux/payload/PlocMpsocHandler.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/payload/PlocMpsocHandler.h b/linux/payload/PlocMpsocHandler.h index 76640900..10171ef5 100644 --- a/linux/payload/PlocMpsocHandler.h +++ b/linux/payload/PlocMpsocHandler.h @@ -112,7 +112,7 @@ class PlocMpsocHandler : public DeviceHandlerBase, public CommandsActionsIF { static const uint16_t PACKET_SEQUENCE_COUNT_MASK = 0x3FFF; mpsoc::HkReport hkReport; - Countdown mpsocBootTransitionCd = Countdown(6000); + Countdown mpsocBootTransitionCd = Countdown(6500); Countdown supvTransitionCd = Countdown(3000); MessageQueueIF* eventQueue = nullptr; From 209e0c68fb990f2e43d7faaf921ef597ad41e721 Mon Sep 17 00:00:00 2001 From: meggert Date: Tue, 26 Sep 2023 11:56:04 +0200 Subject: [PATCH 087/257] fixes --- mission/controller/PowerController.cpp | 19 +++++++++++++------ mission/power/defs.h | 3 +-- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/mission/controller/PowerController.cpp b/mission/controller/PowerController.cpp index c47e2c21..1e45a902 100644 --- a/mission/controller/PowerController.cpp +++ b/mission/controller/PowerController.cpp @@ -150,6 +150,8 @@ void PowerController::calculateStateOfCharge() { pwrCtrlCoreHk.setValidity(false, true); } } + // store time for next run + oldTime = now; return; } @@ -171,12 +173,12 @@ void PowerController::calculateStateOfCharge() { pwrCtrlCoreHk.coulombCounterCharge.setValid(false); } } + // store time for next run + oldTime = now; return; } result = calculateCoulombCounterCharge(); - // store time for next run - oldTime = now; if (result != returnvalue::OK) { // notifying events have already been triggered { @@ -191,6 +193,8 @@ void PowerController::calculateStateOfCharge() { pwrCtrlCoreHk.coulombCounterCharge.setValid(false); } } + // store time for next run + oldTime = now; return; } @@ -204,6 +208,8 @@ void PowerController::calculateStateOfCharge() { pwrCtrlCoreHk.setValidity(true, true); } } + // store time for next run + oldTime = now; } void PowerController::watchStateOfCharge() { @@ -231,13 +237,14 @@ ReturnValue_t PowerController::calculateCoulombCounterCharge() { sif::error << "Power Controller::Time delta too large for Coulomb Counter" << std::endl; return returnvalue::FAILED; } - if ((not pwrCtrlCoreHk.coulombCounterCharge.isValid()) or - (bpxBatteryHk.battVoltage.value > coulombCounterVoltageUpperThreshold and - pwrCtrlCoreHk.coulombCounterCharge.value >= coulombCounterChargeUpperThreshold)) { + if (not pwrCtrlCoreHk.coulombCounterCharge.isValid()) { coulombCounterCharge = openCircuitVoltageCharge; } else { coulombCounterCharge = coulombCounterCharge + iBat * CONVERT_FROM_MILLI * timeDiff * SECONDS_TO_HOURS; + if (coulombCounterCharge >= coulombCounterChargeUpperThreshold) { + coulombCounterCharge = coulombCounterChargeUpperThreshold; + } } return returnvalue::OK; } @@ -261,7 +268,7 @@ ReturnValue_t PowerController::updateEpsData() { } float PowerController::charge2stateOfCharge(float capacity) { - return capacity / batteryMaximumCapacity; + return capacity / coulombCounterChargeUpperThreshold; } float PowerController::linearInterpolation(float x, float x0, float x1, float y0, float y1) { diff --git a/mission/power/defs.h b/mission/power/defs.h index 87fc3f08..375aaf6e 100644 --- a/mission/power/defs.h +++ b/mission/power/defs.h @@ -54,8 +54,7 @@ static constexpr Event DATASET_READ_FAILED = event::makeEvent(SUBSYSTEM_ID, 4, s //! P1: 1 too high, 0 too low static constexpr Event VOLTAGE_OUT_OF_BOUNDS = event::makeEvent(SUBSYSTEM_ID, 5, severity::HIGH); //! [EXPORT] : [COMMENT] Time difference for Coulomb Counter was too large. -static constexpr Event TIMEDELTA_OUT_OF_BOUNDS = - event::makeEvent(SUBSYSTEM_ID, 6, severity::MEDIUM); +static constexpr Event TIMEDELTA_OUT_OF_BOUNDS = event::makeEvent(SUBSYSTEM_ID, 6, severity::LOW); enum class States { IDLE, SWITCHING_POWER, CHECKING_POWER, MODE_COMMANDING }; enum class OpCodes { NONE, TO_OFF_DONE, TO_NOT_OFF_DONE, TIMEOUT_OCCURED }; From 23b15cf3029b4f0ce0daeb2fb04b93723f7850a7 Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 27 Sep 2023 11:55:33 +0200 Subject: [PATCH 088/257] add EPS to transitions --- mission/system/power/epsModeTree.cpp | 73 ++++++++++++++++++++++++++-- mission/system/systemTree.cpp | 14 ++++-- 2 files changed, 79 insertions(+), 8 deletions(-) diff --git a/mission/system/power/epsModeTree.cpp b/mission/system/power/epsModeTree.cpp index feeb6e5d..dbc67fd7 100644 --- a/mission/system/power/epsModeTree.cpp +++ b/mission/system/power/epsModeTree.cpp @@ -20,23 +20,86 @@ static const auto NML = DeviceHandlerIF::MODE_NORMAL; auto EPS_SEQUENCE_OFF = std::make_pair(OFF, FixedArrayList()); auto EPS_TABLE_OFF_TGT = std::make_pair((OFF << 24) | 1, FixedArrayList()); auto EPS_TABLE_OFF_TRANS_0 = std::make_pair((OFF << 24) | 2, FixedArrayList()); -auto EPS_TABLE_OFF_TRANS_1 = std::make_pair((OFF << 24) | 3, FixedArrayList()); auto EPS_SEQUENCE_NORMAL = std::make_pair(NML, FixedArrayList()); auto EPS_TABLE_NORMAL_TGT = std::make_pair((NML << 24) | 1, FixedArrayList()); auto EPS_TABLE_NORMAL_TRANS_0 = std::make_pair((NML << 24) | 2, FixedArrayList()); -auto EPS_TABLE_NORMAL_TRANS_1 = std::make_pair((NML << 24) | 3, FixedArrayList()); Subsystem& satsystem::eps::init() { ModeListEntry entry; buildOffSequence(SUBSYSTEM, entry); buildNormalSequence(SUBSYSTEM, entry); - SUBSYSTEM.setInitialMode(OFF); + SUBSYSTEM.setInitialMode(NML); return SUBSYSTEM; } namespace { -void buildOffSequence(Subsystem& ss, ModeListEntry& eh) {} +void buildOffSequence(Subsystem& ss, ModeListEntry& eh) { + std::string context = "satsystem::eps::buildOffSequence"; + auto ctxc = context.c_str(); + // Insert Helper Table + auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, ArrayList& table) { + eh.setObject(obj); + eh.setMode(mode); + eh.setSubmode(submode); + check(table.insert(eh), ctxc); + }; + // Insert Helper Sequence + auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, + bool checkSuccess) { + eh.setTableId(tableId); + eh.setWaitSeconds(waitSeconds); + eh.setCheckSuccess(checkSuccess); + check(sequence.insert(eh), ctxc); + }; -void buildNormalSequence(Subsystem& ss, ModeListEntry& eh) {} // namespace + // OFF target table is empty + check(ss.addTable(TableEntry(EPS_TABLE_OFF_TGT.first, &EPS_TABLE_OFF_TGT.second)), ctxc); + + // Transition 0 + iht(objects::POWER_CONTROLLER, OFF, 0, EPS_TABLE_OFF_TRANS_0.second); + check(ss.addTable(TableEntry(EPS_TABLE_OFF_TRANS_0.first, &EPS_TABLE_OFF_TRANS_0.second)), ctxc); + + ihs(EPS_SEQUENCE_OFF.second, EPS_TABLE_OFF_TGT.first, 0, false); + ihs(EPS_SEQUENCE_OFF.second, EPS_TABLE_OFF_TRANS_0.first, 0, false); + check(ss.addSequence(SequenceEntry(EPS_SEQUENCE_OFF.first, &EPS_SEQUENCE_OFF.second, + EPS_SEQUENCE_OFF.first)), + ctxc); +} +} // namespace + +void buildNormalSequence(Subsystem& ss, ModeListEntry& eh) { + std::string context = "satsystem::tcs::buildNormalSequence"; + auto ctxc = context.c_str(); + // Insert Helper Table + auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, ArrayList& table) { + eh.setObject(obj); + eh.setMode(mode); + eh.setSubmode(submode); + check(table.insert(eh), ctxc); + }; + // Insert Helper Sequence + auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, + bool checkSuccess) { + eh.setTableId(tableId); + eh.setWaitSeconds(waitSeconds); + eh.setCheckSuccess(checkSuccess); + check(sequence.insert(eh), ctxc); + }; + + // Normal target table + iht(objects::POWER_CONTROLLER, NML, 0, EPS_TABLE_NORMAL_TGT.second); + check(ss.addTable(TableEntry(EPS_TABLE_NORMAL_TGT.first, &EPS_TABLE_NORMAL_TGT.second)), ctxc); + + // Transition 0 + iht(objects::POWER_CONTROLLER, NML, 0, EPS_TABLE_NORMAL_TRANS_0.second); + check(ss.addTable(TableEntry(EPS_TABLE_NORMAL_TRANS_0.first, &EPS_TABLE_NORMAL_TRANS_0.second)), + ctxc); + + ihs(EPS_SEQUENCE_NORMAL.second, EPS_TABLE_NORMAL_TGT.first, 0, false); + ihs(EPS_SEQUENCE_NORMAL.second, EPS_TABLE_NORMAL_TRANS_0.first, 0, false); + check(ss.addSequence(SequenceEntry(EPS_SEQUENCE_NORMAL.first, &EPS_SEQUENCE_NORMAL.second, + EPS_SEQUENCE_NORMAL.first)), + ctxc); +} // namespace diff --git a/mission/system/systemTree.cpp b/mission/system/systemTree.cpp index 6c45a813..c9894f21 100644 --- a/mission/system/systemTree.cpp +++ b/mission/system/systemTree.cpp @@ -144,9 +144,11 @@ void buildBootSequence(Subsystem& ss, ModeListEntry& eh) { iht(objects::PL_SUBSYSTEM, OFF, 0, EIVE_TABLE_BOOT_TGT.second); iht(objects::COM_SUBSYSTEM, com::RX_ONLY, 0, EIVE_TABLE_BOOT_TGT.second); iht(objects::TCS_SUBSYSTEM, OFF, 0, EIVE_TABLE_BOOT_TGT.second); + iht(objects::EPS_SUBSYSTEM, OFF, 0, EIVE_TABLE_BOOT_TGT.second); check(ss.addTable(TableEntry(EIVE_TABLE_BOOT_TGT.first, &EIVE_TABLE_BOOT_TGT.second)), ctxc); - // Build SAFE transition 0. + // Build BOOT transition 0. + iht(objects::EPS_SUBSYSTEM, OFF, 0, EIVE_TABLE_BOOT_TRANS_0.second); iht(objects::TCS_SUBSYSTEM, OFF, 0, EIVE_TABLE_BOOT_TRANS_0.second); iht(objects::COM_SUBSYSTEM, com::RX_ONLY, 0, EIVE_TABLE_BOOT_TRANS_0.second); iht(objects::PL_SUBSYSTEM, OFF, 0, EIVE_TABLE_BOOT_TRANS_0.second); @@ -154,7 +156,7 @@ void buildBootSequence(Subsystem& ss, ModeListEntry& eh) { check(ss.addTable(TableEntry(EIVE_TABLE_BOOT_TRANS_0.first, &EIVE_TABLE_BOOT_TRANS_0.second)), ctxc); - // Build Safe sequence + // Build BOOT sequence ihs(EIVE_SEQUENCE_BOOT.second, EIVE_TABLE_BOOT_TGT.first, 0, false); ihs(EIVE_SEQUENCE_BOOT.second, EIVE_TABLE_BOOT_TRANS_0.first, 0, false); check(ss.addSequence(SequenceEntry(EIVE_SEQUENCE_BOOT.first, &EIVE_SEQUENCE_BOOT.second, @@ -190,13 +192,14 @@ void buildSafeSequence(Subsystem& ss, ModeListEntry& eh) { check(ss.addTable(TableEntry(EIVE_TABLE_SAFE_TGT.first, &EIVE_TABLE_SAFE_TGT.second)), ctxc); // Build SAFE transition 0. + iht(objects::EPS_SUBSYSTEM, NML, 0, EIVE_TABLE_SAFE_TRANS_0.second); iht(objects::TCS_SUBSYSTEM, NML, 0, EIVE_TABLE_SAFE_TRANS_0.second); iht(objects::PL_SUBSYSTEM, OFF, 0, EIVE_TABLE_SAFE_TRANS_0.second); iht(objects::ACS_SUBSYSTEM, acs::AcsMode::SAFE, 0, EIVE_TABLE_SAFE_TRANS_0.second, true); check(ss.addTable(TableEntry(EIVE_TABLE_SAFE_TRANS_0.first, &EIVE_TABLE_SAFE_TRANS_0.second)), ctxc); - // Build Safe sequence + // Build SAFE sequence ihs(EIVE_SEQUENCE_SAFE.second, EIVE_TABLE_SAFE_TGT.first, 0, false); ihs(EIVE_SEQUENCE_SAFE.second, EIVE_TABLE_SAFE_TRANS_0.first, 0, false); check(ss.addSequence(SequenceEntry(EIVE_SEQUENCE_SAFE.first, &EIVE_SEQUENCE_SAFE.second, @@ -227,6 +230,7 @@ void buildIdleSequence(Subsystem& ss, ModeListEntry& eh) { check(ss.addTable(TableEntry(EIVE_TABLE_IDLE_TGT.first, &EIVE_TABLE_IDLE_TGT.second)), ctxc); // Build IDLE transition 0 + iht(objects::EPS_SUBSYSTEM, NML, 0, EIVE_TABLE_IDLE_TRANS_0.second); iht(objects::TCS_SUBSYSTEM, NML, 0, EIVE_TABLE_IDLE_TRANS_0.second); iht(objects::ACS_SUBSYSTEM, acs::AcsMode::PTG_IDLE, 0, EIVE_TABLE_IDLE_TRANS_0.second); check(ss.addTable(TableEntry(EIVE_TABLE_IDLE_TRANS_0.first, &EIVE_TABLE_IDLE_TRANS_0.second)), @@ -264,6 +268,7 @@ void buildPtgNadirSequence(Subsystem& ss, ModeListEntry& eh) { ctxc); // Build PTG_NADIR transition 0 + iht(objects::EPS_SUBSYSTEM, NML, 0, EIVE_TABLE_PTG_NADIR_TRANS_0.second); iht(objects::TCS_SUBSYSTEM, NML, 0, EIVE_TABLE_PTG_NADIR_TRANS_0.second); iht(objects::ACS_SUBSYSTEM, acs::AcsMode::PTG_NADIR, 0, EIVE_TABLE_PTG_NADIR_TRANS_0.second); check(ss.addTable( @@ -302,6 +307,7 @@ void buildPtgTargetSequence(Subsystem& ss, ModeListEntry& eh) { ctxc); // Build PTG_TARGET transition 0 + iht(objects::EPS_SUBSYSTEM, NML, 0, EIVE_TABLE_PTG_TARGET_TRANS_0.second); iht(objects::TCS_SUBSYSTEM, NML, 0, EIVE_TABLE_PTG_TARGET_TRANS_0.second); iht(objects::ACS_SUBSYSTEM, acs::AcsMode::PTG_TARGET, 0, EIVE_TABLE_PTG_TARGET_TRANS_0.second); check(ss.addTable( @@ -341,6 +347,7 @@ void buildPtgTargetGsSequence(Subsystem& ss, ModeListEntry& eh) { ctxc); // Build PTG_TARGET_GS transition 0 + iht(objects::EPS_SUBSYSTEM, NML, 0, EIVE_TABLE_PTG_TARGET_GS_TRANS_0.second); iht(objects::TCS_SUBSYSTEM, NML, 0, EIVE_TABLE_PTG_TARGET_GS_TRANS_0.second); iht(objects::ACS_SUBSYSTEM, acs::AcsMode::PTG_TARGET_GS, 0, EIVE_TABLE_PTG_TARGET_GS_TRANS_0.second); @@ -382,6 +389,7 @@ void buildPtgInertialSequence(Subsystem& ss, ModeListEntry& eh) { ctxc); // Build PTG_INERTIAL transition 0 + iht(objects::EPS_SUBSYSTEM, NML, 0, EIVE_TABLE_PTG_INERTIAL_TRANS_0.second); iht(objects::TCS_SUBSYSTEM, NML, 0, EIVE_TABLE_PTG_INERTIAL_TRANS_0.second); iht(objects::ACS_SUBSYSTEM, acs::AcsMode::PTG_INERTIAL, 0, EIVE_TABLE_PTG_INERTIAL_TRANS_0.second); From b7ccb8b41dd93aa838337f62770055b3fbbee69d Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 27 Sep 2023 13:00:18 +0200 Subject: [PATCH 089/257] cmake --- mission/system/power/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mission/system/power/CMakeLists.txt b/mission/system/power/CMakeLists.txt index 8fa4967e..a7e91e05 100644 --- a/mission/system/power/CMakeLists.txt +++ b/mission/system/power/CMakeLists.txt @@ -1 +1 @@ -target_sources(${LIB_EIVE_MISSION} PRIVATE GomspacePowerFdir.cpp) +target_sources(${LIB_EIVE_MISSION} PRIVATE epsModeTree.cpp EpsSubsystem.cpp GomspacePowerFdir.cpp) From 063a7efc6b9fc2feff3834bd7a889398c215c240 Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 27 Sep 2023 13:00:29 +0200 Subject: [PATCH 090/257] fixed include --- mission/system/power/EpsSubsystem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mission/system/power/EpsSubsystem.cpp b/mission/system/power/EpsSubsystem.cpp index 8d402553..2ec4155b 100644 --- a/mission/system/power/EpsSubsystem.cpp +++ b/mission/system/power/EpsSubsystem.cpp @@ -1,4 +1,4 @@ -#include +#include #include "fsfw/devicehandlers/DeviceHandlerIF.h" From 1973bd2c5b4fee75bddc2c668490813f7d76b5c8 Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 27 Sep 2023 13:07:18 +0200 Subject: [PATCH 091/257] fix --- mission/system/power/epsModeTree.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mission/system/power/epsModeTree.cpp b/mission/system/power/epsModeTree.cpp index dbc67fd7..c28669f9 100644 --- a/mission/system/power/epsModeTree.cpp +++ b/mission/system/power/epsModeTree.cpp @@ -67,7 +67,6 @@ void buildOffSequence(Subsystem& ss, ModeListEntry& eh) { EPS_SEQUENCE_OFF.first)), ctxc); } -} // namespace void buildNormalSequence(Subsystem& ss, ModeListEntry& eh) { std::string context = "satsystem::tcs::buildNormalSequence"; @@ -102,4 +101,5 @@ void buildNormalSequence(Subsystem& ss, ModeListEntry& eh) { check(ss.addSequence(SequenceEntry(EPS_SEQUENCE_NORMAL.first, &EPS_SEQUENCE_NORMAL.second, EPS_SEQUENCE_NORMAL.first)), ctxc); +} } // namespace From c486bb2cf38b757adf1b91ec19b2b35d4ccb5e98 Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 27 Sep 2023 14:46:45 +0200 Subject: [PATCH 092/257] pwr ctrl fdir --- mission/controller/PowerController.cpp | 21 ++++++++++++++++++++- mission/controller/PowerController.h | 5 +++++ mission/power/defs.h | 6 ++++++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/mission/controller/PowerController.cpp b/mission/controller/PowerController.cpp index 1e45a902..12ed5216 100644 --- a/mission/controller/PowerController.cpp +++ b/mission/controller/PowerController.cpp @@ -54,6 +54,12 @@ ReturnValue_t PowerController::getParameter(uint8_t domainId, uint8_t parameterI case 0x3: parameterWrapper->set(maxAllowedTimeDiff); break; + case 0x4: + parameterWrapper->set(payloadLimit); + break; + case 0x5: + parameterWrapper->set(higherModesLimit); + break; default: return INVALID_IDENTIFIER_ID; } @@ -213,7 +219,20 @@ void PowerController::calculateStateOfCharge() { } void PowerController::watchStateOfCharge() { - // ToDo: FDIR + if (pwrCtrlCoreHk.coulombCounterCharge.isValid()) { + if (not pwrLvlLowFlag and pwrCtrlCoreHk.coulombCounterCharge.value < payloadLimit) { + triggerEvent(power::POWER_LEVEL_LOW); + pwrLvlLowFlag = true; + } else { + pwrLvlLowFlag = false; + } + if (not pwrLvlCriticalFlag and pwrCtrlCoreHk.coulombCounterCharge.value < higherModesLimit) { + triggerEvent(power::POWER_LEVEL_CRITICAL); + pwrLvlCriticalFlag = true; + } else { + pwrLvlCriticalFlag = false; + } + } } ReturnValue_t PowerController::calculateOpenCircuitVoltageCharge() { diff --git a/mission/controller/PowerController.h b/mission/controller/PowerController.h index fbd2709b..e7031ad8 100644 --- a/mission/controller/PowerController.h +++ b/mission/controller/PowerController.h @@ -57,6 +57,8 @@ class PowerController : public ExtendedControllerBase, public ReceivesParameterM float batteryMaximumCapacity = 2.6 * 2; // [Ah] float coulombCounterVoltageUpperThreshold = 16.2e3; // [mV] double maxAllowedTimeDiff = 0.5; // [s] + float payloadLimit = 0.75; // [%] + float higherModesLimit = 0.6; // [%] // OCV Look-up-Table {[Ah],[V]} static constexpr uint8_t LOOK_UP_TABLE_MAX_IDX = 99; @@ -111,6 +113,9 @@ class PowerController : public ExtendedControllerBase, public ReceivesParameterM static constexpr int16_t INVALID_TOTAL_BATTERY_CURRENT = 0; static constexpr float INVALID_SOC = -1; + bool pwrLvlLowFlag = false; + bool pwrLvlCriticalFlag = false; + // HK Datasets for Calculation BpxBatteryHk bpxBatteryHk = BpxBatteryHk(objects::BPX_BATT_HANDLER); P60Dock::CoreHkSet p60CoreHk = P60Dock::CoreHkSet(objects::P60DOCK_HANDLER); diff --git a/mission/power/defs.h b/mission/power/defs.h index 375aaf6e..22a8af53 100644 --- a/mission/power/defs.h +++ b/mission/power/defs.h @@ -55,6 +55,12 @@ static constexpr Event DATASET_READ_FAILED = event::makeEvent(SUBSYSTEM_ID, 4, s static constexpr Event VOLTAGE_OUT_OF_BOUNDS = event::makeEvent(SUBSYSTEM_ID, 5, severity::HIGH); //! [EXPORT] : [COMMENT] Time difference for Coulomb Counter was too large. static constexpr Event TIMEDELTA_OUT_OF_BOUNDS = event::makeEvent(SUBSYSTEM_ID, 6, severity::LOW); +//! [EXPORT] : [COMMENT] The State of Charge is below the limit for payload use. Setting Payload to +//! faulty. +static constexpr Event POWER_LEVEL_LOW = event::makeEvent(SUBSYSTEM_ID, 7, severity::HIGH); +//! [EXPORT] : [COMMENT] The State of Charge is below the limit for higher modes. Setting Reaction +//! Wheels to faulty. +static constexpr Event POWER_LEVEL_CRITICAL = event::makeEvent(SUBSYSTEM_ID, 8, severity::HIGH); enum class States { IDLE, SWITCHING_POWER, CHECKING_POWER, MODE_COMMANDING }; enum class OpCodes { NONE, TO_OFF_DONE, TO_NOT_OFF_DONE, TIMEOUT_OCCURED }; From 6a77635bfb9dd095e5e8d10dbec931ed8d25039b Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 27 Sep 2023 16:36:09 +0200 Subject: [PATCH 093/257] soc calculation fixes --- mission/controller/PowerController.cpp | 17 ++++++++++------- mission/controller/PowerController.h | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/mission/controller/PowerController.cpp b/mission/controller/PowerController.cpp index 12ed5216..1eb3abaf 100644 --- a/mission/controller/PowerController.cpp +++ b/mission/controller/PowerController.cpp @@ -162,8 +162,7 @@ void PowerController::calculateStateOfCharge() { } // calculate total battery current - iBat = p60CoreHk.batteryCurrent.value + bpxBatteryHk.heaterCurrent.value + - bpxBatteryHk.dischargeCurrent.value; + iBat = p60CoreHk.batteryCurrent.value + bpxBatteryHk.dischargeCurrent.value; result = calculateOpenCircuitVoltageCharge(); if (result != returnvalue::OK) { @@ -193,7 +192,7 @@ void PowerController::calculateStateOfCharge() { pwrCtrlCoreHk.totalBatteryCurrent.value = iBat; pwrCtrlCoreHk.totalBatteryCurrent.setValid(true); pwrCtrlCoreHk.openCircuitVoltageCharge.value = - charge2stateOfCharge(openCircuitVoltageCharge); + charge2stateOfCharge(openCircuitVoltageCharge, false); pwrCtrlCoreHk.openCircuitVoltageCharge.setValid(true); pwrCtrlCoreHk.coulombCounterCharge.value = INVALID_SOC; pwrCtrlCoreHk.coulombCounterCharge.setValid(false); @@ -209,8 +208,9 @@ void PowerController::calculateStateOfCharge() { PoolReadGuard pg(&pwrCtrlCoreHk); if (pg.getReadResult() == returnvalue::OK) { pwrCtrlCoreHk.totalBatteryCurrent.value = iBat; - pwrCtrlCoreHk.openCircuitVoltageCharge.value = charge2stateOfCharge(openCircuitVoltageCharge); - pwrCtrlCoreHk.coulombCounterCharge.value = charge2stateOfCharge(coulombCounterCharge); + pwrCtrlCoreHk.openCircuitVoltageCharge.value = + charge2stateOfCharge(openCircuitVoltageCharge, false); + pwrCtrlCoreHk.coulombCounterCharge.value = charge2stateOfCharge(coulombCounterCharge, true); pwrCtrlCoreHk.setValidity(true, true); } } @@ -286,8 +286,11 @@ ReturnValue_t PowerController::updateEpsData() { return returnvalue::OK; } -float PowerController::charge2stateOfCharge(float capacity) { - return capacity / coulombCounterChargeUpperThreshold; +float PowerController::charge2stateOfCharge(float capacity, bool coulombCounter) { + if (coulombCounter) { + return capacity / coulombCounterChargeUpperThreshold; + } + return capacity / batteryMaximumCapacity; } float PowerController::linearInterpolation(float x, float x0, float x1, float y0, float y1) { diff --git a/mission/controller/PowerController.h b/mission/controller/PowerController.h index e7031ad8..81522023 100644 --- a/mission/controller/PowerController.h +++ b/mission/controller/PowerController.h @@ -47,7 +47,7 @@ class PowerController : public ExtendedControllerBase, public ReceivesParameterM ReturnValue_t calculateOpenCircuitVoltageCharge(); ReturnValue_t calculateCoulombCounterCharge(); ReturnValue_t updateEpsData(); - float charge2stateOfCharge(float capacity); + float charge2stateOfCharge(float capacity, bool coulombCounter); ReturnValue_t lookUpTableOcvIdxFinder(float voltage, uint8_t& idx); float linearInterpolation(float x, float x0, float x1, float y0, float y1); ReturnValue_t calculateCoulombCounterChargeUpperThreshold(); From 173ee62d39dda1b0ab05154b6cdf6d376f1b2652 Mon Sep 17 00:00:00 2001 From: meggert Date: Thu, 28 Sep 2023 12:00:04 +0200 Subject: [PATCH 094/257] connect pwr ctrl to eps --- bsp_q7s/em/emObjectFactory.cpp | 2 +- bsp_q7s/fmObjectFactory.cpp | 2 +- linux/ObjectFactory.cpp | 6 +++++- linux/ObjectFactory.h | 2 +- mission/system/power/epsModeTree.cpp | 10 +++++----- mission/system/power/epsModeTree.h | 2 +- 6 files changed, 14 insertions(+), 10 deletions(-) diff --git a/bsp_q7s/em/emObjectFactory.cpp b/bsp_q7s/em/emObjectFactory.cpp index 9b106dd2..94e10784 100644 --- a/bsp_q7s/em/emObjectFactory.cpp +++ b/bsp_q7s/em/emObjectFactory.cpp @@ -178,7 +178,7 @@ void ObjectFactory::produce(void* args) { power::Switches::PDU1_CH5_SOLAR_CELL_EXP_5V); #endif createAcsController(true, enableHkSets); - createPowerController(enableHkSets); + createPowerController(true, enableHkSets); HeaterHandler* heaterHandler; createHeaterComponents(gpioComIF, pwrSwitcher, healthTable, heaterHandler); createThermalController(*heaterHandler, true); diff --git a/bsp_q7s/fmObjectFactory.cpp b/bsp_q7s/fmObjectFactory.cpp index 8e1672a8..c6dc1d28 100644 --- a/bsp_q7s/fmObjectFactory.cpp +++ b/bsp_q7s/fmObjectFactory.cpp @@ -132,6 +132,6 @@ void ObjectFactory::produce(void* args) { createMiscComponents(); createThermalController(*heaterHandler, false); createAcsController(true, enableHkSets); - createPowerController(enableHkSets); + createPowerController(true, enableHkSets); satsystem::init(false); } diff --git a/linux/ObjectFactory.cpp b/linux/ObjectFactory.cpp index b74057c1..cb3e043b 100644 --- a/linux/ObjectFactory.cpp +++ b/linux/ObjectFactory.cpp @@ -28,6 +28,7 @@ #include "devices/gpioIds.h" #include "eive/definitions.h" #include "mission/system/acs/acsModeTree.h" +#include "mission/system/power/epsModeTree.h" #include "mission/system/tcs/tcsModeTree.h" #include "mission/system/tree/payloadModeTree.h" #include "mission/tcs/defs.h" @@ -338,8 +339,11 @@ AcsController* ObjectFactory::createAcsController(bool connectSubsystem, bool en return acsCtrl; } -PowerController* ObjectFactory::createPowerController(bool enableHkSets) { +PowerController* ObjectFactory::createPowerController(bool connectSubsystem, bool enableHkSets) { auto pwrCtrl = new PowerController(objects::POWER_CONTROLLER, enableHkSets); + if (connectSubsystem) { + pwrCtrl->connectModeTreeParent(satsystem::eps::EPS_SUBSYSTEM); + } return pwrCtrl; } diff --git a/linux/ObjectFactory.h b/linux/ObjectFactory.h index d8605f48..46baa685 100644 --- a/linux/ObjectFactory.h +++ b/linux/ObjectFactory.h @@ -32,6 +32,6 @@ void createScexComponents(std::string uartDev, PowerSwitchIF* pwrSwitcher, void gpioChecker(ReturnValue_t result, std::string output); AcsController* createAcsController(bool connectSubsystem, bool enableHkSets); -PowerController* createPowerController(bool enableHkSets); +PowerController* createPowerController(bool connectSubsystem, bool enableHkSets); } // namespace ObjectFactory diff --git a/mission/system/power/epsModeTree.cpp b/mission/system/power/epsModeTree.cpp index c28669f9..7c81b38f 100644 --- a/mission/system/power/epsModeTree.cpp +++ b/mission/system/power/epsModeTree.cpp @@ -5,7 +5,7 @@ #include "fsfw/subsystem/Subsystem.h" #include "mission/system/treeUtil.h" -EpsSubsystem satsystem::eps::SUBSYSTEM(objects::EPS_SUBSYSTEM, 12, 24); +EpsSubsystem satsystem::eps::EPS_SUBSYSTEM(objects::EPS_SUBSYSTEM, 12, 24); namespace { // Alias for checker function @@ -27,10 +27,10 @@ auto EPS_TABLE_NORMAL_TRANS_0 = std::make_pair((NML << 24) | 2, FixedArrayList Date: Thu, 28 Sep 2023 12:00:48 +0200 Subject: [PATCH 095/257] remove comments for mode handling --- mission/controller/PowerController.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/mission/controller/PowerController.cpp b/mission/controller/PowerController.cpp index 1eb3abaf..9347f681 100644 --- a/mission/controller/PowerController.cpp +++ b/mission/controller/PowerController.cpp @@ -91,14 +91,13 @@ void PowerController::performControlOperation() { return; } case InternalState::READY: { - // if (mode != MODE_OFF) { - sif::debug << "oh shit, now i gotta do something" << std::endl; - calculateStateOfCharge(); - if (mode == MODE_NORMAL) { - watchStateOfCharge(); + if (mode != MODE_OFF) { + sif::debug << "oh shit, now i gotta do something" << std::endl; + calculateStateOfCharge(); + if (mode == MODE_NORMAL) { + watchStateOfCharge(); + } } - // do something - //} break; } default: From eb84b5bb870c870d3188436e859be94fe499908e Mon Sep 17 00:00:00 2001 From: meggert Date: Thu, 28 Sep 2023 13:09:53 +0200 Subject: [PATCH 096/257] schedule pwr ctrl with bpx again --- common/config/eive/definitions.h | 3 +++ mission/pollingSeqTables.cpp | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/common/config/eive/definitions.h b/common/config/eive/definitions.h index b369f512..d446aa8d 100644 --- a/common/config/eive/definitions.h +++ b/common/config/eive/definitions.h @@ -79,6 +79,7 @@ static constexpr uint32_t SCHED_BLOCK_RTD = 150; static constexpr uint32_t SCHED_BLOCK_7_RW_READ_MS = 300; static constexpr uint32_t SCHED_BLOCK_8_PLPCDU_MS = 320; static constexpr uint32_t SCHED_BLOCK_9_RAD_SENS_MS = 340; +static constexpr uint32_t SCHED_BLOCK_10_PWR_CTRL_MS = 350; // 15 ms for FM static constexpr float SCHED_BLOCK_1_PERIOD = static_cast(SCHED_BLOCK_1_SUS_READ_MS) / 400.0; @@ -94,6 +95,8 @@ static constexpr float SCHED_BLOCK_RTD_PERIOD = static_cast(SCHED_BLOCK_R static constexpr float SCHED_BLOCK_7_PERIOD = static_cast(SCHED_BLOCK_7_RW_READ_MS) / 400.0; static constexpr float SCHED_BLOCK_8_PERIOD = static_cast(SCHED_BLOCK_8_PLPCDU_MS) / 400.0; static constexpr float SCHED_BLOCK_9_PERIOD = static_cast(SCHED_BLOCK_9_RAD_SENS_MS) / 400.0; +static constexpr float SCHED_BLOCK_10_PERIOD = + static_cast(SCHED_BLOCK_10_PWR_CTRL_MS) / 400.0; } // namespace spiSched diff --git a/mission/pollingSeqTables.cpp b/mission/pollingSeqTables.cpp index e2517abd..e9adf83b 100644 --- a/mission/pollingSeqTables.cpp +++ b/mission/pollingSeqTables.cpp @@ -134,8 +134,6 @@ ReturnValue_t pst::pstGompaceCan(FixedTimeslotTaskIF *thisSequence) { thisSequence->addSlot(objects::PDU2_HANDLER, length * 0.5, DeviceHandlerIF::GET_READ); thisSequence->addSlot(objects::ACU_HANDLER, length * 0.5, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::POWER_CONTROLLER, length * 0.6, 0); - if (thisSequence->checkSequence() != returnvalue::OK) { sif::error << "GomSpace PST initialization failed" << std::endl; return returnvalue::FAILED; @@ -605,5 +603,8 @@ ReturnValue_t pst::pstTcsAndAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::RAD_SENSOR, length * config::spiSched::SCHED_BLOCK_9_PERIOD, DeviceHandlerIF::GET_READ); + + thisSequence->addSlot(objects::POWER_CONTROLLER, length * config::spiSched::SCHED_BLOCK_10_PERIOD, + 0); return returnvalue::OK; } From 61ebe5ed99f9a04aa8276d3dcc52488fa5ad0159 Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 29 Sep 2023 09:49:21 +0200 Subject: [PATCH 097/257] scheduled EPS subsystem --- bsp_q7s/scheduling.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bsp_q7s/scheduling.cpp b/bsp_q7s/scheduling.cpp index d7c179ad..fa7fbe18 100644 --- a/bsp_q7s/scheduling.cpp +++ b/bsp_q7s/scheduling.cpp @@ -157,6 +157,10 @@ void scheduling::initTasks() { if (result != returnvalue::OK) { scheduling::printAddObjectError("PL_SUBSYSTEM", objects::PL_SUBSYSTEM); } + result = genericSysTask->addComponent(objects::EPS_SUBSYSTEM); + if (result != returnvalue::OK) { + scheduling::printAddObjectError("EPS_SUBSYSTEM", objects::EPS_SUBSYSTEM); + } result = genericSysTask->addComponent(objects::INTERNAL_ERROR_REPORTER); if (result != returnvalue::OK) { scheduling::printAddObjectError("ERROR_REPORTER", objects::INTERNAL_ERROR_REPORTER); From 49102463f533802e51a4182cafc991b17ea7c85f Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 29 Sep 2023 09:49:52 +0200 Subject: [PATCH 098/257] ran generators --- .../fsfwconfig/events/translateEvents.cpp | 19 +++++++++++++++++-- .../fsfwconfig/objects/translateObjects.cpp | 10 ++++++++-- generators/bsp_hosted_events.csv | 5 +++++ generators/bsp_hosted_objects.csv | 2 ++ generators/bsp_hosted_returnvalues.csv | 8 ++++---- generators/bsp_q7s_events.csv | 5 +++++ generators/bsp_q7s_objects.csv | 2 ++ generators/bsp_q7s_returnvalues.csv | 8 ++++---- generators/events/translateEvents.cpp | 19 +++++++++++++++++-- generators/objects/translateObjects.cpp | 10 ++++++++-- linux/fsfwconfig/events/translateEvents.cpp | 19 +++++++++++++++++-- linux/fsfwconfig/objects/translateObjects.cpp | 10 ++++++++-- 12 files changed, 97 insertions(+), 20 deletions(-) diff --git a/bsp_hosted/fsfwconfig/events/translateEvents.cpp b/bsp_hosted/fsfwconfig/events/translateEvents.cpp index d7a9d6aa..610a69fb 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 308 translations. + * @brief Auto-generated event translation file. Contains 313 translations. * @details - * Generated on: 2023-09-25 17:49:54 + * Generated on: 2023-09-28 15:53:20 */ #include "translateEvents.h" @@ -105,6 +105,11 @@ const char *SWITCH_CMD_SENT_STRING = "SWITCH_CMD_SENT"; const char *SWITCH_HAS_CHANGED_STRING = "SWITCH_HAS_CHANGED"; const char *SWITCHING_Q7S_DENIED_STRING = "SWITCHING_Q7S_DENIED"; const char *FDIR_REACTION_IGNORED_STRING = "FDIR_REACTION_IGNORED"; +const char *DATASET_READ_FAILED_STRING = "DATASET_READ_FAILED"; +const char *VOLTAGE_OUT_OF_BOUNDS_STRING = "VOLTAGE_OUT_OF_BOUNDS"; +const char *TIMEDELTA_OUT_OF_BOUNDS_STRING = "TIMEDELTA_OUT_OF_BOUNDS"; +const char *POWER_LEVEL_LOW_STRING = "POWER_LEVEL_LOW"; +const char *POWER_LEVEL_CRITICAL_STRING = "POWER_LEVEL_CRITICAL"; const char *GPIO_PULL_HIGH_FAILED_STRING = "GPIO_PULL_HIGH_FAILED"; const char *GPIO_PULL_LOW_FAILED_STRING = "GPIO_PULL_LOW_FAILED"; const char *HEATER_WENT_ON_STRING = "HEATER_WENT_ON"; @@ -516,6 +521,16 @@ const char *translateEvents(Event event) { return SWITCHING_Q7S_DENIED_STRING; case (11303): return FDIR_REACTION_IGNORED_STRING; + case (11304): + return DATASET_READ_FAILED_STRING; + case (11305): + return VOLTAGE_OUT_OF_BOUNDS_STRING; + case (11306): + return TIMEDELTA_OUT_OF_BOUNDS_STRING; + case (11307): + return POWER_LEVEL_LOW_STRING; + case (11308): + return POWER_LEVEL_CRITICAL_STRING; case (11400): return GPIO_PULL_HIGH_FAILED_STRING; case (11401): diff --git a/bsp_hosted/fsfwconfig/objects/translateObjects.cpp b/bsp_hosted/fsfwconfig/objects/translateObjects.cpp index ab0c8cec..f3f7d5fb 100644 --- a/bsp_hosted/fsfwconfig/objects/translateObjects.cpp +++ b/bsp_hosted/fsfwconfig/objects/translateObjects.cpp @@ -1,14 +1,15 @@ /** * @brief Auto-generated object translation file. * @details - * Contains 171 translations. - * Generated on: 2023-09-25 17:49:54 + * Contains 173 translations. + * Generated on: 2023-09-28 15:53:20 */ #include "translateObjects.h" const char *TEST_TASK_STRING = "TEST_TASK"; const char *ACS_CONTROLLER_STRING = "ACS_CONTROLLER"; const char *CORE_CONTROLLER_STRING = "CORE_CONTROLLER"; +const char *POWER_CONTROLLER_STRING = "POWER_CONTROLLER"; const char *GLOBAL_JSON_CFG_STRING = "GLOBAL_JSON_CFG"; const char *THERMAL_CONTROLLER_STRING = "THERMAL_CONTROLLER"; const char *DUMMY_HANDLER_STRING = "DUMMY_HANDLER"; @@ -164,6 +165,7 @@ const char *ACS_SUBSYSTEM_STRING = "ACS_SUBSYSTEM"; const char *PL_SUBSYSTEM_STRING = "PL_SUBSYSTEM"; const char *TCS_SUBSYSTEM_STRING = "TCS_SUBSYSTEM"; const char *COM_SUBSYSTEM_STRING = "COM_SUBSYSTEM"; +const char *EPS_SUBSYSTEM_STRING = "EPS_SUBSYSTEM"; const char *MISC_TM_STORE_STRING = "MISC_TM_STORE"; const char *OK_TM_STORE_STRING = "OK_TM_STORE"; const char *NOT_OK_TM_STORE_STRING = "NOT_OK_TM_STORE"; @@ -186,6 +188,8 @@ const char *translateObject(object_id_t object) { return ACS_CONTROLLER_STRING; case 0x43000003: return CORE_CONTROLLER_STRING; + case 0x43000004: + return POWER_CONTROLLER_STRING; case 0x43000006: return GLOBAL_JSON_CFG_STRING; case 0x43400001: @@ -496,6 +500,8 @@ const char *translateObject(object_id_t object) { return TCS_SUBSYSTEM_STRING; case 0x73010004: return COM_SUBSYSTEM_STRING; + case 0x73010005: + return EPS_SUBSYSTEM_STRING; case 0x73020001: return MISC_TM_STORE_STRING; case 0x73020002: diff --git a/generators/bsp_hosted_events.csv b/generators/bsp_hosted_events.csv index 4d762f0e..442fc05c 100644 --- a/generators/bsp_hosted_events.csv +++ b/generators/bsp_hosted_events.csv @@ -99,6 +99,11 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 11301;0x2c25;SWITCH_HAS_CHANGED;INFO;Indicated that a switch state has changed P1: New switch state, 1 for on, 0 for off | P2: Switch Index;mission/power/defs.h 11302;0x2c26;SWITCHING_Q7S_DENIED;MEDIUM;No description;mission/power/defs.h 11303;0x2c27;FDIR_REACTION_IGNORED;MEDIUM;No description;mission/power/defs.h +11304;0x2c28;DATASET_READ_FAILED;INFO;The dataset read for the inputs of the Power Controller has failed.;mission/power/defs.h +11305;0x2c29;VOLTAGE_OUT_OF_BOUNDS;HIGH;The battery voltage read is out of the bounds in which it is supposed to be. P1: 1 too high, 0 too low;mission/power/defs.h +11306;0x2c2a;TIMEDELTA_OUT_OF_BOUNDS;LOW;Time difference for Coulomb Counter was too large.;mission/power/defs.h +11307;0x2c2b;POWER_LEVEL_LOW;HIGH;The State of Charge is below the limit for payload use. Setting Payload to faulty.;mission/power/defs.h +11308;0x2c2c;POWER_LEVEL_CRITICAL;HIGH;The State of Charge is below the limit for higher modes. Setting Reaction Wheels to faulty.;mission/power/defs.h 11400;0x2c88;GPIO_PULL_HIGH_FAILED;LOW;No description;mission/tcs/HeaterHandler.h 11401;0x2c89;GPIO_PULL_LOW_FAILED;LOW;No description;mission/tcs/HeaterHandler.h 11402;0x2c8a;HEATER_WENT_ON;INFO;No description;mission/tcs/HeaterHandler.h diff --git a/generators/bsp_hosted_objects.csv b/generators/bsp_hosted_objects.csv index 3faac37c..4cb21f46 100644 --- a/generators/bsp_hosted_objects.csv +++ b/generators/bsp_hosted_objects.csv @@ -1,6 +1,7 @@ 0x42694269;TEST_TASK 0x43000002;ACS_CONTROLLER 0x43000003;CORE_CONTROLLER +0x43000004;POWER_CONTROLLER 0x43000006;GLOBAL_JSON_CFG 0x43400001;THERMAL_CONTROLLER 0x44000001;DUMMY_HANDLER @@ -156,6 +157,7 @@ 0x73010002;PL_SUBSYSTEM 0x73010003;TCS_SUBSYSTEM 0x73010004;COM_SUBSYSTEM +0x73010005;EPS_SUBSYSTEM 0x73020001;MISC_TM_STORE 0x73020002;OK_TM_STORE 0x73020003;NOT_OK_TM_STORE diff --git a/generators/bsp_hosted_returnvalues.csv b/generators/bsp_hosted_returnvalues.csv index 50a86ae3..e3db4c9a 100644 --- a/generators/bsp_hosted_returnvalues.csv +++ b/generators/bsp_hosted_returnvalues.csv @@ -357,7 +357,6 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x3a02;MQI_Full;No space left for more messages;2;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h 0x3a03;MQI_NoReplyPartner;Returned if a reply method was called without partner;3;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h 0x3a04;MQI_DestinationInvalid;Returned if the target destination is invalid.;4;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h -0x3b00;SPH_ConnBroken;No description;0;SEMAPHORE_IF;fsfw/src/fsfw/osal/common/TcpTmTcServer.h 0x3b01;SPH_SemaphoreTimeout;No description;1;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h 0x3b02;SPH_SemaphoreNotOwned;No description;2;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h 0x3b03;SPH_SemaphoreInvalid;No description;3;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h @@ -373,6 +372,7 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x3e05;HKM_DatasetNotFound;No description;5;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h 0x3f01;DLEE_StreamTooShort;No description;1;DLE_ENCODER;fsfw/src/fsfw/globalfunctions/DleEncoder.h 0x3f02;DLEE_DecodingError;No description;2;DLE_ENCODER;fsfw/src/fsfw/globalfunctions/DleEncoder.h +0x4100;PUS9_ConnBroken;No description;0;PUS_SERVICE_9;fsfw/src/fsfw/osal/common/TcpTmTcServer.h 0x4201;PUS11_InvalidTypeTimeWindow;No description;1;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h 0x4202;PUS11_InvalidTimeWindow;No description;2;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h 0x4203;PUS11_TimeshiftingNotPossible;No description;3;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h @@ -402,9 +402,9 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x4403;UXOS_CommandError;Command execution failed;3;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h 0x4404;UXOS_NoCommandLoadedOrPending;;4;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h 0x4406;UXOS_PcloseCallError;No description;6;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h -0x4500;HSPI_OpeningFileFailed;No description;0;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h -0x4501;HSPI_FullDuplexTransferFailed;No description;1;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h -0x4502;HSPI_HalfDuplexTransferFailed;No description;2;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h +0x4500;HSPI_HalTimeoutRetval;No description;0;HAL_SPI;fsfw/src/fsfw_hal/stm32h7/spi/spiDefinitions.h +0x4501;HSPI_HalBusyRetval;No description;1;HAL_SPI;fsfw/src/fsfw_hal/stm32h7/spi/spiDefinitions.h +0x4502;HSPI_HalErrorRetval;No description;2;HAL_SPI;fsfw/src/fsfw_hal/stm32h7/spi/spiDefinitions.h 0x4503;HSPI_Timeout;No description;3;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h 0x4504;HSPI_Busy;No description;4;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h 0x4505;HSPI_GenericError;No description;5;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h diff --git a/generators/bsp_q7s_events.csv b/generators/bsp_q7s_events.csv index 4d762f0e..442fc05c 100644 --- a/generators/bsp_q7s_events.csv +++ b/generators/bsp_q7s_events.csv @@ -99,6 +99,11 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 11301;0x2c25;SWITCH_HAS_CHANGED;INFO;Indicated that a switch state has changed P1: New switch state, 1 for on, 0 for off | P2: Switch Index;mission/power/defs.h 11302;0x2c26;SWITCHING_Q7S_DENIED;MEDIUM;No description;mission/power/defs.h 11303;0x2c27;FDIR_REACTION_IGNORED;MEDIUM;No description;mission/power/defs.h +11304;0x2c28;DATASET_READ_FAILED;INFO;The dataset read for the inputs of the Power Controller has failed.;mission/power/defs.h +11305;0x2c29;VOLTAGE_OUT_OF_BOUNDS;HIGH;The battery voltage read is out of the bounds in which it is supposed to be. P1: 1 too high, 0 too low;mission/power/defs.h +11306;0x2c2a;TIMEDELTA_OUT_OF_BOUNDS;LOW;Time difference for Coulomb Counter was too large.;mission/power/defs.h +11307;0x2c2b;POWER_LEVEL_LOW;HIGH;The State of Charge is below the limit for payload use. Setting Payload to faulty.;mission/power/defs.h +11308;0x2c2c;POWER_LEVEL_CRITICAL;HIGH;The State of Charge is below the limit for higher modes. Setting Reaction Wheels to faulty.;mission/power/defs.h 11400;0x2c88;GPIO_PULL_HIGH_FAILED;LOW;No description;mission/tcs/HeaterHandler.h 11401;0x2c89;GPIO_PULL_LOW_FAILED;LOW;No description;mission/tcs/HeaterHandler.h 11402;0x2c8a;HEATER_WENT_ON;INFO;No description;mission/tcs/HeaterHandler.h diff --git a/generators/bsp_q7s_objects.csv b/generators/bsp_q7s_objects.csv index eedafc52..914b7df6 100644 --- a/generators/bsp_q7s_objects.csv +++ b/generators/bsp_q7s_objects.csv @@ -1,6 +1,7 @@ 0x00005060;P60DOCK_TEST_TASK 0x43000002;ACS_CONTROLLER 0x43000003;CORE_CONTROLLER +0x43000004;POWER_CONTROLLER 0x43000006;GLOBAL_JSON_CFG 0x43400001;THERMAL_CONTROLLER 0x44120006;MGM_0_LIS3_HANDLER @@ -161,6 +162,7 @@ 0x73010002;PL_SUBSYSTEM 0x73010003;TCS_SUBSYSTEM 0x73010004;COM_SUBSYSTEM +0x73010005;EPS_SUBSYSTEM 0x73020001;MISC_TM_STORE 0x73020002;OK_TM_STORE 0x73020003;NOT_OK_TM_STORE diff --git a/generators/bsp_q7s_returnvalues.csv b/generators/bsp_q7s_returnvalues.csv index 1bc91860..065e5392 100644 --- a/generators/bsp_q7s_returnvalues.csv +++ b/generators/bsp_q7s_returnvalues.csv @@ -357,7 +357,6 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x3a02;MQI_Full;No space left for more messages;2;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h 0x3a03;MQI_NoReplyPartner;Returned if a reply method was called without partner;3;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h 0x3a04;MQI_DestinationInvalid;Returned if the target destination is invalid.;4;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h -0x3b00;SPH_ConnBroken;No description;0;SEMAPHORE_IF;fsfw/src/fsfw/osal/common/TcpTmTcServer.h 0x3b01;SPH_SemaphoreTimeout;No description;1;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h 0x3b02;SPH_SemaphoreNotOwned;No description;2;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h 0x3b03;SPH_SemaphoreInvalid;No description;3;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h @@ -373,6 +372,7 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x3e05;HKM_DatasetNotFound;No description;5;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h 0x3f01;DLEE_StreamTooShort;No description;1;DLE_ENCODER;fsfw/src/fsfw/globalfunctions/DleEncoder.h 0x3f02;DLEE_DecodingError;No description;2;DLE_ENCODER;fsfw/src/fsfw/globalfunctions/DleEncoder.h +0x4100;PUS9_ConnBroken;No description;0;PUS_SERVICE_9;fsfw/src/fsfw/osal/common/TcpTmTcServer.h 0x4201;PUS11_InvalidTypeTimeWindow;No description;1;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h 0x4202;PUS11_InvalidTimeWindow;No description;2;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h 0x4203;PUS11_TimeshiftingNotPossible;No description;3;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h @@ -402,9 +402,9 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x4403;UXOS_CommandError;Command execution failed;3;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h 0x4404;UXOS_NoCommandLoadedOrPending;;4;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h 0x4406;UXOS_PcloseCallError;No description;6;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h -0x4500;HSPI_OpeningFileFailed;No description;0;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h -0x4501;HSPI_FullDuplexTransferFailed;No description;1;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h -0x4502;HSPI_HalfDuplexTransferFailed;No description;2;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h +0x4500;HSPI_HalTimeoutRetval;No description;0;HAL_SPI;fsfw/src/fsfw_hal/stm32h7/spi/spiDefinitions.h +0x4501;HSPI_HalBusyRetval;No description;1;HAL_SPI;fsfw/src/fsfw_hal/stm32h7/spi/spiDefinitions.h +0x4502;HSPI_HalErrorRetval;No description;2;HAL_SPI;fsfw/src/fsfw_hal/stm32h7/spi/spiDefinitions.h 0x4503;HSPI_Timeout;No description;3;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h 0x4504;HSPI_Busy;No description;4;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h 0x4505;HSPI_GenericError;No description;5;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index d7a9d6aa..610a69fb 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 308 translations. + * @brief Auto-generated event translation file. Contains 313 translations. * @details - * Generated on: 2023-09-25 17:49:54 + * Generated on: 2023-09-28 15:53:20 */ #include "translateEvents.h" @@ -105,6 +105,11 @@ const char *SWITCH_CMD_SENT_STRING = "SWITCH_CMD_SENT"; const char *SWITCH_HAS_CHANGED_STRING = "SWITCH_HAS_CHANGED"; const char *SWITCHING_Q7S_DENIED_STRING = "SWITCHING_Q7S_DENIED"; const char *FDIR_REACTION_IGNORED_STRING = "FDIR_REACTION_IGNORED"; +const char *DATASET_READ_FAILED_STRING = "DATASET_READ_FAILED"; +const char *VOLTAGE_OUT_OF_BOUNDS_STRING = "VOLTAGE_OUT_OF_BOUNDS"; +const char *TIMEDELTA_OUT_OF_BOUNDS_STRING = "TIMEDELTA_OUT_OF_BOUNDS"; +const char *POWER_LEVEL_LOW_STRING = "POWER_LEVEL_LOW"; +const char *POWER_LEVEL_CRITICAL_STRING = "POWER_LEVEL_CRITICAL"; const char *GPIO_PULL_HIGH_FAILED_STRING = "GPIO_PULL_HIGH_FAILED"; const char *GPIO_PULL_LOW_FAILED_STRING = "GPIO_PULL_LOW_FAILED"; const char *HEATER_WENT_ON_STRING = "HEATER_WENT_ON"; @@ -516,6 +521,16 @@ const char *translateEvents(Event event) { return SWITCHING_Q7S_DENIED_STRING; case (11303): return FDIR_REACTION_IGNORED_STRING; + case (11304): + return DATASET_READ_FAILED_STRING; + case (11305): + return VOLTAGE_OUT_OF_BOUNDS_STRING; + case (11306): + return TIMEDELTA_OUT_OF_BOUNDS_STRING; + case (11307): + return POWER_LEVEL_LOW_STRING; + case (11308): + return POWER_LEVEL_CRITICAL_STRING; case (11400): return GPIO_PULL_HIGH_FAILED_STRING; case (11401): diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index 19e0bf82..4f191225 100644 --- a/generators/objects/translateObjects.cpp +++ b/generators/objects/translateObjects.cpp @@ -1,14 +1,15 @@ /** * @brief Auto-generated object translation file. * @details - * Contains 175 translations. - * Generated on: 2023-09-25 17:49:54 + * Contains 177 translations. + * Generated on: 2023-09-28 15:53:20 */ #include "translateObjects.h" const char *P60DOCK_TEST_TASK_STRING = "P60DOCK_TEST_TASK"; const char *ACS_CONTROLLER_STRING = "ACS_CONTROLLER"; const char *CORE_CONTROLLER_STRING = "CORE_CONTROLLER"; +const char *POWER_CONTROLLER_STRING = "POWER_CONTROLLER"; const char *GLOBAL_JSON_CFG_STRING = "GLOBAL_JSON_CFG"; const char *THERMAL_CONTROLLER_STRING = "THERMAL_CONTROLLER"; const char *MGM_0_LIS3_HANDLER_STRING = "MGM_0_LIS3_HANDLER"; @@ -169,6 +170,7 @@ const char *ACS_SUBSYSTEM_STRING = "ACS_SUBSYSTEM"; const char *PL_SUBSYSTEM_STRING = "PL_SUBSYSTEM"; const char *TCS_SUBSYSTEM_STRING = "TCS_SUBSYSTEM"; const char *COM_SUBSYSTEM_STRING = "COM_SUBSYSTEM"; +const char *EPS_SUBSYSTEM_STRING = "EPS_SUBSYSTEM"; const char *MISC_TM_STORE_STRING = "MISC_TM_STORE"; const char *OK_TM_STORE_STRING = "OK_TM_STORE"; const char *NOT_OK_TM_STORE_STRING = "NOT_OK_TM_STORE"; @@ -190,6 +192,8 @@ const char *translateObject(object_id_t object) { return ACS_CONTROLLER_STRING; case 0x43000003: return CORE_CONTROLLER_STRING; + case 0x43000004: + return POWER_CONTROLLER_STRING; case 0x43000006: return GLOBAL_JSON_CFG_STRING; case 0x43400001: @@ -510,6 +514,8 @@ const char *translateObject(object_id_t object) { return TCS_SUBSYSTEM_STRING; case 0x73010004: return COM_SUBSYSTEM_STRING; + case 0x73010005: + return EPS_SUBSYSTEM_STRING; case 0x73020001: return MISC_TM_STORE_STRING; case 0x73020002: diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index d7a9d6aa..610a69fb 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 308 translations. + * @brief Auto-generated event translation file. Contains 313 translations. * @details - * Generated on: 2023-09-25 17:49:54 + * Generated on: 2023-09-28 15:53:20 */ #include "translateEvents.h" @@ -105,6 +105,11 @@ const char *SWITCH_CMD_SENT_STRING = "SWITCH_CMD_SENT"; const char *SWITCH_HAS_CHANGED_STRING = "SWITCH_HAS_CHANGED"; const char *SWITCHING_Q7S_DENIED_STRING = "SWITCHING_Q7S_DENIED"; const char *FDIR_REACTION_IGNORED_STRING = "FDIR_REACTION_IGNORED"; +const char *DATASET_READ_FAILED_STRING = "DATASET_READ_FAILED"; +const char *VOLTAGE_OUT_OF_BOUNDS_STRING = "VOLTAGE_OUT_OF_BOUNDS"; +const char *TIMEDELTA_OUT_OF_BOUNDS_STRING = "TIMEDELTA_OUT_OF_BOUNDS"; +const char *POWER_LEVEL_LOW_STRING = "POWER_LEVEL_LOW"; +const char *POWER_LEVEL_CRITICAL_STRING = "POWER_LEVEL_CRITICAL"; const char *GPIO_PULL_HIGH_FAILED_STRING = "GPIO_PULL_HIGH_FAILED"; const char *GPIO_PULL_LOW_FAILED_STRING = "GPIO_PULL_LOW_FAILED"; const char *HEATER_WENT_ON_STRING = "HEATER_WENT_ON"; @@ -516,6 +521,16 @@ const char *translateEvents(Event event) { return SWITCHING_Q7S_DENIED_STRING; case (11303): return FDIR_REACTION_IGNORED_STRING; + case (11304): + return DATASET_READ_FAILED_STRING; + case (11305): + return VOLTAGE_OUT_OF_BOUNDS_STRING; + case (11306): + return TIMEDELTA_OUT_OF_BOUNDS_STRING; + case (11307): + return POWER_LEVEL_LOW_STRING; + case (11308): + return POWER_LEVEL_CRITICAL_STRING; case (11400): return GPIO_PULL_HIGH_FAILED_STRING; case (11401): diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index 19e0bf82..4f191225 100644 --- a/linux/fsfwconfig/objects/translateObjects.cpp +++ b/linux/fsfwconfig/objects/translateObjects.cpp @@ -1,14 +1,15 @@ /** * @brief Auto-generated object translation file. * @details - * Contains 175 translations. - * Generated on: 2023-09-25 17:49:54 + * Contains 177 translations. + * Generated on: 2023-09-28 15:53:20 */ #include "translateObjects.h" const char *P60DOCK_TEST_TASK_STRING = "P60DOCK_TEST_TASK"; const char *ACS_CONTROLLER_STRING = "ACS_CONTROLLER"; const char *CORE_CONTROLLER_STRING = "CORE_CONTROLLER"; +const char *POWER_CONTROLLER_STRING = "POWER_CONTROLLER"; const char *GLOBAL_JSON_CFG_STRING = "GLOBAL_JSON_CFG"; const char *THERMAL_CONTROLLER_STRING = "THERMAL_CONTROLLER"; const char *MGM_0_LIS3_HANDLER_STRING = "MGM_0_LIS3_HANDLER"; @@ -169,6 +170,7 @@ const char *ACS_SUBSYSTEM_STRING = "ACS_SUBSYSTEM"; const char *PL_SUBSYSTEM_STRING = "PL_SUBSYSTEM"; const char *TCS_SUBSYSTEM_STRING = "TCS_SUBSYSTEM"; const char *COM_SUBSYSTEM_STRING = "COM_SUBSYSTEM"; +const char *EPS_SUBSYSTEM_STRING = "EPS_SUBSYSTEM"; const char *MISC_TM_STORE_STRING = "MISC_TM_STORE"; const char *OK_TM_STORE_STRING = "OK_TM_STORE"; const char *NOT_OK_TM_STORE_STRING = "NOT_OK_TM_STORE"; @@ -190,6 +192,8 @@ const char *translateObject(object_id_t object) { return ACS_CONTROLLER_STRING; case 0x43000003: return CORE_CONTROLLER_STRING; + case 0x43000004: + return POWER_CONTROLLER_STRING; case 0x43000006: return GLOBAL_JSON_CFG_STRING; case 0x43400001: @@ -510,6 +514,8 @@ const char *translateObject(object_id_t object) { return TCS_SUBSYSTEM_STRING; case 0x73010004: return COM_SUBSYSTEM_STRING; + case 0x73010005: + return EPS_SUBSYSTEM_STRING; case 0x73020001: return MISC_TM_STORE_STRING; case 0x73020002: From 758add2928ccd43e996840202fa73a9837689309 Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 29 Sep 2023 09:50:48 +0200 Subject: [PATCH 099/257] improved events, allowed all modes, removed debug output --- mission/controller/PowerController.cpp | 17 ++++++++--------- mission/controller/PowerController.h | 2 +- mission/power/defs.h | 2 ++ 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/mission/controller/PowerController.cpp b/mission/controller/PowerController.cpp index 9347f681..054fcfd2 100644 --- a/mission/controller/PowerController.cpp +++ b/mission/controller/PowerController.cpp @@ -11,7 +11,6 @@ ReturnValue_t PowerController::initialize() { if (result != returnvalue::OK) { return result; } - sif::debug << "Rush B, no stop" << std::endl; return ExtendedControllerBase::initialize(); } @@ -92,7 +91,6 @@ void PowerController::performControlOperation() { } case InternalState::READY: { if (mode != MODE_OFF) { - sif::debug << "oh shit, now i gotta do something" << std::endl; calculateStateOfCharge(); if (mode == MODE_NORMAL) { watchStateOfCharge(); @@ -127,7 +125,7 @@ LocalPoolDataSetBase *PowerController::getDataSetHandle(sid_t sid) { ReturnValue_t PowerController::checkModeCommand(Mode_t mode, Submode_t submode, uint32_t *msToReachTheMode) { - if (mode == MODE_OFF) { + if (mode == MODE_OFF or mode == MODE_ON or mode == MODE_NORMAL) { if (submode == SUBMODE_NONE) { return returnvalue::OK; } else { @@ -251,8 +249,9 @@ ReturnValue_t PowerController::calculateOpenCircuitVoltageCharge() { ReturnValue_t PowerController::calculateCoulombCounterCharge() { double timeDiff = timevalOperations::toDouble(now - oldTime); if (timeDiff > maxAllowedTimeDiff) { - triggerEvent(power::TIMEDELTA_OUT_OF_BOUNDS); - sif::error << "Power Controller::Time delta too large for Coulomb Counter" << std::endl; + triggerEvent(power::TIMEDELTA_OUT_OF_BOUNDS, static_cast(timeDiff * 10)); + sif::error << "Power Controller::Time delta too large for Coulomb Counter: " << timeDiff + << std::endl; return returnvalue::FAILED; } if (not pwrCtrlCoreHk.coulombCounterCharge.isValid()) { @@ -298,12 +297,12 @@ float PowerController::linearInterpolation(float x, float x0, float x1, float y0 ReturnValue_t PowerController::lookUpTableOcvIdxFinder(float voltage, uint8_t &idx) { if (voltage >= lookUpTableOcv[1][99]) { - triggerEvent(power::VOLTAGE_OUT_OF_BOUNDS, 0); - sif::error << "Power Controller::Voltage is too high" << std::endl; + triggerEvent(power::VOLTAGE_OUT_OF_BOUNDS, 0, static_cast(voltage * 10)); + sif::error << "Power Controller::Voltage is too high: " << voltage << std::endl; return returnvalue::FAILED; } else if (voltage <= lookUpTableOcv[1][0]) { - triggerEvent(power::VOLTAGE_OUT_OF_BOUNDS, 1); - sif::error << "Power Controller::Voltage is too low" << std::endl; + triggerEvent(power::VOLTAGE_OUT_OF_BOUNDS, 1, static_cast(voltage * 10)); + sif::error << "Power Controller::Voltage is too low: " << voltage << std::endl; return returnvalue::FAILED; } while (lookUpTableOcv[1][idx] > voltage) { diff --git a/mission/controller/PowerController.h b/mission/controller/PowerController.h index 81522023..e374391e 100644 --- a/mission/controller/PowerController.h +++ b/mission/controller/PowerController.h @@ -55,7 +55,7 @@ class PowerController : public ExtendedControllerBase, public ReceivesParameterM // Parameters float batteryInternalResistance = 70.0 / 2.0 / 1000.0; // [Ohm] float batteryMaximumCapacity = 2.6 * 2; // [Ah] - float coulombCounterVoltageUpperThreshold = 16.2e3; // [mV] + float coulombCounterVoltageUpperThreshold = 16.2; // [V] double maxAllowedTimeDiff = 0.5; // [s] float payloadLimit = 0.75; // [%] float higherModesLimit = 0.6; // [%] diff --git a/mission/power/defs.h b/mission/power/defs.h index 22a8af53..28e5eca8 100644 --- a/mission/power/defs.h +++ b/mission/power/defs.h @@ -52,8 +52,10 @@ static constexpr Event DATASET_READ_FAILED = event::makeEvent(SUBSYSTEM_ID, 4, s //! [EXPORT] : [COMMENT] The battery voltage read is out of the bounds in which it is supposed to //! be. //! P1: 1 too high, 0 too low +//! P2: voltage in V * 10 static constexpr Event VOLTAGE_OUT_OF_BOUNDS = event::makeEvent(SUBSYSTEM_ID, 5, severity::HIGH); //! [EXPORT] : [COMMENT] Time difference for Coulomb Counter was too large. +//! P1: time in s * 10 static constexpr Event TIMEDELTA_OUT_OF_BOUNDS = event::makeEvent(SUBSYSTEM_ID, 6, severity::LOW); //! [EXPORT] : [COMMENT] The State of Charge is below the limit for payload use. Setting Payload to //! faulty. From 1abc5036147131cb141561bc35202498535906ee Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 29 Sep 2023 10:15:34 +0200 Subject: [PATCH 100/257] bump tmtc --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index 22a42108..dd74f6c3 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 22a42108b431bafa707de2b3a24cad9de95b70d0 +Subproject commit dd74f6c3ca0e730c7f316ed7959d2992c4a14fb4 From 69f5529adea173432eaebc2788643e17c555f274 Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 29 Sep 2023 10:16:23 +0200 Subject: [PATCH 101/257] added dataset for flag for pl usage --- mission/controller/PowerController.cpp | 33 +++++++++++++++++-- mission/controller/PowerController.h | 5 ++- .../PowerCtrlDefinitions.h | 13 +++++++- 3 files changed, 46 insertions(+), 5 deletions(-) diff --git a/mission/controller/PowerController.cpp b/mission/controller/PowerController.cpp index 054fcfd2..a7dbd37c 100644 --- a/mission/controller/PowerController.cpp +++ b/mission/controller/PowerController.cpp @@ -4,7 +4,8 @@ PowerController::PowerController(object_id_t objectId, bool enableHkSets) : ExtendedControllerBase(objectId), enableHkSets(enableHkSets), parameterHelper(this), - pwrCtrlCoreHk(this) {} + pwrCtrlCoreHk(this), + enablePl(this) {} ReturnValue_t PowerController::initialize() { ReturnValue_t result = parameterHelper.initialize(); @@ -54,9 +55,12 @@ ReturnValue_t PowerController::getParameter(uint8_t domainId, uint8_t parameterI parameterWrapper->set(maxAllowedTimeDiff); break; case 0x4: - parameterWrapper->set(payloadLimit); + parameterWrapper->set(payloadOpLimitOn); break; case 0x5: + parameterWrapper->set(payloadOpLimitLow); + break; + case 0x6: parameterWrapper->set(higherModesLimit); break; default: @@ -110,6 +114,8 @@ ReturnValue_t PowerController::initializeLocalDataPool(localpool::DataPool &loca new PoolEntry({0.0})); localDataPoolMap.emplace(pwrctrl::PoolIds::COULOMB_COUNTER_CHARGE, new PoolEntry({0.0})); poolManager.subscribeForRegularPeriodicPacket({pwrCtrlCoreHk.getSid(), enableHkSets, 60.0}); + localDataPoolMap.emplace(pwrctrl::PoolIds::PAYLOAD_FLAG, new PoolEntry({false})); + poolManager.subscribeForRegularPeriodicPacket({enablePl.getSid(), false, 60.0}); return returnvalue::OK; } @@ -117,6 +123,8 @@ LocalPoolDataSetBase *PowerController::getDataSetHandle(sid_t sid) { switch (sid.ownerSetId) { case pwrctrl::CORE_HK: return &pwrCtrlCoreHk; + case pwrctrl::ENABLE_PL: + return &enablePl; default: return nullptr; } @@ -217,7 +225,20 @@ void PowerController::calculateStateOfCharge() { void PowerController::watchStateOfCharge() { if (pwrCtrlCoreHk.coulombCounterCharge.isValid()) { - if (not pwrLvlLowFlag and pwrCtrlCoreHk.coulombCounterCharge.value < payloadLimit) { + if (pwrCtrlCoreHk.coulombCounterCharge.value < payloadOpLimitOn) { + PoolReadGuard pg(&enablePl); + if (pg.getReadResult() == returnvalue::OK) { + enablePl.plUseAllowed.value = false; + enablePl.plUseAllowed.setValid(true); + } + } else { + PoolReadGuard pg(&enablePl); + if (pg.getReadResult() == returnvalue::OK) { + enablePl.plUseAllowed.value = true; + enablePl.plUseAllowed.setValid(true); + } + } + if (not pwrLvlLowFlag and pwrCtrlCoreHk.coulombCounterCharge.value < payloadOpLimitLow) { triggerEvent(power::POWER_LEVEL_LOW); pwrLvlLowFlag = true; } else { @@ -229,6 +250,12 @@ void PowerController::watchStateOfCharge() { } else { pwrLvlCriticalFlag = false; } + } else { + PoolReadGuard pg(&enablePl); + if (pg.getReadResult() == returnvalue::OK) { + enablePl.plUseAllowed.value = false; + enablePl.plUseAllowed.setValid(true); + } } } diff --git a/mission/controller/PowerController.h b/mission/controller/PowerController.h index e374391e..afab21b4 100644 --- a/mission/controller/PowerController.h +++ b/mission/controller/PowerController.h @@ -57,7 +57,8 @@ class PowerController : public ExtendedControllerBase, public ReceivesParameterM float batteryMaximumCapacity = 2.6 * 2; // [Ah] float coulombCounterVoltageUpperThreshold = 16.2; // [V] double maxAllowedTimeDiff = 0.5; // [s] - float payloadLimit = 0.75; // [%] + float payloadOpLimitOn = 0.90; // [%] + float payloadOpLimitLow = 0.75; // [%] float higherModesLimit = 0.6; // [%] // OCV Look-up-Table {[Ah],[V]} @@ -121,6 +122,8 @@ class PowerController : public ExtendedControllerBase, public ReceivesParameterM P60Dock::CoreHkSet p60CoreHk = P60Dock::CoreHkSet(objects::P60DOCK_HANDLER); // Output Dataset pwrctrl::CoreHk pwrCtrlCoreHk; + // Dataset for PL Flag + pwrctrl::EnablePl enablePl; }; #endif /* MISSION_CONTROLLER_POWERCONTROLLER_H_ */ diff --git a/mission/controller/controllerdefinitions/PowerCtrlDefinitions.h b/mission/controller/controllerdefinitions/PowerCtrlDefinitions.h index f7cce708..ff090e5b 100644 --- a/mission/controller/controllerdefinitions/PowerCtrlDefinitions.h +++ b/mission/controller/controllerdefinitions/PowerCtrlDefinitions.h @@ -10,15 +10,17 @@ namespace pwrctrl { -enum SetIds : uint32_t { CORE_HK }; +enum SetIds : uint32_t { CORE_HK, ENABLE_PL }; enum PoolIds : lp_id_t { TOTAL_BATTERY_CURRENT, OPEN_CIRCUIT_VOLTAGE_CHARGE, COULOMB_COUNTER_CHARGE, + PAYLOAD_FLAG }; static constexpr uint8_t CORE_HK_ENTRIES = 3; +static constexpr uint8_t ENABLE_PL_ENTRIES = 1; class CoreHk : public StaticLocalDataSet { public: @@ -34,6 +36,15 @@ class CoreHk : public StaticLocalDataSet { private: }; +class EnablePl : public StaticLocalDataSet { + public: + EnablePl(HasLocalDataPoolIF* hkOwner) : StaticLocalDataSet(hkOwner, ENABLE_PL) {} + + lp_var_t plUseAllowed = lp_var_t(sid.objectId, PAYLOAD_FLAG, this); + + private: +}; + } // namespace pwrctrl #endif /* MISSION_CONTROLLER_CONTROLLERDEFINITIONS_POWERCTRLDEFINITIONS_H_ */ From 9f8e7b6673db1618fcff669123036205d2dd5120 Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 29 Sep 2023 10:29:52 +0200 Subject: [PATCH 102/257] enable dataset to be called by non-owner --- mission/controller/controllerdefinitions/PowerCtrlDefinitions.h | 1 + 1 file changed, 1 insertion(+) diff --git a/mission/controller/controllerdefinitions/PowerCtrlDefinitions.h b/mission/controller/controllerdefinitions/PowerCtrlDefinitions.h index ff090e5b..1b378cd0 100644 --- a/mission/controller/controllerdefinitions/PowerCtrlDefinitions.h +++ b/mission/controller/controllerdefinitions/PowerCtrlDefinitions.h @@ -39,6 +39,7 @@ class CoreHk : public StaticLocalDataSet { class EnablePl : public StaticLocalDataSet { public: EnablePl(HasLocalDataPoolIF* hkOwner) : StaticLocalDataSet(hkOwner, ENABLE_PL) {} + EnablePl(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, ENABLE_PL)) {} lp_var_t plUseAllowed = lp_var_t(sid.objectId, PAYLOAD_FLAG, this); From 9472faf899687c3eb0ef3ef5ce6725c519739a34 Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 29 Sep 2023 10:30:26 +0200 Subject: [PATCH 103/257] set plFlag to invalid if PWR ctrl is in on --- mission/controller/PowerController.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mission/controller/PowerController.cpp b/mission/controller/PowerController.cpp index a7dbd37c..ef625d8a 100644 --- a/mission/controller/PowerController.cpp +++ b/mission/controller/PowerController.cpp @@ -98,6 +98,11 @@ void PowerController::performControlOperation() { calculateStateOfCharge(); if (mode == MODE_NORMAL) { watchStateOfCharge(); + } else { + PoolReadGuard pg(&enablePl); + if (pg.getReadResult() == returnvalue::OK) { + enablePl.setValidity(false, true); + } } } break; @@ -229,13 +234,13 @@ void PowerController::watchStateOfCharge() { PoolReadGuard pg(&enablePl); if (pg.getReadResult() == returnvalue::OK) { enablePl.plUseAllowed.value = false; - enablePl.plUseAllowed.setValid(true); + enablePl.setValidity(true, true); } } else { PoolReadGuard pg(&enablePl); if (pg.getReadResult() == returnvalue::OK) { enablePl.plUseAllowed.value = true; - enablePl.plUseAllowed.setValid(true); + enablePl.setValidity(true, true); } } if (not pwrLvlLowFlag and pwrCtrlCoreHk.coulombCounterCharge.value < payloadOpLimitLow) { @@ -254,7 +259,7 @@ void PowerController::watchStateOfCharge() { PoolReadGuard pg(&enablePl); if (pg.getReadResult() == returnvalue::OK) { enablePl.plUseAllowed.value = false; - enablePl.plUseAllowed.setValid(true); + enablePl.setValidity(true, true); } } } From 509243a47fdf39b8c2ee1fc94cb5ef8d4946b6c7 Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 29 Sep 2023 14:18:42 +0200 Subject: [PATCH 104/257] eive system event handling --- mission/system/EiveSystem.cpp | 110 ++++++++++++++++++++++++++++++++++ mission/system/EiveSystem.h | 11 ++++ 2 files changed, 121 insertions(+) diff --git a/mission/system/EiveSystem.cpp b/mission/system/EiveSystem.cpp index 6519806e..6e0097f5 100644 --- a/mission/system/EiveSystem.cpp +++ b/mission/system/EiveSystem.cpp @@ -81,6 +81,55 @@ ReturnValue_t EiveSystem::initialize() { return result; } + auto* plSs = ObjectManager::instance()->get(objects::PL_SUBSYSTEM); + if (plSs == nullptr) { + return ObjectManager::CHILD_INIT_FAILED; + } + plSsQueueId = plSs->getCommandQueue(); + + auto* plPcdu = ObjectManager::instance()->get(objects::PLPCDU_HANDLER); + if (plPcdu == nullptr) { + return ObjectManager::CHILD_INIT_FAILED; + } + plPcduQueueId = plPcdu->getCommandQueue(); + + auto* plocMpsoc = ObjectManager::instance()->get(objects::PLOC_MPSOC_HANDLER); + if (plocMpsoc == nullptr) { + return ObjectManager::CHILD_INIT_FAILED; + } + plocMpsocQueueId = plocMpsoc->getCommandQueue(); + + auto* plocSupervisor = + ObjectManager::instance()->get(objects::PLOC_SUPERVISOR_HANDLER); + if (plocSupervisor == nullptr) { + return ObjectManager::CHILD_INIT_FAILED; + } + plocSupervisorQueueId = plocSupervisor->getCommandQueue(); + + auto* camera = ObjectManager::instance()->get(objects::CAM_SWITCHER); + if (camera == nullptr) { + return ObjectManager::CHILD_INIT_FAILED; + } + cameraQueueId = camera->getCommandQueue(); + + auto* scex = ObjectManager::instance()->get(objects::SCEX); + if (scex == nullptr) { + return ObjectManager::CHILD_INIT_FAILED; + } + scexQueueId = scex->getCommandQueue(); + + auto* radSensor = ObjectManager::instance()->get(objects::RAD_SENSOR); + if (radSensor == nullptr) { + return ObjectManager::CHILD_INIT_FAILED; + } + radSensorQueueId = radSensor->getCommandQueue(); + + auto* str = ObjectManager::instance()->get(objects::STAR_TRACKER); + if (str == nullptr) { + return ObjectManager::CHILD_INIT_FAILED; + } + strQueueId = str->getCommandQueue(); + auto* bpxDest = ObjectManager::instance()->get(objects::BPX_BATT_HANDLER); if (bpxDest == nullptr) { return ObjectManager::CHILD_INIT_FAILED; @@ -120,6 +169,8 @@ ReturnValue_t EiveSystem::initialize() { manager->subscribeToEvent(eventQueue->getId(), event::getEventId(tcsCtrl::OBC_OVERHEATING)); manager->subscribeToEvent(eventQueue->getId(), event::getEventId(tcsCtrl::MGT_OVERHEATING)); manager->subscribeToEvent(eventQueue->getId(), event::getEventId(pdec::INVALID_TC_FRAME)); + manager->subscribeToEvent(eventQueue->getId(), event::getEventId(power::POWER_LEVEL_LOW)); + manager->subscribeToEvent(eventQueue->getId(), event::getEventId(power::POWER_LEVEL_CRITICAL)); return Subsystem::initialize(); } @@ -151,6 +202,22 @@ void EiveSystem::handleEventMessages() { commandSelfToSafe(); break; } + case power::POWER_LEVEL_LOW: { + forceOffPayload(); + break; + } + case power::POWER_LEVEL_CRITICAL: + CommandMessage msg; + ModeMessage::setModeMessage(&msg, ModeMessage::CMD_MODE_COMMAND_FORCED, + HasModesIF::MODE_OFF, HasModesIF::SUBMODE_NONE); + HealthMessage::setHealthMessage(&msg, HealthMessage::HEALTH_SET, HasHealthIF::FAULTY); + ReturnValue_t result = MessageQueueSenderIF::sendMessage( + strQueueId, &msg, MessageQueueIF::NO_QUEUE, false); + if (result != returnvalue::OK) { + sif::error << "EIVE System: Sending FAULTY command to STR Assembly failed" + << std::endl; + } + break; } break; default: @@ -336,6 +403,49 @@ void EiveSystem::pdecRecoveryLogic() { } } +void EiveSystem::forceOffPayload() { + CommandMessage msg; + // turn off PL Subsystem + ModeMessage::setModeMessage(&msg, ModeMessage::CMD_MODE_COMMAND_FORCED, HasModesIF::MODE_OFF, + HasModesIF::SUBMODE_NONE); + ReturnValue_t result = commandQueue->sendMessage(plSsQueueId, &msg); + if (result != returnvalue::OK) { + sif::error << "EIVE System: Sending OFF command to PL Subsystem failed" << std::endl; + } + // set PL to faulty + HealthMessage::setHealthMessage(&msg, HealthMessage::HEALTH_SET, HasHealthIF::FAULTY); + + result = commandQueue->sendMessage(plPcduQueueId, &msg); + if (result != returnvalue::OK) { + sif::error << "EIVE System: Sending FAULTY command to PL PCDU failed" << std::endl; + } + + 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(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; + } +} + void EiveSystem::commonI2cRecoverySequenceFinish() { alreadyTriedI2cRecovery = true; performI2cReboot = false; diff --git a/mission/system/EiveSystem.h b/mission/system/EiveSystem.h index e6ff19b9..78f8bdc9 100644 --- a/mission/system/EiveSystem.h +++ b/mission/system/EiveSystem.h @@ -49,6 +49,15 @@ class EiveSystem : public Subsystem, public HasActionsIF { PowerSwitchIF* powerSwitcher = nullptr; std::atomic_uint16_t& i2cErrors; + MessageQueueId_t plSsQueueId = MessageQueueIF::NO_QUEUE; + MessageQueueId_t plPcduQueueId = MessageQueueIF::NO_QUEUE; + MessageQueueId_t plocMpsocQueueId = MessageQueueIF::NO_QUEUE; + MessageQueueId_t plocSupervisorQueueId = MessageQueueIF::NO_QUEUE; + MessageQueueId_t cameraQueueId = MessageQueueIF::NO_QUEUE; + MessageQueueId_t scexQueueId = MessageQueueIF::NO_QUEUE; + MessageQueueId_t radSensorQueueId = MessageQueueIF::NO_QUEUE; + MessageQueueId_t strQueueId = MessageQueueIF::NO_QUEUE; + MessageQueueId_t pdecHandlerQueueId = MessageQueueIF::NO_QUEUE; MessageQueueId_t bpxBattQueueId = MessageQueueIF::NO_QUEUE; @@ -68,6 +77,8 @@ class EiveSystem : public Subsystem, public HasActionsIF { ReturnValue_t sendFullRebootCommand(); ReturnValue_t sendSelfRebootCommand(); + void forceOffPayload(); + void pdecRecoveryLogic(); void i2cRecoveryLogic(); From fda76e24ae7fa819f2b7d05143a7959846ab6acc Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 29 Sep 2023 14:30:57 +0200 Subject: [PATCH 105/257] pl pcdu mode change soc check --- mission/payload/PayloadPcduHandler.cpp | 13 +++++++++++++ mission/payload/PayloadPcduHandler.h | 5 +++++ 2 files changed, 18 insertions(+) diff --git a/mission/payload/PayloadPcduHandler.cpp b/mission/payload/PayloadPcduHandler.cpp index 1e6d16db..1a2b35ff 100644 --- a/mission/payload/PayloadPcduHandler.cpp +++ b/mission/payload/PayloadPcduHandler.cpp @@ -564,6 +564,19 @@ bool PayloadPcduHandler::checkCurrent(float val, float upperBound, Event event) return true; } +ReturnValue_t PayloadPcduHandler::checkModeCommand(Mode_t commandedMode, Submode_t commandedSubmode, + uint32_t* msToReachTheMode) { + if (commandedMode != MODE_OFF) { + PoolReadGuard pg(&enablePl); + if (pg.getReadResult() == returnvalue::OK) { + if (enablePl.plUseAllowed.isValid() and not enablePl.plUseAllowed.value) { + return NON_OP_SOC; + } + } + } + return DeviceHandlerBase::checkModeCommand(commandedMode, commandedSubmode, msToReachTheMode); +} + ReturnValue_t PayloadPcduHandler::isModeCombinationValid(Mode_t mode, Submode_t submode) { using namespace plpcdu; if (mode == MODE_NORMAL) { diff --git a/mission/payload/PayloadPcduHandler.h b/mission/payload/PayloadPcduHandler.h index d9370dcf..e96eadf1 100644 --- a/mission/payload/PayloadPcduHandler.h +++ b/mission/payload/PayloadPcduHandler.h @@ -4,6 +4,7 @@ #include #include #include +#include #include #include @@ -76,6 +77,8 @@ class PayloadPcduHandler : public DeviceHandlerBase { #endif private: + pwrctrl::EnablePl enablePl = pwrctrl::EnablePl(objects::POWER_CONTROLLER); + static constexpr bool NO_ADC_CHECKS = false; enum class States : uint8_t { @@ -152,6 +155,8 @@ class PayloadPcduHandler : public DeviceHandlerBase { uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override; ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap, LocalDataPoolManager& poolManager) override; + ReturnValue_t checkModeCommand(Mode_t commandedMode, Submode_t commandedSubmode, + uint32_t* msToReachTheMode) override; ReturnValue_t isModeCombinationValid(Mode_t mode, Submode_t submode) override; ReturnValue_t getParameter(uint8_t domainId, uint8_t uniqueId, ParameterWrapper* parameterWrapper, const ParameterWrapper* newValues, uint16_t startAtIndex) override; From b66b202373eb9a04ecda4a920b1fa94e354c25d4 Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 29 Sep 2023 14:31:14 +0200 Subject: [PATCH 106/257] bump fsfw --- fsfw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsfw b/fsfw index d246ce34..19093866 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit d246ce34d05ecc5c722fd127e61556374961c899 +Subproject commit 19093866eeffe96c4f6f454df2dc7e2502f8d2f6 From 8847ed611d0340283a6df4913a9abf547f0b4382 Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 29 Sep 2023 15:26:21 +0200 Subject: [PATCH 107/257] cam switcher mode change soc check --- mission/system/objects/CamSwitcher.cpp | 16 +++++++++++++++- mission/system/objects/CamSwitcher.h | 8 +++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/mission/system/objects/CamSwitcher.cpp b/mission/system/objects/CamSwitcher.cpp index 90a78945..93b67646 100644 --- a/mission/system/objects/CamSwitcher.cpp +++ b/mission/system/objects/CamSwitcher.cpp @@ -1,6 +1,6 @@ #include "CamSwitcher.h" -CamSwitcher::CamSwitcher(object_id_t objectId, PowerSwitchIF &pwrSwitcher, +CamSwitcher::CamSwitcher(object_id_t objectId, PowerSwitchIF& pwrSwitcher, power::Switch_t pwrSwitch) : PowerSwitcherComponent(objectId, &pwrSwitcher, pwrSwitch) {} void CamSwitcher::performFaultyOperation() { @@ -8,3 +8,17 @@ void CamSwitcher::performFaultyOperation() { switcher.turnOff(); } } + +ReturnValue_t CamSwitcher::checkModeCommand(Mode_t commandedMode, Submode_t commandedSubmode, + uint32_t* msToReachTheMode) { + if (commandedMode != MODE_OFF) { + PoolReadGuard pg(&enablePl); + if (pg.getReadResult() == returnvalue::OK) { + if (enablePl.plUseAllowed.isValid() and not enablePl.plUseAllowed.value) { + return TRANS_NOT_ALLOWED; + } + } + } + return PowerSwitcherComponent::checkModeCommand(commandedMode, commandedSubmode, + msToReachTheMode); +} diff --git a/mission/system/objects/CamSwitcher.h b/mission/system/objects/CamSwitcher.h index 57f371ce..a0d1b242 100644 --- a/mission/system/objects/CamSwitcher.h +++ b/mission/system/objects/CamSwitcher.h @@ -1,13 +1,19 @@ #ifndef MISSION_SYSTEM_OBJECTS_CAMSWITCHER_H_ #define MISSION_SYSTEM_OBJECTS_CAMSWITCHER_H_ +#include #include +#include class CamSwitcher : public PowerSwitcherComponent { public: - CamSwitcher(object_id_t objectId, PowerSwitchIF &pwrSwitcher, power::Switch_t pwrSwitch); + CamSwitcher(object_id_t objectId, PowerSwitchIF& pwrSwitcher, power::Switch_t pwrSwitch); private: + pwrctrl::EnablePl enablePl = pwrctrl::EnablePl(objects::POWER_CONTROLLER); + ReturnValue_t checkModeCommand(Mode_t commandedMode, Submode_t commandedSubmode, + uint32_t* msToReachTheMode) override; + void performFaultyOperation() override; }; From 2a66f335f244672a4b2e2cb4d5b44605c26837cf Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 29 Sep 2023 15:27:03 +0200 Subject: [PATCH 108/257] bump fsfw --- fsfw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsfw b/fsfw index 19093866..e3a81544 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 19093866eeffe96c4f6f454df2dc7e2502f8d2f6 +Subproject commit e3a815444e401fc2fa75f6f19b40a18eceee08a5 From 2966ee500522df896c1e33311ba0a6cb41e6bf04 Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 29 Sep 2023 15:32:38 +0200 Subject: [PATCH 109/257] boop --- mission/payload/PayloadPcduHandler.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mission/payload/PayloadPcduHandler.h b/mission/payload/PayloadPcduHandler.h index e96eadf1..a4574f53 100644 --- a/mission/payload/PayloadPcduHandler.h +++ b/mission/payload/PayloadPcduHandler.h @@ -77,8 +77,6 @@ class PayloadPcduHandler : public DeviceHandlerBase { #endif private: - pwrctrl::EnablePl enablePl = pwrctrl::EnablePl(objects::POWER_CONTROLLER); - static constexpr bool NO_ADC_CHECKS = false; enum class States : uint8_t { @@ -155,8 +153,6 @@ class PayloadPcduHandler : public DeviceHandlerBase { uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override; ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap, LocalDataPoolManager& poolManager) override; - ReturnValue_t checkModeCommand(Mode_t commandedMode, Submode_t commandedSubmode, - uint32_t* msToReachTheMode) override; ReturnValue_t isModeCombinationValid(Mode_t mode, Submode_t submode) override; ReturnValue_t getParameter(uint8_t domainId, uint8_t uniqueId, ParameterWrapper* parameterWrapper, const ParameterWrapper* newValues, uint16_t startAtIndex) override; @@ -175,6 +171,10 @@ class PayloadPcduHandler : public DeviceHandlerBase { ReturnValue_t handleDoubleParamUpdate(std::string key, ParameterWrapper* parameterWrapper, const ParameterWrapper* newValues); LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override; + + pwrctrl::EnablePl enablePl = pwrctrl::EnablePl(objects::POWER_CONTROLLER); + ReturnValue_t checkModeCommand(Mode_t commandedMode, Submode_t commandedSubmode, + uint32_t* msToReachTheMode) override; }; #endif /* LINUX_DEVICES_PLPCDUHANDLER_H_ */ From cbfcee0b1c3aff5c65ff75e0e1891af65a75aab9 Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 29 Sep 2023 15:33:09 +0200 Subject: [PATCH 110/257] ploc mpsoc mode change soc check --- linux/payload/PlocMpsocHandler.cpp | 13 +++++++++++++ linux/payload/PlocMpsocHandler.h | 5 +++++ 2 files changed, 18 insertions(+) diff --git a/linux/payload/PlocMpsocHandler.cpp b/linux/payload/PlocMpsocHandler.cpp index 2421fcaa..d4c663e6 100644 --- a/linux/payload/PlocMpsocHandler.cpp +++ b/linux/payload/PlocMpsocHandler.cpp @@ -1505,3 +1505,16 @@ void PlocMpsocHandler::cmdDoneHandler(bool success, ReturnValue_t result) { } disableAllReplies(); } + +ReturnValue_t PlocMpsocHandler::checkModeCommand(Mode_t commandedMode, Submode_t commandedSubmode, + uint32_t* msToReachTheMode) { + if (commandedMode != MODE_OFF) { + PoolReadGuard pg(&enablePl); + if (pg.getReadResult() == returnvalue::OK) { + if (enablePl.plUseAllowed.isValid() and not enablePl.plUseAllowed.value) { + return NON_OP_SOC; + } + } + } + return DeviceHandlerBase::checkModeCommand(commandedMode, commandedSubmode, msToReachTheMode); +} diff --git a/linux/payload/PlocMpsocHandler.h b/linux/payload/PlocMpsocHandler.h index 10171ef5..0203b942 100644 --- a/linux/payload/PlocMpsocHandler.h +++ b/linux/payload/PlocMpsocHandler.h @@ -5,6 +5,7 @@ #include #include #include +#include #include @@ -309,6 +310,10 @@ class PlocMpsocHandler : public DeviceHandlerBase, public CommandsActionsIF { void stopSpecialComHelper(); void handleActionCommandFailure(ActionId_t actionId); + + pwrctrl::EnablePl enablePl = pwrctrl::EnablePl(objects::POWER_CONTROLLER); + ReturnValue_t checkModeCommand(Mode_t commandedMode, Submode_t commandedSubmode, + uint32_t* msToReachTheMode) override; }; #endif /* BSP_Q7S_DEVICES_PLOC_PLOCMPSOCHANDLER_H_ */ From 59bc783045ee8e925f4866583f463c706dd963bc Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 29 Sep 2023 15:37:47 +0200 Subject: [PATCH 111/257] ploc supervisor mode change soc check --- linux/payload/PlocSupervisorHandler.cpp | 14 ++++++++++++++ linux/payload/PlocSupervisorHandler.h | 5 +++++ 2 files changed, 19 insertions(+) diff --git a/linux/payload/PlocSupervisorHandler.cpp b/linux/payload/PlocSupervisorHandler.cpp index 0aaa7cfb..648ea74c 100644 --- a/linux/payload/PlocSupervisorHandler.cpp +++ b/linux/payload/PlocSupervisorHandler.cpp @@ -1993,6 +1993,20 @@ uint32_t PlocSupervisorHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t mod return 7000; } +ReturnValue_t PlocSupervisorHandler::checkModeCommand(Mode_t commandedMode, + Submode_t commandedSubmode, + uint32_t* msToReachTheMode) { + if (commandedMode != MODE_OFF) { + PoolReadGuard pg(&enablePl); + if (pg.getReadResult() == returnvalue::OK) { + if (enablePl.plUseAllowed.isValid() and not enablePl.plUseAllowed.value) { + return NON_OP_SOC; + } + } + } + return DeviceHandlerBase::checkModeCommand(commandedMode, commandedSubmode, msToReachTheMode); +} + // ReturnValue_t PlocSupervisorHandler::checkMramPacketApid() { // uint16_t apid = (spacePacketBuffer[0] << 8 | spacePacketBuffer[1]) & supv::APID_MASK; // TODO: Fix diff --git a/linux/payload/PlocSupervisorHandler.h b/linux/payload/PlocSupervisorHandler.h index 3e5ac2a0..d7c5cb1e 100644 --- a/linux/payload/PlocSupervisorHandler.h +++ b/linux/payload/PlocSupervisorHandler.h @@ -3,6 +3,7 @@ #include #include +#include #include "OBSWConfig.h" #include "devices/powerSwitcherList.h" @@ -395,6 +396,10 @@ class PlocSupervisorHandler : public DeviceHandlerBase { void handleExecutionFailureReport(ExecutionReport& report); void printAckFailureInfo(uint16_t statusCode, DeviceCommandId_t commandId); + + pwrctrl::EnablePl enablePl = pwrctrl::EnablePl(objects::POWER_CONTROLLER); + ReturnValue_t checkModeCommand(Mode_t commandedMode, Submode_t commandedSubmode, + uint32_t* msToReachTheMode) override; }; #endif /* MISSION_DEVICES_PLOCSUPERVISORHANDLER_H_ */ From 0e4872165550b475772020b54aad9e3eb66255e4 Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 29 Sep 2023 15:56:07 +0200 Subject: [PATCH 112/257] spam protection --- mission/controller/PowerController.cpp | 12 ++++++++++-- mission/controller/PowerController.h | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/mission/controller/PowerController.cpp b/mission/controller/PowerController.cpp index ef625d8a..bd760012 100644 --- a/mission/controller/PowerController.cpp +++ b/mission/controller/PowerController.cpp @@ -281,6 +281,7 @@ ReturnValue_t PowerController::calculateOpenCircuitVoltageCharge() { ReturnValue_t PowerController::calculateCoulombCounterCharge() { double timeDiff = timevalOperations::toDouble(now - oldTime); if (timeDiff > maxAllowedTimeDiff) { + // should not be a permanent state so no spam protection required triggerEvent(power::TIMEDELTA_OUT_OF_BOUNDS, static_cast(timeDiff * 10)); sif::error << "Power Controller::Time delta too large for Coulomb Counter: " << timeDiff << std::endl; @@ -329,14 +330,21 @@ float PowerController::linearInterpolation(float x, float x0, float x1, float y0 ReturnValue_t PowerController::lookUpTableOcvIdxFinder(float voltage, uint8_t &idx) { if (voltage >= lookUpTableOcv[1][99]) { - triggerEvent(power::VOLTAGE_OUT_OF_BOUNDS, 0, static_cast(voltage * 10)); + if (not voltageOutOfBoundsFlag) { + triggerEvent(power::VOLTAGE_OUT_OF_BOUNDS, 0, static_cast(voltage * 10)); + voltageOutOfBoundsFlag = true; + } sif::error << "Power Controller::Voltage is too high: " << voltage << std::endl; return returnvalue::FAILED; } else if (voltage <= lookUpTableOcv[1][0]) { - triggerEvent(power::VOLTAGE_OUT_OF_BOUNDS, 1, static_cast(voltage * 10)); + if (not voltageOutOfBoundsFlag) { + triggerEvent(power::VOLTAGE_OUT_OF_BOUNDS, 1, static_cast(voltage * 10)); + voltageOutOfBoundsFlag = true; + } sif::error << "Power Controller::Voltage is too low: " << voltage << std::endl; return returnvalue::FAILED; } + voltageOutOfBoundsFlag = false; while (lookUpTableOcv[1][idx] > voltage) { idx--; } diff --git a/mission/controller/PowerController.h b/mission/controller/PowerController.h index afab21b4..adff4733 100644 --- a/mission/controller/PowerController.h +++ b/mission/controller/PowerController.h @@ -116,6 +116,7 @@ class PowerController : public ExtendedControllerBase, public ReceivesParameterM bool pwrLvlLowFlag = false; bool pwrLvlCriticalFlag = false; + bool voltageOutOfBoundsFlag = false; // HK Datasets for Calculation BpxBatteryHk bpxBatteryHk = BpxBatteryHk(objects::BPX_BATT_HANDLER); From 9c1eee075c53c9bca1cefe7d5faf7d6267b6f730 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 2 Oct 2023 14:15:50 +0200 Subject: [PATCH 113/257] well that was fast --- bsp_q7s/core/CMakeLists.txt | 3 ++- bsp_q7s/core/XiphosWdtHandler.cpp | 39 +++++++++++++++++++++++++++++++ bsp_q7s/core/XiphosWdtHandler.h | 22 +++++++++++++++++ bsp_q7s/em/emObjectFactory.cpp | 2 ++ bsp_q7s/fmObjectFactory.cpp | 2 ++ bsp_q7s/scheduling.cpp | 9 +++++++ common/config/eive/objects.h | 1 + tmtc | 2 +- 8 files changed, 78 insertions(+), 2 deletions(-) create mode 100644 bsp_q7s/core/XiphosWdtHandler.cpp create mode 100644 bsp_q7s/core/XiphosWdtHandler.h diff --git a/bsp_q7s/core/CMakeLists.txt b/bsp_q7s/core/CMakeLists.txt index 33550144..530b53e9 100644 --- a/bsp_q7s/core/CMakeLists.txt +++ b/bsp_q7s/core/CMakeLists.txt @@ -1 +1,2 @@ -target_sources(${OBSW_NAME} PRIVATE CoreController.cpp WatchdogHandler.cpp) +target_sources(${OBSW_NAME} PRIVATE CoreController.cpp WatchdogHandler.cpp + XiphosWdtHandler.cpp) diff --git a/bsp_q7s/core/XiphosWdtHandler.cpp b/bsp_q7s/core/XiphosWdtHandler.cpp new file mode 100644 index 00000000..38d206db --- /dev/null +++ b/bsp_q7s/core/XiphosWdtHandler.cpp @@ -0,0 +1,39 @@ +#include "XiphosWdtHandler.h" + +XiphosWdtHandler::XiphosWdtHandler(object_id_t objectId) : SystemObject(objectId) {} + +ReturnValue_t XiphosWdtHandler::initialize() { + int result = xsc_watchdog_init(&wdtHandle); + if (result != 0) { + sif::error << "XiphosWdtHandler: Initiating watchdog failed with code " << result << ": " + << strerror(result) << std::endl; + return ObjectManagerIF::CHILD_INIT_FAILED; + } + if (wdtHandle == nullptr) { + sif::error << "XiphosWdtHandler: WDT handle is nullptr!" << std::endl; + return ObjectManagerIF::CHILD_INIT_FAILED; + } + result = xsc_watchdog_set_timeout(wdtHandle, timeoutSeconds); + if (result != 0) { + sif::error << "XiphosWdtHandler: Setting WDT timeout of " << timeoutSeconds + << " seconds failed with code " << result << ": " << strerror(result) << std::endl; + return ObjectManagerIF::CHILD_INIT_FAILED; + } + result = xsc_watchdog_enable(wdtHandle); + if (result != 0) { + sif::error << "XiphosWdtHandler: Enabling WDT failed with code " << result << ": " + << strerror(result) << std::endl; + return ObjectManagerIF::CHILD_INIT_FAILED; + } + return returnvalue::OK; +} + +ReturnValue_t XiphosWdtHandler::performOperation(uint8_t opCode) { + int result = xsc_watchdog_keepalive(wdtHandle); + if (result != 0) { + sif::warning << "XiphosWdtHandler: Feeding WDT failed with code " << result << ": " + << strerror(result) << std::endl; + return returnvalue::FAILED; + } + return returnvalue::OK; +} diff --git a/bsp_q7s/core/XiphosWdtHandler.h b/bsp_q7s/core/XiphosWdtHandler.h new file mode 100644 index 00000000..346c13ef --- /dev/null +++ b/bsp_q7s/core/XiphosWdtHandler.h @@ -0,0 +1,22 @@ +#ifndef BSP_Q7S_CORE_XIPHOSWDTHANDLER_H_ +#define BSP_Q7S_CORE_XIPHOSWDTHANDLER_H_ + +#include +#include +#include +#include + +class XiphosWdtHandler : public SystemObject, public ExecutableObjectIF { + public: + XiphosWdtHandler(object_id_t objectId); + ReturnValue_t performOperation(uint8_t opCode) override; + ReturnValue_t initialize() override; + + private: + // Timeout duration range specified by Xiphos: 0.001 seconds to 171 seconds. The libxiphos API + // expects an int, so I guess this translates to 1 to 171 seconds. + uint32_t timeoutSeconds = 60; + struct watchdog_s* wdtHandle = nullptr; +}; + +#endif /* BSP_Q7S_CORE_XIPHOSWDTHANDLER_H_ */ diff --git a/bsp_q7s/em/emObjectFactory.cpp b/bsp_q7s/em/emObjectFactory.cpp index 976602d4..06867a1c 100644 --- a/bsp_q7s/em/emObjectFactory.cpp +++ b/bsp_q7s/em/emObjectFactory.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -37,6 +38,7 @@ void ObjectFactory::produce(void* args) { PersistentTmStores stores; readFirmwareVersion(); + new XiphosWdtHandler(objects::XIPHOS_WDT); ObjectFactory::produceGenericObjects(&healthTable, &pusFunnel, &cfdpFunnel, *SdCardManager::instance(), &ipcStore, &tmStore, stores, 200, enableHkSets); diff --git a/bsp_q7s/fmObjectFactory.cpp b/bsp_q7s/fmObjectFactory.cpp index a3ab6bba..83e3d90b 100644 --- a/bsp_q7s/fmObjectFactory.cpp +++ b/bsp_q7s/fmObjectFactory.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -34,6 +35,7 @@ void ObjectFactory::produce(void* args) { PersistentTmStores stores; readFirmwareVersion(); + new XiphosWdtHandler(objects::XIPHOS_WDT); ObjectFactory::produceGenericObjects(&healthTable, &pusFunnel, &cfdpFunnel, *SdCardManager::instance(), &ipcStore, &tmStore, stores, 200, true); diff --git a/bsp_q7s/scheduling.cpp b/bsp_q7s/scheduling.cpp index d7c179ad..7a94c118 100644 --- a/bsp_q7s/scheduling.cpp +++ b/bsp_q7s/scheduling.cpp @@ -82,6 +82,14 @@ void scheduling::initTasks() { } #endif + PeriodicTaskIF* xiphosWdtTask = + factory->createPeriodicTask("XIPHOS_WDT", 90, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.4, + missedDeadlineFunc, &RR_SCHEDULING); + result = xiphosWdtTask->addComponent(objects::XIPHOS_WDT); + if (result != returnvalue::OK) { + scheduling::printAddObjectError("XIPHOS_WDT", objects::XIPHOS_WDT); + } + PeriodicTaskIF* coreCtrlTask = factory->createPeriodicTask( "CORE_CTRL", 55, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.4, missedDeadlineFunc, &RR_SCHEDULING); result = coreCtrlTask->addComponent(objects::CORE_CONTROLLER); @@ -410,6 +418,7 @@ void scheduling::initTasks() { }; sif::info << "Starting tasks.." << std::endl; + xiphosWdtTask->startTask(); tmTcDistributor->startTask(); #if OBSW_ADD_TCPIP_SERVERS == 1 diff --git a/common/config/eive/objects.h b/common/config/eive/objects.h index 0cc4b9d9..2118aa6d 100644 --- a/common/config/eive/objects.h +++ b/common/config/eive/objects.h @@ -26,6 +26,7 @@ enum commonObjects : uint32_t { THERMAL_CONTROLLER = 0x43400001, ACS_CONTROLLER = 0x43000002, CORE_CONTROLLER = 0x43000003, + XIPHOS_WDT = 0x43000004, GLOBAL_JSON_CFG = 0x43000006, /* 0x44 ('D') for device handlers */ diff --git a/tmtc b/tmtc index 22a42108..783bdd29 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 22a42108b431bafa707de2b3a24cad9de95b70d0 +Subproject commit 783bdd297a931a96c8b077ec2c2456a203b23ffc From 404a1009ed46a839da2a9a21c901427447e9a7a4 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 2 Oct 2023 14:47:41 +0200 Subject: [PATCH 114/257] that should get the job done --- CHANGELOG.md | 5 +++++ bsp_q7s/core/XiphosWdtHandler.cpp | 19 ++++++++++++++----- bsp_q7s/scheduling.cpp | 4 +++- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ae7901e..da8e84c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,11 @@ will consitute of a breaking change warranting a new major release: - Missing `nullptr` checks for PLOC Supervisor handler, which could lead to crashes. +## Added + +- Activate Xiphos WDT with a timeout period of 60 seconds using the `libxiphos` API. The WDT + calls are done by the new `XiphosWdtHandler` object. + # [v6.6.0] 2023-09-18 ## Changed diff --git a/bsp_q7s/core/XiphosWdtHandler.cpp b/bsp_q7s/core/XiphosWdtHandler.cpp index 38d206db..dbf1474a 100644 --- a/bsp_q7s/core/XiphosWdtHandler.cpp +++ b/bsp_q7s/core/XiphosWdtHandler.cpp @@ -19,11 +19,20 @@ ReturnValue_t XiphosWdtHandler::initialize() { << " seconds failed with code " << result << ": " << strerror(result) << std::endl; return ObjectManagerIF::CHILD_INIT_FAILED; } - result = xsc_watchdog_enable(wdtHandle); - if (result != 0) { - sif::error << "XiphosWdtHandler: Enabling WDT failed with code " << result << ": " - << strerror(result) << std::endl; - return ObjectManagerIF::CHILD_INIT_FAILED; + int nowayout = 0; + int status = 0; + result = xsc_watchdog_get_status(&nowayout, &status); + if (result == 0) { + if (status == 0) { + result = xsc_watchdog_enable(wdtHandle); + if (result != 0) { + sif::error << "XiphosWdtHandler: Enabling WDT failed with code " << result << ": " + << strerror(result) << std::endl; + return ObjectManagerIF::CHILD_INIT_FAILED; + } + } + } else { + sif::warning << "XiphosWdtHandler: Getting WDT status failed" << std::endl; } return returnvalue::OK; } diff --git a/bsp_q7s/scheduling.cpp b/bsp_q7s/scheduling.cpp index 7a94c118..e8208e65 100644 --- a/bsp_q7s/scheduling.cpp +++ b/bsp_q7s/scheduling.cpp @@ -82,8 +82,10 @@ void scheduling::initTasks() { } #endif + // Medium priority, higher than something like payload, but not the highest priority to also + // detect tasks which choke other tasks. PeriodicTaskIF* xiphosWdtTask = - factory->createPeriodicTask("XIPHOS_WDT", 90, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.4, + factory->createPeriodicTask("XIPHOS_WDT", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.4, missedDeadlineFunc, &RR_SCHEDULING); result = xiphosWdtTask->addComponent(objects::XIPHOS_WDT); if (result != returnvalue::OK) { From 34100e6c9505c02477d0ebaed1cc911c099cdd15 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 2 Oct 2023 14:49:29 +0200 Subject: [PATCH 115/257] small robustness tweak --- bsp_q7s/core/XiphosWdtHandler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bsp_q7s/core/XiphosWdtHandler.cpp b/bsp_q7s/core/XiphosWdtHandler.cpp index dbf1474a..5d4da7b6 100644 --- a/bsp_q7s/core/XiphosWdtHandler.cpp +++ b/bsp_q7s/core/XiphosWdtHandler.cpp @@ -15,9 +15,9 @@ ReturnValue_t XiphosWdtHandler::initialize() { } result = xsc_watchdog_set_timeout(wdtHandle, timeoutSeconds); if (result != 0) { - sif::error << "XiphosWdtHandler: Setting WDT timeout of " << timeoutSeconds + // This propably means that the default timeout is used. Still continue with task init. + sif::warning << "XiphosWdtHandler: Setting WDT timeout of " << timeoutSeconds << " seconds failed with code " << result << ": " << strerror(result) << std::endl; - return ObjectManagerIF::CHILD_INIT_FAILED; } int nowayout = 0; int status = 0; From 6a6789ae99ecfe95be7581fdb7a368c70e1b0625 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 2 Oct 2023 16:11:17 +0200 Subject: [PATCH 116/257] STR extensions --- mission/acs/str/StarTrackerHandler.cpp | 124 +++++++++++++++++++++++-- mission/acs/str/StarTrackerHandler.h | 7 ++ mission/acs/str/strHelpers.h | 44 ++++++++- tmtc | 2 +- 4 files changed, 164 insertions(+), 13 deletions(-) diff --git a/mission/acs/str/StarTrackerHandler.cpp b/mission/acs/str/StarTrackerHandler.cpp index a6091d7c..fb895d78 100644 --- a/mission/acs/str/StarTrackerHandler.cpp +++ b/mission/acs/str/StarTrackerHandler.cpp @@ -607,6 +607,10 @@ ReturnValue_t StarTrackerHandler::buildCommandFromCommand(DeviceCommandId_t devi result = prepareRequestLisaParams(); return result; } + case (startracker::REQ_MATCHED_CENTROIDS): { + result = prepareRequestMatchedCentroids(); + return result; + } case (startracker::REQ_MATCHING): { result = prepareRequestMatchingParams(); return result; @@ -729,6 +733,8 @@ void StarTrackerHandler::fillCommandAndReplyMap() { startracker::MAX_FRAME_SIZE * 2 + 2); this->insertInCommandAndReplyMap(startracker::REQ_DEBUG_CAMERA, 3, &debugCameraSet, startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::REQ_MATCHED_CENTROIDS, 3, &matchedCentroids, + startracker::MAX_FRAME_SIZE * 2 + 2); } ReturnValue_t StarTrackerHandler::isModeCombinationValid(Mode_t mode, Submode_t submode) { @@ -860,6 +866,16 @@ void StarTrackerHandler::setUpJsonCfgs(JsonConfigs& cfgs, const char* paramJsonF JCFG_DONE = true; } +ReturnValue_t StarTrackerHandler::statusFieldCheck(const uint8_t* rawFrame) { + uint8_t status = startracker::getStatusField(rawFrame); + if (status != startracker::STATUS_OK) { + sif::warning << "StarTrackerHandler::handleTm: Reply error: " + << static_cast(status) << std::endl; + return REPLY_ERROR; + } + return returnvalue::OK; +} + void StarTrackerHandler::bootBootloader() { if (internalState == InternalState::IDLE) { internalState = InternalState::BOOT_BOOTLOADER; @@ -896,24 +912,24 @@ ReturnValue_t StarTrackerHandler::scanForReply(const uint8_t* start, size_t rema } case TMTC_ACTIONREPLY: { *foundLen = remainingSize; + fullPacketLen = remainingSize; return scanForActionReply(startracker::getId(start), foundId); - break; } case TMTC_SETPARAMREPLY: { *foundLen = remainingSize; + fullPacketLen = remainingSize; return scanForSetParameterReply(startracker::getId(start), foundId); - break; } case TMTC_PARAMREPLY: { *foundLen = remainingSize; + fullPacketLen = remainingSize; return scanForGetParameterReply(startracker::getId(start), foundId); - break; } case TMTC_TELEMETRYREPLYA: case TMTC_TELEMETRYREPLY: { *foundLen = remainingSize; + fullPacketLen = remainingSize; return scanForTmReply(startracker::getId(start), foundId); - break; } default: { sif::debug << "StarTrackerHandler::scanForReply: Reply has invalid type id" << std::endl; @@ -970,6 +986,10 @@ ReturnValue_t StarTrackerHandler::interpretDeviceReply(DeviceCommandId_t id, result = handleTm(packet, solutionSet, startracker::SolutionSet::SIZE, "REQ_SOLUTION"); break; } + case (startracker::REQ_MATCHED_CENTROIDS): { + result = handleMatchedCentroidTm(packet); + break; + } case (startracker::REQ_TEMPERATURE): { result = handleTm(packet, temperatureSet, startracker::TemperatureSet::SIZE, "REQ_TEMP"); break; @@ -1032,6 +1052,10 @@ ReturnValue_t StarTrackerHandler::interpretDeviceReply(DeviceCommandId_t id, handleParamRequest(packet, trackingSet, startracker::TrackingSet::SIZE); break; } + case (startracker::REQ_MATCHED_CENTROIDS): { + handleParamRequest(packet, matchedCentroids, startracker::MatchedCentroidsSet::SIZE); + break; + } case (startracker::REQ_VALIDATION): { handleParamRequest(packet, validationSet, startracker::ValidationSet::SIZE); break; @@ -1328,6 +1352,20 @@ ReturnValue_t StarTrackerHandler::initializeLocalDataPool(localpool::DataPool& l localDataPoolMap.emplace(startracker::DEBUG_CAMERA_TEST, new PoolEntry({0})); localDataPoolMap.emplace(startracker::CHKSUM, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::PoolIds::NUM_MATCHED_CENTROIDS, new PoolEntry()); + localDataPoolMap.emplace(startracker::PoolIds::MATCHED_CENTROIDS_STAR_IDS, + new PoolEntry(16)); + localDataPoolMap.emplace(startracker::PoolIds::MATCHED_CENTROIDS_X_COORDS, + new PoolEntry(16)); + localDataPoolMap.emplace(startracker::PoolIds::MATCHED_CENTROIDS_Y_COORDS, + new PoolEntry(16)); + localDataPoolMap.emplace(startracker::PoolIds::MATCHED_CENTROIDS_X_ERRORS, + new PoolEntry(16)); + localDataPoolMap.emplace(startracker::PoolIds::MATCHED_CENTROIDS_Y_ERRORS, + new PoolEntry(16)); + localDataPoolMap.emplace(startracker::PoolIds::TICKS_MATCHED_CENTROIDS, + new PoolEntry()); + localDataPoolMap.emplace(startracker::PoolIds::TIME_MATCHED_CENTROIDS, new PoolEntry()); poolManager.subscribeForDiagPeriodicPacket( subdp::DiagnosticsHkPeriodicParams(temperatureSet.getSid(), false, 10.0)); @@ -1760,6 +1798,14 @@ void StarTrackerHandler::prepareHistogramRequest() { rawPacketLen = length; } +ReturnValue_t StarTrackerHandler::prepareRequestMatchedCentroids() { + uint32_t length = 0; + arc_tm_pack_matchedcentroids_req(commandBuffer, &length); + rawPacket = commandBuffer; + rawPacketLen = length; + return returnvalue::OK; +} + ReturnValue_t StarTrackerHandler::prepareParamCommand(const uint8_t* commandData, size_t commandDataLen, ArcsecJsonParamBase& paramSet, @@ -2039,12 +2085,9 @@ ReturnValue_t StarTrackerHandler::checkProgram() { ReturnValue_t StarTrackerHandler::handleTm(const uint8_t* rawFrame, LocalPoolDataSetBase& dataset, size_t size, const char* context) { - ReturnValue_t result = returnvalue::OK; - uint8_t status = startracker::getStatusField(rawFrame); - if (status != startracker::STATUS_OK) { - sif::warning << "StarTrackerHandler::handleTm: Reply error: " - << static_cast(status) << std::endl; - return REPLY_ERROR; + ReturnValue_t result = statusFieldCheck(rawFrame); + if (result != returnvalue::OK) { + return result; } result = dataset.read(TIMEOUT_TYPE, MUTEX_TIMEOUT); if (result != returnvalue::OK) { @@ -2069,6 +2112,66 @@ ReturnValue_t StarTrackerHandler::handleTm(const uint8_t* rawFrame, LocalPoolDat return result; } +ReturnValue_t StarTrackerHandler::handleMatchedCentroidTm(const uint8_t* rawFrame) { + ReturnValue_t result = statusFieldCheck(rawFrame); + if (result != returnvalue::OK) { + return result; + } + const uint8_t* reply = rawFrame + TICKS_OFFSET; + size_t remainingLen = fullPacketLen; + PoolReadGuard pg(&matchedCentroids); + result = pg.getReadResult(); + if (result != returnvalue::OK) { + return result; + } + result = SerializeAdapter::deSerialize(&matchedCentroids.ticks, &rawFrame, &remainingLen, + SerializeIF::Endianness::LITTLE); + if (result != returnvalue::OK) { + return result; + } + result = SerializeAdapter::deSerialize(&matchedCentroids.timeUs, &rawFrame, &remainingLen, + SerializeIF::Endianness::LITTLE); + if (result != returnvalue::OK) { + return result; + } + result = SerializeAdapter::deSerialize(&matchedCentroids.numberOfMatchedCentroids, &rawFrame, + &remainingLen, SerializeIF::Endianness::LITTLE); + + if (result != returnvalue::OK) { + return result; + } + // Yeah, we serialize it like that because I can't model anything with that local datapool crap. + for (unsigned idx = 0; idx < 16; idx++) { + result = SerializeAdapter::deSerialize(&matchedCentroids.starIds[idx], &rawFrame, &remainingLen, + SerializeIF::Endianness::LITTLE); + if (result != returnvalue::OK) { + return result; + } + result = SerializeAdapter::deSerialize(&matchedCentroids.xCoords[idx], &rawFrame, &remainingLen, + SerializeIF::Endianness::LITTLE); + if (result != returnvalue::OK) { + return result; + } + result = SerializeAdapter::deSerialize(&matchedCentroids.yCoords[idx], &rawFrame, &remainingLen, + SerializeIF::Endianness::LITTLE); + if (result != returnvalue::OK) { + return result; + } + result = SerializeAdapter::deSerialize(&matchedCentroids.xErrors[idx], &rawFrame, &remainingLen, + SerializeIF::Endianness::LITTLE); + if (result != returnvalue::OK) { + return result; + } + result = SerializeAdapter::deSerialize(&matchedCentroids.yErrors[idx], &rawFrame, &remainingLen, + SerializeIF::Endianness::LITTLE); + if (result != returnvalue::OK) { + return result; + } + } + matchedCentroids.setValidity(true, true); + return returnvalue::OK; +} + ReturnValue_t StarTrackerHandler::handleActionReplySet(const uint8_t* rawFrame, LocalPoolDataSetBase& dataset, size_t size) { ReturnValue_t result = returnvalue::OK; @@ -2204,6 +2307,7 @@ ReturnValue_t StarTrackerHandler::checkCommand(ActionId_t actionId) { case startracker::REQ_SUBSCRIPTION: case startracker::REQ_LOG_SUBSCRIPTION: case startracker::REQ_DEBUG_CAMERA: + case startracker::REQ_MATCHED_CENTROIDS: if (getMode() == MODE_ON and getSubmode() != startracker::Program::FIRMWARE) { return STARTRACKER_NOT_RUNNING_FIRMWARE; } diff --git a/mission/acs/str/StarTrackerHandler.h b/mission/acs/str/StarTrackerHandler.h index 1e790695..723a8aa8 100644 --- a/mission/acs/str/StarTrackerHandler.h +++ b/mission/acs/str/StarTrackerHandler.h @@ -204,6 +204,7 @@ class StarTrackerHandler : public DeviceHandlerBase { startracker::SubscriptionSet subscriptionSet; startracker::LogSubscriptionSet logSubscriptionSet; startracker::DebugCameraSet debugCameraSet; + startracker::MatchedCentroidsSet matchedCentroids; // Pointer to object responsible for uploading and downloading images to/from the star tracker StrComHandler* strHelper = nullptr; @@ -297,6 +298,8 @@ class StarTrackerHandler : public DeviceHandlerBase { const power::Switch_t powerSwitch = power::NO_SWITCH; + size_t fullPacketLen = 0; + /** * @brief Handles internal state */ @@ -429,6 +432,7 @@ class StarTrackerHandler : public DeviceHandlerBase { ReturnValue_t prepareRequestCentroidingParams(); ReturnValue_t prepareRequestLisaParams(); ReturnValue_t prepareRequestMatchingParams(); + ReturnValue_t prepareRequestMatchedCentroids(); ReturnValue_t prepareRequestTrackingParams(); ReturnValue_t prepareRequestValidationParams(); ReturnValue_t prepareRequestAlgoParams(); @@ -477,6 +481,7 @@ class StarTrackerHandler : public DeviceHandlerBase { */ void handleStartup(uint8_t tmType, uint8_t parameterId); + ReturnValue_t statusFieldCheck(const uint8_t* rawFrame); /** * @brief Handles telemtry replies and fills the appropriate dataset * @@ -488,6 +493,8 @@ class StarTrackerHandler : public DeviceHandlerBase { ReturnValue_t handleTm(const uint8_t* rawFrame, LocalPoolDataSetBase& dataset, size_t size, const char* context); + ReturnValue_t handleMatchedCentroidTm(const uint8_t* rawFrame); + /** * @brief Checks if star tracker is in valid mode for executing the received command. * diff --git a/mission/acs/str/strHelpers.h b/mission/acs/str/strHelpers.h index c6336186..b6a64f29 100644 --- a/mission/acs/str/strHelpers.h +++ b/mission/acs/str/strHelpers.h @@ -272,7 +272,16 @@ enum PoolIds : lp_id_t { LOG_SUBSCRIPTION_LEVEL2, LOG_SUBSCRIPTION_MODULE2, DEBUG_CAMERA_TIMING, - DEBUG_CAMERA_TEST + DEBUG_CAMERA_TEST, + + TICKS_MATCHED_CENTROIDS, + TIME_MATCHED_CENTROIDS, + NUM_MATCHED_CENTROIDS, + MATCHED_CENTROIDS_STAR_IDS, + MATCHED_CENTROIDS_X_COORDS, + MATCHED_CENTROIDS_Y_COORDS, + MATCHED_CENTROIDS_X_ERRORS, + MATCHED_CENTROIDS_Y_ERRORS, }; static const DeviceCommandId_t PING_REQUEST = 0; @@ -328,6 +337,7 @@ static const DeviceCommandId_t DISABLE_TIMESTAMP_GENERATION = 85; static const DeviceCommandId_t ENABLE_TIMESTAMP_GENERATION = 86; static constexpr DeviceCommandId_t SET_TIME_FROM_SYS_TIME = 87; static constexpr DeviceCommandId_t AUTO_THRESHOLD = 88; +static constexpr DeviceCommandId_t REQ_MATCHED_CENTROIDS = 89; static const DeviceCommandId_t NONE = 0xFFFFFFFF; static const uint32_t VERSION_SET_ID = REQ_VERSION; @@ -352,6 +362,7 @@ static const uint32_t ALGO_SET_ID = REQ_ALGO; static const uint32_t SUBSCRIPTION_SET_ID = REQ_SUBSCRIPTION; static const uint32_t LOG_SUBSCRIPTION_SET_ID = REQ_LOG_SUBSCRIPTION; static const uint32_t DEBUG_CAMERA_SET_ID = REQ_DEBUG_CAMERA; +static const uint32_t MATCHED_CENTROIDS_SET_ID = REQ_MATCHED_CENTROIDS; /** Max size of unencoded frame */ static const size_t MAX_FRAME_SIZE = 1200; @@ -666,7 +677,7 @@ class SolutionSet : public StaticLocalDataSet { // Ticks timestamp lp_var_t ticks = lp_var_t(sid.objectId, PoolIds::TICKS_SOLUTION_SET, this); - /// Unix time stamp + // Unix time stamp lp_var_t timeUs = lp_var_t(sid.objectId, PoolIds::TIME_SOLUTION_SET, this); // Calibrated quaternion (takes into account the mounting quaternion), typically same as // track q values @@ -1381,6 +1392,35 @@ class ValidationSet : public StaticLocalDataSet { } }; +class MatchedCentroidsSet : public StaticLocalDataSet<20> { + public: + static constexpr size_t SIZE = 321; + MatchedCentroidsSet(HasLocalDataPoolIF* owner) + : StaticLocalDataSet(owner, MATCHED_CENTROIDS_SET_ID) {} + MatchedCentroidsSet(object_id_t objectId) + : StaticLocalDataSet(sid_t(objectId, MATCHED_CENTROIDS_SET_ID)) {} + // Ticks timestamp + lp_var_t ticks = + lp_var_t(sid.objectId, PoolIds::TICKS_MATCHED_CENTROIDS, this); + // Unix time stamp + lp_var_t timeUs = + lp_var_t(sid.objectId, PoolIds::TIME_MATCHED_CENTROIDS, this); + lp_var_t numberOfMatchedCentroids = + lp_var_t(sid.objectId, PoolIds::NUM_MATCHED_CENTROIDS, this); + lp_vec_t starIds = + lp_vec_t(sid.objectId, PoolIds::MATCHED_CENTROIDS_STAR_IDS); + lp_vec_t xCoords = + lp_vec_t(sid.objectId, PoolIds::MATCHED_CENTROIDS_X_COORDS); + lp_vec_t yCoords = + lp_vec_t(sid.objectId, PoolIds::MATCHED_CENTROIDS_Y_COORDS); + lp_vec_t xErrors = + lp_vec_t(sid.objectId, PoolIds::MATCHED_CENTROIDS_X_ERRORS); + lp_vec_t yErrors = + lp_vec_t(sid.objectId, PoolIds::MATCHED_CENTROIDS_Y_ERRORS); + + private: +}; + /** * @brief Will store the requested algo parameters */ diff --git a/tmtc b/tmtc index 22a42108..783bdd29 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 22a42108b431bafa707de2b3a24cad9de95b70d0 +Subproject commit 783bdd297a931a96c8b077ec2c2456a203b23ffc From a46f712538355d4faa015178e9a2863277700e94 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 4 Oct 2023 10:44:03 +0200 Subject: [PATCH 117/257] STR handler --- mission/acs/str/StarTrackerHandler.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/mission/acs/str/StarTrackerHandler.cpp b/mission/acs/str/StarTrackerHandler.cpp index fb895d78..d6aae0d8 100644 --- a/mission/acs/str/StarTrackerHandler.cpp +++ b/mission/acs/str/StarTrackerHandler.cpp @@ -49,6 +49,7 @@ StarTrackerHandler::StarTrackerHandler(object_id_t objectId, object_id_t comIF, subscriptionSet(this), logSubscriptionSet(this), debugCameraSet(this), + matchedCentroids(this), strHelper(strHelper), paramJsonFile(jsonFileStr), powerSwitch(powerSwitch) { @@ -1052,10 +1053,6 @@ ReturnValue_t StarTrackerHandler::interpretDeviceReply(DeviceCommandId_t id, handleParamRequest(packet, trackingSet, startracker::TrackingSet::SIZE); break; } - case (startracker::REQ_MATCHED_CENTROIDS): { - handleParamRequest(packet, matchedCentroids, startracker::MatchedCentroidsSet::SIZE); - break; - } case (startracker::REQ_VALIDATION): { handleParamRequest(packet, validationSet, startracker::ValidationSet::SIZE); break; @@ -2117,7 +2114,6 @@ ReturnValue_t StarTrackerHandler::handleMatchedCentroidTm(const uint8_t* rawFram if (result != returnvalue::OK) { return result; } - const uint8_t* reply = rawFrame + TICKS_OFFSET; size_t remainingLen = fullPacketLen; PoolReadGuard pg(&matchedCentroids); result = pg.getReadResult(); From d64372833c306a323c5baf5c3376bbf4cf2572d9 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 6 Oct 2023 11:23:31 +0200 Subject: [PATCH 118/257] added blob tm --- mission/acs/str/StarTrackerHandler.cpp | 137 +++++++++++++++++++++++++ mission/acs/str/StarTrackerHandler.h | 6 ++ mission/acs/str/strHelpers.h | 42 ++++++++ 3 files changed, 185 insertions(+) diff --git a/mission/acs/str/StarTrackerHandler.cpp b/mission/acs/str/StarTrackerHandler.cpp index d6aae0d8..0f9c86de 100644 --- a/mission/acs/str/StarTrackerHandler.cpp +++ b/mission/acs/str/StarTrackerHandler.cpp @@ -50,6 +50,7 @@ StarTrackerHandler::StarTrackerHandler(object_id_t objectId, object_id_t comIF, logSubscriptionSet(this), debugCameraSet(this), matchedCentroids(this), + blobsSet(this), strHelper(strHelper), paramJsonFile(jsonFileStr), powerSwitch(powerSwitch) { @@ -612,6 +613,14 @@ ReturnValue_t StarTrackerHandler::buildCommandFromCommand(DeviceCommandId_t devi result = prepareRequestMatchedCentroids(); return result; } + case (startracker::REQ_BLOB): { + result = prepareRequestBlobTm(); + return result; + } + case (startracker::REQ_BLOBS): { + result = prepareRequestBlobsTm(); + return result; + } case (startracker::REQ_MATCHING): { result = prepareRequestMatchingParams(); return result; @@ -736,6 +745,10 @@ void StarTrackerHandler::fillCommandAndReplyMap() { startracker::MAX_FRAME_SIZE * 2 + 2); this->insertInCommandAndReplyMap(startracker::REQ_MATCHED_CENTROIDS, 3, &matchedCentroids, startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::REQ_BLOB, 3, &blobsSet, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::REQ_BLOBS, 3, &blobsSet, + startracker::MAX_FRAME_SIZE * 2 + 2); } ReturnValue_t StarTrackerHandler::isModeCombinationValid(Mode_t mode, Submode_t submode) { @@ -991,6 +1004,14 @@ ReturnValue_t StarTrackerHandler::interpretDeviceReply(DeviceCommandId_t id, result = handleMatchedCentroidTm(packet); break; } + case (startracker::REQ_BLOB): { + result = handleBlobTm(packet); + break; + } + case (startracker::REQ_BLOBS): { + result = handleBlobsTm(packet); + break; + } case (startracker::REQ_TEMPERATURE): { result = handleTm(packet, temperatureSet, startracker::TemperatureSet::SIZE, "REQ_TEMP"); break; @@ -1364,6 +1385,14 @@ ReturnValue_t StarTrackerHandler::initializeLocalDataPool(localpool::DataPool& l new PoolEntry()); localDataPoolMap.emplace(startracker::PoolIds::TIME_MATCHED_CENTROIDS, new PoolEntry()); + localDataPoolMap.emplace(startracker::PoolIds::BLOB_COUNT, new PoolEntry()); + localDataPoolMap.emplace(startracker::PoolIds::BLOBS_COUNT, new PoolEntry()); + localDataPoolMap.emplace(startracker::PoolIds::BLOBS_COUNT_USED, new PoolEntry()); + localDataPoolMap.emplace(startracker::PoolIds::BLOBS_NR_4LINES_SKIPPED, + new PoolEntry()); + localDataPoolMap.emplace(startracker::PoolIds::BLOBS_X_COORDS, new PoolEntry(8)); + localDataPoolMap.emplace(startracker::PoolIds::BLOBS_Y_COORDS, new PoolEntry(8)); + poolManager.subscribeForDiagPeriodicPacket( subdp::DiagnosticsHkPeriodicParams(temperatureSet.getSid(), false, 10.0)); poolManager.subscribeForRegularPeriodicPacket( @@ -1803,6 +1832,22 @@ ReturnValue_t StarTrackerHandler::prepareRequestMatchedCentroids() { return returnvalue::OK; } +ReturnValue_t StarTrackerHandler::prepareRequestBlobTm() { + uint32_t length = 0; + arc_tm_pack_blob_req(commandBuffer, &length); + rawPacket = commandBuffer; + rawPacketLen = length; + return returnvalue::OK; +} + +ReturnValue_t StarTrackerHandler::prepareRequestBlobsTm() { + uint32_t length = 0; + arc_tm_pack_blobs_req(commandBuffer, &length); + rawPacket = commandBuffer; + rawPacketLen = length; + return returnvalue::OK; +} + ReturnValue_t StarTrackerHandler::prepareParamCommand(const uint8_t* commandData, size_t commandDataLen, ArcsecJsonParamBase& paramSet, @@ -2168,6 +2213,96 @@ ReturnValue_t StarTrackerHandler::handleMatchedCentroidTm(const uint8_t* rawFram return returnvalue::OK; } +ReturnValue_t StarTrackerHandler::handleBlobTm(const uint8_t* rawFrame) { + ReturnValue_t result = statusFieldCheck(rawFrame); + if (result != returnvalue::OK) { + return result; + } + size_t remainingLen = fullPacketLen; + PoolReadGuard pg(&blobsSet); + result = pg.getReadResult(); + if (result != returnvalue::OK) { + return result; + } + result = SerializeAdapter::deSerialize(&blobsSet.ticksBlobTm, &rawFrame, &remainingLen, + SerializeIF::Endianness::LITTLE); + if (result != returnvalue::OK) { + return result; + } + result = SerializeAdapter::deSerialize(&blobsSet.timeUsBlobTm, &rawFrame, &remainingLen, + SerializeIF::Endianness::LITTLE); + if (result != returnvalue::OK) { + return result; + } + result = SerializeAdapter::deSerialize(&blobsSet.blobCount, &rawFrame, &remainingLen, + SerializeIF::Endianness::LITTLE); + if (result != returnvalue::OK) { + return result; + } + blobsSet.ticksBlobTm.setValid(true); + blobsSet.timeUsBlobTm.setValid(true); + blobsSet.blobCount.setValid(true); + return returnvalue::OK; +} + +ReturnValue_t StarTrackerHandler::handleBlobsTm(const uint8_t* rawFrame) { + ReturnValue_t result = statusFieldCheck(rawFrame); + if (result != returnvalue::OK) { + return result; + } + size_t remainingLen = fullPacketLen; + PoolReadGuard pg(&blobsSet); + result = pg.getReadResult(); + if (result != returnvalue::OK) { + return result; + } + result = SerializeAdapter::deSerialize(&blobsSet.ticksBlobsTm, &rawFrame, &remainingLen, + SerializeIF::Endianness::LITTLE); + if (result != returnvalue::OK) { + return result; + } + result = SerializeAdapter::deSerialize(&blobsSet.timeUsBlobsTm, &rawFrame, &remainingLen, + SerializeIF::Endianness::LITTLE); + if (result != returnvalue::OK) { + return result; + } + result = SerializeAdapter::deSerialize(&blobsSet.blobsCount, &rawFrame, &remainingLen, + SerializeIF::Endianness::LITTLE); + if (result != returnvalue::OK) { + return result; + } + result = SerializeAdapter::deSerialize(&blobsSet.blobsCountUsed, &rawFrame, &remainingLen, + SerializeIF::Endianness::LITTLE); + if (result != returnvalue::OK) { + return result; + } + result = SerializeAdapter::deSerialize(&blobsSet.nr4LinesSkipped, &rawFrame, &remainingLen, + SerializeIF::Endianness::LITTLE); + if (result != returnvalue::OK) { + return result; + } + for (unsigned idx = 0; idx < 8; idx++) { + result = SerializeAdapter::deSerialize(&blobsSet.xCoords[idx], &rawFrame, &remainingLen, + SerializeIF::Endianness::LITTLE); + if (result != returnvalue::OK) { + return result; + } + result = SerializeAdapter::deSerialize(&blobsSet.yCoords[idx], &rawFrame, &remainingLen, + SerializeIF::Endianness::LITTLE); + if (result != returnvalue::OK) { + return result; + } + } + blobsSet.ticksBlobsTm.setValid(true); + blobsSet.timeUsBlobsTm.setValid(true); + blobsSet.blobsCount.setValid(true); + blobsSet.blobsCountUsed.setValid(true); + blobsSet.nr4LinesSkipped.setValid(true); + blobsSet.xCoords.setValid(true); + blobsSet.yCoords.setValid(true); + return returnvalue::OK; +} + ReturnValue_t StarTrackerHandler::handleActionReplySet(const uint8_t* rawFrame, LocalPoolDataSetBase& dataset, size_t size) { ReturnValue_t result = returnvalue::OK; @@ -2304,6 +2439,8 @@ ReturnValue_t StarTrackerHandler::checkCommand(ActionId_t actionId) { case startracker::REQ_LOG_SUBSCRIPTION: case startracker::REQ_DEBUG_CAMERA: case startracker::REQ_MATCHED_CENTROIDS: + case startracker::REQ_BLOB: + case startracker::REQ_BLOBS: if (getMode() == MODE_ON and getSubmode() != startracker::Program::FIRMWARE) { return STARTRACKER_NOT_RUNNING_FIRMWARE; } diff --git a/mission/acs/str/StarTrackerHandler.h b/mission/acs/str/StarTrackerHandler.h index 723a8aa8..db8335b0 100644 --- a/mission/acs/str/StarTrackerHandler.h +++ b/mission/acs/str/StarTrackerHandler.h @@ -151,6 +151,7 @@ class StarTrackerHandler : public DeviceHandlerBase { static const uint8_t PARAMS_OFFSET = 2; static const uint8_t TICKS_OFFSET = 3; static const uint8_t TIME_OFFSET = 7; + static const uint8_t TM_PARAM_OFFSET = 15; static const uint8_t PARAMETER_ID_OFFSET = 1; static const uint8_t ACTION_ID_OFFSET = 1; static const uint8_t ACTION_DATA_OFFSET = 3; @@ -205,6 +206,7 @@ class StarTrackerHandler : public DeviceHandlerBase { startracker::LogSubscriptionSet logSubscriptionSet; startracker::DebugCameraSet debugCameraSet; startracker::MatchedCentroidsSet matchedCentroids; + startracker::BlobsSet blobsSet; // Pointer to object responsible for uploading and downloading images to/from the star tracker StrComHandler* strHelper = nullptr; @@ -433,6 +435,8 @@ class StarTrackerHandler : public DeviceHandlerBase { ReturnValue_t prepareRequestLisaParams(); ReturnValue_t prepareRequestMatchingParams(); ReturnValue_t prepareRequestMatchedCentroids(); + ReturnValue_t prepareRequestBlobTm(); + ReturnValue_t prepareRequestBlobsTm(); ReturnValue_t prepareRequestTrackingParams(); ReturnValue_t prepareRequestValidationParams(); ReturnValue_t prepareRequestAlgoParams(); @@ -494,6 +498,8 @@ class StarTrackerHandler : public DeviceHandlerBase { const char* context); ReturnValue_t handleMatchedCentroidTm(const uint8_t* rawFrame); + ReturnValue_t handleBlobTm(const uint8_t* rawFrame); + ReturnValue_t handleBlobsTm(const uint8_t* rawFrame); /** * @brief Checks if star tracker is in valid mode for executing the received command. diff --git a/mission/acs/str/strHelpers.h b/mission/acs/str/strHelpers.h index b6a64f29..96692c0b 100644 --- a/mission/acs/str/strHelpers.h +++ b/mission/acs/str/strHelpers.h @@ -282,6 +282,18 @@ enum PoolIds : lp_id_t { MATCHED_CENTROIDS_Y_COORDS, MATCHED_CENTROIDS_X_ERRORS, MATCHED_CENTROIDS_Y_ERRORS, + + BLOB_TICKS, + BLOB_TIME, + BLOB_COUNT, + + BLOBS_TICKS, + BLOBS_TIME, + BLOBS_COUNT, + BLOBS_COUNT_USED, + BLOBS_NR_4LINES_SKIPPED, + BLOBS_X_COORDS, + BLOBS_Y_COORDS, }; static const DeviceCommandId_t PING_REQUEST = 0; @@ -338,6 +350,8 @@ static const DeviceCommandId_t ENABLE_TIMESTAMP_GENERATION = 86; static constexpr DeviceCommandId_t SET_TIME_FROM_SYS_TIME = 87; static constexpr DeviceCommandId_t AUTO_THRESHOLD = 88; static constexpr DeviceCommandId_t REQ_MATCHED_CENTROIDS = 89; +static constexpr DeviceCommandId_t REQ_BLOB = 90; +static constexpr DeviceCommandId_t REQ_BLOBS = 91; static const DeviceCommandId_t NONE = 0xFFFFFFFF; static const uint32_t VERSION_SET_ID = REQ_VERSION; @@ -363,6 +377,7 @@ static const uint32_t SUBSCRIPTION_SET_ID = REQ_SUBSCRIPTION; static const uint32_t LOG_SUBSCRIPTION_SET_ID = REQ_LOG_SUBSCRIPTION; static const uint32_t DEBUG_CAMERA_SET_ID = REQ_DEBUG_CAMERA; static const uint32_t MATCHED_CENTROIDS_SET_ID = REQ_MATCHED_CENTROIDS; +static const uint32_t BLOBS_SET_ID = REQ_BLOBS; /** Max size of unencoded frame */ static const size_t MAX_FRAME_SIZE = 1200; @@ -1421,6 +1436,33 @@ class MatchedCentroidsSet : public StaticLocalDataSet<20> { private: }; +class BlobsSet : public StaticLocalDataSet<20> { + public: + BlobsSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, BLOBS_SET_ID) {} + + private: + // The blob count received from the Blob Telemetry Set (ID 25) + // Ticks timestamp + lp_var_t ticksBlobTm = lp_var_t(sid.objectId, PoolIds::BLOB_TICKS, this); + // Unix time stamp + lp_var_t timeUsBlobTm = lp_var_t(sid.objectId, PoolIds::BLOB_TIME, this); + lp_var_t blobCount = lp_var_t(sid.objectId, PoolIds::BLOB_COUNT, this); + + // Ticks timestamp + lp_var_t ticksBlobsTm = lp_var_t(sid.objectId, PoolIds::BLOBS_TICKS, this); + // Unix time stamp + lp_var_t timeUsBlobsTm = lp_var_t(sid.objectId, PoolIds::BLOBS_TIME, this); + lp_var_t blobsCount = lp_var_t(sid.objectId, PoolIds::BLOBS_COUNT, this); + lp_var_t blobsCountUsed = + lp_var_t(sid.objectId, PoolIds::BLOBS_COUNT_USED, this); + lp_var_t nr4LinesSkipped = + lp_var_t(sid.objectId, PoolIds::BLOBS_NR_4LINES_SKIPPED, this); + lp_vec_t xCoords = + lp_vec_t(sid.objectId, PoolIds::BLOBS_X_COORDS, this); + lp_vec_t yCoords = + lp_vec_t(sid.objectId, PoolIds::BLOBS_Y_COORDS, this); +}; + /** * @brief Will store the requested algo parameters */ From f2ee6995f969e9aefff25f980c38fadfc64b0886 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 6 Oct 2023 11:35:57 +0200 Subject: [PATCH 119/257] compile fixes --- mission/acs/str/StarTrackerHandler.cpp | 5 +++++ mission/acs/str/strHelpers.h | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/mission/acs/str/StarTrackerHandler.cpp b/mission/acs/str/StarTrackerHandler.cpp index 0f9c86de..97f3944d 100644 --- a/mission/acs/str/StarTrackerHandler.cpp +++ b/mission/acs/str/StarTrackerHandler.cpp @@ -1385,7 +1385,12 @@ ReturnValue_t StarTrackerHandler::initializeLocalDataPool(localpool::DataPool& l new PoolEntry()); localDataPoolMap.emplace(startracker::PoolIds::TIME_MATCHED_CENTROIDS, new PoolEntry()); + localDataPoolMap.emplace(startracker::PoolIds::BLOB_TICKS, new PoolEntry()); + localDataPoolMap.emplace(startracker::PoolIds::BLOB_TIME, new PoolEntry()); localDataPoolMap.emplace(startracker::PoolIds::BLOB_COUNT, new PoolEntry()); + + localDataPoolMap.emplace(startracker::PoolIds::BLOBS_TICKS, new PoolEntry()); + localDataPoolMap.emplace(startracker::PoolIds::BLOBS_TIME, new PoolEntry()); localDataPoolMap.emplace(startracker::PoolIds::BLOBS_COUNT, new PoolEntry()); localDataPoolMap.emplace(startracker::PoolIds::BLOBS_COUNT_USED, new PoolEntry()); localDataPoolMap.emplace(startracker::PoolIds::BLOBS_NR_4LINES_SKIPPED, diff --git a/mission/acs/str/strHelpers.h b/mission/acs/str/strHelpers.h index 96692c0b..5d9c483f 100644 --- a/mission/acs/str/strHelpers.h +++ b/mission/acs/str/strHelpers.h @@ -1440,7 +1440,6 @@ class BlobsSet : public StaticLocalDataSet<20> { public: BlobsSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, BLOBS_SET_ID) {} - private: // The blob count received from the Blob Telemetry Set (ID 25) // Ticks timestamp lp_var_t ticksBlobTm = lp_var_t(sid.objectId, PoolIds::BLOB_TICKS, this); From e9e8a93cf40a71407749e2ed8987cd03633e1b55 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 6 Oct 2023 11:41:03 +0200 Subject: [PATCH 120/257] changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ae7901e..88d29e9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,10 @@ will consitute of a breaking change warranting a new major release: # [unreleased] +## Added + +- STR: Added new TM sets: Blob, Blobs, MatchedCentroids. + ## Changed - Changed internals for MPSoC boot process to make the code more understandable and some From e9ad8d956ac9c4eddb8902bbdc94db1a70cece03 Mon Sep 17 00:00:00 2001 From: meggert Date: Mon, 9 Oct 2023 09:33:37 +0200 Subject: [PATCH 121/257] i need a vacation ... --- linux/payload/PlocMpsocHandler.cpp | 2 +- linux/payload/PlocSupervisorHandler.cpp | 2 +- mission/payload/PayloadPcduHandler.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/linux/payload/PlocMpsocHandler.cpp b/linux/payload/PlocMpsocHandler.cpp index d4c663e6..66fba6d8 100644 --- a/linux/payload/PlocMpsocHandler.cpp +++ b/linux/payload/PlocMpsocHandler.cpp @@ -1512,7 +1512,7 @@ ReturnValue_t PlocMpsocHandler::checkModeCommand(Mode_t commandedMode, Submode_t PoolReadGuard pg(&enablePl); if (pg.getReadResult() == returnvalue::OK) { if (enablePl.plUseAllowed.isValid() and not enablePl.plUseAllowed.value) { - return NON_OP_SOC; + return NON_OP_STATE_OF_CHARGE; } } } diff --git a/linux/payload/PlocSupervisorHandler.cpp b/linux/payload/PlocSupervisorHandler.cpp index 648ea74c..0c6311de 100644 --- a/linux/payload/PlocSupervisorHandler.cpp +++ b/linux/payload/PlocSupervisorHandler.cpp @@ -2000,7 +2000,7 @@ ReturnValue_t PlocSupervisorHandler::checkModeCommand(Mode_t commandedMode, PoolReadGuard pg(&enablePl); if (pg.getReadResult() == returnvalue::OK) { if (enablePl.plUseAllowed.isValid() and not enablePl.plUseAllowed.value) { - return NON_OP_SOC; + return NON_OP_STATE_OF_CHARGE; } } } diff --git a/mission/payload/PayloadPcduHandler.cpp b/mission/payload/PayloadPcduHandler.cpp index 1a2b35ff..bda15b20 100644 --- a/mission/payload/PayloadPcduHandler.cpp +++ b/mission/payload/PayloadPcduHandler.cpp @@ -570,7 +570,7 @@ ReturnValue_t PayloadPcduHandler::checkModeCommand(Mode_t commandedMode, Submode PoolReadGuard pg(&enablePl); if (pg.getReadResult() == returnvalue::OK) { if (enablePl.plUseAllowed.isValid() and not enablePl.plUseAllowed.value) { - return NON_OP_SOC; + return NON_OP_STATE_OF_CHARGE; } } } From bd8cb7c26fffcf61078c27d70be42a0440b97e99 Mon Sep 17 00:00:00 2001 From: meggert Date: Mon, 9 Oct 2023 11:42:42 +0200 Subject: [PATCH 122/257] what is dis --- mission/system/EiveSystem.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/mission/system/EiveSystem.cpp b/mission/system/EiveSystem.cpp index 6e0097f5..7093399e 100644 --- a/mission/system/EiveSystem.cpp +++ b/mission/system/EiveSystem.cpp @@ -208,8 +208,6 @@ void EiveSystem::handleEventMessages() { } case power::POWER_LEVEL_CRITICAL: CommandMessage msg; - ModeMessage::setModeMessage(&msg, ModeMessage::CMD_MODE_COMMAND_FORCED, - HasModesIF::MODE_OFF, HasModesIF::SUBMODE_NONE); HealthMessage::setHealthMessage(&msg, HealthMessage::HEALTH_SET, HasHealthIF::FAULTY); ReturnValue_t result = MessageQueueSenderIF::sendMessage( strQueueId, &msg, MessageQueueIF::NO_QUEUE, false); From 47b15bec935b6c4538f9e8c9e21456cf182c61ac Mon Sep 17 00:00:00 2001 From: meggert Date: Mon, 9 Oct 2023 14:03:13 +0200 Subject: [PATCH 123/257] not needed as all PL components are set to faulty anyways --- mission/system/EiveSystem.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/mission/system/EiveSystem.cpp b/mission/system/EiveSystem.cpp index 7093399e..0df0fc95 100644 --- a/mission/system/EiveSystem.cpp +++ b/mission/system/EiveSystem.cpp @@ -403,17 +403,10 @@ void EiveSystem::pdecRecoveryLogic() { void EiveSystem::forceOffPayload() { CommandMessage msg; - // turn off PL Subsystem - ModeMessage::setModeMessage(&msg, ModeMessage::CMD_MODE_COMMAND_FORCED, HasModesIF::MODE_OFF, - HasModesIF::SUBMODE_NONE); - ReturnValue_t result = commandQueue->sendMessage(plSsQueueId, &msg); - if (result != returnvalue::OK) { - sif::error << "EIVE System: Sending OFF command to PL Subsystem failed" << std::endl; - } // set PL to faulty HealthMessage::setHealthMessage(&msg, HealthMessage::HEALTH_SET, HasHealthIF::FAULTY); - result = commandQueue->sendMessage(plPcduQueueId, &msg); + ReturnValue_t result = commandQueue->sendMessage(plPcduQueueId, &msg); if (result != returnvalue::OK) { sif::error << "EIVE System: Sending FAULTY command to PL PCDU failed" << std::endl; } From 706c5be7f71fd24abee12e1223c29e6c4ffec3e9 Mon Sep 17 00:00:00 2001 From: meggert Date: Mon, 9 Oct 2023 14:03:57 +0200 Subject: [PATCH 124/257] stop the spam --- mission/controller/PowerController.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mission/controller/PowerController.cpp b/mission/controller/PowerController.cpp index bd760012..edda2911 100644 --- a/mission/controller/PowerController.cpp +++ b/mission/controller/PowerController.cpp @@ -246,13 +246,13 @@ void PowerController::watchStateOfCharge() { if (not pwrLvlLowFlag and pwrCtrlCoreHk.coulombCounterCharge.value < payloadOpLimitLow) { triggerEvent(power::POWER_LEVEL_LOW); pwrLvlLowFlag = true; - } else { + } else if (pwrLvlLowFlag and pwrCtrlCoreHk.coulombCounterCharge.value > payloadOpLimitLow) { pwrLvlLowFlag = false; } if (not pwrLvlCriticalFlag and pwrCtrlCoreHk.coulombCounterCharge.value < higherModesLimit) { triggerEvent(power::POWER_LEVEL_CRITICAL); pwrLvlCriticalFlag = true; - } else { + } else if (pwrLvlCriticalFlag and pwrCtrlCoreHk.coulombCounterCharge.value > higherModesLimit) { pwrLvlCriticalFlag = false; } } else { From cc1be69764795be1c3da195f19d6842b04425613 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 9 Oct 2023 15:16:48 +0200 Subject: [PATCH 125/257] finished STR extensions TMTC --- mission/acs/str/StarTrackerHandler.cpp | 163 ++++++++++++++++++++++--- mission/acs/str/StarTrackerHandler.h | 7 ++ mission/acs/str/strHelpers.h | 68 +++++++++-- 3 files changed, 214 insertions(+), 24 deletions(-) diff --git a/mission/acs/str/StarTrackerHandler.cpp b/mission/acs/str/StarTrackerHandler.cpp index 97f3944d..20c2b511 100644 --- a/mission/acs/str/StarTrackerHandler.cpp +++ b/mission/acs/str/StarTrackerHandler.cpp @@ -50,7 +50,10 @@ StarTrackerHandler::StarTrackerHandler(object_id_t objectId, object_id_t comIF, logSubscriptionSet(this), debugCameraSet(this), matchedCentroids(this), + blobSet(this), blobsSet(this), + centroidSet(this), + centroidsSet(this), strHelper(strHelper), paramJsonFile(jsonFileStr), powerSwitch(powerSwitch) { @@ -474,6 +477,12 @@ ReturnValue_t StarTrackerHandler::buildCommandFromCommand(DeviceCommandId_t devi prepareTimeRequest(); return returnvalue::OK; } + case (startracker::REQ_CENTROID): { + return returnvalue::OK; + } + case (startracker::REQ_CENTROIDS): { + return returnvalue::OK; + } case (startracker::BOOT): { prepareBootCommand(); return returnvalue::OK; @@ -745,10 +754,14 @@ void StarTrackerHandler::fillCommandAndReplyMap() { startracker::MAX_FRAME_SIZE * 2 + 2); this->insertInCommandAndReplyMap(startracker::REQ_MATCHED_CENTROIDS, 3, &matchedCentroids, startracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startracker::REQ_BLOB, 3, &blobsSet, + this->insertInCommandAndReplyMap(startracker::REQ_BLOB, 3, &blobSet, startracker::MAX_FRAME_SIZE * 2 + 2); this->insertInCommandAndReplyMap(startracker::REQ_BLOBS, 3, &blobsSet, startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::REQ_CENTROID, 3, ¢roidSet, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::REQ_CENTROIDS, 3, ¢roidsSet, + startracker::MAX_FRAME_SIZE * 2 + 2); } ReturnValue_t StarTrackerHandler::isModeCombinationValid(Mode_t mode, Submode_t submode) { @@ -1012,6 +1025,14 @@ ReturnValue_t StarTrackerHandler::interpretDeviceReply(DeviceCommandId_t id, result = handleBlobsTm(packet); break; } + case (startracker::REQ_CENTROID): { + result = handleCentroidTm(packet); + break; + } + case (startracker::REQ_CENTROIDS): { + result = handleCentroidsTm(packet); + break; + } case (startracker::REQ_TEMPERATURE): { result = handleTm(packet, temperatureSet, startracker::TemperatureSet::SIZE, "REQ_TEMP"); break; @@ -1398,6 +1419,17 @@ ReturnValue_t StarTrackerHandler::initializeLocalDataPool(localpool::DataPool& l localDataPoolMap.emplace(startracker::PoolIds::BLOBS_X_COORDS, new PoolEntry(8)); localDataPoolMap.emplace(startracker::PoolIds::BLOBS_Y_COORDS, new PoolEntry(8)); + localDataPoolMap.emplace(startracker::PoolIds::CENTROID_TICKS, new PoolEntry()); + localDataPoolMap.emplace(startracker::PoolIds::CENTROID_TIME, new PoolEntry()); + localDataPoolMap.emplace(startracker::PoolIds::CENTROID_COUNT, new PoolEntry()); + + localDataPoolMap.emplace(startracker::PoolIds::CENTROIDS_TICKS, new PoolEntry()); + localDataPoolMap.emplace(startracker::PoolIds::CENTROIDS_TIME, new PoolEntry()); + localDataPoolMap.emplace(startracker::PoolIds::CENTROIDS_COUNT, new PoolEntry()); + localDataPoolMap.emplace(startracker::PoolIds::CENTROIDS_X_COORDS, new PoolEntry(16)); + localDataPoolMap.emplace(startracker::PoolIds::CENTROIDS_Y_COORDS, new PoolEntry(16)); + localDataPoolMap.emplace(startracker::PoolIds::CENTROIDS_MAGNITUDES, new PoolEntry(16)); + poolManager.subscribeForDiagPeriodicPacket( subdp::DiagnosticsHkPeriodicParams(temperatureSet.getSid(), false, 10.0)); poolManager.subscribeForRegularPeriodicPacket( @@ -1412,6 +1444,16 @@ ReturnValue_t StarTrackerHandler::initializeLocalDataPool(localpool::DataPool& l subdp::RegularHkPeriodicParams(histogramSet.getSid(), false, 10.0)); poolManager.subscribeForRegularPeriodicPacket( subdp::RegularHkPeriodicParams(lisaSet.getSid(), false, 10.0)); + poolManager.subscribeForRegularPeriodicPacket( + subdp::RegularHkPeriodicParams(matchedCentroids.getSid(), false, 10.0)); + poolManager.subscribeForRegularPeriodicPacket( + subdp::RegularHkPeriodicParams(blobSet.getSid(), false, 10.0)); + poolManager.subscribeForRegularPeriodicPacket( + subdp::RegularHkPeriodicParams(blobsSet.getSid(), false, 10.0)); + poolManager.subscribeForRegularPeriodicPacket( + subdp::RegularHkPeriodicParams(centroidSet.getSid(), false, 10.0)); + poolManager.subscribeForRegularPeriodicPacket( + subdp::RegularHkPeriodicParams(centroidsSet.getSid(), false, 10.0)); return returnvalue::OK; } @@ -1853,6 +1895,22 @@ ReturnValue_t StarTrackerHandler::prepareRequestBlobsTm() { return returnvalue::OK; } +ReturnValue_t StarTrackerHandler::prepareRequestCentroidTm() { + uint32_t length = 0; + arc_tm_pack_centroid_req(commandBuffer, &length); + rawPacket = commandBuffer; + rawPacketLen = length; + return returnvalue::OK; +} + +ReturnValue_t StarTrackerHandler::prepareRequestCentroidsTm() { + uint32_t length = 0; + arc_tm_pack_centroids_req(commandBuffer, &length); + rawPacket = commandBuffer; + rawPacketLen = length; + return returnvalue::OK; +} + ReturnValue_t StarTrackerHandler::prepareParamCommand(const uint8_t* commandData, size_t commandDataLen, ArcsecJsonParamBase& paramSet, @@ -2229,24 +2287,22 @@ ReturnValue_t StarTrackerHandler::handleBlobTm(const uint8_t* rawFrame) { if (result != returnvalue::OK) { return result; } - result = SerializeAdapter::deSerialize(&blobsSet.ticksBlobTm, &rawFrame, &remainingLen, + result = SerializeAdapter::deSerialize(&blobSet.ticks, &rawFrame, &remainingLen, SerializeIF::Endianness::LITTLE); if (result != returnvalue::OK) { return result; } - result = SerializeAdapter::deSerialize(&blobsSet.timeUsBlobTm, &rawFrame, &remainingLen, + result = SerializeAdapter::deSerialize(&blobSet.timeUs, &rawFrame, &remainingLen, SerializeIF::Endianness::LITTLE); if (result != returnvalue::OK) { return result; } - result = SerializeAdapter::deSerialize(&blobsSet.blobCount, &rawFrame, &remainingLen, + result = SerializeAdapter::deSerialize(&blobSet.blobCount, &rawFrame, &remainingLen, SerializeIF::Endianness::LITTLE); if (result != returnvalue::OK) { return result; } - blobsSet.ticksBlobTm.setValid(true); - blobsSet.timeUsBlobTm.setValid(true); - blobsSet.blobCount.setValid(true); + blobSet.setValidity(true, true); return returnvalue::OK; } @@ -2261,12 +2317,12 @@ ReturnValue_t StarTrackerHandler::handleBlobsTm(const uint8_t* rawFrame) { if (result != returnvalue::OK) { return result; } - result = SerializeAdapter::deSerialize(&blobsSet.ticksBlobsTm, &rawFrame, &remainingLen, + result = SerializeAdapter::deSerialize(&blobsSet.ticks, &rawFrame, &remainingLen, SerializeIF::Endianness::LITTLE); if (result != returnvalue::OK) { return result; } - result = SerializeAdapter::deSerialize(&blobsSet.timeUsBlobsTm, &rawFrame, &remainingLen, + result = SerializeAdapter::deSerialize(&blobsSet.timeUs, &rawFrame, &remainingLen, SerializeIF::Endianness::LITTLE); if (result != returnvalue::OK) { return result; @@ -2298,13 +2354,86 @@ ReturnValue_t StarTrackerHandler::handleBlobsTm(const uint8_t* rawFrame) { return result; } } - blobsSet.ticksBlobsTm.setValid(true); - blobsSet.timeUsBlobsTm.setValid(true); - blobsSet.blobsCount.setValid(true); - blobsSet.blobsCountUsed.setValid(true); - blobsSet.nr4LinesSkipped.setValid(true); - blobsSet.xCoords.setValid(true); - blobsSet.yCoords.setValid(true); + blobsSet.setValidity(true, true); + return returnvalue::OK; +} + +ReturnValue_t StarTrackerHandler::handleCentroidTm(const uint8_t* rawFrame) { + ReturnValue_t result = statusFieldCheck(rawFrame); + if (result != returnvalue::OK) { + return result; + } + size_t remainingLen = fullPacketLen; + PoolReadGuard pg(¢roidsSet); + result = pg.getReadResult(); + if (result != returnvalue::OK) { + return result; + } + + result = SerializeAdapter::deSerialize(¢roidSet.ticks, &rawFrame, &remainingLen, + SerializeIF::Endianness::LITTLE); + if (result != returnvalue::OK) { + return result; + } + result = SerializeAdapter::deSerialize(¢roidSet.timeUs, &rawFrame, &remainingLen, + SerializeIF::Endianness::LITTLE); + if (result != returnvalue::OK) { + return result; + } + result = SerializeAdapter::deSerialize(¢roidSet.centroidCount, &rawFrame, &remainingLen, + SerializeIF::Endianness::LITTLE); + if (result != returnvalue::OK) { + return result; + } + centroidSet.setValidity(true, true); + return returnvalue::OK; +} + +ReturnValue_t StarTrackerHandler::handleCentroidsTm(const uint8_t* rawFrame) { + ReturnValue_t result = statusFieldCheck(rawFrame); + if (result != returnvalue::OK) { + return result; + } + size_t remainingLen = fullPacketLen; + PoolReadGuard pg(¢roidsSet); + result = pg.getReadResult(); + if (result != returnvalue::OK) { + return result; + } + + result = SerializeAdapter::deSerialize(¢roidsSet.ticksCentroidsTm, &rawFrame, &remainingLen, + SerializeIF::Endianness::LITTLE); + if (result != returnvalue::OK) { + return result; + } + result = SerializeAdapter::deSerialize(¢roidsSet.timeUsCentroidsTm, &rawFrame, &remainingLen, + SerializeIF::Endianness::LITTLE); + if (result != returnvalue::OK) { + return result; + } + result = SerializeAdapter::deSerialize(¢roidsSet.centroidsCount, &rawFrame, &remainingLen, + SerializeIF::Endianness::LITTLE); + if (result != returnvalue::OK) { + return result; + } + for (unsigned idx = 0; idx < 16; idx++) { + result = SerializeAdapter::deSerialize(¢roidsSet.centroidsXCoords[idx], &rawFrame, + &remainingLen, SerializeIF::Endianness::LITTLE); + if (result != returnvalue::OK) { + return result; + } + result = SerializeAdapter::deSerialize(¢roidsSet.centroidsYCoords[idx], &rawFrame, + &remainingLen, SerializeIF::Endianness::LITTLE); + if (result != returnvalue::OK) { + return result; + } + result = SerializeAdapter::deSerialize(¢roidsSet.centroidsMagnitudes[idx], &rawFrame, + &remainingLen, SerializeIF::Endianness::LITTLE); + if (result != returnvalue::OK) { + return result; + } + } + centroidsSet.setValidity(true, true); return returnvalue::OK; } @@ -2446,6 +2575,8 @@ ReturnValue_t StarTrackerHandler::checkCommand(ActionId_t actionId) { case startracker::REQ_MATCHED_CENTROIDS: case startracker::REQ_BLOB: case startracker::REQ_BLOBS: + case startracker::REQ_CENTROID: + case startracker::REQ_CENTROIDS: if (getMode() == MODE_ON and getSubmode() != startracker::Program::FIRMWARE) { return STARTRACKER_NOT_RUNNING_FIRMWARE; } diff --git a/mission/acs/str/StarTrackerHandler.h b/mission/acs/str/StarTrackerHandler.h index db8335b0..e7fdc307 100644 --- a/mission/acs/str/StarTrackerHandler.h +++ b/mission/acs/str/StarTrackerHandler.h @@ -206,7 +206,10 @@ class StarTrackerHandler : public DeviceHandlerBase { startracker::LogSubscriptionSet logSubscriptionSet; startracker::DebugCameraSet debugCameraSet; startracker::MatchedCentroidsSet matchedCentroids; + startracker::BlobSet blobSet; startracker::BlobsSet blobsSet; + startracker::CentroidSet centroidSet; + startracker::CentroidsSet centroidsSet; // Pointer to object responsible for uploading and downloading images to/from the star tracker StrComHandler* strHelper = nullptr; @@ -437,6 +440,8 @@ class StarTrackerHandler : public DeviceHandlerBase { ReturnValue_t prepareRequestMatchedCentroids(); ReturnValue_t prepareRequestBlobTm(); ReturnValue_t prepareRequestBlobsTm(); + ReturnValue_t prepareRequestCentroidTm(); + ReturnValue_t prepareRequestCentroidsTm(); ReturnValue_t prepareRequestTrackingParams(); ReturnValue_t prepareRequestValidationParams(); ReturnValue_t prepareRequestAlgoParams(); @@ -500,6 +505,8 @@ class StarTrackerHandler : public DeviceHandlerBase { ReturnValue_t handleMatchedCentroidTm(const uint8_t* rawFrame); ReturnValue_t handleBlobTm(const uint8_t* rawFrame); ReturnValue_t handleBlobsTm(const uint8_t* rawFrame); + ReturnValue_t handleCentroidTm(const uint8_t* rawFrame); + ReturnValue_t handleCentroidsTm(const uint8_t* rawFrame); /** * @brief Checks if star tracker is in valid mode for executing the received command. diff --git a/mission/acs/str/strHelpers.h b/mission/acs/str/strHelpers.h index 5d9c483f..8bd63512 100644 --- a/mission/acs/str/strHelpers.h +++ b/mission/acs/str/strHelpers.h @@ -294,6 +294,17 @@ enum PoolIds : lp_id_t { BLOBS_NR_4LINES_SKIPPED, BLOBS_X_COORDS, BLOBS_Y_COORDS, + + CENTROID_TICKS, + CENTROID_TIME, + CENTROID_COUNT, + + CENTROIDS_TICKS, + CENTROIDS_TIME, + CENTROIDS_COUNT, + CENTROIDS_X_COORDS, + CENTROIDS_Y_COORDS, + CENTROIDS_MAGNITUDES, }; static const DeviceCommandId_t PING_REQUEST = 0; @@ -352,6 +363,8 @@ static constexpr DeviceCommandId_t AUTO_THRESHOLD = 88; static constexpr DeviceCommandId_t REQ_MATCHED_CENTROIDS = 89; static constexpr DeviceCommandId_t REQ_BLOB = 90; static constexpr DeviceCommandId_t REQ_BLOBS = 91; +static constexpr DeviceCommandId_t REQ_CENTROID = 92; +static constexpr DeviceCommandId_t REQ_CENTROIDS = 93; static const DeviceCommandId_t NONE = 0xFFFFFFFF; static const uint32_t VERSION_SET_ID = REQ_VERSION; @@ -377,7 +390,10 @@ static const uint32_t SUBSCRIPTION_SET_ID = REQ_SUBSCRIPTION; static const uint32_t LOG_SUBSCRIPTION_SET_ID = REQ_LOG_SUBSCRIPTION; static const uint32_t DEBUG_CAMERA_SET_ID = REQ_DEBUG_CAMERA; static const uint32_t MATCHED_CENTROIDS_SET_ID = REQ_MATCHED_CENTROIDS; +static const uint32_t BLOB_SET_ID = REQ_BLOB; static const uint32_t BLOBS_SET_ID = REQ_BLOBS; +static const uint32_t CENTROID_SET_ID = REQ_CENTROID; +static const uint32_t CENTROIDS_SET_ID = REQ_CENTROIDS; /** Max size of unencoded frame */ static const size_t MAX_FRAME_SIZE = 1200; @@ -1436,21 +1452,23 @@ class MatchedCentroidsSet : public StaticLocalDataSet<20> { private: }; -class BlobsSet : public StaticLocalDataSet<20> { +class BlobSet : public StaticLocalDataSet<5> { public: - BlobsSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, BLOBS_SET_ID) {} - + BlobSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, BLOB_SET_ID) {} // The blob count received from the Blob Telemetry Set (ID 25) // Ticks timestamp - lp_var_t ticksBlobTm = lp_var_t(sid.objectId, PoolIds::BLOB_TICKS, this); + lp_var_t ticks = lp_var_t(sid.objectId, PoolIds::BLOB_TICKS, this); // Unix time stamp - lp_var_t timeUsBlobTm = lp_var_t(sid.objectId, PoolIds::BLOB_TIME, this); + lp_var_t timeUs = lp_var_t(sid.objectId, PoolIds::BLOB_TIME, this); lp_var_t blobCount = lp_var_t(sid.objectId, PoolIds::BLOB_COUNT, this); - +}; +class BlobsSet : public StaticLocalDataSet<10> { + public: + BlobsSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, BLOBS_SET_ID) {} // Ticks timestamp - lp_var_t ticksBlobsTm = lp_var_t(sid.objectId, PoolIds::BLOBS_TICKS, this); + lp_var_t ticks = lp_var_t(sid.objectId, PoolIds::BLOBS_TICKS, this); // Unix time stamp - lp_var_t timeUsBlobsTm = lp_var_t(sid.objectId, PoolIds::BLOBS_TIME, this); + lp_var_t timeUs = lp_var_t(sid.objectId, PoolIds::BLOBS_TIME, this); lp_var_t blobsCount = lp_var_t(sid.objectId, PoolIds::BLOBS_COUNT, this); lp_var_t blobsCountUsed = lp_var_t(sid.objectId, PoolIds::BLOBS_COUNT_USED, this); @@ -1462,6 +1480,40 @@ class BlobsSet : public StaticLocalDataSet<20> { lp_vec_t(sid.objectId, PoolIds::BLOBS_Y_COORDS, this); }; +class CentroidSet : public StaticLocalDataSet<5> { + public: + CentroidSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, CENTROID_SET_ID) {} + + // Data received from the Centroid Telemetry Set (ID 26) + // Ticks timestamp + lp_var_t ticks = lp_var_t(sid.objectId, PoolIds::CENTROID_TICKS, this); + // Unix time stamp + lp_var_t timeUs = lp_var_t(sid.objectId, PoolIds::CENTROID_TIME, this); + // The centroid count received from the Centroid Telemetry Set (ID 26) + lp_var_t centroidCount = + lp_var_t(sid.objectId, PoolIds::CENTROID_COUNT, this); +}; + +class CentroidsSet : public StaticLocalDataSet<10> { + public: + CentroidsSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, CENTROIDS_SET_ID) {} + + // Data received from the Centroids Telemetry Set (ID 37) + lp_var_t ticksCentroidsTm = + lp_var_t(sid.objectId, PoolIds::CENTROIDS_TICKS, this); + // Unix time stamp + lp_var_t timeUsCentroidsTm = + lp_var_t(sid.objectId, PoolIds::CENTROIDS_TIME, this); + lp_var_t centroidsCount = + lp_var_t(sid.objectId, PoolIds::CENTROIDS_COUNT, this); + lp_vec_t centroidsXCoords = + lp_vec_t(sid.objectId, PoolIds::CENTROIDS_X_COORDS, this); + lp_vec_t centroidsYCoords = + lp_vec_t(sid.objectId, PoolIds::CENTROIDS_Y_COORDS, this); + lp_vec_t centroidsMagnitudes = + lp_vec_t(sid.objectId, PoolIds::CENTROIDS_MAGNITUDES, this); +}; + /** * @brief Will store the requested algo parameters */ From 8fe4a85998569057f3343d9f241639308ac4c7c3 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 9 Oct 2023 15:18:40 +0200 Subject: [PATCH 126/257] missing API calls --- mission/acs/str/StarTrackerHandler.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mission/acs/str/StarTrackerHandler.cpp b/mission/acs/str/StarTrackerHandler.cpp index 20c2b511..7630120f 100644 --- a/mission/acs/str/StarTrackerHandler.cpp +++ b/mission/acs/str/StarTrackerHandler.cpp @@ -478,9 +478,11 @@ ReturnValue_t StarTrackerHandler::buildCommandFromCommand(DeviceCommandId_t devi return returnvalue::OK; } case (startracker::REQ_CENTROID): { + prepareRequestCentroidTm(); return returnvalue::OK; } case (startracker::REQ_CENTROIDS): { + prepareRequestCentroidsTm(); return returnvalue::OK; } case (startracker::BOOT): { From 25a5e187f6f4a5661c043e383e1f88f11526c5f5 Mon Sep 17 00:00:00 2001 From: meggert Date: Mon, 9 Oct 2023 15:21:38 +0200 Subject: [PATCH 127/257] object factory changes --- bsp_q7s/em/emObjectFactory.cpp | 2 +- bsp_q7s/fmObjectFactory.cpp | 20 +++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/bsp_q7s/em/emObjectFactory.cpp b/bsp_q7s/em/emObjectFactory.cpp index 94e10784..bf7db524 100644 --- a/bsp_q7s/em/emObjectFactory.cpp +++ b/bsp_q7s/em/emObjectFactory.cpp @@ -147,6 +147,7 @@ void ObjectFactory::produce(void* args) { #if OBSW_ADD_BPX_BATTERY_HANDLER == 1 createBpxBatteryComponent(enableHkSets, battAndImtqI2cDev); #endif + createPowerController(true, enableHkSets); #if OBSW_ADD_STAR_TRACKER == 1 createStrComponents(pwrSwitcher); @@ -178,7 +179,6 @@ void ObjectFactory::produce(void* args) { power::Switches::PDU1_CH5_SOLAR_CELL_EXP_5V); #endif createAcsController(true, enableHkSets); - createPowerController(true, enableHkSets); HeaterHandler* heaterHandler; createHeaterComponents(gpioComIF, pwrSwitcher, healthTable, heaterHandler); createThermalController(*heaterHandler, true); diff --git a/bsp_q7s/fmObjectFactory.cpp b/bsp_q7s/fmObjectFactory.cpp index c6dc1d28..c01c4ccb 100644 --- a/bsp_q7s/fmObjectFactory.cpp +++ b/bsp_q7s/fmObjectFactory.cpp @@ -81,14 +81,6 @@ void ObjectFactory::produce(void* args) { createTmpComponents(tmpDevsToAdd); #endif createSolarArrayDeploymentComponents(*pwrSwitcher, *gpioComIF); -#if OBSW_ADD_PL_PCDU == 1 - createPlPcduComponents(gpioComIF, spiMainComIF, pwrSwitcher, *stackHandler); -#endif -#if OBSW_ADD_SYRLINKS == 1 - createSyrlinksComponents(pwrSwitcher); -#endif /* OBSW_ADD_SYRLINKS == 1 */ - createRtdComponents(q7s::SPI_DEFAULT_DEV, gpioComIF, pwrSwitcher, spiMainComIF); - createPayloadComponents(gpioComIF, *pwrSwitcher); const char* battAndImtqI2cDev = q7s::I2C_PL_EIVE; if (core::FW_VERSION_MAJOR >= 4) { @@ -102,6 +94,17 @@ void ObjectFactory::produce(void* args) { #if OBSW_ADD_BPX_BATTERY_HANDLER == 1 createBpxBatteryComponent(enableHkSets, battAndImtqI2cDev); #endif + createPowerController(true, enableHkSets); + +#if OBSW_ADD_PL_PCDU == 1 + createPlPcduComponents(gpioComIF, spiMainComIF, pwrSwitcher, *stackHandler); +#endif +#if OBSW_ADD_SYRLINKS == 1 + createSyrlinksComponents(pwrSwitcher); +#endif /* OBSW_ADD_SYRLINKS == 1 */ + + createRtdComponents(q7s::SPI_DEFAULT_DEV, gpioComIF, pwrSwitcher, spiMainComIF); + createPayloadComponents(gpioComIF, *pwrSwitcher); #if OBSW_ADD_STAR_TRACKER == 1 createStrComponents(pwrSwitcher); @@ -132,6 +135,5 @@ void ObjectFactory::produce(void* args) { createMiscComponents(); createThermalController(*heaterHandler, false); createAcsController(true, enableHkSets); - createPowerController(true, enableHkSets); satsystem::init(false); } From 9421b220987b53bbd038b672dab17021b7c37221 Mon Sep 17 00:00:00 2001 From: meggert Date: Mon, 9 Oct 2023 15:21:53 +0200 Subject: [PATCH 128/257] remove from target table --- mission/system/power/epsModeTree.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mission/system/power/epsModeTree.cpp b/mission/system/power/epsModeTree.cpp index 7c81b38f..83f04ac5 100644 --- a/mission/system/power/epsModeTree.cpp +++ b/mission/system/power/epsModeTree.cpp @@ -87,8 +87,7 @@ void buildNormalSequence(Subsystem& ss, ModeListEntry& eh) { check(sequence.insert(eh), ctxc); }; - // Normal target table - iht(objects::POWER_CONTROLLER, NML, 0, EPS_TABLE_NORMAL_TGT.second); + // Normal table target table is empty check(ss.addTable(TableEntry(EPS_TABLE_NORMAL_TGT.first, &EPS_TABLE_NORMAL_TGT.second)), ctxc); // Transition 0 From e65352818f0cd986d3b7ebdb9f1606ea143c8c0a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 9 Oct 2023 15:29:04 +0200 Subject: [PATCH 129/257] added logic for secondary TM handling --- mission/acs/str/StarTrackerHandler.cpp | 15 ++++++++++++--- mission/acs/str/StarTrackerHandler.h | 8 ++++++-- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/mission/acs/str/StarTrackerHandler.cpp b/mission/acs/str/StarTrackerHandler.cpp index 7630120f..087780eb 100644 --- a/mission/acs/str/StarTrackerHandler.cpp +++ b/mission/acs/str/StarTrackerHandler.cpp @@ -64,6 +64,8 @@ StarTrackerHandler::StarTrackerHandler(object_id_t objectId, object_id_t comIF, sif::error << "StarTrackerHandler: Invalid str image loader" << std::endl; } eventQueue = QueueFactory::instance()->createMessageQueue(EventMessage::EVENT_MESSAGE_SIZE * 5); + additionalRequestedTm.emplace(startracker::REQ_TEMPERATURE); + currentSecondaryTmIter = additionalRequestedTm.begin(); } StarTrackerHandler::~StarTrackerHandler() {} @@ -311,13 +313,20 @@ ReturnValue_t StarTrackerHandler::buildNormalDeviceCommand(DeviceCommandId_t* id return NOTHING_TO_SEND; } switch (normalState) { - case NormalState::TEMPERATURE_REQUEST: - *id = startracker::REQ_TEMPERATURE; + case NormalState::SECONDARY_REQUEST: + if (additionalRequestedTm.size() == 0) { + break; + } + *id = *currentSecondaryTmIter; + currentSecondaryTmIter++; + if (currentSecondaryTmIter == additionalRequestedTm.end()) { + currentSecondaryTmIter = additionalRequestedTm.begin(); + } normalState = NormalState::SOLUTION_REQUEST; break; case NormalState::SOLUTION_REQUEST: *id = startracker::REQ_SOLUTION; - normalState = NormalState::TEMPERATURE_REQUEST; + normalState = NormalState::SECONDARY_REQUEST; break; default: sif::debug << "StarTrackerHandler::buildNormalDeviceCommand: Invalid normal step" diff --git a/mission/acs/str/StarTrackerHandler.h b/mission/acs/str/StarTrackerHandler.h index e7fdc307..ac5812a9 100644 --- a/mission/acs/str/StarTrackerHandler.h +++ b/mission/acs/str/StarTrackerHandler.h @@ -8,6 +8,7 @@ #include #include +#include #include #include "OBSWConfig.h" @@ -245,9 +246,9 @@ class StarTrackerHandler : public DeviceHandlerBase { std::string paramJsonFile; - enum class NormalState { TEMPERATURE_REQUEST, SOLUTION_REQUEST }; + enum class NormalState { SECONDARY_REQUEST, SOLUTION_REQUEST }; - NormalState normalState = NormalState::TEMPERATURE_REQUEST; + NormalState normalState = NormalState::SECONDARY_REQUEST; enum class StartupState { IDLE, @@ -305,6 +306,9 @@ class StarTrackerHandler : public DeviceHandlerBase { size_t fullPacketLen = 0; + std::set additionalRequestedTm{}; + std::set::iterator currentSecondaryTmIter; + /** * @brief Handles internal state */ From 5f9247ee1e988be5d249734b5e008c7d2cde8b3d Mon Sep 17 00:00:00 2001 From: meggert Date: Mon, 9 Oct 2023 15:36:49 +0200 Subject: [PATCH 130/257] this does not work --- mission/controller/PowerController.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/mission/controller/PowerController.cpp b/mission/controller/PowerController.cpp index edda2911..c990ee59 100644 --- a/mission/controller/PowerController.cpp +++ b/mission/controller/PowerController.cpp @@ -48,6 +48,7 @@ ReturnValue_t PowerController::getParameter(uint8_t domainId, uint8_t parameterI ReturnValue_t result = calculateCoulombCounterChargeUpperThreshold(); if (result != returnvalue::OK) { coulombCounterVoltageUpperThreshold = oldCoulombCounterVoltageUpperThreshold; + return returnvalue::FAILED; } break; } @@ -268,7 +269,7 @@ ReturnValue_t PowerController::calculateOpenCircuitVoltageCharge() { float vBatCorrected = (bpxBatteryHk.battVoltage.value - iBat * batteryInternalResistance) * CONVERT_FROM_MILLI; uint8_t lookUpTableIdx = LOOK_UP_TABLE_MAX_IDX; - ReturnValue_t result = lookUpTableOcvIdxFinder(vBatCorrected, lookUpTableIdx); + ReturnValue_t result = lookUpTableOcvIdxFinder(vBatCorrected, lookUpTableIdx, false); if (result != returnvalue::OK) { return result; } @@ -328,16 +329,16 @@ float PowerController::linearInterpolation(float x, float x0, float x1, float y0 return y0 + (x - x0) * (y1 - y0) / (x1 - x0); } -ReturnValue_t PowerController::lookUpTableOcvIdxFinder(float voltage, uint8_t &idx) { +ReturnValue_t PowerController::lookUpTableOcvIdxFinder(float voltage, uint8_t &idx, bool paramCmd) { if (voltage >= lookUpTableOcv[1][99]) { - if (not voltageOutOfBoundsFlag) { + if (not voltageOutOfBoundsFlag and not paramCmd) { triggerEvent(power::VOLTAGE_OUT_OF_BOUNDS, 0, static_cast(voltage * 10)); voltageOutOfBoundsFlag = true; } sif::error << "Power Controller::Voltage is too high: " << voltage << std::endl; return returnvalue::FAILED; } else if (voltage <= lookUpTableOcv[1][0]) { - if (not voltageOutOfBoundsFlag) { + if (not voltageOutOfBoundsFlag and not paramCmd) { triggerEvent(power::VOLTAGE_OUT_OF_BOUNDS, 1, static_cast(voltage * 10)); voltageOutOfBoundsFlag = true; } @@ -354,7 +355,7 @@ ReturnValue_t PowerController::lookUpTableOcvIdxFinder(float voltage, uint8_t &i ReturnValue_t PowerController::calculateCoulombCounterChargeUpperThreshold() { uint8_t lookUpTableIdx = LOOK_UP_TABLE_MAX_IDX; ReturnValue_t result = - lookUpTableOcvIdxFinder(coulombCounterVoltageUpperThreshold, lookUpTableIdx); + lookUpTableOcvIdxFinder(coulombCounterVoltageUpperThreshold, lookUpTableIdx, true); if (result != returnvalue::OK) { return result; } From 93939f95414734cd73158acf25e26f3039c639bd Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 9 Oct 2023 15:56:48 +0200 Subject: [PATCH 131/257] that should do the job --- mission/acs/str/StarTrackerHandler.cpp | 38 ++++++++++++++++++++++++++ mission/acs/str/StarTrackerHandler.h | 12 ++++++++ mission/acs/str/strHelpers.h | 3 ++ 3 files changed, 53 insertions(+) diff --git a/mission/acs/str/StarTrackerHandler.cpp b/mission/acs/str/StarTrackerHandler.cpp index 087780eb..bf31c99a 100644 --- a/mission/acs/str/StarTrackerHandler.cpp +++ b/mission/acs/str/StarTrackerHandler.cpp @@ -172,6 +172,35 @@ ReturnValue_t StarTrackerHandler::executeAction(ActionId_t actionId, MessageQueu ReturnValue_t result = returnvalue::OK; switch (actionId) { + case (startracker::ADD_SECONDARY_TM_TO_NORMAL_MODE): { + if (size < 4) { + return HasActionsIF::INVALID_PARAMETERS; + } + DeviceCommandId_t idToAdd; + result = + SerializeAdapter::deSerialize(&idToAdd, data, &size, SerializeIF::Endianness::NETWORK); + if (result != returnvalue::OK) { + return result; + } + addSecondaryTmForNormalMode(idToAdd); + return EXECUTION_FINISHED; + } + case (startracker::RESET_SECONDARY_TM_SET): { + resetSecondaryTmSet(); + return EXECUTION_FINISHED; + } + case (startracker::READ_SECONDARY_TM_SET): { + std::vector dataVec(additionalRequestedTm.size() * 4); + unsigned idx = 0; + size_t serLen = 0; + for (const auto& cmd : additionalRequestedTm) { + SerializeAdapter::serialize(&cmd, dataVec.data() + idx * 4, &serLen, dataVec.size(), + SerializeIF::Endianness::NETWORK); + idx++; + } + actionHelper.reportData(commandedBy, actionId, dataVec.data(), dataVec.size()); + return EXECUTION_FINISHED; + } case (startracker::STOP_IMAGE_LOADER): { strHelper->stopProcess(); return EXECUTION_FINISHED; @@ -914,6 +943,15 @@ ReturnValue_t StarTrackerHandler::statusFieldCheck(const uint8_t* rawFrame) { return returnvalue::OK; } +void StarTrackerHandler::addSecondaryTmForNormalMode(DeviceCommandId_t cmd) { + additionalRequestedTm.emplace(cmd); +} + +void StarTrackerHandler::resetSecondaryTmSet() { + additionalRequestedTm.clear(); + additionalRequestedTm.emplace(startracker::REQ_TEMPERATURE); +} + void StarTrackerHandler::bootBootloader() { if (internalState == InternalState::IDLE) { internalState = InternalState::BOOT_BOOTLOADER; diff --git a/mission/acs/str/StarTrackerHandler.h b/mission/acs/str/StarTrackerHandler.h index ac5812a9..b239559a 100644 --- a/mission/acs/str/StarTrackerHandler.h +++ b/mission/acs/str/StarTrackerHandler.h @@ -357,6 +357,18 @@ class StarTrackerHandler : public DeviceHandlerBase { */ ReturnValue_t executeFlashReadCommand(const uint8_t* commandData, size_t commandDataLen); + /** + * Add a TM request to the list of telemetry which will be polled in the secondary step of + * the device communication. + * @param cmd + */ + void addSecondaryTmForNormalMode(DeviceCommandId_t cmd); + + /** + * Reset the secondary set, which will only contain a TEMPERATURE set request after the reset. + */ + void resetSecondaryTmSet(); + /** * @brief Fills command buffer with data to boot image (works only when star tracker is * in bootloader mode). diff --git a/mission/acs/str/strHelpers.h b/mission/acs/str/strHelpers.h index 8bd63512..31ac0c05 100644 --- a/mission/acs/str/strHelpers.h +++ b/mission/acs/str/strHelpers.h @@ -365,6 +365,9 @@ static constexpr DeviceCommandId_t REQ_BLOB = 90; static constexpr DeviceCommandId_t REQ_BLOBS = 91; static constexpr DeviceCommandId_t REQ_CENTROID = 92; static constexpr DeviceCommandId_t REQ_CENTROIDS = 93; +static constexpr DeviceCommandId_t ADD_SECONDARY_TM_TO_NORMAL_MODE = 94; +static constexpr DeviceCommandId_t RESET_SECONDARY_TM_SET = 95; +static constexpr DeviceCommandId_t READ_SECONDARY_TM_SET = 96; static const DeviceCommandId_t NONE = 0xFFFFFFFF; static const uint32_t VERSION_SET_ID = REQ_VERSION; From 33d3e7686cc56b4940cc355aeb7878fcbde73dba Mon Sep 17 00:00:00 2001 From: meggert Date: Tue, 10 Oct 2023 10:06:10 +0200 Subject: [PATCH 132/257] right we need dummies ... --- dummies/PlPcduDummy.cpp | 15 +++++++++++++++ dummies/PlPcduDummy.h | 6 ++++++ dummies/PlocMpsocDummy.cpp | 15 +++++++++++++++ dummies/PlocMpsocDummy.h | 5 +++++ dummies/PlocSupervisorDummy.cpp | 16 ++++++++++++++++ dummies/PlocSupervisorDummy.h | 5 +++++ 6 files changed, 62 insertions(+) diff --git a/dummies/PlPcduDummy.cpp b/dummies/PlPcduDummy.cpp index 7dfa4464..589fb075 100644 --- a/dummies/PlPcduDummy.cpp +++ b/dummies/PlPcduDummy.cpp @@ -43,3 +43,18 @@ ReturnValue_t PlPcduDummy::initializeLocalDataPool(localpool::DataPool &localDat localDataPoolMap.emplace(plpcdu::PlPcduPoolIds::TEMP, new PoolEntry({0.0}, true)); return returnvalue::OK; } + +ReturnValue_t PlPcduDummy::checkModeCommand(Mode_t commandedMode, Submode_t commandedSubmode, + uint32_t *msToReachTheMode) { + if (commandedMode != MODE_OFF) { + PoolReadGuard pg(&enablePl); + if (pg.getReadResult() == returnvalue::OK) { + if (enablePl.plUseAllowed.isValid() and enablePl.plUseAllowed.value) { + return DeviceHandlerBase::checkModeCommand(commandedMode, commandedSubmode, + msToReachTheMode); + } + } + return NON_OP_STATE_OF_CHARGE; + } + return DeviceHandlerBase::checkModeCommand(commandedMode, commandedSubmode, msToReachTheMode); +} diff --git a/dummies/PlPcduDummy.h b/dummies/PlPcduDummy.h index 8bf7f0c2..70ee5c46 100644 --- a/dummies/PlPcduDummy.h +++ b/dummies/PlPcduDummy.h @@ -1,7 +1,9 @@ #ifndef DUMMIES_PLPCDUDUMMY_H_ #define DUMMIES_PLPCDUDUMMY_H_ +#include #include +#include #include class PlPcduDummy : public DeviceHandlerBase { @@ -29,6 +31,10 @@ class PlPcduDummy : public DeviceHandlerBase { uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override; ReturnValue_t initializeLocalDataPool(localpool::DataPool &localDataPoolMap, LocalDataPoolManager &poolManager) override; + + ReturnValue_t checkModeCommand(Mode_t commandedMode, Submode_t commandedSubmode, + uint32_t *msToReachTheMode) override; + pwrctrl::EnablePl enablePl = pwrctrl::EnablePl(objects::POWER_CONTROLLER); }; #endif /* DUMMIES_PLPCDUDUMMY_H_ */ diff --git a/dummies/PlocMpsocDummy.cpp b/dummies/PlocMpsocDummy.cpp index e1410ba1..47af8513 100644 --- a/dummies/PlocMpsocDummy.cpp +++ b/dummies/PlocMpsocDummy.cpp @@ -23,6 +23,21 @@ ReturnValue_t PlocMpsocDummy::buildCommandFromCommand(DeviceCommandId_t deviceCo return returnvalue::OK; } +ReturnValue_t PlocMpsocDummy::checkModeCommand(Mode_t commandedMode, Submode_t commandedSubmode, + uint32_t *msToReachTheMode) { + if (commandedMode != MODE_OFF) { + PoolReadGuard pg(&enablePl); + if (pg.getReadResult() == returnvalue::OK) { + if (enablePl.plUseAllowed.isValid() and enablePl.plUseAllowed.value) { + return DeviceHandlerBase::checkModeCommand(commandedMode, commandedSubmode, + msToReachTheMode); + } + } + return NON_OP_STATE_OF_CHARGE; + } + return DeviceHandlerBase::checkModeCommand(commandedMode, commandedSubmode, msToReachTheMode); +} + ReturnValue_t PlocMpsocDummy::scanForReply(const uint8_t *start, size_t len, DeviceCommandId_t *foundId, size_t *foundLen) { return returnvalue::OK; diff --git a/dummies/PlocMpsocDummy.h b/dummies/PlocMpsocDummy.h index cc09e45e..28960fe3 100644 --- a/dummies/PlocMpsocDummy.h +++ b/dummies/PlocMpsocDummy.h @@ -1,6 +1,8 @@ #pragma once +#include #include +#include #include "mission/power/defs.h" @@ -24,6 +26,9 @@ class PlocMpsocDummy : public DeviceHandlerBase { size_t commandDataLen) override; ReturnValue_t scanForReply(const uint8_t *start, size_t len, DeviceCommandId_t *foundId, size_t *foundLen) override; + ReturnValue_t checkModeCommand(Mode_t commandedMode, Submode_t commandedSubmode, + uint32_t *msToReachTheMode) override; + pwrctrl::EnablePl enablePl = pwrctrl::EnablePl(objects::POWER_CONTROLLER); ReturnValue_t interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) override; void fillCommandAndReplyMap() override; uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override; diff --git a/dummies/PlocSupervisorDummy.cpp b/dummies/PlocSupervisorDummy.cpp index b9b1948f..f37bb328 100644 --- a/dummies/PlocSupervisorDummy.cpp +++ b/dummies/PlocSupervisorDummy.cpp @@ -51,3 +51,19 @@ ReturnValue_t PlocSupervisorDummy::getSwitches(const uint8_t **switches, *switches = reinterpret_cast(&switchId); return returnvalue::OK; } + +ReturnValue_t PlocSupervisorDummy::checkModeCommand(Mode_t commandedMode, + Submode_t commandedSubmode, + uint32_t *msToReachTheMode) { + if (commandedMode != MODE_OFF) { + PoolReadGuard pg(&enablePl); + if (pg.getReadResult() == returnvalue::OK) { + if (enablePl.plUseAllowed.isValid() and enablePl.plUseAllowed.value) { + return DeviceHandlerBase::checkModeCommand(commandedMode, commandedSubmode, + msToReachTheMode); + } + } + return NON_OP_STATE_OF_CHARGE; + } + return DeviceHandlerBase::checkModeCommand(commandedMode, commandedSubmode, msToReachTheMode); +} diff --git a/dummies/PlocSupervisorDummy.h b/dummies/PlocSupervisorDummy.h index 33951cb7..c5334e56 100644 --- a/dummies/PlocSupervisorDummy.h +++ b/dummies/PlocSupervisorDummy.h @@ -1,6 +1,8 @@ #pragma once +#include #include +#include #include class PlocSupervisorDummy : public DeviceHandlerBase { @@ -32,4 +34,7 @@ class PlocSupervisorDummy : public DeviceHandlerBase { ReturnValue_t initializeLocalDataPool(localpool::DataPool &localDataPoolMap, LocalDataPoolManager &poolManager) override; ReturnValue_t getSwitches(const uint8_t **switches, uint8_t *numberOfSwitches) override; + ReturnValue_t checkModeCommand(Mode_t commandedMode, Submode_t commandedSubmode, + uint32_t *msToReachTheMode) override; + pwrctrl::EnablePl enablePl = pwrctrl::EnablePl(objects::POWER_CONTROLLER); }; From 000077f327a23233090fb5178d5a9cd36fce8590 Mon Sep 17 00:00:00 2001 From: meggert Date: Tue, 10 Oct 2023 10:06:32 +0200 Subject: [PATCH 133/257] corrected logic --- linux/payload/PlocMpsocHandler.cpp | 6 ++++-- linux/payload/PlocSupervisorHandler.cpp | 6 ++++-- mission/payload/PayloadPcduHandler.cpp | 6 ++++-- mission/system/objects/CamSwitcher.cpp | 6 ++++-- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/linux/payload/PlocMpsocHandler.cpp b/linux/payload/PlocMpsocHandler.cpp index 66fba6d8..c5a17536 100644 --- a/linux/payload/PlocMpsocHandler.cpp +++ b/linux/payload/PlocMpsocHandler.cpp @@ -1511,10 +1511,12 @@ ReturnValue_t PlocMpsocHandler::checkModeCommand(Mode_t commandedMode, Submode_t if (commandedMode != MODE_OFF) { PoolReadGuard pg(&enablePl); if (pg.getReadResult() == returnvalue::OK) { - if (enablePl.plUseAllowed.isValid() and not enablePl.plUseAllowed.value) { - return NON_OP_STATE_OF_CHARGE; + if (enablePl.plUseAllowed.isValid() and enablePl.plUseAllowed.value) { + return DeviceHandlerBase::checkModeCommand(commandedMode, commandedSubmode, + msToReachTheMode); } } + return NON_OP_STATE_OF_CHARGE; } return DeviceHandlerBase::checkModeCommand(commandedMode, commandedSubmode, msToReachTheMode); } diff --git a/linux/payload/PlocSupervisorHandler.cpp b/linux/payload/PlocSupervisorHandler.cpp index 0c6311de..43b8abb2 100644 --- a/linux/payload/PlocSupervisorHandler.cpp +++ b/linux/payload/PlocSupervisorHandler.cpp @@ -1999,10 +1999,12 @@ ReturnValue_t PlocSupervisorHandler::checkModeCommand(Mode_t commandedMode, if (commandedMode != MODE_OFF) { PoolReadGuard pg(&enablePl); if (pg.getReadResult() == returnvalue::OK) { - if (enablePl.plUseAllowed.isValid() and not enablePl.plUseAllowed.value) { - return NON_OP_STATE_OF_CHARGE; + if (enablePl.plUseAllowed.isValid() and enablePl.plUseAllowed.value) { + return DeviceHandlerBase::checkModeCommand(commandedMode, commandedSubmode, + msToReachTheMode); } } + return NON_OP_STATE_OF_CHARGE; } return DeviceHandlerBase::checkModeCommand(commandedMode, commandedSubmode, msToReachTheMode); } diff --git a/mission/payload/PayloadPcduHandler.cpp b/mission/payload/PayloadPcduHandler.cpp index bda15b20..d75ec35e 100644 --- a/mission/payload/PayloadPcduHandler.cpp +++ b/mission/payload/PayloadPcduHandler.cpp @@ -569,10 +569,12 @@ ReturnValue_t PayloadPcduHandler::checkModeCommand(Mode_t commandedMode, Submode if (commandedMode != MODE_OFF) { PoolReadGuard pg(&enablePl); if (pg.getReadResult() == returnvalue::OK) { - if (enablePl.plUseAllowed.isValid() and not enablePl.plUseAllowed.value) { - return NON_OP_STATE_OF_CHARGE; + if (enablePl.plUseAllowed.isValid() and enablePl.plUseAllowed.value) { + return DeviceHandlerBase::checkModeCommand(commandedMode, commandedSubmode, + msToReachTheMode); } } + return NON_OP_STATE_OF_CHARGE; } return DeviceHandlerBase::checkModeCommand(commandedMode, commandedSubmode, msToReachTheMode); } diff --git a/mission/system/objects/CamSwitcher.cpp b/mission/system/objects/CamSwitcher.cpp index 93b67646..300d1cb2 100644 --- a/mission/system/objects/CamSwitcher.cpp +++ b/mission/system/objects/CamSwitcher.cpp @@ -14,10 +14,12 @@ ReturnValue_t CamSwitcher::checkModeCommand(Mode_t commandedMode, Submode_t comm if (commandedMode != MODE_OFF) { PoolReadGuard pg(&enablePl); if (pg.getReadResult() == returnvalue::OK) { - if (enablePl.plUseAllowed.isValid() and not enablePl.plUseAllowed.value) { - return TRANS_NOT_ALLOWED; + if (enablePl.plUseAllowed.isValid() and enablePl.plUseAllowed.value) { + return PowerSwitcherComponent::checkModeCommand(commandedMode, commandedSubmode, + msToReachTheMode); } } + return TRANS_NOT_ALLOWED; } return PowerSwitcherComponent::checkModeCommand(commandedMode, commandedSubmode, msToReachTheMode); From b635e02f2d57320c38d990c0651597fd05a147fc Mon Sep 17 00:00:00 2001 From: meggert Date: Tue, 10 Oct 2023 10:07:01 +0200 Subject: [PATCH 134/257] gens --- bsp_hosted/fsfwconfig/events/translateEvents.cpp | 2 +- bsp_hosted/fsfwconfig/objects/translateObjects.cpp | 2 +- generators/bsp_hosted_events.csv | 4 ++-- generators/bsp_hosted_returnvalues.csv | 1 + generators/bsp_q7s_events.csv | 4 ++-- generators/bsp_q7s_returnvalues.csv | 1 + generators/events/translateEvents.cpp | 2 +- generators/objects/translateObjects.cpp | 2 +- linux/fsfwconfig/events/translateEvents.cpp | 2 +- linux/fsfwconfig/objects/translateObjects.cpp | 2 +- 10 files changed, 12 insertions(+), 10 deletions(-) diff --git a/bsp_hosted/fsfwconfig/events/translateEvents.cpp b/bsp_hosted/fsfwconfig/events/translateEvents.cpp index 610a69fb..c7d9efc1 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 313 translations. * @details - * Generated on: 2023-09-28 15:53:20 + * Generated on: 2023-10-09 16:27:37 */ #include "translateEvents.h" diff --git a/bsp_hosted/fsfwconfig/objects/translateObjects.cpp b/bsp_hosted/fsfwconfig/objects/translateObjects.cpp index f3f7d5fb..ac93d7f1 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 173 translations. - * Generated on: 2023-09-28 15:53:20 + * Generated on: 2023-10-09 16:27:37 */ #include "translateObjects.h" diff --git a/generators/bsp_hosted_events.csv b/generators/bsp_hosted_events.csv index 442fc05c..2cd6ca2f 100644 --- a/generators/bsp_hosted_events.csv +++ b/generators/bsp_hosted_events.csv @@ -100,8 +100,8 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 11302;0x2c26;SWITCHING_Q7S_DENIED;MEDIUM;No description;mission/power/defs.h 11303;0x2c27;FDIR_REACTION_IGNORED;MEDIUM;No description;mission/power/defs.h 11304;0x2c28;DATASET_READ_FAILED;INFO;The dataset read for the inputs of the Power Controller has failed.;mission/power/defs.h -11305;0x2c29;VOLTAGE_OUT_OF_BOUNDS;HIGH;The battery voltage read is out of the bounds in which it is supposed to be. P1: 1 too high, 0 too low;mission/power/defs.h -11306;0x2c2a;TIMEDELTA_OUT_OF_BOUNDS;LOW;Time difference for Coulomb Counter was too large.;mission/power/defs.h +11305;0x2c29;VOLTAGE_OUT_OF_BOUNDS;HIGH;No description;mission/power/defs.h +11306;0x2c2a;TIMEDELTA_OUT_OF_BOUNDS;LOW;Time difference for Coulomb Counter was too large. P1: time in s * 10;mission/power/defs.h 11307;0x2c2b;POWER_LEVEL_LOW;HIGH;The State of Charge is below the limit for payload use. Setting Payload to faulty.;mission/power/defs.h 11308;0x2c2c;POWER_LEVEL_CRITICAL;HIGH;The State of Charge is below the limit for higher modes. Setting Reaction Wheels to faulty.;mission/power/defs.h 11400;0x2c88;GPIO_PULL_HIGH_FAILED;LOW;No description;mission/tcs/HeaterHandler.h diff --git a/generators/bsp_hosted_returnvalues.csv b/generators/bsp_hosted_returnvalues.csv index e3db4c9a..49cfb0a2 100644 --- a/generators/bsp_hosted_returnvalues.csv +++ b/generators/bsp_hosted_returnvalues.csv @@ -210,6 +210,7 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x27a8;DHI_NoReplyExpected;No description;168;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h 0x27a9;DHI_NonOpTemperature;No description;169;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h 0x27aa;DHI_CommandNotImplemented;No description;170;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +0x27ab;DHI_NonOpStateOfCharge;No description;171;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h 0x27b0;DHI_ChecksumError;No description;176;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h 0x27b1;DHI_LengthMissmatch;No description;177;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h 0x27b2;DHI_InvalidData;No description;178;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h diff --git a/generators/bsp_q7s_events.csv b/generators/bsp_q7s_events.csv index 442fc05c..2cd6ca2f 100644 --- a/generators/bsp_q7s_events.csv +++ b/generators/bsp_q7s_events.csv @@ -100,8 +100,8 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 11302;0x2c26;SWITCHING_Q7S_DENIED;MEDIUM;No description;mission/power/defs.h 11303;0x2c27;FDIR_REACTION_IGNORED;MEDIUM;No description;mission/power/defs.h 11304;0x2c28;DATASET_READ_FAILED;INFO;The dataset read for the inputs of the Power Controller has failed.;mission/power/defs.h -11305;0x2c29;VOLTAGE_OUT_OF_BOUNDS;HIGH;The battery voltage read is out of the bounds in which it is supposed to be. P1: 1 too high, 0 too low;mission/power/defs.h -11306;0x2c2a;TIMEDELTA_OUT_OF_BOUNDS;LOW;Time difference for Coulomb Counter was too large.;mission/power/defs.h +11305;0x2c29;VOLTAGE_OUT_OF_BOUNDS;HIGH;No description;mission/power/defs.h +11306;0x2c2a;TIMEDELTA_OUT_OF_BOUNDS;LOW;Time difference for Coulomb Counter was too large. P1: time in s * 10;mission/power/defs.h 11307;0x2c2b;POWER_LEVEL_LOW;HIGH;The State of Charge is below the limit for payload use. Setting Payload to faulty.;mission/power/defs.h 11308;0x2c2c;POWER_LEVEL_CRITICAL;HIGH;The State of Charge is below the limit for higher modes. Setting Reaction Wheels to faulty.;mission/power/defs.h 11400;0x2c88;GPIO_PULL_HIGH_FAILED;LOW;No description;mission/tcs/HeaterHandler.h diff --git a/generators/bsp_q7s_returnvalues.csv b/generators/bsp_q7s_returnvalues.csv index 065e5392..9983f079 100644 --- a/generators/bsp_q7s_returnvalues.csv +++ b/generators/bsp_q7s_returnvalues.csv @@ -210,6 +210,7 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x27a8;DHI_NoReplyExpected;No description;168;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h 0x27a9;DHI_NonOpTemperature;No description;169;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h 0x27aa;DHI_CommandNotImplemented;No description;170;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +0x27ab;DHI_NonOpStateOfCharge;No description;171;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h 0x27b0;DHI_ChecksumError;No description;176;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h 0x27b1;DHI_LengthMissmatch;No description;177;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h 0x27b2;DHI_InvalidData;No description;178;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index 610a69fb..c7d9efc1 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 313 translations. * @details - * Generated on: 2023-09-28 15:53:20 + * Generated on: 2023-10-09 16:27:37 */ #include "translateEvents.h" diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index 4f191225..856a0bed 100644 --- a/generators/objects/translateObjects.cpp +++ b/generators/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 177 translations. - * Generated on: 2023-09-28 15:53:20 + * Generated on: 2023-10-09 16:27:37 */ #include "translateObjects.h" diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index 610a69fb..c7d9efc1 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 313 translations. * @details - * Generated on: 2023-09-28 15:53:20 + * Generated on: 2023-10-09 16:27:37 */ #include "translateEvents.h" diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index 4f191225..856a0bed 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 177 translations. - * Generated on: 2023-09-28 15:53:20 + * Generated on: 2023-10-09 16:27:37 */ #include "translateObjects.h" From 8fc560f9de72acfd08e480e500dbeb82fd302499 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 10 Oct 2023 11:34:18 +0200 Subject: [PATCH 135/257] what is this? --- bsp_q7s/core/XiphosWdtHandler.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsp_q7s/core/XiphosWdtHandler.h b/bsp_q7s/core/XiphosWdtHandler.h index 346c13ef..271df1a0 100644 --- a/bsp_q7s/core/XiphosWdtHandler.h +++ b/bsp_q7s/core/XiphosWdtHandler.h @@ -15,7 +15,7 @@ class XiphosWdtHandler : public SystemObject, public ExecutableObjectIF { private: // Timeout duration range specified by Xiphos: 0.001 seconds to 171 seconds. The libxiphos API // expects an int, so I guess this translates to 1 to 171 seconds. - uint32_t timeoutSeconds = 60; + int timeoutSeconds = 120; struct watchdog_s* wdtHandle = nullptr; }; From 98a1ce5380c8ca45d38a08737275228bd7e3397d Mon Sep 17 00:00:00 2001 From: meggert Date: Tue, 10 Oct 2023 11:53:54 +0200 Subject: [PATCH 136/257] this should work --- mission/controller/PowerController.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/mission/controller/PowerController.cpp b/mission/controller/PowerController.cpp index c990ee59..b1b94d61 100644 --- a/mission/controller/PowerController.cpp +++ b/mission/controller/PowerController.cpp @@ -44,12 +44,17 @@ ReturnValue_t PowerController::getParameter(uint8_t domainId, uint8_t parameterI break; case 0x2: { float oldCoulombCounterVoltageUpperThreshold = coulombCounterVoltageUpperThreshold; - parameterWrapper->set(coulombCounterVoltageUpperThreshold); - ReturnValue_t result = calculateCoulombCounterChargeUpperThreshold(); + ReturnValue_t result = newValues->getElement(&coulombCounterVoltageUpperThreshold); if (result != returnvalue::OK) { coulombCounterVoltageUpperThreshold = oldCoulombCounterVoltageUpperThreshold; - return returnvalue::FAILED; + return result; } + result = calculateCoulombCounterChargeUpperThreshold(); + if (result != returnvalue::OK) { + coulombCounterVoltageUpperThreshold = oldCoulombCounterVoltageUpperThreshold; + return result; + } + // parameterWrapper->set(coulombCounterVoltageUpperThreshold); break; } case 0x3: @@ -230,6 +235,11 @@ void PowerController::calculateStateOfCharge() { } void PowerController::watchStateOfCharge() { + if (test < 100) { + test++; + } else if (test == 100) { + // pwrCtrlCoreHk.coulombCounterCharge.value = 0.7; + } if (pwrCtrlCoreHk.coulombCounterCharge.isValid()) { if (pwrCtrlCoreHk.coulombCounterCharge.value < payloadOpLimitOn) { PoolReadGuard pg(&enablePl); From 2c30efa821c4aab542bd96e04f9ad24649936ffa Mon Sep 17 00:00:00 2001 From: meggert Date: Tue, 10 Oct 2023 11:54:32 +0200 Subject: [PATCH 137/257] aaand we revert --- dummies/PlPcduDummy.cpp | 6 ++---- dummies/PlocMpsocDummy.cpp | 6 ++---- dummies/PlocSupervisorDummy.cpp | 6 ++---- linux/payload/PlocMpsocHandler.cpp | 6 ++---- linux/payload/PlocSupervisorHandler.cpp | 6 ++---- mission/controller/PowerController.h | 13 ++++++++----- mission/payload/PayloadPcduHandler.cpp | 6 ++---- mission/system/objects/CamSwitcher.cpp | 6 ++---- 8 files changed, 22 insertions(+), 33 deletions(-) diff --git a/dummies/PlPcduDummy.cpp b/dummies/PlPcduDummy.cpp index 589fb075..cf652513 100644 --- a/dummies/PlPcduDummy.cpp +++ b/dummies/PlPcduDummy.cpp @@ -49,12 +49,10 @@ ReturnValue_t PlPcduDummy::checkModeCommand(Mode_t commandedMode, Submode_t comm if (commandedMode != MODE_OFF) { PoolReadGuard pg(&enablePl); if (pg.getReadResult() == returnvalue::OK) { - if (enablePl.plUseAllowed.isValid() and enablePl.plUseAllowed.value) { - return DeviceHandlerBase::checkModeCommand(commandedMode, commandedSubmode, - msToReachTheMode); + if (enablePl.plUseAllowed.isValid() and not enablePl.plUseAllowed.value) { + return NON_OP_STATE_OF_CHARGE; } } - return NON_OP_STATE_OF_CHARGE; } return DeviceHandlerBase::checkModeCommand(commandedMode, commandedSubmode, msToReachTheMode); } diff --git a/dummies/PlocMpsocDummy.cpp b/dummies/PlocMpsocDummy.cpp index 47af8513..9959dd0f 100644 --- a/dummies/PlocMpsocDummy.cpp +++ b/dummies/PlocMpsocDummy.cpp @@ -28,12 +28,10 @@ ReturnValue_t PlocMpsocDummy::checkModeCommand(Mode_t commandedMode, Submode_t c if (commandedMode != MODE_OFF) { PoolReadGuard pg(&enablePl); if (pg.getReadResult() == returnvalue::OK) { - if (enablePl.plUseAllowed.isValid() and enablePl.plUseAllowed.value) { - return DeviceHandlerBase::checkModeCommand(commandedMode, commandedSubmode, - msToReachTheMode); + if (enablePl.plUseAllowed.isValid() and not enablePl.plUseAllowed.value) { + return NON_OP_STATE_OF_CHARGE; } } - return NON_OP_STATE_OF_CHARGE; } return DeviceHandlerBase::checkModeCommand(commandedMode, commandedSubmode, msToReachTheMode); } diff --git a/dummies/PlocSupervisorDummy.cpp b/dummies/PlocSupervisorDummy.cpp index f37bb328..c560c91f 100644 --- a/dummies/PlocSupervisorDummy.cpp +++ b/dummies/PlocSupervisorDummy.cpp @@ -58,12 +58,10 @@ ReturnValue_t PlocSupervisorDummy::checkModeCommand(Mode_t commandedMode, if (commandedMode != MODE_OFF) { PoolReadGuard pg(&enablePl); if (pg.getReadResult() == returnvalue::OK) { - if (enablePl.plUseAllowed.isValid() and enablePl.plUseAllowed.value) { - return DeviceHandlerBase::checkModeCommand(commandedMode, commandedSubmode, - msToReachTheMode); + if (enablePl.plUseAllowed.isValid() and not enablePl.plUseAllowed.value) { + return NON_OP_STATE_OF_CHARGE; } } - return NON_OP_STATE_OF_CHARGE; } return DeviceHandlerBase::checkModeCommand(commandedMode, commandedSubmode, msToReachTheMode); } diff --git a/linux/payload/PlocMpsocHandler.cpp b/linux/payload/PlocMpsocHandler.cpp index c5a17536..66fba6d8 100644 --- a/linux/payload/PlocMpsocHandler.cpp +++ b/linux/payload/PlocMpsocHandler.cpp @@ -1511,12 +1511,10 @@ ReturnValue_t PlocMpsocHandler::checkModeCommand(Mode_t commandedMode, Submode_t if (commandedMode != MODE_OFF) { PoolReadGuard pg(&enablePl); if (pg.getReadResult() == returnvalue::OK) { - if (enablePl.plUseAllowed.isValid() and enablePl.plUseAllowed.value) { - return DeviceHandlerBase::checkModeCommand(commandedMode, commandedSubmode, - msToReachTheMode); + if (enablePl.plUseAllowed.isValid() and not enablePl.plUseAllowed.value) { + return NON_OP_STATE_OF_CHARGE; } } - return NON_OP_STATE_OF_CHARGE; } return DeviceHandlerBase::checkModeCommand(commandedMode, commandedSubmode, msToReachTheMode); } diff --git a/linux/payload/PlocSupervisorHandler.cpp b/linux/payload/PlocSupervisorHandler.cpp index 43b8abb2..0c6311de 100644 --- a/linux/payload/PlocSupervisorHandler.cpp +++ b/linux/payload/PlocSupervisorHandler.cpp @@ -1999,12 +1999,10 @@ ReturnValue_t PlocSupervisorHandler::checkModeCommand(Mode_t commandedMode, if (commandedMode != MODE_OFF) { PoolReadGuard pg(&enablePl); if (pg.getReadResult() == returnvalue::OK) { - if (enablePl.plUseAllowed.isValid() and enablePl.plUseAllowed.value) { - return DeviceHandlerBase::checkModeCommand(commandedMode, commandedSubmode, - msToReachTheMode); + if (enablePl.plUseAllowed.isValid() and not enablePl.plUseAllowed.value) { + return NON_OP_STATE_OF_CHARGE; } } - return NON_OP_STATE_OF_CHARGE; } return DeviceHandlerBase::checkModeCommand(commandedMode, commandedSubmode, msToReachTheMode); } diff --git a/mission/controller/PowerController.h b/mission/controller/PowerController.h index adff4733..e57a7858 100644 --- a/mission/controller/PowerController.h +++ b/mission/controller/PowerController.h @@ -24,6 +24,8 @@ class PowerController : public ExtendedControllerBase, public ReceivesParameterM uint16_t startAtIndex) override; private: + int test = 0; + bool enableHkSets = false; ParameterHelper parameterHelper; @@ -48,7 +50,7 @@ class PowerController : public ExtendedControllerBase, public ReceivesParameterM ReturnValue_t calculateCoulombCounterCharge(); ReturnValue_t updateEpsData(); float charge2stateOfCharge(float capacity, bool coulombCounter); - ReturnValue_t lookUpTableOcvIdxFinder(float voltage, uint8_t& idx); + ReturnValue_t lookUpTableOcvIdxFinder(float voltage, uint8_t& idx, bool paramCmd); float linearInterpolation(float x, float x0, float x1, float y0, float y1); ReturnValue_t calculateCoulombCounterChargeUpperThreshold(); @@ -103,10 +105,11 @@ class PowerController : public ExtendedControllerBase, public ReceivesParameterM // Variables timeval now; timeval oldTime; - int16_t iBat = 0; // [mA] - float openCircuitVoltageCharge = 0.0; // [Ah] - float coulombCounterCharge = 0.0; // [Ah] - float coulombCounterChargeUpperThreshold = 0.0; // [Ah] + int16_t iBat = 0; // [mA] + float openCircuitVoltageCharge = 0.0; // [Ah] + float coulombCounterCharge = 0.0; // [Ah] + float coulombCounterChargeUpperThreshold = 0.0; // [Ah] + float oldCoulombCounterVoltageUpperThreshold = 0.0; // [V] static constexpr float CONVERT_FROM_MILLI = 1e-3; static constexpr float SECONDS_TO_HOURS = 1. / (60. * 60.); diff --git a/mission/payload/PayloadPcduHandler.cpp b/mission/payload/PayloadPcduHandler.cpp index d75ec35e..bda15b20 100644 --- a/mission/payload/PayloadPcduHandler.cpp +++ b/mission/payload/PayloadPcduHandler.cpp @@ -569,12 +569,10 @@ ReturnValue_t PayloadPcduHandler::checkModeCommand(Mode_t commandedMode, Submode if (commandedMode != MODE_OFF) { PoolReadGuard pg(&enablePl); if (pg.getReadResult() == returnvalue::OK) { - if (enablePl.plUseAllowed.isValid() and enablePl.plUseAllowed.value) { - return DeviceHandlerBase::checkModeCommand(commandedMode, commandedSubmode, - msToReachTheMode); + if (enablePl.plUseAllowed.isValid() and not enablePl.plUseAllowed.value) { + return NON_OP_STATE_OF_CHARGE; } } - return NON_OP_STATE_OF_CHARGE; } return DeviceHandlerBase::checkModeCommand(commandedMode, commandedSubmode, msToReachTheMode); } diff --git a/mission/system/objects/CamSwitcher.cpp b/mission/system/objects/CamSwitcher.cpp index 300d1cb2..93b67646 100644 --- a/mission/system/objects/CamSwitcher.cpp +++ b/mission/system/objects/CamSwitcher.cpp @@ -14,12 +14,10 @@ ReturnValue_t CamSwitcher::checkModeCommand(Mode_t commandedMode, Submode_t comm if (commandedMode != MODE_OFF) { PoolReadGuard pg(&enablePl); if (pg.getReadResult() == returnvalue::OK) { - if (enablePl.plUseAllowed.isValid() and enablePl.plUseAllowed.value) { - return PowerSwitcherComponent::checkModeCommand(commandedMode, commandedSubmode, - msToReachTheMode); + if (enablePl.plUseAllowed.isValid() and not enablePl.plUseAllowed.value) { + return TRANS_NOT_ALLOWED; } } - return TRANS_NOT_ALLOWED; } return PowerSwitcherComponent::checkModeCommand(commandedMode, commandedSubmode, msToReachTheMode); From 4b4c78c3faab3fe8db1f34ec5a0edf9461a42da6 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 10 Oct 2023 12:19:42 +0200 Subject: [PATCH 138/257] lets go back to 60 seconds --- bsp_q7s/core/XiphosWdtHandler.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsp_q7s/core/XiphosWdtHandler.h b/bsp_q7s/core/XiphosWdtHandler.h index 271df1a0..1f6f8c0d 100644 --- a/bsp_q7s/core/XiphosWdtHandler.h +++ b/bsp_q7s/core/XiphosWdtHandler.h @@ -15,7 +15,7 @@ class XiphosWdtHandler : public SystemObject, public ExecutableObjectIF { private: // Timeout duration range specified by Xiphos: 0.001 seconds to 171 seconds. The libxiphos API // expects an int, so I guess this translates to 1 to 171 seconds. - int timeoutSeconds = 120; + int timeoutSeconds = 60; struct watchdog_s* wdtHandle = nullptr; }; From 0da1fecf390cf871bad9af5a017afc358102cc32 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 10 Oct 2023 13:50:15 +0200 Subject: [PATCH 139/257] updatr submodules --- fsfw | 2 +- tmtc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fsfw b/fsfw index e3a81544..0f604b35 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit e3a815444e401fc2fa75f6f19b40a18eceee08a5 +Subproject commit 0f604b35c6d3a2518e3c3ce3947825102e9fc4f4 diff --git a/tmtc b/tmtc index dd74f6c3..be1ac095 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit dd74f6c3ca0e730c7f316ed7959d2992c4a14fb4 +Subproject commit be1ac0951539971ada7cb490faab07f923b39430 From 9a80af9b95dcb879202f1beec2802a66f1f5eb25 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 10 Oct 2023 13:51:41 +0200 Subject: [PATCH 140/257] update tmtc --- bsp_hosted/fsfwconfig/events/translateEvents.cpp | 2 +- bsp_hosted/fsfwconfig/objects/translateObjects.cpp | 2 +- generators/bsp_hosted_returnvalues.csv | 8 ++++---- generators/bsp_q7s_returnvalues.csv | 8 ++++---- 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, 15 insertions(+), 15 deletions(-) diff --git a/bsp_hosted/fsfwconfig/events/translateEvents.cpp b/bsp_hosted/fsfwconfig/events/translateEvents.cpp index c7d9efc1..77df8166 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 313 translations. * @details - * Generated on: 2023-10-09 16:27:37 + * Generated on: 2023-10-10 13:50:27 */ #include "translateEvents.h" diff --git a/bsp_hosted/fsfwconfig/objects/translateObjects.cpp b/bsp_hosted/fsfwconfig/objects/translateObjects.cpp index ac93d7f1..8d80ca56 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 173 translations. - * Generated on: 2023-10-09 16:27:37 + * Generated on: 2023-10-10 13:50:27 */ #include "translateObjects.h" diff --git a/generators/bsp_hosted_returnvalues.csv b/generators/bsp_hosted_returnvalues.csv index 49cfb0a2..0dfc94c3 100644 --- a/generators/bsp_hosted_returnvalues.csv +++ b/generators/bsp_hosted_returnvalues.csv @@ -358,6 +358,7 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x3a02;MQI_Full;No space left for more messages;2;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h 0x3a03;MQI_NoReplyPartner;Returned if a reply method was called without partner;3;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h 0x3a04;MQI_DestinationInvalid;Returned if the target destination is invalid.;4;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h +0x3b00;SPH_ConnBroken;No description;0;SEMAPHORE_IF;fsfw/src/fsfw/osal/common/TcpTmTcServer.h 0x3b01;SPH_SemaphoreTimeout;No description;1;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h 0x3b02;SPH_SemaphoreNotOwned;No description;2;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h 0x3b03;SPH_SemaphoreInvalid;No description;3;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h @@ -373,7 +374,6 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x3e05;HKM_DatasetNotFound;No description;5;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h 0x3f01;DLEE_StreamTooShort;No description;1;DLE_ENCODER;fsfw/src/fsfw/globalfunctions/DleEncoder.h 0x3f02;DLEE_DecodingError;No description;2;DLE_ENCODER;fsfw/src/fsfw/globalfunctions/DleEncoder.h -0x4100;PUS9_ConnBroken;No description;0;PUS_SERVICE_9;fsfw/src/fsfw/osal/common/TcpTmTcServer.h 0x4201;PUS11_InvalidTypeTimeWindow;No description;1;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h 0x4202;PUS11_InvalidTimeWindow;No description;2;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h 0x4203;PUS11_TimeshiftingNotPossible;No description;3;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h @@ -403,9 +403,9 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x4403;UXOS_CommandError;Command execution failed;3;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h 0x4404;UXOS_NoCommandLoadedOrPending;;4;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h 0x4406;UXOS_PcloseCallError;No description;6;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h -0x4500;HSPI_HalTimeoutRetval;No description;0;HAL_SPI;fsfw/src/fsfw_hal/stm32h7/spi/spiDefinitions.h -0x4501;HSPI_HalBusyRetval;No description;1;HAL_SPI;fsfw/src/fsfw_hal/stm32h7/spi/spiDefinitions.h -0x4502;HSPI_HalErrorRetval;No description;2;HAL_SPI;fsfw/src/fsfw_hal/stm32h7/spi/spiDefinitions.h +0x4500;HSPI_OpeningFileFailed;No description;0;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h +0x4501;HSPI_FullDuplexTransferFailed;No description;1;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h +0x4502;HSPI_HalfDuplexTransferFailed;No description;2;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h 0x4503;HSPI_Timeout;No description;3;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h 0x4504;HSPI_Busy;No description;4;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h 0x4505;HSPI_GenericError;No description;5;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h diff --git a/generators/bsp_q7s_returnvalues.csv b/generators/bsp_q7s_returnvalues.csv index 9983f079..0e804457 100644 --- a/generators/bsp_q7s_returnvalues.csv +++ b/generators/bsp_q7s_returnvalues.csv @@ -358,6 +358,7 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x3a02;MQI_Full;No space left for more messages;2;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h 0x3a03;MQI_NoReplyPartner;Returned if a reply method was called without partner;3;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h 0x3a04;MQI_DestinationInvalid;Returned if the target destination is invalid.;4;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h +0x3b00;SPH_ConnBroken;No description;0;SEMAPHORE_IF;fsfw/src/fsfw/osal/common/TcpTmTcServer.h 0x3b01;SPH_SemaphoreTimeout;No description;1;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h 0x3b02;SPH_SemaphoreNotOwned;No description;2;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h 0x3b03;SPH_SemaphoreInvalid;No description;3;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h @@ -373,7 +374,6 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x3e05;HKM_DatasetNotFound;No description;5;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h 0x3f01;DLEE_StreamTooShort;No description;1;DLE_ENCODER;fsfw/src/fsfw/globalfunctions/DleEncoder.h 0x3f02;DLEE_DecodingError;No description;2;DLE_ENCODER;fsfw/src/fsfw/globalfunctions/DleEncoder.h -0x4100;PUS9_ConnBroken;No description;0;PUS_SERVICE_9;fsfw/src/fsfw/osal/common/TcpTmTcServer.h 0x4201;PUS11_InvalidTypeTimeWindow;No description;1;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h 0x4202;PUS11_InvalidTimeWindow;No description;2;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h 0x4203;PUS11_TimeshiftingNotPossible;No description;3;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h @@ -403,9 +403,9 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x4403;UXOS_CommandError;Command execution failed;3;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h 0x4404;UXOS_NoCommandLoadedOrPending;;4;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h 0x4406;UXOS_PcloseCallError;No description;6;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h -0x4500;HSPI_HalTimeoutRetval;No description;0;HAL_SPI;fsfw/src/fsfw_hal/stm32h7/spi/spiDefinitions.h -0x4501;HSPI_HalBusyRetval;No description;1;HAL_SPI;fsfw/src/fsfw_hal/stm32h7/spi/spiDefinitions.h -0x4502;HSPI_HalErrorRetval;No description;2;HAL_SPI;fsfw/src/fsfw_hal/stm32h7/spi/spiDefinitions.h +0x4500;HSPI_OpeningFileFailed;No description;0;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h +0x4501;HSPI_FullDuplexTransferFailed;No description;1;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h +0x4502;HSPI_HalfDuplexTransferFailed;No description;2;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h 0x4503;HSPI_Timeout;No description;3;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h 0x4504;HSPI_Busy;No description;4;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h 0x4505;HSPI_GenericError;No description;5;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index c7d9efc1..77df8166 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 313 translations. * @details - * Generated on: 2023-10-09 16:27:37 + * Generated on: 2023-10-10 13:50:27 */ #include "translateEvents.h" diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index 856a0bed..aeb2b405 100644 --- a/generators/objects/translateObjects.cpp +++ b/generators/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 177 translations. - * Generated on: 2023-10-09 16:27:37 + * Generated on: 2023-10-10 13:50:27 */ #include "translateObjects.h" diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index c7d9efc1..77df8166 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 313 translations. * @details - * Generated on: 2023-10-09 16:27:37 + * Generated on: 2023-10-10 13:50:27 */ #include "translateEvents.h" diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index 856a0bed..aeb2b405 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 177 translations. - * Generated on: 2023-10-09 16:27:37 + * Generated on: 2023-10-10 13:50:27 */ #include "translateObjects.h" diff --git a/tmtc b/tmtc index be1ac095..bde03fc9 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit be1ac0951539971ada7cb490faab07f923b39430 +Subproject commit bde03fc9c065cdd4dd8fd79da5c43f9510013813 From a29805cb6840e71c67b4e5053dc3592ef801276b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 10 Oct 2023 16:18:35 +0200 Subject: [PATCH 141/257] SCEX bugfix --- mission/payload/ScexDeviceHandler.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mission/payload/ScexDeviceHandler.cpp b/mission/payload/ScexDeviceHandler.cpp index 12c62f7a..0db10561 100644 --- a/mission/payload/ScexDeviceHandler.cpp +++ b/mission/payload/ScexDeviceHandler.cpp @@ -38,9 +38,13 @@ void ScexDeviceHandler::doShutDown() { setMode(_MODE_POWER_DOWN); } -ReturnValue_t ScexDeviceHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) { return OK; } +ReturnValue_t ScexDeviceHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) { + return NOTHING_TO_SEND; +} -ReturnValue_t ScexDeviceHandler::buildTransitionDeviceCommand(DeviceCommandId_t* id) { return OK; } +ReturnValue_t ScexDeviceHandler::buildTransitionDeviceCommand(DeviceCommandId_t* id) { + return NOTHING_TO_SEND; +} ReturnValue_t ScexDeviceHandler::buildCommandFromCommand(DeviceCommandId_t deviceCommand, const uint8_t* commandData, From 7f82dd91e28dd1362d5ff9c7e36238d6d82a69ff Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 10 Oct 2023 16:20:51 +0200 Subject: [PATCH 142/257] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ae7901e..ed736ae4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ will consitute of a breaking change warranting a new major release: ## Fixed - Missing `nullptr` checks for PLOC Supervisor handler, which could lead to crashes. +- SCEX bugfix for normal and transition command. # [v6.6.0] 2023-09-18 From d1e0d7407241b745d7ad38e5ce5f45786e5a1b85 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 10 Oct 2023 18:44:13 +0200 Subject: [PATCH 143/257] robustness fix --- mission/payload/ScexDeviceHandler.cpp | 2 +- tmtc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mission/payload/ScexDeviceHandler.cpp b/mission/payload/ScexDeviceHandler.cpp index 0db10561..ac668cdf 100644 --- a/mission/payload/ScexDeviceHandler.cpp +++ b/mission/payload/ScexDeviceHandler.cpp @@ -273,7 +273,7 @@ ReturnValue_t ScexDeviceHandler::interpretDeviceReply(DeviceCommandId_t id, cons // Unknown DeviceCommand return DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED; } - if (helper.getPacketCounter() == helper.getTotalPacketCounter()) { + if (helper.getPacketCounter() >= helper.getTotalPacketCounter()) { reader.finish(); commandActive = false; if (id != PING) { diff --git a/tmtc b/tmtc index 22a42108..9711dd92 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 22a42108b431bafa707de2b3a24cad9de95b70d0 +Subproject commit 9711dd9242340720e28d41eefda90666ec9af4bb From 9a283b0f98e6092b55e960944c2dd7e74275ea9f Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 10 Oct 2023 19:15:52 +0200 Subject: [PATCH 144/257] add action cmds --- bsp_q7s/core/XiphosWdtHandler.cpp | 124 +++++++++++++++++++++++------- bsp_q7s/core/XiphosWdtHandler.h | 12 ++- tmtc | 2 +- 3 files changed, 108 insertions(+), 30 deletions(-) diff --git a/bsp_q7s/core/XiphosWdtHandler.cpp b/bsp_q7s/core/XiphosWdtHandler.cpp index 5d4da7b6..be087648 100644 --- a/bsp_q7s/core/XiphosWdtHandler.cpp +++ b/bsp_q7s/core/XiphosWdtHandler.cpp @@ -1,48 +1,116 @@ #include "XiphosWdtHandler.h" -XiphosWdtHandler::XiphosWdtHandler(object_id_t objectId) : SystemObject(objectId) {} +#include "fsfw/ipc/QueueFactory.h" + +XiphosWdtHandler::XiphosWdtHandler(object_id_t objectId) + : SystemObject(objectId), + requestQueue(QueueFactory::instance()->createMessageQueue()), + actionHelper(this, requestQueue) {} ReturnValue_t XiphosWdtHandler::initialize() { - int result = xsc_watchdog_init(&wdtHandle); - if (result != 0) { - sif::error << "XiphosWdtHandler: Initiating watchdog failed with code " << result << ": " - << strerror(result) << std::endl; + ReturnValue_t result = actionHelper.initialize(); + if (result != returnvalue::OK) { + return result; + } + int retval = xsc_watchdog_init(&wdtHandle); + if (retval != 0) { + sif::error << "XiphosWdtHandler: Initiating watchdog failed with code " << retval << ": " + << strerror(retval) << std::endl; return ObjectManagerIF::CHILD_INIT_FAILED; } if (wdtHandle == nullptr) { sif::error << "XiphosWdtHandler: WDT handle is nullptr!" << std::endl; return ObjectManagerIF::CHILD_INIT_FAILED; } - result = xsc_watchdog_set_timeout(wdtHandle, timeoutSeconds); - if (result != 0) { + retval = xsc_watchdog_set_timeout(wdtHandle, timeoutSeconds); + if (retval != 0) { // This propably means that the default timeout is used. Still continue with task init. sif::warning << "XiphosWdtHandler: Setting WDT timeout of " << timeoutSeconds - << " seconds failed with code " << result << ": " << strerror(result) << std::endl; + << " seconds failed with code " << result << ": " << strerror(retval) << std::endl; } - int nowayout = 0; - int status = 0; - result = xsc_watchdog_get_status(&nowayout, &status); - if (result == 0) { - if (status == 0) { - result = xsc_watchdog_enable(wdtHandle); - if (result != 0) { - sif::error << "XiphosWdtHandler: Enabling WDT failed with code " << result << ": " - << strerror(result) << std::endl; - return ObjectManagerIF::CHILD_INIT_FAILED; - } - } - } else { - sif::warning << "XiphosWdtHandler: Getting WDT status failed" << std::endl; - } - return returnvalue::OK; + return enableWdt(); } ReturnValue_t XiphosWdtHandler::performOperation(uint8_t opCode) { - int result = xsc_watchdog_keepalive(wdtHandle); - if (result != 0) { - sif::warning << "XiphosWdtHandler: Feeding WDT failed with code " << result << ": " - << strerror(result) << std::endl; + CommandMessage command; + ReturnValue_t result; + for (result = requestQueue->receiveMessage(&command); result == returnvalue::OK; + result = requestQueue->receiveMessage(&command)) { + result = actionHelper.handleActionMessage(&command); + if (result == returnvalue::OK) { + continue; + } + sif::warning << "Can not handle message with message type " << command.getMessageType() + << std::endl; + } + int retval = xsc_watchdog_keepalive(wdtHandle); + if (retval != 0) { + sif::warning << "XiphosWdtHandler: Feeding WDT failed with code " << retval << ": " + << strerror(retval) << std::endl; return returnvalue::FAILED; } return returnvalue::OK; } + +ReturnValue_t XiphosWdtHandler::executeAction(ActionId_t actionId, MessageQueueId_t commandedBy, + const uint8_t *data, size_t size) { + switch (actionId) { + case (ActionId::ENABLE): { + ReturnValue_t result = enableWdt(); + if (result != returnvalue::OK) { + return result; + } + return EXECUTION_FINISHED; + } + case (ActionId::DISABLE): { + ReturnValue_t result = disableWdt(); + if (result != returnvalue::OK) { + return result; + } + return EXECUTION_FINISHED; + } + } + return HasActionsIF::INVALID_ACTION_ID; +} + +ReturnValue_t XiphosWdtHandler::enableWdt() { + int nowayout = 0; + int status = 0; + int retval = xsc_watchdog_get_status(&nowayout, &status); + // If this fails for whatever reason, just try enabling in any case. + if (retval != 0) { + sif::warning << "XiphosWdtHandler: Getting WDT status failed" << std::endl; + } + // Of course the enable API will fail if the device is already on, just perfect, love me some + // good C API... :))) + if (retval != 0 or status == 0) { + int retval = xsc_watchdog_enable(wdtHandle); + if (retval != 0) { + sif::error << "XiphosWdtHandler: Enabling WDT failed with code " << retval << ": " + << strerror(retval) << std::endl; + return returnvalue::FAILED; + } + } + return returnvalue::OK; +} + +ReturnValue_t XiphosWdtHandler::disableWdt() { + int nowayout = 0; + int status = 0; + int retval = xsc_watchdog_get_status(&nowayout, &status); + // If this fails for whatever reason, just try disabling in any case. + if (retval != 0) { + sif::warning << "XiphosWdtHandler: Getting WDT status failed" << std::endl; + } + // Of course the disable API will fail if the device is already off, just perfect, love me some + // good C API... :))) + if (retval != 0 or status == 1) { + int retval = xsc_watchdog_disable(wdtHandle); + if (retval != 0) { + sif::error << "XiphosWdtHandler: Disabling WDT failed with code " << retval << ": " + << strerror(retval) << std::endl; + return returnvalue::FAILED; + } + } + return returnvalue::OK; +} diff --git a/bsp_q7s/core/XiphosWdtHandler.h b/bsp_q7s/core/XiphosWdtHandler.h index 1f6f8c0d..28e48429 100644 --- a/bsp_q7s/core/XiphosWdtHandler.h +++ b/bsp_q7s/core/XiphosWdtHandler.h @@ -6,17 +6,27 @@ #include #include -class XiphosWdtHandler : public SystemObject, public ExecutableObjectIF { +class XiphosWdtHandler : public SystemObject, public ExecutableObjectIF, public HasActionsIF { public: + enum ActionId { ENABLE = 0, DISABLE = 1 }; + XiphosWdtHandler(object_id_t objectId); ReturnValue_t performOperation(uint8_t opCode) override; ReturnValue_t initialize() override; + ReturnValue_t executeAction(ActionId_t actionId, MessageQueueId_t commandedBy, + const uint8_t* data, size_t size) override; + private: + // Wrappers to ensure idempotency of trash C API. + ReturnValue_t enableWdt(); + ReturnValue_t disableWdt(); // Timeout duration range specified by Xiphos: 0.001 seconds to 171 seconds. The libxiphos API // expects an int, so I guess this translates to 1 to 171 seconds. int timeoutSeconds = 60; struct watchdog_s* wdtHandle = nullptr; + MessageQueueIF* requestQueue = nullptr; + ActionHelper actionHelper; }; #endif /* BSP_Q7S_CORE_XIPHOSWDTHANDLER_H_ */ diff --git a/tmtc b/tmtc index 783bdd29..d82cecbe 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 783bdd297a931a96c8b077ec2c2456a203b23ffc +Subproject commit d82cecbe6e51e76a5b3b974b1c0d32ea22693853 From b9f05a14f7858dfa88d7ea82a5993fe6feab2fbd Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 11 Oct 2023 09:24:36 +0200 Subject: [PATCH 145/257] removed debug stuff --- mission/controller/PowerController.cpp | 7 +------ mission/controller/PowerController.h | 4 +--- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/mission/controller/PowerController.cpp b/mission/controller/PowerController.cpp index b1b94d61..7b7db9e8 100644 --- a/mission/controller/PowerController.cpp +++ b/mission/controller/PowerController.cpp @@ -54,7 +54,7 @@ ReturnValue_t PowerController::getParameter(uint8_t domainId, uint8_t parameterI coulombCounterVoltageUpperThreshold = oldCoulombCounterVoltageUpperThreshold; return result; } - // parameterWrapper->set(coulombCounterVoltageUpperThreshold); + parameterWrapper->set(coulombCounterVoltageUpperThreshold); break; } case 0x3: @@ -235,11 +235,6 @@ void PowerController::calculateStateOfCharge() { } void PowerController::watchStateOfCharge() { - if (test < 100) { - test++; - } else if (test == 100) { - // pwrCtrlCoreHk.coulombCounterCharge.value = 0.7; - } if (pwrCtrlCoreHk.coulombCounterCharge.isValid()) { if (pwrCtrlCoreHk.coulombCounterCharge.value < payloadOpLimitOn) { PoolReadGuard pg(&enablePl); diff --git a/mission/controller/PowerController.h b/mission/controller/PowerController.h index e57a7858..1f27616d 100644 --- a/mission/controller/PowerController.h +++ b/mission/controller/PowerController.h @@ -24,8 +24,6 @@ class PowerController : public ExtendedControllerBase, public ReceivesParameterM uint16_t startAtIndex) override; private: - int test = 0; - bool enableHkSets = false; ParameterHelper parameterHelper; @@ -58,7 +56,7 @@ class PowerController : public ExtendedControllerBase, public ReceivesParameterM float batteryInternalResistance = 70.0 / 2.0 / 1000.0; // [Ohm] float batteryMaximumCapacity = 2.6 * 2; // [Ah] float coulombCounterVoltageUpperThreshold = 16.2; // [V] - double maxAllowedTimeDiff = 0.5; // [s] + double maxAllowedTimeDiff = 1.5; // [s] float payloadOpLimitOn = 0.90; // [%] float payloadOpLimitLow = 0.75; // [%] float higherModesLimit = 0.6; // [%] From a0c246b1da3ab7cf31f01c9f227c353322520de5 Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 11 Oct 2023 09:24:48 +0200 Subject: [PATCH 146/257] rw dummy fix --- dummies/RwDummy.cpp | 18 ++++++++++++++++++ dummies/RwDummy.h | 1 + 2 files changed, 19 insertions(+) diff --git a/dummies/RwDummy.cpp b/dummies/RwDummy.cpp index 0bf4db42..05e14396 100644 --- a/dummies/RwDummy.cpp +++ b/dummies/RwDummy.cpp @@ -93,3 +93,21 @@ ReturnValue_t RwDummy::initializeLocalDataPool(localpool::DataPool &localDataPoo subdp::RegularHkPeriodicParams(lastResetStatusSet.getSid(), false, 30.0)); return returnvalue::OK; } + +LocalPoolDataSetBase *RwDummy::getDataSetHandle(sid_t sid) { + switch (sid.ownerSetId) { + case (rws::SetIds::STATUS_SET_ID): { + return &statusSet; + } + case (rws::SetIds::LAST_RESET_ID): { + return &lastResetStatusSet; + } + case (rws::SetIds::SPEED_CMD_SET): { + return &rwSpeedActuationSet; + } + case (rws::SetIds::TM_SET_ID): { + return &tmDataset; + } + } + return nullptr; +} diff --git a/dummies/RwDummy.h b/dummies/RwDummy.h index 03629937..512c4250 100644 --- a/dummies/RwDummy.h +++ b/dummies/RwDummy.h @@ -37,6 +37,7 @@ class RwDummy : public DeviceHandlerBase { uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override; ReturnValue_t initializeLocalDataPool(localpool::DataPool &localDataPoolMap, LocalDataPoolManager &poolManager) override; + LocalPoolDataSetBase *getDataSetHandle(sid_t sid) override; }; #endif /* DUMMIES_RWDUMMY_H_ */ From eb24749abecabc12a28c3e4f206e979b72431362 Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 11 Oct 2023 09:25:12 +0200 Subject: [PATCH 147/257] emObjectFactory fix --- bsp_q7s/em/emObjectFactory.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/bsp_q7s/em/emObjectFactory.cpp b/bsp_q7s/em/emObjectFactory.cpp index bf7db524..370e8d3d 100644 --- a/bsp_q7s/em/emObjectFactory.cpp +++ b/bsp_q7s/em/emObjectFactory.cpp @@ -106,6 +106,17 @@ void ObjectFactory::produce(void* args) { #endif satsystem::EIVE_SYSTEM.setI2cRecoveryParams(pwrSwitcher); + const char* battAndImtqI2cDev = q7s::I2C_PL_EIVE; + if (core::FW_VERSION_MAJOR >= 4) { + battAndImtqI2cDev = q7s::I2C_PS_EIVE; + } + static_cast(battAndImtqI2cDev); + +#if OBSW_ADD_BPX_BATTERY_HANDLER == 1 + createBpxBatteryComponent(enableHkSets, battAndImtqI2cDev); +#endif + createPowerController(true, enableHkSets); + dummy::createDummies(dummyCfg, *pwrSwitcher, gpioComIF, enableHkSets); new CoreController(objects::CORE_CONTROLLER, enableHkSets); @@ -126,12 +137,6 @@ void ObjectFactory::produce(void* args) { gpioChecker(gpioComIF->addGpios(acsBoardGpios), "ACS Board"); #endif - const char* battAndImtqI2cDev = q7s::I2C_PL_EIVE; - if (core::FW_VERSION_MAJOR >= 4) { - battAndImtqI2cDev = q7s::I2C_PS_EIVE; - } - static_cast(battAndImtqI2cDev); - #if OBSW_ADD_MGT == 1 createImtqComponents(pwrSwitcher, enableHkSets, battAndImtqI2cDev); #endif @@ -144,11 +149,6 @@ void ObjectFactory::produce(void* args) { createReactionWheelComponents(gpioComIF, pwrSwitcher); #endif -#if OBSW_ADD_BPX_BATTERY_HANDLER == 1 - createBpxBatteryComponent(enableHkSets, battAndImtqI2cDev); -#endif - createPowerController(true, enableHkSets); - #if OBSW_ADD_STAR_TRACKER == 1 createStrComponents(pwrSwitcher); #endif /* OBSW_ADD_STAR_TRACKER == 1 */ From ac784b58993bd1e74b16fba896e334ff577e1ac9 Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 11 Oct 2023 09:27:11 +0200 Subject: [PATCH 148/257] bump tmtc --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index bde03fc9..d82cecbe 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit bde03fc9c065cdd4dd8fd79da5c43f9510013813 +Subproject commit d82cecbe6e51e76a5b3b974b1c0d32ea22693853 From 6cada9bfc0d4da0b6464722a8f3a6204e53ef2c0 Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 11 Oct 2023 09:31:32 +0200 Subject: [PATCH 149/257] changelog --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ae7901e..0426873f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,15 @@ will consitute of a breaking change warranting a new major release: # [unreleased] +- Bumped `eive-tmtc` to v5.7.0. +- Bumped `eive-fsfw` + +## Added + +- EPS Subsystem has been added to EIVE System Tree +- Power Controller for calculating the State of Charge and FDIR regarding low SoC has been + introduced. + ## Changed - Changed internals for MPSoC boot process to make the code more understandable and some From c3cdcaf9f445cda72f9930aa71469d9acc4f7023 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 11 Oct 2023 10:58:25 +0200 Subject: [PATCH 150/257] bump tmtc and gens --- bsp_hosted/fsfwconfig/events/translateEvents.cpp | 2 +- bsp_hosted/fsfwconfig/objects/translateObjects.cpp | 7 +++++-- generators/bsp_hosted_objects.csv | 1 + generators/bsp_q7s_objects.csv | 1 + generators/events/translateEvents.cpp | 2 +- generators/objects/translateObjects.cpp | 7 +++++-- linux/fsfwconfig/events/translateEvents.cpp | 2 +- linux/fsfwconfig/objects/translateObjects.cpp | 7 +++++-- mission/controller/CMakeLists.txt | 6 +++--- mission/system/power/CMakeLists.txt | 3 ++- tmtc | 2 +- 11 files changed, 26 insertions(+), 14 deletions(-) diff --git a/bsp_hosted/fsfwconfig/events/translateEvents.cpp b/bsp_hosted/fsfwconfig/events/translateEvents.cpp index 77df8166..9bb03ff0 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 313 translations. * @details - * Generated on: 2023-10-10 13:50:27 + * Generated on: 2023-10-11 10:54:39 */ #include "translateEvents.h" diff --git a/bsp_hosted/fsfwconfig/objects/translateObjects.cpp b/bsp_hosted/fsfwconfig/objects/translateObjects.cpp index 8d80ca56..7e795093 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 173 translations. - * Generated on: 2023-10-10 13:50:27 + * Contains 174 translations. + * Generated on: 2023-10-11 10:54:39 */ #include "translateObjects.h" @@ -11,6 +11,7 @@ const char *ACS_CONTROLLER_STRING = "ACS_CONTROLLER"; const char *CORE_CONTROLLER_STRING = "CORE_CONTROLLER"; const char *POWER_CONTROLLER_STRING = "POWER_CONTROLLER"; const char *GLOBAL_JSON_CFG_STRING = "GLOBAL_JSON_CFG"; +const char *XIPHOS_WDT_STRING = "XIPHOS_WDT"; const char *THERMAL_CONTROLLER_STRING = "THERMAL_CONTROLLER"; const char *DUMMY_HANDLER_STRING = "DUMMY_HANDLER"; const char *MGM_0_LIS3_HANDLER_STRING = "MGM_0_LIS3_HANDLER"; @@ -192,6 +193,8 @@ const char *translateObject(object_id_t object) { return POWER_CONTROLLER_STRING; case 0x43000006: return GLOBAL_JSON_CFG_STRING; + case 0x43000007: + return XIPHOS_WDT_STRING; case 0x43400001: return THERMAL_CONTROLLER_STRING; case 0x44000001: diff --git a/generators/bsp_hosted_objects.csv b/generators/bsp_hosted_objects.csv index 4cb21f46..689a58f2 100644 --- a/generators/bsp_hosted_objects.csv +++ b/generators/bsp_hosted_objects.csv @@ -3,6 +3,7 @@ 0x43000003;CORE_CONTROLLER 0x43000004;POWER_CONTROLLER 0x43000006;GLOBAL_JSON_CFG +0x43000007;XIPHOS_WDT 0x43400001;THERMAL_CONTROLLER 0x44000001;DUMMY_HANDLER 0x44120006;MGM_0_LIS3_HANDLER diff --git a/generators/bsp_q7s_objects.csv b/generators/bsp_q7s_objects.csv index 914b7df6..10cfed26 100644 --- a/generators/bsp_q7s_objects.csv +++ b/generators/bsp_q7s_objects.csv @@ -3,6 +3,7 @@ 0x43000003;CORE_CONTROLLER 0x43000004;POWER_CONTROLLER 0x43000006;GLOBAL_JSON_CFG +0x43000007;XIPHOS_WDT 0x43400001;THERMAL_CONTROLLER 0x44120006;MGM_0_LIS3_HANDLER 0x44120010;GYRO_0_ADIS_HANDLER diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index 77df8166..9bb03ff0 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 313 translations. * @details - * Generated on: 2023-10-10 13:50:27 + * Generated on: 2023-10-11 10:54:39 */ #include "translateEvents.h" diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index aeb2b405..0599cc18 100644 --- a/generators/objects/translateObjects.cpp +++ b/generators/objects/translateObjects.cpp @@ -1,8 +1,8 @@ /** * @brief Auto-generated object translation file. * @details - * Contains 177 translations. - * Generated on: 2023-10-10 13:50:27 + * Contains 178 translations. + * Generated on: 2023-10-11 10:54:39 */ #include "translateObjects.h" @@ -11,6 +11,7 @@ const char *ACS_CONTROLLER_STRING = "ACS_CONTROLLER"; const char *CORE_CONTROLLER_STRING = "CORE_CONTROLLER"; const char *POWER_CONTROLLER_STRING = "POWER_CONTROLLER"; const char *GLOBAL_JSON_CFG_STRING = "GLOBAL_JSON_CFG"; +const char *XIPHOS_WDT_STRING = "XIPHOS_WDT"; const char *THERMAL_CONTROLLER_STRING = "THERMAL_CONTROLLER"; const char *MGM_0_LIS3_HANDLER_STRING = "MGM_0_LIS3_HANDLER"; const char *GYRO_0_ADIS_HANDLER_STRING = "GYRO_0_ADIS_HANDLER"; @@ -196,6 +197,8 @@ const char *translateObject(object_id_t object) { return POWER_CONTROLLER_STRING; case 0x43000006: return GLOBAL_JSON_CFG_STRING; + case 0x43000007: + return XIPHOS_WDT_STRING; case 0x43400001: return THERMAL_CONTROLLER_STRING; case 0x44120006: diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index 77df8166..9bb03ff0 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 313 translations. * @details - * Generated on: 2023-10-10 13:50:27 + * Generated on: 2023-10-11 10:54:39 */ #include "translateEvents.h" diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index aeb2b405..0599cc18 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 177 translations. - * Generated on: 2023-10-10 13:50:27 + * Contains 178 translations. + * Generated on: 2023-10-11 10:54:39 */ #include "translateObjects.h" @@ -11,6 +11,7 @@ const char *ACS_CONTROLLER_STRING = "ACS_CONTROLLER"; const char *CORE_CONTROLLER_STRING = "CORE_CONTROLLER"; const char *POWER_CONTROLLER_STRING = "POWER_CONTROLLER"; const char *GLOBAL_JSON_CFG_STRING = "GLOBAL_JSON_CFG"; +const char *XIPHOS_WDT_STRING = "XIPHOS_WDT"; const char *THERMAL_CONTROLLER_STRING = "THERMAL_CONTROLLER"; const char *MGM_0_LIS3_HANDLER_STRING = "MGM_0_LIS3_HANDLER"; const char *GYRO_0_ADIS_HANDLER_STRING = "GYRO_0_ADIS_HANDLER"; @@ -196,6 +197,8 @@ const char *translateObject(object_id_t object) { return POWER_CONTROLLER_STRING; case 0x43000006: return GLOBAL_JSON_CFG_STRING; + case 0x43000007: + return XIPHOS_WDT_STRING; case 0x43400001: return THERMAL_CONTROLLER_STRING; case 0x44120006: diff --git a/mission/controller/CMakeLists.txt b/mission/controller/CMakeLists.txt index 901decc0..690ede64 100644 --- a/mission/controller/CMakeLists.txt +++ b/mission/controller/CMakeLists.txt @@ -1,7 +1,7 @@ if(TGT_BSP MATCHES "arm/q7s" OR TGT_BSP MATCHES "") - target_sources(${LIB_EIVE_MISSION} PRIVATE ThermalController.cpp - AcsController.cpp - PowerController.cpp) + target_sources( + ${LIB_EIVE_MISSION} PRIVATE ThermalController.cpp AcsController.cpp + PowerController.cpp) endif() add_subdirectory(acs) diff --git a/mission/system/power/CMakeLists.txt b/mission/system/power/CMakeLists.txt index a7e91e05..2c720978 100644 --- a/mission/system/power/CMakeLists.txt +++ b/mission/system/power/CMakeLists.txt @@ -1 +1,2 @@ -target_sources(${LIB_EIVE_MISSION} PRIVATE epsModeTree.cpp EpsSubsystem.cpp GomspacePowerFdir.cpp) +target_sources(${LIB_EIVE_MISSION} PRIVATE epsModeTree.cpp EpsSubsystem.cpp + GomspacePowerFdir.cpp) diff --git a/tmtc b/tmtc index d82cecbe..ec8febf6 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit d82cecbe6e51e76a5b3b974b1c0d32ea22693853 +Subproject commit ec8febf623a651b83c518443c30e9acfa36461fd From ee6cdaf6192a3166f0cd82ee4241f6794cb4c185 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 11 Oct 2023 12:57:42 +0200 Subject: [PATCH 151/257] bump submodules --- fsfw | 2 +- tmtc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fsfw b/fsfw index 5bd02019..63c23800 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 5bd020193bb5a2a1b9e5ceadb12234f1cf75dd44 +Subproject commit 63c238005e0c00166879eba6a354a64ca1f59e06 diff --git a/tmtc b/tmtc index 0c476271..34a3a67a 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 0c4762712b9f568943b77373efb3ca3814f78c52 +Subproject commit 34a3a67ac71a8ec6bbb019d429a823cb3e20b12a From d84528e643a7381c85553a9bec89c7ebdbae0c15 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 11 Oct 2023 13:47:38 +0200 Subject: [PATCH 152/257] CFDP file segment len is configurable via definitions.h now --- common/config/eive/definitions.h | 2 ++ mission/genericFactory.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/common/config/eive/definitions.h b/common/config/eive/definitions.h index 86a83ac8..2edf434f 100644 --- a/common/config/eive/definitions.h +++ b/common/config/eive/definitions.h @@ -48,6 +48,8 @@ static constexpr uint32_t LEGACY_SA_DEPL_CHANNEL_ALTERNATION_INTERVAL_SECS = 5; // Maximum allowed burn time allowed by the software. static constexpr uint32_t SA_DEPL_MAX_BURN_TIME = 180; +static constexpr size_t CFDP_MAX_FILE_SEGMENT_LEN = 300; + static constexpr uint32_t CCSDS_HANDLER_QUEUE_SIZE = 50; static constexpr uint8_t NUMBER_OF_VIRTUAL_CHANNELS = 4; static constexpr uint32_t VC0_LIVE_TM_QUEUE_SIZE = 300; diff --git a/mission/genericFactory.cpp b/mission/genericFactory.cpp index 006b295a..0dd965eb 100644 --- a/mission/genericFactory.cpp +++ b/mission/genericFactory.cpp @@ -289,7 +289,7 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_, PusTmFun UnsignedByteField apid(config::EIVE_LOCAL_CFDP_ENTITY_ID); cfdp::EntityId localId(apid); GROUND_REMOTE_CFG.defaultChecksum = cfdp::ChecksumType::CRC_32; - GROUND_REMOTE_CFG.maxFileSegmentLen = 990; + GROUND_REMOTE_CFG.maxFileSegmentLen = config::CFDP_MAX_FILE_SEGMENT_LEN; CfdpHandlerCfg cfdpCfg(localId, indicationCfg, *eiveUserHandler, EIVE_FAULT_HANDLER, PACKET_LIST, LOST_SEGMENTS, REMOTE_CFG_PROVIDER); auto* cfdpHandler = new CfdpHandler(params, cfdpCfg); From fddae1bfc60fea86619058cab6cae01662b9cfc3 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 11 Oct 2023 13:56:05 +0200 Subject: [PATCH 153/257] compile fixes --- bsp_q7s/core/XiphosWdtHandler.cpp | 6 ++++-- bsp_q7s/core/XiphosWdtHandler.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/bsp_q7s/core/XiphosWdtHandler.cpp b/bsp_q7s/core/XiphosWdtHandler.cpp index be087648..6a1dc687 100644 --- a/bsp_q7s/core/XiphosWdtHandler.cpp +++ b/bsp_q7s/core/XiphosWdtHandler.cpp @@ -84,7 +84,7 @@ ReturnValue_t XiphosWdtHandler::enableWdt() { // Of course the enable API will fail if the device is already on, just perfect, love me some // good C API... :))) if (retval != 0 or status == 0) { - int retval = xsc_watchdog_enable(wdtHandle); + retval = xsc_watchdog_enable(wdtHandle); if (retval != 0) { sif::error << "XiphosWdtHandler: Enabling WDT failed with code " << retval << ": " << strerror(retval) << std::endl; @@ -105,7 +105,7 @@ ReturnValue_t XiphosWdtHandler::disableWdt() { // Of course the disable API will fail if the device is already off, just perfect, love me some // good C API... :))) if (retval != 0 or status == 1) { - int retval = xsc_watchdog_disable(wdtHandle); + retval = xsc_watchdog_disable(wdtHandle); if (retval != 0) { sif::error << "XiphosWdtHandler: Disabling WDT failed with code " << retval << ": " << strerror(retval) << std::endl; @@ -114,3 +114,5 @@ ReturnValue_t XiphosWdtHandler::disableWdt() { } return returnvalue::OK; } + +MessageQueueId_t XiphosWdtHandler::getCommandQueue() const { return requestQueue->getId(); } diff --git a/bsp_q7s/core/XiphosWdtHandler.h b/bsp_q7s/core/XiphosWdtHandler.h index 28e48429..5d073e76 100644 --- a/bsp_q7s/core/XiphosWdtHandler.h +++ b/bsp_q7s/core/XiphosWdtHandler.h @@ -16,6 +16,7 @@ class XiphosWdtHandler : public SystemObject, public ExecutableObjectIF, public ReturnValue_t executeAction(ActionId_t actionId, MessageQueueId_t commandedBy, const uint8_t* data, size_t size) override; + [[nodiscard]] virtual MessageQueueId_t getCommandQueue() const override; private: // Wrappers to ensure idempotency of trash C API. From 528360744144a00b8dea423f980278dbfe37bf7a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 11 Oct 2023 13:59:11 +0200 Subject: [PATCH 154/257] changelog update --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a119bca..700a9a49 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,7 +34,7 @@ will consitute of a breaking change warranting a new major release: ## Fixed - Missing `nullptr` checks for PLOC Supervisor handler, which could lead to crashes. -- SCEX bugfix for normal and transition command. +- SCEX bugfix for normal and transition commanding. # [v6.6.0] 2023-09-18 From 8cb46610062d4f8609debba3903e07033a062310 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 11 Oct 2023 14:51:55 +0200 Subject: [PATCH 155/257] higher timeout (max value) --- bsp_q7s/core/XiphosWdtHandler.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsp_q7s/core/XiphosWdtHandler.h b/bsp_q7s/core/XiphosWdtHandler.h index 5d073e76..69fad067 100644 --- a/bsp_q7s/core/XiphosWdtHandler.h +++ b/bsp_q7s/core/XiphosWdtHandler.h @@ -24,7 +24,7 @@ class XiphosWdtHandler : public SystemObject, public ExecutableObjectIF, public ReturnValue_t disableWdt(); // Timeout duration range specified by Xiphos: 0.001 seconds to 171 seconds. The libxiphos API // expects an int, so I guess this translates to 1 to 171 seconds. - int timeoutSeconds = 60; + int timeoutSeconds = 80; struct watchdog_s* wdtHandle = nullptr; MessageQueueIF* requestQueue = nullptr; ActionHelper actionHelper; From eb1b9c837f1863a7ed602aa1346b29f73557b938 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 11 Oct 2023 14:53:10 +0200 Subject: [PATCH 156/257] comment --- bsp_q7s/core/XiphosWdtHandler.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bsp_q7s/core/XiphosWdtHandler.h b/bsp_q7s/core/XiphosWdtHandler.h index 69fad067..3f46cfd3 100644 --- a/bsp_q7s/core/XiphosWdtHandler.h +++ b/bsp_q7s/core/XiphosWdtHandler.h @@ -24,6 +24,8 @@ class XiphosWdtHandler : public SystemObject, public ExecutableObjectIF, public ReturnValue_t disableWdt(); // Timeout duration range specified by Xiphos: 0.001 seconds to 171 seconds. The libxiphos API // expects an int, so I guess this translates to 1 to 171 seconds. + // WARNING: DO NOT SET THIS HIGHER THAN 80 SECONDS! + // Possible bug in Xiphos/Xilinx kernel driver for watchdog, related to overflow. int timeoutSeconds = 80; struct watchdog_s* wdtHandle = nullptr; MessageQueueIF* requestQueue = nullptr; From 4e3229f0189319127de58436061b3ffc057c4aa3 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 11 Oct 2023 15:00:15 +0200 Subject: [PATCH 157/257] cache wdt state --- bsp_q7s/core/XiphosWdtHandler.cpp | 14 +++++++++----- bsp_q7s/core/XiphosWdtHandler.h | 1 + tmtc | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/bsp_q7s/core/XiphosWdtHandler.cpp b/bsp_q7s/core/XiphosWdtHandler.cpp index 6a1dc687..8444b65f 100644 --- a/bsp_q7s/core/XiphosWdtHandler.cpp +++ b/bsp_q7s/core/XiphosWdtHandler.cpp @@ -43,11 +43,13 @@ ReturnValue_t XiphosWdtHandler::performOperation(uint8_t opCode) { sif::warning << "Can not handle message with message type " << command.getMessageType() << std::endl; } - int retval = xsc_watchdog_keepalive(wdtHandle); - if (retval != 0) { - sif::warning << "XiphosWdtHandler: Feeding WDT failed with code " << retval << ": " - << strerror(retval) << std::endl; - return returnvalue::FAILED; + if (enabled) { + int retval = xsc_watchdog_keepalive(wdtHandle); + if (retval != 0) { + sif::warning << "XiphosWdtHandler: Feeding WDT failed with code " << retval << ": " + << strerror(retval) << std::endl; + return returnvalue::FAILED; + } } return returnvalue::OK; } @@ -91,6 +93,7 @@ ReturnValue_t XiphosWdtHandler::enableWdt() { return returnvalue::FAILED; } } + enabled = true; return returnvalue::OK; } @@ -112,6 +115,7 @@ ReturnValue_t XiphosWdtHandler::disableWdt() { return returnvalue::FAILED; } } + enabled = false; return returnvalue::OK; } diff --git a/bsp_q7s/core/XiphosWdtHandler.h b/bsp_q7s/core/XiphosWdtHandler.h index 3f46cfd3..a8d73f48 100644 --- a/bsp_q7s/core/XiphosWdtHandler.h +++ b/bsp_q7s/core/XiphosWdtHandler.h @@ -27,6 +27,7 @@ class XiphosWdtHandler : public SystemObject, public ExecutableObjectIF, public // WARNING: DO NOT SET THIS HIGHER THAN 80 SECONDS! // Possible bug in Xiphos/Xilinx kernel driver for watchdog, related to overflow. int timeoutSeconds = 80; + bool enabled = false; struct watchdog_s* wdtHandle = nullptr; MessageQueueIF* requestQueue = nullptr; ActionHelper actionHelper; diff --git a/tmtc b/tmtc index aba369f1..dcae9308 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit aba369f11f928aefe570f18651bd72ce98953961 +Subproject commit dcae930895b3debca5a5b615fc20cded7c3d0e89 From 9265f27af91317982f93f9e00aabc8a128def018 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 11 Oct 2023 15:02:59 +0200 Subject: [PATCH 158/257] changelog --- CHANGELOG.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f9038140..f3c69d56 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,8 @@ will consitute of a breaking change warranting a new major release: - EPS Subsystem has been added to EIVE System Tree - Power Controller for calculating the State of Charge and FDIR regarding low SoC has been introduced. +- Activate Xiphos WDT with a timeout period of 80 seconds using the `libxiphos` API. The WDT + calls are done by the new `XiphosWdtHandler` object. ## Changed @@ -36,11 +38,6 @@ will consitute of a breaking change warranting a new major release: - Missing `nullptr` checks for PLOC Supervisor handler, which could lead to crashes. - SCEX bugfix for normal and transition commanding. -## Added - -- Activate Xiphos WDT with a timeout period of 60 seconds using the `libxiphos` API. The WDT - calls are done by the new `XiphosWdtHandler` object. - # [v6.6.0] 2023-09-18 ## Changed From a381efc5d949370ab65a6a2b72f5592ffabad463 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 11 Oct 2023 18:16:36 +0200 Subject: [PATCH 159/257] prep next release --- CHANGELOG.md | 4 +++- CMakeLists.txt | 4 ++-- tmtc | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 700a9a49..b7143400 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,9 @@ will consitute of a breaking change warranting a new major release: # [unreleased] -- Bumped `eive-tmtc` to v5.7.0. +# [v7.0.0] 2023-10-11 + +- Bumped `eive-tmtc` to v5.7.1. - Bumped `eive-fsfw` ## Added diff --git a/CMakeLists.txt b/CMakeLists.txt index 65038b76..2b02cfdb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,8 +9,8 @@ # ############################################################################## cmake_minimum_required(VERSION 3.13) -set(OBSW_VERSION_MAJOR 6) -set(OBSW_VERSION_MINOR 6) +set(OBSW_VERSION_MAJOR 7) +set(OBSW_VERSION_MINOR 0) set(OBSW_VERSION_REVISION 0) # set(CMAKE_VERBOSE TRUE) diff --git a/tmtc b/tmtc index 9711dd92..39e6a048 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 9711dd9242340720e28d41eefda90666ec9af4bb +Subproject commit 39e6a0488922590900b862e5e70524be1d6ec5ba From 62305ec39b31ba0533b2358173c3d5fd4233ad7f Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 11 Oct 2023 19:38:03 +0200 Subject: [PATCH 160/257] bump tmtc --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index dcae9308..e249f147 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit dcae930895b3debca5a5b615fc20cded7c3d0e89 +Subproject commit e249f147bc1738003d31290df8f2b525d91c3482 From bb4e495199f61d0d8257f3777dc3d83442e89a43 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 11 Oct 2023 19:40:16 +0200 Subject: [PATCH 161/257] changelog correcion --- CHANGELOG.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 14e7e392..a6d88025 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,12 @@ will consitute of a breaking change warranting a new major release: # [unreleased] +# [v7.1.0] 2023-10-11 + +- Bumped `eive-tmtc` to v5.8.0. +- Activate Xiphos WDT with a timeout period of 80 seconds using the `libxiphos` API. The WDT + calls are done by the new `XiphosWdtHandler` object. + # [v7.0.0] 2023-10-11 - Bumped `eive-tmtc` to v5.7.1. @@ -26,8 +32,6 @@ will consitute of a breaking change warranting a new major release: - EPS Subsystem has been added to EIVE System Tree - Power Controller for calculating the State of Charge and FDIR regarding low SoC has been introduced. -- Activate Xiphos WDT with a timeout period of 80 seconds using the `libxiphos` API. The WDT - calls are done by the new `XiphosWdtHandler` object. ## Changed From ebe67a38a96651e8295a7076bd0cb0cb4759b4b7 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 11 Oct 2023 19:49:24 +0200 Subject: [PATCH 162/257] bump minor version --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2b02cfdb..65e85d35 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,7 @@ cmake_minimum_required(VERSION 3.13) set(OBSW_VERSION_MAJOR 7) -set(OBSW_VERSION_MINOR 0) +set(OBSW_VERSION_MINOR 1) set(OBSW_VERSION_REVISION 0) # set(CMAKE_VERBOSE TRUE) From 8f4c9b272c3887b7362d1423124a5b7975f77e85 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 12 Oct 2023 18:26:55 +0200 Subject: [PATCH 163/257] important bugfix for SSC field --- mission/tmtc/CfdpTmFunnel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mission/tmtc/CfdpTmFunnel.cpp b/mission/tmtc/CfdpTmFunnel.cpp index 268d2d3f..daf53925 100644 --- a/mission/tmtc/CfdpTmFunnel.cpp +++ b/mission/tmtc/CfdpTmFunnel.cpp @@ -66,7 +66,7 @@ ReturnValue_t CfdpTmFunnel::handlePacket(TmTcMessage& msg) { auto spacePacketHeader = SpacePacketCreator(ccsds::PacketType::TM, false, cfdpInCcsdsApid, ccsds::SequenceFlags::UNSEGMENTED, sourceSequenceCount++, 0); - sourceSequenceCount = sourceSequenceCount & ccsds::LIMIT_SEQUENCE_COUNT; + sourceSequenceCount = sourceSequenceCount % ccsds::LIMIT_SEQUENCE_COUNT; spacePacketHeader.setCcsdsLenFromTotalDataFieldLen(cfdpPacketLen); uint8_t* newPacketData = nullptr; store_address_t newStoreId{}; From ffe1281eb9454ac0de0263f44ae53294b3bb1920 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 13 Oct 2023 09:20:51 +0200 Subject: [PATCH 164/257] fix PTME --- .../fsfwconfig/events/translateEvents.cpp | 2 +- .../fsfwconfig/objects/translateObjects.cpp | 2 +- common/config/eive/resultClassIds.h | 1 + generators/bsp_hosted_returnvalues.csv | 2 + generators/bsp_q7s_returnvalues.csv | 4 +- generators/events/translateEvents.cpp | 2 +- generators/objects/translateObjects.cpp | 2 +- linux/fsfwconfig/events/translateEvents.cpp | 2 +- linux/fsfwconfig/objects/translateObjects.cpp | 2 +- linux/ipcore/PapbVcInterface.cpp | 53 +++++++++---------- linux/ipcore/PapbVcInterface.h | 12 ++--- linux/ipcore/Ptme.cpp | 34 ++++-------- linux/ipcore/Ptme.h | 5 +- linux/ipcore/PtmeIF.h | 14 ++--- mission/com/TmStoreTaskBase.cpp | 13 ++++- mission/com/VirtualChannel.cpp | 51 +++++++++++++++--- mission/com/VirtualChannel.h | 11 +++- mission/com/VirtualChannelWithQueue.cpp | 13 ++++- mission/tmtc/DirectTmSinkIF.h | 8 ++- tmtc | 2 +- 20 files changed, 141 insertions(+), 94 deletions(-) diff --git a/bsp_hosted/fsfwconfig/events/translateEvents.cpp b/bsp_hosted/fsfwconfig/events/translateEvents.cpp index 9bb03ff0..13b2f7d5 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 313 translations. * @details - * Generated on: 2023-10-11 10:54:39 + * Generated on: 2023-10-13 09:17:41 */ #include "translateEvents.h" diff --git a/bsp_hosted/fsfwconfig/objects/translateObjects.cpp b/bsp_hosted/fsfwconfig/objects/translateObjects.cpp index 7e795093..00170e41 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 174 translations. - * Generated on: 2023-10-11 10:54:39 + * Generated on: 2023-10-13 09:17:41 */ #include "translateObjects.h" diff --git a/common/config/eive/resultClassIds.h b/common/config/eive/resultClassIds.h index 9e2a3f2f..35b2a419 100644 --- a/common/config/eive/resultClassIds.h +++ b/common/config/eive/resultClassIds.h @@ -41,6 +41,7 @@ enum commonClassIds : uint8_t { LOCAL_PARAM_HANDLER, // LPH PERSISTENT_TM_STORE, // PTM TM_SINK, // TMS + VIRTUAL_CHANNEL, // VCS COMMON_CLASS_ID_END // [EXPORT] : [END] }; } diff --git a/generators/bsp_hosted_returnvalues.csv b/generators/bsp_hosted_returnvalues.csv index 0dfc94c3..ea7717f8 100644 --- a/generators/bsp_hosted_returnvalues.csv +++ b/generators/bsp_hosted_returnvalues.csv @@ -513,3 +513,5 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x6d00;PTM_DumpDone;No description;0;PERSISTENT_TM_STORE;mission/tmtc/PersistentTmStore.h 0x6d01;PTM_BusyDumping;No description;1;PERSISTENT_TM_STORE;mission/tmtc/PersistentTmStore.h 0x6e00;TMS_IsBusy;No description;0;TM_SINK;mission/tmtc/DirectTmSinkIF.h +0x6e01;TMS_PartiallyWritten;No description;1;TM_SINK;mission/tmtc/DirectTmSinkIF.h +0x6f00;VCS_ChannelDoesNotExist;No description;0;VIRTUAL_CHANNEL;mission/com/VirtualChannel.h diff --git a/generators/bsp_q7s_returnvalues.csv b/generators/bsp_q7s_returnvalues.csv index 0e804457..c47d15e1 100644 --- a/generators/bsp_q7s_returnvalues.csv +++ b/generators/bsp_q7s_returnvalues.csv @@ -608,4 +608,6 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x6d00;PTM_DumpDone;No description;0;PERSISTENT_TM_STORE;mission/tmtc/PersistentTmStore.h 0x6d01;PTM_BusyDumping;No description;1;PERSISTENT_TM_STORE;mission/tmtc/PersistentTmStore.h 0x6e00;TMS_IsBusy;No description;0;TM_SINK;mission/tmtc/DirectTmSinkIF.h -0x7000;SCBU_KeyNotFound;No description;0;SCRATCH_BUFFER;bsp_q7s/memory/scratchApi.h +0x6e01;TMS_PartiallyWritten;No description;1;TM_SINK;mission/tmtc/DirectTmSinkIF.h +0x6f00;VCS_ChannelDoesNotExist;No description;0;VIRTUAL_CHANNEL;mission/com/VirtualChannel.h +0x7100;SCBU_KeyNotFound;No description;0;SCRATCH_BUFFER;bsp_q7s/memory/scratchApi.h diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index 9bb03ff0..13b2f7d5 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 313 translations. * @details - * Generated on: 2023-10-11 10:54:39 + * Generated on: 2023-10-13 09:17:41 */ #include "translateEvents.h" diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index 0599cc18..06da3f47 100644 --- a/generators/objects/translateObjects.cpp +++ b/generators/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 178 translations. - * Generated on: 2023-10-11 10:54:39 + * Generated on: 2023-10-13 09:17:41 */ #include "translateObjects.h" diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index 9bb03ff0..13b2f7d5 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 313 translations. * @details - * Generated on: 2023-10-11 10:54:39 + * Generated on: 2023-10-13 09:17:41 */ #include "translateEvents.h" diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index 0599cc18..06da3f47 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 178 translations. - * Generated on: 2023-10-11 10:54:39 + * Generated on: 2023-10-13 09:17:41 */ #include "translateObjects.h" diff --git a/linux/ipcore/PapbVcInterface.cpp b/linux/ipcore/PapbVcInterface.cpp index 5dcb4519..5e63aebc 100644 --- a/linux/ipcore/PapbVcInterface.cpp +++ b/linux/ipcore/PapbVcInterface.cpp @@ -23,7 +23,7 @@ ReturnValue_t PapbVcInterface::initialize() { return returnvalue::OK; } -ReturnValue_t PapbVcInterface::write(const uint8_t* data, size_t size) { +ReturnValue_t PapbVcInterface::write(const uint8_t* data, size_t size, size_t& writtenSize) { // There are no packets smaller than 4, this is considered a configuration error. if (size < 4) { return returnvalue::FAILED; @@ -37,19 +37,7 @@ ReturnValue_t PapbVcInterface::write(const uint8_t* data, size_t size) { abortPacketTransfer(); return returnvalue::FAILED; } - for (size_t idx = 0; idx < size; idx++) { - if (not pollReadyForOctet(MAX_BUSY_POLLS)) { - abortPacketTransfer(); - return returnvalue::FAILED; - } - *(vcBaseReg + DATA_REG_OFFSET) = static_cast(data[idx]); - } - if (not pollReadyForOctet(MAX_BUSY_POLLS)) { - abortPacketTransfer(); - return returnvalue::FAILED; - } - completePacketTransfer(); - return returnvalue::OK; + return finishWritePartialOpt(data, size, true); } void PapbVcInterface::startPacketTransfer(ByteWidthCfg initWidth) { @@ -65,6 +53,26 @@ bool PapbVcInterface::pollReadyForPacket() const { return (reg >> 6) & 0b1; } +ReturnValue_t PapbVcInterface::finishWritePartialOpt(const uint8_t* data, size_t remainingSize, + bool handlePartial) { + for (size_t idx = 0; idx < remainingSize; idx++) { + if (not pollReadyForOctet(MAX_BUSY_POLLS)) { + if (not pollReadyForPacket()) { + return PARTIALLY_WRITTEN; + } + abortPacketTransfer(); + return returnvalue::FAILED; + } + *(vcBaseReg + DATA_REG_OFFSET) = static_cast(data[idx]); + } + if (not pollReadyForOctet(MAX_BUSY_POLLS)) { + abortPacketTransfer(); + return returnvalue::FAILED; + } + completePacketTransfer(); + return returnvalue::OK; +} + bool PapbVcInterface::isVcInterfaceBufferEmpty() { ReturnValue_t result = returnvalue::OK; gpio::Levels papbEmptyState = gpio::Levels::HIGH; @@ -101,21 +109,8 @@ inline bool PapbVcInterface::pollReadyForOctet(uint32_t maxCycles) const { return false; } -ReturnValue_t PapbVcInterface::sendTestFrame() { - /** Size of one complete transfer frame data field amounts to 1105 bytes */ - uint8_t testPacket[1105]; - - /** Fill one test packet */ - for (int idx = 0; idx < 1105; idx++) { - testPacket[idx] = static_cast(idx & 0xFF); - } - - ReturnValue_t result = write(testPacket, 1105); - if (result != returnvalue::OK) { - return result; - } - - return returnvalue::OK; +ReturnValue_t PapbVcInterface::finishWrite(const uint8_t* data, size_t remainingSize) { + return finishWritePartialOpt(data, remainingSize, false); } void PapbVcInterface::abortPacketTransfer() { *vcBaseReg = CONFIG_ABORT; } diff --git a/linux/ipcore/PapbVcInterface.h b/linux/ipcore/PapbVcInterface.h index b5160748..72b9b9f3 100644 --- a/linux/ipcore/PapbVcInterface.h +++ b/linux/ipcore/PapbVcInterface.h @@ -40,7 +40,11 @@ class PapbVcInterface : public VirtualChannelIF { * @param size * @return returnvalue::OK on successfull write, PAPB_BUSY if PAPB is busy. */ - ReturnValue_t write(const uint8_t* data, size_t size) override; + ReturnValue_t write(const uint8_t* data, size_t size, size_t& writtenSize) override; + + ReturnValue_t finishWrite(const uint8_t* data, size_t remainingSize) override; + ReturnValue_t finishWritePartialOpt(const uint8_t* data, size_t remainingSize, + bool handlePartial); void cancelTransfer() override; @@ -126,12 +130,6 @@ class PapbVcInterface : public VirtualChannelIF { * the packet buffer of the virtual channel or not. */ bool isVcInterfaceBufferEmpty(); - - /** - * @brief This function sends a complete telemetry transfer frame data field (1105 bytes) - * to the papb interface of the PTME IP Core. Can be used to test the implementation. - */ - ReturnValue_t sendTestFrame(); }; #endif /* LINUX_OBC_PAPBVCINTERFACE_H_ */ diff --git a/linux/ipcore/Ptme.cpp b/linux/ipcore/Ptme.cpp index f33c8725..9b688d16 100644 --- a/linux/ipcore/Ptme.cpp +++ b/linux/ipcore/Ptme.cpp @@ -19,15 +19,12 @@ ReturnValue_t Ptme::initialize() { return returnvalue::OK; } -ReturnValue_t Ptme::writeToVc(uint8_t vcId, const uint8_t* data, size_t size) { - VcInterfaceMapIter vcInterfaceMapIter = vcInterfaceMap.find(vcId); - if (vcInterfaceMapIter == vcInterfaceMap.end()) { - sif::warning << "Ptme::writeToVc: No virtual channel interface found for the virtual " - "channel with id " - << static_cast(vcId) << std::endl; - return UNKNOWN_VC_ID; +bool Ptme::containsVc(uint8_t vcId) const { + auto channelIter = vcInterfaceMap.find(vcId); + if (channelIter == vcInterfaceMap.end()) { + return false; } - return vcInterfaceMapIter->second->write(data, size); + return true; } void Ptme::addVcInterface(VcId_t vcId, VirtualChannelIF* vc) { @@ -50,21 +47,10 @@ void Ptme::addVcInterface(VcId_t vcId, VirtualChannelIF* vc) { } } -bool Ptme::isBusy(uint8_t vcId) const { - const auto& vcInterfaceMapIter = vcInterfaceMap.find(vcId); - if (vcInterfaceMapIter == vcInterfaceMap.end()) { - sif::warning << "Ptme::writeToVc: No virtual channel interface found for the virtual " - "channel with id " - << static_cast(vcId) << std::endl; - return UNKNOWN_VC_ID; +VirtualChannelIF* Ptme::getVirtChannel(uint8_t vcId) { + auto channelIter = vcInterfaceMap.find(vcId); + if (channelIter == vcInterfaceMap.end()) { + return nullptr; } - return vcInterfaceMapIter->second->isBusy(); -} - -void Ptme::cancelTransfer(uint8_t vcId) { - VcInterfaceMapIter vcInterfaceMapIter = vcInterfaceMap.find(vcId); - if (vcInterfaceMapIter == vcInterfaceMap.end()) { - return; - } - return vcInterfaceMapIter->second->cancelTransfer(); + return channelIter->second; } diff --git a/linux/ipcore/Ptme.h b/linux/ipcore/Ptme.h index 2607fc90..d5e77024 100644 --- a/linux/ipcore/Ptme.h +++ b/linux/ipcore/Ptme.h @@ -34,9 +34,8 @@ class Ptme : public PtmeIF, public SystemObject { virtual ~Ptme(); ReturnValue_t initialize() override; - ReturnValue_t writeToVc(uint8_t vcId, const uint8_t* data, size_t size) override; - bool isBusy(uint8_t vcId) const override; - void cancelTransfer(uint8_t vcId) override; + bool containsVc(uint8_t vcId) const override; + VirtualChannelIF* getVirtChannel(uint8_t vcId) override; /** * @brief This function adds the reference to a virtual channel interface to the vcInterface diff --git a/linux/ipcore/PtmeIF.h b/linux/ipcore/PtmeIF.h index 38804484..a5ea0c95 100644 --- a/linux/ipcore/PtmeIF.h +++ b/linux/ipcore/PtmeIF.h @@ -1,6 +1,8 @@ #ifndef LINUX_OBC_PTMEIF_H_ #define LINUX_OBC_PTMEIF_H_ +#include + #include "fsfw/returnvalues/returnvalue.h" /** @@ -14,16 +16,8 @@ class PtmeIF { public: virtual ~PtmeIF(){}; - /** - * @brief Implements to function to write to a specific virtual channel. - * - * @param vcId Virtual channel to write to - * @param data Pointer to buffer holding the data to write - * @param size Number of bytes to write - */ - virtual ReturnValue_t writeToVc(uint8_t vcId, const uint8_t* data, size_t size) = 0; - virtual bool isBusy(uint8_t vcId) const = 0; - virtual void cancelTransfer(uint8_t vcId) = 0; + virtual bool containsVc(uint8_t vcId) const = 0; + virtual VirtualChannelIF* getVirtChannel(uint8_t vcId) = 0; }; #endif /* LINUX_OBC_PTMEIF_H_ */ diff --git a/mission/com/TmStoreTaskBase.cpp b/mission/com/TmStoreTaskBase.cpp index 80900975..8849b241 100644 --- a/mission/com/TmStoreTaskBase.cpp +++ b/mission/com/TmStoreTaskBase.cpp @@ -138,8 +138,17 @@ ReturnValue_t TmStoreTaskBase::performDump(PersistentTmStoreWithTmQueue& store, return result; } dumpedLen = tmReader.getFullPacketLen(); - result = channel.write(tmReader.getFullData(), dumpedLen); - if (result == DirectTmSinkIF::IS_BUSY) { + size_t partiallyWrittenSize = 0; + result = channel.write(tmReader.getFullData(), dumpedLen, partiallyWrittenSize); + if (result == VirtualChannelIF::PARTIALLY_WRITTEN) { + result = channel.handleLastWriteSynchronously(tmReader.getFullData(), partiallyWrittenSize, + dumpedLen - partiallyWrittenSize, 20); + if (result != returnvalue::OK) { + // TODO: Event? Might lead to dangerous spam though.. + sif::warning << "PersistentTmStore: Synchronous write of last segment failed with code 0x" + << std::setw(4) << std::hex << result << std::endl; + } + } else if (result == DirectTmSinkIF::IS_BUSY) { sif::warning << "PersistentTmStore: Unexpected VC channel busy" << std::endl; } else if (result != returnvalue::OK) { sif::warning << "PersistentTmStore: Unexpected VC channel write failure" << std::endl; diff --git a/mission/com/VirtualChannel.cpp b/mission/com/VirtualChannel.cpp index ff3749a9..b3201334 100644 --- a/mission/com/VirtualChannel.cpp +++ b/mission/com/VirtualChannel.cpp @@ -1,25 +1,64 @@ #include "VirtualChannel.h" +#include + VirtualChannel::VirtualChannel(object_id_t objectId, uint8_t vcId, const char* vcName, PtmeIF& ptme, const std::atomic_bool& txOn) : SystemObject(objectId), ptme(ptme), vcId(vcId), vcName(vcName), txOn(txOn) {} ReturnValue_t VirtualChannel::initialize() { return returnvalue::OK; } -ReturnValue_t VirtualChannel::sendNextTm(const uint8_t* data, size_t size) { - return write(data, size); +ReturnValue_t VirtualChannel::sendNextTm(const uint8_t* data, size_t size, size_t& writtenSize) { + return write(data, size, writtenSize); } -ReturnValue_t VirtualChannel::write(const uint8_t* data, size_t size) { - return ptme.writeToVc(vcId, data, size); +ReturnValue_t VirtualChannel::write(const uint8_t* data, size_t size, size_t& writtenSize) { + if (!ptme.containsVc(vcId)) { + return CHANNEL_DOES_NOT_EXIST; + } + return ptme.getVirtChannel(vcId)->write(data, size, writtenSize); } uint8_t VirtualChannel::getVcid() const { return vcId; } +ReturnValue_t VirtualChannel::finishWrite(const uint8_t* data, size_t remainingSize) { + if (!ptme.containsVc(vcId)) { + return CHANNEL_DOES_NOT_EXIST; + } + return ptme.getVirtChannel(vcId)->finishWrite(data, remainingSize); +} + const char* VirtualChannel::getName() const { return vcName.c_str(); } -bool VirtualChannel::isBusy() const { return ptme.isBusy(vcId); } +bool VirtualChannel::isBusy() const { + if (!ptme.containsVc(vcId)) { + return CHANNEL_DOES_NOT_EXIST; + } + return ptme.getVirtChannel(vcId)->isBusy(); +} -void VirtualChannel::cancelTransfer() { ptme.cancelTransfer(vcId); } +void VirtualChannel::cancelTransfer() { + if (!ptme.containsVc(vcId)) { + return; + } + ptme.getVirtChannel(vcId)->cancelTransfer(); +} bool VirtualChannel::isTxOn() const { return txOn; } + +ReturnValue_t VirtualChannel::handleLastWriteSynchronously(const uint8_t* data, size_t start, + size_t remLen, unsigned maxDelayMs) { + unsigned delayMs = 0; + while (true) { + if (isBusy()) { + if (delayMs >= maxDelayMs) { + break; + } + TaskFactory::delayTask(10); + delayMs += 10; + continue; + } + return finishWrite(data, start); + } + return returnvalue::FAILED; +} diff --git a/mission/com/VirtualChannel.h b/mission/com/VirtualChannel.h index 98aba903..9995772f 100644 --- a/mission/com/VirtualChannel.h +++ b/mission/com/VirtualChannel.h @@ -15,6 +15,10 @@ */ class VirtualChannel : public SystemObject, public VirtualChannelIF { public: + static constexpr uint8_t CLASS_ID = CLASS_ID::VIRTUAL_CHANNEL; + + static constexpr ReturnValue_t CHANNEL_DOES_NOT_EXIST = returnvalue::makeCode(CLASS_ID, 0); + /** * @brief Constructor * @@ -25,9 +29,12 @@ class VirtualChannel : public SystemObject, public VirtualChannelIF { const std::atomic_bool& linkStateProvider); ReturnValue_t initialize() override; - ReturnValue_t sendNextTm(const uint8_t* data, size_t size); + ReturnValue_t sendNextTm(const uint8_t* data, size_t size, size_t& writtenSize); bool isBusy() const override; - ReturnValue_t write(const uint8_t* data, size_t size) override; + ReturnValue_t write(const uint8_t* data, size_t size, size_t& writtenSize) override; + ReturnValue_t finishWrite(const uint8_t* data, size_t remainingSize) override; + ReturnValue_t handleLastWriteSynchronously(const uint8_t* data, size_t start, size_t remLen, + unsigned maxDelayMs); void cancelTransfer() override; uint8_t getVcid() const; bool isTxOn() const; diff --git a/mission/com/VirtualChannelWithQueue.cpp b/mission/com/VirtualChannelWithQueue.cpp index a90829ab..621a7268 100644 --- a/mission/com/VirtualChannelWithQueue.cpp +++ b/mission/com/VirtualChannelWithQueue.cpp @@ -36,8 +36,19 @@ ReturnValue_t VirtualChannelWithQueue::handleNextTm(bool performWriteOp) { return result; } + // TODO: Hnadle partial write handling + size_t partiallyWrittenSize = 0; if (performWriteOp) { - result = write(data, size); + result = write(data, size, partiallyWrittenSize); + if (result == PARTIALLY_WRITTEN) { + result = handleLastWriteSynchronously(data, size, partiallyWrittenSize, 20); + if (result != returnvalue::OK) { + // TODO: Event? Might lead to dangerous spam though.. + sif::warning + << "VirtualChannelWithQueue: Synchronous write of last segment failed with code 0x" + << std::setw(4) << std::hex << result << std::endl; + } + } } // Try delete in any case, ignore failures (which should not happen), it is more important to // propagate write errors. diff --git a/mission/tmtc/DirectTmSinkIF.h b/mission/tmtc/DirectTmSinkIF.h index 11a17c79..a5f3af42 100644 --- a/mission/tmtc/DirectTmSinkIF.h +++ b/mission/tmtc/DirectTmSinkIF.h @@ -13,6 +13,7 @@ class DirectTmSinkIF { static constexpr uint8_t CLASS_ID = CLASS_ID::TM_SINK; static constexpr ReturnValue_t IS_BUSY = returnvalue::makeCode(CLASS_ID, 0); + static constexpr ReturnValue_t PARTIALLY_WRITTEN = returnvalue::makeCode(CLASS_ID, 1); /** * @brief Implements the functionality to write to a TM sink directly @@ -20,9 +21,12 @@ class DirectTmSinkIF { * @param data Pointer to buffer holding the data to write * @param size Number of bytes to write * @return returnvalue::OK on success, returnvalue::FAILED on failure, IS_BUSY - * if the TM sink is busy. + * if the TM sink is busy, PARTIALLY_WRITTEN if only a portion of the bytes could be + * written. */ - virtual ReturnValue_t write(const uint8_t* data, size_t size) = 0; + virtual ReturnValue_t write(const uint8_t* data, size_t size, size_t& writtenSize) = 0; + + virtual ReturnValue_t finishWrite(const uint8_t* data, size_t remainingSize) = 0; virtual bool isBusy() const = 0; }; diff --git a/tmtc b/tmtc index e249f147..84df438e 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit e249f147bc1738003d31290df8f2b525d91c3482 +Subproject commit 84df438e9d74898cbb3c6319ba55193c0c8d0b0c From 99192606a26d80a2942f1fdefeb106bc298e7a81 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 13 Oct 2023 09:27:24 +0200 Subject: [PATCH 165/257] bugfixes for PAPB IF --- linux/ipcore/PapbVcInterface.cpp | 19 ++++++++++++------- linux/ipcore/PapbVcInterface.h | 3 +-- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/linux/ipcore/PapbVcInterface.cpp b/linux/ipcore/PapbVcInterface.cpp index 5e63aebc..2329a32e 100644 --- a/linux/ipcore/PapbVcInterface.cpp +++ b/linux/ipcore/PapbVcInterface.cpp @@ -37,7 +37,7 @@ ReturnValue_t PapbVcInterface::write(const uint8_t* data, size_t size, size_t& w abortPacketTransfer(); return returnvalue::FAILED; } - return finishWritePartialOpt(data, size, true); + return finishWriteInternal(data, size, writtenSize); } void PapbVcInterface::startPacketTransfer(ByteWidthCfg initWidth) { @@ -53,11 +53,20 @@ bool PapbVcInterface::pollReadyForPacket() const { return (reg >> 6) & 0b1; } -ReturnValue_t PapbVcInterface::finishWritePartialOpt(const uint8_t* data, size_t remainingSize, - bool handlePartial) { +ReturnValue_t PapbVcInterface::finishWrite(const uint8_t* data, size_t remainingSize) { + if (not pollReadyForPacket()) { + return returnvalue::FAILED; + } + size_t dummy = 0; + return finishWriteInternal(data, remainingSize, dummy); +} + +ReturnValue_t PapbVcInterface::finishWriteInternal(const uint8_t* data, size_t remainingSize, + size_t& writtenSize) { for (size_t idx = 0; idx < remainingSize; idx++) { if (not pollReadyForOctet(MAX_BUSY_POLLS)) { if (not pollReadyForPacket()) { + writtenSize = idx; return PARTIALLY_WRITTEN; } abortPacketTransfer(); @@ -109,8 +118,4 @@ inline bool PapbVcInterface::pollReadyForOctet(uint32_t maxCycles) const { return false; } -ReturnValue_t PapbVcInterface::finishWrite(const uint8_t* data, size_t remainingSize) { - return finishWritePartialOpt(data, remainingSize, false); -} - void PapbVcInterface::abortPacketTransfer() { *vcBaseReg = CONFIG_ABORT; } diff --git a/linux/ipcore/PapbVcInterface.h b/linux/ipcore/PapbVcInterface.h index 72b9b9f3..201580bc 100644 --- a/linux/ipcore/PapbVcInterface.h +++ b/linux/ipcore/PapbVcInterface.h @@ -43,8 +43,7 @@ class PapbVcInterface : public VirtualChannelIF { ReturnValue_t write(const uint8_t* data, size_t size, size_t& writtenSize) override; ReturnValue_t finishWrite(const uint8_t* data, size_t remainingSize) override; - ReturnValue_t finishWritePartialOpt(const uint8_t* data, size_t remainingSize, - bool handlePartial); + ReturnValue_t finishWriteInternal(const uint8_t* data, size_t remainingSize, size_t& writtenSize); void cancelTransfer() override; From 7c42e05c2374509d7a4ee14658d45ee4cee753c1 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 13 Oct 2023 09:29:57 +0200 Subject: [PATCH 166/257] wait duration fix --- mission/com/TmStoreTaskBase.cpp | 4 ++-- mission/com/VirtualChannelWithQueue.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mission/com/TmStoreTaskBase.cpp b/mission/com/TmStoreTaskBase.cpp index 8849b241..c51d6f9b 100644 --- a/mission/com/TmStoreTaskBase.cpp +++ b/mission/com/TmStoreTaskBase.cpp @@ -142,11 +142,11 @@ ReturnValue_t TmStoreTaskBase::performDump(PersistentTmStoreWithTmQueue& store, result = channel.write(tmReader.getFullData(), dumpedLen, partiallyWrittenSize); if (result == VirtualChannelIF::PARTIALLY_WRITTEN) { result = channel.handleLastWriteSynchronously(tmReader.getFullData(), partiallyWrittenSize, - dumpedLen - partiallyWrittenSize, 20); + dumpedLen - partiallyWrittenSize, 200); if (result != returnvalue::OK) { // TODO: Event? Might lead to dangerous spam though.. sif::warning << "PersistentTmStore: Synchronous write of last segment failed with code 0x" - << std::setw(4) << std::hex << result << std::endl; + << std::setw(4) << std::hex << result << std::dec << std::endl; } } else if (result == DirectTmSinkIF::IS_BUSY) { sif::warning << "PersistentTmStore: Unexpected VC channel busy" << std::endl; diff --git a/mission/com/VirtualChannelWithQueue.cpp b/mission/com/VirtualChannelWithQueue.cpp index 621a7268..53f2ee52 100644 --- a/mission/com/VirtualChannelWithQueue.cpp +++ b/mission/com/VirtualChannelWithQueue.cpp @@ -41,12 +41,12 @@ ReturnValue_t VirtualChannelWithQueue::handleNextTm(bool performWriteOp) { if (performWriteOp) { result = write(data, size, partiallyWrittenSize); if (result == PARTIALLY_WRITTEN) { - result = handleLastWriteSynchronously(data, size, partiallyWrittenSize, 20); + result = handleLastWriteSynchronously(data, size, partiallyWrittenSize, 200); if (result != returnvalue::OK) { // TODO: Event? Might lead to dangerous spam though.. sif::warning << "VirtualChannelWithQueue: Synchronous write of last segment failed with code 0x" - << std::setw(4) << std::hex << result << std::endl; + << std::setw(4) << std::hex << result << std::dec << std::endl; } } } From 8dbc5cad48d24a2bf9ce90c7715c237a79ede1a4 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 13 Oct 2023 09:39:50 +0200 Subject: [PATCH 167/257] more bugfixes --- CHANGELOG.md | 8 ++++++++ linux/ipcore/PapbVcInterface.cpp | 26 +++++++++++++++++++------- linux/ipcore/PapbVcInterface.h | 6 ++++-- mission/com/VirtualChannel.cpp | 6 +++--- mission/com/VirtualChannel.h | 2 +- mission/tmtc/DirectTmSinkIF.h | 3 ++- 6 files changed, 37 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a6d88025..b029d621 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,14 @@ will consitute of a breaking change warranting a new major release: # [unreleased] +## Fixed + +- If the PTME is driven in a way where it fills faster than it can be emptied, the interface + can become full during the process of a regular packet write. The interface of the PAPB VC + component was adapted to account for this partial success state. The caller must now check + for the `PARTIALLY_WRITTEN` state and must take care of finishing a write in some shape or + form before starting the next packet transfer. + # [v7.1.0] 2023-10-11 - Bumped `eive-tmtc` to v5.8.0. diff --git a/linux/ipcore/PapbVcInterface.cpp b/linux/ipcore/PapbVcInterface.cpp index 2329a32e..88684772 100644 --- a/linux/ipcore/PapbVcInterface.cpp +++ b/linux/ipcore/PapbVcInterface.cpp @@ -28,6 +28,10 @@ ReturnValue_t PapbVcInterface::write(const uint8_t* data, size_t size, size_t& w if (size < 4) { return returnvalue::FAILED; } + // The user must call finishWrite before starting a new packet transfer. + if (partialWriteActive) { + return INCOMPLETE_PARTIAL_WRITE; + } if (pollReadyForPacket()) { startPacketTransfer(ByteWidthCfg::ONE); } else { @@ -37,7 +41,7 @@ ReturnValue_t PapbVcInterface::write(const uint8_t* data, size_t size, size_t& w abortPacketTransfer(); return returnvalue::FAILED; } - return finishWriteInternal(data, size, writtenSize); + return finishWriteInternal(data, 0, size, writtenSize, false); } void PapbVcInterface::startPacketTransfer(ByteWidthCfg initWidth) { @@ -53,26 +57,34 @@ bool PapbVcInterface::pollReadyForPacket() const { return (reg >> 6) & 0b1; } -ReturnValue_t PapbVcInterface::finishWrite(const uint8_t* data, size_t remainingSize) { +ReturnValue_t PapbVcInterface::finishWrite(const uint8_t* data, size_t start, + size_t remainingSize) { if (not pollReadyForPacket()) { return returnvalue::FAILED; } size_t dummy = 0; - return finishWriteInternal(data, remainingSize, dummy); + return finishWriteInternal(data, start, remainingSize, dummy, true); } -ReturnValue_t PapbVcInterface::finishWriteInternal(const uint8_t* data, size_t remainingSize, - size_t& writtenSize) { +ReturnValue_t PapbVcInterface::finishWriteInternal(const uint8_t* data, size_t start, + size_t remainingSize, size_t& writtenSize, + bool abortOnPartialWrite) { for (size_t idx = 0; idx < remainingSize; idx++) { if (not pollReadyForOctet(MAX_BUSY_POLLS)) { if (not pollReadyForPacket()) { - writtenSize = idx; + writtenSize = start + idx; + partialWriteActive = true; + if (abortOnPartialWrite) { + abortPacketTransfer(); + partialWriteActive = false; + return returnvalue::FAILED; + } return PARTIALLY_WRITTEN; } abortPacketTransfer(); return returnvalue::FAILED; } - *(vcBaseReg + DATA_REG_OFFSET) = static_cast(data[idx]); + *(vcBaseReg + DATA_REG_OFFSET) = static_cast(data[start + idx]); } if (not pollReadyForOctet(MAX_BUSY_POLLS)) { abortPacketTransfer(); diff --git a/linux/ipcore/PapbVcInterface.h b/linux/ipcore/PapbVcInterface.h index 201580bc..35bd0439 100644 --- a/linux/ipcore/PapbVcInterface.h +++ b/linux/ipcore/PapbVcInterface.h @@ -42,8 +42,9 @@ class PapbVcInterface : public VirtualChannelIF { */ ReturnValue_t write(const uint8_t* data, size_t size, size_t& writtenSize) override; - ReturnValue_t finishWrite(const uint8_t* data, size_t remainingSize) override; - ReturnValue_t finishWriteInternal(const uint8_t* data, size_t remainingSize, size_t& writtenSize); + ReturnValue_t finishWrite(const uint8_t* data, size_t start, size_t remainingSize) override; + ReturnValue_t finishWriteInternal(const uint8_t* data, size_t start, size_t remainingSize, + size_t& writtenSize, bool abortOnPartialWrite); void cancelTransfer() override; @@ -91,6 +92,7 @@ class PapbVcInterface : public VirtualChannelIF { std::string uioFile; int mapNum = 0; + bool partialWriteActive = false; mutable struct timespec nextDelay = {.tv_sec = 0, .tv_nsec = 0}; const struct timespec BETWEEN_POLL_DELAY = {.tv_sec = 0, .tv_nsec = 10}; mutable struct timespec remDelay; diff --git a/mission/com/VirtualChannel.cpp b/mission/com/VirtualChannel.cpp index b3201334..140b23f6 100644 --- a/mission/com/VirtualChannel.cpp +++ b/mission/com/VirtualChannel.cpp @@ -21,11 +21,11 @@ ReturnValue_t VirtualChannel::write(const uint8_t* data, size_t size, size_t& wr uint8_t VirtualChannel::getVcid() const { return vcId; } -ReturnValue_t VirtualChannel::finishWrite(const uint8_t* data, size_t remainingSize) { +ReturnValue_t VirtualChannel::finishWrite(const uint8_t* data, size_t start, size_t remainingSize) { if (!ptme.containsVc(vcId)) { return CHANNEL_DOES_NOT_EXIST; } - return ptme.getVirtChannel(vcId)->finishWrite(data, remainingSize); + return ptme.getVirtChannel(vcId)->finishWrite(data, start, remainingSize); } const char* VirtualChannel::getName() const { return vcName.c_str(); } @@ -58,7 +58,7 @@ ReturnValue_t VirtualChannel::handleLastWriteSynchronously(const uint8_t* data, delayMs += 10; continue; } - return finishWrite(data, start); + return finishWrite(data, start, remLen); } return returnvalue::FAILED; } diff --git a/mission/com/VirtualChannel.h b/mission/com/VirtualChannel.h index 9995772f..3d61bd13 100644 --- a/mission/com/VirtualChannel.h +++ b/mission/com/VirtualChannel.h @@ -32,7 +32,7 @@ class VirtualChannel : public SystemObject, public VirtualChannelIF { ReturnValue_t sendNextTm(const uint8_t* data, size_t size, size_t& writtenSize); bool isBusy() const override; ReturnValue_t write(const uint8_t* data, size_t size, size_t& writtenSize) override; - ReturnValue_t finishWrite(const uint8_t* data, size_t remainingSize) override; + ReturnValue_t finishWrite(const uint8_t* data, size_t start, size_t remainingSize) override; ReturnValue_t handleLastWriteSynchronously(const uint8_t* data, size_t start, size_t remLen, unsigned maxDelayMs); void cancelTransfer() override; diff --git a/mission/tmtc/DirectTmSinkIF.h b/mission/tmtc/DirectTmSinkIF.h index a5f3af42..e1fcf54f 100644 --- a/mission/tmtc/DirectTmSinkIF.h +++ b/mission/tmtc/DirectTmSinkIF.h @@ -14,6 +14,7 @@ class DirectTmSinkIF { static constexpr ReturnValue_t IS_BUSY = returnvalue::makeCode(CLASS_ID, 0); static constexpr ReturnValue_t PARTIALLY_WRITTEN = returnvalue::makeCode(CLASS_ID, 1); + static constexpr ReturnValue_t INCOMPLETE_PARTIAL_WRITE = returnvalue::makeCode(CLASS_ID, 2); /** * @brief Implements the functionality to write to a TM sink directly @@ -26,7 +27,7 @@ class DirectTmSinkIF { */ virtual ReturnValue_t write(const uint8_t* data, size_t size, size_t& writtenSize) = 0; - virtual ReturnValue_t finishWrite(const uint8_t* data, size_t remainingSize) = 0; + virtual ReturnValue_t finishWrite(const uint8_t* data, size_t start, size_t remainingSize) = 0; virtual bool isBusy() const = 0; }; From 031be000d4c0472bc8bdb9103ca4e2129465d60a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 13 Oct 2023 10:04:03 +0200 Subject: [PATCH 168/257] printout correction --- mission/com/LiveTmTask.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/mission/com/LiveTmTask.cpp b/mission/com/LiveTmTask.cpp index 74d79d4d..833f28c1 100644 --- a/mission/com/LiveTmTask.cpp +++ b/mission/com/LiveTmTask.cpp @@ -160,7 +160,19 @@ ReturnValue_t LiveTmTask::handleGenericTmQueue(MessageQueueIF& queue) { } if (!ptmeLocked) { - result = channel.write(data, size); + size_t partiallyWrittenSize = 0; + result = channel.write(data, size, partiallyWrittenSize); + if (result == DirectTmSinkIF::PARTIALLY_WRITTEN) { + // Already throttle CFDP. + signals::CFDP_CHANNEL_THROTTLE_SIGNAL = true; + result = channel.handleLastWriteSynchronously(data, size, partiallyWrittenSize, 200); + if (result != returnvalue::OK) { + // TODO: Event? Might lead to dangerous spam though.. + sif::warning + << "LiveTmTask: Synchronous write of last segment failed with code 0x" + << std::setw(4) << std::hex << result << std::dec << std::endl; + } + } } // Try delete in any case, ignore failures (which should not happen), it is more important to // propagate write errors. From 9f600a24ff53cd37f2c8436a981531a70f162678 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 13 Oct 2023 10:57:58 +0200 Subject: [PATCH 169/257] refactored throttle handling --- mission/cfdp/CfdpHandler.cpp | 19 ++++++------------- mission/cfdp/CfdpHandler.h | 6 ++++-- mission/com/LiveTmTask.cpp | 24 +++++++++++++++++++----- mission/com/LiveTmTask.h | 6 ++++++ mission/com/VirtualChannel.cpp | 1 + mission/genericFactory.cpp | 2 +- 6 files changed, 37 insertions(+), 21 deletions(-) diff --git a/mission/cfdp/CfdpHandler.cpp b/mission/cfdp/CfdpHandler.cpp index 07fbecb1..99afb725 100644 --- a/mission/cfdp/CfdpHandler.cpp +++ b/mission/cfdp/CfdpHandler.cpp @@ -15,7 +15,8 @@ using namespace returnvalue; using namespace cfdp; -CfdpHandler::CfdpHandler(const FsfwHandlerParams& fsfwHandlerParams, const CfdpHandlerCfg& cfdpCfg) +CfdpHandler::CfdpHandler(const FsfwHandlerParams& fsfwHandlerParams, const CfdpHandlerCfg& cfdpCfg, + const std::atomic_bool& throttleSignal) : SystemObject(fsfwHandlerParams.objectId), pduQueue(fsfwHandlerParams.tmtcQueue), cfdpRequestQueue(fsfwHandlerParams.cfdpQueue), @@ -28,7 +29,8 @@ CfdpHandler::CfdpHandler(const FsfwHandlerParams& fsfwHandlerParams, const CfdpH this->fsfwParams), srcHandler(SourceHandlerParams(localCfg, cfdpCfg.userHandler, seqCntProvider), this->fsfwParams), - ipcStore(fsfwHandlerParams.ipcStore) {} + ipcStore(fsfwHandlerParams.ipcStore), + throttleSignal(throttleSignal) {} [[nodiscard]] const char* CfdpHandler::getName() const { return "CFDP Handler"; } @@ -69,20 +71,11 @@ ReturnValue_t CfdpHandler::initialize() { fsmCount++; } fsmCount = 0; - if (signals::CFDP_CHANNEL_THROTTLE_SIGNAL) { - throttlePeriodSourceHandler.resetTimer(); + + if (throttleSignal) { throttlePeriodOngoing = true; - signals::CFDP_CHANNEL_THROTTLE_SIGNAL = false; } - if (throttlePeriodOngoing) { - if (throttlePeriodSourceHandler.hasTimedOut()) { - throttlePeriodOngoing = false; - - } else { - shortDelay = true; - } - } // CFDP can be throttled by the slowest live TM handler to handle back pressure in a sensible // way without requiring huge amounts of memory for large files. if (!throttlePeriodOngoing) { diff --git a/mission/cfdp/CfdpHandler.h b/mission/cfdp/CfdpHandler.h index 46631ac5..82f27b0b 100644 --- a/mission/cfdp/CfdpHandler.h +++ b/mission/cfdp/CfdpHandler.h @@ -62,7 +62,8 @@ struct CfdpHandlerCfg { class CfdpHandler : public SystemObject, public ExecutableObjectIF, public AcceptsTelecommandsIF { public: - explicit CfdpHandler(const FsfwHandlerParams& fsfwParams, const CfdpHandlerCfg& cfdpCfg); + explicit CfdpHandler(const FsfwHandlerParams& fsfwParams, const CfdpHandlerCfg& cfdpCfg, + const std::atomic_bool& throttleSignal); [[nodiscard]] const char* getName() const override; [[nodiscard]] uint32_t getIdentifier() const override; @@ -74,7 +75,6 @@ class CfdpHandler : public SystemObject, public ExecutableObjectIF, public Accep private: MessageQueueIF& pduQueue; MessageQueueIF& cfdpRequestQueue; - Countdown throttlePeriodSourceHandler = Countdown(80); bool throttlePeriodOngoing = false; cfdp::LocalEntityCfg localCfg; @@ -89,6 +89,8 @@ class CfdpHandler : public SystemObject, public ExecutableObjectIF, public Accep StorageManagerIF* tcStore = nullptr; StorageManagerIF* tmStore = nullptr; + const std::atomic_bool& throttleSignal; + ReturnValue_t handlePduPacketMessages(); ReturnValue_t handlePduPacket(TmTcMessage& msg); ReturnValue_t handleCfdpRequest(CommandMessage& msg); diff --git a/mission/com/LiveTmTask.cpp b/mission/com/LiveTmTask.cpp index 833f28c1..f9b01c77 100644 --- a/mission/com/LiveTmTask.cpp +++ b/mission/com/LiveTmTask.cpp @@ -53,11 +53,14 @@ ReturnValue_t LiveTmTask::performOperation(uint8_t opCode) { } } } - if (channel.isBusy() and not signals::CFDP_CHANNEL_THROTTLE_SIGNAL) { + if (channel.isBusy() and !throttlePeriodOngoing) { // Throttle CFDP packet creator. It is by far the most relevant data creator, so throttling - // it is the easiest way to handle back pressure for now in a sensible way. It is cleared - // by the data creator. - signals::CFDP_CHANNEL_THROTTLE_SIGNAL = true; + // it is the easiest way to handle back pressure for now in a sensible way. + throttleCfdp(); + } else if(!channel.isBusy() and throttlePeriodOngoing) { + if(minimumPeriodThrottleCd.hasTimedOut()) { + releaseCfdp(); + } } if (!handledTm) { if (tmFunnelCd.hasTimedOut()) { @@ -164,7 +167,7 @@ ReturnValue_t LiveTmTask::handleGenericTmQueue(MessageQueueIF& queue) { result = channel.write(data, size, partiallyWrittenSize); if (result == DirectTmSinkIF::PARTIALLY_WRITTEN) { // Already throttle CFDP. - signals::CFDP_CHANNEL_THROTTLE_SIGNAL = true; + throttleCfdp(); result = channel.handleLastWriteSynchronously(data, size, partiallyWrittenSize, 200); if (result != returnvalue::OK) { // TODO: Event? Might lead to dangerous spam though.. @@ -180,6 +183,17 @@ ReturnValue_t LiveTmTask::handleGenericTmQueue(MessageQueueIF& queue) { return result; } +void LiveTmTask::throttleCfdp() { + throttlePeriodOngoing = true; + minimumPeriodThrottleCd.resetTimer(); + signals::CFDP_CHANNEL_THROTTLE_SIGNAL = true; +} + +void LiveTmTask::releaseCfdp() { + throttlePeriodOngoing = false; + signals::CFDP_CHANNEL_THROTTLE_SIGNAL = false; +} + ModeTreeChildIF& LiveTmTask::getModeTreeChildIF() { return *this; } ReturnValue_t LiveTmTask::initialize() { diff --git a/mission/com/LiveTmTask.h b/mission/com/LiveTmTask.h index 63831158..73d2bf16 100644 --- a/mission/com/LiveTmTask.h +++ b/mission/com/LiveTmTask.h @@ -39,6 +39,10 @@ class LiveTmTask : public SystemObject, CfdpTmFunnel& cfdpFunnel; VirtualChannel& channel; const std::atomic_bool& ptmeLocked; + // This countdown ensures that the CFDP is always throttled with a minimum period. Only after + // this period, the CFDP can be released if the channel is not busy. + Countdown minimumPeriodThrottleCd = Countdown(40); + bool throttlePeriodOngoing = false; void readCommandQueue(void); @@ -56,6 +60,8 @@ class LiveTmTask : public SystemObject, void startTransition(Mode_t mode, Submode_t submode) override; void announceMode(bool recursive) override; + void throttleCfdp(); + void releaseCfdp(); object_id_t getObjectId() const override; const HasHealthIF* getOptHealthIF() const override; diff --git a/mission/com/VirtualChannel.cpp b/mission/com/VirtualChannel.cpp index 140b23f6..7ada00aa 100644 --- a/mission/com/VirtualChannel.cpp +++ b/mission/com/VirtualChannel.cpp @@ -58,6 +58,7 @@ ReturnValue_t VirtualChannel::handleLastWriteSynchronously(const uint8_t* data, delayMs += 10; continue; } + sif::debug << "last write after" << delayMs << std::endl; return finishWrite(data, start, remLen); } return returnvalue::FAILED; diff --git a/mission/genericFactory.cpp b/mission/genericFactory.cpp index 0dd965eb..d66ef5f7 100644 --- a/mission/genericFactory.cpp +++ b/mission/genericFactory.cpp @@ -292,7 +292,7 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_, PusTmFun GROUND_REMOTE_CFG.maxFileSegmentLen = config::CFDP_MAX_FILE_SEGMENT_LEN; CfdpHandlerCfg cfdpCfg(localId, indicationCfg, *eiveUserHandler, EIVE_FAULT_HANDLER, PACKET_LIST, LOST_SEGMENTS, REMOTE_CFG_PROVIDER); - auto* cfdpHandler = new CfdpHandler(params, cfdpCfg); + auto* cfdpHandler = new CfdpHandler(params, cfdpCfg, signals::CFDP_CHANNEL_THROTTLE_SIGNAL); // All CFDP packets arrive wrapped inside CCSDS space packets CcsdsDistributorIF::DestInfo info("CFDP Destination", config::EIVE_CFDP_APID, cfdpHandler->getRequestQueue(), true); From 5bcd171108c99ac11290ba2bc79de6f437a9882f Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 13 Oct 2023 11:42:13 +0200 Subject: [PATCH 170/257] lot of debugging and trying out --- common/config/eive/definitions.h | 7 ++++--- mission/cfdp/CfdpHandler.cpp | 4 +--- mission/com/LiveTmTask.cpp | 12 +++++++++++- mission/com/LiveTmTask.h | 5 ++++- 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/common/config/eive/definitions.h b/common/config/eive/definitions.h index 2edf434f..777e8924 100644 --- a/common/config/eive/definitions.h +++ b/common/config/eive/definitions.h @@ -48,7 +48,7 @@ static constexpr uint32_t LEGACY_SA_DEPL_CHANNEL_ALTERNATION_INTERVAL_SECS = 5; // Maximum allowed burn time allowed by the software. static constexpr uint32_t SA_DEPL_MAX_BURN_TIME = 180; -static constexpr size_t CFDP_MAX_FILE_SEGMENT_LEN = 300; +static constexpr size_t CFDP_MAX_FILE_SEGMENT_LEN = 990; static constexpr uint32_t CCSDS_HANDLER_QUEUE_SIZE = 50; static constexpr uint8_t NUMBER_OF_VIRTUAL_CHANNELS = 4; @@ -61,9 +61,10 @@ static constexpr uint32_t HK_STORE_QUEUE_SIZE = 300; static constexpr uint32_t CFDP_STORE_QUEUE_SIZE = 300; static constexpr uint32_t LIVE_CHANNEL_NORMAL_QUEUE_SIZE = 250; -static constexpr uint32_t LIVE_CHANNEL_CFDP_QUEUE_SIZE = 250; +static constexpr uint32_t LIVE_CHANNEL_CFDP_QUEUE_SIZE = 400; -static constexpr uint32_t CFDP_MAX_FSM_CALL_COUNT_SRC_HANDLER = 50; +static constexpr uint32_t CFDP_THROTTLE_PERIOD_MS = 200; +static constexpr uint32_t CFDP_MAX_FSM_CALL_COUNT_SRC_HANDLER = 20; static constexpr uint32_t CFDP_MAX_FSM_CALL_COUNT_DEST_HANDLER = 300; static constexpr uint32_t CFDP_SHORT_DELAY_MS = 50; static constexpr uint32_t CFDP_REGULAR_DELAY_MS = 200; diff --git a/mission/cfdp/CfdpHandler.cpp b/mission/cfdp/CfdpHandler.cpp index 99afb725..1382a760 100644 --- a/mission/cfdp/CfdpHandler.cpp +++ b/mission/cfdp/CfdpHandler.cpp @@ -72,9 +72,7 @@ ReturnValue_t CfdpHandler::initialize() { } fsmCount = 0; - if (throttleSignal) { - throttlePeriodOngoing = true; - } + throttlePeriodOngoing = throttleSignal; // CFDP can be throttled by the slowest live TM handler to handle back pressure in a sensible // way without requiring huge amounts of memory for large files. diff --git a/mission/com/LiveTmTask.cpp b/mission/com/LiveTmTask.cpp index f9b01c77..2b8bc50c 100644 --- a/mission/com/LiveTmTask.cpp +++ b/mission/com/LiveTmTask.cpp @@ -52,13 +52,16 @@ ReturnValue_t LiveTmTask::performOperation(uint8_t opCode) { } } } + } else { + consecutiveNoBlockWriteCounter = 0; } if (channel.isBusy() and !throttlePeriodOngoing) { // Throttle CFDP packet creator. It is by far the most relevant data creator, so throttling // it is the easiest way to handle back pressure for now in a sensible way. throttleCfdp(); } else if(!channel.isBusy() and throttlePeriodOngoing) { - if(minimumPeriodThrottleCd.hasTimedOut()) { + if(minimumPeriodThrottleCd.hasTimedOut() and consecutiveNoBlockWriteCounter >= 10) { + sif::debug << "releasing cfdp" << std::endl; releaseCfdp(); } } @@ -162,10 +165,14 @@ ReturnValue_t LiveTmTask::handleGenericTmQueue(MessageQueueIF& queue) { return result; } + if(ptmeLocked) { + consecutiveNoBlockWriteCounter= 0; + } if (!ptmeLocked) { size_t partiallyWrittenSize = 0; result = channel.write(data, size, partiallyWrittenSize); if (result == DirectTmSinkIF::PARTIALLY_WRITTEN) { + consecutiveNoBlockWriteCounter = 0; // Already throttle CFDP. throttleCfdp(); result = channel.handleLastWriteSynchronously(data, size, partiallyWrittenSize, 200); @@ -175,6 +182,9 @@ ReturnValue_t LiveTmTask::handleGenericTmQueue(MessageQueueIF& queue) { << "LiveTmTask: Synchronous write of last segment failed with code 0x" << std::setw(4) << std::hex << result << std::dec << std::endl; } + minimumPeriodThrottleCd.resetTimer(); + } else { + consecutiveNoBlockWriteCounter++; } } // Try delete in any case, ignore failures (which should not happen), it is more important to diff --git a/mission/com/LiveTmTask.h b/mission/com/LiveTmTask.h index 73d2bf16..121fd44f 100644 --- a/mission/com/LiveTmTask.h +++ b/mission/com/LiveTmTask.h @@ -10,6 +10,8 @@ #include #include #include +#include +#include "eive/definitions.h" class LiveTmTask : public SystemObject, public HasModesIF, @@ -35,13 +37,14 @@ class LiveTmTask : public SystemObject, ModeHelper modeHelper; Mode_t mode = HasModesIF::MODE_OFF; Countdown tmFunnelCd = Countdown(100); + uint32_t consecutiveNoBlockWriteCounter = 0; PusTmFunnel& pusFunnel; CfdpTmFunnel& cfdpFunnel; VirtualChannel& channel; const std::atomic_bool& ptmeLocked; // This countdown ensures that the CFDP is always throttled with a minimum period. Only after // this period, the CFDP can be released if the channel is not busy. - Countdown minimumPeriodThrottleCd = Countdown(40); + Countdown minimumPeriodThrottleCd = Countdown(config::CFDP_THROTTLE_PERIOD_MS); bool throttlePeriodOngoing = false; void readCommandQueue(void); From c95964ce0f8d08acf2c03b858a5082600d0a2178 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 13 Oct 2023 13:21:28 +0200 Subject: [PATCH 171/257] lets see if this works better --- mission/cfdp/CfdpHandler.cpp | 2 +- mission/cfdp/CfdpHandler.h | 2 +- mission/com/LiveTmTask.cpp | 35 ++++++++++++++++------------------- mission/com/LiveTmTask.h | 7 ++++--- mission/sysDefs.h | 1 + 5 files changed, 23 insertions(+), 24 deletions(-) diff --git a/mission/cfdp/CfdpHandler.cpp b/mission/cfdp/CfdpHandler.cpp index 1382a760..c1bb3273 100644 --- a/mission/cfdp/CfdpHandler.cpp +++ b/mission/cfdp/CfdpHandler.cpp @@ -16,7 +16,7 @@ using namespace returnvalue; using namespace cfdp; CfdpHandler::CfdpHandler(const FsfwHandlerParams& fsfwHandlerParams, const CfdpHandlerCfg& cfdpCfg, - const std::atomic_bool& throttleSignal) + const std::atomic_bool& throttleSignal) : SystemObject(fsfwHandlerParams.objectId), pduQueue(fsfwHandlerParams.tmtcQueue), cfdpRequestQueue(fsfwHandlerParams.cfdpQueue), diff --git a/mission/cfdp/CfdpHandler.h b/mission/cfdp/CfdpHandler.h index 82f27b0b..b2f49678 100644 --- a/mission/cfdp/CfdpHandler.h +++ b/mission/cfdp/CfdpHandler.h @@ -63,7 +63,7 @@ struct CfdpHandlerCfg { class CfdpHandler : public SystemObject, public ExecutableObjectIF, public AcceptsTelecommandsIF { public: explicit CfdpHandler(const FsfwHandlerParams& fsfwParams, const CfdpHandlerCfg& cfdpCfg, - const std::atomic_bool& throttleSignal); + const std::atomic_bool& throttleSignal); [[nodiscard]] const char* getName() const override; [[nodiscard]] uint32_t getIdentifier() const override; diff --git a/mission/com/LiveTmTask.cpp b/mission/com/LiveTmTask.cpp index 2b8bc50c..c89369fc 100644 --- a/mission/com/LiveTmTask.cpp +++ b/mission/com/LiveTmTask.cpp @@ -9,6 +9,7 @@ static constexpr bool DEBUG_TM_QUEUE_SPEED = false; std::atomic_bool signals::CFDP_CHANNEL_THROTTLE_SIGNAL = false; +std::atomic_uint32_t signals::CFDP_MSG_COUNTER = 0; LiveTmTask::LiveTmTask(object_id_t objectId, PusTmFunnel& pusFunnel, CfdpTmFunnel& cfdpFunnel, VirtualChannel& channel, const std::atomic_bool& ptmeLocked, @@ -52,16 +53,14 @@ ReturnValue_t LiveTmTask::performOperation(uint8_t opCode) { } } } - } else { - consecutiveNoBlockWriteCounter = 0; } if (channel.isBusy() and !throttlePeriodOngoing) { // Throttle CFDP packet creator. It is by far the most relevant data creator, so throttling // it is the easiest way to handle back pressure for now in a sensible way. throttleCfdp(); - } else if(!channel.isBusy() and throttlePeriodOngoing) { - if(minimumPeriodThrottleCd.hasTimedOut() and consecutiveNoBlockWriteCounter >= 10) { - sif::debug << "releasing cfdp" << std::endl; + } else if (!channel.isBusy() and throttlePeriodOngoing) { + // Half full/empty flow control: Release the CFDP is the queue is empty enough. + if (signals::CFDP_MSG_COUNTER <= config::LIVE_CHANNEL_CFDP_QUEUE_SIZE / 2) { releaseCfdp(); } } @@ -144,16 +143,21 @@ void LiveTmTask::readCommandQueue(void) { } } -ReturnValue_t LiveTmTask::handleRegularTmQueue() { return handleGenericTmQueue(*regularTmQueue); } +ReturnValue_t LiveTmTask::handleRegularTmQueue() { + return handleGenericTmQueue(*regularTmQueue, false); +} -ReturnValue_t LiveTmTask::handleCfdpTmQueue() { return handleGenericTmQueue(*cfdpTmQueue); } +ReturnValue_t LiveTmTask::handleCfdpTmQueue() { return handleGenericTmQueue(*cfdpTmQueue, true); } -ReturnValue_t LiveTmTask::handleGenericTmQueue(MessageQueueIF& queue) { +ReturnValue_t LiveTmTask::handleGenericTmQueue(MessageQueueIF& queue, bool isCfdp) { TmTcMessage message; ReturnValue_t result = queue.receiveMessage(&message); if (result == MessageQueueIF::EMPTY) { return result; } + if (signals::CFDP_MSG_COUNTER > 0) { + signals::CFDP_MSG_COUNTER--; + } store_address_t storeId = message.getStorageId(); const uint8_t* data = nullptr; size_t size = 0; @@ -165,26 +169,19 @@ ReturnValue_t LiveTmTask::handleGenericTmQueue(MessageQueueIF& queue) { return result; } - if(ptmeLocked) { - consecutiveNoBlockWriteCounter= 0; - } if (!ptmeLocked) { size_t partiallyWrittenSize = 0; result = channel.write(data, size, partiallyWrittenSize); if (result == DirectTmSinkIF::PARTIALLY_WRITTEN) { - consecutiveNoBlockWriteCounter = 0; // Already throttle CFDP. throttleCfdp(); result = channel.handleLastWriteSynchronously(data, size, partiallyWrittenSize, 200); if (result != returnvalue::OK) { // TODO: Event? Might lead to dangerous spam though.. - sif::warning - << "LiveTmTask: Synchronous write of last segment failed with code 0x" - << std::setw(4) << std::hex << result << std::dec << std::endl; + sif::warning << "LiveTmTask: Synchronous write of last segment failed with code 0x" + << std::setw(4) << std::hex << result << std::dec << std::endl; } - minimumPeriodThrottleCd.resetTimer(); - } else { - consecutiveNoBlockWriteCounter++; + // minimumPeriodThrottleCd.resetTimer(); } } // Try delete in any case, ignore failures (which should not happen), it is more important to @@ -195,7 +192,7 @@ ReturnValue_t LiveTmTask::handleGenericTmQueue(MessageQueueIF& queue) { void LiveTmTask::throttleCfdp() { throttlePeriodOngoing = true; - minimumPeriodThrottleCd.resetTimer(); + // minimumPeriodThrottleCd.resetTimer(); signals::CFDP_CHANNEL_THROTTLE_SIGNAL = true; } diff --git a/mission/com/LiveTmTask.h b/mission/com/LiveTmTask.h index 121fd44f..41b03ece 100644 --- a/mission/com/LiveTmTask.h +++ b/mission/com/LiveTmTask.h @@ -10,7 +10,9 @@ #include #include #include + #include + #include "eive/definitions.h" class LiveTmTask : public SystemObject, @@ -37,21 +39,20 @@ class LiveTmTask : public SystemObject, ModeHelper modeHelper; Mode_t mode = HasModesIF::MODE_OFF; Countdown tmFunnelCd = Countdown(100); - uint32_t consecutiveNoBlockWriteCounter = 0; PusTmFunnel& pusFunnel; CfdpTmFunnel& cfdpFunnel; VirtualChannel& channel; const std::atomic_bool& ptmeLocked; // This countdown ensures that the CFDP is always throttled with a minimum period. Only after // this period, the CFDP can be released if the channel is not busy. - Countdown minimumPeriodThrottleCd = Countdown(config::CFDP_THROTTLE_PERIOD_MS); + // Countdown minimumPeriodThrottleCd = Countdown(config::CFDP_THROTTLE_PERIOD_MS); bool throttlePeriodOngoing = false; void readCommandQueue(void); ReturnValue_t handleRegularTmQueue(); ReturnValue_t handleCfdpTmQueue(); - ReturnValue_t handleGenericTmQueue(MessageQueueIF& queue); + ReturnValue_t handleGenericTmQueue(MessageQueueIF& queue, bool isCfdp); MessageQueueId_t getCommandQueue() const override; diff --git a/mission/sysDefs.h b/mission/sysDefs.h index b7cbd4e0..8fade60a 100644 --- a/mission/sysDefs.h +++ b/mission/sysDefs.h @@ -15,6 +15,7 @@ namespace signals { extern std::atomic_bool CFDP_CHANNEL_THROTTLE_SIGNAL; extern std::atomic_uint16_t I2C_FATAL_ERRORS; +extern std::atomic_uint32_t CFDP_MSG_COUNTER; } // namespace signals From be1fb22e39141ff8473c72bacf6dbb8c7de8c0d3 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 13 Oct 2023 14:00:44 +0200 Subject: [PATCH 172/257] somethings wrong, i can feel it --- mission/cfdp/CfdpHandler.cpp | 13 +++++++++++-- mission/com/LiveTmTask.cpp | 11 +++++++---- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/mission/cfdp/CfdpHandler.cpp b/mission/cfdp/CfdpHandler.cpp index c1bb3273..2e28aee0 100644 --- a/mission/cfdp/CfdpHandler.cpp +++ b/mission/cfdp/CfdpHandler.cpp @@ -60,7 +60,7 @@ ReturnValue_t CfdpHandler::initialize() { result = handleCfdpMessages(); if (result != OK) { } - uint32_t fsmCount = 0; + uint32_t fsmCount = 1; const DestHandler::FsmResult& destResult = destHandler.stateMachine(); while (destResult.callStatus == CallStatus::CALL_AGAIN) { if (fsmCount == config::CFDP_MAX_FSM_CALL_COUNT_DEST_HANDLER) { @@ -70,7 +70,7 @@ ReturnValue_t CfdpHandler::initialize() { destHandler.stateMachine(); fsmCount++; } - fsmCount = 0; + fsmCount = 1; throttlePeriodOngoing = throttleSignal; @@ -78,6 +78,9 @@ ReturnValue_t CfdpHandler::initialize() { // way without requiring huge amounts of memory for large files. if (!throttlePeriodOngoing) { const SourceHandler::FsmResult& srcResult = srcHandler.stateMachine(); + if (srcResult.packetsSent > 0) { + signals::CFDP_MSG_COUNTER.fetch_add(srcResult.packetsSent, std::memory_order_relaxed); + } while (srcResult.callStatus == CallStatus::CALL_AGAIN) { // Limit number of messages. if (fsmCount == config::CFDP_MAX_FSM_CALL_COUNT_SRC_HANDLER) { @@ -85,6 +88,9 @@ ReturnValue_t CfdpHandler::initialize() { break; } srcHandler.stateMachine(); + if (srcResult.packetsSent > 0) { + signals::CFDP_MSG_COUNTER.fetch_add(srcResult.packetsSent, std::memory_order_relaxed); + } if (srcResult.result == cfdp::TM_STORE_FULL) { sif::warning << "CFDP Source Handler: TM store is full" << std::endl; } else if (srcResult.result == cfdp::TARGET_MSG_QUEUE_FULL) { @@ -92,6 +98,9 @@ ReturnValue_t CfdpHandler::initialize() { } fsmCount++; } + if (signals::CFDP_MSG_COUNTER > 0) { + sif::debug << "CFDP msg count: " << signals::CFDP_MSG_COUNTER << std::endl; + } } if (shortDelay) { TaskFactory::delayTask(config::CFDP_SHORT_DELAY_MS); diff --git a/mission/com/LiveTmTask.cpp b/mission/com/LiveTmTask.cpp index c89369fc..a723daa6 100644 --- a/mission/com/LiveTmTask.cpp +++ b/mission/com/LiveTmTask.cpp @@ -54,6 +54,9 @@ ReturnValue_t LiveTmTask::performOperation(uint8_t opCode) { } } } + if (channel.isBusy()) { + sif::debug << "busy" << std::endl; + } if (channel.isBusy() and !throttlePeriodOngoing) { // Throttle CFDP packet creator. It is by far the most relevant data creator, so throttling // it is the easiest way to handle back pressure for now in a sensible way. @@ -74,10 +77,10 @@ ReturnValue_t LiveTmTask::performOperation(uint8_t opCode) { readCommandQueue(); if (DEBUG_TM_QUEUE_SPEED) { if (consecutiveCfdpCounter > 0) { - sif::debug << "Concecutive CFDP TM handled: " << consecutiveCfdpCounter << std::endl; + sif::debug << "Consecutive CFDP TM handled: " << consecutiveCfdpCounter << std::endl; } if (consecutiveRegularCounter > 0) { - sif::debug << "Concecutive regular TM handled: " << consecutiveRegularCounter + sif::debug << "Consecutive regular TM handled: " << consecutiveRegularCounter << std::endl; } consecutiveRegularCounter = 0; @@ -181,7 +184,6 @@ ReturnValue_t LiveTmTask::handleGenericTmQueue(MessageQueueIF& queue, bool isCfd sif::warning << "LiveTmTask: Synchronous write of last segment failed with code 0x" << std::setw(4) << std::hex << result << std::dec << std::endl; } - // minimumPeriodThrottleCd.resetTimer(); } } // Try delete in any case, ignore failures (which should not happen), it is more important to @@ -192,13 +194,14 @@ ReturnValue_t LiveTmTask::handleGenericTmQueue(MessageQueueIF& queue, bool isCfd void LiveTmTask::throttleCfdp() { throttlePeriodOngoing = true; - // minimumPeriodThrottleCd.resetTimer(); signals::CFDP_CHANNEL_THROTTLE_SIGNAL = true; + sif::debug << "throttling CFDP" << std::endl; } void LiveTmTask::releaseCfdp() { throttlePeriodOngoing = false; signals::CFDP_CHANNEL_THROTTLE_SIGNAL = false; + sif::debug << "releasing CFDP" << std::endl; } ModeTreeChildIF& LiveTmTask::getModeTreeChildIF() { return *this; } From 2279eab5e764e73b81560a54827010279f962460 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 13 Oct 2023 14:20:50 +0200 Subject: [PATCH 173/257] maybe this works better? --- mission/com/LiveTmTask.cpp | 17 +++++++++++++---- mission/com/LiveTmTask.h | 2 ++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/mission/com/LiveTmTask.cpp b/mission/com/LiveTmTask.cpp index a723daa6..5b337030 100644 --- a/mission/com/LiveTmTask.cpp +++ b/mission/com/LiveTmTask.cpp @@ -37,7 +37,8 @@ ReturnValue_t LiveTmTask::performOperation(uint8_t opCode) { // TODO: Must read CFDP TM queue and regular TM queue and forward them. Handle regular queue // first. handledTm = false; - if (!channel.isBusy()) { + updateBusyFlag(); + if (!channelIsBusy) { result = handleRegularTmQueue(); if (result == MessageQueueIF::EMPTY) { result = handleCfdpTmQueue(); @@ -54,14 +55,14 @@ ReturnValue_t LiveTmTask::performOperation(uint8_t opCode) { } } } - if (channel.isBusy()) { + if (channelIsBusy) { sif::debug << "busy" << std::endl; } - if (channel.isBusy() and !throttlePeriodOngoing) { + if (channelIsBusy and !throttlePeriodOngoing) { // Throttle CFDP packet creator. It is by far the most relevant data creator, so throttling // it is the easiest way to handle back pressure for now in a sensible way. throttleCfdp(); - } else if (!channel.isBusy() and throttlePeriodOngoing) { + } else if (!channelIsBusy and throttlePeriodOngoing) { // Half full/empty flow control: Release the CFDP is the queue is empty enough. if (signals::CFDP_MSG_COUNTER <= config::LIVE_CHANNEL_CFDP_QUEUE_SIZE / 2) { releaseCfdp(); @@ -184,6 +185,9 @@ ReturnValue_t LiveTmTask::handleGenericTmQueue(MessageQueueIF& queue, bool isCfd sif::warning << "LiveTmTask: Synchronous write of last segment failed with code 0x" << std::setw(4) << std::hex << result << std::dec << std::endl; } + // This is a bit of a hack: If a partial write was performed and synchronously finished, we + // treat this like a busy channel. + channelIsBusy = true; } } // Try delete in any case, ignore failures (which should not happen), it is more important to @@ -204,6 +208,11 @@ void LiveTmTask::releaseCfdp() { sif::debug << "releasing CFDP" << std::endl; } +void LiveTmTask::updateBusyFlag() { + // We cache this as a member, because the busy bit can toggle very quickly.. + channelIsBusy = channel.isBusy(); +} + ModeTreeChildIF& LiveTmTask::getModeTreeChildIF() { return *this; } ReturnValue_t LiveTmTask::initialize() { diff --git a/mission/com/LiveTmTask.h b/mission/com/LiveTmTask.h index 41b03ece..0727bad1 100644 --- a/mission/com/LiveTmTask.h +++ b/mission/com/LiveTmTask.h @@ -47,6 +47,7 @@ class LiveTmTask : public SystemObject, // this period, the CFDP can be released if the channel is not busy. // Countdown minimumPeriodThrottleCd = Countdown(config::CFDP_THROTTLE_PERIOD_MS); bool throttlePeriodOngoing = false; + bool channelIsBusy = false; void readCommandQueue(void); @@ -66,6 +67,7 @@ class LiveTmTask : public SystemObject, void announceMode(bool recursive) override; void throttleCfdp(); void releaseCfdp(); + void updateBusyFlag(); object_id_t getObjectId() const override; const HasHealthIF* getOptHealthIF() const override; From 4431883b4ddd982dff6bd1ce446e6a048d7afce0 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 13 Oct 2023 15:10:52 +0200 Subject: [PATCH 174/257] okay, PAPB IF caches packet now --- bsp_q7s/objectFactory.cpp | 20 ++++++---- common/config/eive/definitions.h | 2 + linux/ipcore/PapbVcInterface.cpp | 51 +++++++++++++------------ linux/ipcore/PapbVcInterface.h | 15 +++++--- mission/com/LiveTmTask.cpp | 12 +++--- mission/com/TmStoreTaskBase.cpp | 7 ++-- mission/com/VirtualChannel.cpp | 21 ++++++---- mission/com/VirtualChannel.h | 6 +-- mission/com/VirtualChannelWithQueue.cpp | 6 +-- mission/tmtc/DirectTmSinkIF.h | 3 +- 10 files changed, 80 insertions(+), 63 deletions(-) diff --git a/bsp_q7s/objectFactory.cpp b/bsp_q7s/objectFactory.cpp index 211aa071..c8e6f555 100644 --- a/bsp_q7s/objectFactory.cpp +++ b/bsp_q7s/objectFactory.cpp @@ -750,14 +750,18 @@ ReturnValue_t ObjectFactory::createCcsdsComponents(CcsdsComponentArgs& args) { gpioChecker(args.gpioComIF.addGpios(gpioCookiePtmeIp), "PTME PAPB VCs"); // Creating virtual channel interfaces - VirtualChannelIF* vc0 = new PapbVcInterface(&args.gpioComIF, gpioIds::VC0_PAPB_EMPTY, - q7s::UIO_PTME, q7s::uiomapids::PTME_VC0); - VirtualChannelIF* vc1 = new PapbVcInterface(&args.gpioComIF, gpioIds::VC1_PAPB_EMPTY, - q7s::UIO_PTME, q7s::uiomapids::PTME_VC1); - VirtualChannelIF* vc2 = new PapbVcInterface(&args.gpioComIF, gpioIds::VC2_PAPB_EMPTY, - q7s::UIO_PTME, q7s::uiomapids::PTME_VC2); - VirtualChannelIF* vc3 = new PapbVcInterface(&args.gpioComIF, gpioIds::VC3_PAPB_EMPTY, - q7s::UIO_PTME, q7s::uiomapids::PTME_VC3); + VirtualChannelIF* vc0 = + new PapbVcInterface(&args.gpioComIF, gpioIds::VC0_PAPB_EMPTY, q7s::UIO_PTME, + q7s::uiomapids::PTME_VC0, config::MAX_SPACEPACKET_TC_SIZE); + VirtualChannelIF* vc1 = + new PapbVcInterface(&args.gpioComIF, gpioIds::VC1_PAPB_EMPTY, q7s::UIO_PTME, + q7s::uiomapids::PTME_VC1, config::MAX_SPACEPACKET_TC_SIZE); + VirtualChannelIF* vc2 = + new PapbVcInterface(&args.gpioComIF, gpioIds::VC2_PAPB_EMPTY, q7s::UIO_PTME, + q7s::uiomapids::PTME_VC2, config::MAX_SPACEPACKET_TC_SIZE); + VirtualChannelIF* vc3 = + new PapbVcInterface(&args.gpioComIF, gpioIds::VC3_PAPB_EMPTY, q7s::UIO_PTME, + q7s::uiomapids::PTME_VC3, config::MAX_SPACEPACKET_TC_SIZE); // Creating ptme object and adding virtual channel interfaces Ptme* ptme = new Ptme(objects::PTME); ptme->addVcInterface(ccsds::VC0, vc0); diff --git a/common/config/eive/definitions.h b/common/config/eive/definitions.h index 777e8924..ee1fd5b7 100644 --- a/common/config/eive/definitions.h +++ b/common/config/eive/definitions.h @@ -35,6 +35,8 @@ static constexpr uint32_t STR_IMG_HELPER_QUEUE_SIZE = 50; static constexpr uint8_t LIVE_TM = 0; +static constexpr size_t MAX_SPACEPACKET_TC_SIZE = 2048; + /* Limits for filename and path checks */ static constexpr uint32_t MAX_PATH_SIZE = 200; static constexpr uint32_t MAX_FILENAME_SIZE = 100; diff --git a/linux/ipcore/PapbVcInterface.cpp b/linux/ipcore/PapbVcInterface.cpp index 88684772..d5207c0b 100644 --- a/linux/ipcore/PapbVcInterface.cpp +++ b/linux/ipcore/PapbVcInterface.cpp @@ -8,8 +8,12 @@ #include "fsfw/serviceinterface/ServiceInterface.h" PapbVcInterface::PapbVcInterface(LinuxLibgpioIF* gpioComIF, gpioId_t papbEmptyId, - std::string uioFile, int mapNum) - : gpioComIF(gpioComIF), papbEmptyId(papbEmptyId), uioFile(std::move(uioFile)), mapNum(mapNum) {} + std::string uioFile, int mapNum, size_t maxPacketSize) + : gpioComIF(gpioComIF), + papbEmptyId(papbEmptyId), + packetBuf(maxPacketSize), + uioFile(std::move(uioFile)), + mapNum(mapNum) {} PapbVcInterface::~PapbVcInterface() {} @@ -29,9 +33,17 @@ ReturnValue_t PapbVcInterface::write(const uint8_t* data, size_t size, size_t& w return returnvalue::FAILED; } // The user must call finishWrite before starting a new packet transfer. - if (partialWriteActive) { - return INCOMPLETE_PARTIAL_WRITE; + if (writeActive) { + return IS_BUSY; } + if (size > packetBuf.capacity()) { + sif::error << "PapbVcInterface: Packet with size " << size << " larger than maximum configured" + << " byte size " << packetBuf.capacity() << std::endl; + return returnvalue::FAILED; + } + std::memcpy(packetBuf.data(), data, size); + currentPacketSize = size; + currentPacketIndex = 0; if (pollReadyForPacket()) { startPacketTransfer(ByteWidthCfg::ONE); } else { @@ -41,14 +53,17 @@ ReturnValue_t PapbVcInterface::write(const uint8_t* data, size_t size, size_t& w abortPacketTransfer(); return returnvalue::FAILED; } - return finishWriteInternal(data, 0, size, writtenSize, false); + return advanceWrite(writtenSize); } void PapbVcInterface::startPacketTransfer(ByteWidthCfg initWidth) { *vcBaseReg = CONFIG_DATA_INPUT | initWidth; } -void PapbVcInterface::completePacketTransfer() { *vcBaseReg = CONFIG_END; } +void PapbVcInterface::completePacketTransfer() { + *vcBaseReg = CONFIG_END; + writeActive = false; +} bool PapbVcInterface::pollReadyForPacket() const { // Check if PAPB interface is ready to receive data. Use the configuration register for this. @@ -57,34 +72,20 @@ bool PapbVcInterface::pollReadyForPacket() const { return (reg >> 6) & 0b1; } -ReturnValue_t PapbVcInterface::finishWrite(const uint8_t* data, size_t start, - size_t remainingSize) { +ReturnValue_t PapbVcInterface::advanceWrite(size_t& writtenSize) { if (not pollReadyForPacket()) { - return returnvalue::FAILED; + return IS_BUSY; } - size_t dummy = 0; - return finishWriteInternal(data, start, remainingSize, dummy, true); -} - -ReturnValue_t PapbVcInterface::finishWriteInternal(const uint8_t* data, size_t start, - size_t remainingSize, size_t& writtenSize, - bool abortOnPartialWrite) { - for (size_t idx = 0; idx < remainingSize; idx++) { + for (size_t idx = currentPacketIndex; idx < currentPacketSize; idx++) { if (not pollReadyForOctet(MAX_BUSY_POLLS)) { if (not pollReadyForPacket()) { - writtenSize = start + idx; - partialWriteActive = true; - if (abortOnPartialWrite) { - abortPacketTransfer(); - partialWriteActive = false; - return returnvalue::FAILED; - } return PARTIALLY_WRITTEN; } abortPacketTransfer(); return returnvalue::FAILED; } - *(vcBaseReg + DATA_REG_OFFSET) = static_cast(data[start + idx]); + *(vcBaseReg + DATA_REG_OFFSET) = static_cast(packetBuf[currentPacketIndex]); + writtenSize++; } if (not pollReadyForOctet(MAX_BUSY_POLLS)) { abortPacketTransfer(); diff --git a/linux/ipcore/PapbVcInterface.h b/linux/ipcore/PapbVcInterface.h index 35bd0439..eb707b62 100644 --- a/linux/ipcore/PapbVcInterface.h +++ b/linux/ipcore/PapbVcInterface.h @@ -6,6 +6,7 @@ #include #include +#include #include "OBSWConfig.h" #include "fsfw/returnvalues/returnvalue.h" @@ -30,7 +31,8 @@ class PapbVcInterface : public VirtualChannelIF { * @param uioFile UIO file providing access to the PAPB bus * @param mapNum Map number of UIO map associated with this virtual channel */ - PapbVcInterface(LinuxLibgpioIF* gpioComIF, gpioId_t papbEmptyId, std::string uioFile, int mapNum); + PapbVcInterface(LinuxLibgpioIF* gpioComIF, gpioId_t papbEmptyId, std::string uioFile, int mapNum, + size_t maxPacketSize); virtual ~PapbVcInterface(); bool isBusy() const override; @@ -42,9 +44,9 @@ class PapbVcInterface : public VirtualChannelIF { */ ReturnValue_t write(const uint8_t* data, size_t size, size_t& writtenSize) override; - ReturnValue_t finishWrite(const uint8_t* data, size_t start, size_t remainingSize) override; - ReturnValue_t finishWriteInternal(const uint8_t* data, size_t start, size_t remainingSize, - size_t& writtenSize, bool abortOnPartialWrite); + ReturnValue_t advanceWrite(size_t& remainingSize) override; + // ReturnValue_t finishWriteInternal(const uint8_t* data, size_t start, size_t remainingSize, + // size_t& writtenSize, bool abortOnPartialWrite); void cancelTransfer() override; @@ -90,9 +92,12 @@ class PapbVcInterface : public VirtualChannelIF { /** High when external buffer memory of virtual channel is empty */ gpioId_t papbEmptyId = gpio::NO_GPIO; + std::vector packetBuf; std::string uioFile; int mapNum = 0; - bool partialWriteActive = false; + bool writeActive = false; + size_t currentPacketIndex = 0; + size_t currentPacketSize = 0; mutable struct timespec nextDelay = {.tv_sec = 0, .tv_nsec = 0}; const struct timespec BETWEEN_POLL_DELAY = {.tv_sec = 0, .tv_nsec = 10}; mutable struct timespec remDelay; diff --git a/mission/com/LiveTmTask.cpp b/mission/com/LiveTmTask.cpp index 5b337030..15630be5 100644 --- a/mission/com/LiveTmTask.cpp +++ b/mission/com/LiveTmTask.cpp @@ -53,11 +53,11 @@ ReturnValue_t LiveTmTask::performOperation(uint8_t opCode) { consecutiveRegularCounter++; } } + } else if (result != MessageQueueIF::EMPTY) { + sif::warning << "LiveTmTask: TM queue failure, returncode 0x" << std::hex << std::setw(4) + << result << std::dec << std::endl; } } - if (channelIsBusy) { - sif::debug << "busy" << std::endl; - } if (channelIsBusy and !throttlePeriodOngoing) { // Throttle CFDP packet creator. It is by far the most relevant data creator, so throttling // it is the easiest way to handle back pressure for now in a sensible way. @@ -174,12 +174,12 @@ ReturnValue_t LiveTmTask::handleGenericTmQueue(MessageQueueIF& queue, bool isCfd } if (!ptmeLocked) { - size_t partiallyWrittenSize = 0; - result = channel.write(data, size, partiallyWrittenSize); + size_t writtenSize = 0; + result = channel.write(data, size, writtenSize); if (result == DirectTmSinkIF::PARTIALLY_WRITTEN) { // Already throttle CFDP. throttleCfdp(); - result = channel.handleLastWriteSynchronously(data, size, partiallyWrittenSize, 200); + result = channel.handleWriteCompletionSynchronously(writtenSize, 200); if (result != returnvalue::OK) { // TODO: Event? Might lead to dangerous spam though.. sif::warning << "LiveTmTask: Synchronous write of last segment failed with code 0x" diff --git a/mission/com/TmStoreTaskBase.cpp b/mission/com/TmStoreTaskBase.cpp index c51d6f9b..215cef08 100644 --- a/mission/com/TmStoreTaskBase.cpp +++ b/mission/com/TmStoreTaskBase.cpp @@ -138,11 +138,10 @@ ReturnValue_t TmStoreTaskBase::performDump(PersistentTmStoreWithTmQueue& store, return result; } dumpedLen = tmReader.getFullPacketLen(); - size_t partiallyWrittenSize = 0; - result = channel.write(tmReader.getFullData(), dumpedLen, partiallyWrittenSize); + size_t writtenSize = 0; + result = channel.write(tmReader.getFullData(), dumpedLen, writtenSize); if (result == VirtualChannelIF::PARTIALLY_WRITTEN) { - result = channel.handleLastWriteSynchronously(tmReader.getFullData(), partiallyWrittenSize, - dumpedLen - partiallyWrittenSize, 200); + result = channel.handleWriteCompletionSynchronously(writtenSize, 200); if (result != returnvalue::OK) { // TODO: Event? Might lead to dangerous spam though.. sif::warning << "PersistentTmStore: Synchronous write of last segment failed with code 0x" diff --git a/mission/com/VirtualChannel.cpp b/mission/com/VirtualChannel.cpp index 7ada00aa..d6d792f4 100644 --- a/mission/com/VirtualChannel.cpp +++ b/mission/com/VirtualChannel.cpp @@ -21,11 +21,11 @@ ReturnValue_t VirtualChannel::write(const uint8_t* data, size_t size, size_t& wr uint8_t VirtualChannel::getVcid() const { return vcId; } -ReturnValue_t VirtualChannel::finishWrite(const uint8_t* data, size_t start, size_t remainingSize) { +ReturnValue_t VirtualChannel::advanceWrite(size_t& writtenSize) { if (!ptme.containsVc(vcId)) { return CHANNEL_DOES_NOT_EXIST; } - return ptme.getVirtChannel(vcId)->finishWrite(data, start, remainingSize); + return ptme.getVirtChannel(vcId)->advanceWrite(writtenSize); } const char* VirtualChannel::getName() const { return vcName.c_str(); } @@ -46,20 +46,27 @@ void VirtualChannel::cancelTransfer() { bool VirtualChannel::isTxOn() const { return txOn; } -ReturnValue_t VirtualChannel::handleLastWriteSynchronously(const uint8_t* data, size_t start, - size_t remLen, unsigned maxDelayMs) { +ReturnValue_t VirtualChannel::handleWriteCompletionSynchronously(size_t& writtenSize, + unsigned maxCompletionTimeMs) { unsigned delayMs = 0; while (true) { if (isBusy()) { - if (delayMs >= maxDelayMs) { + if (delayMs >= maxCompletionTimeMs) { break; } TaskFactory::delayTask(10); delayMs += 10; continue; } - sif::debug << "last write after" << delayMs << std::endl; - return finishWrite(data, start, remLen); + ReturnValue_t result = advanceWrite(writtenSize); + if (result == returnvalue::OK) { + sif::debug << "last write after" << delayMs << std::endl; + // Transfer complete + return result; + } else if (result != PARTIALLY_WRITTEN) { + // Some error where we can not or should not continue the transfer. + return result; + } } return returnvalue::FAILED; } diff --git a/mission/com/VirtualChannel.h b/mission/com/VirtualChannel.h index 3d61bd13..d8ac0228 100644 --- a/mission/com/VirtualChannel.h +++ b/mission/com/VirtualChannel.h @@ -32,9 +32,9 @@ class VirtualChannel : public SystemObject, public VirtualChannelIF { ReturnValue_t sendNextTm(const uint8_t* data, size_t size, size_t& writtenSize); bool isBusy() const override; ReturnValue_t write(const uint8_t* data, size_t size, size_t& writtenSize) override; - ReturnValue_t finishWrite(const uint8_t* data, size_t start, size_t remainingSize) override; - ReturnValue_t handleLastWriteSynchronously(const uint8_t* data, size_t start, size_t remLen, - unsigned maxDelayMs); + ReturnValue_t advanceWrite(size_t& writtenSize) override; + ReturnValue_t handleWriteCompletionSynchronously(size_t& writtenSize, + unsigned maxCompletionTimeMs); void cancelTransfer() override; uint8_t getVcid() const; bool isTxOn() const; diff --git a/mission/com/VirtualChannelWithQueue.cpp b/mission/com/VirtualChannelWithQueue.cpp index 53f2ee52..0d9e4d11 100644 --- a/mission/com/VirtualChannelWithQueue.cpp +++ b/mission/com/VirtualChannelWithQueue.cpp @@ -37,11 +37,11 @@ ReturnValue_t VirtualChannelWithQueue::handleNextTm(bool performWriteOp) { } // TODO: Hnadle partial write handling - size_t partiallyWrittenSize = 0; + size_t writtenSize = 0; if (performWriteOp) { - result = write(data, size, partiallyWrittenSize); + result = write(data, size, writtenSize); if (result == PARTIALLY_WRITTEN) { - result = handleLastWriteSynchronously(data, size, partiallyWrittenSize, 200); + result = handleWriteCompletionSynchronously(writtenSize, 200); if (result != returnvalue::OK) { // TODO: Event? Might lead to dangerous spam though.. sif::warning diff --git a/mission/tmtc/DirectTmSinkIF.h b/mission/tmtc/DirectTmSinkIF.h index e1fcf54f..f5b43039 100644 --- a/mission/tmtc/DirectTmSinkIF.h +++ b/mission/tmtc/DirectTmSinkIF.h @@ -14,7 +14,6 @@ class DirectTmSinkIF { static constexpr ReturnValue_t IS_BUSY = returnvalue::makeCode(CLASS_ID, 0); static constexpr ReturnValue_t PARTIALLY_WRITTEN = returnvalue::makeCode(CLASS_ID, 1); - static constexpr ReturnValue_t INCOMPLETE_PARTIAL_WRITE = returnvalue::makeCode(CLASS_ID, 2); /** * @brief Implements the functionality to write to a TM sink directly @@ -27,7 +26,7 @@ class DirectTmSinkIF { */ virtual ReturnValue_t write(const uint8_t* data, size_t size, size_t& writtenSize) = 0; - virtual ReturnValue_t finishWrite(const uint8_t* data, size_t start, size_t remainingSize) = 0; + virtual ReturnValue_t advanceWrite(size_t& writtenSize) = 0; virtual bool isBusy() const = 0; }; From b8beddc11b2ff7779d6ba1c7b51ccbf5fabb6a2f Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 13 Oct 2023 15:24:06 +0200 Subject: [PATCH 175/257] gens --- .../fsfwconfig/events/translateEvents.cpp | 2 +- .../fsfwconfig/objects/translateObjects.cpp | 2 +- generators/bsp_hosted_returnvalues.csv | 2 +- generators/bsp_q7s_returnvalues.csv | 2 +- generators/events/translateEvents.cpp | 2 +- generators/objects/translateObjects.cpp | 2 +- linux/fsfwconfig/events/translateEvents.cpp | 2 +- linux/fsfwconfig/objects/translateObjects.cpp | 2 +- linux/ipcore/PapbVcInterface.cpp | 28 +++++++++++++------ linux/ipcore/PapbVcInterface.h | 5 ++-- mission/com/VirtualChannel.cpp | 7 +++++ mission/com/VirtualChannel.h | 1 + mission/tmtc/DirectTmSinkIF.h | 25 ++++++++++++++--- tmtc | 2 +- 14 files changed, 61 insertions(+), 23 deletions(-) diff --git a/bsp_hosted/fsfwconfig/events/translateEvents.cpp b/bsp_hosted/fsfwconfig/events/translateEvents.cpp index 56112520..7c04e9f5 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. * @details - * Generated on: 2023-10-13 09:44:05 + * Generated on: 2023-10-13 15:23:30 */ #include "translateEvents.h" diff --git a/bsp_hosted/fsfwconfig/objects/translateObjects.cpp b/bsp_hosted/fsfwconfig/objects/translateObjects.cpp index 7916bfeb..5cb8e295 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 174 translations. - * Generated on: 2023-10-13 09:44:05 + * Generated on: 2023-10-13 15:23:30 */ #include "translateObjects.h" diff --git a/generators/bsp_hosted_returnvalues.csv b/generators/bsp_hosted_returnvalues.csv index e8d79402..1964e00e 100644 --- a/generators/bsp_hosted_returnvalues.csv +++ b/generators/bsp_hosted_returnvalues.csv @@ -521,5 +521,5 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x6e01;PTM_BusyDumping;No description;1;PERSISTENT_TM_STORE;mission/tmtc/PersistentTmStore.h 0x6f00;TMS_IsBusy;No description;0;TM_SINK;mission/tmtc/DirectTmSinkIF.h 0x6f01;TMS_PartiallyWritten;No description;1;TM_SINK;mission/tmtc/DirectTmSinkIF.h -0x6f02;TMS_IncompletePartialWrite;No description;2;TM_SINK;mission/tmtc/DirectTmSinkIF.h +0x6f02;TMS_NoWriteActive;No description;2;TM_SINK;mission/tmtc/DirectTmSinkIF.h 0x7000;VCS_ChannelDoesNotExist;No description;0;VIRTUAL_CHANNEL;mission/com/VirtualChannel.h diff --git a/generators/bsp_q7s_returnvalues.csv b/generators/bsp_q7s_returnvalues.csv index 0d08c2b7..9aa12b12 100644 --- a/generators/bsp_q7s_returnvalues.csv +++ b/generators/bsp_q7s_returnvalues.csv @@ -616,6 +616,6 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x6e01;PTM_BusyDumping;No description;1;PERSISTENT_TM_STORE;mission/tmtc/PersistentTmStore.h 0x6f00;TMS_IsBusy;No description;0;TM_SINK;mission/tmtc/DirectTmSinkIF.h 0x6f01;TMS_PartiallyWritten;No description;1;TM_SINK;mission/tmtc/DirectTmSinkIF.h -0x6f02;TMS_IncompletePartialWrite;No description;2;TM_SINK;mission/tmtc/DirectTmSinkIF.h +0x6f02;TMS_NoWriteActive;No description;2;TM_SINK;mission/tmtc/DirectTmSinkIF.h 0x7000;VCS_ChannelDoesNotExist;No description;0;VIRTUAL_CHANNEL;mission/com/VirtualChannel.h 0x7200;SCBU_KeyNotFound;No description;0;SCRATCH_BUFFER;bsp_q7s/memory/scratchApi.h diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index 56112520..7c04e9f5 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 314 translations. * @details - * Generated on: 2023-10-13 09:44:05 + * Generated on: 2023-10-13 15:23:30 */ #include "translateEvents.h" diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index 96e07335..5b99d6f0 100644 --- a/generators/objects/translateObjects.cpp +++ b/generators/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 178 translations. - * Generated on: 2023-10-13 09:44:05 + * Generated on: 2023-10-13 15:23:30 */ #include "translateObjects.h" diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index 56112520..7c04e9f5 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. * @details - * Generated on: 2023-10-13 09:44:05 + * Generated on: 2023-10-13 15:23:30 */ #include "translateEvents.h" diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index 96e07335..5b99d6f0 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 178 translations. - * Generated on: 2023-10-13 09:44:05 + * Generated on: 2023-10-13 15:23:30 */ #include "translateObjects.h" diff --git a/linux/ipcore/PapbVcInterface.cpp b/linux/ipcore/PapbVcInterface.cpp index d5207c0b..239ed091 100644 --- a/linux/ipcore/PapbVcInterface.cpp +++ b/linux/ipcore/PapbVcInterface.cpp @@ -32,8 +32,8 @@ ReturnValue_t PapbVcInterface::write(const uint8_t* data, size_t size, size_t& w if (size < 4) { return returnvalue::FAILED; } - // The user must call finishWrite before starting a new packet transfer. - if (writeActive) { + // The user must call advance until completion before starting a new packet transfer. + if (writeActiveStatus) { return IS_BUSY; } if (size > packetBuf.capacity()) { @@ -60,11 +60,6 @@ void PapbVcInterface::startPacketTransfer(ByteWidthCfg initWidth) { *vcBaseReg = CONFIG_DATA_INPUT | initWidth; } -void PapbVcInterface::completePacketTransfer() { - *vcBaseReg = CONFIG_END; - writeActive = false; -} - bool PapbVcInterface::pollReadyForPacket() const { // Check if PAPB interface is ready to receive data. Use the configuration register for this. // Bit 5, see PTME ptme_001_01-0-7-r2 Table 31. @@ -73,6 +68,9 @@ bool PapbVcInterface::pollReadyForPacket() const { } ReturnValue_t PapbVcInterface::advanceWrite(size_t& writtenSize) { + if (!writeActiveStatus) { + return NO_WRITE_ACTIVE; + } if (not pollReadyForPacket()) { return IS_BUSY; } @@ -95,6 +93,8 @@ ReturnValue_t PapbVcInterface::advanceWrite(size_t& writtenSize) { return returnvalue::OK; } +bool PapbVcInterface::writeActive() const { return writeActiveStatus; } + bool PapbVcInterface::isVcInterfaceBufferEmpty() { ReturnValue_t result = returnvalue::OK; gpio::Levels papbEmptyState = gpio::Levels::HIGH; @@ -131,4 +131,16 @@ inline bool PapbVcInterface::pollReadyForOctet(uint32_t maxCycles) const { return false; } -void PapbVcInterface::abortPacketTransfer() { *vcBaseReg = CONFIG_ABORT; } +void PapbVcInterface::abortPacketTransfer() { + *vcBaseReg = CONFIG_ABORT; + writeActiveStatus = false; + currentPacketIndex = 0; + currentPacketSize = 0; +} + +void PapbVcInterface::completePacketTransfer() { + *vcBaseReg = CONFIG_END; + writeActiveStatus = false; + currentPacketIndex = 0; + currentPacketSize = 0; +} diff --git a/linux/ipcore/PapbVcInterface.h b/linux/ipcore/PapbVcInterface.h index eb707b62..bcda5709 100644 --- a/linux/ipcore/PapbVcInterface.h +++ b/linux/ipcore/PapbVcInterface.h @@ -50,6 +50,8 @@ class PapbVcInterface : public VirtualChannelIF { void cancelTransfer() override; + bool writeActive() const override; + ReturnValue_t initialize() override; private: @@ -95,12 +97,11 @@ class PapbVcInterface : public VirtualChannelIF { std::vector packetBuf; std::string uioFile; int mapNum = 0; - bool writeActive = false; + bool writeActiveStatus = false; size_t currentPacketIndex = 0; size_t currentPacketSize = 0; mutable struct timespec nextDelay = {.tv_sec = 0, .tv_nsec = 0}; const struct timespec BETWEEN_POLL_DELAY = {.tv_sec = 0, .tv_nsec = 10}; - mutable struct timespec remDelay; volatile uint32_t* vcBaseReg = nullptr; diff --git a/mission/com/VirtualChannel.cpp b/mission/com/VirtualChannel.cpp index d6d792f4..93c83eeb 100644 --- a/mission/com/VirtualChannel.cpp +++ b/mission/com/VirtualChannel.cpp @@ -28,6 +28,13 @@ ReturnValue_t VirtualChannel::advanceWrite(size_t& writtenSize) { return ptme.getVirtChannel(vcId)->advanceWrite(writtenSize); } +bool VirtualChannel::writeActive() const { + if (!ptme.containsVc(vcId)) { + return CHANNEL_DOES_NOT_EXIST; + } + return ptme.getVirtChannel(vcId)->writeActive(); +} + const char* VirtualChannel::getName() const { return vcName.c_str(); } bool VirtualChannel::isBusy() const { diff --git a/mission/com/VirtualChannel.h b/mission/com/VirtualChannel.h index d8ac0228..84cdafb3 100644 --- a/mission/com/VirtualChannel.h +++ b/mission/com/VirtualChannel.h @@ -35,6 +35,7 @@ class VirtualChannel : public SystemObject, public VirtualChannelIF { ReturnValue_t advanceWrite(size_t& writtenSize) override; ReturnValue_t handleWriteCompletionSynchronously(size_t& writtenSize, unsigned maxCompletionTimeMs); + bool writeActive() const override; void cancelTransfer() override; uint8_t getVcid() const; bool isTxOn() const; diff --git a/mission/tmtc/DirectTmSinkIF.h b/mission/tmtc/DirectTmSinkIF.h index f5b43039..6ac182d2 100644 --- a/mission/tmtc/DirectTmSinkIF.h +++ b/mission/tmtc/DirectTmSinkIF.h @@ -14,21 +14,38 @@ class DirectTmSinkIF { static constexpr ReturnValue_t IS_BUSY = returnvalue::makeCode(CLASS_ID, 0); static constexpr ReturnValue_t PARTIALLY_WRITTEN = returnvalue::makeCode(CLASS_ID, 1); + static constexpr ReturnValue_t NO_WRITE_ACTIVE = returnvalue::makeCode(CLASS_ID, 2); /** - * @brief Implements the functionality to write to a TM sink directly + * @brief Implements the functionality to write to a TM sink directly. + * + * The write might not be completed immediately! If PARTIALLY_WRITTEN is returned, the user + * should poll the ready for packet status bit and call @advanceWrite continuously until + * the transfer is completed. * * @param data Pointer to buffer holding the data to write * @param size Number of bytes to write - * @return returnvalue::OK on success, returnvalue::FAILED on failure, IS_BUSY - * if the TM sink is busy, PARTIALLY_WRITTEN if only a portion of the bytes could be - * written. + * @param writtenSize Size written during write call. + * @return returnvalue::OK on full write success, IS_BUSY if a previous write transfer has not + * been completed yet or the PAPB interface is not ready for a packet, PARTIALLY_WRITTEN + * if some bytes were written, but the transfer has not been completed yet. */ virtual ReturnValue_t write(const uint8_t* data, size_t size, size_t& writtenSize) = 0; + /** + * Advances a active file transfer. + * @param writtenSize + * @return returnvalue::OK if the packet write process is complete, PARTIALLY_WRITTEN if + * some bytes were written but the transfer is not complete yet. + */ virtual ReturnValue_t advanceWrite(size_t& writtenSize) = 0; virtual bool isBusy() const = 0; + /** + * The PAPB interface is currently busy writing a packet and a new packet can not be written yet. + * @return + */ + virtual bool writeActive() const = 0; }; #endif /* MISSION_TMTC_DIRECTTMSINKIF_H_ */ diff --git a/tmtc b/tmtc index 10e163be..60f7ae54 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 10e163be752a6a259b6d3dabea825acc9c9725f8 +Subproject commit 60f7ae5453b387ee5ebcf6a338c34284004dbce7 From 2f25ac8e7d1997637f6c1bbd74724c180b58b378 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 13 Oct 2023 16:25:40 +0200 Subject: [PATCH 176/257] remove old printouts --- common/config/eive/definitions.h | 3 +-- linux/ipcore/PapbVcInterface.cpp | 1 + mission/cfdp/CfdpHandler.cpp | 3 --- mission/com/LiveTmTask.cpp | 2 -- mission/com/VirtualChannel.cpp | 1 - 5 files changed, 2 insertions(+), 8 deletions(-) diff --git a/common/config/eive/definitions.h b/common/config/eive/definitions.h index ee1fd5b7..9274878f 100644 --- a/common/config/eive/definitions.h +++ b/common/config/eive/definitions.h @@ -65,8 +65,7 @@ static constexpr uint32_t CFDP_STORE_QUEUE_SIZE = 300; static constexpr uint32_t LIVE_CHANNEL_NORMAL_QUEUE_SIZE = 250; static constexpr uint32_t LIVE_CHANNEL_CFDP_QUEUE_SIZE = 400; -static constexpr uint32_t CFDP_THROTTLE_PERIOD_MS = 200; -static constexpr uint32_t CFDP_MAX_FSM_CALL_COUNT_SRC_HANDLER = 20; +static constexpr uint32_t CFDP_MAX_FSM_CALL_COUNT_SRC_HANDLER = 60; static constexpr uint32_t CFDP_MAX_FSM_CALL_COUNT_DEST_HANDLER = 300; static constexpr uint32_t CFDP_SHORT_DELAY_MS = 50; static constexpr uint32_t CFDP_REGULAR_DELAY_MS = 200; diff --git a/linux/ipcore/PapbVcInterface.cpp b/linux/ipcore/PapbVcInterface.cpp index 239ed091..bc324489 100644 --- a/linux/ipcore/PapbVcInterface.cpp +++ b/linux/ipcore/PapbVcInterface.cpp @@ -58,6 +58,7 @@ ReturnValue_t PapbVcInterface::write(const uint8_t* data, size_t size, size_t& w void PapbVcInterface::startPacketTransfer(ByteWidthCfg initWidth) { *vcBaseReg = CONFIG_DATA_INPUT | initWidth; + writeActiveStatus = true; } bool PapbVcInterface::pollReadyForPacket() const { diff --git a/mission/cfdp/CfdpHandler.cpp b/mission/cfdp/CfdpHandler.cpp index 2e28aee0..bb98b946 100644 --- a/mission/cfdp/CfdpHandler.cpp +++ b/mission/cfdp/CfdpHandler.cpp @@ -98,9 +98,6 @@ ReturnValue_t CfdpHandler::initialize() { } fsmCount++; } - if (signals::CFDP_MSG_COUNTER > 0) { - sif::debug << "CFDP msg count: " << signals::CFDP_MSG_COUNTER << std::endl; - } } if (shortDelay) { TaskFactory::delayTask(config::CFDP_SHORT_DELAY_MS); diff --git a/mission/com/LiveTmTask.cpp b/mission/com/LiveTmTask.cpp index 15630be5..78382168 100644 --- a/mission/com/LiveTmTask.cpp +++ b/mission/com/LiveTmTask.cpp @@ -199,13 +199,11 @@ ReturnValue_t LiveTmTask::handleGenericTmQueue(MessageQueueIF& queue, bool isCfd void LiveTmTask::throttleCfdp() { throttlePeriodOngoing = true; signals::CFDP_CHANNEL_THROTTLE_SIGNAL = true; - sif::debug << "throttling CFDP" << std::endl; } void LiveTmTask::releaseCfdp() { throttlePeriodOngoing = false; signals::CFDP_CHANNEL_THROTTLE_SIGNAL = false; - sif::debug << "releasing CFDP" << std::endl; } void LiveTmTask::updateBusyFlag() { diff --git a/mission/com/VirtualChannel.cpp b/mission/com/VirtualChannel.cpp index 93c83eeb..e531727e 100644 --- a/mission/com/VirtualChannel.cpp +++ b/mission/com/VirtualChannel.cpp @@ -67,7 +67,6 @@ ReturnValue_t VirtualChannel::handleWriteCompletionSynchronously(size_t& written } ReturnValue_t result = advanceWrite(writtenSize); if (result == returnvalue::OK) { - sif::debug << "last write after" << delayMs << std::endl; // Transfer complete return result; } else if (result != PARTIALLY_WRITTEN) { From a47ad98d90e8fd683a7421a6d44bd7a92c04d7b0 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 13 Oct 2023 16:29:02 +0200 Subject: [PATCH 177/257] delete some old code --- mission/com/LiveTmTask.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/mission/com/LiveTmTask.h b/mission/com/LiveTmTask.h index 0727bad1..4b5096de 100644 --- a/mission/com/LiveTmTask.h +++ b/mission/com/LiveTmTask.h @@ -43,9 +43,6 @@ class LiveTmTask : public SystemObject, CfdpTmFunnel& cfdpFunnel; VirtualChannel& channel; const std::atomic_bool& ptmeLocked; - // This countdown ensures that the CFDP is always throttled with a minimum period. Only after - // this period, the CFDP can be released if the channel is not busy. - // Countdown minimumPeriodThrottleCd = Countdown(config::CFDP_THROTTLE_PERIOD_MS); bool throttlePeriodOngoing = false; bool channelIsBusy = false; From e7709b7091b435bb60b162a52754631726f661f2 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 13 Oct 2023 16:42:13 +0200 Subject: [PATCH 178/257] this is even better --- mission/com/LiveTmTask.cpp | 38 ++++++++++++++++++++++---------------- mission/com/LiveTmTask.h | 2 ++ 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/mission/com/LiveTmTask.cpp b/mission/com/LiveTmTask.cpp index 78382168..16f8b346 100644 --- a/mission/com/LiveTmTask.cpp +++ b/mission/com/LiveTmTask.cpp @@ -58,16 +58,9 @@ ReturnValue_t LiveTmTask::performOperation(uint8_t opCode) { << result << std::dec << std::endl; } } - if (channelIsBusy and !throttlePeriodOngoing) { - // Throttle CFDP packet creator. It is by far the most relevant data creator, so throttling - // it is the easiest way to handle back pressure for now in a sensible way. - throttleCfdp(); - } else if (!channelIsBusy and throttlePeriodOngoing) { - // Half full/empty flow control: Release the CFDP is the queue is empty enough. - if (signals::CFDP_MSG_COUNTER <= config::LIVE_CHANNEL_CFDP_QUEUE_SIZE / 2) { - releaseCfdp(); - } - } + + cfdpBackpressureHandling(); + if (!handledTm) { if (tmFunnelCd.hasTimedOut()) { pusFunnel.performOperation(0); @@ -159,9 +152,10 @@ ReturnValue_t LiveTmTask::handleGenericTmQueue(MessageQueueIF& queue, bool isCfd if (result == MessageQueueIF::EMPTY) { return result; } - if (signals::CFDP_MSG_COUNTER > 0) { + if (isCfdp and signals::CFDP_MSG_COUNTER > 0) { signals::CFDP_MSG_COUNTER--; } + sif::debug << "CFDP msg counter: " << signals::CFDP_MSG_COUNTER << std::endl; store_address_t storeId = message.getStorageId(); const uint8_t* data = nullptr; size_t size = 0; @@ -177,17 +171,12 @@ ReturnValue_t LiveTmTask::handleGenericTmQueue(MessageQueueIF& queue, bool isCfd size_t writtenSize = 0; result = channel.write(data, size, writtenSize); if (result == DirectTmSinkIF::PARTIALLY_WRITTEN) { - // Already throttle CFDP. - throttleCfdp(); result = channel.handleWriteCompletionSynchronously(writtenSize, 200); if (result != returnvalue::OK) { // TODO: Event? Might lead to dangerous spam though.. sif::warning << "LiveTmTask: Synchronous write of last segment failed with code 0x" << std::setw(4) << std::hex << result << std::dec << std::endl; } - // This is a bit of a hack: If a partial write was performed and synchronously finished, we - // treat this like a busy channel. - channelIsBusy = true; } } // Try delete in any case, ignore failures (which should not happen), it is more important to @@ -199,11 +188,13 @@ ReturnValue_t LiveTmTask::handleGenericTmQueue(MessageQueueIF& queue, bool isCfd void LiveTmTask::throttleCfdp() { throttlePeriodOngoing = true; signals::CFDP_CHANNEL_THROTTLE_SIGNAL = true; + sif::debug << "throttling CFDP" << std::endl; } void LiveTmTask::releaseCfdp() { throttlePeriodOngoing = false; signals::CFDP_CHANNEL_THROTTLE_SIGNAL = false; + sif::debug << "releasing CFDP" << std::endl; } void LiveTmTask::updateBusyFlag() { @@ -211,6 +202,21 @@ void LiveTmTask::updateBusyFlag() { channelIsBusy = channel.isBusy(); } +void LiveTmTask::cfdpBackpressureHandling() { + if (channelIsBusy and !throttlePeriodOngoing) { + // Throttle CFDP packet creator. It is by far the most relevant data creator, so throttling + // it is the easiest way to handle back pressure for now in a sensible way. + if (signals::CFDP_MSG_COUNTER >= (config::LIVE_CHANNEL_CFDP_QUEUE_SIZE / 2)) { + throttleCfdp(); + } + } else if (!channelIsBusy and throttlePeriodOngoing) { + // Half full/empty flow control: Release the CFDP is the queue is empty enough. + if (signals::CFDP_MSG_COUNTER <= (config::LIVE_CHANNEL_CFDP_QUEUE_SIZE / 4)) { + releaseCfdp(); + } + } +} + ModeTreeChildIF& LiveTmTask::getModeTreeChildIF() { return *this; } ReturnValue_t LiveTmTask::initialize() { diff --git a/mission/com/LiveTmTask.h b/mission/com/LiveTmTask.h index 4b5096de..04409b5d 100644 --- a/mission/com/LiveTmTask.h +++ b/mission/com/LiveTmTask.h @@ -56,6 +56,8 @@ class LiveTmTask : public SystemObject, void getMode(Mode_t* mode, Submode_t* submode) override; + void cfdpBackpressureHandling(); + ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode, uint32_t* msToReachTheMode) override; From 6c4149571d0c4abeeff267edd0c3fe3128e28d98 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 13 Oct 2023 16:47:16 +0200 Subject: [PATCH 179/257] debug flags --- mission/com/LiveTmTask.cpp | 12 +++++++++--- mission/com/LiveTmTask.h | 2 ++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/mission/com/LiveTmTask.cpp b/mission/com/LiveTmTask.cpp index 16f8b346..32916afb 100644 --- a/mission/com/LiveTmTask.cpp +++ b/mission/com/LiveTmTask.cpp @@ -155,7 +155,9 @@ ReturnValue_t LiveTmTask::handleGenericTmQueue(MessageQueueIF& queue, bool isCfd if (isCfdp and signals::CFDP_MSG_COUNTER > 0) { signals::CFDP_MSG_COUNTER--; } - sif::debug << "CFDP msg counter: " << signals::CFDP_MSG_COUNTER << std::endl; + if (DEBUG_CFDP_TO_LIVE_TM_TASK) { + sif::debug << "LiveTmTask: CFDP message counter: " << signals::CFDP_MSG_COUNTER << std::endl; + } store_address_t storeId = message.getStorageId(); const uint8_t* data = nullptr; size_t size = 0; @@ -188,13 +190,17 @@ ReturnValue_t LiveTmTask::handleGenericTmQueue(MessageQueueIF& queue, bool isCfd void LiveTmTask::throttleCfdp() { throttlePeriodOngoing = true; signals::CFDP_CHANNEL_THROTTLE_SIGNAL = true; - sif::debug << "throttling CFDP" << std::endl; + if (DEBUG_CFDP_TO_LIVE_TM_TASK) { + sif::debug << "Throttling CFDP" << std::endl; + } } void LiveTmTask::releaseCfdp() { throttlePeriodOngoing = false; signals::CFDP_CHANNEL_THROTTLE_SIGNAL = false; - sif::debug << "releasing CFDP" << std::endl; + if (DEBUG_CFDP_TO_LIVE_TM_TASK) { + sif::debug << "Releasing CFDP" << std::endl; + } } void LiveTmTask::updateBusyFlag() { diff --git a/mission/com/LiveTmTask.h b/mission/com/LiveTmTask.h index 04409b5d..48bbb9f9 100644 --- a/mission/com/LiveTmTask.h +++ b/mission/com/LiveTmTask.h @@ -15,6 +15,8 @@ #include "eive/definitions.h" +static constexpr bool DEBUG_CFDP_TO_LIVE_TM_TASK = false; + class LiveTmTask : public SystemObject, public HasModesIF, public ExecutableObjectIF, From ce60a639ce63cf31f9ded4c6597c3abbc60551d3 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 13 Oct 2023 16:48:43 +0200 Subject: [PATCH 180/257] small tweak --- mission/com/LiveTmTask.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mission/com/LiveTmTask.cpp b/mission/com/LiveTmTask.cpp index 32916afb..48e7476c 100644 --- a/mission/com/LiveTmTask.cpp +++ b/mission/com/LiveTmTask.cpp @@ -155,7 +155,7 @@ ReturnValue_t LiveTmTask::handleGenericTmQueue(MessageQueueIF& queue, bool isCfd if (isCfdp and signals::CFDP_MSG_COUNTER > 0) { signals::CFDP_MSG_COUNTER--; } - if (DEBUG_CFDP_TO_LIVE_TM_TASK) { + if (DEBUG_CFDP_TO_LIVE_TM_TASK and signals::CFDP_MSG_COUNTER > 0) { sif::debug << "LiveTmTask: CFDP message counter: " << signals::CFDP_MSG_COUNTER << std::endl; } store_address_t storeId = message.getStorageId(); From d486c046344778118b3c01e695fbc6f43b07b407 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 13 Oct 2023 16:55:19 +0200 Subject: [PATCH 181/257] better docs --- linux/ipcore/PapbVcInterface.h | 11 +++-------- mission/tmtc/DirectTmSinkIF.h | 6 ++++++ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/linux/ipcore/PapbVcInterface.h b/linux/ipcore/PapbVcInterface.h index bcda5709..ddc9c074 100644 --- a/linux/ipcore/PapbVcInterface.h +++ b/linux/ipcore/PapbVcInterface.h @@ -35,18 +35,13 @@ class PapbVcInterface : public VirtualChannelIF { size_t maxPacketSize); virtual ~PapbVcInterface(); + // See interface function documentation for docs on these functions. + bool isBusy() const override; - /** - * - * @param data - * @param size - * @return returnvalue::OK on successfull write, PAPB_BUSY if PAPB is busy. - */ + ReturnValue_t write(const uint8_t* data, size_t size, size_t& writtenSize) override; ReturnValue_t advanceWrite(size_t& remainingSize) override; - // ReturnValue_t finishWriteInternal(const uint8_t* data, size_t start, size_t remainingSize, - // size_t& writtenSize, bool abortOnPartialWrite); void cancelTransfer() override; diff --git a/mission/tmtc/DirectTmSinkIF.h b/mission/tmtc/DirectTmSinkIF.h index 6ac182d2..ff8ab6fe 100644 --- a/mission/tmtc/DirectTmSinkIF.h +++ b/mission/tmtc/DirectTmSinkIF.h @@ -37,9 +37,15 @@ class DirectTmSinkIF { * @param writtenSize * @return returnvalue::OK if the packet write process is complete, PARTIALLY_WRITTEN if * some bytes were written but the transfer is not complete yet. + * NO_WRITE_ACTIVE if this is called without a valid previous write call. */ virtual ReturnValue_t advanceWrite(size_t& writtenSize) = 0; + /** + * Is busy, so no write operation can not be started and write advancement + * is not possible. + * @return + */ virtual bool isBusy() const = 0; /** * The PAPB interface is currently busy writing a packet and a new packet can not be written yet. From f14d792658af10aad5e9969dbad2ff50389eca61 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 13 Oct 2023 16:56:10 +0200 Subject: [PATCH 182/257] this should work as well now --- common/config/eive/definitions.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/config/eive/definitions.h b/common/config/eive/definitions.h index 9274878f..78b577c1 100644 --- a/common/config/eive/definitions.h +++ b/common/config/eive/definitions.h @@ -65,7 +65,7 @@ static constexpr uint32_t CFDP_STORE_QUEUE_SIZE = 300; static constexpr uint32_t LIVE_CHANNEL_NORMAL_QUEUE_SIZE = 250; static constexpr uint32_t LIVE_CHANNEL_CFDP_QUEUE_SIZE = 400; -static constexpr uint32_t CFDP_MAX_FSM_CALL_COUNT_SRC_HANDLER = 60; +static constexpr uint32_t CFDP_MAX_FSM_CALL_COUNT_SRC_HANDLER = 80; static constexpr uint32_t CFDP_MAX_FSM_CALL_COUNT_DEST_HANDLER = 300; static constexpr uint32_t CFDP_SHORT_DELAY_MS = 50; static constexpr uint32_t CFDP_REGULAR_DELAY_MS = 200; From c5c9692ded8bc5463e7040c2a14401cfc6bbf257 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 13 Oct 2023 17:09:50 +0200 Subject: [PATCH 183/257] lets leave it like this. --- common/config/eive/definitions.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/config/eive/definitions.h b/common/config/eive/definitions.h index 78b577c1..9274878f 100644 --- a/common/config/eive/definitions.h +++ b/common/config/eive/definitions.h @@ -65,7 +65,7 @@ static constexpr uint32_t CFDP_STORE_QUEUE_SIZE = 300; static constexpr uint32_t LIVE_CHANNEL_NORMAL_QUEUE_SIZE = 250; static constexpr uint32_t LIVE_CHANNEL_CFDP_QUEUE_SIZE = 400; -static constexpr uint32_t CFDP_MAX_FSM_CALL_COUNT_SRC_HANDLER = 80; +static constexpr uint32_t CFDP_MAX_FSM_CALL_COUNT_SRC_HANDLER = 60; static constexpr uint32_t CFDP_MAX_FSM_CALL_COUNT_DEST_HANDLER = 300; static constexpr uint32_t CFDP_SHORT_DELAY_MS = 50; static constexpr uint32_t CFDP_REGULAR_DELAY_MS = 200; From 0f5f147b8d0d7db1a863ac3784ceae2a045b23f1 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 13 Oct 2023 17:12:35 +0200 Subject: [PATCH 184/257] changelog --- CHANGELOG.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e2f57d3b..2c581221 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,14 +20,16 @@ will consitute of a breaking change warranting a new major release: - CFDP source handler, which allow file downlink using the standardized CFDP interface. +- Proper back pressure handling for the CFDP handler, where the `LiveTmTask` is able to throttle + the CFDP handler. ## Fixed - If the PTME is driven in a way where it fills faster than it can be emptied, the interface can become full during the process of a regular packet write. The interface of the PAPB VC - component was adapted to account for this partial success state. The caller must now check - for the `PARTIALLY_WRITTEN` state and must take care of finishing a write in some shape or - form before starting the next packet transfer. + was adapted to be stateful now. Packet generation is started with a `write` call while + write transfers are advanced and completed with the `advanceWrite` call if they can not be + completed immediately. - Host build fixes # [v7.1.0] 2023-10-11 From ffba0b371ccc7ce3def6cf19ca0ffbcdab4268c1 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 13 Oct 2023 17:28:31 +0200 Subject: [PATCH 185/257] added another fix --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c581221..4e4a138c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ will consitute of a breaking change warranting a new major release: was adapted to be stateful now. Packet generation is started with a `write` call while write transfers are advanced and completed with the `advanceWrite` call if they can not be completed immediately. +- CFDP Space Packets SSC is now generated properly, was always 0 before. - Host build fixes # [v7.1.0] 2023-10-11 From 04c081f4aa4015265b1505e6ef5e13306bd3ae48 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 16 Oct 2023 13:52:56 +0200 Subject: [PATCH 186/257] transition --- mission/controller/PowerController.cpp | 7 +++++++ mission/controller/PowerController.h | 1 + 2 files changed, 8 insertions(+) diff --git a/mission/controller/PowerController.cpp b/mission/controller/PowerController.cpp index 7b7db9e8..f31c589f 100644 --- a/mission/controller/PowerController.cpp +++ b/mission/controller/PowerController.cpp @@ -370,3 +370,10 @@ ReturnValue_t PowerController::calculateCoulombCounterChargeUpperThreshold() { lookUpTableOcv[0][lookUpTableIdx + 1]); return returnvalue::OK; } + +void PowerController::startTransition(Mode_t mode, Submode_t submode) { + if (mode == MODE_OFF) { + enablePl.setValidity(false, true); + } + ControllerBase::startTransition(mode, submode); +} diff --git a/mission/controller/PowerController.h b/mission/controller/PowerController.h index 1f27616d..8777fe53 100644 --- a/mission/controller/PowerController.h +++ b/mission/controller/PowerController.h @@ -22,6 +22,7 @@ class PowerController : public ExtendedControllerBase, public ReceivesParameterM ReturnValue_t getParameter(uint8_t domainId, uint8_t parameterId, ParameterWrapper* parameterWrapper, const ParameterWrapper* newValues, uint16_t startAtIndex) override; + void startTransition(Mode_t mode, Submode_t submode) override; private: bool enableHkSets = false; From f0cafedda7e035aec0b6fc89fca40bdc04a6154d Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 16 Oct 2023 14:10:51 +0200 Subject: [PATCH 187/257] this is better --- mission/controller/PowerController.cpp | 18 ++++++------------ mission/controller/PowerController.h | 1 - 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/mission/controller/PowerController.cpp b/mission/controller/PowerController.cpp index f31c589f..2a735782 100644 --- a/mission/controller/PowerController.cpp +++ b/mission/controller/PowerController.cpp @@ -100,15 +100,16 @@ void PowerController::performControlOperation() { return; } case InternalState::READY: { + if (mode != MODE_NORMAL) { + PoolReadGuard pg(&enablePl); + if (pg.getReadResult() == returnvalue::OK) { + enablePl.setValidity(false, true); + } + } if (mode != MODE_OFF) { calculateStateOfCharge(); if (mode == MODE_NORMAL) { watchStateOfCharge(); - } else { - PoolReadGuard pg(&enablePl); - if (pg.getReadResult() == returnvalue::OK) { - enablePl.setValidity(false, true); - } } } break; @@ -370,10 +371,3 @@ ReturnValue_t PowerController::calculateCoulombCounterChargeUpperThreshold() { lookUpTableOcv[0][lookUpTableIdx + 1]); return returnvalue::OK; } - -void PowerController::startTransition(Mode_t mode, Submode_t submode) { - if (mode == MODE_OFF) { - enablePl.setValidity(false, true); - } - ControllerBase::startTransition(mode, submode); -} diff --git a/mission/controller/PowerController.h b/mission/controller/PowerController.h index 8777fe53..1f27616d 100644 --- a/mission/controller/PowerController.h +++ b/mission/controller/PowerController.h @@ -22,7 +22,6 @@ class PowerController : public ExtendedControllerBase, public ReceivesParameterM ReturnValue_t getParameter(uint8_t domainId, uint8_t parameterId, ParameterWrapper* parameterWrapper, const ParameterWrapper* newValues, uint16_t startAtIndex) override; - void startTransition(Mode_t mode, Submode_t submode) override; private: bool enableHkSets = false; From b8e73637448f125aafdbde93ee57f90ce95e4c7e Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 16 Oct 2023 14:36:30 +0200 Subject: [PATCH 188/257] mpsoc debug opt --- linux/payload/PlocMpsocHandler.cpp | 25 ++++++++++++++++++++----- linux/payload/PlocMpsocHandler.h | 2 ++ 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/linux/payload/PlocMpsocHandler.cpp b/linux/payload/PlocMpsocHandler.cpp index 66fba6d8..94fe4588 100644 --- a/linux/payload/PlocMpsocHandler.cpp +++ b/linux/payload/PlocMpsocHandler.cpp @@ -348,10 +348,17 @@ void PlocMpsocHandler::fillCommandAndReplyMap() { ReturnValue_t PlocMpsocHandler::scanForReply(const uint8_t* start, size_t remainingSize, DeviceCommandId_t* foundId, size_t* foundLen) { + // sif::debug << "received reply with length" << remainingSize << std::endl; + // arrayprinter::print(start, remainingSize); ReturnValue_t result = returnvalue::OK; SpacePacketReader spacePacket; spacePacket.setReadOnlyData(start, remainingSize); + if (DEBUG_MPSOC_COMMUNICATION) { + sif::debug << "RECV MPSOC packet. APID 0x" << std::hex << std::setw(3) << spacePacket.getApid() + << std::dec << " Size " << spacePacket.getFullPacketLen() << " SSC " + << spacePacket.getSequenceCount() << std::endl; + } if (spacePacket.isNull()) { return returnvalue::FAILED; } @@ -467,7 +474,7 @@ void PlocMpsocHandler::setNormalDatapoolEntriesInvalid() { hkReport.setValidity(false, true); } -uint32_t PlocMpsocHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 10000; } +uint32_t PlocMpsocHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 15000; } ReturnValue_t PlocMpsocHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap, LocalDataPoolManager& poolManager) { @@ -700,6 +707,12 @@ ReturnValue_t PlocMpsocHandler::finishTcPrep(mpsoc::TcBase& tcBase) { rawPacket = commandBuffer; rawPacketLen = tcBase.getFullPacketLen(); sequenceCount++; + + if (DEBUG_MPSOC_COMMUNICATION) { + sif::debug << "SEND MPSOC packet. APID 0x" << std::hex << std::setw(3) << tcBase.getApid() + << " Size " << std::dec << tcBase.getFullPacketLen() << " SSC " + << tcBase.getSeqCount() << std::endl; + } return returnvalue::OK; } @@ -1223,10 +1236,12 @@ void PlocMpsocHandler::dataReceived(ActionId_t actionId, const uint8_t* data, ui void PlocMpsocHandler::completionSuccessfulReceived(ActionId_t actionId) { if (actionId == supv::ACK_REPORT) { - sif::warning - << "PlocMpsocHandler::completionSuccessfulReceived: Only received ACK report. Consider " - "increasing the MPSoC boot timer." - << std::endl; + // I seriously don't know why this happens.. + // sif::warning + // << "PlocMpsocHandler::completionSuccessfulReceived: Only received ACK report. Consider + // " + // "increasing the MPSoC boot timer." + // << std::endl; } else if (actionId != supv::EXE_REPORT) { sif::warning << "PlocMpsocHandler::completionSuccessfulReceived: Did not expect the action " << "ID " << actionId << std::endl; diff --git a/linux/payload/PlocMpsocHandler.h b/linux/payload/PlocMpsocHandler.h index 0203b942..6cce4951 100644 --- a/linux/payload/PlocMpsocHandler.h +++ b/linux/payload/PlocMpsocHandler.h @@ -17,6 +17,8 @@ #include "fsfw_hal/linux/gpio/Gpio.h" #include "fsfw_hal/linux/serial/SerialComIF.h" +static constexpr bool DEBUG_MPSOC_COMMUNICATION = true; + /** * @brief This is the device handler for the MPSoC of the payload computer. * From 0ada9562858e76baac560562d5ce5021ee0aa9b2 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 16 Oct 2023 14:46:02 +0200 Subject: [PATCH 189/257] some more debugging --- linux/payload/PlocMpsocHandler.cpp | 4 +++- linux/payload/PlocMpsocHandler.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/linux/payload/PlocMpsocHandler.cpp b/linux/payload/PlocMpsocHandler.cpp index 94fe4588..eedfb95e 100644 --- a/linux/payload/PlocMpsocHandler.cpp +++ b/linux/payload/PlocMpsocHandler.cpp @@ -91,6 +91,8 @@ ReturnValue_t PlocMpsocHandler::initialize() { void PlocMpsocHandler::performOperationHook() { if (commandIsPending and cmdCountdown.hasTimedOut()) { + sif::warning << "PlocMpsocHandler: Command " << getPendingCommand() << " has timed out" + << std::endl; commandIsPending = false; // TODO: Better returnvalue? cmdDoneHandler(false, returnvalue::FAILED); @@ -215,7 +217,6 @@ ReturnValue_t PlocMpsocHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) if (not commandIsPending and not specialComHelperExecuting) { *id = mpsoc::TC_GET_HK_REPORT; commandIsPending = true; - cmdCountdown.resetTimer(); return buildCommandFromCommand(*id, nullptr, 0); } return NOTHING_TO_SEND; @@ -713,6 +714,7 @@ ReturnValue_t PlocMpsocHandler::finishTcPrep(mpsoc::TcBase& tcBase) { << " Size " << std::dec << tcBase.getFullPacketLen() << " SSC " << tcBase.getSeqCount() << std::endl; } + cmdCountdown.resetTimer(); return returnvalue::OK; } diff --git a/linux/payload/PlocMpsocHandler.h b/linux/payload/PlocMpsocHandler.h index 6cce4951..216001d6 100644 --- a/linux/payload/PlocMpsocHandler.h +++ b/linux/payload/PlocMpsocHandler.h @@ -186,7 +186,7 @@ class PlocMpsocHandler : public DeviceHandlerBase, public CommandsActionsIF { }; TmMemReadReport tmMemReadReport; - Countdown cmdCountdown = Countdown(10000); + Countdown cmdCountdown = Countdown(12000); struct TelemetryBuffer { uint16_t length = 0; From aaf99b52b42e52eeaddc881648403541f61d5277 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 16 Oct 2023 14:46:45 +0200 Subject: [PATCH 190/257] changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a6d88025..d71df6e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,11 @@ will consitute of a breaking change warranting a new major release: # [unreleased] +## Fixed + +- PL Enable set of the power controller is now set to invalid properly + if the power controller is not in normal mode. + # [v7.1.0] 2023-10-11 - Bumped `eive-tmtc` to v5.8.0. From 31bf896a6ce3ef7075dd1516ff4bfab3c7370cfd Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 16 Oct 2023 15:06:02 +0200 Subject: [PATCH 191/257] disable debug mode --- linux/payload/PlocMpsocHandler.cpp | 2 +- linux/payload/PlocMpsocHandler.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/linux/payload/PlocMpsocHandler.cpp b/linux/payload/PlocMpsocHandler.cpp index eedfb95e..bca4280b 100644 --- a/linux/payload/PlocMpsocHandler.cpp +++ b/linux/payload/PlocMpsocHandler.cpp @@ -1507,7 +1507,7 @@ LocalPoolDataSetBase* PlocMpsocHandler::getDataSetHandle(sid_t sid) { bool PlocMpsocHandler::dontCheckQueue() { // The TC and TMs need to be handled strictly sequentially, so while a command is pending, - // more specifically while replies are still expected, do not check the queue.s + // more specifically while replies are still expected, do not check the queue. return commandIsPending; } diff --git a/linux/payload/PlocMpsocHandler.h b/linux/payload/PlocMpsocHandler.h index 216001d6..5d584943 100644 --- a/linux/payload/PlocMpsocHandler.h +++ b/linux/payload/PlocMpsocHandler.h @@ -17,7 +17,7 @@ #include "fsfw_hal/linux/gpio/Gpio.h" #include "fsfw_hal/linux/serial/SerialComIF.h" -static constexpr bool DEBUG_MPSOC_COMMUNICATION = true; +static constexpr bool DEBUG_MPSOC_COMMUNICATION = false; /** * @brief This is the device handler for the MPSoC of the payload computer. @@ -186,7 +186,7 @@ class PlocMpsocHandler : public DeviceHandlerBase, public CommandsActionsIF { }; TmMemReadReport tmMemReadReport; - Countdown cmdCountdown = Countdown(12000); + Countdown cmdCountdown = Countdown(10000); struct TelemetryBuffer { uint16_t length = 0; From 718277da283b48a38b0e040948506bb2e4554bb9 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 16 Oct 2023 15:18:32 +0200 Subject: [PATCH 192/257] remove dcommented code --- linux/payload/PlocMpsocHandler.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/linux/payload/PlocMpsocHandler.cpp b/linux/payload/PlocMpsocHandler.cpp index bca4280b..34053c70 100644 --- a/linux/payload/PlocMpsocHandler.cpp +++ b/linux/payload/PlocMpsocHandler.cpp @@ -349,8 +349,6 @@ void PlocMpsocHandler::fillCommandAndReplyMap() { ReturnValue_t PlocMpsocHandler::scanForReply(const uint8_t* start, size_t remainingSize, DeviceCommandId_t* foundId, size_t* foundLen) { - // sif::debug << "received reply with length" << remainingSize << std::endl; - // arrayprinter::print(start, remainingSize); ReturnValue_t result = returnvalue::OK; SpacePacketReader spacePacket; From c268977b3d75217effb825f01f39371499258ebc Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 16 Oct 2023 15:30:17 +0200 Subject: [PATCH 193/257] changelog --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d71df6e5..09055dd7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,8 +18,9 @@ will consitute of a breaking change warranting a new major release: ## Fixed -- PL Enable set of the power controller is now set to invalid properly - if the power controller is not in normal mode. +- PL Enable set of the power controller is now set to invalid properly if the power controller + is not in normal mode. +- MPSoC debug mode. # [v7.1.0] 2023-10-11 From ace75919cafe73a533b29f46c67ae5f57f4381e4 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 18 Oct 2023 12:24:22 +0200 Subject: [PATCH 194/257] more testing --- common/config/eive/definitions.h | 8 ++++---- linux/ipcore/PapbVcInterface.cpp | 11 +++++------ mission/com/LiveTmTask.cpp | 4 ++++ mission/com/VirtualChannel.cpp | 3 +++ 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/common/config/eive/definitions.h b/common/config/eive/definitions.h index 9274878f..9ed032a6 100644 --- a/common/config/eive/definitions.h +++ b/common/config/eive/definitions.h @@ -50,7 +50,7 @@ static constexpr uint32_t LEGACY_SA_DEPL_CHANNEL_ALTERNATION_INTERVAL_SECS = 5; // Maximum allowed burn time allowed by the software. static constexpr uint32_t SA_DEPL_MAX_BURN_TIME = 180; -static constexpr size_t CFDP_MAX_FILE_SEGMENT_LEN = 990; +static constexpr size_t CFDP_MAX_FILE_SEGMENT_LEN = 300; static constexpr uint32_t CCSDS_HANDLER_QUEUE_SIZE = 50; static constexpr uint8_t NUMBER_OF_VIRTUAL_CHANNELS = 4; @@ -63,11 +63,11 @@ static constexpr uint32_t HK_STORE_QUEUE_SIZE = 300; static constexpr uint32_t CFDP_STORE_QUEUE_SIZE = 300; static constexpr uint32_t LIVE_CHANNEL_NORMAL_QUEUE_SIZE = 250; -static constexpr uint32_t LIVE_CHANNEL_CFDP_QUEUE_SIZE = 400; +static constexpr uint32_t LIVE_CHANNEL_CFDP_QUEUE_SIZE = 450; -static constexpr uint32_t CFDP_MAX_FSM_CALL_COUNT_SRC_HANDLER = 60; +static constexpr uint32_t CFDP_MAX_FSM_CALL_COUNT_SRC_HANDLER = 50; static constexpr uint32_t CFDP_MAX_FSM_CALL_COUNT_DEST_HANDLER = 300; -static constexpr uint32_t CFDP_SHORT_DELAY_MS = 50; +static constexpr uint32_t CFDP_SHORT_DELAY_MS = 40; static constexpr uint32_t CFDP_REGULAR_DELAY_MS = 200; static constexpr uint32_t MAX_PUS_FUNNEL_QUEUE_DEPTH = 100; diff --git a/linux/ipcore/PapbVcInterface.cpp b/linux/ipcore/PapbVcInterface.cpp index bc324489..d11b6c9b 100644 --- a/linux/ipcore/PapbVcInterface.cpp +++ b/linux/ipcore/PapbVcInterface.cpp @@ -34,6 +34,7 @@ ReturnValue_t PapbVcInterface::write(const uint8_t* data, size_t size, size_t& w } // The user must call advance until completion before starting a new packet transfer. if (writeActiveStatus) { + sif::debug << "is busy with writing" << std::endl; return IS_BUSY; } if (size > packetBuf.capacity()) { @@ -47,12 +48,9 @@ ReturnValue_t PapbVcInterface::write(const uint8_t* data, size_t size, size_t& w if (pollReadyForPacket()) { startPacketTransfer(ByteWidthCfg::ONE); } else { + sif::debug << "is busy can not even start" << std::endl; return DirectTmSinkIF::IS_BUSY; } - if (not pollReadyForOctet(MAX_BUSY_POLLS)) { - abortPacketTransfer(); - return returnvalue::FAILED; - } return advanceWrite(writtenSize); } @@ -75,15 +73,16 @@ ReturnValue_t PapbVcInterface::advanceWrite(size_t& writtenSize) { if (not pollReadyForPacket()) { return IS_BUSY; } - for (size_t idx = currentPacketIndex; idx < currentPacketSize; idx++) { + while (currentPacketIndex < currentPacketSize) { if (not pollReadyForOctet(MAX_BUSY_POLLS)) { if (not pollReadyForPacket()) { return PARTIALLY_WRITTEN; } + sif::debug << "aborting unexpectedly" << std::endl; abortPacketTransfer(); return returnvalue::FAILED; } - *(vcBaseReg + DATA_REG_OFFSET) = static_cast(packetBuf[currentPacketIndex]); + *(vcBaseReg + DATA_REG_OFFSET) = static_cast(packetBuf[currentPacketIndex++]); writtenSize++; } if (not pollReadyForOctet(MAX_BUSY_POLLS)) { diff --git a/mission/com/LiveTmTask.cpp b/mission/com/LiveTmTask.cpp index 48e7476c..2792125c 100644 --- a/mission/com/LiveTmTask.cpp +++ b/mission/com/LiveTmTask.cpp @@ -173,12 +173,16 @@ ReturnValue_t LiveTmTask::handleGenericTmQueue(MessageQueueIF& queue, bool isCfd size_t writtenSize = 0; result = channel.write(data, size, writtenSize); if (result == DirectTmSinkIF::PARTIALLY_WRITTEN) { + sif::debug << "only partial write" << std::endl; result = channel.handleWriteCompletionSynchronously(writtenSize, 200); if (result != returnvalue::OK) { // TODO: Event? Might lead to dangerous spam though.. sif::warning << "LiveTmTask: Synchronous write of last segment failed with code 0x" << std::setw(4) << std::hex << result << std::dec << std::endl; } + } else if(result != returnvalue::OK) { + sif::error << "LiveTmTask: Channel write failed with code 0x" << std::hex << std::setw(4) << + result << std::dec << std::endl; } } // Try delete in any case, ignore failures (which should not happen), it is more important to diff --git a/mission/com/VirtualChannel.cpp b/mission/com/VirtualChannel.cpp index e531727e..11678180 100644 --- a/mission/com/VirtualChannel.cpp +++ b/mission/com/VirtualChannel.cpp @@ -67,12 +67,15 @@ ReturnValue_t VirtualChannel::handleWriteCompletionSynchronously(size_t& written } ReturnValue_t result = advanceWrite(writtenSize); if (result == returnvalue::OK) { + sif::debug << "transfer complete" << std::endl; // Transfer complete return result; } else if (result != PARTIALLY_WRITTEN) { + sif::debug << "transfer completion error" << std::endl; // Some error where we can not or should not continue the transfer. return result; } } + sif::debug << "wtf" << std::endl; return returnvalue::FAILED; } From c1394576617d03e60f5b690320fad4cd5325ddd0 Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 18 Oct 2023 13:32:09 +0200 Subject: [PATCH 195/257] reduce sus fdir events --- mission/acs/SusHandler.cpp | 14 ++++++++++---- mission/acs/SusHandler.h | 13 ++++++++----- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/mission/acs/SusHandler.cpp b/mission/acs/SusHandler.cpp index 4b9778e5..fd06b9ab 100644 --- a/mission/acs/SusHandler.cpp +++ b/mission/acs/SusHandler.cpp @@ -97,9 +97,7 @@ ReturnValue_t SusHandler::interpretDeviceReply(DeviceCommandId_t id, const uint8 // 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) { + if (invalidMsgCounter == susMax1227::MAX_INVALID_MSG_COUNT) { triggerEvent(DeviceHandlerIF::DEVICE_WANTS_HARD_REBOOT); waitingForRecovery = true; } @@ -110,8 +108,16 @@ ReturnValue_t SusHandler::interpretDeviceReply(DeviceCommandId_t id, const uint8 return returnvalue::OK; } if (invalidMsgCounter > 0) { - triggerEvent(TEMPERATURE_ALL_ONES_RECOVERY, invalidMsgCounter); + invalidMsgPeriodCounter++; + if (invalidMsgCounter > invalidMsgCounterMax) { + invalidMsgCounterMax = invalidMsgCounter; + } invalidMsgCounter = 0; + invalidMsgCountdown.resetTimer(); + } + if (invalidMsgCountdown.hasTimedOut() and invalidMsgPeriodCounter > 0) { + triggerEvent(TEMPERATURE_ALL_ONES_RECOVERY, invalidMsgPeriodCounter, invalidMsgCounterMax); + invalidMsgPeriodCounter = 0; } dataset.setValidity(true, true); dataset.tempC = max1227::getTemperature(reply->tempRaw); diff --git a/mission/acs/SusHandler.h b/mission/acs/SusHandler.h index 88e2b163..e35185b7 100644 --- a/mission/acs/SusHandler.h +++ b/mission/acs/SusHandler.h @@ -17,11 +17,9 @@ 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] Detected invalid values, starting invalid message counting - static constexpr Event TEMPERATURE_ALL_ONES_START = - event::makeEvent(SUBSYSTEM_ID, 0, severity::MEDIUM); - //! [EXPORT] : [COMMENT] Detected valid values again, resetting invalid message counter. - //! P1: Invalid message counter. + //! [EXPORT] : [COMMENT] Detected valid values for a prolonged time again, resetting all counters. + //! P1: Number of periods with invalid messages. + //! P2: Maximum invalid message counter. static constexpr Event TEMPERATURE_ALL_ONES_RECOVERY = event::makeEvent(SUBSYSTEM_ID, 1, severity::INFO); @@ -54,8 +52,13 @@ class SusHandler : public DeviceHandlerBase { susMax1227::SusDataset dataset; acs::SusRequest request{}; uint8_t susIdx; + + // After 1 minute, trigger the event for the invalid messages. + Countdown invalidMsgCountdown = Countdown(60000); bool waitingForRecovery = true; uint32_t invalidMsgCounter = 0; + uint32_t invalidMsgCounterMax = 0; + uint32_t invalidMsgPeriodCounter = 0; uint32_t transitionDelay = 1000; bool goToNormalMode = false; From 665b7d95f7929add0eda2097fba90432248af6f3 Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 18 Oct 2023 13:35:18 +0200 Subject: [PATCH 196/257] actually lets keep this --- mission/acs/SusHandler.cpp | 4 +++- mission/acs/SusHandler.h | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/mission/acs/SusHandler.cpp b/mission/acs/SusHandler.cpp index fd06b9ab..58280636 100644 --- a/mission/acs/SusHandler.cpp +++ b/mission/acs/SusHandler.cpp @@ -97,7 +97,9 @@ ReturnValue_t SusHandler::interpretDeviceReply(DeviceCommandId_t id, const uint8 // 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 == susMax1227::MAX_INVALID_MSG_COUNT) { + if (invalidMsgCounter == 0 and invalidMsgPeriodCounter == 0) { + triggerEvent(TEMPERATURE_ALL_ONES_START); + } else if (invalidMsgCounter == susMax1227::MAX_INVALID_MSG_COUNT) { triggerEvent(DeviceHandlerIF::DEVICE_WANTS_HARD_REBOOT); waitingForRecovery = true; } diff --git a/mission/acs/SusHandler.h b/mission/acs/SusHandler.h index e35185b7..43c49dcb 100644 --- a/mission/acs/SusHandler.h +++ b/mission/acs/SusHandler.h @@ -17,6 +17,9 @@ 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] Detected invalid values, starting invalid message counting + static constexpr Event TEMPERATURE_ALL_ONES_START = + event::makeEvent(SUBSYSTEM_ID, 0, severity::MEDIUM); //! [EXPORT] : [COMMENT] Detected valid values for a prolonged time again, resetting all counters. //! P1: Number of periods with invalid messages. //! P2: Maximum invalid message counter. From be6d52ff4aab545cf7ce03887c4b4d02020a92fd Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 18 Oct 2023 14:07:33 +0200 Subject: [PATCH 197/257] throw out stuff --- linux/ipcore/PapbVcInterface.cpp | 3 --- mission/com/LiveTmTask.cpp | 6 +++--- mission/com/VirtualChannel.cpp | 3 --- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/linux/ipcore/PapbVcInterface.cpp b/linux/ipcore/PapbVcInterface.cpp index d11b6c9b..c02d0935 100644 --- a/linux/ipcore/PapbVcInterface.cpp +++ b/linux/ipcore/PapbVcInterface.cpp @@ -34,7 +34,6 @@ ReturnValue_t PapbVcInterface::write(const uint8_t* data, size_t size, size_t& w } // The user must call advance until completion before starting a new packet transfer. if (writeActiveStatus) { - sif::debug << "is busy with writing" << std::endl; return IS_BUSY; } if (size > packetBuf.capacity()) { @@ -48,7 +47,6 @@ ReturnValue_t PapbVcInterface::write(const uint8_t* data, size_t size, size_t& w if (pollReadyForPacket()) { startPacketTransfer(ByteWidthCfg::ONE); } else { - sif::debug << "is busy can not even start" << std::endl; return DirectTmSinkIF::IS_BUSY; } return advanceWrite(writtenSize); @@ -78,7 +76,6 @@ ReturnValue_t PapbVcInterface::advanceWrite(size_t& writtenSize) { if (not pollReadyForPacket()) { return PARTIALLY_WRITTEN; } - sif::debug << "aborting unexpectedly" << std::endl; abortPacketTransfer(); return returnvalue::FAILED; } diff --git a/mission/com/LiveTmTask.cpp b/mission/com/LiveTmTask.cpp index 2792125c..e931b8a7 100644 --- a/mission/com/LiveTmTask.cpp +++ b/mission/com/LiveTmTask.cpp @@ -180,9 +180,9 @@ ReturnValue_t LiveTmTask::handleGenericTmQueue(MessageQueueIF& queue, bool isCfd sif::warning << "LiveTmTask: Synchronous write of last segment failed with code 0x" << std::setw(4) << std::hex << result << std::dec << std::endl; } - } else if(result != returnvalue::OK) { - sif::error << "LiveTmTask: Channel write failed with code 0x" << std::hex << std::setw(4) << - result << std::dec << std::endl; + } else if (result != returnvalue::OK) { + sif::error << "LiveTmTask: Channel write failed with code 0x" << std::hex << std::setw(4) + << result << std::dec << std::endl; } } // Try delete in any case, ignore failures (which should not happen), it is more important to diff --git a/mission/com/VirtualChannel.cpp b/mission/com/VirtualChannel.cpp index 11678180..e531727e 100644 --- a/mission/com/VirtualChannel.cpp +++ b/mission/com/VirtualChannel.cpp @@ -67,15 +67,12 @@ ReturnValue_t VirtualChannel::handleWriteCompletionSynchronously(size_t& written } ReturnValue_t result = advanceWrite(writtenSize); if (result == returnvalue::OK) { - sif::debug << "transfer complete" << std::endl; // Transfer complete return result; } else if (result != PARTIALLY_WRITTEN) { - sif::debug << "transfer completion error" << std::endl; // Some error where we can not or should not continue the transfer. return result; } } - sif::debug << "wtf" << std::endl; return returnvalue::FAILED; } From 978dd4a1de3ca831e3172c9f54109e244276455c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 18 Oct 2023 14:10:57 +0200 Subject: [PATCH 198/257] larger size --- common/config/eive/definitions.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/config/eive/definitions.h b/common/config/eive/definitions.h index 9ed032a6..e4aa2daa 100644 --- a/common/config/eive/definitions.h +++ b/common/config/eive/definitions.h @@ -50,7 +50,7 @@ static constexpr uint32_t LEGACY_SA_DEPL_CHANNEL_ALTERNATION_INTERVAL_SECS = 5; // Maximum allowed burn time allowed by the software. static constexpr uint32_t SA_DEPL_MAX_BURN_TIME = 180; -static constexpr size_t CFDP_MAX_FILE_SEGMENT_LEN = 300; +static constexpr size_t CFDP_MAX_FILE_SEGMENT_LEN = 900; static constexpr uint32_t CCSDS_HANDLER_QUEUE_SIZE = 50; static constexpr uint8_t NUMBER_OF_VIRTUAL_CHANNELS = 4; From 696d8e4e4cedeacc0a78cf5489b126f4d1d3be02 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 18 Oct 2023 14:12:16 +0200 Subject: [PATCH 199/257] threw out other debug output --- mission/com/LiveTmTask.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/mission/com/LiveTmTask.cpp b/mission/com/LiveTmTask.cpp index e931b8a7..56fe5a51 100644 --- a/mission/com/LiveTmTask.cpp +++ b/mission/com/LiveTmTask.cpp @@ -173,7 +173,6 @@ ReturnValue_t LiveTmTask::handleGenericTmQueue(MessageQueueIF& queue, bool isCfd size_t writtenSize = 0; result = channel.write(data, size, writtenSize); if (result == DirectTmSinkIF::PARTIALLY_WRITTEN) { - sif::debug << "only partial write" << std::endl; result = channel.handleWriteCompletionSynchronously(writtenSize, 200); if (result != returnvalue::OK) { // TODO: Event? Might lead to dangerous spam though.. From 8b6fa63c60d3fb49f7f797255caea13769ae4d4f Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 18 Oct 2023 14:29:33 +0200 Subject: [PATCH 200/257] changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 09055dd7..78803876 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,12 @@ will consitute of a breaking change warranting a new major release: is not in normal mode. - MPSoC debug mode. +## Changed + +- SUS FDIR should now trigger less events. The finish event is now only triggered once the + SUS has been working properly for a minute again. It will then display the number of periods + during which the SUS was not working as well as the maximum amount of invalid messages. + # [v7.1.0] 2023-10-11 - Bumped `eive-tmtc` to v5.8.0. From d1ee938ade9e6e4dc3d49c898ccb1d492e576ecc Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 18 Oct 2023 16:07:00 +0200 Subject: [PATCH 201/257] store still not large enough? --- common/config/eive/definitions.h | 2 +- mission/com/LiveTmTask.h | 2 +- mission/genericFactory.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common/config/eive/definitions.h b/common/config/eive/definitions.h index e4aa2daa..d2c0de52 100644 --- a/common/config/eive/definitions.h +++ b/common/config/eive/definitions.h @@ -50,7 +50,7 @@ static constexpr uint32_t LEGACY_SA_DEPL_CHANNEL_ALTERNATION_INTERVAL_SECS = 5; // Maximum allowed burn time allowed by the software. static constexpr uint32_t SA_DEPL_MAX_BURN_TIME = 180; -static constexpr size_t CFDP_MAX_FILE_SEGMENT_LEN = 900; +static constexpr size_t CFDP_MAX_FILE_SEGMENT_LEN = 500; static constexpr uint32_t CCSDS_HANDLER_QUEUE_SIZE = 50; static constexpr uint8_t NUMBER_OF_VIRTUAL_CHANNELS = 4; diff --git a/mission/com/LiveTmTask.h b/mission/com/LiveTmTask.h index 48bbb9f9..24579cb7 100644 --- a/mission/com/LiveTmTask.h +++ b/mission/com/LiveTmTask.h @@ -15,7 +15,7 @@ #include "eive/definitions.h" -static constexpr bool DEBUG_CFDP_TO_LIVE_TM_TASK = false; +static constexpr bool DEBUG_CFDP_TO_LIVE_TM_TASK = true; class LiveTmTask : public SystemObject, public HasModesIF, diff --git a/mission/genericFactory.cpp b/mission/genericFactory.cpp index d66ef5f7..1dd434d2 100644 --- a/mission/genericFactory.cpp +++ b/mission/genericFactory.cpp @@ -118,7 +118,7 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_, PusTmFun { PoolManager::LocalPoolConfig poolCfg = {{600, 32}, {400, 64}, {400, 128}, - {350, 512}, {500, 1200}, {100, 2048}}; + {350, 512}, {600, 1200}, {100, 2048}}; *tmStore = new PoolManager(objects::TM_STORE, poolCfg); } From 0f4fd6b452c8edbb5e201eff77cc8be2aa728b6e Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 18 Oct 2023 16:09:36 +0200 Subject: [PATCH 202/257] auto blob --- mission/acs/str/strHelpers.h | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/mission/acs/str/strHelpers.h b/mission/acs/str/strHelpers.h index 31ac0c05..1d107a58 100644 --- a/mission/acs/str/strHelpers.h +++ b/mission/acs/str/strHelpers.h @@ -274,6 +274,8 @@ enum PoolIds : lp_id_t { DEBUG_CAMERA_TIMING, DEBUG_CAMERA_TEST, + AUTO_BLOB_THRESHOLD, + TICKS_MATCHED_CENTROIDS, TIME_MATCHED_CENTROIDS, NUM_MATCHED_CENTROIDS, @@ -360,14 +362,15 @@ static const DeviceCommandId_t DISABLE_TIMESTAMP_GENERATION = 85; static const DeviceCommandId_t ENABLE_TIMESTAMP_GENERATION = 86; static constexpr DeviceCommandId_t SET_TIME_FROM_SYS_TIME = 87; static constexpr DeviceCommandId_t AUTO_THRESHOLD = 88; -static constexpr DeviceCommandId_t REQ_MATCHED_CENTROIDS = 89; -static constexpr DeviceCommandId_t REQ_BLOB = 90; -static constexpr DeviceCommandId_t REQ_BLOBS = 91; -static constexpr DeviceCommandId_t REQ_CENTROID = 92; -static constexpr DeviceCommandId_t REQ_CENTROIDS = 93; -static constexpr DeviceCommandId_t ADD_SECONDARY_TM_TO_NORMAL_MODE = 94; -static constexpr DeviceCommandId_t RESET_SECONDARY_TM_SET = 95; -static constexpr DeviceCommandId_t READ_SECONDARY_TM_SET = 96; +static constexpr DeviceCommandId_t REQ_AUTO_BLOB = 89; +static constexpr DeviceCommandId_t REQ_MATCHED_CENTROIDS = 90; +static constexpr DeviceCommandId_t REQ_BLOB = 91; +static constexpr DeviceCommandId_t REQ_BLOBS = 92; +static constexpr DeviceCommandId_t REQ_CENTROID = 93; +static constexpr DeviceCommandId_t REQ_CENTROIDS = 94; +static constexpr DeviceCommandId_t ADD_SECONDARY_TM_TO_NORMAL_MODE = 95; +static constexpr DeviceCommandId_t RESET_SECONDARY_TM_SET = 96; +static constexpr DeviceCommandId_t READ_SECONDARY_TM_SET = 97; static const DeviceCommandId_t NONE = 0xFFFFFFFF; static const uint32_t VERSION_SET_ID = REQ_VERSION; @@ -392,6 +395,7 @@ static const uint32_t ALGO_SET_ID = REQ_ALGO; static const uint32_t SUBSCRIPTION_SET_ID = REQ_SUBSCRIPTION; static const uint32_t LOG_SUBSCRIPTION_SET_ID = REQ_LOG_SUBSCRIPTION; static const uint32_t DEBUG_CAMERA_SET_ID = REQ_DEBUG_CAMERA; +static const uint32_t AUTO_BLOB_SET_ID = REQ_AUTO_BLOB; static const uint32_t MATCHED_CENTROIDS_SET_ID = REQ_MATCHED_CENTROIDS; static const uint32_t BLOB_SET_ID = REQ_BLOB; static const uint32_t BLOBS_SET_ID = REQ_BLOBS; @@ -1426,6 +1430,14 @@ class ValidationSet : public StaticLocalDataSet { } }; +class AutoBlobSet : StaticLocalDataSet<1> { + public: + AutoBlobSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, AUTO_BLOB_SET_ID) {} + lp_var_t threshold = lp_var_t(sid.objectId, PoolIds::AUTO_BLOB_THRESHOLD, this); + + private: +}; + class MatchedCentroidsSet : public StaticLocalDataSet<20> { public: static constexpr size_t SIZE = 321; @@ -1465,6 +1477,7 @@ class BlobSet : public StaticLocalDataSet<5> { lp_var_t timeUs = lp_var_t(sid.objectId, PoolIds::BLOB_TIME, this); lp_var_t blobCount = lp_var_t(sid.objectId, PoolIds::BLOB_COUNT, this); }; + class BlobsSet : public StaticLocalDataSet<10> { public: BlobsSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, BLOBS_SET_ID) {} From e911d8b13efb9ebc898bbe50322673e5bfd39898 Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 18 Oct 2023 16:15:33 +0200 Subject: [PATCH 203/257] i guess we do this --- mission/acs/str/strHelpers.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mission/acs/str/strHelpers.h b/mission/acs/str/strHelpers.h index 1d107a58..235fd31a 100644 --- a/mission/acs/str/strHelpers.h +++ b/mission/acs/str/strHelpers.h @@ -1433,6 +1433,12 @@ class ValidationSet : public StaticLocalDataSet { class AutoBlobSet : StaticLocalDataSet<1> { public: AutoBlobSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, AUTO_BLOB_SET_ID) {} + // Ticks timestamp + lp_var_t ticks = + lp_var_t(sid.objectId, PoolIds::TICKS_MATCHED_CENTROIDS, this); + // Unix time stamp + lp_var_t timeUs = + lp_var_t(sid.objectId, PoolIds::TIME_MATCHED_CENTROIDS, this); lp_var_t threshold = lp_var_t(sid.objectId, PoolIds::AUTO_BLOB_THRESHOLD, this); private: From 6e3a60f9c579a4908c7acbff1035149d55aac853 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 18 Oct 2023 17:24:44 +0200 Subject: [PATCH 204/257] fine tweaking --- common/config/eive/definitions.h | 10 +++++----- mission/genericFactory.cpp | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/common/config/eive/definitions.h b/common/config/eive/definitions.h index d2c0de52..d51f6c68 100644 --- a/common/config/eive/definitions.h +++ b/common/config/eive/definitions.h @@ -50,7 +50,7 @@ static constexpr uint32_t LEGACY_SA_DEPL_CHANNEL_ALTERNATION_INTERVAL_SECS = 5; // Maximum allowed burn time allowed by the software. static constexpr uint32_t SA_DEPL_MAX_BURN_TIME = 180; -static constexpr size_t CFDP_MAX_FILE_SEGMENT_LEN = 500; +static constexpr size_t CFDP_MAX_FILE_SEGMENT_LEN = 900; static constexpr uint32_t CCSDS_HANDLER_QUEUE_SIZE = 50; static constexpr uint8_t NUMBER_OF_VIRTUAL_CHANNELS = 4; @@ -63,22 +63,22 @@ static constexpr uint32_t HK_STORE_QUEUE_SIZE = 300; static constexpr uint32_t CFDP_STORE_QUEUE_SIZE = 300; static constexpr uint32_t LIVE_CHANNEL_NORMAL_QUEUE_SIZE = 250; -static constexpr uint32_t LIVE_CHANNEL_CFDP_QUEUE_SIZE = 450; +static constexpr uint32_t LIVE_CHANNEL_CFDP_QUEUE_SIZE = 350; -static constexpr uint32_t CFDP_MAX_FSM_CALL_COUNT_SRC_HANDLER = 50; +static constexpr uint32_t CFDP_MAX_FSM_CALL_COUNT_SRC_HANDLER = 20; static constexpr uint32_t CFDP_MAX_FSM_CALL_COUNT_DEST_HANDLER = 300; static constexpr uint32_t CFDP_SHORT_DELAY_MS = 40; static constexpr uint32_t CFDP_REGULAR_DELAY_MS = 200; static constexpr uint32_t MAX_PUS_FUNNEL_QUEUE_DEPTH = 100; -static constexpr uint32_t MAX_CFDP_FUNNEL_QUEUE_DEPTH = 150; +static constexpr uint32_t MAX_CFDP_FUNNEL_QUEUE_DEPTH = LIVE_CHANNEL_CFDP_QUEUE_SIZE; static constexpr uint32_t VERIFICATION_SERVICE_QUEUE_DEPTH = 120; static constexpr uint32_t HK_SERVICE_QUEUE_DEPTH = 60; static constexpr uint32_t ACTION_SERVICE_QUEUE_DEPTH = 60; static constexpr uint32_t UDP_MAX_STORED_CMDS = 200; static constexpr uint32_t UDP_MSG_QUEUE_DEPTH = UDP_MAX_STORED_CMDS; -static constexpr uint32_t TCP_MAX_STORED_CMDS = 300; +static constexpr uint32_t TCP_MAX_STORED_CMDS = 350; static constexpr uint32_t TCP_MSG_QUEUE_DEPTH = TCP_MAX_STORED_CMDS; static constexpr uint32_t TCP_MAX_NUMBER_TMS_SENT_PER_CYCLE = TCP_MSG_QUEUE_DEPTH; diff --git a/mission/genericFactory.cpp b/mission/genericFactory.cpp index 1dd434d2..25b59f9b 100644 --- a/mission/genericFactory.cpp +++ b/mission/genericFactory.cpp @@ -118,7 +118,7 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_, PusTmFun { PoolManager::LocalPoolConfig poolCfg = {{600, 32}, {400, 64}, {400, 128}, - {350, 512}, {600, 1200}, {100, 2048}}; + {400, 512}, {800, 1200}, {150, 2048}}; *tmStore = new PoolManager(objects::TM_STORE, poolCfg); } From aa47881cecf4f34487fae78bf795f4273f26fcfd Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 18 Oct 2023 18:11:56 +0200 Subject: [PATCH 205/257] this is sufficient to sustain even the high rate --- common/config/eive/definitions.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/config/eive/definitions.h b/common/config/eive/definitions.h index d51f6c68..b51eefdb 100644 --- a/common/config/eive/definitions.h +++ b/common/config/eive/definitions.h @@ -65,7 +65,7 @@ static constexpr uint32_t CFDP_STORE_QUEUE_SIZE = 300; static constexpr uint32_t LIVE_CHANNEL_NORMAL_QUEUE_SIZE = 250; static constexpr uint32_t LIVE_CHANNEL_CFDP_QUEUE_SIZE = 350; -static constexpr uint32_t CFDP_MAX_FSM_CALL_COUNT_SRC_HANDLER = 20; +static constexpr uint32_t CFDP_MAX_FSM_CALL_COUNT_SRC_HANDLER = 10; static constexpr uint32_t CFDP_MAX_FSM_CALL_COUNT_DEST_HANDLER = 300; static constexpr uint32_t CFDP_SHORT_DELAY_MS = 40; static constexpr uint32_t CFDP_REGULAR_DELAY_MS = 200; From ca33e2987fd452a2e565199f6a225e9b10f059f2 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 18 Oct 2023 18:14:02 +0200 Subject: [PATCH 206/257] disable debugging --- mission/com/LiveTmTask.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mission/com/LiveTmTask.h b/mission/com/LiveTmTask.h index 24579cb7..48bbb9f9 100644 --- a/mission/com/LiveTmTask.h +++ b/mission/com/LiveTmTask.h @@ -15,7 +15,7 @@ #include "eive/definitions.h" -static constexpr bool DEBUG_CFDP_TO_LIVE_TM_TASK = true; +static constexpr bool DEBUG_CFDP_TO_LIVE_TM_TASK = false; class LiveTmTask : public SystemObject, public HasModesIF, From b3f9a82064ecf374118fff016fa55ed41cb0a891 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 18 Oct 2023 18:16:32 +0200 Subject: [PATCH 207/257] changelog update --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 65ec154d..9308d71d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,7 @@ will consitute of a breaking change warranting a new major release: ## Added -- CFDP source handler, which allow file downlink using the standardized +- CFDP source handler, which allows file downlink using the standardized CFDP interface. - Proper back pressure handling for the CFDP handler, where the `LiveTmTask` is able to throttle the CFDP handler. From 12909cb3b96140070a6ce6c5a92d8311a15b1a7b Mon Sep 17 00:00:00 2001 From: meggert Date: Thu, 19 Oct 2023 09:26:28 +0200 Subject: [PATCH 208/257] now for the fun part --- mission/acs/str/StarTrackerHandler.cpp | 67 +++++++++++++++++++------- mission/acs/str/StarTrackerHandler.h | 4 +- 2 files changed, 52 insertions(+), 19 deletions(-) diff --git a/mission/acs/str/StarTrackerHandler.cpp b/mission/acs/str/StarTrackerHandler.cpp index bf31c99a..6278739e 100644 --- a/mission/acs/str/StarTrackerHandler.cpp +++ b/mission/acs/str/StarTrackerHandler.cpp @@ -49,7 +49,8 @@ StarTrackerHandler::StarTrackerHandler(object_id_t objectId, object_id_t comIF, subscriptionSet(this), logSubscriptionSet(this), debugCameraSet(this), - matchedCentroids(this), + autoBlobSet(this), + matchedCentroidsSet(this), blobSet(this), blobsSet(this), centroidSet(this), @@ -792,7 +793,7 @@ void StarTrackerHandler::fillCommandAndReplyMap() { startracker::MAX_FRAME_SIZE * 2 + 2); this->insertInCommandAndReplyMap(startracker::REQ_DEBUG_CAMERA, 3, &debugCameraSet, startracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startracker::REQ_MATCHED_CENTROIDS, 3, &matchedCentroids, + this->insertInCommandAndReplyMap(startracker::REQ_MATCHED_CENTROIDS, 3, &matchedCentroidsSet, startracker::MAX_FRAME_SIZE * 2 + 2); this->insertInCommandAndReplyMap(startracker::REQ_BLOB, 3, &blobSet, startracker::MAX_FRAME_SIZE * 2 + 2); @@ -1494,7 +1495,7 @@ ReturnValue_t StarTrackerHandler::initializeLocalDataPool(localpool::DataPool& l poolManager.subscribeForRegularPeriodicPacket( subdp::RegularHkPeriodicParams(lisaSet.getSid(), false, 10.0)); poolManager.subscribeForRegularPeriodicPacket( - subdp::RegularHkPeriodicParams(matchedCentroids.getSid(), false, 10.0)); + subdp::RegularHkPeriodicParams(matchedCentroidsSet.getSid(), false, 10.0)); poolManager.subscribeForRegularPeriodicPacket( subdp::RegularHkPeriodicParams(blobSet.getSid(), false, 10.0)); poolManager.subscribeForRegularPeriodicPacket( @@ -2266,28 +2267,58 @@ ReturnValue_t StarTrackerHandler::handleTm(const uint8_t* rawFrame, LocalPoolDat return result; } +ReturnValue_t StarTrackerHandler::handleAutoBlobTm(const uint8_t* rawFrame) { + ReturnValue_t result = statusFieldCheck(rawFrame); + if (result != returnvalue::OK) { + return result; + } + size_t remainingLen = fullPacketLen; + PoolReadGuard pg(&autoBlobSet); + result = pg.getReadResult(); + if (result != returnvalue::OK) { + return result; + } + result = SerializeAdapter::deSerialize(&autoBlobSet.ticks, &rawFrame, &remainingLen, + SerializeIF::Endianness::LITTLE); + if (result != returnvalue::OK) { + return result; + } + result = SerializeAdapter::deSerialize(&autoBlobSet.timeUs, &rawFrame, &remainingLen, + SerializeIF::Endianness::LITTLE); + if (result != returnvalue::OK) { + return result; + } + result = SerializeAdapter::deSerialize(&autoBlobSet.threshold, &rawFrame, &remainingLen, + SerializeIF::Endianness::LITTLE); + if (result != returnvalue::OK) { + return result; + } + autoBlobSet.setValidity(true, true); + return returnvalue::OK; +} + ReturnValue_t StarTrackerHandler::handleMatchedCentroidTm(const uint8_t* rawFrame) { ReturnValue_t result = statusFieldCheck(rawFrame); if (result != returnvalue::OK) { return result; } size_t remainingLen = fullPacketLen; - PoolReadGuard pg(&matchedCentroids); + PoolReadGuard pg(&matchedCentroidsSet); result = pg.getReadResult(); if (result != returnvalue::OK) { return result; } - result = SerializeAdapter::deSerialize(&matchedCentroids.ticks, &rawFrame, &remainingLen, + result = SerializeAdapter::deSerialize(&matchedCentroidsSet.ticks, &rawFrame, &remainingLen, SerializeIF::Endianness::LITTLE); if (result != returnvalue::OK) { return result; } - result = SerializeAdapter::deSerialize(&matchedCentroids.timeUs, &rawFrame, &remainingLen, + result = SerializeAdapter::deSerialize(&matchedCentroidsSet.timeUs, &rawFrame, &remainingLen, SerializeIF::Endianness::LITTLE); if (result != returnvalue::OK) { return result; } - result = SerializeAdapter::deSerialize(&matchedCentroids.numberOfMatchedCentroids, &rawFrame, + result = SerializeAdapter::deSerialize(&matchedCentroidsSet.numberOfMatchedCentroids, &rawFrame, &remainingLen, SerializeIF::Endianness::LITTLE); if (result != returnvalue::OK) { @@ -2295,33 +2326,33 @@ ReturnValue_t StarTrackerHandler::handleMatchedCentroidTm(const uint8_t* rawFram } // Yeah, we serialize it like that because I can't model anything with that local datapool crap. for (unsigned idx = 0; idx < 16; idx++) { - result = SerializeAdapter::deSerialize(&matchedCentroids.starIds[idx], &rawFrame, &remainingLen, - SerializeIF::Endianness::LITTLE); + result = SerializeAdapter::deSerialize(&matchedCentroidsSet.starIds[idx], &rawFrame, + &remainingLen, SerializeIF::Endianness::LITTLE); if (result != returnvalue::OK) { return result; } - result = SerializeAdapter::deSerialize(&matchedCentroids.xCoords[idx], &rawFrame, &remainingLen, - SerializeIF::Endianness::LITTLE); + result = SerializeAdapter::deSerialize(&matchedCentroidsSet.xCoords[idx], &rawFrame, + &remainingLen, SerializeIF::Endianness::LITTLE); if (result != returnvalue::OK) { return result; } - result = SerializeAdapter::deSerialize(&matchedCentroids.yCoords[idx], &rawFrame, &remainingLen, - SerializeIF::Endianness::LITTLE); + result = SerializeAdapter::deSerialize(&matchedCentroidsSet.yCoords[idx], &rawFrame, + &remainingLen, SerializeIF::Endianness::LITTLE); if (result != returnvalue::OK) { return result; } - result = SerializeAdapter::deSerialize(&matchedCentroids.xErrors[idx], &rawFrame, &remainingLen, - SerializeIF::Endianness::LITTLE); + result = SerializeAdapter::deSerialize(&matchedCentroidsSet.xErrors[idx], &rawFrame, + &remainingLen, SerializeIF::Endianness::LITTLE); if (result != returnvalue::OK) { return result; } - result = SerializeAdapter::deSerialize(&matchedCentroids.yErrors[idx], &rawFrame, &remainingLen, - SerializeIF::Endianness::LITTLE); + result = SerializeAdapter::deSerialize(&matchedCentroidsSet.yErrors[idx], &rawFrame, + &remainingLen, SerializeIF::Endianness::LITTLE); if (result != returnvalue::OK) { return result; } } - matchedCentroids.setValidity(true, true); + matchedCentroidsSet.setValidity(true, true); return returnvalue::OK; } diff --git a/mission/acs/str/StarTrackerHandler.h b/mission/acs/str/StarTrackerHandler.h index b239559a..90261285 100644 --- a/mission/acs/str/StarTrackerHandler.h +++ b/mission/acs/str/StarTrackerHandler.h @@ -206,7 +206,8 @@ class StarTrackerHandler : public DeviceHandlerBase { startracker::SubscriptionSet subscriptionSet; startracker::LogSubscriptionSet logSubscriptionSet; startracker::DebugCameraSet debugCameraSet; - startracker::MatchedCentroidsSet matchedCentroids; + startracker::AutoBlobSet autoBlobSet; + startracker::MatchedCentroidsSet matchedCentroidsSet; startracker::BlobSet blobSet; startracker::BlobsSet blobsSet; startracker::CentroidSet centroidSet; @@ -518,6 +519,7 @@ class StarTrackerHandler : public DeviceHandlerBase { ReturnValue_t handleTm(const uint8_t* rawFrame, LocalPoolDataSetBase& dataset, size_t size, const char* context); + ReturnValue_t handleAutoBlobTm(const uint8_t* rawFrame); ReturnValue_t handleMatchedCentroidTm(const uint8_t* rawFrame); ReturnValue_t handleBlobTm(const uint8_t* rawFrame); ReturnValue_t handleBlobsTm(const uint8_t* rawFrame); From 58d967861391e52a6802e89d2195237132d2f107 Mon Sep 17 00:00:00 2001 From: meggert Date: Thu, 19 Oct 2023 09:32:21 +0200 Subject: [PATCH 209/257] woops --- mission/acs/str/strHelpers.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mission/acs/str/strHelpers.h b/mission/acs/str/strHelpers.h index 235fd31a..fe8755f2 100644 --- a/mission/acs/str/strHelpers.h +++ b/mission/acs/str/strHelpers.h @@ -1430,7 +1430,7 @@ class ValidationSet : public StaticLocalDataSet { } }; -class AutoBlobSet : StaticLocalDataSet<1> { +class AutoBlobSet : public StaticLocalDataSet<1> { public: AutoBlobSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, AUTO_BLOB_SET_ID) {} // Ticks timestamp From 440375e64bc0f3a90593457fafd62c7698d6034d Mon Sep 17 00:00:00 2001 From: meggert Date: Thu, 19 Oct 2023 09:37:01 +0200 Subject: [PATCH 210/257] add cmd --- mission/acs/str/StarTrackerHandler.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mission/acs/str/StarTrackerHandler.cpp b/mission/acs/str/StarTrackerHandler.cpp index 6278739e..1b1300b5 100644 --- a/mission/acs/str/StarTrackerHandler.cpp +++ b/mission/acs/str/StarTrackerHandler.cpp @@ -1063,6 +1063,10 @@ ReturnValue_t StarTrackerHandler::interpretDeviceReply(DeviceCommandId_t id, result = handleTm(packet, solutionSet, startracker::SolutionSet::SIZE, "REQ_SOLUTION"); break; } + case (startracker::REQ_AUTO_BLOB): { + result = handleAutoBlobTm(packet); + break; + } case (startracker::REQ_MATCHED_CENTROIDS): { result = handleMatchedCentroidTm(packet); break; From fc626a2ad68d398478d92952183f033001dfd752 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 19 Oct 2023 11:05:07 +0200 Subject: [PATCH 211/257] bump fsfw --- fsfw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsfw b/fsfw index 63c23800..cc3e64e7 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 63c238005e0c00166879eba6a354a64ca1f59e06 +Subproject commit cc3e64e70d90f6a2b5c59215b2569c1771e890f0 From 0854ec878bbb714e70b0cd73d29e59328aba8ab2 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 19 Oct 2023 11:27:21 +0200 Subject: [PATCH 212/257] 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 213/257] 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 214/257] 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 215/257] 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 216/257] 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) { From feb64598783af99abdb66ce6ee668446a168efe9 Mon Sep 17 00:00:00 2001 From: meggert Date: Thu, 19 Oct 2023 14:54:12 +0200 Subject: [PATCH 217/257] might wanna push this --- mission/acs/str/StarTrackerHandler.cpp | 19 +++++++++++++++++-- mission/acs/str/StarTrackerHandler.h | 3 ++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/mission/acs/str/StarTrackerHandler.cpp b/mission/acs/str/StarTrackerHandler.cpp index 1b1300b5..0e81b7e4 100644 --- a/mission/acs/str/StarTrackerHandler.cpp +++ b/mission/acs/str/StarTrackerHandler.cpp @@ -660,7 +660,7 @@ ReturnValue_t StarTrackerHandler::buildCommandFromCommand(DeviceCommandId_t devi return result; } case (startracker::REQ_MATCHED_CENTROIDS): { - result = prepareRequestMatchedCentroids(); + result = prepareRequestMatchedCentroidsTm(); return result; } case (startracker::REQ_BLOB): { @@ -793,6 +793,8 @@ void StarTrackerHandler::fillCommandAndReplyMap() { startracker::MAX_FRAME_SIZE * 2 + 2); this->insertInCommandAndReplyMap(startracker::REQ_DEBUG_CAMERA, 3, &debugCameraSet, startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::REQ_AUTO_BLOB, 3, &autoBlobSet, + startracker::MAX_FRAME_SIZE * 2 + 2); this->insertInCommandAndReplyMap(startracker::REQ_MATCHED_CENTROIDS, 3, &matchedCentroidsSet, startracker::MAX_FRAME_SIZE * 2 + 2); this->insertInCommandAndReplyMap(startracker::REQ_BLOB, 3, &blobSet, @@ -1445,6 +1447,9 @@ ReturnValue_t StarTrackerHandler::initializeLocalDataPool(localpool::DataPool& l localDataPoolMap.emplace(startracker::DEBUG_CAMERA_TEST, new PoolEntry({0})); localDataPoolMap.emplace(startracker::CHKSUM, new PoolEntry({0})); + + localDataPoolMap.emplace(startracker::AUTO_BLOB_THRESHOLD, new PoolEntry()); + localDataPoolMap.emplace(startracker::PoolIds::NUM_MATCHED_CENTROIDS, new PoolEntry()); localDataPoolMap.emplace(startracker::PoolIds::MATCHED_CENTROIDS_STAR_IDS, new PoolEntry(16)); @@ -1498,6 +1503,8 @@ ReturnValue_t StarTrackerHandler::initializeLocalDataPool(localpool::DataPool& l subdp::RegularHkPeriodicParams(histogramSet.getSid(), false, 10.0)); poolManager.subscribeForRegularPeriodicPacket( subdp::RegularHkPeriodicParams(lisaSet.getSid(), false, 10.0)); + poolManager.subscribeForRegularPeriodicPacket( + subdp::RegularHkPeriodicParams(autoBlobSet.getSid(), false, 10.0)); poolManager.subscribeForRegularPeriodicPacket( subdp::RegularHkPeriodicParams(matchedCentroidsSet.getSid(), false, 10.0)); poolManager.subscribeForRegularPeriodicPacket( @@ -1925,7 +1932,15 @@ void StarTrackerHandler::prepareHistogramRequest() { rawPacketLen = length; } -ReturnValue_t StarTrackerHandler::prepareRequestMatchedCentroids() { +ReturnValue_t StarTrackerHandler::prepareRequestAutoBlobTm() { + uint32_t length = 0; + arc_tm_pack_autoblob_req(commandBuffer, &length); + rawPacket = commandBuffer; + rawPacketLen = length; + return returnvalue::OK; +} + +ReturnValue_t StarTrackerHandler::prepareRequestMatchedCentroidsTm() { uint32_t length = 0; arc_tm_pack_matchedcentroids_req(commandBuffer, &length); rawPacket = commandBuffer; diff --git a/mission/acs/str/StarTrackerHandler.h b/mission/acs/str/StarTrackerHandler.h index 90261285..d63335ae 100644 --- a/mission/acs/str/StarTrackerHandler.h +++ b/mission/acs/str/StarTrackerHandler.h @@ -454,7 +454,8 @@ class StarTrackerHandler : public DeviceHandlerBase { ReturnValue_t prepareRequestCentroidingParams(); ReturnValue_t prepareRequestLisaParams(); ReturnValue_t prepareRequestMatchingParams(); - ReturnValue_t prepareRequestMatchedCentroids(); + ReturnValue_t prepareRequestAutoBlobTm(); + ReturnValue_t prepareRequestMatchedCentroidsTm(); ReturnValue_t prepareRequestBlobTm(); ReturnValue_t prepareRequestBlobsTm(); ReturnValue_t prepareRequestCentroidTm(); From c67a9fa2c284131721c3aa8e9500473c76330d02 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 23 Oct 2023 17:10:37 +0200 Subject: [PATCH 218/257] this might be a bugfix --- CHANGELOG.md | 2 ++ mission/payload/PayloadPcduHandler.cpp | 13 +++++++++++-- mission/payload/PayloadPcduHandler.h | 2 ++ tmtc | 2 +- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9308d71d..55857ce1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,8 @@ will consitute of a breaking change warranting a new major release: - PL Enable set of the power controller is now set to invalid properly if the power controller is not in normal mode. - MPSoC debug mode. +- Possible bugfix for PL PCDU parameter JSON handling which might not have been initialized + properly from the JSON file. # [v7.1.0] 2023-10-11 diff --git a/mission/payload/PayloadPcduHandler.cpp b/mission/payload/PayloadPcduHandler.cpp index bda15b20..48bc3b6a 100644 --- a/mission/payload/PayloadPcduHandler.cpp +++ b/mission/payload/PayloadPcduHandler.cpp @@ -395,7 +395,6 @@ void PayloadPcduHandler::quickTransitionBackToOff(bool startTransitionToOff, boo void PayloadPcduHandler::checkAdcValues() { using namespace plpcdu; - checkJsonFileInit(); adcSet.processed[U_BAT_DIV_6] = static_cast(adcSet.channels[0]) * VOLTAGE_DIV / MAX122X_BIT * MAX122X_VREF; adcSet.processed[U_NEG_V_FB] = @@ -529,6 +528,10 @@ void PayloadPcduHandler::checkJsonFileInit() { params.initialize(sdcMan->getCurrentMountPrefix()); jsonFileInitComplete = true; } + } else { + if (not sdcMan->isSdCardUsable(std::nullopt)) { + jsonFileInitComplete = false; + } } } @@ -564,6 +567,13 @@ bool PayloadPcduHandler::checkCurrent(float val, float upperBound, Event event) return true; } +ReturnValue_t PayloadPcduHandler::initialize() { + checkJsonFileInit(); + return DeviceHandlerBase::initialize(); +} + +void PayloadPcduHandler::performOperationHook() { checkJsonFileInit(); } + ReturnValue_t PayloadPcduHandler::checkModeCommand(Mode_t commandedMode, Submode_t commandedSubmode, uint32_t* msToReachTheMode) { if (commandedMode != MODE_OFF) { @@ -717,7 +727,6 @@ ReturnValue_t PayloadPcduHandler::handleDoubleParamUpdate(std::string key, if (result != returnvalue::OK) { return result; } - params.setValue(key, newValue); // Do this so the dumping and loading with the framework works as well doubleDummy = newValue; parameterWrapper->set(doubleDummy); diff --git a/mission/payload/PayloadPcduHandler.h b/mission/payload/PayloadPcduHandler.h index a4574f53..d48d0f89 100644 --- a/mission/payload/PayloadPcduHandler.h +++ b/mission/payload/PayloadPcduHandler.h @@ -67,7 +67,9 @@ class PayloadPcduHandler : public DeviceHandlerBase { SdCardMountedIF* sdcMan, Stack5VHandler& stackHandler, bool periodicPrintout); void setToGoToNormalModeImmediately(bool enable); + void performOperationHook() override; void enablePeriodicPrintout(bool enable, uint8_t divider); + ReturnValue_t initialize() override; #ifdef XIPHOS_Q7S static ReturnValue_t extConvAsTwoCallback(SpiComIF* comIf, SpiCookie* cookie, diff --git a/tmtc b/tmtc index 60f7ae54..70c3f9dc 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 60f7ae5453b387ee5ebcf6a338c34284004dbce7 +Subproject commit 70c3f9dcaaa8f0623ee8c30d639947ea36f9bac1 From 70747e1864ae48849308b1bcae0c1b097fb92f89 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 23 Oct 2023 17:28:20 +0200 Subject: [PATCH 219/257] bump PL PCDU handler --- mission/payload/PayloadPcduHandler.cpp | 1 + tmtc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/mission/payload/PayloadPcduHandler.cpp b/mission/payload/PayloadPcduHandler.cpp index 48bc3b6a..b3b71aea 100644 --- a/mission/payload/PayloadPcduHandler.cpp +++ b/mission/payload/PayloadPcduHandler.cpp @@ -727,6 +727,7 @@ ReturnValue_t PayloadPcduHandler::handleDoubleParamUpdate(std::string key, if (result != returnvalue::OK) { return result; } + params.setValue(key, newValue); // Do this so the dumping and loading with the framework works as well doubleDummy = newValue; parameterWrapper->set(doubleDummy); diff --git a/tmtc b/tmtc index 70c3f9dc..b45b0b22 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 70c3f9dcaaa8f0623ee8c30d639947ea36f9bac1 +Subproject commit b45b0b2271cd67d501921a97a1325fb983da4d00 From ec903abd491c30f19ef1515ab75105a622c555a2 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 24 Oct 2023 15:00:10 +0200 Subject: [PATCH 220/257] pdec handler start addr change --- linux/ipcore/PdecHandler.cpp | 3 ++- linux/ipcore/PdecHandler.h | 10 +++------- tmtc | 2 +- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/linux/ipcore/PdecHandler.cpp b/linux/ipcore/PdecHandler.cpp index 8f86ee9c..d5f45ae7 100644 --- a/linux/ipcore/PdecHandler.cpp +++ b/linux/ipcore/PdecHandler.cpp @@ -24,7 +24,8 @@ using namespace pdec; uint32_t PdecHandler::CURRENT_FAR = 0; PdecHandler::PdecHandler(object_id_t objectId, object_id_t tcDestinationId, - LinuxLibgpioIF* gpioComIF, gpioId_t pdecReset, UioNames names) + LinuxLibgpioIF* gpioComIF, gpioId_t pdecReset, UioNames names, + uint32_t cfgMemPhyAddr, uint32_t pdecRamPhyAddr) : SystemObject(objectId), tcDestinationId(tcDestinationId), gpioComIF(gpioComIF), diff --git a/linux/ipcore/PdecHandler.h b/linux/ipcore/PdecHandler.h index 19968da6..3a802cdd 100644 --- a/linux/ipcore/PdecHandler.h +++ b/linux/ipcore/PdecHandler.h @@ -68,7 +68,7 @@ class PdecHandler : public SystemObject, * @param uioregsiters String of uio device file same mapped to the PDEC register space */ PdecHandler(object_id_t objectId, object_id_t tcDestinationId, LinuxLibgpioIF* gpioComIF, - gpioId_t pdecReset, UioNames names); + gpioId_t pdecReset, UioNames names, uint32_t cfgMemPhyAddr, uint32_t pdecRamPhyAddr); virtual ~PdecHandler(); @@ -103,12 +103,6 @@ class PdecHandler : public SystemObject, static const size_t MAX_TC_SEGMENT_SIZE = 1017; static const uint8_t MAP_ID_MASK = 0x3F; -#ifdef TE0720_1CFA - static const uint32_t PHYSICAL_RAM_BASE_ADDRESS = 0x32000000; -#else - static const uint32_t PHYSICAL_RAM_BASE_ADDRESS = 0x26000000; -#endif - // Expected value stored in FAR register after reset static const uint32_t FAR_RESET = 0x7FE0; @@ -152,6 +146,8 @@ class PdecHandler : public SystemObject, LinuxLibgpioIF* gpioComIF = nullptr; + uint32_t cfgMemBaseAddr = 0x0; + uint32_t pdecRamBaseAddr = 0x0; uint32_t interruptCounter = 0; Countdown interruptWindowCd = Countdown(1000); diff --git a/tmtc b/tmtc index 60f7ae54..8f8bcde9 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 60f7ae5453b387ee5ebcf6a338c34284004dbce7 +Subproject commit 8f8bcde90e3b9113388cfedc47775426888d0781 From f55b475f7e9fc89ab5c691bbdb62e4431e5d6bda Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 25 Oct 2023 08:23:36 +0200 Subject: [PATCH 221/257] add new addrs --- common/config/eive/definitions.h | 3 +++ linux/ipcore/PdecHandler.cpp | 8 +++++--- linux/ipcore/PdecHandler.h | 9 +++++---- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/common/config/eive/definitions.h b/common/config/eive/definitions.h index b51eefdb..033d703f 100644 --- a/common/config/eive/definitions.h +++ b/common/config/eive/definitions.h @@ -115,6 +115,9 @@ static constexpr float SCHED_BLOCK_10_PERIOD = } // namespace spiSched +namespace pdec { +static constexpr uint32_t PDEC_CONFIG_BASE_ADDR_LEGACY = 0x24000000; +} } // namespace config #endif /* COMMON_CONFIG_DEFINITIONS_H_ */ diff --git a/linux/ipcore/PdecHandler.cpp b/linux/ipcore/PdecHandler.cpp index d5f45ae7..d9065314 100644 --- a/linux/ipcore/PdecHandler.cpp +++ b/linux/ipcore/PdecHandler.cpp @@ -31,6 +31,8 @@ PdecHandler::PdecHandler(object_id_t objectId, object_id_t tcDestinationId, gpioComIF(gpioComIF), pdecReset(pdecReset), actionHelper(this, nullptr), + cfgMemBaseAddr(cfgMemPhyAddr), + pdecRamBaseAddr(pdecRamPhyAddr), uioNames(names), paramHelper(this) { auto mqArgs = MqArgs(objectId, static_cast(this)); @@ -68,7 +70,7 @@ ReturnValue_t PdecHandler::initialize() { }; memoryBaseAddress = static_cast( mmap(0, PDEC_CFG_MEM_SIZE, static_cast(UioMapper::Permissions::READ_WRITE), MAP_SHARED, - fd, PDEC_CFG_MEM_PHY_ADDR)); + fd, cfgMemBaseAddr)); if (memoryBaseAddress == nullptr) { return ObjectManagerIF::CHILD_INIT_FAILED; } @@ -76,7 +78,7 @@ ReturnValue_t PdecHandler::initialize() { ramBaseAddress = static_cast(mmap(0, PDEC_RAM_SIZE, static_cast(UioMapper::Permissions::READ_WRITE), - MAP_SHARED, fd, PDEC_RAM_PHY_ADDR)); + MAP_SHARED, fd, pdecRamBaseAddr)); if (ramBaseAddress == nullptr) { return ObjectManagerIF::CHILD_INIT_FAILED; } @@ -646,7 +648,7 @@ void PdecHandler::handleNewTc() { } ReturnValue_t PdecHandler::readTc(uint32_t& tcLength) { - uint32_t tcOffset = (*(registerBaseAddress + PDEC_BPTR_OFFSET) - PHYSICAL_RAM_BASE_ADDRESS) / 4; + uint32_t tcOffset = (*(registerBaseAddress + PDEC_BPTR_OFFSET) - pdecRamBaseAddr) / 4; #if OBSW_DEBUG_PDEC_HANDLER == 1 sif::debug << "PdecHandler::readTc: TC offset: 0x" << std::hex << tcOffset << std::endl; diff --git a/linux/ipcore/PdecHandler.h b/linux/ipcore/PdecHandler.h index 3a802cdd..1119999c 100644 --- a/linux/ipcore/PdecHandler.h +++ b/linux/ipcore/PdecHandler.h @@ -52,9 +52,9 @@ class PdecHandler : public SystemObject, public: static constexpr dur_millis_t IRQ_TIMEOUT_MS = 500; static constexpr uint32_t PDEC_CFG_MEM_SIZE = 0x1000; - static constexpr uint32_t PDEC_CFG_MEM_PHY_ADDR = 0x24000000; + //static constexpr uint32_t PDEC_CFG_MEM_PHY_ADDR = 0x24000000; static constexpr uint32_t PDEC_RAM_SIZE = 0x10000; - static constexpr uint32_t PDEC_RAM_PHY_ADDR = 0x26000000; + //static constexpr uint32_t PDEC_RAM_PHY_ADDR = 0x26000000; enum class Modes { POLLED, IRQ }; @@ -146,8 +146,6 @@ class PdecHandler : public SystemObject, LinuxLibgpioIF* gpioComIF = nullptr; - uint32_t cfgMemBaseAddr = 0x0; - uint32_t pdecRamBaseAddr = 0x0; uint32_t interruptCounter = 0; Countdown interruptWindowCd = Countdown(1000); @@ -191,6 +189,9 @@ class PdecHandler : public SystemObject, MessageQueueId_t commandedBy = MessageQueueIF::NO_QUEUE; bool ptmeResetWithReinitializationPending = false; + uint32_t cfgMemBaseAddr; + uint32_t pdecRamBaseAddr; + UioNames uioNames; ParameterHelper paramHelper; From 817182b45fab42a9ace33e1d74e2f9001438eb11 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 25 Oct 2023 09:10:04 +0200 Subject: [PATCH 222/257] finished addr change --- bsp_q7s/em/emObjectFactory.cpp | 4 ++-- bsp_q7s/fmObjectFactory.cpp | 4 ++-- bsp_q7s/objectFactory.cpp | 12 +++++++++--- bsp_q7s/objectFactory.h | 11 ++++++++--- common/config/eive/definitions.h | 11 ++++++++++- linux/ipcore/PdecHandler.h | 4 ++-- tmtc | 2 +- 7 files changed, 34 insertions(+), 14 deletions(-) diff --git a/bsp_q7s/em/emObjectFactory.cpp b/bsp_q7s/em/emObjectFactory.cpp index ca75e123..41dab3e6 100644 --- a/bsp_q7s/em/emObjectFactory.cpp +++ b/bsp_q7s/em/emObjectFactory.cpp @@ -163,8 +163,8 @@ void ObjectFactory::produce(void* args) { #if OBSW_ADD_CCSDS_IP_CORES == 1 CcsdsIpCoreHandler* ipCoreHandler = nullptr; CcsdsComponentArgs ccsdsArgs(*gpioComIF, *ipcStore, *tmStore, stores, *pusFunnel, *cfdpFunnel, - &ipCoreHandler); - createCcsdsIpComponentsAddTmRouting(ccsdsArgs); + &ipCoreHandler, 0, 0); + createCcsdsIpComponentsWrapper(ccsdsArgs); #endif /* OBSW_ADD_CCSDS_IP_CORES == 1 */ /* Test Task */ diff --git a/bsp_q7s/fmObjectFactory.cpp b/bsp_q7s/fmObjectFactory.cpp index e4a61124..b154ac52 100644 --- a/bsp_q7s/fmObjectFactory.cpp +++ b/bsp_q7s/fmObjectFactory.cpp @@ -115,8 +115,8 @@ void ObjectFactory::produce(void* args) { #if OBSW_ADD_CCSDS_IP_CORES == 1 CcsdsIpCoreHandler* ipCoreHandler = nullptr; CcsdsComponentArgs ccsdsArgs(*gpioComIF, *ipcStore, *tmStore, stores, *pusFunnel, *cfdpFunnel, - &ipCoreHandler); - createCcsdsIpComponentsAddTmRouting(ccsdsArgs); + &ipCoreHandler, 0, 0); + createCcsdsIpComponentsWrapper(ccsdsArgs); #endif /* OBSW_ADD_CCSDS_IP_CORES == 1 */ #if OBSW_ADD_SCEX_DEVICE == 1 diff --git a/bsp_q7s/objectFactory.cpp b/bsp_q7s/objectFactory.cpp index c8e6f555..552eb6a6 100644 --- a/bsp_q7s/objectFactory.cpp +++ b/bsp_q7s/objectFactory.cpp @@ -834,9 +834,9 @@ ReturnValue_t ObjectFactory::createCcsdsComponents(CcsdsComponentArgs& args) { uioNames.configMemory = q7s::UIO_PDEC_CONFIG_MEMORY; uioNames.ramMemory = q7s::UIO_PDEC_RAM; uioNames.registers = q7s::UIO_PDEC_REGISTERS; - uioNames.irq = q7s::UIO_PDEC_IRQ; + uint32_t cfgMemAddr = config::pdec::PDEC_CONFIG_BASE_ADDR_LEGACY; new PdecHandler(objects::PDEC_HANDLER, objects::CCSDS_HANDLER, &args.gpioComIF, - gpioIds::PDEC_RESET, uioNames); + gpioIds::PDEC_RESET, uioNames, args.pdecCfgMemBaseAddr, args.pdecRamBaseAddr); GpioCookie* gpioRS485Chip = new GpioCookie; gpio = new GpiodRegularByLineName(q7s::gpioNames::RS485_EN_TX_CLOCK, "RS485 Transceiver", Direction::OUT, Levels::LOW); @@ -1062,7 +1062,13 @@ ReturnValue_t ObjectFactory::readFirmwareVersion() { return returnvalue::OK; } -ReturnValue_t ObjectFactory::createCcsdsIpComponentsAddTmRouting(CcsdsComponentArgs& ccsdsArgs) { +ReturnValue_t ObjectFactory::createCcsdsIpComponentsWrapper(CcsdsComponentArgs& ccsdsArgs) { + ccsdsArgs.pdecCfgMemBaseAddr = config::pdec::PDEC_CONFIG_BASE_ADDR; + ccsdsArgs.pdecRamBaseAddr = config::pdec::PDEC_RAM_ADDR; + if (core::FW_VERSION_MAJOR < 6) { + ccsdsArgs.pdecCfgMemBaseAddr = config::pdec::PDEC_CONFIG_BASE_ADDR_LEGACY; + ccsdsArgs.pdecRamBaseAddr = config::pdec::PDEC_RAM_ADDR_LEGACY; + } ReturnValue_t result = createCcsdsComponents(ccsdsArgs); #if OBSW_TM_TO_PTME == 1 if (ccsdsArgs.normalLiveTmDest != MessageQueueIF::NO_QUEUE) { diff --git a/bsp_q7s/objectFactory.h b/bsp_q7s/objectFactory.h index 223031e6..b3dfa83b 100644 --- a/bsp_q7s/objectFactory.h +++ b/bsp_q7s/objectFactory.h @@ -31,14 +31,17 @@ namespace ObjectFactory { struct CcsdsComponentArgs { CcsdsComponentArgs(LinuxLibgpioIF& gpioIF, StorageManagerIF& ipcStore, StorageManagerIF& tmStore, PersistentTmStores& stores, PusTmFunnel& pusFunnel, CfdpTmFunnel& cfdpFunnel, - CcsdsIpCoreHandler** ipCoreHandler) + CcsdsIpCoreHandler** ipCoreHandler, uint32_t pdecCfgMemBaseAddr, + uint32_t pdecRamBaseAddr) : gpioComIF(gpioIF), ipcStore(ipcStore), tmStore(tmStore), stores(stores), pusFunnel(pusFunnel), cfdpFunnel(cfdpFunnel), - ipCoreHandler(ipCoreHandler) {} + ipCoreHandler(ipCoreHandler), + pdecCfgMemBaseAddr(pdecCfgMemBaseAddr), + pdecRamBaseAddr(pdecRamBaseAddr) {} LinuxLibgpioIF& gpioComIF; StorageManagerIF& ipcStore; StorageManagerIF& tmStore; @@ -46,6 +49,8 @@ struct CcsdsComponentArgs { PusTmFunnel& pusFunnel; CfdpTmFunnel& cfdpFunnel; CcsdsIpCoreHandler** ipCoreHandler; + uint32_t pdecCfgMemBaseAddr; + uint32_t pdecRamBaseAddr; MessageQueueId_t normalLiveTmDest = MessageQueueIF::NO_QUEUE; MessageQueueId_t cfdpLiveTmDest = MessageQueueIF::NO_QUEUE; }; @@ -75,7 +80,7 @@ void createSolarArrayDeploymentComponents(PowerSwitchIF& pwrSwitcher, GpioIF& gp void createSyrlinksComponents(PowerSwitchIF* pwrSwitcher); void createPayloadComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchIF& pwrSwitcher); void createReactionWheelComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchIF* pwrSwitcher); -ReturnValue_t createCcsdsIpComponentsAddTmRouting(CcsdsComponentArgs& args); +ReturnValue_t createCcsdsIpComponentsWrapper(CcsdsComponentArgs& args); ReturnValue_t createCcsdsComponents(CcsdsComponentArgs& args); ReturnValue_t readFirmwareVersion(); void createMiscComponents(); diff --git a/common/config/eive/definitions.h b/common/config/eive/definitions.h index 033d703f..0b63a017 100644 --- a/common/config/eive/definitions.h +++ b/common/config/eive/definitions.h @@ -116,8 +116,17 @@ static constexpr float SCHED_BLOCK_10_PERIOD = } // namespace spiSched namespace pdec { + +// Pre FW v6.0.0 static constexpr uint32_t PDEC_CONFIG_BASE_ADDR_LEGACY = 0x24000000; -} +static constexpr uint32_t PDEC_RAM_ADDR_LEGACY = 0x26000000; + +// Post FW v6.0.0 +static constexpr uint32_t PDEC_CONFIG_BASE_ADDR = 0x4000000; +static constexpr uint32_t PDEC_RAM_ADDR = 0x7000000; + +} // namespace pdec + } // namespace config #endif /* COMMON_CONFIG_DEFINITIONS_H_ */ diff --git a/linux/ipcore/PdecHandler.h b/linux/ipcore/PdecHandler.h index 1119999c..c2badb62 100644 --- a/linux/ipcore/PdecHandler.h +++ b/linux/ipcore/PdecHandler.h @@ -52,9 +52,9 @@ class PdecHandler : public SystemObject, public: static constexpr dur_millis_t IRQ_TIMEOUT_MS = 500; static constexpr uint32_t PDEC_CFG_MEM_SIZE = 0x1000; - //static constexpr uint32_t PDEC_CFG_MEM_PHY_ADDR = 0x24000000; + // static constexpr uint32_t PDEC_CFG_MEM_PHY_ADDR = 0x24000000; static constexpr uint32_t PDEC_RAM_SIZE = 0x10000; - //static constexpr uint32_t PDEC_RAM_PHY_ADDR = 0x26000000; + // static constexpr uint32_t PDEC_RAM_PHY_ADDR = 0x26000000; enum class Modes { POLLED, IRQ }; diff --git a/tmtc b/tmtc index 8f8bcde9..97f99415 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 8f8bcde90e3b9113388cfedc47775426888d0781 +Subproject commit 97f99415d6be40d35bf9c373fea40b41c8457386 From 94f3d89f7b98c3172c30266cb3f2bf77d2be0eb2 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 25 Oct 2023 09:11:45 +0200 Subject: [PATCH 223/257] smaller tweak --- bsp_q7s/objectFactory.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/bsp_q7s/objectFactory.cpp b/bsp_q7s/objectFactory.cpp index 552eb6a6..dff68f1f 100644 --- a/bsp_q7s/objectFactory.cpp +++ b/bsp_q7s/objectFactory.cpp @@ -834,7 +834,6 @@ ReturnValue_t ObjectFactory::createCcsdsComponents(CcsdsComponentArgs& args) { uioNames.configMemory = q7s::UIO_PDEC_CONFIG_MEMORY; uioNames.ramMemory = q7s::UIO_PDEC_RAM; uioNames.registers = q7s::UIO_PDEC_REGISTERS; - uint32_t cfgMemAddr = config::pdec::PDEC_CONFIG_BASE_ADDR_LEGACY; new PdecHandler(objects::PDEC_HANDLER, objects::CCSDS_HANDLER, &args.gpioComIF, gpioIds::PDEC_RESET, uioNames, args.pdecCfgMemBaseAddr, args.pdecRamBaseAddr); GpioCookie* gpioRS485Chip = new GpioCookie; From d5ca0f9f5e1b1ff22b757cfc571cbb96f68ce70a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 25 Oct 2023 09:45:16 +0200 Subject: [PATCH 224/257] should not delete that --- bsp_q7s/objectFactory.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/bsp_q7s/objectFactory.cpp b/bsp_q7s/objectFactory.cpp index dff68f1f..479d59c0 100644 --- a/bsp_q7s/objectFactory.cpp +++ b/bsp_q7s/objectFactory.cpp @@ -834,6 +834,7 @@ ReturnValue_t ObjectFactory::createCcsdsComponents(CcsdsComponentArgs& args) { uioNames.configMemory = q7s::UIO_PDEC_CONFIG_MEMORY; uioNames.ramMemory = q7s::UIO_PDEC_RAM; uioNames.registers = q7s::UIO_PDEC_REGISTERS; + uioNames.irq = q7s::UIO_PDEC_IRQ; new PdecHandler(objects::PDEC_HANDLER, objects::CCSDS_HANDLER, &args.gpioComIF, gpioIds::PDEC_RESET, uioNames, args.pdecCfgMemBaseAddr, args.pdecRamBaseAddr); GpioCookie* gpioRS485Chip = new GpioCookie; From c784d1251b6a019360d4e28a7afd5b00d953b265 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 25 Oct 2023 09:54:29 +0200 Subject: [PATCH 225/257] remove old code --- linux/ipcore/PdecHandler.cpp | 5 ----- linux/ipcore/PdecHandler.h | 2 -- 2 files changed, 7 deletions(-) diff --git a/linux/ipcore/PdecHandler.cpp b/linux/ipcore/PdecHandler.cpp index d9065314..28598aa8 100644 --- a/linux/ipcore/PdecHandler.cpp +++ b/linux/ipcore/PdecHandler.cpp @@ -469,11 +469,6 @@ bool PdecHandler::newTcReceived() { } void PdecHandler::doPeriodicWork() { - // scuffed test code - // if(testCntr < 30) { - // triggerEvent(pdec::INVALID_TC_FRAME, FRAME_DIRTY_RETVAL); - // testCntr++; - // } checkLocks(); } diff --git a/linux/ipcore/PdecHandler.h b/linux/ipcore/PdecHandler.h index c2badb62..8832b5d5 100644 --- a/linux/ipcore/PdecHandler.h +++ b/linux/ipcore/PdecHandler.h @@ -52,9 +52,7 @@ class PdecHandler : public SystemObject, public: static constexpr dur_millis_t IRQ_TIMEOUT_MS = 500; static constexpr uint32_t PDEC_CFG_MEM_SIZE = 0x1000; - // static constexpr uint32_t PDEC_CFG_MEM_PHY_ADDR = 0x24000000; static constexpr uint32_t PDEC_RAM_SIZE = 0x10000; - // static constexpr uint32_t PDEC_RAM_PHY_ADDR = 0x26000000; enum class Modes { POLLED, IRQ }; From f8d4eb04a56fa9b63dceb3bc0e5960bcafda0aa3 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 25 Oct 2023 17:47:51 +0200 Subject: [PATCH 226/257] slight improvement --- bsp_q7s/boardconfig/busConf.h | 3 ++- bsp_q7s/objectFactory.cpp | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/bsp_q7s/boardconfig/busConf.h b/bsp_q7s/boardconfig/busConf.h index dc3779a7..aab8ce44 100644 --- a/bsp_q7s/boardconfig/busConf.h +++ b/bsp_q7s/boardconfig/busConf.h @@ -18,7 +18,8 @@ static constexpr char I2C_Q7_EIVE[] = "/dev/i2c_q7"; static constexpr char UART_GNSS_DEV[] = "/dev/gps0"; static constexpr char UART_PLOC_MPSOC_DEV[] = "/dev/ul_plmpsoc"; -static constexpr char UART_PLOC_SUPERVSIOR_DEV[] = "/dev/ploc_supv"; +static constexpr char UART_PLOC_SUPERVISOR_DEV_FALLBACK[] = "/dev/ttyUL4"; +static constexpr char UART_PLOC_SUPERVISOR_DEV[] = "/dev/ploc_supv"; static constexpr char UART_SYRLINKS_DEV[] = "/dev/ul_syrlinks"; static constexpr char UART_STAR_TRACKER_DEV[] = "/dev/ul_str"; static constexpr char UART_SCEX_DEV[] = "/dev/scex"; diff --git a/bsp_q7s/objectFactory.cpp b/bsp_q7s/objectFactory.cpp index 479d59c0..d0c0f924 100644 --- a/bsp_q7s/objectFactory.cpp +++ b/bsp_q7s/objectFactory.cpp @@ -642,8 +642,12 @@ void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF, PowerSwit auto supvGpioCookie = new GpioCookie; supvGpioCookie->addGpio(gpioIds::ENABLE_SUPV_UART, gpioConfigSupv); gpioComIF->addGpios(supvGpioCookie); + const char* plocSupvDev = q7s::UART_PLOC_SUPERVISOR_DEV; + if(not std::filesystem::exists(plocSupvDev)) { + plocSupvDev = q7s::UART_PLOC_SUPERVISOR_DEV_FALLBACK; + } auto supervisorCookie = new SerialCookie(objects::PLOC_SUPERVISOR_HANDLER, - q7s::UART_PLOC_SUPERVSIOR_DEV, serial::PLOC_SUPV_BAUD, + plocSupvDev, serial::PLOC_SUPV_BAUD, supv::MAX_PACKET_SIZE * 20, UartModes::NON_CANONICAL); supervisorCookie->setNoFixedSizeReply(); auto supvHelper = new PlocSupvUartManager(objects::PLOC_SUPERVISOR_HELPER); From 93e3f3578d2d542c1dfb86ae470b9329bca780e5 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 25 Oct 2023 17:48:28 +0200 Subject: [PATCH 227/257] swap RTDs --- common/config/devices/gpioIds.h | 6 +-- linux/ObjectFactory.cpp | 46 +++++++++-------- linux/callbacks/gpioCallbacks.cpp | 84 +++++++++++++++---------------- tmtc | 2 +- 4 files changed, 71 insertions(+), 67 deletions(-) diff --git a/common/config/devices/gpioIds.h b/common/config/devices/gpioIds.h index bed82142..2cab2c32 100644 --- a/common/config/devices/gpioIds.h +++ b/common/config/devices/gpioIds.h @@ -37,6 +37,9 @@ enum gpioId_t { TEST_ID_0, TEST_ID_1, + RTD_IC_0, + RTD_IC_1, + RTD_IC_2, RTD_IC_3, RTD_IC_4, RTD_IC_5, @@ -50,9 +53,6 @@ enum gpioId_t { RTD_IC_13, RTD_IC_14, RTD_IC_15, - RTD_IC_16, - RTD_IC_17, - RTD_IC_18, CS_SUS_0, CS_SUS_1, diff --git a/linux/ObjectFactory.cpp b/linux/ObjectFactory.cpp index cb3e043b..756dc0af 100644 --- a/linux/ObjectFactory.cpp +++ b/linux/ObjectFactory.cpp @@ -206,74 +206,78 @@ void ObjectFactory::createRtdComponents(std::string spiDev, GpioIF* gpioComIF, GpioCallback* gpioRtdIc0 = new GpioCallback("Chip select RTD IC0", Direction::OUT, Levels::HIGH, &gpioCallbacks::spiCsDecoderCallback, gpioComIF); - rtdGpioCookie->addGpio(gpioIds::RTD_IC_3, gpioRtdIc0); + rtdGpioCookie->addGpio(gpioIds::RTD_IC_0, gpioRtdIc0); GpioCallback* gpioRtdIc1 = new GpioCallback("Chip select RTD IC1", Direction::OUT, Levels::HIGH, &gpioCallbacks::spiCsDecoderCallback, gpioComIF); - rtdGpioCookie->addGpio(gpioIds::RTD_IC_4, gpioRtdIc1); + rtdGpioCookie->addGpio(gpioIds::RTD_IC_1, gpioRtdIc1); GpioCallback* gpioRtdIc2 = new GpioCallback("Chip select RTD IC2", Direction::OUT, Levels::HIGH, &gpioCallbacks::spiCsDecoderCallback, gpioComIF); - rtdGpioCookie->addGpio(gpioIds::RTD_IC_5, gpioRtdIc2); + rtdGpioCookie->addGpio(gpioIds::RTD_IC_2, gpioRtdIc2); GpioCallback* gpioRtdIc3 = new GpioCallback("Chip select RTD IC3", Direction::OUT, Levels::HIGH, &gpioCallbacks::spiCsDecoderCallback, gpioComIF); - rtdGpioCookie->addGpio(gpioIds::RTD_IC_6, gpioRtdIc3); + rtdGpioCookie->addGpio(gpioIds::RTD_IC_3, gpioRtdIc3); GpioCallback* gpioRtdIc4 = new GpioCallback("Chip select RTD IC4", Direction::OUT, Levels::HIGH, &gpioCallbacks::spiCsDecoderCallback, gpioComIF); - rtdGpioCookie->addGpio(gpioIds::RTD_IC_7, gpioRtdIc4); + rtdGpioCookie->addGpio(gpioIds::RTD_IC_4, gpioRtdIc4); GpioCallback* gpioRtdIc5 = new GpioCallback("Chip select RTD IC5", Direction::OUT, Levels::HIGH, &gpioCallbacks::spiCsDecoderCallback, gpioComIF); - rtdGpioCookie->addGpio(gpioIds::RTD_IC_8, gpioRtdIc5); + rtdGpioCookie->addGpio(gpioIds::RTD_IC_5, gpioRtdIc5); GpioCallback* gpioRtdIc6 = new GpioCallback("Chip select RTD IC6", Direction::OUT, Levels::HIGH, &gpioCallbacks::spiCsDecoderCallback, gpioComIF); - rtdGpioCookie->addGpio(gpioIds::RTD_IC_9, gpioRtdIc6); + rtdGpioCookie->addGpio(gpioIds::RTD_IC_6, gpioRtdIc6); GpioCallback* gpioRtdIc7 = new GpioCallback("Chip select RTD IC7", Direction::OUT, Levels::HIGH, &gpioCallbacks::spiCsDecoderCallback, gpioComIF); - rtdGpioCookie->addGpio(gpioIds::RTD_IC_10, gpioRtdIc7); + rtdGpioCookie->addGpio(gpioIds::RTD_IC_7, gpioRtdIc7); GpioCallback* gpioRtdIc8 = new GpioCallback("Chip select RTD IC8", Direction::OUT, Levels::HIGH, &gpioCallbacks::spiCsDecoderCallback, gpioComIF); - rtdGpioCookie->addGpio(gpioIds::RTD_IC_11, gpioRtdIc8); + rtdGpioCookie->addGpio(gpioIds::RTD_IC_8, gpioRtdIc8); GpioCallback* gpioRtdIc9 = new GpioCallback("Chip select RTD IC9", Direction::OUT, Levels::HIGH, &gpioCallbacks::spiCsDecoderCallback, gpioComIF); - rtdGpioCookie->addGpio(gpioIds::RTD_IC_12, gpioRtdIc9); + rtdGpioCookie->addGpio(gpioIds::RTD_IC_9, gpioRtdIc9); GpioCallback* gpioRtdIc10 = new GpioCallback("Chip select RTD IC10", Direction::OUT, Levels::HIGH, &gpioCallbacks::spiCsDecoderCallback, gpioComIF); - rtdGpioCookie->addGpio(gpioIds::RTD_IC_13, gpioRtdIc10); + rtdGpioCookie->addGpio(gpioIds::RTD_IC_10, gpioRtdIc10); GpioCallback* gpioRtdIc11 = new GpioCallback("Chip select RTD IC11", Direction::OUT, Levels::HIGH, &gpioCallbacks::spiCsDecoderCallback, gpioComIF); - rtdGpioCookie->addGpio(gpioIds::RTD_IC_14, gpioRtdIc11); + rtdGpioCookie->addGpio(gpioIds::RTD_IC_11, gpioRtdIc11); GpioCallback* gpioRtdIc12 = new GpioCallback("Chip select RTD IC12", Direction::OUT, Levels::HIGH, &gpioCallbacks::spiCsDecoderCallback, gpioComIF); - rtdGpioCookie->addGpio(gpioIds::RTD_IC_15, gpioRtdIc12); + rtdGpioCookie->addGpio(gpioIds::RTD_IC_12, gpioRtdIc12); GpioCallback* gpioRtdIc13 = new GpioCallback("Chip select RTD IC13", Direction::OUT, Levels::HIGH, &gpioCallbacks::spiCsDecoderCallback, gpioComIF); - rtdGpioCookie->addGpio(gpioIds::RTD_IC_16, gpioRtdIc13); + rtdGpioCookie->addGpio(gpioIds::RTD_IC_13, gpioRtdIc13); GpioCallback* gpioRtdIc14 = new GpioCallback("Chip select RTD IC14", Direction::OUT, Levels::HIGH, &gpioCallbacks::spiCsDecoderCallback, gpioComIF); - rtdGpioCookie->addGpio(gpioIds::RTD_IC_17, gpioRtdIc14); + rtdGpioCookie->addGpio(gpioIds::RTD_IC_14, gpioRtdIc14); GpioCallback* gpioRtdIc15 = new GpioCallback("Chip select RTD IC15", Direction::OUT, Levels::HIGH, &gpioCallbacks::spiCsDecoderCallback, gpioComIF); - rtdGpioCookie->addGpio(gpioIds::RTD_IC_18, gpioRtdIc15); + rtdGpioCookie->addGpio(gpioIds::RTD_IC_15, gpioRtdIc15); gpioChecker(gpioComIF->addGpios(rtdGpioCookie), "RTDs"); #if OBSW_ADD_RTD_DEVICES == 1 using namespace EiveMax31855; + // ! NOTE ! + // The chip selects for device 9 and 11 are swapped here. It is strongly suspected the cables + // for those devices were swapped during integration. This is probably the easiest way to + // fix the issue. std::array, NUM_RTDS> cookieArgs = {{ + {addresses::RTD_IC_0, gpioIds::RTD_IC_0}, + {addresses::RTD_IC_1, gpioIds::RTD_IC_1}, + {addresses::RTD_IC_2, gpioIds::RTD_IC_2}, {addresses::RTD_IC_3, gpioIds::RTD_IC_3}, {addresses::RTD_IC_4, gpioIds::RTD_IC_4}, {addresses::RTD_IC_5, gpioIds::RTD_IC_5}, {addresses::RTD_IC_6, gpioIds::RTD_IC_6}, {addresses::RTD_IC_7, gpioIds::RTD_IC_7}, {addresses::RTD_IC_8, gpioIds::RTD_IC_8}, - {addresses::RTD_IC_9, gpioIds::RTD_IC_9}, - {addresses::RTD_IC_10, gpioIds::RTD_IC_10}, {addresses::RTD_IC_11, gpioIds::RTD_IC_11}, + {addresses::RTD_IC_10, gpioIds::RTD_IC_10}, + {addresses::RTD_IC_9, gpioIds::RTD_IC_9}, {addresses::RTD_IC_12, gpioIds::RTD_IC_12}, {addresses::RTD_IC_13, gpioIds::RTD_IC_13}, {addresses::RTD_IC_14, gpioIds::RTD_IC_14}, {addresses::RTD_IC_15, gpioIds::RTD_IC_15}, - {addresses::RTD_IC_16, gpioIds::RTD_IC_16}, - {addresses::RTD_IC_17, gpioIds::RTD_IC_17}, - {addresses::RTD_IC_18, gpioIds::RTD_IC_18}, }}; // HSPD: Heatspreader diff --git a/linux/callbacks/gpioCallbacks.cpp b/linux/callbacks/gpioCallbacks.cpp index 969aada0..4c05bac3 100644 --- a/linux/callbacks/gpioCallbacks.cpp +++ b/linux/callbacks/gpioCallbacks.cpp @@ -21,6 +21,18 @@ void gpioCallbacks::spiCsDecoderCallback(gpioId_t gpioId, gpio::GpioOperation gp if (value == gpio::Levels::HIGH) { switch (gpioId) { + case (gpioIds::RTD_IC_0): { + disableDecoderTcsIc1(gpioIF); + break; + } + case (gpioIds::RTD_IC_1): { + disableDecoderTcsIc1(gpioIF); + break; + } + case (gpioIds::RTD_IC_2): { + disableDecoderTcsIc1(gpioIF); + break; + } case (gpioIds::RTD_IC_3): { disableDecoderTcsIc1(gpioIF); break; @@ -42,15 +54,15 @@ void gpioCallbacks::spiCsDecoderCallback(gpioId_t gpioId, gpio::GpioOperation gp break; } case (gpioIds::RTD_IC_8): { - disableDecoderTcsIc1(gpioIF); + disableDecoderTcsIc2(gpioIF); break; } case (gpioIds::RTD_IC_9): { - disableDecoderTcsIc1(gpioIF); + disableDecoderTcsIc2(gpioIF); break; } case (gpioIds::RTD_IC_10): { - disableDecoderTcsIc1(gpioIF); + disableDecoderTcsIc2(gpioIF); break; } case (gpioIds::RTD_IC_11): { @@ -73,18 +85,6 @@ void gpioCallbacks::spiCsDecoderCallback(gpioId_t gpioId, gpio::GpioOperation gp disableDecoderTcsIc2(gpioIF); break; } - case (gpioIds::RTD_IC_16): { - disableDecoderTcsIc2(gpioIF); - break; - } - case (gpioIds::RTD_IC_17): { - disableDecoderTcsIc2(gpioIF); - break; - } - case (gpioIds::RTD_IC_18): { - disableDecoderTcsIc2(gpioIF); - break; - } case (gpioIds::CS_SUS_0): { disableDecoderInterfaceBoardIc1(gpioIF); break; @@ -154,82 +154,82 @@ void gpioCallbacks::spiCsDecoderCallback(gpioId_t gpioId, gpio::GpioOperation gp } } else if (value == gpio::Levels::LOW) { switch (gpioId) { - case (gpioIds::RTD_IC_3): { + case (gpioIds::RTD_IC_0): { selectY7(gpioIF); enableDecoderTcsIc1(gpioIF); break; } + case (gpioIds::RTD_IC_1): { + selectY6(gpioIF); + enableDecoderTcsIc1(gpioIF); + break; + } + case (gpioIds::RTD_IC_2): { + selectY5(gpioIF); + enableDecoderTcsIc1(gpioIF); + break; + } + case (gpioIds::RTD_IC_3): { + selectY4(gpioIF); + enableDecoderTcsIc1(gpioIF); + break; + } case (gpioIds::RTD_IC_4): { - selectY6(gpioIF); + selectY3(gpioIF); enableDecoderTcsIc1(gpioIF); break; } case (gpioIds::RTD_IC_5): { - selectY5(gpioIF); + selectY2(gpioIF); enableDecoderTcsIc1(gpioIF); break; } case (gpioIds::RTD_IC_6): { - selectY4(gpioIF); + selectY1(gpioIF); enableDecoderTcsIc1(gpioIF); break; } case (gpioIds::RTD_IC_7): { - selectY3(gpioIF); - enableDecoderTcsIc1(gpioIF); - break; - } - case (gpioIds::RTD_IC_8): { - selectY2(gpioIF); - enableDecoderTcsIc1(gpioIF); - break; - } - case (gpioIds::RTD_IC_9): { - selectY1(gpioIF); - enableDecoderTcsIc1(gpioIF); - break; - } - case (gpioIds::RTD_IC_10): { selectY0(gpioIF); enableDecoderTcsIc1(gpioIF); break; } - case (gpioIds::RTD_IC_11): { + case (gpioIds::RTD_IC_8): { selectY7(gpioIF); enableDecoderTcsIc2(gpioIF); break; } - case (gpioIds::RTD_IC_12): { + case (gpioIds::RTD_IC_9): { selectY6(gpioIF); enableDecoderTcsIc2(gpioIF); break; } - case (gpioIds::RTD_IC_13): { + case (gpioIds::RTD_IC_10): { selectY5(gpioIF); enableDecoderTcsIc2(gpioIF); break; } - case (gpioIds::RTD_IC_14): { + case (gpioIds::RTD_IC_11): { selectY4(gpioIF); enableDecoderTcsIc2(gpioIF); break; } - case (gpioIds::RTD_IC_15): { + case (gpioIds::RTD_IC_12): { selectY3(gpioIF); enableDecoderTcsIc2(gpioIF); break; } - case (gpioIds::RTD_IC_16): { + case (gpioIds::RTD_IC_13): { selectY2(gpioIF); enableDecoderTcsIc2(gpioIF); break; } - case (gpioIds::RTD_IC_17): { + case (gpioIds::RTD_IC_14): { selectY1(gpioIF); enableDecoderTcsIc2(gpioIF); break; } - case (gpioIds::RTD_IC_18): { + case (gpioIds::RTD_IC_15): { selectY0(gpioIF); enableDecoderTcsIc2(gpioIF); break; diff --git a/tmtc b/tmtc index 60f7ae54..97f99415 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 60f7ae5453b387ee5ebcf6a338c34284004dbce7 +Subproject commit 97f99415d6be40d35bf9c373fea40b41c8457386 From b7e33ebcb673cf573378f2f76d065ac8d896d586 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 25 Oct 2023 17:49:31 +0200 Subject: [PATCH 228/257] changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9308d71d..c061f0d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,12 @@ will consitute of a breaking change warranting a new major release: is not in normal mode. - MPSoC debug mode. +## Changed + +- Swapped RTD 9 and RTD 11 chip select definitions. It is strongly suspected the cables + for those devices were swapped during integration. This is probably the easiest way to + fix the issue. + # [v7.1.0] 2023-10-11 - Bumped `eive-tmtc` to v5.8.0. From ef2e62e418bfdf687ad631c2d69e529f6de8528d Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 25 Oct 2023 17:51:41 +0200 Subject: [PATCH 229/257] changelog clarification --- CHANGELOG.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c061f0d0..e104aeba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,9 +38,10 @@ will consitute of a breaking change warranting a new major release: ## Changed -- Swapped RTD 9 and RTD 11 chip select definitions. It is strongly suspected the cables - for those devices were swapped during integration. This is probably the easiest way to - fix the issue. +- Swapped RTD 9 (PLOC HPA Sensor) and RTD 11 (PLOC MPA Sensor) chip select definitions. It is + strongly suspected the cables for those devices were swapped during integration. This is probably + the easiest way to fix the issue without the need to tweak ground or other OBSW or controller + code. # [v7.1.0] 2023-10-11 From 7c765d037bff7be3d2ce37f1cb35f2046a4a11c2 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 25 Oct 2023 18:17:51 +0200 Subject: [PATCH 230/257] compile fix --- common/config/devices/addresses.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/config/devices/addresses.h b/common/config/devices/addresses.h index c1e65314..e1598574 100644 --- a/common/config/devices/addresses.h +++ b/common/config/devices/addresses.h @@ -54,6 +54,9 @@ enum I2cAddress : address_t { }; enum spiAddresses : address_t { + RTD_IC_0, + RTD_IC_1, + RTD_IC_2, RTD_IC_3, RTD_IC_4, RTD_IC_5, @@ -67,9 +70,6 @@ enum spiAddresses : address_t { RTD_IC_13, RTD_IC_14, RTD_IC_15, - RTD_IC_16, - RTD_IC_17, - RTD_IC_18, RW1, RW2, RW3, From 54c2fc964662bb655af4f001c4d5c423e4bb4de9 Mon Sep 17 00:00:00 2001 From: meggert Date: Thu, 26 Oct 2023 09:52:25 +0200 Subject: [PATCH 231/257] validity handling --- mission/acs/str/StarTrackerHandler.cpp | 36 ++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/mission/acs/str/StarTrackerHandler.cpp b/mission/acs/str/StarTrackerHandler.cpp index 0e81b7e4..94a29f01 100644 --- a/mission/acs/str/StarTrackerHandler.cpp +++ b/mission/acs/str/StarTrackerHandler.cpp @@ -953,6 +953,42 @@ void StarTrackerHandler::addSecondaryTmForNormalMode(DeviceCommandId_t cmd) { void StarTrackerHandler::resetSecondaryTmSet() { additionalRequestedTm.clear(); additionalRequestedTm.emplace(startracker::REQ_TEMPERATURE); + { + PoolReadGuard pg(&autoBlobSet); + if (pg.getReadResult() == returnvalue::OK) { + autoBlobSet.setValidity(false, true); + } + } + { + PoolReadGuard pg(&matchedCentroidsSet); + if (pg.getReadResult() == returnvalue::OK) { + matchedCentroidsSet.setValidity(false, true); + } + } + { + PoolReadGuard pg(&blobSet); + if (pg.getReadResult() == returnvalue::OK) { + blobSet.setValidity(false, true); + } + } + { + PoolReadGuard pg(&blobsSet); + if (pg.getReadResult() == returnvalue::OK) { + blobsSet.setValidity(false, true); + } + } + { + PoolReadGuard pg(¢roidSet); + if (pg.getReadResult() == returnvalue::OK) { + centroidSet.setValidity(false, true); + } + } + { + PoolReadGuard pg(¢roidsSet); + if (pg.getReadResult() == returnvalue::OK) { + centroidsSet.setValidity(false, true); + } + } } void StarTrackerHandler::bootBootloader() { From 534ddde9e83c5df19af3f88b46fa86e586a56daa Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 26 Oct 2023 11:19:21 +0200 Subject: [PATCH 232/257] ploc supv debug mode --- linux/payload/PlocSupervisorHandler.cpp | 232 +----------------------- linux/payload/PlocSupervisorHandler.h | 17 +- tmtc | 2 +- 3 files changed, 8 insertions(+), 243 deletions(-) diff --git a/linux/payload/PlocSupervisorHandler.cpp b/linux/payload/PlocSupervisorHandler.cpp index 0c6311de..81af2ade 100644 --- a/linux/payload/PlocSupervisorHandler.cpp +++ b/linux/payload/PlocSupervisorHandler.cpp @@ -223,6 +223,7 @@ ReturnValue_t PlocSupervisorHandler::buildCommandFromCommand(DeviceCommandId_t d break; } case RESET_MPSOC: { + sif::info << "PLOC SUPV: Resetting MPSoC" << std::endl; prepareEmptyCmd(Apid::BOOT_MAN, static_cast(tc::BootManId::RESET_MPSOC)); result = returnvalue::OK; break; @@ -320,85 +321,6 @@ ReturnValue_t PlocSupervisorHandler::buildCommandFromCommand(DeviceCommandId_t d result = prepareWipeMramCmd(commandData); break; } - // case ENABLE_NVMS: { - // result = prepareEnableNvmsCommand(commandData); - // break; - // } - // case RESTART_SUPERVISOR: { - // prepareEmptyCmd(APID_RESTART_SUPERVISOR); - // result = returnvalue::OK; - // break; - // } - // Removed command - // case START_MPSOC_QUIET: { - // prepareEmptyCmd(APID_START_MPSOC_QUIET); - // result = returnvalue::OK; - // break; - // } - // case ENABLE_AUTO_TM: { - // EnableAutoTm packet(spParams); - // result = packet.buildPacket(); - // if (result != returnvalue::OK) { - // break; - // } - // finishTcPrep(packet.getFullPacketLen()); - // break; - // } - // case DISABLE_AUTO_TM: { - // DisableAutoTm packet(spParams); - // result = packet.buildPacket(); - // if (result != returnvalue::OK) { - // break; - // } - // finishTcPrep(packet.getFullPacketLen()); - // break; - // } - // case LOGGING_REQUEST_COUNTERS: { - // RequestLoggingData packet(spParams); - // result = packet.buildPacket(RequestLoggingData::Sa::REQUEST_COUNTERS); - // if (result != returnvalue::OK) { - // break; - // } - // finishTcPrep(packet.getFullPacketLen()); - // break; - // } - // case LOGGING_CLEAR_COUNTERS: { - // RequestLoggingData packet(spParams); - // result = packet.buildPacket(RequestLoggingData::Sa::CLEAR_COUNTERS); - // if (result != returnvalue::OK) { - // break; - // } - // finishTcPrep(packet.getFullPacketLen()); - // break; - // } - // case LOGGING_SET_TOPIC: { - // if (commandData == nullptr or commandDataLen == 0) { - // return HasActionsIF::INVALID_PARAMETERS; - // } - // uint8_t tpc = *(commandData); - // RequestLoggingData packet(spParams); - // result = packet.buildPacket(RequestLoggingData::Sa::SET_LOGGING_TOPIC, tpc); - // if (result != returnvalue::OK) { - // break; - // } - // finishTcPrep(packet.getFullPacketLen()); - // break; - // } - // I think this is disabled right now according to the TC excel table - // case COPY_ADC_DATA_TO_MRAM: { - // prepareEmptyCmd(APID_COPY_ADC_DATA_TO_MRAM); - // result = returnvalue::OK; - // break; - // } - // case REQUEST_ADC_REPORT: { - // prepareEmptyCmd(APID_REQUEST_ADC_REPORT); - // result = returnvalue::OK; - // break; - // } - // case FIRST_MRAM_DUMP: - // case CONSECUTIVE_MRAM_DUMP: - // result = prepareDumpMramCmd(commandData); - // break; default: sif::debug << "PlocSupervisorHandler::buildCommandFromCommand: Command not implemented" << std::endl; @@ -550,23 +472,17 @@ ReturnValue_t PlocSupervisorHandler::enableReplyInReplyMap(DeviceCommandMap::ite case SET_ADC_ENABLED_CHANNELS: case SET_ADC_WINDOW_AND_STRIDE: case SET_ADC_THRESHOLD: - // case COPY_ADC_DATA_TO_MRAM: case RUN_AUTO_EM_TESTS: case WIPE_MRAM: case SET_GPIO: case FACTORY_RESET: case READ_GPIO: - // case RESTART_SUPERVISOR: case DISABLE_PERIOIC_HK_TRANSMISSION: - // case START_MPSOC_QUIET: case SET_SHUTDOWN_TIMEOUT: case FACTORY_FLASH: case ENABLE_AUTO_TM: case DISABLE_AUTO_TM: - // case LOGGING_CLEAR_COUNTERS: - // case LOGGING_SET_TOPIC: case RESET_PL: - // case ENABLE_NVMS: enabledReplies = 2; break; default: @@ -598,19 +514,14 @@ ReturnValue_t PlocSupervisorHandler::enableReplyInReplyMap(DeviceCommandMap::ite ReturnValue_t PlocSupervisorHandler::scanForReply(const uint8_t* start, size_t remainingSize, DeviceCommandId_t* foundId, size_t* foundLen) { using namespace supv; - // TODO: Is this still required? - // if (nextReplyId == FIRST_MRAM_DUMP) { - // *foundId = FIRST_MRAM_DUMP; - // return parseMramPackets(start, remainingSize, foundLen); - // } else if (nextReplyId == CONSECUTIVE_MRAM_DUMP) { - // *foundId = CONSECUTIVE_MRAM_DUMP; - // return parseMramPackets(start, remainingSize, foundLen); - // } tmReader.setData(start, remainingSize); - // sif::debug << "PlocSupervisorHandler::scanForReply: Received Packet" << std::endl; - // arrayprinter::print(start, remainingSize); uint16_t apid = tmReader.getModuleApid(); + if(DEBUG_PLOC_SUPV) { + sif::debug << "PlocSupervisorHandler: RECV PACKET Size " << tmReader.getFullPacketLen() << " APID " << tmReader.getApid() + << " Module APID: " << tmReader.getModuleApid() << std::endl; + arrayprinter::print(start, remainingSize); + } switch (apid) { case (Apid::TMTC_MAN): { @@ -2006,134 +1917,3 @@ ReturnValue_t PlocSupervisorHandler::checkModeCommand(Mode_t commandedMode, } return DeviceHandlerBase::checkModeCommand(commandedMode, commandedSubmode, msToReachTheMode); } - -// ReturnValue_t PlocSupervisorHandler::checkMramPacketApid() { -// uint16_t apid = (spacePacketBuffer[0] << 8 | spacePacketBuffer[1]) & supv::APID_MASK; -// TODO: Fix -// if (apid != supv::APID_MRAM_DUMP_TM) { -// return result::NO_MRAM_PACKET; -// } -// return APERIODIC_REPLY; -//} - -// ReturnValue_t PlocSupervisorHandler::parseMramPackets(const uint8_t* packet, size_t -// remainingSize, -// size_t* foundLen) { -// ReturnValue_t result = IGNORE_FULL_PACKET; -// uint16_t packetLen = 0; -// *foundLen = 0; -// -// for (size_t idx = 0; idx < remainingSize; idx++) { -// std::memcpy(spacePacketBuffer + bufferTop, packet + idx, 1); -// bufferTop += 1; -// *foundLen += 1; -// if (bufferTop >= ccsds::HEADER_LEN) { -// packetLen = readSpacePacketLength(spacePacketBuffer); -// } -// -// if (bufferTop == ccsds::HEADER_LEN + packetLen + 1) { -// packetInBuffer = true; -// bufferTop = 0; -// return checkMramPacketApid(); -// } -// -// if (bufferTop == supv::MAX_PACKET_SIZE) { -// *foundLen = remainingSize; -// disableAllReplies(); -// bufferTop = 0; -// sif::info << "PlocSupervisorHandler::parseMramPackets: Can not find MRAM packet in space " -// "packet buffer" -// << std::endl; -// return result::MRAM_PACKET_PARSING_FAILURE; -// } -// } -// -// return result; -// } - -// ReturnValue_t PlocSupervisorHandler::prepareDumpMramCmd(const uint8_t* commandData) { -// uint32_t start = 0; -// uint32_t stop = 0; -// size_t size = sizeof(start) + sizeof(stop); -// SerializeAdapter::deSerialize(&start, &commandData, &size, SerializeIF::Endianness::BIG); -// SerializeAdapter::deSerialize(&stop, &commandData, &size, SerializeIF::Endianness::BIG); -// if ((stop - start) <= 0) { -// return SupvReturnValuesIF::INVALID_MRAM_ADDRESSES; -// } -// supv::MramCmd packet(spParams); -// ReturnValue_t result = packet.buildPacket(start, stop, supv::MramCmd::MramAction::DUMP); -// if (result != returnvalue::OK) { -// return result; -// } -// expectedMramDumpPackets = (stop - start) / supv::MAX_DATA_CAPACITY; -// if ((stop - start) % supv::MAX_DATA_CAPACITY) { -// expectedMramDumpPackets++; -// } -// receivedMramDumpPackets = 0; -// -// finishTcPrep(packet.getFullPacketLen()); -// return returnvalue::OK; -// } - -// ReturnValue_t PlocSupervisorHandler::prepareLoggingRequest(const uint8_t* commandData, -// size_t commandDataLen) { -// using namespace supv; -// RequestLoggingData::Sa sa = static_cast(*commandData); -// uint8_t tpc = *(commandData + 1); -// RequestLoggingData packet(spParams); -// ReturnValue_t result = packet.buildPacket(sa, tpc); -// if (result != returnvalue::OK) { -// return result; -// } -// finishTcPrep(packet.getFullPacketLen()); -// return returnvalue::OK; -// } - -// ReturnValue_t PlocSupervisorHandler::prepareEnableNvmsCommand(const uint8_t* commandData) { -// using namespace supv; -// uint8_t nvm01 = *(commandData); -// uint8_t nvm3 = *(commandData + 1); -// EnableNvms packet(spParams); -// ReturnValue_t result = packet.buildPacket(nvm01, nvm3); -// if (result != returnvalue::OK) { -// return result; -// } -// finishTcPrep(packet.getFullPacketLen()); -// return returnvalue::OK; -// } - -// ReturnValue_t PlocSupervisorHandler::handleLoggingReport(const uint8_t* data) { -// ReturnValue_t result = returnvalue::OK; -// -// result = verifyPacket(data, supv::SIZE_LOGGING_REPORT); -// -// if (result == SupvReturnValuesIF::CRC_FAILURE) { -// sif::warning << "PlocSupervisorHandler::handleLoggingReport: Logging report has " -// << "invalid crc" << std::endl; -// return result; -// } -// -// const uint8_t* dataField = data + supv::PAYLOAD_OFFSET + sizeof(supv::RequestLoggingData::Sa); -// result = loggingReport.read(); -// if (result != returnvalue::OK) { -// return result; -// } -// loggingReport.setValidityBufferGeneration(false); -// size_t size = loggingReport.getSerializedSize(); -// result = loggingReport.deSerialize(&dataField, &size, SerializeIF::Endianness::BIG); -// if (result != returnvalue::OK) { -// sif::warning << "PlocSupervisorHandler::handleLoggingReport: Deserialization failed" -// << std::endl; -// } -// loggingReport.setValidityBufferGeneration(true); -// loggingReport.setValidity(true, true); -// result = loggingReport.commit(); -// if (result != returnvalue::OK) { -// return result; -// } -// #if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_PLOC_SUPERVISOR == 1 -// loggingReport.printSet(); -// #endif -// nextReplyId = supv::EXE_REPORT; -// return result; -// } diff --git a/linux/payload/PlocSupervisorHandler.h b/linux/payload/PlocSupervisorHandler.h index d7c5cb1e..48377a40 100644 --- a/linux/payload/PlocSupervisorHandler.h +++ b/linux/payload/PlocSupervisorHandler.h @@ -19,6 +19,7 @@ using supv::ExecutionReport; +static constexpr bool DEBUG_PLOC_SUPV = false; /** * @brief This is the device handler for the supervisor of the PLOC which is programmed by * Thales. @@ -227,7 +228,6 @@ class PlocSupervisorHandler : public DeviceHandlerBase { ReturnValue_t handleLatchupStatusReport(const uint8_t* data); void handleBadApidServiceCombination(Event result, unsigned int apid, unsigned int serviceId); - // ReturnValue_t handleLoggingReport(const uint8_t* data); ReturnValue_t handleAdcReport(const uint8_t* data); /** @@ -297,11 +297,8 @@ class PlocSupervisorHandler : public DeviceHandlerBase { ReturnValue_t prepareSetAdcThresholdCmd(const uint8_t* commandData); ReturnValue_t prepareRunAutoEmTest(const uint8_t* commandData); ReturnValue_t prepareWipeMramCmd(const uint8_t* commandData); - // ReturnValue_t prepareDumpMramCmd(const uint8_t* commandData); ReturnValue_t prepareSetGpioCmd(const uint8_t* commandData); ReturnValue_t prepareReadGpioCmd(const uint8_t* commandData); - // ReturnValue_t prepareLoggingRequest(const uint8_t* commandData, size_t commandDataLen); - // ReturnValue_t prepareEnableNvmsCommand(const uint8_t* commandData); /** * @brief Copies the content of a space packet to the command buffer. @@ -332,12 +329,6 @@ class PlocSupervisorHandler : public DeviceHandlerBase { */ void disableExeReportReply(); - /** - * @brief Function is called in scanForReply and fills the spacePacketBuffer with the read - * data until a full packet has been received. - */ - // ReturnValue_t parseMramPackets(const uint8_t* packet, size_t remainingSize, size_t* foundlen); - /** * @brief This function generates the Service 8 packets for the MRAM dump data. */ @@ -350,12 +341,6 @@ class PlocSupervisorHandler : public DeviceHandlerBase { */ void increaseExpectedMramReplies(DeviceCommandId_t id); - /** - * @brief Function checks if the packet written to the space packet buffer is really a - * MRAM dump packet. - */ - // ReturnValue_t checkMramPacketApid(); - /** * @brief Writes the data of the MRAM dump to a file. The file will be created when receiving * the first packet. diff --git a/tmtc b/tmtc index 60f7ae54..84f50bab 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 60f7ae5453b387ee5ebcf6a338c34284004dbce7 +Subproject commit 84f50bab83db2c783c54dcf63263fdf175445521 From 27d6760322969202c96ac0210810884382a5d259 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 26 Oct 2023 13:41:52 +0200 Subject: [PATCH 233/257] add optional printout mode for PLOC SUPV --- linux/payload/PlocSupervisorHandler.cpp | 86 ++++++++++++++++++------- linux/payload/PlocSupervisorHandler.h | 8 ++- 2 files changed, 68 insertions(+), 26 deletions(-) diff --git a/linux/payload/PlocSupervisorHandler.cpp b/linux/payload/PlocSupervisorHandler.cpp index 81af2ade..3863caea 100644 --- a/linux/payload/PlocSupervisorHandler.cpp +++ b/linux/payload/PlocSupervisorHandler.cpp @@ -517,10 +517,8 @@ ReturnValue_t PlocSupervisorHandler::scanForReply(const uint8_t* start, size_t r tmReader.setData(start, remainingSize); uint16_t apid = tmReader.getModuleApid(); - if(DEBUG_PLOC_SUPV) { - sif::debug << "PlocSupervisorHandler: RECV PACKET Size " << tmReader.getFullPacketLen() << " APID " << tmReader.getApid() - << " Module APID: " << tmReader.getModuleApid() << std::endl; - arrayprinter::print(start, remainingSize); + if (DEBUG_PLOC_SUPV) { + handlePacketPrint(); } switch (apid) { @@ -575,6 +573,42 @@ ReturnValue_t PlocSupervisorHandler::scanForReply(const uint8_t* start, size_t r return INVALID_DATA; } +void PlocSupervisorHandler::handlePacketPrint() { + if (tmReader.getModuleApid() == Apid::TMTC_MAN) { + if ((tmReader.getServiceId() == static_cast(supv::tm::TmtcId::ACK)) or + (tmReader.getServiceId() == static_cast(supv::tm::TmtcId::NAK))) { + AcknowledgmentReport ack(tmReader); + const char* printStr = "???"; + if (tmReader.getServiceId() == static_cast(supv::tm::TmtcId::ACK)) { + printStr = "ACK"; + + } else if (tmReader.getServiceId() == static_cast(supv::tm::TmtcId::NAK)) { + printStr = "NAK"; + } + sif::debug << "PlocSupervisorHandler: RECV " << printStr << " for APID Module ID " + << (int)ack.getRefModuleApid() << " Service ID " << (int)ack.getRefServiceId() + << " Seq Count " << ack.getRefSequenceCount() << std::endl; + return; + } else if ((tmReader.getServiceId() == static_cast(supv::tm::TmtcId::EXEC_ACK)) or + (tmReader.getServiceId() == static_cast(supv::tm::TmtcId::EXEC_NAK))) { + ExecutionReport exe(tmReader); + const char* printStr = "???"; + if (tmReader.getServiceId() == static_cast(supv::tm::TmtcId::EXEC_ACK)) { + printStr = "ACK EXE"; + + } else if (tmReader.getServiceId() == static_cast(supv::tm::TmtcId::EXEC_NAK)) { + printStr = "NAK EXE"; + } + sif::debug << "PlocSupervisorHandler: RECV " << printStr << " for APID Module ID " + << (int)exe.getRefModuleApid() << " Service ID " << (int)exe.getRefServiceId() + << " Seq Count " << exe.getRefSequenceCount() << std::endl; + return; + } + } + sif::debug << "PlocSupervisorHandler: RECV PACKET Size " << tmReader.getFullPacketLen() + << " Module APID " << (int)tmReader.getModuleApid() << " Service ID " + << (int)tmReader.getServiceId() << std::endl; +} ReturnValue_t PlocSupervisorHandler::interpretDeviceReply(DeviceCommandId_t id, const uint8_t* packet) { using namespace supv; @@ -1203,7 +1237,7 @@ ReturnValue_t PlocSupervisorHandler::prepareEmptyCmd(uint16_t apid, uint8_t serv if (result != returnvalue::OK) { return result; } - finishTcPrep(packet.getFullPacketLen()); + finishTcPrep(packet); return returnvalue::OK; } @@ -1214,7 +1248,7 @@ ReturnValue_t PlocSupervisorHandler::prepareSelBootImageCmd(const uint8_t* comma if (result != returnvalue::OK) { return result; } - finishTcPrep(packet.getFullPacketLen()); + finishTcPrep(packet); return returnvalue::OK; } @@ -1231,7 +1265,7 @@ ReturnValue_t PlocSupervisorHandler::prepareSetTimeRefCmd() { if (result != returnvalue::OK) { return result; } - finishTcPrep(packet.getFullPacketLen()); + finishTcPrep(packet); return returnvalue::OK; } @@ -1241,7 +1275,7 @@ ReturnValue_t PlocSupervisorHandler::prepareDisableHk() { if (result != returnvalue::OK) { return result; } - finishTcPrep(packet.getFullPacketLen()); + finishTcPrep(packet); return returnvalue::OK; } @@ -1253,7 +1287,7 @@ ReturnValue_t PlocSupervisorHandler::prepareSetBootTimeoutCmd(const uint8_t* com if (result != returnvalue::OK) { return result; } - finishTcPrep(packet.getFullPacketLen()); + finishTcPrep(packet); return returnvalue::OK; } @@ -1264,7 +1298,7 @@ ReturnValue_t PlocSupervisorHandler::prepareRestartTriesCmd(const uint8_t* comma if (result != returnvalue::OK) { return result; } - finishTcPrep(packet.getFullPacketLen()); + finishTcPrep(packet); return returnvalue::OK; } @@ -1282,7 +1316,7 @@ ReturnValue_t PlocSupervisorHandler::prepareLatchupConfigCmd(const uint8_t* comm if (result != returnvalue::OK) { return result; } - finishTcPrep(packet.getFullPacketLen()); + finishTcPrep(packet); break; } case (supv::DISABLE_LATCHUP_ALERT): { @@ -1291,7 +1325,7 @@ ReturnValue_t PlocSupervisorHandler::prepareLatchupConfigCmd(const uint8_t* comm if (result != returnvalue::OK) { return result; } - finishTcPrep(packet.getFullPacketLen()); + finishTcPrep(packet); break; } default: { @@ -1318,7 +1352,7 @@ ReturnValue_t PlocSupervisorHandler::prepareSetAlertLimitCmd(const uint8_t* comm if (result != returnvalue::OK) { return result; } - finishTcPrep(packet.getFullPacketLen()); + finishTcPrep(packet); return returnvalue::OK; } @@ -1329,7 +1363,7 @@ ReturnValue_t PlocSupervisorHandler::prepareSetAdcEnabledChannelsCmd(const uint8 if (result != returnvalue::OK) { return result; } - finishTcPrep(packet.getFullPacketLen()); + finishTcPrep(packet); return returnvalue::OK; } @@ -1343,7 +1377,7 @@ ReturnValue_t PlocSupervisorHandler::prepareSetAdcWindowAndStrideCmd(const uint8 if (result != returnvalue::OK) { return result; } - finishTcPrep(packet.getFullPacketLen()); + finishTcPrep(packet); return returnvalue::OK; } @@ -1355,7 +1389,7 @@ ReturnValue_t PlocSupervisorHandler::prepareSetAdcThresholdCmd(const uint8_t* co if (result != returnvalue::OK) { return result; } - finishTcPrep(packet.getFullPacketLen()); + finishTcPrep(packet); return returnvalue::OK; } @@ -1369,7 +1403,7 @@ ReturnValue_t PlocSupervisorHandler::prepareRunAutoEmTest(const uint8_t* command if (result != returnvalue::OK) { return result; } - finishTcPrep(packet.getFullPacketLen()); + finishTcPrep(packet); return returnvalue::OK; } @@ -1382,7 +1416,7 @@ ReturnValue_t PlocSupervisorHandler::prepareSetGpioCmd(const uint8_t* commandDat if (result != returnvalue::OK) { return result; } - finishTcPrep(packet.getFullPacketLen()); + finishTcPrep(packet); return returnvalue::OK; } @@ -1394,7 +1428,7 @@ ReturnValue_t PlocSupervisorHandler::prepareReadGpioCmd(const uint8_t* commandDa if (result != returnvalue::OK) { return result; } - finishTcPrep(packet.getFullPacketLen()); + finishTcPrep(packet); return returnvalue::OK; } @@ -1408,14 +1442,18 @@ ReturnValue_t PlocSupervisorHandler::prepareFactoryResetCmd(const uint8_t* comma if (result != returnvalue::OK) { return result; } - finishTcPrep(resetCmd.getFullPacketLen()); + finishTcPrep(resetCmd); return returnvalue::OK; } -void PlocSupervisorHandler::finishTcPrep(size_t packetLen) { +void PlocSupervisorHandler::finishTcPrep(TcBase& tc) { nextReplyId = supv::ACK_REPORT; rawPacket = commandBuffer; - rawPacketLen = packetLen; + rawPacketLen = tc.getFullPacketLen(); + if (DEBUG_PLOC_SUPV) { + sif::debug << "PLOC SUPV: SEND PACKET Size " << tc.getFullPacketLen() << " Module APID " + << (int)tc.getModuleApid() << " Service ID " << (int)tc.getServiceId() << std::endl; + } } ReturnValue_t PlocSupervisorHandler::prepareSetShutdownTimeoutCmd(const uint8_t* commandData) { @@ -1434,7 +1472,7 @@ ReturnValue_t PlocSupervisorHandler::prepareSetShutdownTimeoutCmd(const uint8_t* if (result != returnvalue::OK) { return result; } - finishTcPrep(packet.getFullPacketLen()); + finishTcPrep(packet); return returnvalue::OK; } @@ -1651,7 +1689,7 @@ ReturnValue_t PlocSupervisorHandler::prepareWipeMramCmd(const uint8_t* commandDa if (result != returnvalue::OK) { return result; } - finishTcPrep(packet.getFullPacketLen()); + finishTcPrep(packet); return returnvalue::OK; } diff --git a/linux/payload/PlocSupervisorHandler.h b/linux/payload/PlocSupervisorHandler.h index 48377a40..822b1174 100644 --- a/linux/payload/PlocSupervisorHandler.h +++ b/linux/payload/PlocSupervisorHandler.h @@ -18,8 +18,10 @@ #endif using supv::ExecutionReport; +using supv::TcBase; + +static constexpr bool DEBUG_PLOC_SUPV = true; -static constexpr bool DEBUG_PLOC_SUPV = false; /** * @brief This is the device handler for the supervisor of the PLOC which is programmed by * Thales. @@ -175,6 +177,8 @@ class PlocSupervisorHandler : public DeviceHandlerBase { */ void setExecutionTimeout(DeviceCommandId_t command); + void handlePacketPrint(); + /** * @brief Handles event messages received from the supervisor helper */ @@ -303,7 +307,7 @@ class PlocSupervisorHandler : public DeviceHandlerBase { /** * @brief Copies the content of a space packet to the command buffer. */ - void finishTcPrep(size_t packetLen); + void finishTcPrep(TcBase& tc); /** * @brief In case an acknowledgment failure reply has been received this function disables From 02fcd0c42390db8ca52d725ac2da361c9791aaa6 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 26 Oct 2023 13:42:27 +0200 Subject: [PATCH 234/257] disable printout mode --- linux/payload/PlocSupervisorHandler.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/payload/PlocSupervisorHandler.h b/linux/payload/PlocSupervisorHandler.h index 822b1174..4514e69f 100644 --- a/linux/payload/PlocSupervisorHandler.h +++ b/linux/payload/PlocSupervisorHandler.h @@ -20,7 +20,7 @@ using supv::ExecutionReport; using supv::TcBase; -static constexpr bool DEBUG_PLOC_SUPV = true; +static constexpr bool DEBUG_PLOC_SUPV = false; /** * @brief This is the device handler for the supervisor of the PLOC which is programmed by From 1c7545bffa27d753b462b55988ddf97b94e4b812 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 26 Oct 2023 19:59:16 +0200 Subject: [PATCH 235/257] fix --- mission/acs/str/StarTrackerHandler.cpp | 26 +++++++++++++++++++++++++- mission/acs/str/strHelpers.h | 8 +++++++- tmtc | 2 +- 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/mission/acs/str/StarTrackerHandler.cpp b/mission/acs/str/StarTrackerHandler.cpp index 94a29f01..1bf35ca2 100644 --- a/mission/acs/str/StarTrackerHandler.cpp +++ b/mission/acs/str/StarTrackerHandler.cpp @@ -1792,8 +1792,32 @@ ReturnValue_t StarTrackerHandler::scanForTmReply(uint8_t replyId, DeviceCommandI *foundId = startracker::REQ_SOLUTION; break; } + case(startracker::ID::BLOB): { + *foundId = startracker::REQ_BLOB; + break; + } + case(startracker::ID::BLOBS): { + *foundId = startracker::REQ_BLOBS; + break; + } + case(startracker::ID::CENTROID): { + *foundId = startracker::REQ_CENTROID; + break; + } + case(startracker::ID::CENTROIDS): { + *foundId = startracker::REQ_CENTROIDS; + break; + } + case(startracker::ID::AUTO_BLOB): { + *foundId = startracker::REQ_AUTO_BLOB; + break; + } + case(startracker::ID::MATCHED_CENTROIDS): { + *foundId = startracker::REQ_MATCHED_CENTROIDS; + break; + } default: { - sif::debug << "StarTrackerHandler::scanForTmReply: Reply contains invalid reply id: " + sif::debug << "StarTrackerHandler::scanForTmReply: Reply contains invalid reply ID: " << static_cast(replyId) << std::endl; return returnvalue::FAILED; break; diff --git a/mission/acs/str/strHelpers.h b/mission/acs/str/strHelpers.h index fe8755f2..dff29f95 100644 --- a/mission/acs/str/strHelpers.h +++ b/mission/acs/str/strHelpers.h @@ -461,6 +461,12 @@ static const uint8_t LOG_LEVEL = 3; static const uint8_t LOG_SUBSCRIPTION = 19; static const uint8_t DEBUG_CAMERA = 20; static const uint8_t AUTO_THRESHOLD = 23; +static constexpr uint8_t BLOB = 25; +static constexpr uint8_t BLOBS = 36; +static constexpr uint8_t CENTROID = 26; +static constexpr uint8_t CENTROIDS = 37; +static constexpr uint8_t AUTO_BLOB = 39; +static constexpr uint8_t MATCHED_CENTROIDS = 40; } // namespace ID namespace Program { @@ -1430,7 +1436,7 @@ class ValidationSet : public StaticLocalDataSet { } }; -class AutoBlobSet : public StaticLocalDataSet<1> { +class AutoBlobSet : public StaticLocalDataSet<3> { public: AutoBlobSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, AUTO_BLOB_SET_ID) {} // Ticks timestamp diff --git a/tmtc b/tmtc index f52f4b1c..c4598ff0 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit f52f4b1ce2f8932cb567a69e4972e562fd124134 +Subproject commit c4598ff05858952d0107d4f6f61cbef8ff2de691 From 0beac793a161ec73e2c24f6a349ec9c2f03e6a3b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 26 Oct 2023 20:45:36 +0200 Subject: [PATCH 236/257] some more important bugfixes --- mission/acs/str/StarTrackerHandler.cpp | 12 ++++++++++++ mission/acs/str/strHelpers.h | 16 +++++++++------- tmtc | 2 +- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/mission/acs/str/StarTrackerHandler.cpp b/mission/acs/str/StarTrackerHandler.cpp index 1bf35ca2..3ebc92fb 100644 --- a/mission/acs/str/StarTrackerHandler.cpp +++ b/mission/acs/str/StarTrackerHandler.cpp @@ -671,6 +671,10 @@ ReturnValue_t StarTrackerHandler::buildCommandFromCommand(DeviceCommandId_t devi result = prepareRequestBlobsTm(); return result; } + case(startracker::REQ_AUTO_BLOB): { + result = prepareRequestAutoBlobTm(); + return returnvalue::OK; + } case (startracker::REQ_MATCHING): { result = prepareRequestMatchingParams(); return result; @@ -1484,6 +1488,8 @@ ReturnValue_t StarTrackerHandler::initializeLocalDataPool(localpool::DataPool& l localDataPoolMap.emplace(startracker::CHKSUM, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TICKS_AUTO_BLOB, new PoolEntry()); + localDataPoolMap.emplace(startracker::TIME_AUTO_BLOB, new PoolEntry()); localDataPoolMap.emplace(startracker::AUTO_BLOB_THRESHOLD, new PoolEntry()); localDataPoolMap.emplace(startracker::PoolIds::NUM_MATCHED_CENTROIDS, new PoolEntry()); @@ -2351,6 +2357,7 @@ ReturnValue_t StarTrackerHandler::handleAutoBlobTm(const uint8_t* rawFrame) { if (result != returnvalue::OK) { return result; } + rawFrame += TICKS_OFFSET; size_t remainingLen = fullPacketLen; PoolReadGuard pg(&autoBlobSet); result = pg.getReadResult(); @@ -2381,6 +2388,7 @@ ReturnValue_t StarTrackerHandler::handleMatchedCentroidTm(const uint8_t* rawFram if (result != returnvalue::OK) { return result; } + rawFrame += TICKS_OFFSET; size_t remainingLen = fullPacketLen; PoolReadGuard pg(&matchedCentroidsSet); result = pg.getReadResult(); @@ -2440,6 +2448,7 @@ ReturnValue_t StarTrackerHandler::handleBlobTm(const uint8_t* rawFrame) { if (result != returnvalue::OK) { return result; } + rawFrame += TICKS_OFFSET; size_t remainingLen = fullPacketLen; PoolReadGuard pg(&blobsSet); result = pg.getReadResult(); @@ -2470,6 +2479,7 @@ ReturnValue_t StarTrackerHandler::handleBlobsTm(const uint8_t* rawFrame) { if (result != returnvalue::OK) { return result; } + rawFrame += TICKS_OFFSET; size_t remainingLen = fullPacketLen; PoolReadGuard pg(&blobsSet); result = pg.getReadResult(); @@ -2522,6 +2532,7 @@ ReturnValue_t StarTrackerHandler::handleCentroidTm(const uint8_t* rawFrame) { if (result != returnvalue::OK) { return result; } + rawFrame += TICKS_OFFSET; size_t remainingLen = fullPacketLen; PoolReadGuard pg(¢roidsSet); result = pg.getReadResult(); @@ -2553,6 +2564,7 @@ ReturnValue_t StarTrackerHandler::handleCentroidsTm(const uint8_t* rawFrame) { if (result != returnvalue::OK) { return result; } + rawFrame += TICKS_OFFSET; size_t remainingLen = fullPacketLen; PoolReadGuard pg(¢roidsSet); result = pg.getReadResult(); diff --git a/mission/acs/str/strHelpers.h b/mission/acs/str/strHelpers.h index dff29f95..2fe999c0 100644 --- a/mission/acs/str/strHelpers.h +++ b/mission/acs/str/strHelpers.h @@ -274,6 +274,8 @@ enum PoolIds : lp_id_t { DEBUG_CAMERA_TIMING, DEBUG_CAMERA_TEST, + TICKS_AUTO_BLOB, + TIME_AUTO_BLOB, AUTO_BLOB_THRESHOLD, TICKS_MATCHED_CENTROIDS, @@ -1441,10 +1443,10 @@ class AutoBlobSet : public StaticLocalDataSet<3> { AutoBlobSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, AUTO_BLOB_SET_ID) {} // Ticks timestamp lp_var_t ticks = - lp_var_t(sid.objectId, PoolIds::TICKS_MATCHED_CENTROIDS, this); + lp_var_t(sid.objectId, PoolIds::TICKS_AUTO_BLOB, this); // Unix time stamp lp_var_t timeUs = - lp_var_t(sid.objectId, PoolIds::TIME_MATCHED_CENTROIDS, this); + lp_var_t(sid.objectId, PoolIds::TIME_AUTO_BLOB, this); lp_var_t threshold = lp_var_t(sid.objectId, PoolIds::AUTO_BLOB_THRESHOLD, this); private: @@ -1466,15 +1468,15 @@ class MatchedCentroidsSet : public StaticLocalDataSet<20> { lp_var_t numberOfMatchedCentroids = lp_var_t(sid.objectId, PoolIds::NUM_MATCHED_CENTROIDS, this); lp_vec_t starIds = - lp_vec_t(sid.objectId, PoolIds::MATCHED_CENTROIDS_STAR_IDS); + lp_vec_t(sid.objectId, PoolIds::MATCHED_CENTROIDS_STAR_IDS, this); lp_vec_t xCoords = - lp_vec_t(sid.objectId, PoolIds::MATCHED_CENTROIDS_X_COORDS); + lp_vec_t(sid.objectId, PoolIds::MATCHED_CENTROIDS_X_COORDS, this); lp_vec_t yCoords = - lp_vec_t(sid.objectId, PoolIds::MATCHED_CENTROIDS_Y_COORDS); + lp_vec_t(sid.objectId, PoolIds::MATCHED_CENTROIDS_Y_COORDS, this); lp_vec_t xErrors = - lp_vec_t(sid.objectId, PoolIds::MATCHED_CENTROIDS_X_ERRORS); + lp_vec_t(sid.objectId, PoolIds::MATCHED_CENTROIDS_X_ERRORS, this); lp_vec_t yErrors = - lp_vec_t(sid.objectId, PoolIds::MATCHED_CENTROIDS_Y_ERRORS); + lp_vec_t(sid.objectId, PoolIds::MATCHED_CENTROIDS_Y_ERRORS, this); private: }; diff --git a/tmtc b/tmtc index c4598ff0..97b52931 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit c4598ff05858952d0107d4f6f61cbef8ff2de691 +Subproject commit 97b529318dbc654ec55fd765f892bff212918f39 From 35e7fba576e427a9618c1ad618417df3a026b2c8 Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 27 Oct 2023 09:50:40 +0200 Subject: [PATCH 237/257] smoll fix --- mission/acs/SusHandler.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/mission/acs/SusHandler.cpp b/mission/acs/SusHandler.cpp index 58280636..193bdb5c 100644 --- a/mission/acs/SusHandler.cpp +++ b/mission/acs/SusHandler.cpp @@ -120,6 +120,7 @@ ReturnValue_t SusHandler::interpretDeviceReply(DeviceCommandId_t id, const uint8 if (invalidMsgCountdown.hasTimedOut() and invalidMsgPeriodCounter > 0) { triggerEvent(TEMPERATURE_ALL_ONES_RECOVERY, invalidMsgPeriodCounter, invalidMsgCounterMax); invalidMsgPeriodCounter = 0; + invalidMsgCounterMax = 0; } dataset.setValidity(true, true); dataset.tempC = max1227::getTemperature(reply->tempRaw); From 964d47b909cf776044bea7c5387a776954695735 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 27 Oct 2023 09:59:15 +0200 Subject: [PATCH 238/257] bugfix for reset function --- mission/acs/str/StarTrackerHandler.cpp | 1 + tmtc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/mission/acs/str/StarTrackerHandler.cpp b/mission/acs/str/StarTrackerHandler.cpp index 3ebc92fb..b7b4ee83 100644 --- a/mission/acs/str/StarTrackerHandler.cpp +++ b/mission/acs/str/StarTrackerHandler.cpp @@ -957,6 +957,7 @@ void StarTrackerHandler::addSecondaryTmForNormalMode(DeviceCommandId_t cmd) { void StarTrackerHandler::resetSecondaryTmSet() { additionalRequestedTm.clear(); additionalRequestedTm.emplace(startracker::REQ_TEMPERATURE); + currentSecondaryTmIter = additionalRequestedTm.begin(); { PoolReadGuard pg(&autoBlobSet); if (pg.getReadResult() == returnvalue::OK) { diff --git a/tmtc b/tmtc index 97b52931..d9530271 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 97b529318dbc654ec55fd765f892bff212918f39 +Subproject commit d9530271c38f8c81d6c5f3f11c6f3532085141e3 From f8eb4fdd6f5d9114a9eb0b067ac927889f18a0e5 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 27 Oct 2023 11:24:51 +0200 Subject: [PATCH 239/257] add contrast set --- mission/acs/str/StarTrackerHandler.cpp | 39 ++++++++++++++++++++++++++ mission/acs/str/StarTrackerHandler.h | 2 ++ mission/acs/str/strHelpers.h | 32 +++++++++++++++++++++ tmtc | 2 +- 4 files changed, 74 insertions(+), 1 deletion(-) diff --git a/mission/acs/str/StarTrackerHandler.cpp b/mission/acs/str/StarTrackerHandler.cpp index b7b4ee83..f3550734 100644 --- a/mission/acs/str/StarTrackerHandler.cpp +++ b/mission/acs/str/StarTrackerHandler.cpp @@ -55,6 +55,7 @@ StarTrackerHandler::StarTrackerHandler(object_id_t objectId, object_id_t comIF, blobsSet(this), centroidSet(this), centroidsSet(this), + contrastSet(this), strHelper(strHelper), paramJsonFile(jsonFileStr), powerSwitch(powerSwitch) { @@ -352,6 +353,7 @@ ReturnValue_t StarTrackerHandler::buildNormalDeviceCommand(DeviceCommandId_t* id if (currentSecondaryTmIter == additionalRequestedTm.end()) { currentSecondaryTmIter = additionalRequestedTm.begin(); } + sif::debug << "requesting ID " << *id << std::endl; normalState = NormalState::SOLUTION_REQUEST; break; case NormalState::SOLUTION_REQUEST: @@ -524,6 +526,9 @@ ReturnValue_t StarTrackerHandler::buildCommandFromCommand(DeviceCommandId_t devi prepareRequestCentroidsTm(); return returnvalue::OK; } + case (startracker::REQ_CONTRAST): { + return returnvalue::OK; + } case (startracker::BOOT): { prepareBootCommand(); return returnvalue::OK; @@ -809,6 +814,8 @@ void StarTrackerHandler::fillCommandAndReplyMap() { startracker::MAX_FRAME_SIZE * 2 + 2); this->insertInCommandAndReplyMap(startracker::REQ_CENTROIDS, 3, ¢roidsSet, startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::REQ_CONTRAST, 3, &contrastSet, + startracker::MAX_FRAME_SIZE * 2 + 2); } ReturnValue_t StarTrackerHandler::isModeCombinationValid(Mode_t mode, Submode_t submode) { @@ -994,6 +1001,12 @@ void StarTrackerHandler::resetSecondaryTmSet() { centroidsSet.setValidity(false, true); } } + { + PoolReadGuard pg(&histogramSet); + if (pg.getReadResult() == returnvalue::OK) { + histogramSet.setValidity(false, true); + } + } } void StarTrackerHandler::bootBootloader() { @@ -1106,6 +1119,10 @@ ReturnValue_t StarTrackerHandler::interpretDeviceReply(DeviceCommandId_t id, result = handleTm(packet, solutionSet, startracker::SolutionSet::SIZE, "REQ_SOLUTION"); break; } + case(startracker::REQ_CONTRAST): { + result = handleTm(packet, contrastSet, startracker::ContrastSet::SIZE, "REQ_CONTRAST"); + break; + } case (startracker::REQ_AUTO_BLOB): { result = handleAutoBlobTm(packet); break; @@ -1532,6 +1549,13 @@ ReturnValue_t StarTrackerHandler::initializeLocalDataPool(localpool::DataPool& l localDataPoolMap.emplace(startracker::PoolIds::CENTROIDS_Y_COORDS, new PoolEntry(16)); localDataPoolMap.emplace(startracker::PoolIds::CENTROIDS_MAGNITUDES, new PoolEntry(16)); + localDataPoolMap.emplace(startracker::PoolIds::CONTRAST_TICKS, new PoolEntry()); + localDataPoolMap.emplace(startracker::PoolIds::CONTRAST_TIME, new PoolEntry()); + localDataPoolMap.emplace(startracker::PoolIds::CONTRAST_A, new PoolEntry(9)); + localDataPoolMap.emplace(startracker::PoolIds::CONTRAST_B, new PoolEntry(9)); + localDataPoolMap.emplace(startracker::PoolIds::CONTRAST_C, new PoolEntry(9)); + localDataPoolMap.emplace(startracker::PoolIds::CONTRAST_D, new PoolEntry(9)); + poolManager.subscribeForDiagPeriodicPacket( subdp::DiagnosticsHkPeriodicParams(temperatureSet.getSid(), false, 10.0)); poolManager.subscribeForRegularPeriodicPacket( @@ -1558,6 +1582,8 @@ ReturnValue_t StarTrackerHandler::initializeLocalDataPool(localpool::DataPool& l subdp::RegularHkPeriodicParams(centroidSet.getSid(), false, 10.0)); poolManager.subscribeForRegularPeriodicPacket( subdp::RegularHkPeriodicParams(centroidsSet.getSid(), false, 10.0)); + poolManager.subscribeForRegularPeriodicPacket( + subdp::RegularHkPeriodicParams(contrastSet.getSid(), false, 10.0)); return returnvalue::OK; } @@ -1823,6 +1849,10 @@ ReturnValue_t StarTrackerHandler::scanForTmReply(uint8_t replyId, DeviceCommandI *foundId = startracker::REQ_MATCHED_CENTROIDS; break; } + case(startracker::ID::CONTRAST): { + *foundId = startracker::REQ_CONTRAST; + break; + } default: { sif::debug << "StarTrackerHandler::scanForTmReply: Reply contains invalid reply ID: " << static_cast(replyId) << std::endl; @@ -2047,6 +2077,14 @@ ReturnValue_t StarTrackerHandler::prepareRequestCentroidsTm() { return returnvalue::OK; } +ReturnValue_t StarTrackerHandler::prepareRequestContrastTm() { + uint32_t length = 0; + arc_tm_pack_contrast_req(commandBuffer, &length); + rawPacket = commandBuffer; + rawPacketLen = length; + return returnvalue::OK; +} + ReturnValue_t StarTrackerHandler::prepareParamCommand(const uint8_t* commandData, size_t commandDataLen, ArcsecJsonParamBase& paramSet, @@ -2749,6 +2787,7 @@ ReturnValue_t StarTrackerHandler::checkCommand(ActionId_t actionId) { case startracker::REQ_BLOBS: case startracker::REQ_CENTROID: case startracker::REQ_CENTROIDS: + case startracker::REQ_CONTRAST: if (getMode() == MODE_ON and getSubmode() != startracker::Program::FIRMWARE) { return STARTRACKER_NOT_RUNNING_FIRMWARE; } diff --git a/mission/acs/str/StarTrackerHandler.h b/mission/acs/str/StarTrackerHandler.h index d63335ae..c43d70fe 100644 --- a/mission/acs/str/StarTrackerHandler.h +++ b/mission/acs/str/StarTrackerHandler.h @@ -212,6 +212,7 @@ class StarTrackerHandler : public DeviceHandlerBase { startracker::BlobsSet blobsSet; startracker::CentroidSet centroidSet; startracker::CentroidsSet centroidsSet; + startracker::CentroidsSet contrastSet; // Pointer to object responsible for uploading and downloading images to/from the star tracker StrComHandler* strHelper = nullptr; @@ -460,6 +461,7 @@ class StarTrackerHandler : public DeviceHandlerBase { ReturnValue_t prepareRequestBlobsTm(); ReturnValue_t prepareRequestCentroidTm(); ReturnValue_t prepareRequestCentroidsTm(); + ReturnValue_t prepareRequestContrastTm(); ReturnValue_t prepareRequestTrackingParams(); ReturnValue_t prepareRequestValidationParams(); ReturnValue_t prepareRequestAlgoParams(); diff --git a/mission/acs/str/strHelpers.h b/mission/acs/str/strHelpers.h index 2fe999c0..834336a9 100644 --- a/mission/acs/str/strHelpers.h +++ b/mission/acs/str/strHelpers.h @@ -309,6 +309,13 @@ enum PoolIds : lp_id_t { CENTROIDS_X_COORDS, CENTROIDS_Y_COORDS, CENTROIDS_MAGNITUDES, + + CONTRAST_TICKS, + CONTRAST_TIME, + CONTRAST_A, + CONTRAST_B, + CONTRAST_C, + CONTRAST_D, }; static const DeviceCommandId_t PING_REQUEST = 0; @@ -327,6 +334,7 @@ static const DeviceCommandId_t IMAGE_PROCESSOR = 19; static const DeviceCommandId_t REQ_SOLUTION = 24; static const DeviceCommandId_t REQ_TEMPERATURE = 25; static const DeviceCommandId_t REQ_HISTOGRAM = 28; +static constexpr DeviceCommandId_t REQ_CONTRAST = 29; static const DeviceCommandId_t LIMITS = 40; static const DeviceCommandId_t MOUNTING = 41; static const DeviceCommandId_t CAMERA = 42; @@ -403,6 +411,7 @@ static const uint32_t BLOB_SET_ID = REQ_BLOB; static const uint32_t BLOBS_SET_ID = REQ_BLOBS; static const uint32_t CENTROID_SET_ID = REQ_CENTROID; static const uint32_t CENTROIDS_SET_ID = REQ_CENTROIDS; +static const uint32_t CONTRAST_SET_ID = REQ_CONTRAST; /** Max size of unencoded frame */ static const size_t MAX_FRAME_SIZE = 1200; @@ -1544,6 +1553,29 @@ class CentroidsSet : public StaticLocalDataSet<10> { lp_vec_t(sid.objectId, PoolIds::CENTROIDS_MAGNITUDES, this); }; +class ContrastSet: public StaticLocalDataSet<8> { + +public: + static constexpr size_t SIZE = 156; + + ContrastSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, CONTRAST_SET_ID) {} + + // Data received from the Centroids Telemetry Set (ID 29) + lp_var_t ticks = + lp_var_t(sid.objectId, PoolIds::CONTRAST_TICKS, this); + // Unix time stamp + lp_var_t timeUs = + lp_var_t(sid.objectId, PoolIds::CONTRAST_TIME, this); + lp_vec_t contrastA = + lp_vec_t(sid.objectId, PoolIds::CONTRAST_A, this); + lp_vec_t contrastB = + lp_vec_t(sid.objectId, PoolIds::CONTRAST_B, this); + lp_vec_t contrastC = + lp_vec_t(sid.objectId, PoolIds::CONTRAST_C, this); + lp_vec_t contrastD = + lp_vec_t(sid.objectId, PoolIds::CONTRAST_D, this); +}; + /** * @brief Will store the requested algo parameters */ diff --git a/tmtc b/tmtc index d9530271..5821c60e 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit d9530271c38f8c81d6c5f3f11c6f3532085141e3 +Subproject commit 5821c60eb4743b014eb4641104bc35213f0b465b From dcdceba07e56354322e80ecedeea62f0385c2474 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 27 Oct 2023 12:17:54 +0200 Subject: [PATCH 240/257] wrapping up --- mission/acs/str/StarTrackerHandler.cpp | 54 +++++++++++++++----------- mission/acs/str/StarTrackerHandler.h | 4 +- mission/acs/str/strHelpers.h | 44 +++++---------------- 3 files changed, 43 insertions(+), 59 deletions(-) diff --git a/mission/acs/str/StarTrackerHandler.cpp b/mission/acs/str/StarTrackerHandler.cpp index f3550734..541301f1 100644 --- a/mission/acs/str/StarTrackerHandler.cpp +++ b/mission/acs/str/StarTrackerHandler.cpp @@ -353,7 +353,6 @@ ReturnValue_t StarTrackerHandler::buildNormalDeviceCommand(DeviceCommandId_t* id if (currentSecondaryTmIter == additionalRequestedTm.end()) { currentSecondaryTmIter = additionalRequestedTm.begin(); } - sif::debug << "requesting ID " << *id << std::endl; normalState = NormalState::SOLUTION_REQUEST; break; case NormalState::SOLUTION_REQUEST: @@ -527,6 +526,7 @@ ReturnValue_t StarTrackerHandler::buildCommandFromCommand(DeviceCommandId_t devi return returnvalue::OK; } case (startracker::REQ_CONTRAST): { + prepareRequestContrastTm(); return returnvalue::OK; } case (startracker::BOOT): { @@ -676,7 +676,7 @@ ReturnValue_t StarTrackerHandler::buildCommandFromCommand(DeviceCommandId_t devi result = prepareRequestBlobsTm(); return result; } - case(startracker::REQ_AUTO_BLOB): { + case (startracker::REQ_AUTO_BLOB): { result = prepareRequestAutoBlobTm(); return returnvalue::OK; } @@ -995,6 +995,12 @@ void StarTrackerHandler::resetSecondaryTmSet() { centroidSet.setValidity(false, true); } } + { + PoolReadGuard pg(&contrastSet); + if (pg.getReadResult() == returnvalue::OK) { + contrastSet.setValidity(false, true); + } + } { PoolReadGuard pg(¢roidsSet); if (pg.getReadResult() == returnvalue::OK) { @@ -1082,7 +1088,7 @@ ReturnValue_t StarTrackerHandler::interpretDeviceReply(DeviceCommandId_t id, break; } case (startracker::REQ_TIME): { - result = handleTm(packet, timeSet, startracker::TimeSet::SIZE, "REQ_TIME"); + result = handleTm(packet, timeSet, "REQ_TIME"); break; } case (startracker::PING_REQUEST): { @@ -1097,7 +1103,7 @@ ReturnValue_t StarTrackerHandler::interpretDeviceReply(DeviceCommandId_t id, break; } case (startracker::REQ_VERSION): { - result = handleTm(packet, versionSet, startracker::VersionSet::SIZE, "REQ_VERSION"); + result = handleTm(packet, versionSet, "REQ_VERSION"); if (result != returnvalue::OK) { return result; } @@ -1108,19 +1114,19 @@ ReturnValue_t StarTrackerHandler::interpretDeviceReply(DeviceCommandId_t id, break; } case (startracker::REQ_INTERFACE): { - result = handleTm(packet, interfaceSet, startracker::InterfaceSet::SIZE, "REQ_INTERFACE"); + result = handleTm(packet, interfaceSet, "REQ_INTERFACE"); break; } case (startracker::REQ_POWER): { - result = handleTm(packet, powerSet, startracker::PowerSet::SIZE, "REQ_POWER"); + result = handleTm(packet, powerSet, "REQ_POWER"); break; } case (startracker::REQ_SOLUTION): { - result = handleTm(packet, solutionSet, startracker::SolutionSet::SIZE, "REQ_SOLUTION"); + result = handleTm(packet, solutionSet, "REQ_SOLUTION"); break; } - case(startracker::REQ_CONTRAST): { - result = handleTm(packet, contrastSet, startracker::ContrastSet::SIZE, "REQ_CONTRAST"); + case (startracker::REQ_CONTRAST): { + result = handleTm(packet, contrastSet, "REQ_CONTRAST"); break; } case (startracker::REQ_AUTO_BLOB): { @@ -1148,11 +1154,11 @@ ReturnValue_t StarTrackerHandler::interpretDeviceReply(DeviceCommandId_t id, break; } case (startracker::REQ_TEMPERATURE): { - result = handleTm(packet, temperatureSet, startracker::TemperatureSet::SIZE, "REQ_TEMP"); + result = handleTm(packet, temperatureSet, "REQ_TEMP"); break; } case (startracker::REQ_HISTOGRAM): { - result = handleTm(packet, histogramSet, startracker::HistogramSet::SIZE, "REQ_HISTO"); + result = handleTm(packet, histogramSet, "REQ_HISTO"); break; } case (startracker::SUBSCRIPTION): @@ -1825,31 +1831,31 @@ ReturnValue_t StarTrackerHandler::scanForTmReply(uint8_t replyId, DeviceCommandI *foundId = startracker::REQ_SOLUTION; break; } - case(startracker::ID::BLOB): { + case (startracker::ID::BLOB): { *foundId = startracker::REQ_BLOB; break; } - case(startracker::ID::BLOBS): { + case (startracker::ID::BLOBS): { *foundId = startracker::REQ_BLOBS; break; } - case(startracker::ID::CENTROID): { + case (startracker::ID::CENTROID): { *foundId = startracker::REQ_CENTROID; break; } - case(startracker::ID::CENTROIDS): { + case (startracker::ID::CENTROIDS): { *foundId = startracker::REQ_CENTROIDS; break; } - case(startracker::ID::AUTO_BLOB): { + case (startracker::ID::AUTO_BLOB): { *foundId = startracker::REQ_AUTO_BLOB; break; } - case(startracker::ID::MATCHED_CENTROIDS): { + case (startracker::ID::MATCHED_CENTROIDS): { *foundId = startracker::REQ_MATCHED_CENTROIDS; break; } - case(startracker::ID::CONTRAST): { + case (startracker::ID::CONTRAST): { *foundId = startracker::REQ_CONTRAST; break; } @@ -2363,7 +2369,7 @@ ReturnValue_t StarTrackerHandler::checkProgram() { } ReturnValue_t StarTrackerHandler::handleTm(const uint8_t* rawFrame, LocalPoolDataSetBase& dataset, - size_t size, const char* context) { + const char* context) { ReturnValue_t result = statusFieldCheck(rawFrame); if (result != returnvalue::OK) { return result; @@ -2374,10 +2380,11 @@ ReturnValue_t StarTrackerHandler::handleTm(const uint8_t* rawFrame, LocalPoolDat } const uint8_t* reply = rawFrame + TICKS_OFFSET; dataset.setValidityBufferGeneration(false); - result = dataset.deSerialize(&reply, &size, SerializeIF::Endianness::LITTLE); + size_t sizeLeft = fullPacketLen; + result = dataset.deSerialize(&reply, &sizeLeft, SerializeIF::Endianness::LITTLE); if (result != returnvalue::OK) { - sif::warning << "StarTrackerHandler::handleTm: Deserialization failed for " << context - << std::endl; + sif::warning << "StarTrackerHandler::handleTm: Deserialization failed for " << context << ": 0x" + << std::hex << std::setw(4) << result << std::dec << std::endl; } dataset.setValidityBufferGeneration(true); dataset.setValidity(true, true); @@ -2787,11 +2794,12 @@ ReturnValue_t StarTrackerHandler::checkCommand(ActionId_t actionId) { case startracker::REQ_BLOBS: case startracker::REQ_CENTROID: case startracker::REQ_CENTROIDS: - case startracker::REQ_CONTRAST: + case startracker::REQ_CONTRAST: { if (getMode() == MODE_ON and getSubmode() != startracker::Program::FIRMWARE) { return STARTRACKER_NOT_RUNNING_FIRMWARE; } break; + } case startracker::FIRMWARE_UPDATE: case startracker::FLASH_READ: if (getMode() != MODE_ON or getSubmode() != startracker::Program::BOOTLOADER) { diff --git a/mission/acs/str/StarTrackerHandler.h b/mission/acs/str/StarTrackerHandler.h index c43d70fe..3bfdc8fd 100644 --- a/mission/acs/str/StarTrackerHandler.h +++ b/mission/acs/str/StarTrackerHandler.h @@ -212,7 +212,7 @@ class StarTrackerHandler : public DeviceHandlerBase { startracker::BlobsSet blobsSet; startracker::CentroidSet centroidSet; startracker::CentroidsSet centroidsSet; - startracker::CentroidsSet contrastSet; + startracker::ContrastSet contrastSet; // Pointer to object responsible for uploading and downloading images to/from the star tracker StrComHandler* strHelper = nullptr; @@ -519,7 +519,7 @@ class StarTrackerHandler : public DeviceHandlerBase { * * @return returnvalue::OK if successful, otherwise error return value */ - ReturnValue_t handleTm(const uint8_t* rawFrame, LocalPoolDataSetBase& dataset, size_t size, + ReturnValue_t handleTm(const uint8_t* rawFrame, LocalPoolDataSetBase& dataset, const char* context); ReturnValue_t handleAutoBlobTm(const uint8_t* rawFrame); diff --git a/mission/acs/str/strHelpers.h b/mission/acs/str/strHelpers.h index 834336a9..808d6060 100644 --- a/mission/acs/str/strHelpers.h +++ b/mission/acs/str/strHelpers.h @@ -540,8 +540,6 @@ static const uint32_t FLASH_REGION_SIZE = 0x20000; */ class TemperatureSet : public StaticLocalDataSet { public: - static const size_t SIZE = 24; - TemperatureSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, TEMPERATURE_SET_ID) {} TemperatureSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, TEMPERATURE_SET_ID)) {} @@ -571,8 +569,6 @@ class TemperatureSet : public StaticLocalDataSet { */ class VersionSet : public StaticLocalDataSet { public: - static const size_t SIZE = 15; - VersionSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, VERSION_SET_ID) {} VersionSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, VERSION_SET_ID)) {} @@ -602,8 +598,6 @@ class VersionSet : public StaticLocalDataSet { */ class InterfaceSet : public StaticLocalDataSet { public: - static const size_t SIZE = 20; - InterfaceSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, REQ_INTERFACE) {} InterfaceSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, REQ_INTERFACE)) {} @@ -631,8 +625,6 @@ class InterfaceSet : public StaticLocalDataSet { */ class PowerSet : public StaticLocalDataSet { public: - static const size_t SIZE = 76; - PowerSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, REQ_INTERFACE) {} PowerSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, REQ_INTERFACE)) {} @@ -696,8 +688,6 @@ class PowerSet : public StaticLocalDataSet { */ class TimeSet : public StaticLocalDataSet { public: - static const size_t SIZE = 24; - TimeSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, TIME_SET_ID) {} TimeSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, TIME_SET_ID)) {} @@ -724,8 +714,6 @@ class TimeSet : public StaticLocalDataSet { */ class SolutionSet : public StaticLocalDataSet { public: - static const size_t SIZE = 79; - SolutionSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, SOLUTION_SET_ID) {} SolutionSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, SOLUTION_SET_ID)) {} @@ -1451,11 +1439,9 @@ class AutoBlobSet : public StaticLocalDataSet<3> { public: AutoBlobSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, AUTO_BLOB_SET_ID) {} // Ticks timestamp - lp_var_t ticks = - lp_var_t(sid.objectId, PoolIds::TICKS_AUTO_BLOB, this); + lp_var_t ticks = lp_var_t(sid.objectId, PoolIds::TICKS_AUTO_BLOB, this); // Unix time stamp - lp_var_t timeUs = - lp_var_t(sid.objectId, PoolIds::TIME_AUTO_BLOB, this); + lp_var_t timeUs = lp_var_t(sid.objectId, PoolIds::TIME_AUTO_BLOB, this); lp_var_t threshold = lp_var_t(sid.objectId, PoolIds::AUTO_BLOB_THRESHOLD, this); private: @@ -1463,7 +1449,6 @@ class AutoBlobSet : public StaticLocalDataSet<3> { class MatchedCentroidsSet : public StaticLocalDataSet<20> { public: - static constexpr size_t SIZE = 321; MatchedCentroidsSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, MATCHED_CENTROIDS_SET_ID) {} MatchedCentroidsSet(object_id_t objectId) @@ -1553,27 +1538,18 @@ class CentroidsSet : public StaticLocalDataSet<10> { lp_vec_t(sid.objectId, PoolIds::CENTROIDS_MAGNITUDES, this); }; -class ContrastSet: public StaticLocalDataSet<8> { - -public: - static constexpr size_t SIZE = 156; - +class ContrastSet : public StaticLocalDataSet<8> { + public: ContrastSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, CONTRAST_SET_ID) {} // Data received from the Centroids Telemetry Set (ID 29) - lp_var_t ticks = - lp_var_t(sid.objectId, PoolIds::CONTRAST_TICKS, this); + lp_var_t ticks = lp_var_t(sid.objectId, PoolIds::CONTRAST_TICKS, this); // Unix time stamp - lp_var_t timeUs = - lp_var_t(sid.objectId, PoolIds::CONTRAST_TIME, this); - lp_vec_t contrastA = - lp_vec_t(sid.objectId, PoolIds::CONTRAST_A, this); - lp_vec_t contrastB = - lp_vec_t(sid.objectId, PoolIds::CONTRAST_B, this); - lp_vec_t contrastC = - lp_vec_t(sid.objectId, PoolIds::CONTRAST_C, this); - lp_vec_t contrastD = - lp_vec_t(sid.objectId, PoolIds::CONTRAST_D, this); + lp_var_t timeUs = lp_var_t(sid.objectId, PoolIds::CONTRAST_TIME, this); + lp_vec_t contrastA = lp_vec_t(sid.objectId, PoolIds::CONTRAST_A, this); + lp_vec_t contrastB = lp_vec_t(sid.objectId, PoolIds::CONTRAST_B, this); + lp_vec_t contrastC = lp_vec_t(sid.objectId, PoolIds::CONTRAST_C, this); + lp_vec_t contrastD = lp_vec_t(sid.objectId, PoolIds::CONTRAST_D, this); }; /** From 656c69f85809b5a84633c3403da1f2a77f7db90a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 27 Oct 2023 12:32:59 +0200 Subject: [PATCH 241/257] bump tmtc --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index 5821c60e..72460fdb 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 5821c60eb4743b014eb4641104bc35213f0b465b +Subproject commit 72460fdb4960a5c3116826e1a8dbae4253c8ff25 From a877edf40befd7baf0596ac0589f1517dd6b609b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 27 Oct 2023 12:34:33 +0200 Subject: [PATCH 242/257] bump tmtc --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index 72460fdb..0aaf6321 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 72460fdb4960a5c3116826e1a8dbae4253c8ff25 +Subproject commit 0aaf63215b5fe010a5447e5d64e1b4150d543847 From 5a67ce56aab49c2ac28a1523cbcb8e000718a3dd Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 27 Oct 2023 12:43:32 +0200 Subject: [PATCH 243/257] changelog --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e0b669f9..3301f65f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,11 @@ will consitute of a breaking change warranting a new major release: ## Added +- STR: Added new TM sets: Blob, Blobs, MatchedCentroids, Contrast, AutoBlob +- STR: Added new mechanism where the secondary TM which is polled can now be a set instead of + being temperature only. An API is exposed which allows to add a data set to that set of secondary + telemetry, reset it back to temperature only, and read the whole set. This allows more debugging + capability. - CFDP source handler, which allows file downlink using the standardized CFDP interface. - Proper back pressure handling for the CFDP handler, where the `LiveTmTask` is able to throttle @@ -57,7 +62,6 @@ will consitute of a breaking change warranting a new major release: ## Added -- STR: Added new TM sets: Blob, Blobs, MatchedCentroids. - EPS Subsystem has been added to EIVE System Tree - Power Controller for calculating the State of Charge and FDIR regarding low SoC has been introduced. From d2b5384f0586cb86d1031159a26be29b8354b757 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 27 Oct 2023 12:54:32 +0200 Subject: [PATCH 244/257] make marius happy --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3301f65f..9688a565 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,7 @@ will consitute of a breaking change warranting a new major release: ## Added -- STR: Added new TM sets: Blob, Blobs, MatchedCentroids, Contrast, AutoBlob +- STR: Added new TM sets: Blob, Blobs, MatchedCentroids, Contrast, AutoBlob, Centroid, Centroids - STR: Added new mechanism where the secondary TM which is polled can now be a set instead of being temperature only. An API is exposed which allows to add a data set to that set of secondary telemetry, reset it back to temperature only, and read the whole set. This allows more debugging From 43e981dfed4e31589a6ca44d0b3bf056678027f9 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 27 Oct 2023 14:24:59 +0200 Subject: [PATCH 245/257] prep v7.2.0 --- CHANGELOG.md | 2 ++ CMakeLists.txt | 2 +- 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 +- tmtc | 2 +- 11 files changed, 12 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b218c940..320c33a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ will consitute of a breaking change warranting a new major release: # [unreleased] +# [v7.2.0] 2023-10-27 + ## Added - STR: Added new TM sets: Blob, Blobs, MatchedCentroids, Contrast, AutoBlob, Centroid, Centroids diff --git a/CMakeLists.txt b/CMakeLists.txt index 65e85d35..cbfd7815 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,7 @@ cmake_minimum_required(VERSION 3.13) set(OBSW_VERSION_MAJOR 7) -set(OBSW_VERSION_MINOR 1) +set(OBSW_VERSION_MINOR 2) set(OBSW_VERSION_REVISION 0) # set(CMAKE_VERBOSE TRUE) diff --git a/bsp_hosted/fsfwconfig/events/translateEvents.cpp b/bsp_hosted/fsfwconfig/events/translateEvents.cpp index 62dafe33..099a4c7a 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:29:35 + * Generated on: 2023-10-27 14:24:05 */ #include "translateEvents.h" diff --git a/bsp_hosted/fsfwconfig/objects/translateObjects.cpp b/bsp_hosted/fsfwconfig/objects/translateObjects.cpp index 8a61f2ed..1fa48c9a 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:29:35 + * Generated on: 2023-10-27 14:24:05 */ #include "translateObjects.h" diff --git a/generators/bsp_hosted_events.csv b/generators/bsp_hosted_events.csv index eafa7584..de7416f5 100644 --- a/generators/bsp_hosted_events.csv +++ b/generators/bsp_hosted_events.csv @@ -312,5 +312,5 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 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;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 +14501;0x38a5;TEMPERATURE_ALL_ONES_RECOVERY;INFO;Detected valid values for a prolonged time again, resetting all counters. P1: Number of periods with invalid messages. P2: Maximum 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_events.csv b/generators/bsp_q7s_events.csv index eafa7584..de7416f5 100644 --- a/generators/bsp_q7s_events.csv +++ b/generators/bsp_q7s_events.csv @@ -312,5 +312,5 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 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;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 +14501;0x38a5;TEMPERATURE_ALL_ONES_RECOVERY;INFO;Detected valid values for a prolonged time again, resetting all counters. P1: Number of periods with invalid messages. P2: Maximum 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/events/translateEvents.cpp b/generators/events/translateEvents.cpp index 62dafe33..099a4c7a 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:29:35 + * Generated on: 2023-10-27 14:24:05 */ #include "translateEvents.h" diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index d8046cb8..5cc157c2 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:29:35 + * Generated on: 2023-10-27 14:24:05 */ #include "translateObjects.h" diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index 62dafe33..099a4c7a 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:29:35 + * Generated on: 2023-10-27 14:24:05 */ #include "translateEvents.h" diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index d8046cb8..5cc157c2 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:29:35 + * Generated on: 2023-10-27 14:24:05 */ #include "translateObjects.h" diff --git a/tmtc b/tmtc index 0aaf6321..14334dae 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 0aaf63215b5fe010a5447e5d64e1b4150d543847 +Subproject commit 14334dae92d1e54464717cf2d4729e12a1931b82 From dca6cade117941cf4755f9dda3f4d2538472af99 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 27 Oct 2023 15:03:02 +0200 Subject: [PATCH 246/257] bump tmtc --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index 14334dae..99c6c8bb 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 14334dae92d1e54464717cf2d4729e12a1931b82 +Subproject commit 99c6c8bbd0d791d8b17720de481c6142091a54a4 From 647a394150f5a1030ae92f758cb1ad98dfac08ff Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 27 Oct 2023 15:04:11 +0200 Subject: [PATCH 247/257] eive-tmtc version --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 320c33a3..579dc5b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,8 @@ will consitute of a breaking change warranting a new major release: # [v7.2.0] 2023-10-27 +- `eive-tmtc` v5.10.1 + ## Added - STR: Added new TM sets: Blob, Blobs, MatchedCentroids, Contrast, AutoBlob, Centroid, Centroids From ad6fa66daf985304b4246804b56472c11feb0fef Mon Sep 17 00:00:00 2001 From: eggertm Date: Fri, 27 Oct 2023 15:37:45 +0200 Subject: [PATCH 248/257] update internal resistance --- mission/controller/PowerController.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mission/controller/PowerController.h b/mission/controller/PowerController.h index 1f27616d..e6c48d42 100644 --- a/mission/controller/PowerController.h +++ b/mission/controller/PowerController.h @@ -53,13 +53,13 @@ class PowerController : public ExtendedControllerBase, public ReceivesParameterM ReturnValue_t calculateCoulombCounterChargeUpperThreshold(); // Parameters - float batteryInternalResistance = 70.0 / 2.0 / 1000.0; // [Ohm] - float batteryMaximumCapacity = 2.6 * 2; // [Ah] - float coulombCounterVoltageUpperThreshold = 16.2; // [V] - double maxAllowedTimeDiff = 1.5; // [s] - float payloadOpLimitOn = 0.90; // [%] - float payloadOpLimitLow = 0.75; // [%] - float higherModesLimit = 0.6; // [%] + float batteryInternalResistance = 70.0 / 2.0 / 1000.0 * 1.94; // [Ohm] + float batteryMaximumCapacity = 2.6 * 2; // [Ah] + float coulombCounterVoltageUpperThreshold = 16.2; // [V] + double maxAllowedTimeDiff = 1.5; // [s] + float payloadOpLimitOn = 0.90; // [%] + float payloadOpLimitLow = 0.75; // [%] + float higherModesLimit = 0.6; // [%] // OCV Look-up-Table {[Ah],[V]} static constexpr uint8_t LOOK_UP_TABLE_MAX_IDX = 99; From a2090448ff3f13c4a2bd9e5ba60128bea7537831 Mon Sep 17 00:00:00 2001 From: meggert Date: Mon, 30 Oct 2023 08:52:18 +0100 Subject: [PATCH 249/257] changelog --- CHANGELOG.md | 1 + mission/controller/PowerController.h | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b218c940..dd37e663 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -57,6 +57,7 @@ will consitute of a breaking change warranting a new major release: - SUS FDIR should now trigger less events. The finish event is now only triggered once the SUS has been working properly for a minute again. It will then display the number of periods during which the SUS was not working as well as the maximum amount of invalid messages. +- Updated battery internal resistance to new value # [v7.1.0] 2023-10-11 diff --git a/mission/controller/PowerController.h b/mission/controller/PowerController.h index e6c48d42..b7c3d1a0 100644 --- a/mission/controller/PowerController.h +++ b/mission/controller/PowerController.h @@ -53,13 +53,13 @@ class PowerController : public ExtendedControllerBase, public ReceivesParameterM ReturnValue_t calculateCoulombCounterChargeUpperThreshold(); // Parameters - float batteryInternalResistance = 70.0 / 2.0 / 1000.0 * 1.94; // [Ohm] - float batteryMaximumCapacity = 2.6 * 2; // [Ah] - float coulombCounterVoltageUpperThreshold = 16.2; // [V] - double maxAllowedTimeDiff = 1.5; // [s] - float payloadOpLimitOn = 0.90; // [%] - float payloadOpLimitLow = 0.75; // [%] - float higherModesLimit = 0.6; // [%] + float batteryInternalResistance = 0.06798200367; // [Ohm] + float batteryMaximumCapacity = 2.6 * 2; // [Ah] + float coulombCounterVoltageUpperThreshold = 16.2; // [V] + double maxAllowedTimeDiff = 1.5; // [s] + float payloadOpLimitOn = 0.90; // [%] + float payloadOpLimitLow = 0.75; // [%] + float higherModesLimit = 0.6; // [%] // OCV Look-up-Table {[Ah],[V]} static constexpr uint8_t LOOK_UP_TABLE_MAX_IDX = 99; From e45f9899ff376c2a3eadb3ebc29c3ab065ec97e9 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 30 Oct 2023 14:46:46 +0100 Subject: [PATCH 250/257] changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 276a6b1f..d3a8ed70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,12 @@ will consitute of a breaking change warranting a new major release: # [unreleased] +## Changed + +- Changed PDEC addresses depending on which firmware version is used. It is suspected that + the previous addresses were invalid and not properly covered by the Linux memory protection. + The OBSW will use the old addresses for older FW versions. + # [v7.2.0] 2023-10-27 - `eive-tmtc` v5.10.1 From c11867323c2d4d51416a76349668c9a8a1228b6d Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 30 Oct 2023 16:11:36 +0100 Subject: [PATCH 251/257] changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d3a8ed70..eae983a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ will consitute of a breaking change warranting a new major release: # [unreleased] +# [v7.3.0] 2023-10-30 + ## Changed - Changed PDEC addresses depending on which firmware version is used. It is suspected that From 3158f2341c1cc77a20cad346adf153d224e31456 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 30 Oct 2023 16:11:51 +0100 Subject: [PATCH 252/257] update version number --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cbfd7815..78be7ec5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,7 @@ cmake_minimum_required(VERSION 3.13) set(OBSW_VERSION_MAJOR 7) -set(OBSW_VERSION_MINOR 2) +set(OBSW_VERSION_MINOR 3) set(OBSW_VERSION_REVISION 0) # set(CMAKE_VERBOSE TRUE) From b081766829bef550f79dac075aa693decc774ea9 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 6 Nov 2023 14:37:13 +0100 Subject: [PATCH 253/257] always add PLOC code --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cbfd7815..ec343707 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -126,13 +126,13 @@ set(OBSW_ADD_HEATERS 1 CACHE STRING "Add TCS heaters") set(OBSW_ADD_PLOC_SUPERVISOR - ${INIT_VAL} + 1 CACHE STRING "Add PLOC supervisor handler") set(OBSW_ADD_SA_DEPL ${INIT_VAL} CACHE STRING "Add SA deployment handler") set(OBSW_ADD_PLOC_MPSOC - ${INIT_VAL} + 1 CACHE STRING "Add MPSoC handler") set(OBSW_ADD_ACS_CTRL ${INIT_VAL} From 4986955a0f14b63791da0062cdea94dab7791de5 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 6 Nov 2023 14:43:31 +0100 Subject: [PATCH 254/257] bump changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d3a8ed70..1575e29a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,10 @@ will consitute of a breaking change warranting a new major release: the previous addresses were invalid and not properly covered by the Linux memory protection. The OBSW will use the old addresses for older FW versions. +## Added + +- Always add PLOC MPSoC and PLOC SUPV components for the EM as well. + # [v7.2.0] 2023-10-27 - `eive-tmtc` v5.10.1 From 93c5e542bdc0846beaa11c4e589b2de06642ff57 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 6 Nov 2023 14:44:01 +0100 Subject: [PATCH 255/257] bump release date --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eae983a9..868d01fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,7 @@ will consitute of a breaking change warranting a new major release: # [unreleased] -# [v7.3.0] 2023-10-30 +# [v7.3.0] 2023-11-06 ## Changed From 5862c1bb40b4d8fd853e29e7bf16054c0f92f7d1 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 7 Nov 2023 09:12:44 +0100 Subject: [PATCH 256/257] auto-formatter --- bsp_q7s/objectFactory.cpp | 8 ++++---- linux/ipcore/PdecHandler.cpp | 4 +--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/bsp_q7s/objectFactory.cpp b/bsp_q7s/objectFactory.cpp index d0c0f924..eadf70c6 100644 --- a/bsp_q7s/objectFactory.cpp +++ b/bsp_q7s/objectFactory.cpp @@ -643,12 +643,12 @@ void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF, PowerSwit supvGpioCookie->addGpio(gpioIds::ENABLE_SUPV_UART, gpioConfigSupv); gpioComIF->addGpios(supvGpioCookie); const char* plocSupvDev = q7s::UART_PLOC_SUPERVISOR_DEV; - if(not std::filesystem::exists(plocSupvDev)) { + if (not std::filesystem::exists(plocSupvDev)) { plocSupvDev = q7s::UART_PLOC_SUPERVISOR_DEV_FALLBACK; } - auto supervisorCookie = new SerialCookie(objects::PLOC_SUPERVISOR_HANDLER, - plocSupvDev, serial::PLOC_SUPV_BAUD, - supv::MAX_PACKET_SIZE * 20, UartModes::NON_CANONICAL); + auto supervisorCookie = + new SerialCookie(objects::PLOC_SUPERVISOR_HANDLER, plocSupvDev, serial::PLOC_SUPV_BAUD, + supv::MAX_PACKET_SIZE * 20, UartModes::NON_CANONICAL); supervisorCookie->setNoFixedSizeReply(); auto supvHelper = new PlocSupvUartManager(objects::PLOC_SUPERVISOR_HELPER); auto* supvHandler = new PlocSupervisorHandler(objects::PLOC_SUPERVISOR_HANDLER, supervisorCookie, diff --git a/linux/ipcore/PdecHandler.cpp b/linux/ipcore/PdecHandler.cpp index 28598aa8..fd952855 100644 --- a/linux/ipcore/PdecHandler.cpp +++ b/linux/ipcore/PdecHandler.cpp @@ -468,9 +468,7 @@ bool PdecHandler::newTcReceived() { return true; } -void PdecHandler::doPeriodicWork() { - checkLocks(); -} +void PdecHandler::doPeriodicWork() { checkLocks(); } bool PdecHandler::checkFrameAna(uint32_t pdecFar) { bool frameValid = false; From 49a87224e75f8d182a008ab1e2297bcd14f37a6f Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 7 Nov 2023 09:13:21 +0100 Subject: [PATCH 257/257] changelog update --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 738ec6a6..74bd77e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,7 @@ will consitute of a breaking change warranting a new major release: # [unreleased] -# [v7.3.0] 2023-11-06 +# [v7.3.0] 2023-11-07 ## Changed