From 214428295bbefcea6e98f091bdee517db69a9d1b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 12 Oct 2022 12:01:48 +0200 Subject: [PATCH 01/97] only do time file handling with mounted SD card --- bsp_q7s/core/CoreController.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsp_q7s/core/CoreController.cpp b/bsp_q7s/core/CoreController.cpp index 083aebf5..30d5228d 100644 --- a/bsp_q7s/core/CoreController.cpp +++ b/bsp_q7s/core/CoreController.cpp @@ -1241,6 +1241,7 @@ void CoreController::performMountedSdCardOperations() { initClockFromTimeFile(); performRebootFileHandling(false); } + timeFileHandler(); }; bool clearOneShotFlag = false; if (sdInfo.active == sd::SdCard::SLOT_0 and sdcMan->isSdCardUsable(sd::SdCard::SLOT_0)) { @@ -1254,7 +1255,6 @@ void CoreController::performMountedSdCardOperations() { if (clearOneShotFlag) { performOneShotSdCardOpsSwitch = true; } - timeFileHandler(); } ReturnValue_t CoreController::performSdCardCheck() { -- 2.43.0 From b6b258d82ce23e4ad44d29656607dcb5721d4fc0 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 12 Oct 2022 13:21:58 +0200 Subject: [PATCH 02/97] remove gpio pst --- bsp_q7s/core/InitMission.cpp | 37 +-- bsp_q7s/core/ObjectFactory.cpp | 6 +- bsp_q7s/core/ObjectFactory.h | 2 +- bsp_q7s/fmObjectFactory.cpp | 2 +- .../pollingSequenceFactory.cpp | 16 -- .../pollingsequence/pollingSequenceFactory.h | 3 - .../devices/SolarArrayDeploymentHandler.cpp | 225 +++++++++--------- mission/devices/SolarArrayDeploymentHandler.h | 47 ++-- 8 files changed, 152 insertions(+), 186 deletions(-) diff --git a/bsp_q7s/core/InitMission.cpp b/bsp_q7s/core/InitMission.cpp index a5cc3df9..d74581c7 100644 --- a/bsp_q7s/core/InitMission.cpp +++ b/bsp_q7s/core/InitMission.cpp @@ -211,13 +211,27 @@ void initmission::initTasks() { tcsTask->addComponent(rtd, DeviceHandlerIF::SEND_READ); tcsTask->addComponent(rtd, DeviceHandlerIF::GET_READ); } - tcsTask->addComponent(objects::TCS_BOARD_ASS); -#endif /* OBSW_ADD_RTD_DEVICES */ - -#if OBSW_ADD_TCS_CTRL == 1 - tcsTask->addComponent(objects::THERMAL_CONTROLLER); #endif + PeriodicTaskIF* tcsSystemTask = factory->createPeriodicTask( + "TCS_TASK", 45, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.5, missedDeadlineFunc); +#if OBSW_ADD_RTD_DEVICES == 1 + result = tcsSystemTask->addComponent(objects::TCS_BOARD_ASS); + if (result != returnvalue::OK) { + initmission::printAddObjectError("TCS_BOARD_ASS", objects::TCS_BOARD_ASS); + } +#endif /* OBSW_ADD_RTD_DEVICES */ +#if OBSW_ADD_TCS_CTRL == 1 + result = tcsSystemTask->addComponent(objects::THERMAL_CONTROLLER); + if (result != returnvalue::OK) { + initmission::printAddObjectError("THERMAL_CONTROLLER", objects::THERMAL_CONTROLLER); + } +#endif + result = tcsSystemTask->addComponent(objects::HEATER_HANDLER); + if (result != returnvalue::OK) { + initmission::printAddObjectError("HEATER_HANDLER", objects::HEATER_HANDLER); + } + #if OBSW_ADD_STAR_TRACKER == 1 PeriodicTaskIF* strHelperTask = factory->createPeriodicTask( "STR_HELPER", 20, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc); @@ -319,6 +333,7 @@ void initmission::initTasks() { tcsPollingTask->startTask(); tcsTask->startTask(); #endif /* OBSW_ADD_RTD_DEVICES == 1 */ + tcsSystemTask->startTask(); #if OBSW_ADD_PLOC_SUPERVISOR == 1 supvHelperTask->startTask(); #endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */ @@ -378,18 +393,6 @@ void initmission::createPstTasks(TaskFactory& factory, taskVec.push_back(uartPst); } - FixedTimeslotTaskIF* gpioPst = factory.createFixedTimeslotTask( - "GPIO_PST", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.2, missedDeadlineFunc); - result = pst::pstGpio(gpioPst); - if (result != returnvalue::OK) { - if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) { - sif::warning << "InitMission::initTasks: GPIO PST is empty" << std::endl; - } else { - sif::error << "InitMission::initTasks: Creating GPIO PST failed!" << std::endl; - } - } else { - taskVec.push_back(gpioPst); - } #if OBSW_ADD_I2C_TEST_CODE == 0 FixedTimeslotTaskIF* i2cPst = factory.createFixedTimeslotTask( "I2C_PST", 65, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 0.2, missedDeadlineFunc); diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 80dcb55e..db2779bd 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -539,7 +539,7 @@ void ObjectFactory::createHeaterComponents(GpioIF* gpioIF, PowerSwitchIF* pwrSwi pcdu::Switches::PDU2_CH3_TCS_BOARD_HEATER_IN_8V); } -void ObjectFactory::createSolarArrayDeploymentComponents() { +void ObjectFactory::createSolarArrayDeploymentComponents(PowerSwitchIF& pwrSwitcher) { using namespace gpio; GpioCookie* solarArrayDeplCookie = new GpioCookie; GpiodRegularByLineName* gpio = nullptr; @@ -555,9 +555,9 @@ void ObjectFactory::createSolarArrayDeploymentComponents() { // TODO: Find out burn time. For now set to 1000 ms. new SolarArrayDeploymentHandler(objects::SOLAR_ARRAY_DEPL_HANDLER, objects::GPIO_IF, - solarArrayDeplCookie, objects::PCDU_HANDLER, + solarArrayDeplCookie, pwrSwitcher, pcdu::Switches::PDU2_CH5_DEPLOYMENT_MECHANISM_8V, - gpioIds::DEPLSA1, gpioIds::DEPLSA2, 1000); + gpioIds::DEPLSA1, gpioIds::DEPLSA2); } void ObjectFactory::createSyrlinksComponents(PowerSwitchIF* pwrSwitcher) { diff --git a/bsp_q7s/core/ObjectFactory.h b/bsp_q7s/core/ObjectFactory.h index 0b81c235..37cdc70e 100644 --- a/bsp_q7s/core/ObjectFactory.h +++ b/bsp_q7s/core/ObjectFactory.h @@ -33,7 +33,7 @@ void createHeaterComponents(GpioIF* gpioIF, PowerSwitchIF* pwrSwitcher, HealthTa void createImtqComponents(PowerSwitchIF* pwrSwitcher); void createBpxBatteryComponent(); void createStrComponents(PowerSwitchIF* pwrSwitcher); -void createSolarArrayDeploymentComponents(); +void createSolarArrayDeploymentComponents(PowerSwitchIF& pwrSwitcher); void createSyrlinksComponents(PowerSwitchIF* pwrSwitcher); void createPayloadComponents(LinuxLibgpioIF* gpioComIF); void createReactionWheelComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchIF* pwrSwitcher); diff --git a/bsp_q7s/fmObjectFactory.cpp b/bsp_q7s/fmObjectFactory.cpp index 1746c048..413223d8 100644 --- a/bsp_q7s/fmObjectFactory.cpp +++ b/bsp_q7s/fmObjectFactory.cpp @@ -35,7 +35,7 @@ void ObjectFactory::produce(void* args) { createAcsBoardComponents(gpioComIF, uartComIF, pwrSwitcher); #endif createHeaterComponents(gpioComIF, pwrSwitcher, healthTable); - createSolarArrayDeploymentComponents(); + createSolarArrayDeploymentComponents(*pwrSwitcher); createPlPcduComponents(gpioComIF, spiMainComIF, pwrSwitcher); #if OBSW_ADD_SYRLINKS == 1 createSyrlinksComponents(pwrSwitcher); diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp index e11632c8..0d75588f 100644 --- a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp @@ -15,22 +15,6 @@ #define RPI_TEST_GPS_HANDLER 0 #endif -ReturnValue_t pst::pstGpio(FixedTimeslotTaskIF *thisSequence) { - // Length of a communication cycle - uint32_t length = thisSequence->getPeriodMs(); - - thisSequence->addSlot(objects::HEATER_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::SOLAR_ARRAY_DEPL_HANDLER, length * 0, - DeviceHandlerIF::PERFORM_OPERATION); - - if (thisSequence->checkSequence() == returnvalue::OK) { - return returnvalue::OK; - } - - sif::error << "PollingSequence::initialize has errors!" << std::endl; - return returnvalue::FAILED; -} - ReturnValue_t pst::pstSpiRw(FixedTimeslotTaskIF *thisSequence) { uint32_t length = thisSequence->getPeriodMs(); static_cast(length); diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.h b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.h index 960820b5..1b585d81 100644 --- a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.h +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.h @@ -31,9 +31,6 @@ class FixedTimeslotTaskIF; */ namespace pst { -/* 0.4 second period init*/ -ReturnValue_t pstGpio(FixedTimeslotTaskIF* thisSequence); - /** * @brief This function creates the PST for all gomspace devices. * @details diff --git a/mission/devices/SolarArrayDeploymentHandler.cpp b/mission/devices/SolarArrayDeploymentHandler.cpp index c4e9a43b..63425615 100644 --- a/mission/devices/SolarArrayDeploymentHandler.cpp +++ b/mission/devices/SolarArrayDeploymentHandler.cpp @@ -7,16 +7,15 @@ SolarArrayDeploymentHandler::SolarArrayDeploymentHandler( object_id_t setObjectId_, object_id_t gpioDriverId_, CookieIF* gpioCookie_, - object_id_t mainLineSwitcherObjectId_, pcdu::Switches mainLineSwitch_, gpioId_t deplSA1, - gpioId_t deplSA2, uint32_t burnTimeMs) + PowerSwitchIF& mainLineSwitcher_, pcdu::Switches mainLineSwitch_, gpioId_t deplSA1, + gpioId_t deplSA2) : SystemObject(setObjectId_), gpioDriverId(gpioDriverId_), gpioCookie(gpioCookie_), - mainLineSwitcherObjectId(mainLineSwitcherObjectId_), - mainLineSwitch(mainLineSwitch_), deplSA1(deplSA1), deplSA2(deplSA2), - burnTimeMs(burnTimeMs), + mainLineSwitcher(mainLineSwitcher_), + mainLineSwitch(mainLineSwitch_), actionHelper(this, nullptr) { auto mqArgs = MqArgs(setObjectId_, static_cast(this)); commandQueue = QueueFactory::instance()->createMessageQueue( @@ -52,16 +51,6 @@ ReturnValue_t SolarArrayDeploymentHandler::initialize() { return ObjectManagerIF::CHILD_INIT_FAILED; } - if (mainLineSwitcherObjectId != objects::NO_OBJECT) { - mainLineSwitcher = ObjectManager::instance()->get(mainLineSwitcherObjectId); - if (mainLineSwitcher == nullptr) { - sif::error - << "SolarArrayDeploymentHandler::initialize: Main line switcher failed to fetch object" - << "from object ID." << std::endl; - return ObjectManagerIF::CHILD_INIT_FAILED; - } - } - result = actionHelper.initialize(commandQueue); if (result != returnvalue::OK) { return ObjectManagerIF::CHILD_INIT_FAILED; @@ -71,102 +60,102 @@ ReturnValue_t SolarArrayDeploymentHandler::initialize() { } void SolarArrayDeploymentHandler::handleStateMachine() { - switch (stateMachine) { - case WAIT_ON_DELOYMENT_COMMAND: - readCommandQueue(); - break; - case SWITCH_8V_ON: - mainLineSwitcher->sendSwitchCommand(mainLineSwitch, PowerSwitchIF::SWITCH_ON); - mainSwitchCountdown.setTimeout(mainLineSwitcher->getSwitchDelayMs()); - stateMachine = WAIT_ON_8V_SWITCH; - break; - case WAIT_ON_8V_SWITCH: - performWaitOn8VActions(); - break; - case SWITCH_DEPL_GPIOS: - switchDeploymentTransistors(); - break; - case WAIT_ON_DEPLOYMENT_FINISH: - handleDeploymentFinish(); - break; - case WAIT_FOR_MAIN_SWITCH_OFF: - if (mainLineSwitcher->getSwitchState(mainLineSwitch) == PowerSwitchIF::SWITCH_OFF) { - stateMachine = WAIT_ON_DELOYMENT_COMMAND; - } else if (mainSwitchCountdown.hasTimedOut()) { - triggerEvent(MAIN_SWITCH_OFF_TIMEOUT); - sif::error << "SolarArrayDeploymentHandler::handleStateMachine: Failed to switch main" - << " switch off" << std::endl; - stateMachine = WAIT_ON_DELOYMENT_COMMAND; - } - break; - default: - sif::debug << "SolarArrayDeploymentHandler::handleStateMachine: Invalid state" << std::endl; - break; - } +// switch (stateMachine) { +// case WAIT_ON_DELOYMENT_COMMAND: +// readCommandQueue(); +// break; +// case SWITCH_8V_ON: +// mainLineSwitcher.sendSwitchCommand(mainLineSwitch, PowerSwitchIF::SWITCH_ON); +// mainSwitchCountdown.setTimeout(mainLineSwitcher.getSwitchDelayMs()); +// stateMachine = WAIT_ON_8V_SWITCH; +// break; +// case WAIT_ON_8V_SWITCH: +// performWaitOn8VActions(); +// break; +// case SWITCH_DEPL_GPIOS: +// deploymentTransistorsOn(); +// break; +//// case WAIT_ON_DEPLOYMENT_FINISH: +//// handleDeploymentFinish(); +//// break; +// case WAIT_FOR_MAIN_SWITCH_OFF: +// if (mainLineSwitcher.getSwitchState(mainLineSwitch) == PowerSwitchIF::SWITCH_OFF) { +// stateMachine = WAIT_ON_DELOYMENT_COMMAND; +// } else if (mainSwitchCountdown.hasTimedOut()) { +// triggerEvent(MAIN_SWITCH_OFF_TIMEOUT); +// sif::error << "SolarArrayDeploymentHandler::handleStateMachine: Failed to switch main" +// << " switch off" << std::endl; +// stateMachine = WAIT_ON_DELOYMENT_COMMAND; +// } +// break; +// default: +// sif::debug << "SolarArrayDeploymentHandler::handleStateMachine: Invalid state" << std::endl; +// break; +// } } void SolarArrayDeploymentHandler::performWaitOn8VActions() { - if (mainLineSwitcher->getSwitchState(mainLineSwitch) == PowerSwitchIF::SWITCH_ON) { - stateMachine = SWITCH_DEPL_GPIOS; - } else { - if (mainSwitchCountdown.hasTimedOut()) { - triggerEvent(MAIN_SWITCH_ON_TIMEOUT); - actionHelper.finish(false, rememberCommanderId, DEPLOY_SOLAR_ARRAYS, - MAIN_SWITCH_TIMEOUT_FAILURE); - stateMachine = WAIT_ON_DELOYMENT_COMMAND; - } - } +// if (mainLineSwitcher.getSwitchState(mainLineSwitch) == PowerSwitchIF::SWITCH_ON) { +// stateMachine = SWITCH_DEPL_GPIOS; +// } else { +// if (mainSwitchCountdown.hasTimedOut()) { +// triggerEvent(MAIN_SWITCH_ON_TIMEOUT); +// actionHelper.finish(false, rememberCommanderId, DEPLOY_SOLAR_ARRAYS, +// MAIN_SWITCH_TIMEOUT_FAILURE); +// stateMachine = WAIT_ON_DELOYMENT_COMMAND; +// } +// } } -void SolarArrayDeploymentHandler::switchDeploymentTransistors() { - ReturnValue_t result = returnvalue::OK; - result = gpioInterface->pullHigh(deplSA1); - if (result != returnvalue::OK) { - sif::debug << "SolarArrayDeploymentHandler::handleStateMachine: Failed to pull solar" - " array deployment switch 1 high " - << std::endl; - /* If gpio switch high failed, state machine is reset to wait for a command reinitiating - * the deployment sequence. */ - stateMachine = WAIT_ON_DELOYMENT_COMMAND; - triggerEvent(DEPL_SA1_GPIO_SWTICH_ON_FAILED); - actionHelper.finish(false, rememberCommanderId, DEPLOY_SOLAR_ARRAYS, SWITCHING_DEPL_SA2_FAILED); - mainLineSwitcher->sendSwitchCommand(mainLineSwitch, PowerSwitchIF::SWITCH_OFF); - } - result = gpioInterface->pullHigh(deplSA2); - if (result != returnvalue::OK) { - sif::debug << "SolarArrayDeploymentHandler::handleStateMachine: Failed to pull solar" - " array deployment switch 2 high " - << std::endl; - stateMachine = WAIT_ON_DELOYMENT_COMMAND; - triggerEvent(DEPL_SA2_GPIO_SWTICH_ON_FAILED); - actionHelper.finish(false, rememberCommanderId, DEPLOY_SOLAR_ARRAYS, SWITCHING_DEPL_SA2_FAILED); - mainLineSwitcher->sendSwitchCommand(mainLineSwitch, PowerSwitchIF::SWITCH_OFF); - } - deploymentCountdown.setTimeout(burnTimeMs); - stateMachine = WAIT_ON_DEPLOYMENT_FINISH; +void SolarArrayDeploymentHandler::deploymentTransistorsOn() { +// ReturnValue_t result = returnvalue::OK; +// result = gpioInterface->pullHigh(deplSA1); +// if (result != returnvalue::OK) { +// sif::debug << "SolarArrayDeploymentHandler::handleStateMachine: Failed to pull solar" +// " array deployment switch 1 high " +// << std::endl; +// /* If gpio switch high failed, state machine is reset to wait for a command reinitiating +// * the deployment sequence. */ +// stateMachine = WAIT_ON_DELOYMENT_COMMAND; +// triggerEvent(DEPL_SA1_GPIO_SWTICH_ON_FAILED); +// actionHelper.finish(false, rememberCommanderId, DEPLOY_SOLAR_ARRAYS, SWITCHING_DEPL_SA2_FAILED); +// mainLineSwitcher.sendSwitchCommand(mainLineSwitch, PowerSwitchIF::SWITCH_OFF); +// } +// result = gpioInterface->pullHigh(deplSA2); +// if (result != returnvalue::OK) { +// sif::debug << "SolarArrayDeploymentHandler::handleStateMachine: Failed to pull solar" +// " array deployment switch 2 high " +// << std::endl; +// stateMachine = WAIT_ON_DELOYMENT_COMMAND; +// triggerEvent(DEPL_SA2_GPIO_SWTICH_ON_FAILED); +// actionHelper.finish(false, rememberCommanderId, DEPLOY_SOLAR_ARRAYS, SWITCHING_DEPL_SA2_FAILED); +// mainLineSwitcher.sendSwitchCommand(mainLineSwitch, PowerSwitchIF::SWITCH_OFF); +// } + //deploymentCountdown.setTimeout(burnTimeMs); + //stateMachine = WAIT_ON_DEPLOYMENT_FINISH; } -void SolarArrayDeploymentHandler::handleDeploymentFinish() { - ReturnValue_t result = returnvalue::OK; - if (deploymentCountdown.hasTimedOut()) { - actionHelper.finish(true, rememberCommanderId, DEPLOY_SOLAR_ARRAYS, returnvalue::OK); - result = gpioInterface->pullLow(deplSA1); - if (result != returnvalue::OK) { - sif::debug << "SolarArrayDeploymentHandler::handleStateMachine: Failed to pull solar" - " array deployment switch 1 low " - << std::endl; - } - result = gpioInterface->pullLow(deplSA2); - if (result != returnvalue::OK) { - sif::debug << "SolarArrayDeploymentHandler::handleStateMachine: Failed to pull solar" - " array deployment switch 2 low " - << std::endl; - } - mainLineSwitcher->sendSwitchCommand(mainLineSwitch, PowerSwitchIF::SWITCH_OFF); - mainSwitchCountdown.setTimeout(mainLineSwitcher->getSwitchDelayMs()); - stateMachine = WAIT_FOR_MAIN_SWITCH_OFF; - } -} +//void SolarArrayDeploymentHandler::handleDeploymentFinish() { +// ReturnValue_t result = returnvalue::OK; +//// if (deploymentCountdown.hasTimedOut()) { +//// actionHelper.finish(true, rememberCommanderId, DEPLOY_SOLAR_ARRAYS, returnvalue::OK); +//// result = gpioInterface->pullLow(deplSA1); +//// if (result != returnvalue::OK) { +//// sif::debug << "SolarArrayDeploymentHandler::handleStateMachine: Failed to pull solar" +//// " array deployment switch 1 low " +//// << std::endl; +//// } +//// result = gpioInterface->pullLow(deplSA2); +//// if (result != returnvalue::OK) { +//// sif::debug << "SolarArrayDeploymentHandler::handleStateMachine: Failed to pull solar" +//// " array deployment switch 2 low " +//// << std::endl; +//// } +// mainLineSwitcher.sendSwitchCommand(mainLineSwitch, PowerSwitchIF::SWITCH_OFF); +// mainSwitchCountdown.setTimeout(mainLineSwitcher.getSwitchDelayMs()); +// stateMachine = WAIT_FOR_MAIN_SWITCH_OFF; +// } +//} void SolarArrayDeploymentHandler::readCommandQueue() { CommandMessage command; @@ -185,20 +174,20 @@ ReturnValue_t SolarArrayDeploymentHandler::executeAction(ActionId_t actionId, MessageQueueId_t commandedBy, const uint8_t* data, size_t size) { ReturnValue_t result; - if (stateMachine != WAIT_ON_DELOYMENT_COMMAND) { - sif::error << "SolarArrayDeploymentHandler::executeAction: Received command while not in" - << "waiting-on-command-state" << std::endl; - return DEPLOYMENT_ALREADY_EXECUTING; - } - if (actionId != DEPLOY_SOLAR_ARRAYS) { - sif::error << "SolarArrayDeploymentHandler::executeAction: Received invalid command" - << std::endl; - result = COMMAND_NOT_SUPPORTED; - } else { - stateMachine = SWITCH_8V_ON; - rememberCommanderId = commandedBy; - result = returnvalue::OK; - } +// if (stateMachine != WAIT_ON_DELOYMENT_COMMAND) { +// sif::error << "SolarArrayDeploymentHandler::executeAction: Received command while not in" +// << "waiting-on-command-state" << std::endl; +// return DEPLOYMENT_ALREADY_EXECUTING; +// } +// if (actionId != DEPLOY_SOLAR_ARRAYS) { +// sif::error << "SolarArrayDeploymentHandler::executeAction: Received invalid command" +// << std::endl; +// result = COMMAND_NOT_SUPPORTED; +// } else { +// stateMachine = SWITCH_8V_ON; +// rememberCommanderId = commandedBy; +// result = returnvalue::OK; +// } return result; } diff --git a/mission/devices/SolarArrayDeploymentHandler.h b/mission/devices/SolarArrayDeploymentHandler.h index 89be12a6..05fb7fb4 100644 --- a/mission/devices/SolarArrayDeploymentHandler.h +++ b/mission/devices/SolarArrayDeploymentHandler.h @@ -26,7 +26,7 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, public SystemObject, public HasActionsIF { public: - static const DeviceCommandId_t DEPLOY_SOLAR_ARRAYS = 0x5; + static constexpr DeviceCommandId_t DEPLOY_SOLAR_ARRAYS_MANUALLY = 0x5; /** * @brief constructor @@ -44,9 +44,8 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, * @param burnTimeMs Time duration the power will be applied to the burn wires. */ SolarArrayDeploymentHandler(object_id_t setObjectId, object_id_t gpioDriverId, - CookieIF* gpioCookie, object_id_t mainLineSwitcherObjectId, - pcdu::Switches mainLineSwitch, gpioId_t deplSA1, gpioId_t deplSA2, - uint32_t burnTimeMs); + CookieIF* gpioCookie, PowerSwitchIF& mainLineSwitcher, + pcdu::Switches mainLineSwitch, gpioId_t deplSA1, gpioId_t deplSA2); virtual ~SolarArrayDeploymentHandler(); @@ -72,16 +71,16 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, static const Event DEPL_SA1_GPIO_SWTICH_ON_FAILED = MAKE_EVENT(3, severity::HIGH); static const Event DEPL_SA2_GPIO_SWTICH_ON_FAILED = MAKE_EVENT(4, severity::HIGH); - enum StateMachine { - WAIT_ON_DELOYMENT_COMMAND, - SWITCH_8V_ON, - WAIT_ON_8V_SWITCH, - SWITCH_DEPL_GPIOS, - WAIT_ON_DEPLOYMENT_FINISH, - WAIT_FOR_MAIN_SWITCH_OFF - }; - - StateMachine stateMachine = WAIT_ON_DELOYMENT_COMMAND; +// enum StateMachine { +// WAIT_ON_DELOYMENT_COMMAND, +// SWITCH_8V_ON, +// WAIT_ON_8V_SWITCH, +// SWITCH_DEPL_GPIOS, +// WAIT_ON_DEPLOYMENT_FINISH, +// WAIT_FOR_MAIN_SWITCH_OFF +// }; +// +// StateMachine stateMachine = WAIT_ON_DELOYMENT_COMMAND; /** * This countdown is used to check if the PCDU sets the 8V line on in the intended time. @@ -91,7 +90,7 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, /** * This countdown is used to wait for the burn wire being successful cut. */ - Countdown deploymentCountdown; + //Countdown deploymentCountdown; /** * The message queue id of the component commanding an action will be stored in this variable. @@ -107,27 +106,21 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, CookieIF* gpioCookie; - /** Object id of the object responsible to switch the 8V power input. Typically the PCDU. */ - object_id_t mainLineSwitcherObjectId; - - /** Switch number of the 8V power switch */ - uint8_t mainLineSwitch; - gpioId_t deplSA1; gpioId_t deplSA2; GpioIF* gpioInterface = nullptr; - /** Time duration switches are active to cut the burn wire */ - uint32_t burnTimeMs; - /** Queue to receive messages from other objects. */ MessageQueueIF* commandQueue = nullptr; /** * After initialization this pointer will hold the reference to the main line switcher object. */ - PowerSwitchIF* mainLineSwitcher = nullptr; + PowerSwitchIF& mainLineSwitcher; + + /** Switch number of the 8V power switch */ + uint8_t mainLineSwitch; ActionHelper actionHelper; @@ -147,13 +140,13 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, /** * @brief This functions handles the switching of the solar array deployment transistors. */ - void switchDeploymentTransistors(); + void deploymentTransistorsOn(); /** * @brief This function performs actions to finish the deployment. Essentially switches * are turned of after the burn time has expired. */ - void handleDeploymentFinish(); + //void handleDeploymentFinish(); }; #endif /* MISSION_DEVICES_SOLARARRAYDEPLOYMENT_H_ */ -- 2.43.0 From ea82748496984aabb43b89239665ee94e2fe90fc Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 12 Oct 2022 13:29:38 +0200 Subject: [PATCH 03/97] new solar array deployment task --- bsp_q7s/core/InitMission.cpp | 50 ++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/bsp_q7s/core/InitMission.cpp b/bsp_q7s/core/InitMission.cpp index d74581c7..8872fc1f 100644 --- a/bsp_q7s/core/InitMission.cpp +++ b/bsp_q7s/core/InitMission.cpp @@ -67,16 +67,30 @@ void initmission::initTasks() { void (*missedDeadlineFunc)(void) = nullptr; #endif - PeriodicTaskIF* coreController = factory->createPeriodicTask( + PeriodicTaskIF* sysCtrlTask = factory->createPeriodicTask( "CORE_CTRL", 60, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.4, missedDeadlineFunc); - result = coreController->addComponent(objects::CORE_CONTROLLER); + result = sysCtrlTask->addComponent(objects::CORE_CONTROLLER); if (result != returnvalue::OK) { initmission::printAddObjectError("CORE_CTRL", objects::CORE_CONTROLLER); } + // Could add this to the core controller but the core controller does so many thing that I would + // prefer to have the solar array deployment in a seprate task. + PeriodicTaskIF* solarArrayDeplTask = factory->createPeriodicTask( + "SOLAR_ARRAY_DEPL", 65, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.4, missedDeadlineFunc); + result = solarArrayDeplTask->addComponent(objects::SOLAR_ARRAY_DEPL_HANDLER); + if (result != returnvalue::OK) { + initmission::printAddObjectError("SOLAR_ARRAY_DEPL", objects::SOLAR_ARRAY_DEPL_HANDLER); + } /* TMTC Distribution */ PeriodicTaskIF* tmTcDistributor = factory->createPeriodicTask( - "DIST", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc); + "DIST", 45, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc); +#if OBSW_ADD_TCPIP_BRIDGE == 1 + result = tmTcDistributor->addComponent(objects::TMTC_BRIDGE); + if (result != returnvalue::OK) { + initmission::printAddObjectError("TMTC_BRIDGE", objects::TMTC_BRIDGE); + } +#endif result = tmTcDistributor->addComponent(objects::CCSDS_PACKET_DISTRIBUTOR); if (result != returnvalue::OK) { initmission::printAddObjectError("CCSDS_DISTRIB", objects::CCSDS_PACKET_DISTRIBUTOR); @@ -95,13 +109,6 @@ void initmission::initTasks() { } #if OBSW_ADD_TCPIP_BRIDGE == 1 - // TMTC bridge - PeriodicTaskIF* tmtcBridgeTask = factory->createPeriodicTask( - "TCPIP_TMTC_BRIDGE", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc); - result = tmtcBridgeTask->addComponent(objects::TMTC_BRIDGE); - if (result != returnvalue::OK) { - initmission::printAddObjectError("TMTC_BRIDGE", objects::TMTC_BRIDGE); - } PeriodicTaskIF* tmtcPollingTask = factory->createPeriodicTask( "TMTC_POLLING", 80, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc); result = tmtcPollingTask->addComponent(objects::TMTC_POLLING_TASK); @@ -138,39 +145,39 @@ void initmission::initTasks() { } #endif - PeriodicTaskIF* acsTask = factory->createPeriodicTask( + PeriodicTaskIF* acsCtrlTask = factory->createPeriodicTask( "ACS_TASK", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.4, missedDeadlineFunc); #if OBSW_ADD_GPS_CTRL == 1 - result = acsTask->addComponent(objects::GPS_CONTROLLER); + result = acsCtrlTask->addComponent(objects::GPS_CONTROLLER); if (result != returnvalue::OK) { initmission::printAddObjectError("GPS_CTRL", objects::GPS_CONTROLLER); } #endif /* OBSW_ADD_GPS_CTRL */ #if OBSW_ADD_ACS_CTRL == 1 - acsTask->addComponent(objects::ACS_CONTROLLER); + acsCtrlTask->addComponent(objects::ACS_CONTROLLER); if (result != returnvalue::OK) { initmission::printAddObjectError("ACS_CTRL", objects::ACS_CONTROLLER); } #endif - PeriodicTaskIF* sysTask = factory->createPeriodicTask( + PeriodicTaskIF* acsSysTask = factory->createPeriodicTask( "SYS_TASK", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.4, missedDeadlineFunc); - static_cast(sysTask); + static_cast(acsSysTask); #if OBSW_ADD_ACS_BOARD == 1 - result = sysTask->addComponent(objects::ACS_BOARD_ASS); + result = acsSysTask->addComponent(objects::ACS_BOARD_ASS); if (result != returnvalue::OK) { initmission::printAddObjectError("ACS_BOARD_ASS", objects::ACS_BOARD_ASS); } #endif /* OBSW_ADD_ACS_HANDLERS */ #if OBSW_ADD_RW == 1 - result = sysTask->addComponent(objects::RW_ASS); + result = acsSysTask->addComponent(objects::RW_ASS); if (result != returnvalue::OK) { initmission::printAddObjectError("RW_ASS", objects::RW_ASS); } #endif #if OBSW_ADD_SUS_BOARD_ASS == 1 - result = sysTask->addComponent(objects::SUS_BOARD_ASS); + result = acsSysTask->addComponent(objects::SUS_BOARD_ASS); if (result != returnvalue::OK) { initmission::printAddObjectError("SUS_BOARD_ASS", objects::SUS_BOARD_ASS); } @@ -297,7 +304,6 @@ void initmission::initTasks() { tmTcDistributor->startTask(); #if OBSW_ADD_TCPIP_BRIDGE == 1 - tmtcBridgeTask->startTask(); tmtcPollingTask->startTask(); #endif @@ -306,7 +312,7 @@ void initmission::initTasks() { pdecHandlerTask->startTask(); #endif /* OBSW_USE_CCSDS_IP_CORE == 1 */ - coreController->startTask(); + sysCtrlTask->startTask(); taskStarter(pstTasks, "PST task vector"); taskStarter(pusTasks, "PUS task vector"); @@ -327,8 +333,8 @@ void initmission::initTasks() { strHelperTask->startTask(); #endif /* OBSW_ADD_STAR_TRACKER == 1 */ - acsTask->startTask(); - sysTask->startTask(); + acsCtrlTask->startTask(); + acsSysTask->startTask(); #if OBSW_ADD_RTD_DEVICES == 1 tcsPollingTask->startTask(); tcsTask->startTask(); -- 2.43.0 From 09c0afbe7fc14d4be26e389d2836e022b2f6f64d Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 12 Oct 2022 13:56:25 +0200 Subject: [PATCH 04/97] simplified SA Depl init --- bsp_q7s/core/ObjectFactory.cpp | 11 +- bsp_q7s/core/ObjectFactory.h | 2 +- bsp_q7s/fmObjectFactory.cpp | 2 +- .../devices/SolarArrayDeploymentHandler.cpp | 193 +++++++++--------- mission/devices/SolarArrayDeploymentHandler.h | 39 ++-- 5 files changed, 116 insertions(+), 131 deletions(-) diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index db2779bd..d4fb01b5 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -539,7 +539,8 @@ void ObjectFactory::createHeaterComponents(GpioIF* gpioIF, PowerSwitchIF* pwrSwi pcdu::Switches::PDU2_CH3_TCS_BOARD_HEATER_IN_8V); } -void ObjectFactory::createSolarArrayDeploymentComponents(PowerSwitchIF& pwrSwitcher) { +void ObjectFactory::createSolarArrayDeploymentComponents(PowerSwitchIF& pwrSwitcher, + GpioIF& gpioIF) { using namespace gpio; GpioCookie* solarArrayDeplCookie = new GpioCookie; GpiodRegularByLineName* gpio = nullptr; @@ -552,10 +553,12 @@ void ObjectFactory::createSolarArrayDeploymentComponents(PowerSwitchIF& pwrSwitc gpio = new GpiodRegularByLineName(q7s::gpioNames::SA_DPL_PIN_1, consumer.str(), Direction::OUT, Levels::LOW); solarArrayDeplCookie->addGpio(gpioIds::DEPLSA2, gpio); + ReturnValue_t result = gpioIF.addGpios(solarArrayDeplCookie); + if (result != returnvalue::OK) { + sif::error << "Adding Solar Array Deployment GPIO cookie failed" << std::endl; + } - // TODO: Find out burn time. For now set to 1000 ms. - new SolarArrayDeploymentHandler(objects::SOLAR_ARRAY_DEPL_HANDLER, objects::GPIO_IF, - solarArrayDeplCookie, pwrSwitcher, + new SolarArrayDeploymentHandler(objects::SOLAR_ARRAY_DEPL_HANDLER, gpioIF, pwrSwitcher, pcdu::Switches::PDU2_CH5_DEPLOYMENT_MECHANISM_8V, gpioIds::DEPLSA1, gpioIds::DEPLSA2); } diff --git a/bsp_q7s/core/ObjectFactory.h b/bsp_q7s/core/ObjectFactory.h index 37cdc70e..88881090 100644 --- a/bsp_q7s/core/ObjectFactory.h +++ b/bsp_q7s/core/ObjectFactory.h @@ -33,7 +33,7 @@ void createHeaterComponents(GpioIF* gpioIF, PowerSwitchIF* pwrSwitcher, HealthTa void createImtqComponents(PowerSwitchIF* pwrSwitcher); void createBpxBatteryComponent(); void createStrComponents(PowerSwitchIF* pwrSwitcher); -void createSolarArrayDeploymentComponents(PowerSwitchIF& pwrSwitcher); +void createSolarArrayDeploymentComponents(PowerSwitchIF& pwrSwitcher, GpioIF& gpioIF); void createSyrlinksComponents(PowerSwitchIF* pwrSwitcher); void createPayloadComponents(LinuxLibgpioIF* gpioComIF); void createReactionWheelComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchIF* pwrSwitcher); diff --git a/bsp_q7s/fmObjectFactory.cpp b/bsp_q7s/fmObjectFactory.cpp index 413223d8..d28b7248 100644 --- a/bsp_q7s/fmObjectFactory.cpp +++ b/bsp_q7s/fmObjectFactory.cpp @@ -35,7 +35,7 @@ void ObjectFactory::produce(void* args) { createAcsBoardComponents(gpioComIF, uartComIF, pwrSwitcher); #endif createHeaterComponents(gpioComIF, pwrSwitcher, healthTable); - createSolarArrayDeploymentComponents(*pwrSwitcher); + createSolarArrayDeploymentComponents(*pwrSwitcher, *gpioComIF); createPlPcduComponents(gpioComIF, spiMainComIF, pwrSwitcher); #if OBSW_ADD_SYRLINKS == 1 createSyrlinksComponents(pwrSwitcher); diff --git a/mission/devices/SolarArrayDeploymentHandler.cpp b/mission/devices/SolarArrayDeploymentHandler.cpp index 63425615..30497ed3 100644 --- a/mission/devices/SolarArrayDeploymentHandler.cpp +++ b/mission/devices/SolarArrayDeploymentHandler.cpp @@ -5,13 +5,13 @@ #include #include -SolarArrayDeploymentHandler::SolarArrayDeploymentHandler( - object_id_t setObjectId_, object_id_t gpioDriverId_, CookieIF* gpioCookie_, - PowerSwitchIF& mainLineSwitcher_, pcdu::Switches mainLineSwitch_, gpioId_t deplSA1, - gpioId_t deplSA2) +SolarArrayDeploymentHandler::SolarArrayDeploymentHandler(object_id_t setObjectId_, + GpioIF& gpioInterface, + PowerSwitchIF& mainLineSwitcher_, + pcdu::Switches mainLineSwitch_, + gpioId_t deplSA1, gpioId_t deplSA2) : SystemObject(setObjectId_), - gpioDriverId(gpioDriverId_), - gpioCookie(gpioCookie_), + gpioInterface(gpioInterface), deplSA1(deplSA1), deplSA2(deplSA2), mainLineSwitcher(mainLineSwitcher_), @@ -38,19 +38,6 @@ ReturnValue_t SolarArrayDeploymentHandler::initialize() { return ObjectManagerIF::CHILD_INIT_FAILED; } - gpioInterface = ObjectManager::instance()->get(gpioDriverId); - if (gpioInterface == nullptr) { - sif::error << "SolarArrayDeploymentHandler::initialize: Invalid Gpio interface." << std::endl; - return ObjectManagerIF::CHILD_INIT_FAILED; - } - - result = gpioInterface->addGpios(dynamic_cast(gpioCookie)); - if (result != returnvalue::OK) { - sif::error << "SolarArrayDeploymentHandler::initialize: Failed to initialize Gpio interface" - << std::endl; - return ObjectManagerIF::CHILD_INIT_FAILED; - } - result = actionHelper.initialize(commandQueue); if (result != returnvalue::OK) { return ObjectManagerIF::CHILD_INIT_FAILED; @@ -60,83 +47,85 @@ ReturnValue_t SolarArrayDeploymentHandler::initialize() { } void SolarArrayDeploymentHandler::handleStateMachine() { -// switch (stateMachine) { -// case WAIT_ON_DELOYMENT_COMMAND: -// readCommandQueue(); -// break; -// case SWITCH_8V_ON: -// mainLineSwitcher.sendSwitchCommand(mainLineSwitch, PowerSwitchIF::SWITCH_ON); -// mainSwitchCountdown.setTimeout(mainLineSwitcher.getSwitchDelayMs()); -// stateMachine = WAIT_ON_8V_SWITCH; -// break; -// case WAIT_ON_8V_SWITCH: -// performWaitOn8VActions(); -// break; -// case SWITCH_DEPL_GPIOS: -// deploymentTransistorsOn(); -// break; -//// case WAIT_ON_DEPLOYMENT_FINISH: -//// handleDeploymentFinish(); -//// break; -// case WAIT_FOR_MAIN_SWITCH_OFF: -// if (mainLineSwitcher.getSwitchState(mainLineSwitch) == PowerSwitchIF::SWITCH_OFF) { -// stateMachine = WAIT_ON_DELOYMENT_COMMAND; -// } else if (mainSwitchCountdown.hasTimedOut()) { -// triggerEvent(MAIN_SWITCH_OFF_TIMEOUT); -// sif::error << "SolarArrayDeploymentHandler::handleStateMachine: Failed to switch main" -// << " switch off" << std::endl; -// stateMachine = WAIT_ON_DELOYMENT_COMMAND; -// } -// break; -// default: -// sif::debug << "SolarArrayDeploymentHandler::handleStateMachine: Invalid state" << std::endl; -// break; -// } + // switch (stateMachine) { + // case WAIT_ON_DELOYMENT_COMMAND: + // readCommandQueue(); + // break; + // case SWITCH_8V_ON: + // mainLineSwitcher.sendSwitchCommand(mainLineSwitch, PowerSwitchIF::SWITCH_ON); + // mainSwitchCountdown.setTimeout(mainLineSwitcher.getSwitchDelayMs()); + // stateMachine = WAIT_ON_8V_SWITCH; + // break; + // case WAIT_ON_8V_SWITCH: + // performWaitOn8VActions(); + // break; + // case SWITCH_DEPL_GPIOS: + // deploymentTransistorsOn(); + // break; + //// case WAIT_ON_DEPLOYMENT_FINISH: + //// handleDeploymentFinish(); + //// break; + // case WAIT_FOR_MAIN_SWITCH_OFF: + // if (mainLineSwitcher.getSwitchState(mainLineSwitch) == PowerSwitchIF::SWITCH_OFF) { + // stateMachine = WAIT_ON_DELOYMENT_COMMAND; + // } else if (mainSwitchCountdown.hasTimedOut()) { + // triggerEvent(MAIN_SWITCH_OFF_TIMEOUT); + // sif::error << "SolarArrayDeploymentHandler::handleStateMachine: Failed to switch main" + // << " switch off" << std::endl; + // stateMachine = WAIT_ON_DELOYMENT_COMMAND; + // } + // break; + // default: + // sif::debug << "SolarArrayDeploymentHandler::handleStateMachine: Invalid state" << + // std::endl; break; + // } } void SolarArrayDeploymentHandler::performWaitOn8VActions() { -// if (mainLineSwitcher.getSwitchState(mainLineSwitch) == PowerSwitchIF::SWITCH_ON) { -// stateMachine = SWITCH_DEPL_GPIOS; -// } else { -// if (mainSwitchCountdown.hasTimedOut()) { -// triggerEvent(MAIN_SWITCH_ON_TIMEOUT); -// actionHelper.finish(false, rememberCommanderId, DEPLOY_SOLAR_ARRAYS, -// MAIN_SWITCH_TIMEOUT_FAILURE); -// stateMachine = WAIT_ON_DELOYMENT_COMMAND; -// } -// } + // if (mainLineSwitcher.getSwitchState(mainLineSwitch) == PowerSwitchIF::SWITCH_ON) { + // stateMachine = SWITCH_DEPL_GPIOS; + // } else { + // if (mainSwitchCountdown.hasTimedOut()) { + // triggerEvent(MAIN_SWITCH_ON_TIMEOUT); + // actionHelper.finish(false, rememberCommanderId, DEPLOY_SOLAR_ARRAYS, + // MAIN_SWITCH_TIMEOUT_FAILURE); + // stateMachine = WAIT_ON_DELOYMENT_COMMAND; + // } + // } } void SolarArrayDeploymentHandler::deploymentTransistorsOn() { -// ReturnValue_t result = returnvalue::OK; -// result = gpioInterface->pullHigh(deplSA1); -// if (result != returnvalue::OK) { -// sif::debug << "SolarArrayDeploymentHandler::handleStateMachine: Failed to pull solar" -// " array deployment switch 1 high " -// << std::endl; -// /* If gpio switch high failed, state machine is reset to wait for a command reinitiating -// * the deployment sequence. */ -// stateMachine = WAIT_ON_DELOYMENT_COMMAND; -// triggerEvent(DEPL_SA1_GPIO_SWTICH_ON_FAILED); -// actionHelper.finish(false, rememberCommanderId, DEPLOY_SOLAR_ARRAYS, SWITCHING_DEPL_SA2_FAILED); -// mainLineSwitcher.sendSwitchCommand(mainLineSwitch, PowerSwitchIF::SWITCH_OFF); -// } -// result = gpioInterface->pullHigh(deplSA2); -// if (result != returnvalue::OK) { -// sif::debug << "SolarArrayDeploymentHandler::handleStateMachine: Failed to pull solar" -// " array deployment switch 2 high " -// << std::endl; -// stateMachine = WAIT_ON_DELOYMENT_COMMAND; -// triggerEvent(DEPL_SA2_GPIO_SWTICH_ON_FAILED); -// actionHelper.finish(false, rememberCommanderId, DEPLOY_SOLAR_ARRAYS, SWITCHING_DEPL_SA2_FAILED); -// mainLineSwitcher.sendSwitchCommand(mainLineSwitch, PowerSwitchIF::SWITCH_OFF); -// } - //deploymentCountdown.setTimeout(burnTimeMs); - //stateMachine = WAIT_ON_DEPLOYMENT_FINISH; + // ReturnValue_t result = returnvalue::OK; + // result = gpioInterface->pullHigh(deplSA1); + // if (result != returnvalue::OK) { + // sif::debug << "SolarArrayDeploymentHandler::handleStateMachine: Failed to pull solar" + // " array deployment switch 1 high " + // << std::endl; + // /* If gpio switch high failed, state machine is reset to wait for a command reinitiating + // * the deployment sequence. */ + // stateMachine = WAIT_ON_DELOYMENT_COMMAND; + // triggerEvent(DEPL_SA1_GPIO_SWTICH_ON_FAILED); + // actionHelper.finish(false, rememberCommanderId, DEPLOY_SOLAR_ARRAYS, + // SWITCHING_DEPL_SA2_FAILED); mainLineSwitcher.sendSwitchCommand(mainLineSwitch, + // PowerSwitchIF::SWITCH_OFF); + // } + // result = gpioInterface->pullHigh(deplSA2); + // if (result != returnvalue::OK) { + // sif::debug << "SolarArrayDeploymentHandler::handleStateMachine: Failed to pull solar" + // " array deployment switch 2 high " + // << std::endl; + // stateMachine = WAIT_ON_DELOYMENT_COMMAND; + // triggerEvent(DEPL_SA2_GPIO_SWTICH_ON_FAILED); + // actionHelper.finish(false, rememberCommanderId, DEPLOY_SOLAR_ARRAYS, + // SWITCHING_DEPL_SA2_FAILED); mainLineSwitcher.sendSwitchCommand(mainLineSwitch, + // PowerSwitchIF::SWITCH_OFF); + // } + // deploymentCountdown.setTimeout(burnTimeMs); + // stateMachine = WAIT_ON_DEPLOYMENT_FINISH; } -//void SolarArrayDeploymentHandler::handleDeploymentFinish() { -// ReturnValue_t result = returnvalue::OK; +// void SolarArrayDeploymentHandler::handleDeploymentFinish() { +// ReturnValue_t result = returnvalue::OK; //// if (deploymentCountdown.hasTimedOut()) { //// actionHelper.finish(true, rememberCommanderId, DEPLOY_SOLAR_ARRAYS, returnvalue::OK); //// result = gpioInterface->pullLow(deplSA1); @@ -174,20 +163,20 @@ ReturnValue_t SolarArrayDeploymentHandler::executeAction(ActionId_t actionId, MessageQueueId_t commandedBy, const uint8_t* data, size_t size) { ReturnValue_t result; -// if (stateMachine != WAIT_ON_DELOYMENT_COMMAND) { -// sif::error << "SolarArrayDeploymentHandler::executeAction: Received command while not in" -// << "waiting-on-command-state" << std::endl; -// return DEPLOYMENT_ALREADY_EXECUTING; -// } -// if (actionId != DEPLOY_SOLAR_ARRAYS) { -// sif::error << "SolarArrayDeploymentHandler::executeAction: Received invalid command" -// << std::endl; -// result = COMMAND_NOT_SUPPORTED; -// } else { -// stateMachine = SWITCH_8V_ON; -// rememberCommanderId = commandedBy; -// result = returnvalue::OK; -// } + // if (stateMachine != WAIT_ON_DELOYMENT_COMMAND) { + // sif::error << "SolarArrayDeploymentHandler::executeAction: Received command while not in" + // << "waiting-on-command-state" << std::endl; + // return DEPLOYMENT_ALREADY_EXECUTING; + // } + // if (actionId != DEPLOY_SOLAR_ARRAYS) { + // sif::error << "SolarArrayDeploymentHandler::executeAction: Received invalid command" + // << std::endl; + // result = COMMAND_NOT_SUPPORTED; + // } else { + // stateMachine = SWITCH_8V_ON; + // rememberCommanderId = commandedBy; + // result = returnvalue::OK; + // } return result; } diff --git a/mission/devices/SolarArrayDeploymentHandler.h b/mission/devices/SolarArrayDeploymentHandler.h index 05fb7fb4..0f85029f 100644 --- a/mission/devices/SolarArrayDeploymentHandler.h +++ b/mission/devices/SolarArrayDeploymentHandler.h @@ -43,9 +43,9 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, * @param deplSA2 gpioId of the GPIO controlling the deployment 2 transistor. * @param burnTimeMs Time duration the power will be applied to the burn wires. */ - SolarArrayDeploymentHandler(object_id_t setObjectId, object_id_t gpioDriverId, - CookieIF* gpioCookie, PowerSwitchIF& mainLineSwitcher, - pcdu::Switches mainLineSwitch, gpioId_t deplSA1, gpioId_t deplSA2); + SolarArrayDeploymentHandler(object_id_t setObjectId, GpioIF& gpio, + PowerSwitchIF& mainLineSwitcher, pcdu::Switches mainLineSwitch, + gpioId_t deplSA1, gpioId_t deplSA2); virtual ~SolarArrayDeploymentHandler(); @@ -71,16 +71,16 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, static const Event DEPL_SA1_GPIO_SWTICH_ON_FAILED = MAKE_EVENT(3, severity::HIGH); static const Event DEPL_SA2_GPIO_SWTICH_ON_FAILED = MAKE_EVENT(4, severity::HIGH); -// enum StateMachine { -// WAIT_ON_DELOYMENT_COMMAND, -// SWITCH_8V_ON, -// WAIT_ON_8V_SWITCH, -// SWITCH_DEPL_GPIOS, -// WAIT_ON_DEPLOYMENT_FINISH, -// WAIT_FOR_MAIN_SWITCH_OFF -// }; -// -// StateMachine stateMachine = WAIT_ON_DELOYMENT_COMMAND; + // enum StateMachine { + // WAIT_ON_DELOYMENT_COMMAND, + // SWITCH_8V_ON, + // WAIT_ON_8V_SWITCH, + // SWITCH_DEPL_GPIOS, + // WAIT_ON_DEPLOYMENT_FINISH, + // WAIT_FOR_MAIN_SWITCH_OFF + // }; + // + // StateMachine stateMachine = WAIT_ON_DELOYMENT_COMMAND; /** * This countdown is used to check if the PCDU sets the 8V line on in the intended time. @@ -90,7 +90,7 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, /** * This countdown is used to wait for the burn wire being successful cut. */ - //Countdown deploymentCountdown; + // Countdown deploymentCountdown; /** * The message queue id of the component commanding an action will be stored in this variable. @@ -100,17 +100,10 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, /** Size of command queue */ size_t cmdQueueSize = 20; - - /** The object ID of the GPIO driver which switches the deployment transistors */ - object_id_t gpioDriverId; - - CookieIF* gpioCookie; - + GpioIF& gpioInterface; gpioId_t deplSA1; gpioId_t deplSA2; - GpioIF* gpioInterface = nullptr; - /** Queue to receive messages from other objects. */ MessageQueueIF* commandQueue = nullptr; @@ -146,7 +139,7 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, * @brief This function performs actions to finish the deployment. Essentially switches * are turned of after the burn time has expired. */ - //void handleDeploymentFinish(); + // void handleDeploymentFinish(); }; #endif /* MISSION_DEVICES_SOLARARRAYDEPLOYMENT_H_ */ -- 2.43.0 From 3289a4032018bbd5383f8a9294ae874546ceaa82 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 12 Oct 2022 13:58:48 +0200 Subject: [PATCH 05/97] update comment block --- .../devices/SolarArrayDeploymentHandler.cpp | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/mission/devices/SolarArrayDeploymentHandler.cpp b/mission/devices/SolarArrayDeploymentHandler.cpp index 30497ed3..9d2d94a3 100644 --- a/mission/devices/SolarArrayDeploymentHandler.cpp +++ b/mission/devices/SolarArrayDeploymentHandler.cpp @@ -62,9 +62,9 @@ void SolarArrayDeploymentHandler::handleStateMachine() { // case SWITCH_DEPL_GPIOS: // deploymentTransistorsOn(); // break; - //// case WAIT_ON_DEPLOYMENT_FINISH: - //// handleDeploymentFinish(); - //// break; + // case WAIT_ON_DEPLOYMENT_FINISH: + // handleDeploymentFinish(); + // break; // case WAIT_FOR_MAIN_SWITCH_OFF: // if (mainLineSwitcher.getSwitchState(mainLineSwitch) == PowerSwitchIF::SWITCH_OFF) { // stateMachine = WAIT_ON_DELOYMENT_COMMAND; @@ -126,20 +126,20 @@ void SolarArrayDeploymentHandler::deploymentTransistorsOn() { // void SolarArrayDeploymentHandler::handleDeploymentFinish() { // ReturnValue_t result = returnvalue::OK; -//// if (deploymentCountdown.hasTimedOut()) { -//// actionHelper.finish(true, rememberCommanderId, DEPLOY_SOLAR_ARRAYS, returnvalue::OK); -//// result = gpioInterface->pullLow(deplSA1); -//// if (result != returnvalue::OK) { -//// sif::debug << "SolarArrayDeploymentHandler::handleStateMachine: Failed to pull solar" -//// " array deployment switch 1 low " -//// << std::endl; -//// } -//// result = gpioInterface->pullLow(deplSA2); -//// if (result != returnvalue::OK) { -//// sif::debug << "SolarArrayDeploymentHandler::handleStateMachine: Failed to pull solar" -//// " array deployment switch 2 low " -//// << std::endl; -//// } +// if (deploymentCountdown.hasTimedOut()) { +// actionHelper.finish(true, rememberCommanderId, DEPLOY_SOLAR_ARRAYS, returnvalue::OK); +// result = gpioInterface->pullLow(deplSA1); +// if (result != returnvalue::OK) { +// sif::debug << "SolarArrayDeploymentHandler::handleStateMachine: Failed to pull solar" +// " array deployment switch 1 low " +// << std::endl; +// } +// result = gpioInterface->pullLow(deplSA2); +// if (result != returnvalue::OK) { +// sif::debug << "SolarArrayDeploymentHandler::handleStateMachine: Failed to pull solar" +// " array deployment switch 2 low " +// << std::endl; +// } // mainLineSwitcher.sendSwitchCommand(mainLineSwitch, PowerSwitchIF::SWITCH_OFF); // mainSwitchCountdown.setTimeout(mainLineSwitcher.getSwitchDelayMs()); // stateMachine = WAIT_FOR_MAIN_SWITCH_OFF; -- 2.43.0 From a2e1ed56c91d6b469494fbb3eca25b9cf6639bec Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 12 Oct 2022 14:09:07 +0200 Subject: [PATCH 06/97] pass SDC man to SA DEPL handler --- bsp_q7s/core/ObjectFactory.cpp | 2 +- .../devices/SolarArrayDeploymentHandler.cpp | 18 ++++---------- mission/devices/SolarArrayDeploymentHandler.h | 24 ++++++++++--------- 3 files changed, 19 insertions(+), 25 deletions(-) diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index d4fb01b5..74af9564 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -560,7 +560,7 @@ void ObjectFactory::createSolarArrayDeploymentComponents(PowerSwitchIF& pwrSwitc new SolarArrayDeploymentHandler(objects::SOLAR_ARRAY_DEPL_HANDLER, gpioIF, pwrSwitcher, pcdu::Switches::PDU2_CH5_DEPLOYMENT_MECHANISM_8V, - gpioIds::DEPLSA1, gpioIds::DEPLSA2); + gpioIds::DEPLSA1, gpioIds::DEPLSA2, *SdCardManager::instance()); } void ObjectFactory::createSyrlinksComponents(PowerSwitchIF* pwrSwitcher) { diff --git a/mission/devices/SolarArrayDeploymentHandler.cpp b/mission/devices/SolarArrayDeploymentHandler.cpp index 9d2d94a3..e3357a53 100644 --- a/mission/devices/SolarArrayDeploymentHandler.cpp +++ b/mission/devices/SolarArrayDeploymentHandler.cpp @@ -9,7 +9,8 @@ SolarArrayDeploymentHandler::SolarArrayDeploymentHandler(object_id_t setObjectId GpioIF& gpioInterface, PowerSwitchIF& mainLineSwitcher_, pcdu::Switches mainLineSwitch_, - gpioId_t deplSA1, gpioId_t deplSA2) + gpioId_t deplSA1, gpioId_t deplSA2, + SdCardMountedIF& sdcMountedIF) : SystemObject(setObjectId_), gpioInterface(gpioInterface), deplSA1(deplSA1), @@ -25,25 +26,16 @@ SolarArrayDeploymentHandler::SolarArrayDeploymentHandler(object_id_t setObjectId SolarArrayDeploymentHandler::~SolarArrayDeploymentHandler() {} ReturnValue_t SolarArrayDeploymentHandler::performOperation(uint8_t operationCode) { - if (operationCode == DeviceHandlerIF::PERFORM_OPERATION) { - handleStateMachine(); - return returnvalue::OK; - } + handleStateMachine(); return returnvalue::OK; } ReturnValue_t SolarArrayDeploymentHandler::initialize() { - ReturnValue_t result = SystemObject::initialize(); + ReturnValue_t result = actionHelper.initialize(commandQueue); if (result != returnvalue::OK) { return ObjectManagerIF::CHILD_INIT_FAILED; } - - result = actionHelper.initialize(commandQueue); - if (result != returnvalue::OK) { - return ObjectManagerIF::CHILD_INIT_FAILED; - } - - return returnvalue::OK; + return SystemObject::initialize(); } void SolarArrayDeploymentHandler::handleStateMachine() { diff --git a/mission/devices/SolarArrayDeploymentHandler.h b/mission/devices/SolarArrayDeploymentHandler.h index 0f85029f..74d207a9 100644 --- a/mission/devices/SolarArrayDeploymentHandler.h +++ b/mission/devices/SolarArrayDeploymentHandler.h @@ -1,16 +1,17 @@ #ifndef MISSION_DEVICES_SOLARARRAYDEPLOYMENT_H_ #define MISSION_DEVICES_SOLARARRAYDEPLOYMENT_H_ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "devices/powerSwitcherList.h" +#include "fsfw/action/HasActionsIF.h" +#include "fsfw/devicehandlers/CookieIF.h" +#include "fsfw/devicehandlers/DeviceHandlerIF.h" +#include "fsfw/objectmanager/SystemObject.h" +#include "fsfw/power/PowerSwitchIF.h" +#include "fsfw/returnvalues/returnvalue.h" +#include "fsfw/tasks/ExecutableObjectIF.h" +#include "fsfw/timemanager/Countdown.h" +#include "fsfw_hal/common/gpio/GpioIF.h" +#include "mission/memory/SdCardMountedIF.h" #include @@ -45,7 +46,8 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, */ SolarArrayDeploymentHandler(object_id_t setObjectId, GpioIF& gpio, PowerSwitchIF& mainLineSwitcher, pcdu::Switches mainLineSwitch, - gpioId_t deplSA1, gpioId_t deplSA2); + gpioId_t deplSA1, gpioId_t deplSA2, + SdCardMountedIF& sdcMountedIF); virtual ~SolarArrayDeploymentHandler(); -- 2.43.0 From 6a900693f3ff5754761c52aec3876bea5834c038 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 12 Oct 2022 14:24:45 +0200 Subject: [PATCH 07/97] continue SA DEPL --- .../devices/SolarArrayDeploymentHandler.cpp | 32 ++++++++++++++++--- mission/devices/SolarArrayDeploymentHandler.h | 25 +++++++++------ 2 files changed, 42 insertions(+), 15 deletions(-) diff --git a/mission/devices/SolarArrayDeploymentHandler.cpp b/mission/devices/SolarArrayDeploymentHandler.cpp index e3357a53..fac22115 100644 --- a/mission/devices/SolarArrayDeploymentHandler.cpp +++ b/mission/devices/SolarArrayDeploymentHandler.cpp @@ -1,9 +1,11 @@ #include "SolarArrayDeploymentHandler.h" -#include -#include -#include -#include +#include "devices/gpioIds.h" +#include "fsfw/ipc/QueueFactory.h" +#include "fsfw/objectmanager/ObjectManager.h" +#include "fsfw_hal/common/gpio/GpioCookie.h" + +#include SolarArrayDeploymentHandler::SolarArrayDeploymentHandler(object_id_t setObjectId_, GpioIF& gpioInterface, @@ -17,16 +19,36 @@ SolarArrayDeploymentHandler::SolarArrayDeploymentHandler(object_id_t setObjectId deplSA2(deplSA2), mainLineSwitcher(mainLineSwitcher_), mainLineSwitch(mainLineSwitch_), + sdcMan(sdcMountedIF), actionHelper(this, nullptr) { auto mqArgs = MqArgs(setObjectId_, static_cast(this)); commandQueue = QueueFactory::instance()->createMessageQueue( cmdQueueSize, MessageQueueMessage::MAX_MESSAGE_SIZE, &mqArgs); } -SolarArrayDeploymentHandler::~SolarArrayDeploymentHandler() {} +SolarArrayDeploymentHandler::~SolarArrayDeploymentHandler() = default; ReturnValue_t SolarArrayDeploymentHandler::performOperation(uint8_t operationCode) { + using namespace std::filesystem; handleStateMachine(); + auto activeSdc = sdcMan.getActiveSdCard(); + if (activeSdc and activeSdc.value() == sd::SdCard::SLOT_0 and + sdcMan.isSdCardUsable(activeSdc.value())) { + if (exists(SD_0_DEPL_FILE)) { + // perform autonomous deployment handling + performAutonomousDepl(sd::SdCard::SLOT_0); + } + } else if (activeSdc and activeSdc.value() == sd::SdCard::SLOT_1 and + sdcMan.isSdCardUsable(activeSdc.value())) { + if (exists(SD_1_DEPL_FILE)) { + // perform autonomous deployment handling + performAutonomousDepl(sd::SdCard::SLOT_1); + } + } + return returnvalue::OK; +} + +ReturnValue_t SolarArrayDeploymentHandler::performAutonomousDepl(sd::SdCard sdCard) { return returnvalue::OK; } diff --git a/mission/devices/SolarArrayDeploymentHandler.h b/mission/devices/SolarArrayDeploymentHandler.h index 74d207a9..9e0bdfa1 100644 --- a/mission/devices/SolarArrayDeploymentHandler.h +++ b/mission/devices/SolarArrayDeploymentHandler.h @@ -1,7 +1,10 @@ #ifndef MISSION_DEVICES_SOLARARRAYDEPLOYMENT_H_ #define MISSION_DEVICES_SOLARARRAYDEPLOYMENT_H_ +#include + #include "devices/powerSwitcherList.h" +#include "events/subsystemIdRanges.h" #include "fsfw/action/HasActionsIF.h" #include "fsfw/devicehandlers/CookieIF.h" #include "fsfw/devicehandlers/DeviceHandlerIF.h" @@ -12,10 +15,6 @@ #include "fsfw/timemanager/Countdown.h" #include "fsfw_hal/common/gpio/GpioIF.h" #include "mission/memory/SdCardMountedIF.h" - -#include - -#include "events/subsystemIdRanges.h" #include "returnvalues/classIds.h" /** @@ -28,7 +27,10 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, public HasActionsIF { public: static constexpr DeviceCommandId_t DEPLOY_SOLAR_ARRAYS_MANUALLY = 0x5; - + static const char SD_0_DEPL_FILE[] = "/mnt/sd0/conf/deployment"; + static const char SD_1_DEPL_FILE[] = "/mnt/sd1/conf/deployment"; + static const char SD_0_DEPLY_INFO[] = "/mnt/sd0/conf/deployment_info.txt"; + static const char SD_1_DEPLY_INFO[] = "/mnt/sd1/conf/deployment_info.txt"; /** * @brief constructor * @@ -46,8 +48,7 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, */ SolarArrayDeploymentHandler(object_id_t setObjectId, GpioIF& gpio, PowerSwitchIF& mainLineSwitcher, pcdu::Switches mainLineSwitch, - gpioId_t deplSA1, gpioId_t deplSA2, - SdCardMountedIF& sdcMountedIF); + gpioId_t deplSA1, gpioId_t deplSA2, SdCardMountedIF& sdcMountedIF); virtual ~SolarArrayDeploymentHandler(); @@ -84,6 +85,8 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, // // StateMachine stateMachine = WAIT_ON_DELOYMENT_COMMAND; + ReturnValue_t performAutonomousDepl(sd::SdCard sdCard); + /** * This countdown is used to check if the PCDU sets the 8V line on in the intended time. */ @@ -106,9 +109,6 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, gpioId_t deplSA1; gpioId_t deplSA2; - /** Queue to receive messages from other objects. */ - MessageQueueIF* commandQueue = nullptr; - /** * After initialization this pointer will hold the reference to the main line switcher object. */ @@ -117,8 +117,13 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, /** Switch number of the 8V power switch */ uint8_t mainLineSwitch; + SdCardMountedIF& sdcMan; + ActionHelper actionHelper; + /** Queue to receive messages from other objects. */ + MessageQueueIF* commandQueue = nullptr; + void readCommandQueue(); /** -- 2.43.0 From 2bc7c7b3ae942044b5b4fe69f1bc2c68f5deaef0 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 12 Oct 2022 15:19:21 +0200 Subject: [PATCH 08/97] continue autonomous depl handling --- common/config/eive/definitions.h | 4 ++ .../devices/SolarArrayDeploymentHandler.cpp | 71 ++++++++++++++++++- mission/devices/SolarArrayDeploymentHandler.h | 34 +++++++-- 3 files changed, 104 insertions(+), 5 deletions(-) diff --git a/common/config/eive/definitions.h b/common/config/eive/definitions.h index 1e8faad9..fb941edc 100644 --- a/common/config/eive/definitions.h +++ b/common/config/eive/definitions.h @@ -34,6 +34,10 @@ static constexpr uint8_t LIVE_TM = 0; static constexpr uint32_t MAX_PATH_SIZE = 100; static constexpr uint32_t MAX_FILENAME_SIZE = 50; +static constexpr uint32_t SA_DEPL_INIT_BUFFER_SECS = 120; +static constexpr uint32_t SA_DEPL_BURN_TIME_SECS = 90; +static constexpr uint32_t SA_DEPL_WAIT_TIME_SECS = 45 * 60; + } // namespace config #endif /* COMMON_CONFIG_DEFINITIONS_H_ */ diff --git a/mission/devices/SolarArrayDeploymentHandler.cpp b/mission/devices/SolarArrayDeploymentHandler.cpp index fac22115..47d93e09 100644 --- a/mission/devices/SolarArrayDeploymentHandler.cpp +++ b/mission/devices/SolarArrayDeploymentHandler.cpp @@ -6,6 +6,8 @@ #include "fsfw_hal/common/gpio/GpioCookie.h" #include +#include +#include SolarArrayDeploymentHandler::SolarArrayDeploymentHandler(object_id_t setObjectId_, GpioIF& gpioInterface, @@ -49,6 +51,73 @@ ReturnValue_t SolarArrayDeploymentHandler::performOperation(uint8_t operationCod } ReturnValue_t SolarArrayDeploymentHandler::performAutonomousDepl(sd::SdCard sdCard) { + using namespace std::filesystem; + using namespace std; + auto initFile = [](const char* filename) { + ofstream of(filename); + of << "phase: init\n"; + of << "secs_since_start: 0\n"; + }; + auto handler = [](const char* filename) { + + ifstream file(filename); + string line; + string word; + unsigned int lineNum = 0; + AutonomousDeplState deplState; + while(std::getline(file, line)) { + if(lineNum == 0) { + std::istringstream iss(line); + if (lineNum == 0) { + iss >> word; + if(word.find("phase:") == string::npos) { + return false; + } + iss >> word; + if(word.find(PHASE_INIT_STR) != string::npos) { + deplState = AutonomousDeplState::INIT; + } else if(word.find(PHASE_FIRST_BURN_STR) != string::npos) { + deplState = AutonomousDeplState::FIRST_BURN; + } else if(word.find(PHASE_WAIT_STR) != string::npos) { + deplState = AutonomousDeplState::WAIT; + } else if(word.find(PHASE_SECOND_BURN_STR) != string::npos) { + deplState = AutonomousDeplState::SECOND_BURN; + } else if(word.find(PHASE_DONE) != string::npos) { + deplState = AutonomousDeplState::DONE; + } else { + return false; + } + } else if(lineNum == 1) { + iss >> word; + if(word.find("phase:") == string::npos) { + return false; + } + uint32_t secsSinceBoot = 0; + iss >> secsSinceBoot; + if (iss.bad()) { + return false; + } + } + } + lineNum++; + } + return true; + }; + if (sdCard == sd::SdCard::SLOT_0) { + if (not exists(SD_0_DEPLY_INFO)) { + initFile(SD_0_DEPLY_INFO); + } + if (not handler(SD_0_DEPLY_INFO)) { + initFile(SD_0_DEPLY_INFO); + } + } else if(sdCard == sd::SdCard::SLOT_1) { + if (not exists(SD_1_DEPLY_INFO)) { + initFile(SD_1_DEPLY_INFO); + } + if (not handler(SD_1_DEPLY_INFO)) { + initFile(SD_1_DEPLY_INFO); + } + } return returnvalue::OK; } @@ -176,7 +245,7 @@ void SolarArrayDeploymentHandler::readCommandQueue() { ReturnValue_t SolarArrayDeploymentHandler::executeAction(ActionId_t actionId, MessageQueueId_t commandedBy, const uint8_t* data, size_t size) { - ReturnValue_t result; + ReturnValue_t result = returnvalue::OK; // if (stateMachine != WAIT_ON_DELOYMENT_COMMAND) { // sif::error << "SolarArrayDeploymentHandler::executeAction: Received command while not in" // << "waiting-on-command-state" << std::endl; diff --git a/mission/devices/SolarArrayDeploymentHandler.h b/mission/devices/SolarArrayDeploymentHandler.h index 9e0bdfa1..dc1db96d 100644 --- a/mission/devices/SolarArrayDeploymentHandler.h +++ b/mission/devices/SolarArrayDeploymentHandler.h @@ -3,6 +3,7 @@ #include +#include "eive/definitions.h" #include "devices/powerSwitcherList.h" #include "events/subsystemIdRanges.h" #include "fsfw/action/HasActionsIF.h" @@ -26,11 +27,29 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, public SystemObject, public HasActionsIF { public: + // Burn them for a custom amount limited by 120 secs static constexpr DeviceCommandId_t DEPLOY_SOLAR_ARRAYS_MANUALLY = 0x5; - static const char SD_0_DEPL_FILE[] = "/mnt/sd0/conf/deployment"; - static const char SD_1_DEPL_FILE[] = "/mnt/sd1/conf/deployment"; - static const char SD_0_DEPLY_INFO[] = "/mnt/sd0/conf/deployment_info.txt"; - static const char SD_1_DEPLY_INFO[] = "/mnt/sd1/conf/deployment_info.txt"; + // Careful with these command, not automatic off handling! + static constexpr DeviceCommandId_t FORCE_DEPLY_ON = 0x06; + static constexpr DeviceCommandId_t FORCE_DEPLY_OFF = 0x07; + + static constexpr uint32_t FIRST_BURN_START_TIME = config::SA_DEPL_BURN_TIME_SECS; + static constexpr uint32_t FIRST_BURN_END_TIME = FIRST_BURN_START_TIME + config::SA_DEPL_BURN_TIME_SECS; + static constexpr uint32_t FIRST_WAIT_START_TIME = FIRST_BURN_END_TIME; + static constexpr uint32_t FIRST_WAIT_END_TIME = FIRST_BURN_END_TIME + config::SA_DEPL_WAIT_TIME_SECS; + static constexpr uint32_t SECOND_BURN_START_TIME = FIRST_WAIT_END_TIME; + static constexpr uint32_t SECOND_BURN_END_TIME = SECOND_BURN_START_TIME + config::SA_DEPL_WAIT_TIME_SECS; + + static constexpr char SD_0_DEPL_FILE[] = "/mnt/sd0/conf/deployment"; + static constexpr char SD_1_DEPL_FILE[] = "/mnt/sd1/conf/deployment"; + static constexpr char SD_0_DEPLY_INFO[] = "/mnt/sd0/conf/deployment_info.txt"; + static constexpr char SD_1_DEPLY_INFO[] = "/mnt/sd1/conf/deployment_info.txt"; + + static constexpr char PHASE_INIT_STR[] = "init"; + static constexpr char PHASE_FIRST_BURN_STR[] = "first_burn"; + static constexpr char PHASE_WAIT_STR[] = "wait"; + static constexpr char PHASE_SECOND_BURN_STR[] = "second_burn"; + static constexpr char PHASE_DONE[] = "done"; /** * @brief constructor * @@ -74,6 +93,13 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, static const Event DEPL_SA1_GPIO_SWTICH_ON_FAILED = MAKE_EVENT(3, severity::HIGH); static const Event DEPL_SA2_GPIO_SWTICH_ON_FAILED = MAKE_EVENT(4, severity::HIGH); + enum AutonomousDeplState { + INIT, + FIRST_BURN, + WAIT, + SECOND_BURN, + DONE + }; // enum StateMachine { // WAIT_ON_DELOYMENT_COMMAND, // SWITCH_8V_ON, -- 2.43.0 From 15fb86ddb7fa840a37b0ac4ad2edfba7471fef38 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 12 Oct 2022 17:18:57 +0200 Subject: [PATCH 09/97] continue SA DEPL handler --- .../devices/SolarArrayDeploymentHandler.cpp | 343 ++++++++++-------- mission/devices/SolarArrayDeploymentHandler.h | 69 ++-- 2 files changed, 235 insertions(+), 177 deletions(-) diff --git a/mission/devices/SolarArrayDeploymentHandler.cpp b/mission/devices/SolarArrayDeploymentHandler.cpp index 47d93e09..7a1c06d4 100644 --- a/mission/devices/SolarArrayDeploymentHandler.cpp +++ b/mission/devices/SolarArrayDeploymentHandler.cpp @@ -1,14 +1,14 @@ #include "SolarArrayDeploymentHandler.h" +#include +#include +#include + #include "devices/gpioIds.h" #include "fsfw/ipc/QueueFactory.h" #include "fsfw/objectmanager/ObjectManager.h" #include "fsfw_hal/common/gpio/GpioCookie.h" -#include -#include -#include - SolarArrayDeploymentHandler::SolarArrayDeploymentHandler(object_id_t setObjectId_, GpioIF& gpioInterface, PowerSwitchIF& mainLineSwitcher_, @@ -32,7 +32,6 @@ SolarArrayDeploymentHandler::~SolarArrayDeploymentHandler() = default; ReturnValue_t SolarArrayDeploymentHandler::performOperation(uint8_t operationCode) { using namespace std::filesystem; - handleStateMachine(); auto activeSdc = sdcMan.getActiveSdCard(); if (activeSdc and activeSdc.value() == sd::SdCard::SLOT_0 and sdcMan.isSdCardUsable(activeSdc.value())) { @@ -47,6 +46,8 @@ ReturnValue_t SolarArrayDeploymentHandler::performOperation(uint8_t operationCod performAutonomousDepl(sd::SdCard::SLOT_1); } } + readCommandQueue(); + handleStateMachine(); return returnvalue::OK; } @@ -58,69 +59,104 @@ ReturnValue_t SolarArrayDeploymentHandler::performAutonomousDepl(sd::SdCard sdCa of << "phase: init\n"; of << "secs_since_start: 0\n"; }; - auto handler = [](const char* filename) { - - ifstream file(filename); - string line; - string word; - unsigned int lineNum = 0; - AutonomousDeplState deplState; - while(std::getline(file, line)) { - if(lineNum == 0) { - std::istringstream iss(line); - if (lineNum == 0) { - iss >> word; - if(word.find("phase:") == string::npos) { - return false; - } - iss >> word; - if(word.find(PHASE_INIT_STR) != string::npos) { - deplState = AutonomousDeplState::INIT; - } else if(word.find(PHASE_FIRST_BURN_STR) != string::npos) { - deplState = AutonomousDeplState::FIRST_BURN; - } else if(word.find(PHASE_WAIT_STR) != string::npos) { - deplState = AutonomousDeplState::WAIT; - } else if(word.find(PHASE_SECOND_BURN_STR) != string::npos) { - deplState = AutonomousDeplState::SECOND_BURN; - } else if(word.find(PHASE_DONE) != string::npos) { - deplState = AutonomousDeplState::DONE; - } else { - return false; - } - } else if(lineNum == 1) { - iss >> word; - if(word.find("phase:") == string::npos) { - return false; - } - uint32_t secsSinceBoot = 0; - iss >> secsSinceBoot; - if (iss.bad()) { - return false; - } - } - } - lineNum++; - } - return true; - }; if (sdCard == sd::SdCard::SLOT_0) { if (not exists(SD_0_DEPLY_INFO)) { initFile(SD_0_DEPLY_INFO); } - if (not handler(SD_0_DEPLY_INFO)) { + if (not autonomousDeplForFile(SD_0_DEPLY_INFO)) { initFile(SD_0_DEPLY_INFO); } - } else if(sdCard == sd::SdCard::SLOT_1) { + } else if (sdCard == sd::SdCard::SLOT_1) { if (not exists(SD_1_DEPLY_INFO)) { initFile(SD_1_DEPLY_INFO); } - if (not handler(SD_1_DEPLY_INFO)) { + if (not autonomousDeplForFile(SD_1_DEPLY_INFO)) { initFile(SD_1_DEPLY_INFO); } } return returnvalue::OK; } +bool SolarArrayDeploymentHandler::autonomousDeplForFile(const char* filename) { + using namespace std; + ifstream file(filename); + string line; + string word; + unsigned int lineNum = 0; + AutonomousDeplState deplState; + bool stateSwitch = false; + uint32_t secsSinceBoot = 0; + while (std::getline(file, line)) { + if (lineNum == 0) { + std::istringstream iss(line); + if (lineNum == 0) { + iss >> word; + if (word.find("phase:") == string::npos) { + return false; + } + iss >> word; + if (word.find(PHASE_INIT_STR) != string::npos) { + deplState = AutonomousDeplState::INIT; + } else if (word.find(PHASE_FIRST_BURN_STR) != string::npos) { + deplState = AutonomousDeplState::FIRST_BURN; + } else if (word.find(PHASE_WAIT_STR) != string::npos) { + deplState = AutonomousDeplState::WAIT; + } else if (word.find(PHASE_SECOND_BURN_STR) != string::npos) { + deplState = AutonomousDeplState::SECOND_BURN; + } else if (word.find(PHASE_DONE) != string::npos) { + deplState = AutonomousDeplState::DONE; + } else { + return false; + } + } else if (lineNum == 1) { + iss >> word; + if (word.find("phase:") == string::npos) { + return false; + } + + iss >> secsSinceBoot; + if (not initUptime) { + initUptime = secsSinceBoot; + } + if (iss.bad()) { + return false; + } + auto switchCheck = [&](AutonomousDeplState expected) { + if (deplState != expected) { + deplState = expected; + stateSwitch = true; + } + }; + if ((secsSinceBoot > FIRST_BURN_START_TIME) and (secsSinceBoot < FIRST_BURN_END_TIME)) { + switchCheck(AutonomousDeplState::FIRST_BURN); + } else if ((secsSinceBoot > WAIT_START_TIME) and (secsSinceBoot < WAIT_END_TIME)) { + switchCheck(AutonomousDeplState::WAIT); + } else if ((secsSinceBoot > SECOND_BURN_START_TIME) and + (secsSinceBoot < SECOND_BURN_END_TIME)) { + switchCheck(AutonomousDeplState::SECOND_BURN); + } else if (secsSinceBoot > SECOND_BURN_END_TIME) { + switchCheck(AutonomousDeplState::DONE); + } + } + } + lineNum++; + } + if (initUptime) { + secsSinceBoot = initUptime.value(); + } + // Uptime has increased by X seconds so we need to update the uptime count inside the file + secsSinceBoot += Clock::getUptime().tv_sec; + if (stateSwitch) { + if (deplState == AutonomousDeplState::FIRST_BURN or + deplState == AutonomousDeplState::SECOND_BURN) { + startFsm(true, true); + } else if (deplState == AutonomousDeplState::WAIT or deplState == AutonomousDeplState::DONE) { + startFsm(false, false); + } + } + return true; +} + ReturnValue_t SolarArrayDeploymentHandler::initialize() { ReturnValue_t result = actionHelper.initialize(commandQueue); if (result != returnvalue::OK) { @@ -130,104 +166,121 @@ ReturnValue_t SolarArrayDeploymentHandler::initialize() { } void SolarArrayDeploymentHandler::handleStateMachine() { - // switch (stateMachine) { - // case WAIT_ON_DELOYMENT_COMMAND: - // readCommandQueue(); - // break; - // case SWITCH_8V_ON: - // mainLineSwitcher.sendSwitchCommand(mainLineSwitch, PowerSwitchIF::SWITCH_ON); - // mainSwitchCountdown.setTimeout(mainLineSwitcher.getSwitchDelayMs()); - // stateMachine = WAIT_ON_8V_SWITCH; - // break; - // case WAIT_ON_8V_SWITCH: - // performWaitOn8VActions(); - // break; - // case SWITCH_DEPL_GPIOS: - // deploymentTransistorsOn(); - // break; - // case WAIT_ON_DEPLOYMENT_FINISH: - // handleDeploymentFinish(); - // break; - // case WAIT_FOR_MAIN_SWITCH_OFF: - // if (mainLineSwitcher.getSwitchState(mainLineSwitch) == PowerSwitchIF::SWITCH_OFF) { - // stateMachine = WAIT_ON_DELOYMENT_COMMAND; - // } else if (mainSwitchCountdown.hasTimedOut()) { - // triggerEvent(MAIN_SWITCH_OFF_TIMEOUT); - // sif::error << "SolarArrayDeploymentHandler::handleStateMachine: Failed to switch main" - // << " switch off" << std::endl; - // stateMachine = WAIT_ON_DELOYMENT_COMMAND; - // } - // break; - // default: - // sif::debug << "SolarArrayDeploymentHandler::handleStateMachine: Invalid state" << - // std::endl; break; - // } + if (stateMachine == MAIN_POWER_ON) { + mainLineSwitcher.sendSwitchCommand(mainLineSwitch, PowerSwitchIF::SWITCH_ON); + mainSwitchCountdown.setTimeout(mainLineSwitcher.getSwitchDelayMs()); + stateMachine = WAIT_MAIN_POWER_ON; + } + if (stateMachine == MAIN_POWER_OFF) { + // This should never fail + deploymentTransistorsOff(); + mainLineSwitcher.sendSwitchCommand(mainLineSwitch, PowerSwitchIF::SWITCH_ON); + mainSwitchCountdown.setTimeout(mainLineSwitcher.getSwitchDelayMs()); + stateMachine = WAIT_MAIN_POWER_OFF; + } + if (stateMachine == WAIT_MAIN_POWER_ON) { + if (checkMainPowerOn()) { + stateMachine = SWITCH_DEPL_GPIOS; + } + } + if (stateMachine == WAIT_MAIN_POWER_OFF) { + if (checkMainPowerOff()) { + finishFsm(returnvalue::OK); + } + } + if (stateMachine == SWITCH_DEPL_GPIOS) { + // This should never fail + deploymentTransistorsOn(); + finishFsm(returnvalue::OK); + } } -void SolarArrayDeploymentHandler::performWaitOn8VActions() { - // if (mainLineSwitcher.getSwitchState(mainLineSwitch) == PowerSwitchIF::SWITCH_ON) { - // stateMachine = SWITCH_DEPL_GPIOS; - // } else { - // if (mainSwitchCountdown.hasTimedOut()) { - // triggerEvent(MAIN_SWITCH_ON_TIMEOUT); - // actionHelper.finish(false, rememberCommanderId, DEPLOY_SOLAR_ARRAYS, - // MAIN_SWITCH_TIMEOUT_FAILURE); - // stateMachine = WAIT_ON_DELOYMENT_COMMAND; - // } - // } +bool SolarArrayDeploymentHandler::checkMainPowerOn() { return checkMainPower(true); } + +bool SolarArrayDeploymentHandler::checkMainPowerOff() { return checkMainPower(false); } + +bool SolarArrayDeploymentHandler::checkMainPower(bool onOff) { + if ((onOff and mainLineSwitcher.getSwitchState(mainLineSwitch) == PowerSwitchIF::SWITCH_ON) or + (not onOff and + mainLineSwitcher.getSwitchState(mainLineSwitch) == PowerSwitchIF::SWITCH_OFF)) { + return true; + } + if (mainSwitchCountdown.hasTimedOut()) { + if (onOff) { + triggerEvent(MAIN_SWITCH_ON_TIMEOUT); + } else { + triggerEvent(MAIN_SWITCH_OFF_TIMEOUT); + } + if (retryCounter < 3) { + if (onOff) { + stateMachine = MAIN_POWER_ON; + } else { + stateMachine = MAIN_POWER_OFF; + } + retryCounter++; + } else { + finishFsm(MAIN_SWITCH_TIMEOUT_FAILURE); + } + } + return false; } -void SolarArrayDeploymentHandler::deploymentTransistorsOn() { - // ReturnValue_t result = returnvalue::OK; - // result = gpioInterface->pullHigh(deplSA1); - // if (result != returnvalue::OK) { - // sif::debug << "SolarArrayDeploymentHandler::handleStateMachine: Failed to pull solar" - // " array deployment switch 1 high " - // << std::endl; - // /* If gpio switch high failed, state machine is reset to wait for a command reinitiating - // * the deployment sequence. */ - // stateMachine = WAIT_ON_DELOYMENT_COMMAND; - // triggerEvent(DEPL_SA1_GPIO_SWTICH_ON_FAILED); - // actionHelper.finish(false, rememberCommanderId, DEPLOY_SOLAR_ARRAYS, - // SWITCHING_DEPL_SA2_FAILED); mainLineSwitcher.sendSwitchCommand(mainLineSwitch, - // PowerSwitchIF::SWITCH_OFF); - // } - // result = gpioInterface->pullHigh(deplSA2); - // if (result != returnvalue::OK) { - // sif::debug << "SolarArrayDeploymentHandler::handleStateMachine: Failed to pull solar" - // " array deployment switch 2 high " - // << std::endl; - // stateMachine = WAIT_ON_DELOYMENT_COMMAND; - // triggerEvent(DEPL_SA2_GPIO_SWTICH_ON_FAILED); - // actionHelper.finish(false, rememberCommanderId, DEPLOY_SOLAR_ARRAYS, - // SWITCHING_DEPL_SA2_FAILED); mainLineSwitcher.sendSwitchCommand(mainLineSwitch, - // PowerSwitchIF::SWITCH_OFF); - // } - // deploymentCountdown.setTimeout(burnTimeMs); - // stateMachine = WAIT_ON_DEPLOYMENT_FINISH; +bool SolarArrayDeploymentHandler::startFsm(std::optional sa1OnOff, + std::optional sa2OnOff) { + if ((stateMachine != StateMachine::IDLE) or (not sa1OnOff and not sa2OnOff)) { + return false; + } + retryCounter = 0; + return true; } -// void SolarArrayDeploymentHandler::handleDeploymentFinish() { -// ReturnValue_t result = returnvalue::OK; -// if (deploymentCountdown.hasTimedOut()) { -// actionHelper.finish(true, rememberCommanderId, DEPLOY_SOLAR_ARRAYS, returnvalue::OK); -// result = gpioInterface->pullLow(deplSA1); -// if (result != returnvalue::OK) { -// sif::debug << "SolarArrayDeploymentHandler::handleStateMachine: Failed to pull solar" -// " array deployment switch 1 low " -// << std::endl; -// } -// result = gpioInterface->pullLow(deplSA2); -// if (result != returnvalue::OK) { -// sif::debug << "SolarArrayDeploymentHandler::handleStateMachine: Failed to pull solar" -// " array deployment switch 2 low " -// << std::endl; -// } -// mainLineSwitcher.sendSwitchCommand(mainLineSwitch, PowerSwitchIF::SWITCH_OFF); -// mainSwitchCountdown.setTimeout(mainLineSwitcher.getSwitchDelayMs()); -// stateMachine = WAIT_FOR_MAIN_SWITCH_OFF; -// } -//} +void SolarArrayDeploymentHandler::finishFsm(ReturnValue_t resultForActionHelper) { + retryCounter = 0; + stateMachine = StateMachine::IDLE; + if (actionActive) { + actionHelper.finish(true, rememberCommanderId, activeCmd, resultForActionHelper); + } +} + +ReturnValue_t SolarArrayDeploymentHandler::deploymentTransistorsOn() { + ReturnValue_t result = gpioInterface.pullHigh(deplSA1); + if (result != returnvalue::OK) { + sif::debug << "SolarArrayDeploymentHandler::handleStateMachine: Failed to pull solar" + " array deployment switch 1 high " + << std::endl; + // If gpio switch high failed, state machine is reset to wait for a command re-initiating + // the deployment sequence. + triggerEvent(DEPL_SA1_GPIO_SWTICH_ON_FAILED); + } + result = gpioInterface.pullHigh(deplSA2); + if (result != returnvalue::OK) { + sif::debug << "SolarArrayDeploymentHandler::handleStateMachine: Failed to pull solar" + " array deployment switch 2 high " + << std::endl; + triggerEvent(DEPL_SA2_GPIO_SWTICH_ON_FAILED); + } + return result; +} + +ReturnValue_t SolarArrayDeploymentHandler::deploymentTransistorsOff() { + ReturnValue_t result = gpioInterface.pullLow(deplSA1); + if (result != returnvalue::OK) { + sif::debug << "SolarArrayDeploymentHandler::handleStateMachine: Failed to pull solar" + " array deployment switch 1 low" + << std::endl; + // If gpio switch high failed, state machine is reset to wait for a command re-initiating + // the deployment sequence. + triggerEvent(DEPL_SA1_GPIO_SWTICH_ON_FAILED); + } + result = gpioInterface.pullLow(deplSA2); + if (result != returnvalue::OK) { + sif::debug << "SolarArrayDeploymentHandler::handleStateMachine: Failed to pull solar" + " array deployment switch 2 low" + << std::endl; + triggerEvent(DEPL_SA2_GPIO_SWTICH_ON_FAILED); + } + return result; +} void SolarArrayDeploymentHandler::readCommandQueue() { CommandMessage command; diff --git a/mission/devices/SolarArrayDeploymentHandler.h b/mission/devices/SolarArrayDeploymentHandler.h index dc1db96d..2a5806e0 100644 --- a/mission/devices/SolarArrayDeploymentHandler.h +++ b/mission/devices/SolarArrayDeploymentHandler.h @@ -3,8 +3,8 @@ #include -#include "eive/definitions.h" #include "devices/powerSwitcherList.h" +#include "eive/definitions.h" #include "events/subsystemIdRanges.h" #include "fsfw/action/HasActionsIF.h" #include "fsfw/devicehandlers/CookieIF.h" @@ -34,11 +34,13 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, static constexpr DeviceCommandId_t FORCE_DEPLY_OFF = 0x07; static constexpr uint32_t FIRST_BURN_START_TIME = config::SA_DEPL_BURN_TIME_SECS; - static constexpr uint32_t FIRST_BURN_END_TIME = FIRST_BURN_START_TIME + config::SA_DEPL_BURN_TIME_SECS; - static constexpr uint32_t FIRST_WAIT_START_TIME = FIRST_BURN_END_TIME; - static constexpr uint32_t FIRST_WAIT_END_TIME = FIRST_BURN_END_TIME + config::SA_DEPL_WAIT_TIME_SECS; - static constexpr uint32_t SECOND_BURN_START_TIME = FIRST_WAIT_END_TIME; - static constexpr uint32_t SECOND_BURN_END_TIME = SECOND_BURN_START_TIME + config::SA_DEPL_WAIT_TIME_SECS; + static constexpr uint32_t FIRST_BURN_END_TIME = + FIRST_BURN_START_TIME + config::SA_DEPL_BURN_TIME_SECS; + static constexpr uint32_t WAIT_START_TIME = FIRST_BURN_END_TIME; + static constexpr uint32_t WAIT_END_TIME = WAIT_START_TIME + config::SA_DEPL_WAIT_TIME_SECS; + static constexpr uint32_t SECOND_BURN_START_TIME = WAIT_END_TIME; + static constexpr uint32_t SECOND_BURN_END_TIME = + SECOND_BURN_START_TIME + config::SA_DEPL_WAIT_TIME_SECS; static constexpr char SD_0_DEPL_FILE[] = "/mnt/sd0/conf/deployment"; static constexpr char SD_1_DEPL_FILE[] = "/mnt/sd1/conf/deployment"; @@ -93,26 +95,32 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, static const Event DEPL_SA1_GPIO_SWTICH_ON_FAILED = MAKE_EVENT(3, severity::HIGH); static const Event DEPL_SA2_GPIO_SWTICH_ON_FAILED = MAKE_EVENT(4, severity::HIGH); - enum AutonomousDeplState { - INIT, - FIRST_BURN, - WAIT, - SECOND_BURN, - DONE + enum AutonomousDeplState { INIT, FIRST_BURN, WAIT, SECOND_BURN, DONE }; + enum StateMachine { + IDLE, + MAIN_POWER_ON, + MAIN_POWER_OFF, + WAIT_MAIN_POWER_ON, + WAIT_MAIN_POWER_OFF, + SWITCH_DEPL_GPIOS, }; - // enum StateMachine { - // WAIT_ON_DELOYMENT_COMMAND, - // SWITCH_8V_ON, - // WAIT_ON_8V_SWITCH, - // SWITCH_DEPL_GPIOS, - // WAIT_ON_DEPLOYMENT_FINISH, - // WAIT_FOR_MAIN_SWITCH_OFF - // }; - // - // StateMachine stateMachine = WAIT_ON_DELOYMENT_COMMAND; + + StateMachine stateMachine = IDLE; + bool actionActive = false; + ActionId_t activeCmd = HasActionsIF::INVALID_ACTION_ID; + std::optional initUptime; + uint8_t retryCounter = 3; + struct FsmInfo { + // false if OFF, true is ON + bool sa1OnOff = false; + bool sa2OnOff = false; + } fsmInfo; + + bool startFsm(std::optional sa1OnOff, std::optional sa2OnOff); + void finishFsm(ReturnValue_t resultForActionHelper); ReturnValue_t performAutonomousDepl(sd::SdCard sdCard); - + bool autonomousDeplForFile(const char* filename); /** * This countdown is used to check if the PCDU sets the 8V line on in the intended time. */ @@ -121,7 +129,7 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, /** * This countdown is used to wait for the burn wire being successful cut. */ - // Countdown deploymentCountdown; + Countdown deploymentCountdown; /** * The message queue id of the component commanding an action will be stored in this variable. @@ -161,18 +169,15 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, * @brief This function polls the 8V switch state and changes the state machine when the * switch has been enabled. */ - void performWaitOn8VActions(); + bool checkMainPowerOn(); + bool checkMainPowerOff(); + bool checkMainPower(bool onOff); /** * @brief This functions handles the switching of the solar array deployment transistors. */ - void deploymentTransistorsOn(); - - /** - * @brief This function performs actions to finish the deployment. Essentially switches - * are turned of after the burn time has expired. - */ - // void handleDeploymentFinish(); + ReturnValue_t deploymentTransistorsOn(); + ReturnValue_t deploymentTransistorsOff(); }; #endif /* MISSION_DEVICES_SOLARARRAYDEPLOYMENT_H_ */ -- 2.43.0 From 10da5cd45b1bb5552b3972e04ffc15edee2e3cf9 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 12 Oct 2022 17:21:10 +0200 Subject: [PATCH 10/97] action handler init --- .../devices/SolarArrayDeploymentHandler.cpp | 20 ++++++------------- mission/devices/SolarArrayDeploymentHandler.h | 2 +- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/mission/devices/SolarArrayDeploymentHandler.cpp b/mission/devices/SolarArrayDeploymentHandler.cpp index 7a1c06d4..0b085cf6 100644 --- a/mission/devices/SolarArrayDeploymentHandler.cpp +++ b/mission/devices/SolarArrayDeploymentHandler.cpp @@ -299,20 +299,12 @@ ReturnValue_t SolarArrayDeploymentHandler::executeAction(ActionId_t actionId, MessageQueueId_t commandedBy, const uint8_t* data, size_t size) { ReturnValue_t result = returnvalue::OK; - // if (stateMachine != WAIT_ON_DELOYMENT_COMMAND) { - // sif::error << "SolarArrayDeploymentHandler::executeAction: Received command while not in" - // << "waiting-on-command-state" << std::endl; - // return DEPLOYMENT_ALREADY_EXECUTING; - // } - // if (actionId != DEPLOY_SOLAR_ARRAYS) { - // sif::error << "SolarArrayDeploymentHandler::executeAction: Received invalid command" - // << std::endl; - // result = COMMAND_NOT_SUPPORTED; - // } else { - // stateMachine = SWITCH_8V_ON; - // rememberCommanderId = commandedBy; - // result = returnvalue::OK; - // } + if (actionId == FORCE_DEPLY_ON) { + } + if (actionId == FORCE_DEPLY_OFF) { + } + if (actionId == DEPLOY_SOLAR_ARRAYS_MANUALLY) { + } return result; } diff --git a/mission/devices/SolarArrayDeploymentHandler.h b/mission/devices/SolarArrayDeploymentHandler.h index 2a5806e0..b94ba67c 100644 --- a/mission/devices/SolarArrayDeploymentHandler.h +++ b/mission/devices/SolarArrayDeploymentHandler.h @@ -28,7 +28,7 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, public HasActionsIF { public: // Burn them for a custom amount limited by 120 secs - static constexpr DeviceCommandId_t DEPLOY_SOLAR_ARRAYS_MANUALLY = 0x5; + static constexpr DeviceCommandId_t DEPLOY_SOLAR_ARRAYS_MANUALLY = 0x05; // Careful with these command, not automatic off handling! static constexpr DeviceCommandId_t FORCE_DEPLY_ON = 0x06; static constexpr DeviceCommandId_t FORCE_DEPLY_OFF = 0x07; -- 2.43.0 From 22691b695038934d46fa1f1a8d737cec7fe498cd Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 12 Oct 2022 17:23:54 +0200 Subject: [PATCH 11/97] add TODO --- mission/devices/SolarArrayDeploymentHandler.cpp | 15 +++++++++++---- mission/devices/SolarArrayDeploymentHandler.h | 2 ++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/mission/devices/SolarArrayDeploymentHandler.cpp b/mission/devices/SolarArrayDeploymentHandler.cpp index 0b085cf6..af281d1d 100644 --- a/mission/devices/SolarArrayDeploymentHandler.cpp +++ b/mission/devices/SolarArrayDeploymentHandler.cpp @@ -141,11 +141,15 @@ bool SolarArrayDeploymentHandler::autonomousDeplForFile(const char* filename) { } lineNum++; } - if (initUptime) { - secsSinceBoot = initUptime.value(); + bool updateUptime = false; + if(opDivider.checkAndIncrement()) { + if (initUptime) { + secsSinceBoot = initUptime.value(); + } + // Uptime has increased by X seconds so we need to update the uptime count inside the file + secsSinceBoot += Clock::getUptime().tv_sec; + updateUptime = true; } - // Uptime has increased by X seconds so we need to update the uptime count inside the file - secsSinceBoot += Clock::getUptime().tv_sec; if (stateSwitch) { if (deplState == AutonomousDeplState::FIRST_BURN or deplState == AutonomousDeplState::SECOND_BURN) { @@ -154,6 +158,9 @@ bool SolarArrayDeploymentHandler::autonomousDeplForFile(const char* filename) { startFsm(false, false); } } + if(stateSwitch or updateUptime) { + // TODO: Write new file here + } return true; } diff --git a/mission/devices/SolarArrayDeploymentHandler.h b/mission/devices/SolarArrayDeploymentHandler.h index b94ba67c..019c6bf6 100644 --- a/mission/devices/SolarArrayDeploymentHandler.h +++ b/mission/devices/SolarArrayDeploymentHandler.h @@ -1,6 +1,7 @@ #ifndef MISSION_DEVICES_SOLARARRAYDEPLOYMENT_H_ #define MISSION_DEVICES_SOLARARRAYDEPLOYMENT_H_ +#include #include #include "devices/powerSwitcherList.h" @@ -109,6 +110,7 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, bool actionActive = false; ActionId_t activeCmd = HasActionsIF::INVALID_ACTION_ID; std::optional initUptime; + PeriodicOperationDivider opDivider = PeriodicOperationDivider(5); uint8_t retryCounter = 3; struct FsmInfo { // false if OFF, true is ON -- 2.43.0 From e1b3688869c8d08e390302e760be11968798dbda Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 12 Oct 2022 19:55:20 +0200 Subject: [PATCH 12/97] finish file handling --- mission/devices/SolarArrayDeploymentHandler.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/mission/devices/SolarArrayDeploymentHandler.cpp b/mission/devices/SolarArrayDeploymentHandler.cpp index af281d1d..dc5ae63e 100644 --- a/mission/devices/SolarArrayDeploymentHandler.cpp +++ b/mission/devices/SolarArrayDeploymentHandler.cpp @@ -110,7 +110,7 @@ bool SolarArrayDeploymentHandler::autonomousDeplForFile(const char* filename) { } } else if (lineNum == 1) { iss >> word; - if (word.find("phase:") == string::npos) { + if (word.find("secs_since_start:") == string::npos) { return false; } @@ -159,7 +159,20 @@ bool SolarArrayDeploymentHandler::autonomousDeplForFile(const char* filename) { } } if(stateSwitch or updateUptime) { - // TODO: Write new file here + std::ofstream of(filename); + of << "phase: " ; + if(deplState == AutonomousDeplState::INIT) { + of << PHASE_INIT_STR << "\n"; + } else if(deplState == AutonomousDeplState::FIRST_BURN) { + of << PHASE_FIRST_BURN_STR << "\n"; + } else if(deplState == AutonomousDeplState::WAIT) { + of << PHASE_WAIT_STR << "\n"; + } else if(deplState == AutonomousDeplState::SECOND_BURN) { + of << PHASE_SECOND_BURN_STR << "\n"; + } else if(deplState == AutonomousDeplState::DONE) { + of << PHASE_DONE<< "\n"; + } + of << "secs_since_start: " << std::to_string(secsSinceBoot) << "\n"; } return true; } -- 2.43.0 From 20b57906b7139e285d7f9c168f6918cde8a54ae0 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 12 Oct 2022 19:55:47 +0200 Subject: [PATCH 13/97] added TODO --- mission/devices/SolarArrayDeploymentHandler.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/mission/devices/SolarArrayDeploymentHandler.cpp b/mission/devices/SolarArrayDeploymentHandler.cpp index dc5ae63e..90054ecc 100644 --- a/mission/devices/SolarArrayDeploymentHandler.cpp +++ b/mission/devices/SolarArrayDeploymentHandler.cpp @@ -318,6 +318,7 @@ void SolarArrayDeploymentHandler::readCommandQueue() { ReturnValue_t SolarArrayDeploymentHandler::executeAction(ActionId_t actionId, MessageQueueId_t commandedBy, const uint8_t* data, size_t size) { + // TODO: Finish command handling ReturnValue_t result = returnvalue::OK; if (actionId == FORCE_DEPLY_ON) { } -- 2.43.0 From db7f7bdae2f7670184feca973b2a1f349a1286ee Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 13 Oct 2022 15:09:47 +0200 Subject: [PATCH 14/97] continue SA DEPL impl --- .../devices/SolarArrayDeploymentHandler.cpp | 126 ++++++++++-------- mission/devices/SolarArrayDeploymentHandler.h | 30 ++++- 2 files changed, 94 insertions(+), 62 deletions(-) diff --git a/mission/devices/SolarArrayDeploymentHandler.cpp b/mission/devices/SolarArrayDeploymentHandler.cpp index 90054ecc..41d7ddbb 100644 --- a/mission/devices/SolarArrayDeploymentHandler.cpp +++ b/mission/devices/SolarArrayDeploymentHandler.cpp @@ -142,7 +142,7 @@ bool SolarArrayDeploymentHandler::autonomousDeplForFile(const char* filename) { lineNum++; } bool updateUptime = false; - if(opDivider.checkAndIncrement()) { + if (opDivider.checkAndIncrement()) { if (initUptime) { secsSinceBoot = initUptime.value(); } @@ -158,21 +158,21 @@ bool SolarArrayDeploymentHandler::autonomousDeplForFile(const char* filename) { startFsm(false, false); } } - if(stateSwitch or updateUptime) { - std::ofstream of(filename); - of << "phase: " ; - if(deplState == AutonomousDeplState::INIT) { - of << PHASE_INIT_STR << "\n"; - } else if(deplState == AutonomousDeplState::FIRST_BURN) { - of << PHASE_FIRST_BURN_STR << "\n"; - } else if(deplState == AutonomousDeplState::WAIT) { - of << PHASE_WAIT_STR << "\n"; - } else if(deplState == AutonomousDeplState::SECOND_BURN) { - of << PHASE_SECOND_BURN_STR << "\n"; - } else if(deplState == AutonomousDeplState::DONE) { - of << PHASE_DONE<< "\n"; - } - of << "secs_since_start: " << std::to_string(secsSinceBoot) << "\n"; + if (stateSwitch or updateUptime) { + std::ofstream of(filename); + of << "phase: "; + if (deplState == AutonomousDeplState::INIT) { + of << PHASE_INIT_STR << "\n"; + } else if (deplState == AutonomousDeplState::FIRST_BURN) { + of << PHASE_FIRST_BURN_STR << "\n"; + } else if (deplState == AutonomousDeplState::WAIT) { + of << PHASE_WAIT_STR << "\n"; + } else if (deplState == AutonomousDeplState::SECOND_BURN) { + of << PHASE_SECOND_BURN_STR << "\n"; + } else if (deplState == AutonomousDeplState::DONE) { + of << PHASE_DONE << "\n"; + } + of << "secs_since_start: " << std::to_string(secsSinceBoot) << "\n"; } return true; } @@ -192,8 +192,9 @@ void SolarArrayDeploymentHandler::handleStateMachine() { stateMachine = WAIT_MAIN_POWER_ON; } if (stateMachine == MAIN_POWER_OFF) { - // This should never fail - deploymentTransistorsOff(); + // These should never fail + deploymentTransistorsOff(DeploymentChannels::SA_1); + deploymentTransistorsOff(DeploymentChannels::SA_2); mainLineSwitcher.sendSwitchCommand(mainLineSwitch, PowerSwitchIF::SWITCH_ON); mainSwitchCountdown.setTimeout(mainLineSwitcher.getSwitchDelayMs()); stateMachine = WAIT_MAIN_POWER_OFF; @@ -210,7 +211,7 @@ void SolarArrayDeploymentHandler::handleStateMachine() { } if (stateMachine == SWITCH_DEPL_GPIOS) { // This should never fail - deploymentTransistorsOn(); + // deploymentTransistorsOn(); finishFsm(returnvalue::OK); } } @@ -262,42 +263,50 @@ void SolarArrayDeploymentHandler::finishFsm(ReturnValue_t resultForActionHelper) } } -ReturnValue_t SolarArrayDeploymentHandler::deploymentTransistorsOn() { - ReturnValue_t result = gpioInterface.pullHigh(deplSA1); - if (result != returnvalue::OK) { - sif::debug << "SolarArrayDeploymentHandler::handleStateMachine: Failed to pull solar" - " array deployment switch 1 high " - << std::endl; - // If gpio switch high failed, state machine is reset to wait for a command re-initiating - // the deployment sequence. - triggerEvent(DEPL_SA1_GPIO_SWTICH_ON_FAILED); - } - result = gpioInterface.pullHigh(deplSA2); - if (result != returnvalue::OK) { - sif::debug << "SolarArrayDeploymentHandler::handleStateMachine: Failed to pull solar" - " array deployment switch 2 high " - << std::endl; - triggerEvent(DEPL_SA2_GPIO_SWTICH_ON_FAILED); +ReturnValue_t SolarArrayDeploymentHandler::deploymentTransistorsOn(DeploymentChannels channel) { + ReturnValue_t result = returnvalue::FAILED; + if (channel == DeploymentChannels::SA_1) { + result = gpioInterface.pullHigh(deplSA1); + if (result != returnvalue::OK) { + sif::debug << "SolarArrayDeploymentHandler::handleStateMachine: Failed to pull solar" + " array deployment switch 1 high " + << std::endl; + // If gpio switch high failed, state machine is reset to wait for a command re-initiating + // the deployment sequence. + triggerEvent(DEPL_SA1_GPIO_SWTICH_ON_FAILED); + } + } else if (channel == DeploymentChannels::SA_2) { + result = gpioInterface.pullHigh(deplSA2); + if (result != returnvalue::OK) { + sif::debug << "SolarArrayDeploymentHandler::handleStateMachine: Failed to pull solar" + " array deployment switch 2 high " + << std::endl; + triggerEvent(DEPL_SA2_GPIO_SWTICH_ON_FAILED); + } } return result; } -ReturnValue_t SolarArrayDeploymentHandler::deploymentTransistorsOff() { - ReturnValue_t result = gpioInterface.pullLow(deplSA1); - if (result != returnvalue::OK) { - sif::debug << "SolarArrayDeploymentHandler::handleStateMachine: Failed to pull solar" - " array deployment switch 1 low" - << std::endl; - // If gpio switch high failed, state machine is reset to wait for a command re-initiating - // the deployment sequence. - triggerEvent(DEPL_SA1_GPIO_SWTICH_ON_FAILED); - } - result = gpioInterface.pullLow(deplSA2); - if (result != returnvalue::OK) { - sif::debug << "SolarArrayDeploymentHandler::handleStateMachine: Failed to pull solar" - " array deployment switch 2 low" - << std::endl; - triggerEvent(DEPL_SA2_GPIO_SWTICH_ON_FAILED); +ReturnValue_t SolarArrayDeploymentHandler::deploymentTransistorsOff(DeploymentChannels channel) { + ReturnValue_t result = returnvalue::FAILED; + if (channel == DeploymentChannels::SA_1) { + result = gpioInterface.pullLow(deplSA1); + if (result != returnvalue::OK) { + sif::debug << "SolarArrayDeploymentHandler::handleStateMachine: Failed to pull solar" + " array deployment switch 1 high " + << std::endl; + // If gpio switch high failed, state machine is reset to wait for a command re-initiating + // the deployment sequence. + triggerEvent(DEPL_SA1_GPIO_SWTICH_OFF_FAILED); + } + } else if (channel == DeploymentChannels::SA_2) { + result = gpioInterface.pullLow(deplSA2); + if (result != returnvalue::OK) { + sif::debug << "SolarArrayDeploymentHandler::handleStateMachine: Failed to pull solar" + " array deployment switch 2 high " + << std::endl; + triggerEvent(DEPL_SA2_GPIO_SWTICH_OFF_FAILED); + } } return result; } @@ -318,13 +327,18 @@ void SolarArrayDeploymentHandler::readCommandQueue() { ReturnValue_t SolarArrayDeploymentHandler::executeAction(ActionId_t actionId, MessageQueueId_t commandedBy, const uint8_t* data, size_t size) { - // TODO: Finish command handling ReturnValue_t result = returnvalue::OK; - if (actionId == FORCE_DEPLY_ON) { - } - if (actionId == FORCE_DEPLY_OFF) { - } if (actionId == DEPLOY_SOLAR_ARRAYS_MANUALLY) { + ManualDeploymentCommand cmd; + if (size < cmd.getSerializedSize()) { + return HasActionsIF::INVALID_PARAMETERS; + } + result = cmd.deSerialize(&data, &size, SerializeIF::Endianness::NETWORK); + if (result != returnvalue::OK) { + return result; + } + } else { + return HasActionsIF::INVALID_ACTION_ID; } return result; } diff --git a/mission/devices/SolarArrayDeploymentHandler.h b/mission/devices/SolarArrayDeploymentHandler.h index 019c6bf6..d4f859a5 100644 --- a/mission/devices/SolarArrayDeploymentHandler.h +++ b/mission/devices/SolarArrayDeploymentHandler.h @@ -2,6 +2,7 @@ #define MISSION_DEVICES_SOLARARRAYDEPLOYMENT_H_ #include + #include #include "devices/powerSwitcherList.h" @@ -13,12 +14,30 @@ #include "fsfw/objectmanager/SystemObject.h" #include "fsfw/power/PowerSwitchIF.h" #include "fsfw/returnvalues/returnvalue.h" +#include "fsfw/serialize/SerialLinkedListAdapter.h" #include "fsfw/tasks/ExecutableObjectIF.h" #include "fsfw/timemanager/Countdown.h" #include "fsfw_hal/common/gpio/GpioIF.h" #include "mission/memory/SdCardMountedIF.h" #include "returnvalues/classIds.h" +enum DeploymentChannels : uint8_t { SA_1 = 1, SA_2 = 2 }; + +class ManualDeploymentCommand : SerialLinkedListAdapter { + public: + ManualDeploymentCommand() = default; + + void setLinks() { + setStart(&burnTime); + burnTime.setNext(&channel); + } + + private: + SerializeElement burnTime; + // Deployment channel SA1 or SA2 + SerializeElement channel; +}; + /** * @brief This class is used to control the solar array deployment. * @@ -28,11 +47,8 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, public SystemObject, public HasActionsIF { public: - // Burn them for a custom amount limited by 120 secs + //! Manual deployment of the solar arrays. Burn time and channels are supplied with TC parameters static constexpr DeviceCommandId_t DEPLOY_SOLAR_ARRAYS_MANUALLY = 0x05; - // Careful with these command, not automatic off handling! - static constexpr DeviceCommandId_t FORCE_DEPLY_ON = 0x06; - static constexpr DeviceCommandId_t FORCE_DEPLY_OFF = 0x07; static constexpr uint32_t FIRST_BURN_START_TIME = config::SA_DEPL_BURN_TIME_SECS; static constexpr uint32_t FIRST_BURN_END_TIME = @@ -95,6 +111,8 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, static const Event DEPLOYMENT_FAILED = MAKE_EVENT(2, severity::HIGH); static const Event DEPL_SA1_GPIO_SWTICH_ON_FAILED = MAKE_EVENT(3, severity::HIGH); static const Event DEPL_SA2_GPIO_SWTICH_ON_FAILED = MAKE_EVENT(4, severity::HIGH); + static const Event DEPL_SA1_GPIO_SWTICH_OFF_FAILED = MAKE_EVENT(5, severity::HIGH); + static const Event DEPL_SA2_GPIO_SWTICH_OFF_FAILED = MAKE_EVENT(6, severity::HIGH); enum AutonomousDeplState { INIT, FIRST_BURN, WAIT, SECOND_BURN, DONE }; enum StateMachine { @@ -178,8 +196,8 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, /** * @brief This functions handles the switching of the solar array deployment transistors. */ - ReturnValue_t deploymentTransistorsOn(); - ReturnValue_t deploymentTransistorsOff(); + ReturnValue_t deploymentTransistorsOn(DeploymentChannels channel); + ReturnValue_t deploymentTransistorsOff(DeploymentChannels channel); }; #endif /* MISSION_DEVICES_SOLARARRAYDEPLOYMENT_H_ */ -- 2.43.0 From 18e8827a849758fdab03240e04ba71799ad6aec3 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 13 Oct 2022 15:13:19 +0200 Subject: [PATCH 15/97] add missing public keyword --- mission/devices/SolarArrayDeploymentHandler.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mission/devices/SolarArrayDeploymentHandler.h b/mission/devices/SolarArrayDeploymentHandler.h index d4f859a5..5a627ea0 100644 --- a/mission/devices/SolarArrayDeploymentHandler.h +++ b/mission/devices/SolarArrayDeploymentHandler.h @@ -23,7 +23,7 @@ enum DeploymentChannels : uint8_t { SA_1 = 1, SA_2 = 2 }; -class ManualDeploymentCommand : SerialLinkedListAdapter { +class ManualDeploymentCommand : public SerialLinkedListAdapter { public: ManualDeploymentCommand() = default; -- 2.43.0 From 0ebd0a0c0bfb2a3991e30df8ed796e36815ebcca Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 13 Oct 2022 15:59:56 +0200 Subject: [PATCH 16/97] completed impl --- common/config/eive/definitions.h | 3 + .../devices/SolarArrayDeploymentHandler.cpp | 70 +++++++++++++++---- mission/devices/SolarArrayDeploymentHandler.h | 29 ++++++-- 3 files changed, 86 insertions(+), 16 deletions(-) diff --git a/common/config/eive/definitions.h b/common/config/eive/definitions.h index fb941edc..cd23b382 100644 --- a/common/config/eive/definitions.h +++ b/common/config/eive/definitions.h @@ -35,8 +35,11 @@ static constexpr uint32_t MAX_PATH_SIZE = 100; static constexpr uint32_t MAX_FILENAME_SIZE = 50; static constexpr uint32_t SA_DEPL_INIT_BUFFER_SECS = 120; +// Burn time for autonomous deployment static constexpr uint32_t SA_DEPL_BURN_TIME_SECS = 90; static constexpr uint32_t SA_DEPL_WAIT_TIME_SECS = 45 * 60; +// Maximum allowed burn time allowed by the software. +static constexpr uint32_t SA_DEPL_MAX_BURN_TIME = 120; } // namespace config diff --git a/mission/devices/SolarArrayDeploymentHandler.cpp b/mission/devices/SolarArrayDeploymentHandler.cpp index 41d7ddbb..567d9353 100644 --- a/mission/devices/SolarArrayDeploymentHandler.cpp +++ b/mission/devices/SolarArrayDeploymentHandler.cpp @@ -153,9 +153,12 @@ bool SolarArrayDeploymentHandler::autonomousDeplForFile(const char* filename) { if (stateSwitch) { if (deplState == AutonomousDeplState::FIRST_BURN or deplState == AutonomousDeplState::SECOND_BURN) { - startFsm(true, true); + // TODO: Update to be channel specific + // startFsmOn(channel, config::SA_DEPL_BURN_TIME_SECS); + //startFsm(true, true); } else if (deplState == AutonomousDeplState::WAIT or deplState == AutonomousDeplState::DONE) { - startFsm(false, false); + startFsmOff(); + //startFsm(false, false); } } if (stateSwitch or updateUptime) { @@ -193,10 +196,7 @@ void SolarArrayDeploymentHandler::handleStateMachine() { } if (stateMachine == MAIN_POWER_OFF) { // These should never fail - deploymentTransistorsOff(DeploymentChannels::SA_1); - deploymentTransistorsOff(DeploymentChannels::SA_2); - mainLineSwitcher.sendSwitchCommand(mainLineSwitch, PowerSwitchIF::SWITCH_ON); - mainSwitchCountdown.setTimeout(mainLineSwitcher.getSwitchDelayMs()); + allOff(); stateMachine = WAIT_MAIN_POWER_OFF; } if (stateMachine == WAIT_MAIN_POWER_ON) { @@ -211,8 +211,15 @@ void SolarArrayDeploymentHandler::handleStateMachine() { } if (stateMachine == SWITCH_DEPL_GPIOS) { // This should never fail - // deploymentTransistorsOn(); - finishFsm(returnvalue::OK); + deploymentTransistorsOn(fsmInfo.channel); + burnCountdown.setTimeout(fsmInfo.burnCountdown); + stateMachine = CHANNEL_ON; + } + if(stateMachine == CHANNEL_ON) { + if(burnCountdown.hasTimedOut()) { + allOff(); + stateMachine = WAIT_MAIN_POWER_OFF; + } } } @@ -246,20 +253,39 @@ bool SolarArrayDeploymentHandler::checkMainPower(bool onOff) { return false; } -bool SolarArrayDeploymentHandler::startFsm(std::optional sa1OnOff, - std::optional sa2OnOff) { - if ((stateMachine != StateMachine::IDLE) or (not sa1OnOff and not sa2OnOff)) { +bool SolarArrayDeploymentHandler::startFsmOn(DeploymentChannels channel, uint32_t burnCountdown_) { + if (stateMachine != StateMachine::IDLE) { return false; } + if(burnCountdown_ > config::SA_DEPL_MAX_BURN_TIME) { + burnCountdown_ = config::SA_DEPL_MAX_BURN_TIME; + } + fsmInfo.onOff = true; + fsmInfo.channel = channel; + fsmInfo.burnCountdown = burnCountdown_; retryCounter = 0; return true; } +void SolarArrayDeploymentHandler::startFsmOff() { + if(stateMachine != StateMachine::IDLE) { + // off commands override the state machine. Cancel any active action commands. + finishFsm(returnvalue::FAILED); + } + fsmInfo.onOff = false; + retryCounter = 0; + stateMachine = StateMachine::MAIN_POWER_ON; +} + void SolarArrayDeploymentHandler::finishFsm(ReturnValue_t resultForActionHelper) { retryCounter = 0; stateMachine = StateMachine::IDLE; if (actionActive) { - actionHelper.finish(true, rememberCommanderId, activeCmd, resultForActionHelper); + bool success = false; + if(resultForActionHelper == returnvalue::OK or resultForActionHelper == HasActionsIF::EXECUTION_FINISHED) { + success = true; + } + actionHelper.finish(success, rememberCommanderId, activeCmd, resultForActionHelper); } } @@ -287,6 +313,13 @@ ReturnValue_t SolarArrayDeploymentHandler::deploymentTransistorsOn(DeploymentCha return result; } +void SolarArrayDeploymentHandler::allOff() { + deploymentTransistorsOff(DeploymentChannels::SA_1); + deploymentTransistorsOff(DeploymentChannels::SA_2); + mainLineSwitcher.sendSwitchCommand(mainLineSwitch, PowerSwitchIF::SWITCH_OFF); + mainSwitchCountdown.setTimeout(mainLineSwitcher.getSwitchDelayMs()); +} + ReturnValue_t SolarArrayDeploymentHandler::deploymentTransistorsOff(DeploymentChannels channel) { ReturnValue_t result = returnvalue::FAILED; if (channel == DeploymentChannels::SA_1) { @@ -337,6 +370,19 @@ ReturnValue_t SolarArrayDeploymentHandler::executeAction(ActionId_t actionId, if (result != returnvalue::OK) { return result; } + uint32_t burnCountdown = cmd.getBurnTime(); + DeploymentChannels channel; + result = cmd.getChannel(channel); + if(result != returnvalue::OK) { + return result; + } + if (not startFsmOn(channel, burnCountdown)) { + return HasActionsIF::IS_BUSY; + } + return result; + } else if(actionId == SWITCH_OFF_DEPLOYMENT) { + startFsmOff(); + return result; } else { return HasActionsIF::INVALID_ACTION_ID; } diff --git a/mission/devices/SolarArrayDeploymentHandler.h b/mission/devices/SolarArrayDeploymentHandler.h index 5a627ea0..d8fb27ed 100644 --- a/mission/devices/SolarArrayDeploymentHandler.h +++ b/mission/devices/SolarArrayDeploymentHandler.h @@ -32,6 +32,18 @@ class ManualDeploymentCommand : public SerialLinkedListAdapter { burnTime.setNext(&channel); } + uint32_t getBurnTime() const { + return burnTime.entry; + } + + ReturnValue_t getChannel(DeploymentChannels& channel_) const { + if (channel.entry == 1 or channel.entry == 2) { + channel_ = static_cast(channel.entry); + return returnvalue::OK; + } + return HasActionsIF::INVALID_PARAMETERS; + } + private: SerializeElement burnTime; // Deployment channel SA1 or SA2 @@ -49,6 +61,7 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, public: //! Manual deployment of the solar arrays. Burn time and channels are supplied with TC parameters static constexpr DeviceCommandId_t DEPLOY_SOLAR_ARRAYS_MANUALLY = 0x05; + static constexpr DeviceCommandId_t SWITCH_OFF_DEPLOYMENT = 0x06; static constexpr uint32_t FIRST_BURN_START_TIME = config::SA_DEPL_BURN_TIME_SECS; static constexpr uint32_t FIRST_BURN_END_TIME = @@ -122,6 +135,7 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, WAIT_MAIN_POWER_ON, WAIT_MAIN_POWER_OFF, SWITCH_DEPL_GPIOS, + CHANNEL_ON }; StateMachine stateMachine = IDLE; @@ -130,13 +144,18 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, std::optional initUptime; PeriodicOperationDivider opDivider = PeriodicOperationDivider(5); uint8_t retryCounter = 3; + + bool startFsmOn(DeploymentChannels channel, uint32_t burnCountdown); + void startFsmOff(); + struct FsmInfo { + DeploymentChannels channel; // false if OFF, true is ON - bool sa1OnOff = false; - bool sa2OnOff = false; + bool onOff; + uint32_t burnCountdown = config::SA_DEPL_MAX_BURN_TIME; } fsmInfo; - bool startFsm(std::optional sa1OnOff, std::optional sa2OnOff); + void finishFsm(ReturnValue_t resultForActionHelper); ReturnValue_t performAutonomousDepl(sd::SdCard sdCard); @@ -149,7 +168,7 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, /** * This countdown is used to wait for the burn wire being successful cut. */ - Countdown deploymentCountdown; + Countdown burnCountdown; /** * The message queue id of the component commanding an action will be stored in this variable. @@ -193,6 +212,8 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, bool checkMainPowerOff(); bool checkMainPower(bool onOff); + void allOff(); + /** * @brief This functions handles the switching of the solar array deployment transistors. */ -- 2.43.0 From d97e0a1a6ac8730148841fe5423178708165bbb5 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 13 Oct 2022 16:04:34 +0200 Subject: [PATCH 17/97] update depl handler --- .../devices/SolarArrayDeploymentHandler.cpp | 23 +++++----- mission/devices/SolarArrayDeploymentHandler.h | 44 +++++++++---------- 2 files changed, 34 insertions(+), 33 deletions(-) diff --git a/mission/devices/SolarArrayDeploymentHandler.cpp b/mission/devices/SolarArrayDeploymentHandler.cpp index 567d9353..28922fd2 100644 --- a/mission/devices/SolarArrayDeploymentHandler.cpp +++ b/mission/devices/SolarArrayDeploymentHandler.cpp @@ -155,10 +155,10 @@ bool SolarArrayDeploymentHandler::autonomousDeplForFile(const char* filename) { deplState == AutonomousDeplState::SECOND_BURN) { // TODO: Update to be channel specific // startFsmOn(channel, config::SA_DEPL_BURN_TIME_SECS); - //startFsm(true, true); + // startFsm(true, true); } else if (deplState == AutonomousDeplState::WAIT or deplState == AutonomousDeplState::DONE) { startFsmOff(); - //startFsm(false, false); + // startFsm(false, false); } } if (stateSwitch or updateUptime) { @@ -215,8 +215,8 @@ void SolarArrayDeploymentHandler::handleStateMachine() { burnCountdown.setTimeout(fsmInfo.burnCountdown); stateMachine = CHANNEL_ON; } - if(stateMachine == CHANNEL_ON) { - if(burnCountdown.hasTimedOut()) { + if (stateMachine == CHANNEL_ON) { + if (burnCountdown.hasTimedOut()) { allOff(); stateMachine = WAIT_MAIN_POWER_OFF; } @@ -257,7 +257,7 @@ bool SolarArrayDeploymentHandler::startFsmOn(DeploymentChannels channel, uint32_ if (stateMachine != StateMachine::IDLE) { return false; } - if(burnCountdown_ > config::SA_DEPL_MAX_BURN_TIME) { + if (burnCountdown_ > config::SA_DEPL_MAX_BURN_TIME) { burnCountdown_ = config::SA_DEPL_MAX_BURN_TIME; } fsmInfo.onOff = true; @@ -268,7 +268,7 @@ bool SolarArrayDeploymentHandler::startFsmOn(DeploymentChannels channel, uint32_ } void SolarArrayDeploymentHandler::startFsmOff() { - if(stateMachine != StateMachine::IDLE) { + if (stateMachine != StateMachine::IDLE) { // off commands override the state machine. Cancel any active action commands. finishFsm(returnvalue::FAILED); } @@ -282,7 +282,8 @@ void SolarArrayDeploymentHandler::finishFsm(ReturnValue_t resultForActionHelper) stateMachine = StateMachine::IDLE; if (actionActive) { bool success = false; - if(resultForActionHelper == returnvalue::OK or resultForActionHelper == HasActionsIF::EXECUTION_FINISHED) { + if (resultForActionHelper == returnvalue::OK or + resultForActionHelper == HasActionsIF::EXECUTION_FINISHED) { success = true; } actionHelper.finish(success, rememberCommanderId, activeCmd, resultForActionHelper); @@ -373,16 +374,16 @@ ReturnValue_t SolarArrayDeploymentHandler::executeAction(ActionId_t actionId, uint32_t burnCountdown = cmd.getBurnTime(); DeploymentChannels channel; result = cmd.getChannel(channel); - if(result != returnvalue::OK) { + if (result != returnvalue::OK) { return result; } if (not startFsmOn(channel, burnCountdown)) { return HasActionsIF::IS_BUSY; } return result; - } else if(actionId == SWITCH_OFF_DEPLOYMENT) { - startFsmOff(); - return result; + } else if (actionId == SWITCH_OFF_DEPLOYMENT) { + startFsmOff(); + return result; } else { return HasActionsIF::INVALID_ACTION_ID; } diff --git a/mission/devices/SolarArrayDeploymentHandler.h b/mission/devices/SolarArrayDeploymentHandler.h index d8fb27ed..2d20606f 100644 --- a/mission/devices/SolarArrayDeploymentHandler.h +++ b/mission/devices/SolarArrayDeploymentHandler.h @@ -32,9 +32,7 @@ class ManualDeploymentCommand : public SerialLinkedListAdapter { burnTime.setNext(&channel); } - uint32_t getBurnTime() const { - return burnTime.entry; - } + uint32_t getBurnTime() const { return burnTime.entry; } ReturnValue_t getChannel(DeploymentChannels& channel_) const { if (channel.entry == 1 or channel.entry == 2) { @@ -111,6 +109,26 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, virtual ReturnValue_t initialize() override; private: + enum AutonomousDeplState { INIT, FIRST_BURN, WAIT, SECOND_BURN, DONE }; + + enum StateMachine { + IDLE, + MAIN_POWER_ON, + MAIN_POWER_OFF, + WAIT_MAIN_POWER_ON, + WAIT_MAIN_POWER_OFF, + SWITCH_DEPL_GPIOS, + CHANNEL_ON + }; + + struct FsmInfo { + DeploymentChannels channel; + // false if OFF, true is ON + bool onOff; + bool dryRun; + uint32_t burnCountdown = config::SA_DEPL_MAX_BURN_TIME; + }; + static const uint8_t INTERFACE_ID = CLASS_ID::SA_DEPL_HANDLER; static const ReturnValue_t COMMAND_NOT_SUPPORTED = MAKE_RETURN_CODE(0xA0); static const ReturnValue_t DEPLOYMENT_ALREADY_EXECUTING = MAKE_RETURN_CODE(0xA1); @@ -127,17 +145,7 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, static const Event DEPL_SA1_GPIO_SWTICH_OFF_FAILED = MAKE_EVENT(5, severity::HIGH); static const Event DEPL_SA2_GPIO_SWTICH_OFF_FAILED = MAKE_EVENT(6, severity::HIGH); - enum AutonomousDeplState { INIT, FIRST_BURN, WAIT, SECOND_BURN, DONE }; - enum StateMachine { - IDLE, - MAIN_POWER_ON, - MAIN_POWER_OFF, - WAIT_MAIN_POWER_ON, - WAIT_MAIN_POWER_OFF, - SWITCH_DEPL_GPIOS, - CHANNEL_ON - }; - + FsmInfo fsmInfo; StateMachine stateMachine = IDLE; bool actionActive = false; ActionId_t activeCmd = HasActionsIF::INVALID_ACTION_ID; @@ -148,14 +156,6 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, bool startFsmOn(DeploymentChannels channel, uint32_t burnCountdown); void startFsmOff(); - struct FsmInfo { - DeploymentChannels channel; - // false if OFF, true is ON - bool onOff; - uint32_t burnCountdown = config::SA_DEPL_MAX_BURN_TIME; - } fsmInfo; - - void finishFsm(ReturnValue_t resultForActionHelper); ReturnValue_t performAutonomousDepl(sd::SdCard sdCard); -- 2.43.0 From 773747dd54e34c929ef4a348047554e506fe3694 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 13 Oct 2022 17:34:33 +0200 Subject: [PATCH 18/97] implemented alternating GPIO SA Deployment --- common/config/eive/definitions.h | 4 +- .../devices/SolarArrayDeploymentHandler.cpp | 190 ++++++++++++------ mission/devices/SolarArrayDeploymentHandler.h | 31 ++- tmtc | 2 +- 4 files changed, 152 insertions(+), 75 deletions(-) diff --git a/common/config/eive/definitions.h b/common/config/eive/definitions.h index cd23b382..81792c20 100644 --- a/common/config/eive/definitions.h +++ b/common/config/eive/definitions.h @@ -36,8 +36,10 @@ static constexpr uint32_t MAX_FILENAME_SIZE = 50; static constexpr uint32_t SA_DEPL_INIT_BUFFER_SECS = 120; // Burn time for autonomous deployment -static constexpr uint32_t SA_DEPL_BURN_TIME_SECS = 90; +static constexpr uint32_t SA_DEPL_BURN_TIME_SECS = 180; static constexpr uint32_t SA_DEPL_WAIT_TIME_SECS = 45 * 60; +// HW constraints (current limit) mean that the GPIO channels need to be switched on in alternation +static constexpr uint32_t SA_DEPL_CHANNEL_ALTERNATION_INTERVAL_SECS = 5; // Maximum allowed burn time allowed by the software. static constexpr uint32_t SA_DEPL_MAX_BURN_TIME = 120; diff --git a/mission/devices/SolarArrayDeploymentHandler.cpp b/mission/devices/SolarArrayDeploymentHandler.cpp index 28922fd2..21d01ce7 100644 --- a/mission/devices/SolarArrayDeploymentHandler.cpp +++ b/mission/devices/SolarArrayDeploymentHandler.cpp @@ -37,13 +37,13 @@ ReturnValue_t SolarArrayDeploymentHandler::performOperation(uint8_t operationCod sdcMan.isSdCardUsable(activeSdc.value())) { if (exists(SD_0_DEPL_FILE)) { // perform autonomous deployment handling - performAutonomousDepl(sd::SdCard::SLOT_0); + performAutonomousDepl(sd::SdCard::SLOT_0, dryRunStringInFile(SD_0_DEPL_FILE)); } } else if (activeSdc and activeSdc.value() == sd::SdCard::SLOT_1 and sdcMan.isSdCardUsable(activeSdc.value())) { if (exists(SD_1_DEPL_FILE)) { // perform autonomous deployment handling - performAutonomousDepl(sd::SdCard::SLOT_1); + performAutonomousDepl(sd::SdCard::SLOT_1, dryRunStringInFile(SD_1_DEPL_FILE)); } } readCommandQueue(); @@ -51,7 +51,7 @@ ReturnValue_t SolarArrayDeploymentHandler::performOperation(uint8_t operationCod return returnvalue::OK; } -ReturnValue_t SolarArrayDeploymentHandler::performAutonomousDepl(sd::SdCard sdCard) { +ReturnValue_t SolarArrayDeploymentHandler::performAutonomousDepl(sd::SdCard sdCard, bool dryRun) { using namespace std::filesystem; using namespace std; auto initFile = [](const char* filename) { @@ -63,21 +63,21 @@ ReturnValue_t SolarArrayDeploymentHandler::performAutonomousDepl(sd::SdCard sdCa if (not exists(SD_0_DEPLY_INFO)) { initFile(SD_0_DEPLY_INFO); } - if (not autonomousDeplForFile(SD_0_DEPLY_INFO)) { + if (not autonomousDeplForFile(SD_0_DEPLY_INFO, dryRun)) { initFile(SD_0_DEPLY_INFO); } } else if (sdCard == sd::SdCard::SLOT_1) { if (not exists(SD_1_DEPLY_INFO)) { initFile(SD_1_DEPLY_INFO); } - if (not autonomousDeplForFile(SD_1_DEPLY_INFO)) { + if (not autonomousDeplForFile(SD_1_DEPLY_INFO, dryRun)) { initFile(SD_1_DEPLY_INFO); } } return returnvalue::OK; } -bool SolarArrayDeploymentHandler::autonomousDeplForFile(const char* filename) { +bool SolarArrayDeploymentHandler::autonomousDeplForFile(const char* filename, bool dryRun) { using namespace std; ifstream file(filename); string line; @@ -153,9 +153,8 @@ bool SolarArrayDeploymentHandler::autonomousDeplForFile(const char* filename) { if (stateSwitch) { if (deplState == AutonomousDeplState::FIRST_BURN or deplState == AutonomousDeplState::SECOND_BURN) { - // TODO: Update to be channel specific - // startFsmOn(channel, config::SA_DEPL_BURN_TIME_SECS); - // startFsm(true, true); + // TODO: Update whole procedure to work for both channels + startFsmOn(config::SA_DEPL_BURN_TIME_SECS, dryRun); } else if (deplState == AutonomousDeplState::WAIT or deplState == AutonomousDeplState::DONE) { startFsmOff(); // startFsm(false, false); @@ -210,12 +209,20 @@ void SolarArrayDeploymentHandler::handleStateMachine() { } } if (stateMachine == SWITCH_DEPL_GPIOS) { - // This should never fail - deploymentTransistorsOn(fsmInfo.channel); burnCountdown.setTimeout(fsmInfo.burnCountdown); - stateMachine = CHANNEL_ON; + // This should never fail + if (not fsmInfo.dryRun) { + channelAlternationCd.resetTimer(); + sa2Off(); + sa1On(); + fsmInfo.alternationDummy = true; + } + stateMachine = BURNING; } - if (stateMachine == CHANNEL_ON) { + if (stateMachine == BURNING) { + if (not fsmInfo.dryRun) { + saGpioAlternation(); + } if (burnCountdown.hasTimedOut()) { allOff(); stateMachine = WAIT_MAIN_POWER_OFF; @@ -253,7 +260,7 @@ bool SolarArrayDeploymentHandler::checkMainPower(bool onOff) { return false; } -bool SolarArrayDeploymentHandler::startFsmOn(DeploymentChannels channel, uint32_t burnCountdown_) { +bool SolarArrayDeploymentHandler::startFsmOn(uint32_t burnCountdown_, bool dryRun) { if (stateMachine != StateMachine::IDLE) { return false; } @@ -261,7 +268,7 @@ bool SolarArrayDeploymentHandler::startFsmOn(DeploymentChannels channel, uint32_ burnCountdown_ = config::SA_DEPL_MAX_BURN_TIME; } fsmInfo.onOff = true; - fsmInfo.channel = channel; + fsmInfo.dryRun = dryRun; fsmInfo.burnCountdown = burnCountdown_; retryCounter = 0; return true; @@ -290,59 +297,24 @@ void SolarArrayDeploymentHandler::finishFsm(ReturnValue_t resultForActionHelper) } } -ReturnValue_t SolarArrayDeploymentHandler::deploymentTransistorsOn(DeploymentChannels channel) { - ReturnValue_t result = returnvalue::FAILED; - if (channel == DeploymentChannels::SA_1) { - result = gpioInterface.pullHigh(deplSA1); - if (result != returnvalue::OK) { - sif::debug << "SolarArrayDeploymentHandler::handleStateMachine: Failed to pull solar" - " array deployment switch 1 high " - << std::endl; - // If gpio switch high failed, state machine is reset to wait for a command re-initiating - // the deployment sequence. - triggerEvent(DEPL_SA1_GPIO_SWTICH_ON_FAILED); - } - } else if (channel == DeploymentChannels::SA_2) { - result = gpioInterface.pullHigh(deplSA2); - if (result != returnvalue::OK) { - sif::debug << "SolarArrayDeploymentHandler::handleStateMachine: Failed to pull solar" - " array deployment switch 2 high " - << std::endl; - triggerEvent(DEPL_SA2_GPIO_SWTICH_ON_FAILED); - } - } - return result; -} - void SolarArrayDeploymentHandler::allOff() { - deploymentTransistorsOff(DeploymentChannels::SA_1); - deploymentTransistorsOff(DeploymentChannels::SA_2); + deploymentTransistorsOff(); mainLineSwitcher.sendSwitchCommand(mainLineSwitch, PowerSwitchIF::SWITCH_OFF); mainSwitchCountdown.setTimeout(mainLineSwitcher.getSwitchDelayMs()); } -ReturnValue_t SolarArrayDeploymentHandler::deploymentTransistorsOff(DeploymentChannels channel) { - ReturnValue_t result = returnvalue::FAILED; - if (channel == DeploymentChannels::SA_1) { - result = gpioInterface.pullLow(deplSA1); - if (result != returnvalue::OK) { - sif::debug << "SolarArrayDeploymentHandler::handleStateMachine: Failed to pull solar" - " array deployment switch 1 high " - << std::endl; - // If gpio switch high failed, state machine is reset to wait for a command re-initiating - // the deployment sequence. - triggerEvent(DEPL_SA1_GPIO_SWTICH_OFF_FAILED); - } - } else if (channel == DeploymentChannels::SA_2) { - result = gpioInterface.pullLow(deplSA2); - if (result != returnvalue::OK) { - sif::debug << "SolarArrayDeploymentHandler::handleStateMachine: Failed to pull solar" - " array deployment switch 2 high " - << std::endl; - triggerEvent(DEPL_SA2_GPIO_SWTICH_OFF_FAILED); +bool SolarArrayDeploymentHandler::dryRunStringInFile(const char* filename) { + std::ifstream ifile(filename); + if (ifile.bad()) { + return false; + } + std::string line; + while (getline(ifile, line)) { + if (line.find("dryrun") != std::string::npos) { + return true; } } - return result; + return false; } void SolarArrayDeploymentHandler::readCommandQueue() { @@ -377,7 +349,7 @@ ReturnValue_t SolarArrayDeploymentHandler::executeAction(ActionId_t actionId, if (result != returnvalue::OK) { return result; } - if (not startFsmOn(channel, burnCountdown)) { + if (not startFsmOn(burnCountdown, cmd.isDryRun())) { return HasActionsIF::IS_BUSY; } return result; @@ -390,6 +362,100 @@ ReturnValue_t SolarArrayDeploymentHandler::executeAction(ActionId_t actionId, return result; } +ReturnValue_t SolarArrayDeploymentHandler::saGpioAlternation() { + ReturnValue_t status = returnvalue::OK; + ReturnValue_t result; + if (channelAlternationCd.hasTimedOut()) { + if (fsmInfo.alternationDummy) { + result = sa1Off(); + if (result != returnvalue::OK) { + status = result; + } + result = sa2On(); + if (result != returnvalue::OK) { + status = result; + } + } else { + result = sa1On(); + if (result != returnvalue::OK) { + status = result; + } + result = sa2Off(); + if (result != returnvalue::OK) { + status = result; + } + } + fsmInfo.alternationDummy = not fsmInfo.alternationDummy; + channelAlternationCd.resetTimer(); + } + return status; +} + +ReturnValue_t SolarArrayDeploymentHandler::deploymentTransistorsOff() { + ReturnValue_t status = returnvalue::OK; + ReturnValue_t result = sa1Off(); + if (result != returnvalue::OK) { + status = result; + } + result = sa2Off(); + if (result != returnvalue::OK) { + status = result; + } + return status; +} + +ReturnValue_t SolarArrayDeploymentHandler::sa1On() { + ReturnValue_t result = gpioInterface.pullHigh(deplSA1); + if (result != returnvalue::OK) { + sif::warning << "SolarArrayDeploymentHandler::handleStateMachine: Failed to pull solar" + " array deployment switch 1 high" + << std::endl; + // If gpio switch high failed, state machine is reset to wait for a command re-initiating + // the deployment sequence. + triggerEvent(DEPL_SA1_GPIO_SWTICH_ON_FAILED); + } + return result; +} + +ReturnValue_t SolarArrayDeploymentHandler::sa1Off() { + ReturnValue_t result = gpioInterface.pullLow(deplSA1); + if (result != returnvalue::OK) { + sif::warning << "SolarArrayDeploymentHandler::handleStateMachine: Failed to pull solar" + " array deployment switch 1 low" + << std::endl; + // If gpio switch high failed, state machine is reset to wait for a command re-initiating + // the deployment sequence. + triggerEvent(DEPL_SA1_GPIO_SWTICH_OFF_FAILED); + } + return result; +} + +ReturnValue_t SolarArrayDeploymentHandler::sa2On() { + ReturnValue_t result = gpioInterface.pullHigh(deplSA2); + if (result != returnvalue::OK) { + sif::warning << "SolarArrayDeploymentHandler::handleStateMachine: Failed to pull solar" + " array deployment switch 2 high" + << std::endl; + // If gpio switch high failed, state machine is reset to wait for a command re-initiating + // the deployment sequence. + triggerEvent(DEPL_SA2_GPIO_SWTICH_ON_FAILED); + } + return result; +} + +ReturnValue_t SolarArrayDeploymentHandler::sa2Off() { + ReturnValue_t result = gpioInterface.pullLow(deplSA2); + if (result != returnvalue::OK) { + sif::warning << "SolarArrayDeploymentHandler::handleStateMachine: Failed to pull solar" + " array deployment switch 2 low" + << std::endl; + // If gpio switch high failed, state machine is reset to wait for a command re-initiating + // the deployment sequence. + triggerEvent(DEPL_SA2_GPIO_SWTICH_OFF_FAILED); + } + return result; +} + MessageQueueId_t SolarArrayDeploymentHandler::getCommandQueue() const { return commandQueue->getId(); } diff --git a/mission/devices/SolarArrayDeploymentHandler.h b/mission/devices/SolarArrayDeploymentHandler.h index 2d20606f..08fd4b47 100644 --- a/mission/devices/SolarArrayDeploymentHandler.h +++ b/mission/devices/SolarArrayDeploymentHandler.h @@ -42,10 +42,13 @@ class ManualDeploymentCommand : public SerialLinkedListAdapter { return HasActionsIF::INVALID_PARAMETERS; } + bool isDryRun() const { return dryRun.entry; } + private: SerializeElement burnTime; // Deployment channel SA1 or SA2 SerializeElement channel; + SerializeElement dryRun; }; /** @@ -61,7 +64,7 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, static constexpr DeviceCommandId_t DEPLOY_SOLAR_ARRAYS_MANUALLY = 0x05; static constexpr DeviceCommandId_t SWITCH_OFF_DEPLOYMENT = 0x06; - static constexpr uint32_t FIRST_BURN_START_TIME = config::SA_DEPL_BURN_TIME_SECS; + static constexpr uint32_t FIRST_BURN_START_TIME = config::SA_DEPL_INIT_BUFFER_SECS; static constexpr uint32_t FIRST_BURN_END_TIME = FIRST_BURN_START_TIME + config::SA_DEPL_BURN_TIME_SECS; static constexpr uint32_t WAIT_START_TIME = FIRST_BURN_END_TIME; @@ -118,14 +121,16 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, WAIT_MAIN_POWER_ON, WAIT_MAIN_POWER_OFF, SWITCH_DEPL_GPIOS, - CHANNEL_ON + BURNING }; struct FsmInfo { - DeploymentChannels channel; + // Not required anymore + // DeploymentChannels channel; // false if OFF, true is ON bool onOff; bool dryRun; + bool alternationDummy = false; uint32_t burnCountdown = config::SA_DEPL_MAX_BURN_TIME; }; @@ -153,13 +158,14 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, PeriodicOperationDivider opDivider = PeriodicOperationDivider(5); uint8_t retryCounter = 3; - bool startFsmOn(DeploymentChannels channel, uint32_t burnCountdown); + bool startFsmOn(uint32_t burnCountdown, bool dryRun); void startFsmOff(); void finishFsm(ReturnValue_t resultForActionHelper); - ReturnValue_t performAutonomousDepl(sd::SdCard sdCard); - bool autonomousDeplForFile(const char* filename); + ReturnValue_t performAutonomousDepl(sd::SdCard sdCard, bool dryRun); + bool dryRunStringInFile(const char* filename); + bool autonomousDeplForFile(const char* filename, bool dryRun); /** * This countdown is used to check if the PCDU sets the 8V line on in the intended time. */ @@ -170,6 +176,8 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, */ Countdown burnCountdown; + Countdown channelAlternationCd = Countdown(config::SA_DEPL_CHANNEL_ALTERNATION_INTERVAL_SECS); + /** * The message queue id of the component commanding an action will be stored in this variable. * This is necessary to send later the action finish replies. @@ -214,11 +222,12 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, void allOff(); - /** - * @brief This functions handles the switching of the solar array deployment transistors. - */ - ReturnValue_t deploymentTransistorsOn(DeploymentChannels channel); - ReturnValue_t deploymentTransistorsOff(DeploymentChannels channel); + ReturnValue_t deploymentTransistorsOff(); + ReturnValue_t saGpioAlternation(); + ReturnValue_t sa1On(); + ReturnValue_t sa1Off(); + ReturnValue_t sa2On(); + ReturnValue_t sa2Off(); }; #endif /* MISSION_DEVICES_SOLARARRAYDEPLOYMENT_H_ */ diff --git a/tmtc b/tmtc index 4c3f5f28..50abe69f 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 4c3f5f28256be0dbfc5b46ea87f8f484c93a9996 +Subproject commit 50abe69f261b7d2a3345d86bd7042514ff845fd3 -- 2.43.0 From f9ee01b02d61d324e5743e03d887eb75cf1d20d0 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 13 Oct 2022 17:35:57 +0200 Subject: [PATCH 19/97] removed TODO --- mission/devices/SolarArrayDeploymentHandler.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/mission/devices/SolarArrayDeploymentHandler.cpp b/mission/devices/SolarArrayDeploymentHandler.cpp index 21d01ce7..e350c803 100644 --- a/mission/devices/SolarArrayDeploymentHandler.cpp +++ b/mission/devices/SolarArrayDeploymentHandler.cpp @@ -153,11 +153,9 @@ bool SolarArrayDeploymentHandler::autonomousDeplForFile(const char* filename, bo if (stateSwitch) { if (deplState == AutonomousDeplState::FIRST_BURN or deplState == AutonomousDeplState::SECOND_BURN) { - // TODO: Update whole procedure to work for both channels startFsmOn(config::SA_DEPL_BURN_TIME_SECS, dryRun); } else if (deplState == AutonomousDeplState::WAIT or deplState == AutonomousDeplState::DONE) { startFsmOff(); - // startFsm(false, false); } } if (stateSwitch or updateUptime) { -- 2.43.0 From 0e8a085f979c6aaa072b052a8c0283bd15393b60 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 13 Oct 2022 17:48:32 +0200 Subject: [PATCH 20/97] add debug mode --- .../devices/SolarArrayDeploymentHandler.cpp | 73 ++++++++++++------- 1 file changed, 47 insertions(+), 26 deletions(-) diff --git a/mission/devices/SolarArrayDeploymentHandler.cpp b/mission/devices/SolarArrayDeploymentHandler.cpp index e350c803..92283749 100644 --- a/mission/devices/SolarArrayDeploymentHandler.cpp +++ b/mission/devices/SolarArrayDeploymentHandler.cpp @@ -9,6 +9,8 @@ #include "fsfw/objectmanager/ObjectManager.h" #include "fsfw_hal/common/gpio/GpioCookie.h" +static constexpr bool DEBUG_MODE = true; + SolarArrayDeploymentHandler::SolarArrayDeploymentHandler(object_id_t setObjectId_, GpioIF& gpioInterface, PowerSwitchIF& mainLineSwitcher_, @@ -177,51 +179,59 @@ bool SolarArrayDeploymentHandler::autonomousDeplForFile(const char* filename, bo return true; } -ReturnValue_t SolarArrayDeploymentHandler::initialize() { - ReturnValue_t result = actionHelper.initialize(commandQueue); - if (result != returnvalue::OK) { - return ObjectManagerIF::CHILD_INIT_FAILED; - } - return SystemObject::initialize(); -} - void SolarArrayDeploymentHandler::handleStateMachine() { if (stateMachine == MAIN_POWER_ON) { mainLineSwitcher.sendSwitchCommand(mainLineSwitch, PowerSwitchIF::SWITCH_ON); mainSwitchCountdown.setTimeout(mainLineSwitcher.getSwitchDelayMs()); stateMachine = WAIT_MAIN_POWER_ON; + if (DEBUG_MODE) { + sif::debug << "SA DEPL FSM: MAIN_POWER_ON done -> WAIT_MAIN_POWER_ON" << std::endl; + } } if (stateMachine == MAIN_POWER_OFF) { // These should never fail allOff(); stateMachine = WAIT_MAIN_POWER_OFF; + if (DEBUG_MODE) { + sif::debug << "SA DEPL FSM: MAIN_POWER_OFF done -> WAIT_MAIN_POWER_OFF" << std::endl; + } } if (stateMachine == WAIT_MAIN_POWER_ON) { if (checkMainPowerOn()) { + if (DEBUG_MODE) { + sif::debug << "SA DEPL FSM: WAIT_MAIN_POWER_ON done -> SWITCH_DEPL_GPIOS" << std::endl; + } stateMachine = SWITCH_DEPL_GPIOS; } } if (stateMachine == WAIT_MAIN_POWER_OFF) { if (checkMainPowerOff()) { + if (DEBUG_MODE) { + sif::debug << "SA DEPL FSM: WAIT_MAIN_POWER_OFF done -> FSM DONE" << std::endl; + } finishFsm(returnvalue::OK); } } if (stateMachine == SWITCH_DEPL_GPIOS) { burnCountdown.setTimeout(fsmInfo.burnCountdown); // This should never fail + channelAlternationCd.resetTimer(); if (not fsmInfo.dryRun) { - channelAlternationCd.resetTimer(); sa2Off(); sa1On(); fsmInfo.alternationDummy = true; } + if (DEBUG_MODE) { + sif::debug << "SA DEPL FSM: SWITCH_DEPL_GPIOS done -> BURNING" << std::endl; + } stateMachine = BURNING; } if (stateMachine == BURNING) { - if (not fsmInfo.dryRun) { - saGpioAlternation(); - } + saGpioAlternation(); if (burnCountdown.hasTimedOut()) { + if (DEBUG_MODE) { + sif::debug << "SA DEPL FSM: BURNING done -> WAIT_MAIN_POWER_OFF" << std::endl; + } allOff(); stateMachine = WAIT_MAIN_POWER_OFF; } @@ -285,6 +295,9 @@ void SolarArrayDeploymentHandler::startFsmOff() { void SolarArrayDeploymentHandler::finishFsm(ReturnValue_t resultForActionHelper) { retryCounter = 0; stateMachine = StateMachine::IDLE; + fsmInfo.dryRun = false; + fsmInfo.onOff = false; + fsmInfo.alternationDummy = false; if (actionActive) { bool success = false; if (resultForActionHelper == returnvalue::OK or @@ -315,19 +328,6 @@ bool SolarArrayDeploymentHandler::dryRunStringInFile(const char* filename) { return false; } -void SolarArrayDeploymentHandler::readCommandQueue() { - CommandMessage command; - ReturnValue_t result = commandQueue->receiveMessage(&command); - if (result != returnvalue::OK) { - return; - } - - result = actionHelper.handleActionMessage(&command); - if (result == returnvalue::OK) { - return; - } -} - ReturnValue_t SolarArrayDeploymentHandler::executeAction(ActionId_t actionId, MessageQueueId_t commandedBy, const uint8_t* data, size_t size) { @@ -363,7 +363,7 @@ ReturnValue_t SolarArrayDeploymentHandler::executeAction(ActionId_t actionId, ReturnValue_t SolarArrayDeploymentHandler::saGpioAlternation() { ReturnValue_t status = returnvalue::OK; ReturnValue_t result; - if (channelAlternationCd.hasTimedOut()) { + if (channelAlternationCd.hasTimedOut() and not fsmInfo.dryRun) { if (fsmInfo.alternationDummy) { result = sa1Off(); if (result != returnvalue::OK) { @@ -454,6 +454,27 @@ ReturnValue_t SolarArrayDeploymentHandler::sa2Off() { return result; } +void SolarArrayDeploymentHandler::readCommandQueue() { + CommandMessage command; + ReturnValue_t result = commandQueue->receiveMessage(&command); + if (result != returnvalue::OK) { + return; + } + + result = actionHelper.handleActionMessage(&command); + if (result == returnvalue::OK) { + return; + } +} + MessageQueueId_t SolarArrayDeploymentHandler::getCommandQueue() const { return commandQueue->getId(); } + +ReturnValue_t SolarArrayDeploymentHandler::initialize() { + ReturnValue_t result = actionHelper.initialize(commandQueue); + if (result != returnvalue::OK) { + return ObjectManagerIF::CHILD_INIT_FAILED; + } + return SystemObject::initialize(); +} -- 2.43.0 From a4bf47499efbaf1e785e0ce466035704919669b3 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 13 Oct 2022 18:11:05 +0200 Subject: [PATCH 21/97] remove channel param from cmd --- mission/devices/SolarArrayDeploymentHandler.cpp | 5 ----- mission/devices/SolarArrayDeploymentHandler.h | 12 +----------- tmtc | 2 +- 3 files changed, 2 insertions(+), 17 deletions(-) diff --git a/mission/devices/SolarArrayDeploymentHandler.cpp b/mission/devices/SolarArrayDeploymentHandler.cpp index 92283749..72bcace4 100644 --- a/mission/devices/SolarArrayDeploymentHandler.cpp +++ b/mission/devices/SolarArrayDeploymentHandler.cpp @@ -342,11 +342,6 @@ ReturnValue_t SolarArrayDeploymentHandler::executeAction(ActionId_t actionId, return result; } uint32_t burnCountdown = cmd.getBurnTime(); - DeploymentChannels channel; - result = cmd.getChannel(channel); - if (result != returnvalue::OK) { - return result; - } if (not startFsmOn(burnCountdown, cmd.isDryRun())) { return HasActionsIF::IS_BUSY; } diff --git a/mission/devices/SolarArrayDeploymentHandler.h b/mission/devices/SolarArrayDeploymentHandler.h index 08fd4b47..a5f56a5f 100644 --- a/mission/devices/SolarArrayDeploymentHandler.h +++ b/mission/devices/SolarArrayDeploymentHandler.h @@ -29,25 +29,15 @@ class ManualDeploymentCommand : public SerialLinkedListAdapter { void setLinks() { setStart(&burnTime); - burnTime.setNext(&channel); + burnTime.setNext(&dryRun); } uint32_t getBurnTime() const { return burnTime.entry; } - ReturnValue_t getChannel(DeploymentChannels& channel_) const { - if (channel.entry == 1 or channel.entry == 2) { - channel_ = static_cast(channel.entry); - return returnvalue::OK; - } - return HasActionsIF::INVALID_PARAMETERS; - } - bool isDryRun() const { return dryRun.entry; } private: SerializeElement burnTime; - // Deployment channel SA1 or SA2 - SerializeElement channel; SerializeElement dryRun; }; diff --git a/tmtc b/tmtc index 50abe69f..adf2327e 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 50abe69f261b7d2a3345d86bd7042514ff845fd3 +Subproject commit adf2327e6dda748c627b98c857683c6f783bb78a -- 2.43.0 From 213787d435098305795fe1652eb2486482870f4c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 13 Oct 2022 18:15:28 +0200 Subject: [PATCH 22/97] start SA depl task --- bsp_q7s/core/InitMission.cpp | 1 + tmtc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bsp_q7s/core/InitMission.cpp b/bsp_q7s/core/InitMission.cpp index 8872fc1f..df36df33 100644 --- a/bsp_q7s/core/InitMission.cpp +++ b/bsp_q7s/core/InitMission.cpp @@ -313,6 +313,7 @@ void initmission::initTasks() { #endif /* OBSW_USE_CCSDS_IP_CORE == 1 */ sysCtrlTask->startTask(); + solarArrayDeplTask->startTask(); taskStarter(pstTasks, "PST task vector"); taskStarter(pusTasks, "PUS task vector"); diff --git a/tmtc b/tmtc index adf2327e..55f27b83 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit adf2327e6dda748c627b98c857683c6f783bb78a +Subproject commit 55f27b83be5df1afafea5cdd4decc1bf49c3c799 -- 2.43.0 From d8907d5cccbe026556034169b75cad3cfe92cdb0 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 13 Oct 2022 18:20:17 +0200 Subject: [PATCH 23/97] important fix --- mission/devices/SolarArrayDeploymentHandler.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mission/devices/SolarArrayDeploymentHandler.h b/mission/devices/SolarArrayDeploymentHandler.h index a5f56a5f..eb5afb53 100644 --- a/mission/devices/SolarArrayDeploymentHandler.h +++ b/mission/devices/SolarArrayDeploymentHandler.h @@ -25,7 +25,9 @@ enum DeploymentChannels : uint8_t { SA_1 = 1, SA_2 = 2 }; class ManualDeploymentCommand : public SerialLinkedListAdapter { public: - ManualDeploymentCommand() = default; + ManualDeploymentCommand() { + setLinks(); + } void setLinks() { setStart(&burnTime); -- 2.43.0 From b783e9865ed69a688c7828f637b2d58298692528 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 13 Oct 2022 18:39:14 +0200 Subject: [PATCH 24/97] start the FSM properly --- mission/devices/SolarArrayDeploymentHandler.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/mission/devices/SolarArrayDeploymentHandler.cpp b/mission/devices/SolarArrayDeploymentHandler.cpp index 72bcace4..dee6a203 100644 --- a/mission/devices/SolarArrayDeploymentHandler.cpp +++ b/mission/devices/SolarArrayDeploymentHandler.cpp @@ -278,6 +278,7 @@ bool SolarArrayDeploymentHandler::startFsmOn(uint32_t burnCountdown_, bool dryRu fsmInfo.onOff = true; fsmInfo.dryRun = dryRun; fsmInfo.burnCountdown = burnCountdown_; + stateMachine = StateMachine::MAIN_POWER_ON; retryCounter = 0; return true; } -- 2.43.0 From 4714c15d6502b1dd03628f7ed2efc3b43c61fd7a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 13 Oct 2022 18:42:47 +0200 Subject: [PATCH 25/97] some more fixes --- mission/devices/SolarArrayDeploymentHandler.cpp | 12 +++++++----- mission/devices/SolarArrayDeploymentHandler.h | 4 ++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/mission/devices/SolarArrayDeploymentHandler.cpp b/mission/devices/SolarArrayDeploymentHandler.cpp index dee6a203..9c311651 100644 --- a/mission/devices/SolarArrayDeploymentHandler.cpp +++ b/mission/devices/SolarArrayDeploymentHandler.cpp @@ -213,7 +213,7 @@ void SolarArrayDeploymentHandler::handleStateMachine() { } } if (stateMachine == SWITCH_DEPL_GPIOS) { - burnCountdown.setTimeout(fsmInfo.burnCountdown); + burnCountdown.setTimeout(fsmInfo.burnCountdownMs); // This should never fail channelAlternationCd.resetTimer(); if (not fsmInfo.dryRun) { @@ -268,16 +268,16 @@ bool SolarArrayDeploymentHandler::checkMainPower(bool onOff) { return false; } -bool SolarArrayDeploymentHandler::startFsmOn(uint32_t burnCountdown_, bool dryRun) { +bool SolarArrayDeploymentHandler::startFsmOn(uint32_t burnCountdownSecs, bool dryRun) { if (stateMachine != StateMachine::IDLE) { return false; } - if (burnCountdown_ > config::SA_DEPL_MAX_BURN_TIME) { - burnCountdown_ = config::SA_DEPL_MAX_BURN_TIME; + if (burnCountdownSecs > config::SA_DEPL_MAX_BURN_TIME) { + burnCountdownSecs = config::SA_DEPL_MAX_BURN_TIME; } fsmInfo.onOff = true; fsmInfo.dryRun = dryRun; - fsmInfo.burnCountdown = burnCountdown_; + fsmInfo.burnCountdownMs = burnCountdownSecs * 1000; stateMachine = StateMachine::MAIN_POWER_ON; retryCounter = 0; return true; @@ -346,9 +346,11 @@ ReturnValue_t SolarArrayDeploymentHandler::executeAction(ActionId_t actionId, if (not startFsmOn(burnCountdown, cmd.isDryRun())) { return HasActionsIF::IS_BUSY; } + actionActive = true; return result; } else if (actionId == SWITCH_OFF_DEPLOYMENT) { startFsmOff(); + actionActive = true; return result; } else { return HasActionsIF::INVALID_ACTION_ID; diff --git a/mission/devices/SolarArrayDeploymentHandler.h b/mission/devices/SolarArrayDeploymentHandler.h index eb5afb53..00d67d4e 100644 --- a/mission/devices/SolarArrayDeploymentHandler.h +++ b/mission/devices/SolarArrayDeploymentHandler.h @@ -123,7 +123,7 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, bool onOff; bool dryRun; bool alternationDummy = false; - uint32_t burnCountdown = config::SA_DEPL_MAX_BURN_TIME; + uint32_t burnCountdownMs = config::SA_DEPL_MAX_BURN_TIME; }; static const uint8_t INTERFACE_ID = CLASS_ID::SA_DEPL_HANDLER; @@ -150,7 +150,7 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, PeriodicOperationDivider opDivider = PeriodicOperationDivider(5); uint8_t retryCounter = 3; - bool startFsmOn(uint32_t burnCountdown, bool dryRun); + bool startFsmOn(uint32_t burnCountdownSecs, bool dryRun); void startFsmOff(); void finishFsm(ReturnValue_t resultForActionHelper); -- 2.43.0 From f939bfc4691c97aebb6b17e41cf6f4fb7e209882 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 13 Oct 2022 18:44:50 +0200 Subject: [PATCH 26/97] remember commander --- mission/devices/SolarArrayDeploymentHandler.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mission/devices/SolarArrayDeploymentHandler.cpp b/mission/devices/SolarArrayDeploymentHandler.cpp index 9c311651..d5d37fe3 100644 --- a/mission/devices/SolarArrayDeploymentHandler.cpp +++ b/mission/devices/SolarArrayDeploymentHandler.cpp @@ -347,10 +347,12 @@ ReturnValue_t SolarArrayDeploymentHandler::executeAction(ActionId_t actionId, return HasActionsIF::IS_BUSY; } actionActive = true; + rememberCommanderId = commandedBy; return result; } else if (actionId == SWITCH_OFF_DEPLOYMENT) { startFsmOff(); actionActive = true; + rememberCommanderId = commandedBy; return result; } else { return HasActionsIF::INVALID_ACTION_ID; -- 2.43.0 From 470f0ad7e875a9fc56469a55a9382ad16b8ee4fa Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 13 Oct 2022 18:52:44 +0200 Subject: [PATCH 27/97] convert some debug output into info output --- mission/devices/SolarArrayDeploymentHandler.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/mission/devices/SolarArrayDeploymentHandler.cpp b/mission/devices/SolarArrayDeploymentHandler.cpp index d5d37fe3..eb50c840 100644 --- a/mission/devices/SolarArrayDeploymentHandler.cpp +++ b/mission/devices/SolarArrayDeploymentHandler.cpp @@ -184,17 +184,13 @@ void SolarArrayDeploymentHandler::handleStateMachine() { mainLineSwitcher.sendSwitchCommand(mainLineSwitch, PowerSwitchIF::SWITCH_ON); mainSwitchCountdown.setTimeout(mainLineSwitcher.getSwitchDelayMs()); stateMachine = WAIT_MAIN_POWER_ON; - if (DEBUG_MODE) { - sif::debug << "SA DEPL FSM: MAIN_POWER_ON done -> WAIT_MAIN_POWER_ON" << std::endl; - } + sif::info << "S/A Deployment: Deployment power line on" << std::endl; } if (stateMachine == MAIN_POWER_OFF) { // These should never fail allOff(); stateMachine = WAIT_MAIN_POWER_OFF; - if (DEBUG_MODE) { - sif::debug << "SA DEPL FSM: MAIN_POWER_OFF done -> WAIT_MAIN_POWER_OFF" << std::endl; - } + sif::info << "S/A Deployment: Deployment power line off" << std::endl; } if (stateMachine == WAIT_MAIN_POWER_ON) { if (checkMainPowerOn()) { @@ -209,6 +205,7 @@ void SolarArrayDeploymentHandler::handleStateMachine() { if (DEBUG_MODE) { sif::debug << "SA DEPL FSM: WAIT_MAIN_POWER_OFF done -> FSM DONE" << std::endl; } + sif::info << "S/A Deployment: FSM done" << std::endl; finishFsm(returnvalue::OK); } } @@ -221,9 +218,7 @@ void SolarArrayDeploymentHandler::handleStateMachine() { sa1On(); fsmInfo.alternationDummy = true; } - if (DEBUG_MODE) { - sif::debug << "SA DEPL FSM: SWITCH_DEPL_GPIOS done -> BURNING" << std::endl; - } + sif::info << "S/A Deployment: Burning" << std::endl; stateMachine = BURNING; } if (stateMachine == BURNING) { -- 2.43.0 From 69f34acbd2cf9c0142e181a0d1b340a7d3e7317c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 14 Oct 2022 11:55:21 +0200 Subject: [PATCH 28/97] rerun generator script --- generators/bsp_q7s_events.csv | 13 ++++++---- generators/events/translateEvents.cpp | 23 +++++++++++----- generators/objects/translateObjects.cpp | 2 +- linux/fsfwconfig/events/translateEvents.cpp | 23 +++++++++++----- linux/fsfwconfig/objects/translateObjects.cpp | 2 +- .../devices/SolarArrayDeploymentHandler.cpp | 2 ++ mission/devices/SolarArrayDeploymentHandler.h | 26 ++++++++++++------- tmtc | 2 +- 8 files changed, 61 insertions(+), 32 deletions(-) diff --git a/generators/bsp_q7s_events.csv b/generators/bsp_q7s_events.csv index 49cdc610..cff23c21 100644 --- a/generators/bsp_q7s_events.csv +++ b/generators/bsp_q7s_events.csv @@ -92,11 +92,14 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 11405;0x2c8d;SWITCH_ALREADY_OFF;LOW;;mission/devices/HeaterHandler.h 11406;0x2c8e;MAIN_SWITCH_TIMEOUT;MEDIUM;;mission/devices/HeaterHandler.h 11407;0x2c8f;FAULTY_HEATER_WAS_ON;LOW;;mission/devices/HeaterHandler.h -11500;0x2cec;MAIN_SWITCH_ON_TIMEOUT;LOW;;mission/devices/SolarArrayDeploymentHandler.h -11501;0x2ced;MAIN_SWITCH_OFF_TIMEOUT;LOW;;mission/devices/SolarArrayDeploymentHandler.h -11502;0x2cee;DEPLOYMENT_FAILED;HIGH;;mission/devices/SolarArrayDeploymentHandler.h -11503;0x2cef;DEPL_SA1_GPIO_SWTICH_ON_FAILED;HIGH;;mission/devices/SolarArrayDeploymentHandler.h -11504;0x2cf0;DEPL_SA2_GPIO_SWTICH_ON_FAILED;HIGH;;mission/devices/SolarArrayDeploymentHandler.h +11500;0x2cec;BURN_PHASE_START;INFO;P1: Burn duration in milliseconds, P2: Dry run flag;mission/devices/SolarArrayDeploymentHandler.h +11501;0x2ced;BURN_PHASE_DONE;INFO;P1: Burn duration in milliseconds, P2: Dry run flag;mission/devices/SolarArrayDeploymentHandler.h +11502;0x2cee;MAIN_SWITCH_ON_TIMEOUT;LOW;;mission/devices/SolarArrayDeploymentHandler.h +11503;0x2cef;MAIN_SWITCH_OFF_TIMEOUT;LOW;;mission/devices/SolarArrayDeploymentHandler.h +11504;0x2cf0;DEPL_SA1_GPIO_SWTICH_ON_FAILED;HIGH;;mission/devices/SolarArrayDeploymentHandler.h +11505;0x2cf1;DEPL_SA2_GPIO_SWTICH_ON_FAILED;HIGH;;mission/devices/SolarArrayDeploymentHandler.h +11506;0x2cf2;DEPL_SA1_GPIO_SWTICH_OFF_FAILED;HIGH;;mission/devices/SolarArrayDeploymentHandler.h +11507;0x2cf3;DEPL_SA2_GPIO_SWTICH_OFF_FAILED;HIGH;;mission/devices/SolarArrayDeploymentHandler.h 11601;0x2d51;MEMORY_READ_RPT_CRC_FAILURE;LOW;PLOC crc failure in telemetry packet;linux/devices/ploc/PlocMPSoCHandler.h 11602;0x2d52;ACK_FAILURE;LOW;PLOC receive acknowledgment failure report P1: Command Id which leads the acknowledgment failure report P2: The status field inserted by the MPSoC into the data field;linux/devices/ploc/PlocMPSoCHandler.h 11603;0x2d53;EXE_FAILURE;LOW;PLOC receive execution failure report P1: Command Id which leads the execution failure report P2: The status field inserted by the MPSoC into the data field;linux/devices/ploc/PlocMPSoCHandler.h diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index 8711750b..f175b6e4 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 225 translations. + * @brief Auto-generated event translation file. Contains 228 translations. * @details - * Generated on: 2022-10-10 11:15:49 + * Generated on: 2022-10-14 11:53:48 */ #include "translateEvents.h" @@ -98,11 +98,14 @@ const char *SWITCH_ALREADY_ON_STRING = "SWITCH_ALREADY_ON"; const char *SWITCH_ALREADY_OFF_STRING = "SWITCH_ALREADY_OFF"; const char *MAIN_SWITCH_TIMEOUT_STRING = "MAIN_SWITCH_TIMEOUT"; const char *FAULTY_HEATER_WAS_ON_STRING = "FAULTY_HEATER_WAS_ON"; +const char *BURN_PHASE_START_STRING = "BURN_PHASE_START"; +const char *BURN_PHASE_DONE_STRING = "BURN_PHASE_DONE"; const char *MAIN_SWITCH_ON_TIMEOUT_STRING = "MAIN_SWITCH_ON_TIMEOUT"; const char *MAIN_SWITCH_OFF_TIMEOUT_STRING = "MAIN_SWITCH_OFF_TIMEOUT"; -const char *DEPLOYMENT_FAILED_STRING = "DEPLOYMENT_FAILED"; const char *DEPL_SA1_GPIO_SWTICH_ON_FAILED_STRING = "DEPL_SA1_GPIO_SWTICH_ON_FAILED"; const char *DEPL_SA2_GPIO_SWTICH_ON_FAILED_STRING = "DEPL_SA2_GPIO_SWTICH_ON_FAILED"; +const char *DEPL_SA1_GPIO_SWTICH_OFF_FAILED_STRING = "DEPL_SA1_GPIO_SWTICH_OFF_FAILED"; +const char *DEPL_SA2_GPIO_SWTICH_OFF_FAILED_STRING = "DEPL_SA2_GPIO_SWTICH_OFF_FAILED"; const char *MEMORY_READ_RPT_CRC_FAILURE_STRING = "MEMORY_READ_RPT_CRC_FAILURE"; const char *ACK_FAILURE_STRING = "ACK_FAILURE"; const char *EXE_FAILURE_STRING = "EXE_FAILURE"; @@ -416,15 +419,21 @@ const char *translateEvents(Event event) { case (11407): return FAULTY_HEATER_WAS_ON_STRING; case (11500): - return MAIN_SWITCH_ON_TIMEOUT_STRING; + return BURN_PHASE_START_STRING; case (11501): - return MAIN_SWITCH_OFF_TIMEOUT_STRING; + return BURN_PHASE_DONE_STRING; case (11502): - return DEPLOYMENT_FAILED_STRING; + return MAIN_SWITCH_ON_TIMEOUT_STRING; case (11503): - return DEPL_SA1_GPIO_SWTICH_ON_FAILED_STRING; + return MAIN_SWITCH_OFF_TIMEOUT_STRING; case (11504): + return DEPL_SA1_GPIO_SWTICH_ON_FAILED_STRING; + case (11505): return DEPL_SA2_GPIO_SWTICH_ON_FAILED_STRING; + case (11506): + return DEPL_SA1_GPIO_SWTICH_OFF_FAILED_STRING; + case (11507): + return DEPL_SA2_GPIO_SWTICH_OFF_FAILED_STRING; case (11601): return MEMORY_READ_RPT_CRC_FAILURE_STRING; case (11602): diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index 910fe8fd..19c18ca2 100644 --- a/generators/objects/translateObjects.cpp +++ b/generators/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 138 translations. - * Generated on: 2022-10-10 11:15:49 + * Generated on: 2022-10-14 11:53:48 */ #include "translateObjects.h" diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index 8711750b..f175b6e4 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 225 translations. + * @brief Auto-generated event translation file. Contains 228 translations. * @details - * Generated on: 2022-10-10 11:15:49 + * Generated on: 2022-10-14 11:53:48 */ #include "translateEvents.h" @@ -98,11 +98,14 @@ const char *SWITCH_ALREADY_ON_STRING = "SWITCH_ALREADY_ON"; const char *SWITCH_ALREADY_OFF_STRING = "SWITCH_ALREADY_OFF"; const char *MAIN_SWITCH_TIMEOUT_STRING = "MAIN_SWITCH_TIMEOUT"; const char *FAULTY_HEATER_WAS_ON_STRING = "FAULTY_HEATER_WAS_ON"; +const char *BURN_PHASE_START_STRING = "BURN_PHASE_START"; +const char *BURN_PHASE_DONE_STRING = "BURN_PHASE_DONE"; const char *MAIN_SWITCH_ON_TIMEOUT_STRING = "MAIN_SWITCH_ON_TIMEOUT"; const char *MAIN_SWITCH_OFF_TIMEOUT_STRING = "MAIN_SWITCH_OFF_TIMEOUT"; -const char *DEPLOYMENT_FAILED_STRING = "DEPLOYMENT_FAILED"; const char *DEPL_SA1_GPIO_SWTICH_ON_FAILED_STRING = "DEPL_SA1_GPIO_SWTICH_ON_FAILED"; const char *DEPL_SA2_GPIO_SWTICH_ON_FAILED_STRING = "DEPL_SA2_GPIO_SWTICH_ON_FAILED"; +const char *DEPL_SA1_GPIO_SWTICH_OFF_FAILED_STRING = "DEPL_SA1_GPIO_SWTICH_OFF_FAILED"; +const char *DEPL_SA2_GPIO_SWTICH_OFF_FAILED_STRING = "DEPL_SA2_GPIO_SWTICH_OFF_FAILED"; const char *MEMORY_READ_RPT_CRC_FAILURE_STRING = "MEMORY_READ_RPT_CRC_FAILURE"; const char *ACK_FAILURE_STRING = "ACK_FAILURE"; const char *EXE_FAILURE_STRING = "EXE_FAILURE"; @@ -416,15 +419,21 @@ const char *translateEvents(Event event) { case (11407): return FAULTY_HEATER_WAS_ON_STRING; case (11500): - return MAIN_SWITCH_ON_TIMEOUT_STRING; + return BURN_PHASE_START_STRING; case (11501): - return MAIN_SWITCH_OFF_TIMEOUT_STRING; + return BURN_PHASE_DONE_STRING; case (11502): - return DEPLOYMENT_FAILED_STRING; + return MAIN_SWITCH_ON_TIMEOUT_STRING; case (11503): - return DEPL_SA1_GPIO_SWTICH_ON_FAILED_STRING; + return MAIN_SWITCH_OFF_TIMEOUT_STRING; case (11504): + return DEPL_SA1_GPIO_SWTICH_ON_FAILED_STRING; + case (11505): return DEPL_SA2_GPIO_SWTICH_ON_FAILED_STRING; + case (11506): + return DEPL_SA1_GPIO_SWTICH_OFF_FAILED_STRING; + case (11507): + return DEPL_SA2_GPIO_SWTICH_OFF_FAILED_STRING; case (11601): return MEMORY_READ_RPT_CRC_FAILURE_STRING; case (11602): diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index 910fe8fd..19c18ca2 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 138 translations. - * Generated on: 2022-10-10 11:15:49 + * Generated on: 2022-10-14 11:53:48 */ #include "translateObjects.h" diff --git a/mission/devices/SolarArrayDeploymentHandler.cpp b/mission/devices/SolarArrayDeploymentHandler.cpp index eb50c840..cd64fd7b 100644 --- a/mission/devices/SolarArrayDeploymentHandler.cpp +++ b/mission/devices/SolarArrayDeploymentHandler.cpp @@ -219,6 +219,7 @@ void SolarArrayDeploymentHandler::handleStateMachine() { fsmInfo.alternationDummy = true; } sif::info << "S/A Deployment: Burning" << std::endl; + triggerEvent(BURN_PHASE_START, fsmInfo.burnCountdownMs, fsmInfo.dryRun); stateMachine = BURNING; } if (stateMachine == BURNING) { @@ -228,6 +229,7 @@ void SolarArrayDeploymentHandler::handleStateMachine() { sif::debug << "SA DEPL FSM: BURNING done -> WAIT_MAIN_POWER_OFF" << std::endl; } allOff(); + triggerEvent(BURN_PHASE_DONE, fsmInfo.burnCountdownMs, fsmInfo.dryRun); stateMachine = WAIT_MAIN_POWER_OFF; } } diff --git a/mission/devices/SolarArrayDeploymentHandler.h b/mission/devices/SolarArrayDeploymentHandler.h index 00d67d4e..c7494b8a 100644 --- a/mission/devices/SolarArrayDeploymentHandler.h +++ b/mission/devices/SolarArrayDeploymentHandler.h @@ -25,9 +25,7 @@ enum DeploymentChannels : uint8_t { SA_1 = 1, SA_2 = 2 }; class ManualDeploymentCommand : public SerialLinkedListAdapter { public: - ManualDeploymentCommand() { - setLinks(); - } + ManualDeploymentCommand() { setLinks(); } void setLinks() { setStart(&burnTime); @@ -134,13 +132,21 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, static const ReturnValue_t SWITCHING_DEPL_SA2_FAILED = MAKE_RETURN_CODE(0xA4); static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::SA_DEPL_HANDLER; - static const Event MAIN_SWITCH_ON_TIMEOUT = MAKE_EVENT(0, severity::LOW); - static const Event MAIN_SWITCH_OFF_TIMEOUT = MAKE_EVENT(1, severity::LOW); - static const Event DEPLOYMENT_FAILED = MAKE_EVENT(2, severity::HIGH); - static const Event DEPL_SA1_GPIO_SWTICH_ON_FAILED = MAKE_EVENT(3, severity::HIGH); - static const Event DEPL_SA2_GPIO_SWTICH_ON_FAILED = MAKE_EVENT(4, severity::HIGH); - static const Event DEPL_SA1_GPIO_SWTICH_OFF_FAILED = MAKE_EVENT(5, severity::HIGH); - static const Event DEPL_SA2_GPIO_SWTICH_OFF_FAILED = MAKE_EVENT(6, severity::HIGH); + + //! [EXPORT] : [COMMENT] P1: Burn duration in milliseconds, P2: Dry run flag + static constexpr Event BURN_PHASE_START = event::makeEvent(SUBSYSTEM_ID, 0, severity::INFO); + //! [EXPORT] : [COMMENT] P1: Burn duration in milliseconds, P2: Dry run flag + static constexpr Event BURN_PHASE_DONE = event::makeEvent(SUBSYSTEM_ID, 1, severity::INFO); + static constexpr Event MAIN_SWITCH_ON_TIMEOUT = event::makeEvent(SUBSYSTEM_ID, 2, severity::LOW); + static constexpr Event MAIN_SWITCH_OFF_TIMEOUT = event::makeEvent(SUBSYSTEM_ID, 3, severity::LOW); + static constexpr Event DEPL_SA1_GPIO_SWTICH_ON_FAILED = + event::makeEvent(SUBSYSTEM_ID, 4, severity::HIGH); + static constexpr Event DEPL_SA2_GPIO_SWTICH_ON_FAILED = + event::makeEvent(SUBSYSTEM_ID, 5, severity::HIGH); + static constexpr Event DEPL_SA1_GPIO_SWTICH_OFF_FAILED = + event::makeEvent(SUBSYSTEM_ID, 6, severity::HIGH); + static constexpr Event DEPL_SA2_GPIO_SWTICH_OFF_FAILED = + event::makeEvent(SUBSYSTEM_ID, 7, severity::HIGH); FsmInfo fsmInfo; StateMachine stateMachine = IDLE; diff --git a/tmtc b/tmtc index 55f27b83..772c86ab 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 55f27b83be5df1afafea5cdd4decc1bf49c3c799 +Subproject commit 772c86ab04c453b12459d65327fdaaf4d1472279 -- 2.43.0 From 19c73167c9e028b8778d6107f2189c2c67539bd3 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 14 Oct 2022 13:13:23 +0200 Subject: [PATCH 29/97] bugfixes for alternation --- mission/devices/SolarArrayDeploymentHandler.cpp | 9 +++++---- mission/devices/SolarArrayDeploymentHandler.h | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/mission/devices/SolarArrayDeploymentHandler.cpp b/mission/devices/SolarArrayDeploymentHandler.cpp index cd64fd7b..513ddbff 100644 --- a/mission/devices/SolarArrayDeploymentHandler.cpp +++ b/mission/devices/SolarArrayDeploymentHandler.cpp @@ -371,14 +371,15 @@ ReturnValue_t SolarArrayDeploymentHandler::saGpioAlternation() { status = result; } } else { + result = sa2Off(); + if (result != returnvalue::OK) { + status = result; + } result = sa1On(); if (result != returnvalue::OK) { status = result; } - result = sa2Off(); - if (result != returnvalue::OK) { - status = result; - } + } fsmInfo.alternationDummy = not fsmInfo.alternationDummy; channelAlternationCd.resetTimer(); diff --git a/mission/devices/SolarArrayDeploymentHandler.h b/mission/devices/SolarArrayDeploymentHandler.h index c7494b8a..32892688 100644 --- a/mission/devices/SolarArrayDeploymentHandler.h +++ b/mission/devices/SolarArrayDeploymentHandler.h @@ -174,7 +174,7 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, */ Countdown burnCountdown; - Countdown channelAlternationCd = Countdown(config::SA_DEPL_CHANNEL_ALTERNATION_INTERVAL_SECS); + Countdown channelAlternationCd = Countdown(config::SA_DEPL_CHANNEL_ALTERNATION_INTERVAL_SECS * 1000); /** * The message queue id of the component commanding an action will be stored in this variable. -- 2.43.0 From bcef1f5d33e2da3ab97e2a6b06f1d4dc0b39db36 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 14 Oct 2022 13:30:35 +0200 Subject: [PATCH 30/97] small delay --- mission/devices/SolarArrayDeploymentHandler.cpp | 13 ++++++++----- mission/devices/SolarArrayDeploymentHandler.h | 3 ++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/mission/devices/SolarArrayDeploymentHandler.cpp b/mission/devices/SolarArrayDeploymentHandler.cpp index 513ddbff..1c6375be 100644 --- a/mission/devices/SolarArrayDeploymentHandler.cpp +++ b/mission/devices/SolarArrayDeploymentHandler.cpp @@ -1,5 +1,7 @@ #include "SolarArrayDeploymentHandler.h" +#include + #include #include #include @@ -366,20 +368,21 @@ ReturnValue_t SolarArrayDeploymentHandler::saGpioAlternation() { if (result != returnvalue::OK) { status = result; } + TaskFactory::delayTask(1); result = sa2On(); if (result != returnvalue::OK) { status = result; } } else { - result = sa2Off(); - if (result != returnvalue::OK) { - status = result; - } + result = sa2Off(); + if (result != returnvalue::OK) { + status = result; + } + TaskFactory::delayTask(1); result = sa1On(); if (result != returnvalue::OK) { status = result; } - } fsmInfo.alternationDummy = not fsmInfo.alternationDummy; channelAlternationCd.resetTimer(); diff --git a/mission/devices/SolarArrayDeploymentHandler.h b/mission/devices/SolarArrayDeploymentHandler.h index 32892688..20a558c6 100644 --- a/mission/devices/SolarArrayDeploymentHandler.h +++ b/mission/devices/SolarArrayDeploymentHandler.h @@ -174,7 +174,8 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, */ Countdown burnCountdown; - Countdown channelAlternationCd = Countdown(config::SA_DEPL_CHANNEL_ALTERNATION_INTERVAL_SECS * 1000); + Countdown channelAlternationCd = + Countdown(config::SA_DEPL_CHANNEL_ALTERNATION_INTERVAL_SECS * 1000); /** * The message queue id of the component commanding an action will be stored in this variable. -- 2.43.0 From 5d721706f3e4a3392e1dd08fe52d56eb6d98c7f0 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 14 Oct 2022 14:17:20 +0200 Subject: [PATCH 31/97] bugfix for autonomous handling --- common/config/eive/definitions.h | 2 +- .../devices/SolarArrayDeploymentHandler.cpp | 92 +++++++++---------- 2 files changed, 46 insertions(+), 48 deletions(-) diff --git a/common/config/eive/definitions.h b/common/config/eive/definitions.h index 81792c20..33d37812 100644 --- a/common/config/eive/definitions.h +++ b/common/config/eive/definitions.h @@ -41,7 +41,7 @@ static constexpr uint32_t SA_DEPL_WAIT_TIME_SECS = 45 * 60; // HW constraints (current limit) mean that the GPIO channels need to be switched on in alternation static constexpr uint32_t SA_DEPL_CHANNEL_ALTERNATION_INTERVAL_SECS = 5; // Maximum allowed burn time allowed by the software. -static constexpr uint32_t SA_DEPL_MAX_BURN_TIME = 120; +static constexpr uint32_t SA_DEPL_MAX_BURN_TIME = 180; } // namespace config diff --git a/mission/devices/SolarArrayDeploymentHandler.cpp b/mission/devices/SolarArrayDeploymentHandler.cpp index cd64fd7b..baa35861 100644 --- a/mission/devices/SolarArrayDeploymentHandler.cpp +++ b/mission/devices/SolarArrayDeploymentHandler.cpp @@ -89,56 +89,54 @@ bool SolarArrayDeploymentHandler::autonomousDeplForFile(const char* filename, bo bool stateSwitch = false; uint32_t secsSinceBoot = 0; while (std::getline(file, line)) { + std::istringstream iss(line); if (lineNum == 0) { - std::istringstream iss(line); - if (lineNum == 0) { - iss >> word; - if (word.find("phase:") == string::npos) { - return false; - } - iss >> word; - if (word.find(PHASE_INIT_STR) != string::npos) { - deplState = AutonomousDeplState::INIT; - } else if (word.find(PHASE_FIRST_BURN_STR) != string::npos) { - deplState = AutonomousDeplState::FIRST_BURN; - } else if (word.find(PHASE_WAIT_STR) != string::npos) { - deplState = AutonomousDeplState::WAIT; - } else if (word.find(PHASE_SECOND_BURN_STR) != string::npos) { - deplState = AutonomousDeplState::SECOND_BURN; - } else if (word.find(PHASE_DONE) != string::npos) { - deplState = AutonomousDeplState::DONE; - } else { - return false; - } - } else if (lineNum == 1) { - iss >> word; - if (word.find("secs_since_start:") == string::npos) { - return false; - } + iss >> word; + if (word.find("phase:") == string::npos) { + return false; + } + iss >> word; + if (word.find(PHASE_INIT_STR) != string::npos) { + deplState = AutonomousDeplState::INIT; + } else if (word.find(PHASE_FIRST_BURN_STR) != string::npos) { + deplState = AutonomousDeplState::FIRST_BURN; + } else if (word.find(PHASE_WAIT_STR) != string::npos) { + deplState = AutonomousDeplState::WAIT; + } else if (word.find(PHASE_SECOND_BURN_STR) != string::npos) { + deplState = AutonomousDeplState::SECOND_BURN; + } else if (word.find(PHASE_DONE) != string::npos) { + deplState = AutonomousDeplState::DONE; + } else { + return false; + } + } else if (lineNum == 1) { + iss >> word; + if (word.find("secs_since_start:") == string::npos) { + return false; + } - iss >> secsSinceBoot; - if (not initUptime) { - initUptime = secsSinceBoot; - } - if (iss.bad()) { - return false; - } - auto switchCheck = [&](AutonomousDeplState expected) { - if (deplState != expected) { - deplState = expected; - stateSwitch = true; - } - }; - if ((secsSinceBoot > FIRST_BURN_START_TIME) and (secsSinceBoot < FIRST_BURN_END_TIME)) { - switchCheck(AutonomousDeplState::FIRST_BURN); - } else if ((secsSinceBoot > WAIT_START_TIME) and (secsSinceBoot < WAIT_END_TIME)) { - switchCheck(AutonomousDeplState::WAIT); - } else if ((secsSinceBoot > SECOND_BURN_START_TIME) and - (secsSinceBoot < SECOND_BURN_END_TIME)) { - switchCheck(AutonomousDeplState::SECOND_BURN); - } else if (secsSinceBoot > SECOND_BURN_END_TIME) { - switchCheck(AutonomousDeplState::DONE); + iss >> secsSinceBoot; + if (not initUptime) { + initUptime = secsSinceBoot; + } + if (iss.bad()) { + return false; + } + auto switchCheck = [&](AutonomousDeplState expected) { + if (deplState != expected) { + deplState = expected; + stateSwitch = true; } + }; + if ((secsSinceBoot > FIRST_BURN_START_TIME) and (secsSinceBoot < FIRST_BURN_END_TIME)) { + switchCheck(AutonomousDeplState::FIRST_BURN); + } else if ((secsSinceBoot > WAIT_START_TIME) and (secsSinceBoot < WAIT_END_TIME)) { + switchCheck(AutonomousDeplState::WAIT); + } else if ((secsSinceBoot > SECOND_BURN_START_TIME) and + (secsSinceBoot < SECOND_BURN_END_TIME)) { + switchCheck(AutonomousDeplState::SECOND_BURN); + } else if (secsSinceBoot > SECOND_BURN_END_TIME) { + switchCheck(AutonomousDeplState::DONE); } } lineNum++; -- 2.43.0 From 99f703a2eb143e8e8bf688b9fbbed6fe5e9c69f5 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 14 Oct 2022 14:34:35 +0200 Subject: [PATCH 32/97] some more important bugfixes --- .../devices/SolarArrayDeploymentHandler.cpp | 86 ++++++++++--------- mission/devices/SolarArrayDeploymentHandler.h | 1 + 2 files changed, 46 insertions(+), 41 deletions(-) diff --git a/mission/devices/SolarArrayDeploymentHandler.cpp b/mission/devices/SolarArrayDeploymentHandler.cpp index df3f0805..88b3d7bf 100644 --- a/mission/devices/SolarArrayDeploymentHandler.cpp +++ b/mission/devices/SolarArrayDeploymentHandler.cpp @@ -36,22 +36,27 @@ SolarArrayDeploymentHandler::~SolarArrayDeploymentHandler() = default; ReturnValue_t SolarArrayDeploymentHandler::performOperation(uint8_t operationCode) { using namespace std::filesystem; - auto activeSdc = sdcMan.getActiveSdCard(); - if (activeSdc and activeSdc.value() == sd::SdCard::SLOT_0 and - sdcMan.isSdCardUsable(activeSdc.value())) { - if (exists(SD_0_DEPL_FILE)) { - // perform autonomous deployment handling - performAutonomousDepl(sd::SdCard::SLOT_0, dryRunStringInFile(SD_0_DEPL_FILE)); - } - } else if (activeSdc and activeSdc.value() == sd::SdCard::SLOT_1 and - sdcMan.isSdCardUsable(activeSdc.value())) { - if (exists(SD_1_DEPL_FILE)) { - // perform autonomous deployment handling - performAutonomousDepl(sd::SdCard::SLOT_1, dryRunStringInFile(SD_1_DEPL_FILE)); + if (opDivider.checkAndIncrement()) { + auto activeSdc = sdcMan.getActiveSdCard(); + if (activeSdc and activeSdc.value() == sd::SdCard::SLOT_0 and + sdcMan.isSdCardUsable(activeSdc.value())) { + if (exists(SD_0_DEPL_FILE)) { + // perform autonomous deployment handling + performAutonomousDepl(sd::SdCard::SLOT_0, dryRunStringInFile(SD_0_DEPL_FILE)); + } + } else if (activeSdc and activeSdc.value() == sd::SdCard::SLOT_1 and + sdcMan.isSdCardUsable(activeSdc.value())) { + if (exists(SD_1_DEPL_FILE)) { + // perform autonomous deployment handling + performAutonomousDepl(sd::SdCard::SLOT_1, dryRunStringInFile(SD_1_DEPL_FILE)); + } } } readCommandQueue(); handleStateMachine(); + if (firstCycle) { + firstCycle = false; + } return returnvalue::OK; } @@ -113,17 +118,21 @@ bool SolarArrayDeploymentHandler::autonomousDeplForFile(const char* filename, bo } } else if (lineNum == 1) { iss >> word; + if (iss.bad()) { + return false; + } if (word.find("secs_since_start:") == string::npos) { return false; } iss >> secsSinceBoot; - if (not initUptime) { - initUptime = secsSinceBoot; - } if (iss.bad()) { return false; } + if (not initUptime) { + initUptime = secsSinceBoot; + } + auto switchCheck = [&](AutonomousDeplState expected) { if (deplState != expected) { deplState = expected; @@ -143,39 +152,34 @@ bool SolarArrayDeploymentHandler::autonomousDeplForFile(const char* filename, bo } lineNum++; } - bool updateUptime = false; - if (opDivider.checkAndIncrement()) { - if (initUptime) { - secsSinceBoot = initUptime.value(); - } - // Uptime has increased by X seconds so we need to update the uptime count inside the file - secsSinceBoot += Clock::getUptime().tv_sec; - updateUptime = true; + if (initUptime) { + secsSinceBoot = initUptime.value(); } - if (stateSwitch) { + // Uptime has increased by X seconds so we need to update the uptime count inside the file + secsSinceBoot += Clock::getUptime().tv_sec; + if (stateSwitch or firstCycle) { if (deplState == AutonomousDeplState::FIRST_BURN or deplState == AutonomousDeplState::SECOND_BURN) { startFsmOn(config::SA_DEPL_BURN_TIME_SECS, dryRun); - } else if (deplState == AutonomousDeplState::WAIT or deplState == AutonomousDeplState::DONE) { + } else if (deplState == AutonomousDeplState::WAIT or deplState == AutonomousDeplState::DONE or + deplState == AutonomousDeplState::INIT) { startFsmOff(); } } - if (stateSwitch or updateUptime) { - std::ofstream of(filename); - of << "phase: "; - if (deplState == AutonomousDeplState::INIT) { - of << PHASE_INIT_STR << "\n"; - } else if (deplState == AutonomousDeplState::FIRST_BURN) { - of << PHASE_FIRST_BURN_STR << "\n"; - } else if (deplState == AutonomousDeplState::WAIT) { - of << PHASE_WAIT_STR << "\n"; - } else if (deplState == AutonomousDeplState::SECOND_BURN) { - of << PHASE_SECOND_BURN_STR << "\n"; - } else if (deplState == AutonomousDeplState::DONE) { - of << PHASE_DONE << "\n"; - } - of << "secs_since_start: " << std::to_string(secsSinceBoot) << "\n"; + std::ofstream of(filename); + of << "phase: "; + if (deplState == AutonomousDeplState::INIT) { + of << PHASE_INIT_STR << "\n"; + } else if (deplState == AutonomousDeplState::FIRST_BURN) { + of << PHASE_FIRST_BURN_STR << "\n"; + } else if (deplState == AutonomousDeplState::WAIT) { + of << PHASE_WAIT_STR << "\n"; + } else if (deplState == AutonomousDeplState::SECOND_BURN) { + of << PHASE_SECOND_BURN_STR << "\n"; + } else if (deplState == AutonomousDeplState::DONE) { + of << PHASE_DONE << "\n"; } + of << "secs_since_start: " << std::to_string(secsSinceBoot) << "\n"; return true; } @@ -287,7 +291,7 @@ void SolarArrayDeploymentHandler::startFsmOff() { } fsmInfo.onOff = false; retryCounter = 0; - stateMachine = StateMachine::MAIN_POWER_ON; + stateMachine = StateMachine::MAIN_POWER_OFF; } void SolarArrayDeploymentHandler::finishFsm(ReturnValue_t resultForActionHelper) { diff --git a/mission/devices/SolarArrayDeploymentHandler.h b/mission/devices/SolarArrayDeploymentHandler.h index 20a558c6..2e4c775e 100644 --- a/mission/devices/SolarArrayDeploymentHandler.h +++ b/mission/devices/SolarArrayDeploymentHandler.h @@ -151,6 +151,7 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, FsmInfo fsmInfo; StateMachine stateMachine = IDLE; bool actionActive = false; + bool firstCycle = true; ActionId_t activeCmd = HasActionsIF::INVALID_ACTION_ID; std::optional initUptime; PeriodicOperationDivider opDivider = PeriodicOperationDivider(5); -- 2.43.0 From 3cff1c48e9c58ebd24a1573b8bb92af43a412bbf Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 14 Oct 2022 14:55:37 +0200 Subject: [PATCH 33/97] some more testing and bugfixes --- common/config/eive/definitions.h | 4 +- generators/bsp_q7s_events.csv | 1 + generators/events/translateEvents.cpp | 7 +- generators/objects/translateObjects.cpp | 2 +- linux/fsfwconfig/events/translateEvents.cpp | 7 +- linux/fsfwconfig/objects/translateObjects.cpp | 2 +- .../devices/SolarArrayDeploymentHandler.cpp | 156 +++++++++--------- mission/devices/SolarArrayDeploymentHandler.h | 6 +- tmtc | 2 +- 9 files changed, 100 insertions(+), 87 deletions(-) diff --git a/common/config/eive/definitions.h b/common/config/eive/definitions.h index 33d37812..d15b5ea6 100644 --- a/common/config/eive/definitions.h +++ b/common/config/eive/definitions.h @@ -36,8 +36,8 @@ static constexpr uint32_t MAX_FILENAME_SIZE = 50; static constexpr uint32_t SA_DEPL_INIT_BUFFER_SECS = 120; // Burn time for autonomous deployment -static constexpr uint32_t SA_DEPL_BURN_TIME_SECS = 180; -static constexpr uint32_t SA_DEPL_WAIT_TIME_SECS = 45 * 60; +static constexpr uint32_t SA_DEPL_BURN_TIME_SECS = 60; // 180; +static constexpr uint32_t SA_DEPL_WAIT_TIME_SECS = 90; // 45 * 60; // HW constraints (current limit) mean that the GPIO channels need to be switched on in alternation static constexpr uint32_t SA_DEPL_CHANNEL_ALTERNATION_INTERVAL_SECS = 5; // Maximum allowed burn time allowed by the software. diff --git a/generators/bsp_q7s_events.csv b/generators/bsp_q7s_events.csv index cff23c21..5a662fb5 100644 --- a/generators/bsp_q7s_events.csv +++ b/generators/bsp_q7s_events.csv @@ -100,6 +100,7 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 11505;0x2cf1;DEPL_SA2_GPIO_SWTICH_ON_FAILED;HIGH;;mission/devices/SolarArrayDeploymentHandler.h 11506;0x2cf2;DEPL_SA1_GPIO_SWTICH_OFF_FAILED;HIGH;;mission/devices/SolarArrayDeploymentHandler.h 11507;0x2cf3;DEPL_SA2_GPIO_SWTICH_OFF_FAILED;HIGH;;mission/devices/SolarArrayDeploymentHandler.h +11508;0x2cf4;AUTONOMOUS_DEPLOYMENT_COMPLETED;INFO;;mission/devices/SolarArrayDeploymentHandler.h 11601;0x2d51;MEMORY_READ_RPT_CRC_FAILURE;LOW;PLOC crc failure in telemetry packet;linux/devices/ploc/PlocMPSoCHandler.h 11602;0x2d52;ACK_FAILURE;LOW;PLOC receive acknowledgment failure report P1: Command Id which leads the acknowledgment failure report P2: The status field inserted by the MPSoC into the data field;linux/devices/ploc/PlocMPSoCHandler.h 11603;0x2d53;EXE_FAILURE;LOW;PLOC receive execution failure report P1: Command Id which leads the execution failure report P2: The status field inserted by the MPSoC into the data field;linux/devices/ploc/PlocMPSoCHandler.h diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index f175b6e4..b27c54fc 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 228 translations. + * @brief Auto-generated event translation file. Contains 229 translations. * @details - * Generated on: 2022-10-14 11:53:48 + * Generated on: 2022-10-14 14:54:47 */ #include "translateEvents.h" @@ -106,6 +106,7 @@ const char *DEPL_SA1_GPIO_SWTICH_ON_FAILED_STRING = "DEPL_SA1_GPIO_SWTICH_ON_FAI const char *DEPL_SA2_GPIO_SWTICH_ON_FAILED_STRING = "DEPL_SA2_GPIO_SWTICH_ON_FAILED"; const char *DEPL_SA1_GPIO_SWTICH_OFF_FAILED_STRING = "DEPL_SA1_GPIO_SWTICH_OFF_FAILED"; const char *DEPL_SA2_GPIO_SWTICH_OFF_FAILED_STRING = "DEPL_SA2_GPIO_SWTICH_OFF_FAILED"; +const char *AUTONOMOUS_DEPLOYMENT_COMPLETED_STRING = "AUTONOMOUS_DEPLOYMENT_COMPLETED"; const char *MEMORY_READ_RPT_CRC_FAILURE_STRING = "MEMORY_READ_RPT_CRC_FAILURE"; const char *ACK_FAILURE_STRING = "ACK_FAILURE"; const char *EXE_FAILURE_STRING = "EXE_FAILURE"; @@ -434,6 +435,8 @@ const char *translateEvents(Event event) { return DEPL_SA1_GPIO_SWTICH_OFF_FAILED_STRING; case (11507): return DEPL_SA2_GPIO_SWTICH_OFF_FAILED_STRING; + case (11508): + return AUTONOMOUS_DEPLOYMENT_COMPLETED_STRING; case (11601): return MEMORY_READ_RPT_CRC_FAILURE_STRING; case (11602): diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index 19c18ca2..a855e48a 100644 --- a/generators/objects/translateObjects.cpp +++ b/generators/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 138 translations. - * Generated on: 2022-10-14 11:53:48 + * Generated on: 2022-10-14 14:54:47 */ #include "translateObjects.h" diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index f175b6e4..b27c54fc 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 228 translations. + * @brief Auto-generated event translation file. Contains 229 translations. * @details - * Generated on: 2022-10-14 11:53:48 + * Generated on: 2022-10-14 14:54:47 */ #include "translateEvents.h" @@ -106,6 +106,7 @@ const char *DEPL_SA1_GPIO_SWTICH_ON_FAILED_STRING = "DEPL_SA1_GPIO_SWTICH_ON_FAI const char *DEPL_SA2_GPIO_SWTICH_ON_FAILED_STRING = "DEPL_SA2_GPIO_SWTICH_ON_FAILED"; const char *DEPL_SA1_GPIO_SWTICH_OFF_FAILED_STRING = "DEPL_SA1_GPIO_SWTICH_OFF_FAILED"; const char *DEPL_SA2_GPIO_SWTICH_OFF_FAILED_STRING = "DEPL_SA2_GPIO_SWTICH_OFF_FAILED"; +const char *AUTONOMOUS_DEPLOYMENT_COMPLETED_STRING = "AUTONOMOUS_DEPLOYMENT_COMPLETED"; const char *MEMORY_READ_RPT_CRC_FAILURE_STRING = "MEMORY_READ_RPT_CRC_FAILURE"; const char *ACK_FAILURE_STRING = "ACK_FAILURE"; const char *EXE_FAILURE_STRING = "EXE_FAILURE"; @@ -434,6 +435,8 @@ const char *translateEvents(Event event) { return DEPL_SA1_GPIO_SWTICH_OFF_FAILED_STRING; case (11507): return DEPL_SA2_GPIO_SWTICH_OFF_FAILED_STRING; + case (11508): + return AUTONOMOUS_DEPLOYMENT_COMPLETED_STRING; case (11601): return MEMORY_READ_RPT_CRC_FAILURE_STRING; case (11602): diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index 19c18ca2..a855e48a 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 138 translations. - * Generated on: 2022-10-14 11:53:48 + * Generated on: 2022-10-14 14:54:47 */ #include "translateObjects.h" diff --git a/mission/devices/SolarArrayDeploymentHandler.cpp b/mission/devices/SolarArrayDeploymentHandler.cpp index 88b3d7bf..eaecae37 100644 --- a/mission/devices/SolarArrayDeploymentHandler.cpp +++ b/mission/devices/SolarArrayDeploymentHandler.cpp @@ -60,6 +60,62 @@ ReturnValue_t SolarArrayDeploymentHandler::performOperation(uint8_t operationCod return returnvalue::OK; } +void SolarArrayDeploymentHandler::handleStateMachine() { + if (stateMachine == MAIN_POWER_ON) { + mainLineSwitcher.sendSwitchCommand(mainLineSwitch, PowerSwitchIF::SWITCH_ON); + mainSwitchCountdown.setTimeout(mainLineSwitcher.getSwitchDelayMs()); + stateMachine = WAIT_MAIN_POWER_ON; + sif::info << "S/A Deployment: Deployment power line on" << std::endl; + } + if (stateMachine == MAIN_POWER_OFF) { + // These should never fail + allOff(); + stateMachine = WAIT_MAIN_POWER_OFF; + sif::info << "S/A Deployment: Deployment power line off" << std::endl; + } + if (stateMachine == WAIT_MAIN_POWER_ON) { + if (checkMainPowerOn()) { + if (DEBUG_MODE) { + sif::debug << "SA DEPL FSM: WAIT_MAIN_POWER_ON done -> SWITCH_DEPL_GPIOS" << std::endl; + } + stateMachine = SWITCH_DEPL_GPIOS; + } + } + if (stateMachine == WAIT_MAIN_POWER_OFF) { + if (checkMainPowerOff()) { + if (DEBUG_MODE) { + sif::debug << "SA DEPL FSM: WAIT_MAIN_POWER_OFF done -> FSM DONE" << std::endl; + } + sif::info << "S/A Deployment: FSM done" << std::endl; + finishFsm(returnvalue::OK); + } + } + if (stateMachine == SWITCH_DEPL_GPIOS) { + burnCountdown.setTimeout(fsmInfo.burnCountdownMs); + // This should never fail + channelAlternationCd.resetTimer(); + if (not fsmInfo.dryRun) { + sa2Off(); + sa1On(); + fsmInfo.alternationDummy = true; + } + sif::info << "S/A Deployment: Burning" << std::endl; + triggerEvent(BURN_PHASE_START, fsmInfo.burnCountdownMs, fsmInfo.dryRun); + stateMachine = BURNING; + } + if (stateMachine == BURNING) { + saGpioAlternation(); + if (burnCountdown.hasTimedOut()) { + if (DEBUG_MODE) { + sif::debug << "SA DEPL FSM: BURNING done -> WAIT_MAIN_POWER_OFF" << std::endl; + } + allOff(); + triggerEvent(BURN_PHASE_DONE, fsmInfo.burnCountdownMs, fsmInfo.dryRun); + stateMachine = WAIT_MAIN_POWER_OFF; + } + } +} + ReturnValue_t SolarArrayDeploymentHandler::performAutonomousDepl(sd::SdCard sdCard, bool dryRun) { using namespace std::filesystem; using namespace std; @@ -72,21 +128,22 @@ ReturnValue_t SolarArrayDeploymentHandler::performAutonomousDepl(sd::SdCard sdCa if (not exists(SD_0_DEPLY_INFO)) { initFile(SD_0_DEPLY_INFO); } - if (not autonomousDeplForFile(SD_0_DEPLY_INFO, dryRun)) { + if (not autonomousDeplForFile(sd::SdCard::SLOT_0, SD_0_DEPLY_INFO, dryRun)) { initFile(SD_0_DEPLY_INFO); } } else if (sdCard == sd::SdCard::SLOT_1) { if (not exists(SD_1_DEPLY_INFO)) { initFile(SD_1_DEPLY_INFO); } - if (not autonomousDeplForFile(SD_1_DEPLY_INFO, dryRun)) { + if (not autonomousDeplForFile(sd::SdCard::SLOT_1, SD_1_DEPLY_INFO, dryRun)) { initFile(SD_1_DEPLY_INFO); } } return returnvalue::OK; } -bool SolarArrayDeploymentHandler::autonomousDeplForFile(const char* filename, bool dryRun) { +bool SolarArrayDeploymentHandler::autonomousDeplForFile(sd::SdCard sdCard, const char* filename, + bool dryRun) { using namespace std; ifstream file(filename); string line; @@ -166,79 +223,31 @@ bool SolarArrayDeploymentHandler::autonomousDeplForFile(const char* filename, bo startFsmOff(); } } - std::ofstream of(filename); - of << "phase: "; - if (deplState == AutonomousDeplState::INIT) { - of << PHASE_INIT_STR << "\n"; - } else if (deplState == AutonomousDeplState::FIRST_BURN) { - of << PHASE_FIRST_BURN_STR << "\n"; - } else if (deplState == AutonomousDeplState::WAIT) { - of << PHASE_WAIT_STR << "\n"; - } else if (deplState == AutonomousDeplState::SECOND_BURN) { - of << PHASE_SECOND_BURN_STR << "\n"; - } else if (deplState == AutonomousDeplState::DONE) { - of << PHASE_DONE << "\n"; + if (deplState == AutonomousDeplState::DONE) { + remove(filename); + if (sdCard == sd::SdCard::SLOT_0) { + remove(SD_0_DEPL_FILE); + } else { + remove(SD_1_DEPL_FILE); + } + triggerEvent(AUTONOMOUS_DEPLOYMENT_COMPLETED); + } else { + std::ofstream of(filename); + of << "phase: "; + if (deplState == AutonomousDeplState::INIT) { + of << PHASE_INIT_STR << "\n"; + } else if (deplState == AutonomousDeplState::FIRST_BURN) { + of << PHASE_FIRST_BURN_STR << "\n"; + } else if (deplState == AutonomousDeplState::WAIT) { + of << PHASE_WAIT_STR << "\n"; + } else if (deplState == AutonomousDeplState::SECOND_BURN) { + of << PHASE_SECOND_BURN_STR << "\n"; + } + of << "secs_since_start: " << std::to_string(secsSinceBoot) << "\n"; } - of << "secs_since_start: " << std::to_string(secsSinceBoot) << "\n"; return true; } -void SolarArrayDeploymentHandler::handleStateMachine() { - if (stateMachine == MAIN_POWER_ON) { - mainLineSwitcher.sendSwitchCommand(mainLineSwitch, PowerSwitchIF::SWITCH_ON); - mainSwitchCountdown.setTimeout(mainLineSwitcher.getSwitchDelayMs()); - stateMachine = WAIT_MAIN_POWER_ON; - sif::info << "S/A Deployment: Deployment power line on" << std::endl; - } - if (stateMachine == MAIN_POWER_OFF) { - // These should never fail - allOff(); - stateMachine = WAIT_MAIN_POWER_OFF; - sif::info << "S/A Deployment: Deployment power line off" << std::endl; - } - if (stateMachine == WAIT_MAIN_POWER_ON) { - if (checkMainPowerOn()) { - if (DEBUG_MODE) { - sif::debug << "SA DEPL FSM: WAIT_MAIN_POWER_ON done -> SWITCH_DEPL_GPIOS" << std::endl; - } - stateMachine = SWITCH_DEPL_GPIOS; - } - } - if (stateMachine == WAIT_MAIN_POWER_OFF) { - if (checkMainPowerOff()) { - if (DEBUG_MODE) { - sif::debug << "SA DEPL FSM: WAIT_MAIN_POWER_OFF done -> FSM DONE" << std::endl; - } - sif::info << "S/A Deployment: FSM done" << std::endl; - finishFsm(returnvalue::OK); - } - } - if (stateMachine == SWITCH_DEPL_GPIOS) { - burnCountdown.setTimeout(fsmInfo.burnCountdownMs); - // This should never fail - channelAlternationCd.resetTimer(); - if (not fsmInfo.dryRun) { - sa2Off(); - sa1On(); - fsmInfo.alternationDummy = true; - } - sif::info << "S/A Deployment: Burning" << std::endl; - triggerEvent(BURN_PHASE_START, fsmInfo.burnCountdownMs, fsmInfo.dryRun); - stateMachine = BURNING; - } - if (stateMachine == BURNING) { - saGpioAlternation(); - if (burnCountdown.hasTimedOut()) { - if (DEBUG_MODE) { - sif::debug << "SA DEPL FSM: BURNING done -> WAIT_MAIN_POWER_OFF" << std::endl; - } - allOff(); - triggerEvent(BURN_PHASE_DONE, fsmInfo.burnCountdownMs, fsmInfo.dryRun); - stateMachine = WAIT_MAIN_POWER_OFF; - } - } -} - bool SolarArrayDeploymentHandler::checkMainPowerOn() { return checkMainPower(true); } bool SolarArrayDeploymentHandler::checkMainPowerOff() { return checkMainPower(false); } @@ -276,7 +285,6 @@ bool SolarArrayDeploymentHandler::startFsmOn(uint32_t burnCountdownSecs, bool dr if (burnCountdownSecs > config::SA_DEPL_MAX_BURN_TIME) { burnCountdownSecs = config::SA_DEPL_MAX_BURN_TIME; } - fsmInfo.onOff = true; fsmInfo.dryRun = dryRun; fsmInfo.burnCountdownMs = burnCountdownSecs * 1000; stateMachine = StateMachine::MAIN_POWER_ON; @@ -289,7 +297,6 @@ void SolarArrayDeploymentHandler::startFsmOff() { // off commands override the state machine. Cancel any active action commands. finishFsm(returnvalue::FAILED); } - fsmInfo.onOff = false; retryCounter = 0; stateMachine = StateMachine::MAIN_POWER_OFF; } @@ -298,7 +305,6 @@ void SolarArrayDeploymentHandler::finishFsm(ReturnValue_t resultForActionHelper) retryCounter = 0; stateMachine = StateMachine::IDLE; fsmInfo.dryRun = false; - fsmInfo.onOff = false; fsmInfo.alternationDummy = false; if (actionActive) { bool success = false; diff --git a/mission/devices/SolarArrayDeploymentHandler.h b/mission/devices/SolarArrayDeploymentHandler.h index 2e4c775e..a5b3a10e 100644 --- a/mission/devices/SolarArrayDeploymentHandler.h +++ b/mission/devices/SolarArrayDeploymentHandler.h @@ -117,8 +117,6 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, struct FsmInfo { // Not required anymore // DeploymentChannels channel; - // false if OFF, true is ON - bool onOff; bool dryRun; bool alternationDummy = false; uint32_t burnCountdownMs = config::SA_DEPL_MAX_BURN_TIME; @@ -147,6 +145,8 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, event::makeEvent(SUBSYSTEM_ID, 6, severity::HIGH); static constexpr Event DEPL_SA2_GPIO_SWTICH_OFF_FAILED = event::makeEvent(SUBSYSTEM_ID, 7, severity::HIGH); + static constexpr Event AUTONOMOUS_DEPLOYMENT_COMPLETED = + event::makeEvent(SUBSYSTEM_ID, 8, severity::INFO); FsmInfo fsmInfo; StateMachine stateMachine = IDLE; @@ -164,7 +164,7 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, ReturnValue_t performAutonomousDepl(sd::SdCard sdCard, bool dryRun); bool dryRunStringInFile(const char* filename); - bool autonomousDeplForFile(const char* filename, bool dryRun); + bool autonomousDeplForFile(sd::SdCard sdCard, const char* filename, bool dryRun); /** * This countdown is used to check if the PCDU sets the 8V line on in the intended time. */ diff --git a/tmtc b/tmtc index 772c86ab..646cf1a1 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 772c86ab04c453b12459d65327fdaaf4d1472279 +Subproject commit 646cf1a14e0fa61d5e91e26a46017be557bad642 -- 2.43.0 From e9a4c631274a2e1ad7c41a8fa177d3e392ec7e5e Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 14 Oct 2022 15:05:44 +0200 Subject: [PATCH 34/97] fix one shot flag --- mission/devices/SolarArrayDeploymentHandler.cpp | 8 ++++---- mission/devices/SolarArrayDeploymentHandler.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mission/devices/SolarArrayDeploymentHandler.cpp b/mission/devices/SolarArrayDeploymentHandler.cpp index eaecae37..3985eb21 100644 --- a/mission/devices/SolarArrayDeploymentHandler.cpp +++ b/mission/devices/SolarArrayDeploymentHandler.cpp @@ -54,9 +54,6 @@ ReturnValue_t SolarArrayDeploymentHandler::performOperation(uint8_t operationCod } readCommandQueue(); handleStateMachine(); - if (firstCycle) { - firstCycle = false; - } return returnvalue::OK; } @@ -214,7 +211,7 @@ bool SolarArrayDeploymentHandler::autonomousDeplForFile(sd::SdCard sdCard, const } // Uptime has increased by X seconds so we need to update the uptime count inside the file secsSinceBoot += Clock::getUptime().tv_sec; - if (stateSwitch or firstCycle) { + if (stateSwitch or firstAutonomousCycle) { if (deplState == AutonomousDeplState::FIRST_BURN or deplState == AutonomousDeplState::SECOND_BURN) { startFsmOn(config::SA_DEPL_BURN_TIME_SECS, dryRun); @@ -245,6 +242,9 @@ bool SolarArrayDeploymentHandler::autonomousDeplForFile(sd::SdCard sdCard, const } of << "secs_since_start: " << std::to_string(secsSinceBoot) << "\n"; } + if (firstAutonomousCycle) { + firstAutonomousCycle = false; + } return true; } diff --git a/mission/devices/SolarArrayDeploymentHandler.h b/mission/devices/SolarArrayDeploymentHandler.h index a5b3a10e..b935b096 100644 --- a/mission/devices/SolarArrayDeploymentHandler.h +++ b/mission/devices/SolarArrayDeploymentHandler.h @@ -151,7 +151,7 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, FsmInfo fsmInfo; StateMachine stateMachine = IDLE; bool actionActive = false; - bool firstCycle = true; + bool firstAutonomousCycle = true; ActionId_t activeCmd = HasActionsIF::INVALID_ACTION_ID; std::optional initUptime; PeriodicOperationDivider opDivider = PeriodicOperationDivider(5); -- 2.43.0 From c800ddfa3197ed1950461c84dd869b7ce34bca6f Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 14 Oct 2022 15:33:34 +0200 Subject: [PATCH 35/97] basic SD card remount FDIR --- bsp_q7s/OBSWConfig.h.in | 8 +++++-- bsp_q7s/core/CoreController.cpp | 23 ++++++++++++++----- bsp_q7s/core/CoreController.h | 8 +++++++ .../devices/SolarArrayDeploymentHandler.cpp | 4 ++++ 4 files changed, 35 insertions(+), 8 deletions(-) diff --git a/bsp_q7s/OBSWConfig.h.in b/bsp_q7s/OBSWConfig.h.in index 260ccc2d..f3cfa907 100644 --- a/bsp_q7s/OBSWConfig.h.in +++ b/bsp_q7s/OBSWConfig.h.in @@ -20,7 +20,6 @@ // Set to 1 if telecommands are received via the PDEC IP Core #define OBSW_TC_FROM_PDEC 0 -#define OBSW_ENABLE_TIMERS 1 #define OBSW_ADD_GOMSPACE_PCDU @OBSW_ADD_GOMSPACE_PCDU@ #define OBSW_ADD_MGT @OBSW_ADD_MGT@ #define OBSW_ADD_BPX_BATTERY_HANDLER @OBSW_ADD_BPX_BATTERY_HANDLER@ @@ -41,7 +40,11 @@ #define OBSW_ADD_PL_PCDU @OBSW_ADD_PL_PCDU@ #define OBSW_ADD_SYRLINKS @OBSW_ADD_SYRLINKS@ #define OBSW_ENABLE_SYRLINKS_TRANSMIT_TIMEOUT 0 -#define OBSW_MPSOC_JTAG_BOOT 0 + +// Configuration parameter which causes the core controller to try to keep at least one SD card +// working +#define OBSW_SD_CARD_MUST_BE_ON 1 +#define OBSW_ENABLE_TIMERS 1 // This is a really tricky switch.. It initializes the PCDU switches to their default states // at powerup. I think it would be better @@ -59,6 +62,7 @@ #define OBSW_SWITCH_TO_NORMAL_MODE_AFTER_STARTUP 1 #define OBSW_PRINT_MISSED_DEADLINES 1 +#define OBSW_MPSOC_JTAG_BOOT 0 #define OBSW_STAR_TRACKER_GROUND_CONFIG 1 #define OBSW_SYRLINKS_SIMULATED 1 #define OBSW_ADD_TEST_CODE 0 diff --git a/bsp_q7s/core/CoreController.cpp b/bsp_q7s/core/CoreController.cpp index 30d5228d..95700148 100644 --- a/bsp_q7s/core/CoreController.cpp +++ b/bsp_q7s/core/CoreController.cpp @@ -4,7 +4,6 @@ #include #include -#include "OBSWConfig.h" #include "OBSWVersion.h" #include "fsfw/serviceinterface/ServiceInterface.h" #include "fsfw/timemanager/Stopwatch.h" @@ -1243,16 +1242,16 @@ void CoreController::performMountedSdCardOperations() { } timeFileHandler(); }; - bool clearOneShotFlag = false; + bool someSdCardActive = false; if (sdInfo.active == sd::SdCard::SLOT_0 and sdcMan->isSdCardUsable(sd::SdCard::SLOT_0)) { mountedSdCardOp(sd::SdCard::SLOT_0, config::SD_0_MOUNT_POINT); - clearOneShotFlag = true; + someSdCardActive = true; } if (sdInfo.active == sd::SdCard::SLOT_1 and sdcMan->isSdCardUsable(sd::SdCard::SLOT_1)) { mountedSdCardOp(sd::SdCard::SLOT_1, config::SD_1_MOUNT_POINT); - clearOneShotFlag = true; + someSdCardActive = true; } - if (clearOneShotFlag) { + if (someSdCardActive) { performOneShotSdCardOpsSwitch = true; } } @@ -1295,7 +1294,19 @@ ReturnValue_t CoreController::performSdCardCheck() { if (active.second == sd::SdState::MOUNTED) { sdCardCheck(sd::SdCard::SLOT_1); } - +#if OBSW_SD_CARD_MUST_BE_ON == 1 + // This is FDIR. The core controller will attempt once to get some SD card working + bool someSdCardActive = false; + if ((sdInfo.active == sd::SdCard::SLOT_0 and sdcMan->isSdCardUsable(sd::SdCard::SLOT_0)) or + (sdInfo.active == sd::SdCard::SLOT_1 and sdcMan->isSdCardUsable(sd::SdCard::SLOT_1))) { + someSdCardActive = true; + } + if (not someSdCardActive and remountAttemptFlag) { + triggerEvent(NO_SD_CARD_ACTIVE); + initSdCardBlocking(); + remountAttemptFlag = false; + } +#endif return returnvalue::OK; } diff --git a/bsp_q7s/core/CoreController.h b/bsp_q7s/core/CoreController.h index 3c205e4a..460c0f8a 100644 --- a/bsp_q7s/core/CoreController.h +++ b/bsp_q7s/core/CoreController.h @@ -7,6 +7,7 @@ #include #include "CoreDefinitions.h" +#include "OBSWConfig.h" #include "bsp_q7s/fs/SdCardManager.h" #include "events/subsystemIdRanges.h" #include "fsfw/controller/ExtendedControllerBase.h" @@ -102,6 +103,9 @@ class CoreController : public ExtendedControllerBase { event::makeEvent(SUBSYSTEM_ID, 2, severity::MEDIUM); //! Trying to find a way how to determine that the reboot came from ProASIC3 or PCDU.. static constexpr Event REBOOT_HW = event::makeEvent(SUBSYSTEM_ID, 3, severity::MEDIUM); + //! [EXPORT] : [COMMENT] No SD card was active. Core controller will attempt to re-initialize + //! a SD card. + static constexpr Event NO_SD_CARD_ACTIVE = event::makeEvent(SUBSYSTEM_ID, 4, severity::HIGH); CoreController(object_id_t objectId); virtual ~CoreController(); @@ -219,6 +223,10 @@ class CoreController : public ExtendedControllerBase { core::HkSet hkSet; +#if OBSW_SD_CARD_MUST_BE_ON == 1 + bool remountAttemptFlag = true; +#endif + ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap, LocalDataPoolManager& poolManager) override; Countdown sdCardCheckCd = Countdown(120000); diff --git a/mission/devices/SolarArrayDeploymentHandler.cpp b/mission/devices/SolarArrayDeploymentHandler.cpp index 3985eb21..affc0e2e 100644 --- a/mission/devices/SolarArrayDeploymentHandler.cpp +++ b/mission/devices/SolarArrayDeploymentHandler.cpp @@ -50,6 +50,10 @@ ReturnValue_t SolarArrayDeploymentHandler::performOperation(uint8_t operationCod // perform autonomous deployment handling performAutonomousDepl(sd::SdCard::SLOT_1, dryRunStringInFile(SD_1_DEPL_FILE)); } + } else { + // TODO: This is FDIR domain. If both SD cards are not available for whatever reason, + // there is not much we can do except somehow use the scratch buffer which is + // not non-volatile. Implementation effort is considerable as well. } } readCommandQueue(); -- 2.43.0 From 43f25e80025fc422e59ce4b114a933a46e83ff74 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 14 Oct 2022 20:37:02 +0200 Subject: [PATCH 36/97] default time windows --- common/config/eive/definitions.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/config/eive/definitions.h b/common/config/eive/definitions.h index d15b5ea6..33d37812 100644 --- a/common/config/eive/definitions.h +++ b/common/config/eive/definitions.h @@ -36,8 +36,8 @@ static constexpr uint32_t MAX_FILENAME_SIZE = 50; static constexpr uint32_t SA_DEPL_INIT_BUFFER_SECS = 120; // Burn time for autonomous deployment -static constexpr uint32_t SA_DEPL_BURN_TIME_SECS = 60; // 180; -static constexpr uint32_t SA_DEPL_WAIT_TIME_SECS = 90; // 45 * 60; +static constexpr uint32_t SA_DEPL_BURN_TIME_SECS = 180; +static constexpr uint32_t SA_DEPL_WAIT_TIME_SECS = 45 * 60; // HW constraints (current limit) mean that the GPIO channels need to be switched on in alternation static constexpr uint32_t SA_DEPL_CHANNEL_ALTERNATION_INTERVAL_SECS = 5; // Maximum allowed burn time allowed by the software. -- 2.43.0 From 13a6a45d3046d14cfc6b25af5408acc6873f5786 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 18 Oct 2022 10:22:02 +0200 Subject: [PATCH 37/97] bump tmtc --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index 646cf1a1..8655f0c9 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 646cf1a14e0fa61d5e91e26a46017be557bad642 +Subproject commit 8655f0c9e6158c460e1f8bc02e73a9310e33b18f -- 2.43.0 From e781da1be4e9e22fc7b5766d162dd485261e5f99 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 18 Oct 2022 11:01:33 +0200 Subject: [PATCH 38/97] simplify power set ID handling --- mission/devices/PCDUHandler.cpp | 8 +-- .../devicedefinitions/GomspaceDefinitions.h | 50 ++++++++----------- tmtc | 2 +- 3 files changed, 26 insertions(+), 34 deletions(-) diff --git a/mission/devices/PCDUHandler.cpp b/mission/devices/PCDUHandler.cpp index 8dc78137..39a09d5a 100644 --- a/mission/devices/PCDUHandler.cpp +++ b/mission/devices/PCDUHandler.cpp @@ -52,7 +52,7 @@ ReturnValue_t PCDUHandler::initialize() { return returnvalue::FAILED; } result = pdu2Handler->getSubscriptionInterface()->subscribeForSetUpdateMessage( - static_cast(P60System::SetIds::PDU_2_CORE), this->getObjectId(), + static_cast(P60System::SetIds::CORE), this->getObjectId(), commandQueue->getId(), true); if (result != returnvalue::OK) { sif::error << "PCDUHandler::initialize: Failed to subscribe for set update messages from " @@ -68,7 +68,7 @@ ReturnValue_t PCDUHandler::initialize() { return returnvalue::FAILED; } result = pdu1Handler->getSubscriptionInterface()->subscribeForSetUpdateMessage( - static_cast(P60System::SetIds::PDU_1_CORE), this->getObjectId(), + static_cast(P60System::SetIds::CORE), this->getObjectId(), commandQueue->getId(), true); if (result != returnvalue::OK) { sif::error << "PCDUHandler::initialize: Failed to subscribe for set update messages from " @@ -110,11 +110,11 @@ void PCDUHandler::readCommandQueue() { MessageQueueId_t PCDUHandler::getCommandQueue() const { return commandQueue->getId(); } void PCDUHandler::handleChangedDataset(sid_t sid, store_address_t storeId, bool* clearMessage) { - if (sid == sid_t(objects::PDU2_HANDLER, static_cast(P60System::SetIds::PDU_2_CORE))) { + if (sid == sid_t(objects::PDU2_HANDLER, static_cast(P60System::SetIds::CORE))) { updateHkTableDataset(storeId, &pdu2CoreHk, &timeStampPdu2HkDataset); updatePdu2SwitchStates(); } else if (sid == - sid_t(objects::PDU1_HANDLER, static_cast(P60System::SetIds::PDU_1_CORE))) { + sid_t(objects::PDU1_HANDLER, static_cast(P60System::SetIds::CORE))) { updateHkTableDataset(storeId, &pdu1CoreHk, &timeStampPdu1HkDataset); updatePdu1SwitchStates(); } else { diff --git a/mission/devices/devicedefinitions/GomspaceDefinitions.h b/mission/devices/devicedefinitions/GomspaceDefinitions.h index 5d435375..325a2a0c 100644 --- a/mission/devices/devicedefinitions/GomspaceDefinitions.h +++ b/mission/devices/devicedefinitions/GomspaceDefinitions.h @@ -103,17 +103,9 @@ namespace P60System { enum class BatteryModes : uint8_t { CRITICAL = 1, SAFE = 2, NORMAL = 3, FULL = 4 }; enum class SetIds : uint32_t { - PDU_1_CORE = 1, - PDU_1_AUX = 2, - PDU_2_CORE = 3, - PDU_2_AUX = 4, - P60_CORE = 5, - P60_AUX = 6, - ACU_CORE = 7, - ACU_AUX = 8, - - PDU_1_CONFIG = 9, - PDU_2_CONFIG = 10 + CORE = 1, + AUX = 2, + CONFIG = 3 }; } // namespace P60System @@ -217,10 +209,10 @@ static const uint8_t HK_TABLE_ENTRIES = 100; class CoreHkSet : public StaticLocalDataSet<16> { public: CoreHkSet(HasLocalDataPoolIF* owner) - : StaticLocalDataSet(owner, static_cast(::P60System::SetIds::P60_CORE)) {} + : StaticLocalDataSet(owner, static_cast(::P60System::SetIds::CORE)) {} CoreHkSet(object_id_t objectId) - : StaticLocalDataSet(sid_t(objectId, static_cast(::P60System::SetIds::P60_CORE))) {} + : StaticLocalDataSet(sid_t(objectId, static_cast(::P60System::SetIds::CORE))) {} /** Measured output currents */ lp_vec_t currents = @@ -254,10 +246,10 @@ class CoreHkSet : public StaticLocalDataSet<16> { class HkTableDataset : public StaticLocalDataSet<32> { public: HkTableDataset(HasLocalDataPoolIF* owner) - : StaticLocalDataSet(owner, static_cast(::P60System::SetIds::P60_AUX)) {} + : StaticLocalDataSet(owner, static_cast(::P60System::SetIds::AUX)) {} HkTableDataset(object_id_t objectId) - : StaticLocalDataSet(sid_t(objectId, static_cast(::P60System::SetIds::P60_AUX))) {} + : StaticLocalDataSet(sid_t(objectId, static_cast(::P60System::SetIds::AUX))) {} /** Number of detected latchups on each output channel */ lp_vec_t latchups = @@ -545,25 +537,25 @@ static const uint16_t CONFIG_ADDRESS_OUT_EN_CHANNEL8 = 0x50; class Pdu1CoreHk : public ::PDU::PduCoreHk { public: Pdu1CoreHk(HasLocalDataPoolIF* owner) - : PduCoreHk(owner, static_cast(::P60System::SetIds::PDU_1_CORE)) {} + : PduCoreHk(owner, static_cast(::P60System::SetIds::CORE)) {} Pdu1CoreHk(object_id_t objectId) - : PduCoreHk(objectId, static_cast(::P60System::SetIds::PDU_1_CORE)) {} + : PduCoreHk(objectId, static_cast(::P60System::SetIds::CORE)) {} }; class Pdu1AuxHk : public ::PDU::PduAuxHk { public: Pdu1AuxHk(HasLocalDataPoolIF* owner) - : PduAuxHk(owner, static_cast(::P60System::SetIds::PDU_1_AUX)) {} + : PduAuxHk(owner, static_cast(::P60System::SetIds::AUX)) {} Pdu1AuxHk(object_id_t objectId) - : PduAuxHk(objectId, static_cast(::P60System::SetIds::PDU_1_AUX)) {} + : PduAuxHk(objectId, static_cast(::P60System::SetIds::AUX)) {} }; class Pdu1Config : public ::PDU::PduConfig { public: Pdu1Config(HasLocalDataPoolIF* owner) - : PduConfig(owner, static_cast(::P60System::SetIds::PDU_1_CONFIG)) {} + : PduConfig(owner, static_cast(::P60System::SetIds::CONFIG)) {} }; } // namespace PDU1 @@ -600,25 +592,25 @@ static const uint16_t CONFIG_ADDRESS_OUT_EN_PAYLOAD_CAMERA = 0x50; class Pdu2CoreHk : public ::PDU::PduCoreHk { public: Pdu2CoreHk(HasLocalDataPoolIF* owner) - : PduCoreHk(owner, static_cast(::P60System::SetIds::PDU_2_CORE)) {} + : PduCoreHk(owner, static_cast(::P60System::SetIds::CORE)) {} Pdu2CoreHk(object_id_t objectId) - : PduCoreHk(objectId, static_cast(::P60System::SetIds::PDU_2_CORE)) {} + : PduCoreHk(objectId, static_cast(::P60System::SetIds::CORE)) {} }; class Pdu2AuxHk : public ::PDU::PduAuxHk { public: Pdu2AuxHk(HasLocalDataPoolIF* owner) - : PduAuxHk(owner, static_cast(::P60System::SetIds::PDU_2_AUX)) {} + : PduAuxHk(owner, static_cast(::P60System::SetIds::AUX)) {} Pdu2AuxHk(object_id_t objectId) - : PduAuxHk(objectId, static_cast(::P60System::SetIds::PDU_2_AUX)) {} + : PduAuxHk(objectId, static_cast(::P60System::SetIds::AUX)) {} }; class Pdu2Config : public ::PDU::PduConfig { public: Pdu2Config(HasLocalDataPoolIF* owner) - : PduConfig(owner, static_cast(::P60System::SetIds::PDU_2_CONFIG)) {} + : PduConfig(owner, static_cast(::P60System::SetIds::CONFIG)) {} }; } // namespace PDU2 @@ -661,10 +653,10 @@ static const size_t MAX_REPLY_SIZE = HK_TABLE_SIZE; class CoreHk : public StaticLocalDataSet<14> { public: CoreHk(HasLocalDataPoolIF* owner) - : StaticLocalDataSet(owner, static_cast(::P60System::SetIds::ACU_CORE)) {} + : StaticLocalDataSet(owner, static_cast(::P60System::SetIds::CORE)) {} CoreHk(object_id_t objectId) - : StaticLocalDataSet(sid_t(objectId, static_cast(::P60System::SetIds::ACU_CORE))) {} + : StaticLocalDataSet(sid_t(objectId, static_cast(::P60System::SetIds::CORE))) {} lp_var_t mpptMode = lp_var_t(sid.objectId, pool::ACU_MPPT_MODE, this); @@ -694,10 +686,10 @@ class CoreHk : public StaticLocalDataSet<14> { class AuxHk : public StaticLocalDataSet<12> { public: AuxHk(HasLocalDataPoolIF* owner) - : StaticLocalDataSet(owner, static_cast(::P60System::SetIds::ACU_AUX)) {} + : StaticLocalDataSet(owner, static_cast(::P60System::SetIds::AUX)) {} AuxHk(object_id_t objectId) - : StaticLocalDataSet(sid_t(objectId, static_cast(::P60System::SetIds::ACU_AUX))) {} + : StaticLocalDataSet(sid_t(objectId, static_cast(::P60System::SetIds::AUX))) {} lp_vec_t dacEnables = lp_vec_t(sid.objectId, pool::ACU_DAC_ENABLES, this); diff --git a/tmtc b/tmtc index 8655f0c9..9171f23d 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 8655f0c9e6158c460e1f8bc02e73a9310e33b18f +Subproject commit 9171f23d9373fcba6b75d2f75d1b4764180bb7b5 -- 2.43.0 From b01217cf16ef0cfab0c634dfce4a16b474e09802 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 18 Oct 2022 11:08:38 +0200 Subject: [PATCH 39/97] bump tmtc --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index 9171f23d..80a57cdc 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 9171f23d9373fcba6b75d2f75d1b4764180bb7b5 +Subproject commit 80a57cdc70f8d88365ed6e77b075b2f7cae483d9 -- 2.43.0 From a0f8872ad7abbd116484c25e716e40bdd7359b19 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 18 Oct 2022 11:41:27 +0200 Subject: [PATCH 40/97] bump tmtc --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index 80a57cdc..0ddb9587 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 80a57cdc70f8d88365ed6e77b075b2f7cae483d9 +Subproject commit 0ddb9587ba48ff9108fb5da9ef39b646960d6022 -- 2.43.0 From c3b2e3ef0f39a4a2b62da76f2cc7517ee4249bc3 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 18 Oct 2022 14:08:26 +0200 Subject: [PATCH 41/97] rw fix and higher timeout for tctrl locks --- mission/controller/ThermalController.cpp | 60 ++++++++++++------------ mission/controller/ThermalController.h | 1 + mission/devices/RwHandler.cpp | 4 +- tmtc | 2 +- 4 files changed, 34 insertions(+), 33 deletions(-) diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index 10c74fca..608b68b7 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -235,7 +235,7 @@ ReturnValue_t ThermalController::checkModeCommand(Mode_t mode, Submode_t submode void ThermalController::copySensors() { { - PoolReadGuard pg0(&max31865Set0); + PoolReadGuard pg0(&max31865Set0, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT); if (pg0.getReadResult() == returnvalue::OK) { sensorTemperatures.sensor_ploc_heatspreader.value = max31865Set0.temperatureCelcius.value; sensorTemperatures.sensor_ploc_heatspreader.setValid( @@ -247,7 +247,7 @@ void ThermalController::copySensors() { } { - PoolReadGuard pg1(&max31865Set1); + PoolReadGuard pg1(&max31865Set1, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT); if (pg1.getReadResult() == returnvalue::OK) { sensorTemperatures.sensor_ploc_missionboard.value = max31865Set1.temperatureCelcius.value; sensorTemperatures.sensor_ploc_missionboard.setValid( @@ -259,7 +259,7 @@ void ThermalController::copySensors() { } { - PoolReadGuard pg2(&max31865Set2); + PoolReadGuard pg2(&max31865Set2, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT); if (pg2.getReadResult() == returnvalue::OK) { sensorTemperatures.sensor_4k_camera.value = max31865Set2.temperatureCelcius.value; sensorTemperatures.sensor_4k_camera.setValid(max31865Set2.temperatureCelcius.isValid()); @@ -270,7 +270,7 @@ void ThermalController::copySensors() { } { - PoolReadGuard pg3(&max31865Set3); + PoolReadGuard pg3(&max31865Set3, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT); if (pg3.getReadResult() == returnvalue::OK) { sensorTemperatures.sensor_dac_heatspreader.value = max31865Set3.temperatureCelcius.value; sensorTemperatures.sensor_dac_heatspreader.setValid( @@ -282,7 +282,7 @@ void ThermalController::copySensors() { } { - PoolReadGuard pg4(&max31865Set4); + PoolReadGuard pg4(&max31865Set4, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT); if (pg4.getReadResult() == returnvalue::OK) { sensorTemperatures.sensor_startracker.value = max31865Set4.temperatureCelcius.value; sensorTemperatures.sensor_startracker.setValid(max31865Set4.temperatureCelcius.isValid()); @@ -293,7 +293,7 @@ void ThermalController::copySensors() { } { - PoolReadGuard pg5(&max31865Set5); + PoolReadGuard pg5(&max31865Set5, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT); if (pg5.getReadResult() == returnvalue::OK) { sensorTemperatures.sensor_rw1.value = max31865Set5.temperatureCelcius.value; sensorTemperatures.sensor_rw1.setValid(max31865Set5.temperatureCelcius.isValid()); @@ -304,7 +304,7 @@ void ThermalController::copySensors() { } { - PoolReadGuard pg6(&max31865Set6); + PoolReadGuard pg6(&max31865Set6, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT); if (pg6.getReadResult() == returnvalue::OK) { sensorTemperatures.sensor_dro.value = max31865Set6.temperatureCelcius.value; sensorTemperatures.sensor_dro.setValid(max31865Set6.temperatureCelcius.isValid()); @@ -315,7 +315,7 @@ void ThermalController::copySensors() { } { - PoolReadGuard pg7(&max31865Set7); + PoolReadGuard pg7(&max31865Set7, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT); if (pg7.getReadResult() == returnvalue::OK) { sensorTemperatures.sensor_scex.value = max31865Set7.temperatureCelcius.value; sensorTemperatures.sensor_scex.setValid(max31865Set7.temperatureCelcius.isValid()); @@ -326,7 +326,7 @@ void ThermalController::copySensors() { } { - PoolReadGuard pg8(&max31865Set8); + PoolReadGuard pg8(&max31865Set8, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT); if (pg8.getReadResult() == returnvalue::OK) { sensorTemperatures.sensor_x8.value = max31865Set8.temperatureCelcius.value; sensorTemperatures.sensor_x8.setValid(max31865Set8.temperatureCelcius.isValid()); @@ -337,7 +337,7 @@ void ThermalController::copySensors() { } { - PoolReadGuard pg9(&max31865Set9); + PoolReadGuard pg9(&max31865Set9, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT); if (pg9.getReadResult() == returnvalue::OK) { sensorTemperatures.sensor_hpa.value = max31865Set9.temperatureCelcius.value; sensorTemperatures.sensor_hpa.setValid(max31865Set9.temperatureCelcius.isValid()); @@ -348,7 +348,7 @@ void ThermalController::copySensors() { } { - PoolReadGuard pg10(&max31865Set10); + PoolReadGuard pg10(&max31865Set10, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT); if (pg10.getReadResult() == returnvalue::OK) { sensorTemperatures.sensor_tx_modul.value = max31865Set10.temperatureCelcius.value; sensorTemperatures.sensor_tx_modul.setValid(max31865Set10.temperatureCelcius.isValid()); @@ -359,7 +359,7 @@ void ThermalController::copySensors() { } { - PoolReadGuard pg11(&max31865Set11); + PoolReadGuard pg11(&max31865Set11, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT); if (pg11.getReadResult() == returnvalue::OK) { sensorTemperatures.sensor_mpa.value = max31865Set11.temperatureCelcius.value; sensorTemperatures.sensor_mpa.setValid(max31865Set11.temperatureCelcius.isValid()); @@ -370,7 +370,7 @@ void ThermalController::copySensors() { } { - PoolReadGuard pg12(&max31865Set12); + PoolReadGuard pg12(&max31865Set12, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT); if (pg12.getReadResult() == returnvalue::OK) { sensorTemperatures.sensor_acu.value = max31865Set12.temperatureCelcius.value; sensorTemperatures.sensor_acu.setValid(max31865Set12.temperatureCelcius.isValid()); @@ -381,7 +381,7 @@ void ThermalController::copySensors() { } { - PoolReadGuard pg13(&max31865Set13); + PoolReadGuard pg13(&max31865Set13, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT); if (pg13.getReadResult() == returnvalue::OK) { sensorTemperatures.sensor_plpcdu_heatspreader.value = max31865Set13.temperatureCelcius.value; sensorTemperatures.sensor_plpcdu_heatspreader.setValid( @@ -393,7 +393,7 @@ void ThermalController::copySensors() { } { - PoolReadGuard pg14(&max31865Set14); + PoolReadGuard pg14(&max31865Set14, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT); if (pg14.getReadResult() == returnvalue::OK) { sensorTemperatures.sensor_tcs_board.value = max31865Set14.temperatureCelcius.value; sensorTemperatures.sensor_tcs_board.setValid(max31865Set14.temperatureCelcius.isValid()); @@ -404,7 +404,7 @@ void ThermalController::copySensors() { } { - PoolReadGuard pg15(&max31865Set15); + PoolReadGuard pg15(&max31865Set15, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT); if (pg15.getReadResult() == returnvalue::OK) { sensorTemperatures.sensor_magnettorquer.value = max31865Set15.temperatureCelcius.value; sensorTemperatures.sensor_magnettorquer.setValid(max31865Set15.temperatureCelcius.isValid()); @@ -415,7 +415,7 @@ void ThermalController::copySensors() { } { - PoolReadGuard pg111(&tmp1075Set1); + PoolReadGuard pg111(&tmp1075Set1, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT); if (pg111.getReadResult() == returnvalue::OK) { sensorTemperatures.sensor_tmp1075_1.value = tmp1075Set1.temperatureCelcius.value; sensorTemperatures.sensor_tmp1075_1.setValid(tmp1075Set1.temperatureCelcius.isValid()); @@ -426,7 +426,7 @@ void ThermalController::copySensors() { } { - PoolReadGuard pg112(&tmp1075Set2); + PoolReadGuard pg112(&tmp1075Set2, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT); if (pg112.getReadResult() == returnvalue::OK) { sensorTemperatures.sensor_tmp1075_2.value = tmp1075Set2.temperatureCelcius.value; sensorTemperatures.sensor_tmp1075_2.setValid(tmp1075Set2.temperatureCelcius.isValid()); @@ -439,7 +439,7 @@ void ThermalController::copySensors() { void ThermalController::copySus() { { - PoolReadGuard pg0(&susSet0); + PoolReadGuard pg0(&susSet0, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT); if (pg0.getReadResult() == returnvalue::OK) { susTemperatures.sus_0_n_loc_xfyfzm_pt_xf.value = susSet0.temperatureCelcius.value; susTemperatures.sus_0_n_loc_xfyfzm_pt_xf.setValid(susSet0.temperatureCelcius.isValid()); @@ -450,7 +450,7 @@ void ThermalController::copySus() { } { - PoolReadGuard pg1(&susSet1); + PoolReadGuard pg1(&susSet1, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT); if (pg1.getReadResult() == returnvalue::OK) { susTemperatures.sus_6_r_loc_xfybzm_pt_xf.value = susSet1.temperatureCelcius.value; susTemperatures.sus_6_r_loc_xfybzm_pt_xf.setValid(susSet1.temperatureCelcius.isValid()); @@ -461,7 +461,7 @@ void ThermalController::copySus() { } { - PoolReadGuard pg2(&susSet2); + PoolReadGuard pg2(&susSet2, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT); if (pg2.getReadResult() == returnvalue::OK) { susTemperatures.sus_1_n_loc_xbyfzm_pt_xb.value = susSet2.temperatureCelcius.value; susTemperatures.sus_1_n_loc_xbyfzm_pt_xb.setValid(susSet2.temperatureCelcius.isValid()); @@ -472,7 +472,7 @@ void ThermalController::copySus() { } { - PoolReadGuard pg3(&susSet3); + PoolReadGuard pg3(&susSet3, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT); if (pg3.getReadResult() == returnvalue::OK) { susTemperatures.sus_7_r_loc_xbybzm_pt_xb.value = susSet3.temperatureCelcius.value; susTemperatures.sus_7_r_loc_xbybzm_pt_xb.setValid(susSet3.temperatureCelcius.isValid()); @@ -483,7 +483,7 @@ void ThermalController::copySus() { } { - PoolReadGuard pg4(&susSet4); + PoolReadGuard pg4(&susSet4, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT); if (pg4.getReadResult() == returnvalue::OK) { susTemperatures.sus_2_n_loc_xfybzb_pt_yb.value = susSet4.temperatureCelcius.value; susTemperatures.sus_2_n_loc_xfybzb_pt_yb.setValid(susSet4.temperatureCelcius.isValid()); @@ -494,7 +494,7 @@ void ThermalController::copySus() { } { - PoolReadGuard pg5(&susSet5); + PoolReadGuard pg5(&susSet5, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT); if (pg5.getReadResult() == returnvalue::OK) { susTemperatures.sus_8_r_loc_xbybzb_pt_yb.value = susSet5.temperatureCelcius.value; susTemperatures.sus_8_r_loc_xbybzb_pt_yb.setValid(susSet5.temperatureCelcius.isValid()); @@ -505,7 +505,7 @@ void ThermalController::copySus() { } { - PoolReadGuard pg6(&susSet6); + PoolReadGuard pg6(&susSet6, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT); if (pg6.getReadResult() == returnvalue::OK) { susTemperatures.sus_3_n_loc_xfybzf_pt_yf.value = susSet6.temperatureCelcius.value; susTemperatures.sus_3_n_loc_xfybzf_pt_yf.setValid(susSet6.temperatureCelcius.isValid()); @@ -516,7 +516,7 @@ void ThermalController::copySus() { } { - PoolReadGuard pg7(&susSet7); + PoolReadGuard pg7(&susSet7, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT); if (pg7.getReadResult() == returnvalue::OK) { susTemperatures.sus_9_r_loc_xbybzb_pt_yf.value = susSet7.temperatureCelcius.value; susTemperatures.sus_9_r_loc_xbybzb_pt_yf.setValid(susSet7.temperatureCelcius.isValid()); @@ -527,7 +527,7 @@ void ThermalController::copySus() { } { - PoolReadGuard pg8(&susSet8); + PoolReadGuard pg8(&susSet8, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT); if (pg8.getReadResult() == returnvalue::OK) { susTemperatures.sus_4_n_loc_xmyfzf_pt_zf.value = susSet8.temperatureCelcius.value; susTemperatures.sus_4_n_loc_xmyfzf_pt_zf.setValid(susSet8.temperatureCelcius.isValid()); @@ -538,7 +538,7 @@ void ThermalController::copySus() { } { - PoolReadGuard pg9(&susSet9); + PoolReadGuard pg9(&susSet9, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT); if (pg9.getReadResult() == returnvalue::OK) { susTemperatures.sus_10_n_loc_xmybzf_pt_zf.value = susSet9.temperatureCelcius.value; susTemperatures.sus_10_n_loc_xmybzf_pt_zf.setValid(susSet9.temperatureCelcius.isValid()); @@ -549,7 +549,7 @@ void ThermalController::copySus() { } { - PoolReadGuard pg10(&susSet10); + PoolReadGuard pg10(&susSet10, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT); if (pg10.getReadResult() == returnvalue::OK) { susTemperatures.sus_5_n_loc_xfymzb_pt_zb.value = susSet10.temperatureCelcius.value; susTemperatures.sus_5_n_loc_xfymzb_pt_zb.setValid(susSet10.temperatureCelcius.isValid()); @@ -560,7 +560,7 @@ void ThermalController::copySus() { } { - PoolReadGuard pg11(&susSet11); + PoolReadGuard pg11(&susSet11, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT); if (pg11.getReadResult() == returnvalue::OK) { susTemperatures.sus_11_r_loc_xbymzb_pt_zb.value = susSet11.temperatureCelcius.value; susTemperatures.sus_11_r_loc_xbymzb_pt_zb.setValid(susSet11.temperatureCelcius.isValid()); diff --git a/mission/controller/ThermalController.h b/mission/controller/ThermalController.h index 29661d5e..7ca517cb 100644 --- a/mission/controller/ThermalController.h +++ b/mission/controller/ThermalController.h @@ -75,6 +75,7 @@ class ThermalController : public ExtendedControllerBase { // Initial delay to make sure all pool variables have been initialized their owners Countdown initialCountdown = Countdown(DELAY); + static constexpr dur_millis_t MUTEX_TIMEOUT = 50; void copySensors(); void copySus(); void copyDevices(); diff --git a/mission/devices/RwHandler.cpp b/mission/devices/RwHandler.cpp index b7e26123..732bb9fe 100644 --- a/mission/devices/RwHandler.cpp +++ b/mission/devices/RwHandler.cpp @@ -304,9 +304,9 @@ ReturnValue_t RwHandler::checkSpeedAndRampTime(const uint8_t* commandData, size_ return INVALID_SPEED; } - uint16_t rampTime = *(commandData + 4) << 8 | *(commandData + 5); + uint16_t rampTime = (*(commandData + 4) << 8) | *(commandData + 5); - if (rampTime < 10 || rampTime > 10000) { + if (rampTime < 10 || rampTime > 20000) { sif::error << "RwHandler::checkSpeedAndRampTime: Command has invalid ramp time" << std::endl; return INVALID_RAMP_TIME; } diff --git a/tmtc b/tmtc index 0ddb9587..7957ed84 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 0ddb9587ba48ff9108fb5da9ef39b646960d6022 +Subproject commit 7957ed844e6b2d143cf780d3cc5a3ba485a06e70 -- 2.43.0 From 83362f7a0072f2afb948ffc4cb2672941f0d4aa9 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 18 Oct 2022 17:51:20 +0200 Subject: [PATCH 42/97] bump tmtc --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index 7957ed84..b2bab4c9 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 7957ed844e6b2d143cf780d3cc5a3ba485a06e70 +Subproject commit b2bab4c964848d6f78a6f44525166dcf24cc46b6 -- 2.43.0 From 371a11684ae71b25e704a77a8c8d2959aef33da1 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 19 Oct 2022 10:46:57 +0200 Subject: [PATCH 43/97] cleanr PL PCDU data on off cmd --- mission/devices/PCDUHandler.cpp | 11 +++++------ mission/devices/PayloadPcduHandler.cpp | 6 ++++++ mission/devices/PayloadPcduHandler.h | 1 + .../devices/devicedefinitions/GomspaceDefinitions.h | 6 +----- tmtc | 2 +- 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/mission/devices/PCDUHandler.cpp b/mission/devices/PCDUHandler.cpp index 39a09d5a..91881db5 100644 --- a/mission/devices/PCDUHandler.cpp +++ b/mission/devices/PCDUHandler.cpp @@ -52,8 +52,8 @@ ReturnValue_t PCDUHandler::initialize() { return returnvalue::FAILED; } result = pdu2Handler->getSubscriptionInterface()->subscribeForSetUpdateMessage( - static_cast(P60System::SetIds::CORE), this->getObjectId(), - commandQueue->getId(), true); + static_cast(P60System::SetIds::CORE), this->getObjectId(), commandQueue->getId(), + true); if (result != returnvalue::OK) { sif::error << "PCDUHandler::initialize: Failed to subscribe for set update messages from " << "PDU2Handler" << std::endl; @@ -68,8 +68,8 @@ ReturnValue_t PCDUHandler::initialize() { return returnvalue::FAILED; } result = pdu1Handler->getSubscriptionInterface()->subscribeForSetUpdateMessage( - static_cast(P60System::SetIds::CORE), this->getObjectId(), - commandQueue->getId(), true); + static_cast(P60System::SetIds::CORE), this->getObjectId(), commandQueue->getId(), + true); if (result != returnvalue::OK) { sif::error << "PCDUHandler::initialize: Failed to subscribe for set update messages from " << "PDU1Handler" << std::endl; @@ -113,8 +113,7 @@ void PCDUHandler::handleChangedDataset(sid_t sid, store_address_t storeId, bool* if (sid == sid_t(objects::PDU2_HANDLER, static_cast(P60System::SetIds::CORE))) { updateHkTableDataset(storeId, &pdu2CoreHk, &timeStampPdu2HkDataset); updatePdu2SwitchStates(); - } else if (sid == - sid_t(objects::PDU1_HANDLER, static_cast(P60System::SetIds::CORE))) { + } else if (sid == sid_t(objects::PDU1_HANDLER, static_cast(P60System::SetIds::CORE))) { updateHkTableDataset(storeId, &pdu1CoreHk, &timeStampPdu1HkDataset); updatePdu1SwitchStates(); } else { diff --git a/mission/devices/PayloadPcduHandler.cpp b/mission/devices/PayloadPcduHandler.cpp index 56822bd5..d9e41c7f 100644 --- a/mission/devices/PayloadPcduHandler.cpp +++ b/mission/devices/PayloadPcduHandler.cpp @@ -33,6 +33,7 @@ void PayloadPcduHandler::doStartUp() { if (pwrStateMachine.getState() == power::States::IDLE) { pwrStateMachine.start(MODE_ON, pwrSubmode); } + clearSetOnOffFlag = true; auto opCode = pwrStateMachine.fsm(); if (opCode == power::OpCodes::TO_NOT_OFF_DONE or opCode == power::OpCodes::TIMEOUT_OCCURED) { pwrStateMachine.reset(); @@ -50,6 +51,11 @@ void PayloadPcduHandler::doShutDown() { if (pwrStateMachine.getState() == power::States::IDLE) { pwrStateMachine.start(MODE_OFF, 0); } + if (clearSetOnOffFlag) { + std::memset(adcSet.processed.value, 0, adcSet.processed.getSerializedSize()); + clearSetOnOffFlag = false; + } + auto opCode = pwrStateMachine.fsm(); if (opCode == power::OpCodes::TO_OFF_DONE or opCode == power::OpCodes::TIMEOUT_OCCURED) { pwrStateMachine.reset(); diff --git a/mission/devices/PayloadPcduHandler.h b/mission/devices/PayloadPcduHandler.h index 6a9334ca..2f89c837 100644 --- a/mission/devices/PayloadPcduHandler.h +++ b/mission/devices/PayloadPcduHandler.h @@ -124,6 +124,7 @@ class PayloadPcduHandler : public DeviceHandlerBase { bool txToMpaInjectionRequested = false; bool mpaToHpaInjectionRequested = false; bool allOnInjectRequested = false; + bool clearSetOnOffFlag = true; PeriodicOperationDivider opDivider = PeriodicOperationDivider(5); uint8_t tempReadDivisor = 1; diff --git a/mission/devices/devicedefinitions/GomspaceDefinitions.h b/mission/devices/devicedefinitions/GomspaceDefinitions.h index 325a2a0c..d2ffdc25 100644 --- a/mission/devices/devicedefinitions/GomspaceDefinitions.h +++ b/mission/devices/devicedefinitions/GomspaceDefinitions.h @@ -102,11 +102,7 @@ namespace P60System { enum class BatteryModes : uint8_t { CRITICAL = 1, SAFE = 2, NORMAL = 3, FULL = 4 }; -enum class SetIds : uint32_t { - CORE = 1, - AUX = 2, - CONFIG = 3 -}; +enum class SetIds : uint32_t { CORE = 1, AUX = 2, CONFIG = 3 }; } // namespace P60System diff --git a/tmtc b/tmtc index b2bab4c9..9493cdaa 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit b2bab4c964848d6f78a6f44525166dcf24cc46b6 +Subproject commit 9493cdaabf3cef636dcab2c98768215b0e58636b -- 2.43.0 From a0356a50926019f0496acdf66b758432187504c2 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 19 Oct 2022 15:36:57 +0200 Subject: [PATCH 44/97] imtq update --- mission/controller/AcsController.h | 3 + mission/devices/IMTQHandler.cpp | 1 + mission/devices/IMTQHandler.h | 1 + mission/devices/PCDUHandler.cpp | 11 +- .../devicedefinitions/GomspaceDefinitions.h | 6 +- .../IMTQHandlerDefinitions.h | 103 +++++++++++++----- tmtc | 2 +- 7 files changed, 86 insertions(+), 41 deletions(-) diff --git a/mission/controller/AcsController.h b/mission/controller/AcsController.h index c20ae94d..b1ad7090 100644 --- a/mission/controller/AcsController.h +++ b/mission/controller/AcsController.h @@ -44,6 +44,7 @@ class AcsController : public ExtendedControllerBase { RM3100::Rm3100PrimaryDataset mgm3Rm3100Set = RM3100::Rm3100PrimaryDataset(objects::MGM_3_RM3100_HANDLER); IMTQ::RawMtmMeasurementSet imtqMgmSet = IMTQ::RawMtmMeasurementSet(objects::IMTQ_HANDLER); + IMTQ::DipoleActuationSet dipoleSet = IMTQ::DipoleActuationSet(objects::IMTQ_HANDLER); PoolEntry mgm0PoolVec = PoolEntry(3); PoolEntry mgm1PoolVec = PoolEntry(3); @@ -70,6 +71,8 @@ class AcsController : public ExtendedControllerBase { SUS::SusDataset(objects::SUS_11_R_LOC_XBYMZB_PT_ZB), }; + + // Initial delay to make sure all pool variables have been initialized their owners Countdown initialCountdown = Countdown(INIT_DELAY); }; diff --git a/mission/devices/IMTQHandler.cpp b/mission/devices/IMTQHandler.cpp index 6ab5ed48..f6047c48 100644 --- a/mission/devices/IMTQHandler.cpp +++ b/mission/devices/IMTQHandler.cpp @@ -13,6 +13,7 @@ IMTQHandler::IMTQHandler(object_id_t objectId, object_id_t comIF, CookieIF* comC engHkDataset(this), calMtmMeasurementSet(this), rawMtmMeasurementSet(this), + dipoleSet(*this), posXselfTestDataset(this), negXselfTestDataset(this), posYselfTestDataset(this), diff --git a/mission/devices/IMTQHandler.h b/mission/devices/IMTQHandler.h index 5102b2e0..92df8aae 100644 --- a/mission/devices/IMTQHandler.h +++ b/mission/devices/IMTQHandler.h @@ -95,6 +95,7 @@ class IMTQHandler : public DeviceHandlerBase { IMTQ::EngHkDataset engHkDataset; IMTQ::CalibratedMtmMeasurementSet calMtmMeasurementSet; IMTQ::RawMtmMeasurementSet rawMtmMeasurementSet; + IMTQ::DipoleActuationSet dipoleSet; IMTQ::PosXSelfTestSet posXselfTestDataset; IMTQ::NegXSelfTestSet negXselfTestDataset; IMTQ::PosYSelfTestSet posYselfTestDataset; diff --git a/mission/devices/PCDUHandler.cpp b/mission/devices/PCDUHandler.cpp index 39a09d5a..91881db5 100644 --- a/mission/devices/PCDUHandler.cpp +++ b/mission/devices/PCDUHandler.cpp @@ -52,8 +52,8 @@ ReturnValue_t PCDUHandler::initialize() { return returnvalue::FAILED; } result = pdu2Handler->getSubscriptionInterface()->subscribeForSetUpdateMessage( - static_cast(P60System::SetIds::CORE), this->getObjectId(), - commandQueue->getId(), true); + static_cast(P60System::SetIds::CORE), this->getObjectId(), commandQueue->getId(), + true); if (result != returnvalue::OK) { sif::error << "PCDUHandler::initialize: Failed to subscribe for set update messages from " << "PDU2Handler" << std::endl; @@ -68,8 +68,8 @@ ReturnValue_t PCDUHandler::initialize() { return returnvalue::FAILED; } result = pdu1Handler->getSubscriptionInterface()->subscribeForSetUpdateMessage( - static_cast(P60System::SetIds::CORE), this->getObjectId(), - commandQueue->getId(), true); + static_cast(P60System::SetIds::CORE), this->getObjectId(), commandQueue->getId(), + true); if (result != returnvalue::OK) { sif::error << "PCDUHandler::initialize: Failed to subscribe for set update messages from " << "PDU1Handler" << std::endl; @@ -113,8 +113,7 @@ void PCDUHandler::handleChangedDataset(sid_t sid, store_address_t storeId, bool* if (sid == sid_t(objects::PDU2_HANDLER, static_cast(P60System::SetIds::CORE))) { updateHkTableDataset(storeId, &pdu2CoreHk, &timeStampPdu2HkDataset); updatePdu2SwitchStates(); - } else if (sid == - sid_t(objects::PDU1_HANDLER, static_cast(P60System::SetIds::CORE))) { + } else if (sid == sid_t(objects::PDU1_HANDLER, static_cast(P60System::SetIds::CORE))) { updateHkTableDataset(storeId, &pdu1CoreHk, &timeStampPdu1HkDataset); updatePdu1SwitchStates(); } else { diff --git a/mission/devices/devicedefinitions/GomspaceDefinitions.h b/mission/devices/devicedefinitions/GomspaceDefinitions.h index 325a2a0c..d2ffdc25 100644 --- a/mission/devices/devicedefinitions/GomspaceDefinitions.h +++ b/mission/devices/devicedefinitions/GomspaceDefinitions.h @@ -102,11 +102,7 @@ namespace P60System { enum class BatteryModes : uint8_t { CRITICAL = 1, SAFE = 2, NORMAL = 3, FULL = 4 }; -enum class SetIds : uint32_t { - CORE = 1, - AUX = 2, - CONFIG = 3 -}; +enum class SetIds : uint32_t { CORE = 1, AUX = 2, CONFIG = 3 }; } // namespace P60System diff --git a/mission/devices/devicedefinitions/IMTQHandlerDefinitions.h b/mission/devices/devicedefinitions/IMTQHandlerDefinitions.h index 485be5da..ddb0af5b 100644 --- a/mission/devices/devicedefinitions/IMTQHandlerDefinitions.h +++ b/mission/devices/devicedefinitions/IMTQHandlerDefinitions.h @@ -1,6 +1,7 @@ #ifndef MISSION_DEVICES_DEVICEDEFINITIONS_IMTQDEFINITIONS_H_ #define MISSION_DEVICES_DEVICEDEFINITIONS_IMTQDEFINITIONS_H_ +#include #include namespace IMTQ { @@ -27,15 +28,18 @@ static const uint8_t GET_TEMP_REPLY_SIZE = 2; static const uint8_t CFGR_CMD_SIZE = 3; static const uint8_t POINTER_REG_SIZE = 1; -static const uint32_t ENG_HK_DATA_SET_ID = 1; -static const uint32_t CAL_MTM_SET = 2; -static const uint32_t RAW_MTM_SET = 3; -static const uint32_t POS_X_TEST_DATASET = 4; -static const uint32_t NEG_X_TEST_DATASET = 5; -static const uint32_t POS_Y_TEST_DATASET = 6; -static const uint32_t NEG_Y_TEST_DATASET = 7; -static const uint32_t POS_Z_TEST_DATASET = 8; -static const uint32_t NEG_Z_TEST_DATASET = 9; +enum SetIds : uint32_t { + ENG_HK = 1, + CAL_MGM = 2, + RAW_MGM = 3, + POS_X_TEST = 4, + NEG_X_TEST = 5, + POS_Y_TEST = 6, + NEG_Y_TEST = 7, + POS_Z_TEST = 8, + NEG_Z_TEST = 9, + DIPOLES = 10 +}; static const uint8_t SIZE_ENG_HK_COMMAND = 1; static const uint8_t SIZE_STATUS_REPLY = 2; @@ -103,7 +107,7 @@ static const uint8_t Z_NEGATIVE = 0x6; static const uint8_t FINA = 0x7; } // namespace SELF_TEST_STEPS -enum IMTQPoolIds : lp_id_t { +enum PoolIds : lp_id_t { DIGITAL_VOLTAGE_MV, ANALOG_VOLTAGE_MV, DIGITAL_CURRENT, @@ -119,6 +123,10 @@ enum IMTQPoolIds : lp_id_t { ACTUATION_CAL_STATUS, MTM_RAW, ACTUATION_RAW_STATUS, + DIPOLES_X, + DIPOLES_Y, + DIPOLES_Z, + CURRENT_TORQUE_DURATION, INIT_POS_X_ERR, INIT_POS_X_RAW_MAG_X, @@ -375,9 +383,9 @@ enum IMTQPoolIds : lp_id_t { class EngHkDataset : public StaticLocalDataSet { public: - EngHkDataset(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, ENG_HK_DATA_SET_ID) {} + EngHkDataset(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, IMTQ::SetIds::ENG_HK) {} - EngHkDataset(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, ENG_HK_DATA_SET_ID)) {} + EngHkDataset(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, IMTQ::SetIds::ENG_HK)) {} lp_var_t digitalVoltageMv = lp_var_t(sid.objectId, DIGITAL_VOLTAGE_MV, this); lp_var_t analogVoltageMv = lp_var_t(sid.objectId, ANALOG_VOLTAGE_MV, this); @@ -398,13 +406,14 @@ class EngHkDataset : public StaticLocalDataSet { */ class CalibratedMtmMeasurementSet : public StaticLocalDataSet { public: - CalibratedMtmMeasurementSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, CAL_MTM_SET) {} + CalibratedMtmMeasurementSet(HasLocalDataPoolIF* owner) + : StaticLocalDataSet(owner, IMTQ::SetIds::CAL_MGM) {} CalibratedMtmMeasurementSet(object_id_t objectId) - : StaticLocalDataSet(sid_t(objectId, CAL_MTM_SET)) {} + : StaticLocalDataSet(sid_t(objectId, IMTQ::SetIds::CAL_MGM)) {} /** The unit of all measurements is nT */ - lp_vec_t mgmXyz = lp_vec_t(sid.objectId, MGM_CAL_NT); + lp_vec_t mgmXyz = lp_vec_t(sid.objectId, MGM_CAL_NT, this); /** 1 if coils were actuating during measurement otherwise 0 */ lp_var_t coilActuationStatus = lp_var_t(sid.objectId, ACTUATION_CAL_STATUS, this); @@ -415,9 +424,11 @@ class CalibratedMtmMeasurementSet : public StaticLocalDataSet { public: - RawMtmMeasurementSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, RAW_MTM_SET) {} + RawMtmMeasurementSet(HasLocalDataPoolIF* owner) + : StaticLocalDataSet(owner, IMTQ::SetIds::RAW_MGM) {} - RawMtmMeasurementSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, RAW_MTM_SET)) {} + RawMtmMeasurementSet(object_id_t objectId) + : StaticLocalDataSet(sid_t(objectId, IMTQ::SetIds::RAW_MGM)) {} /** The unit of all measurements is nT */ lp_vec_t mtmRawNt = lp_vec_t(sid.objectId, MTM_RAW, this); @@ -462,6 +473,40 @@ class CommandDipolePacket : public SerialLinkedListAdapter { SerializeElement duration; }; +class DipoleActuationSet : public StaticLocalDataSet<4> { + public: + DipoleActuationSet(HasLocalDataPoolIF& owner) + : StaticLocalDataSet(&owner, IMTQ::SetIds::DIPOLES) {} + DipoleActuationSet(object_id_t objectId) + : StaticLocalDataSet(sid_t(objectId, IMTQ::SetIds::DIPOLES)) {} + + void setDipoles(uint16_t xDipole_, uint16_t yDipole_, uint16_t zDipole_, + uint16_t currentTorqueDurationMs_) { + PoolReadGuard pg(this); + newActuation = false; + if (xDipole.value != xDipole_) { + newActuation = true; + } + xDipole = xDipole_; + if (yDipole.value != yDipole_) { + newActuation = true; + } + yDipole = yDipole_; + if (zDipole.value != zDipole_) { + newActuation = true; + } + zDipole = zDipole_; + currentTorqueDurationMs = currentTorqueDurationMs_; + } + + private: + lp_var_t xDipole = lp_var_t(sid.objectId, DIPOLES_X, this); + lp_var_t yDipole = lp_var_t(sid.objectId, DIPOLES_Y, this); + lp_var_t zDipole = lp_var_t(sid.objectId, DIPOLES_Z, this); + lp_var_t currentTorqueDurationMs = + lp_var_t(sid.objectId, CURRENT_TORQUE_DURATION, this); + bool newActuation = false; +}; /** * @brief This dataset can be used to store the self test results of the +X self test. * @@ -479,10 +524,10 @@ class CommandDipolePacket : public SerialLinkedListAdapter { class PosXSelfTestSet : public StaticLocalDataSet { public: PosXSelfTestSet(HasLocalDataPoolIF* owner) - : StaticLocalDataSet(owner, IMTQ::POS_X_TEST_DATASET) {} + : StaticLocalDataSet(owner, IMTQ::SetIds::POS_X_TEST) {} PosXSelfTestSet(object_id_t objectId) - : StaticLocalDataSet(sid_t(objectId, IMTQ::POS_X_TEST_DATASET)) {} + : StaticLocalDataSet(sid_t(objectId, IMTQ::SetIds::POS_X_TEST)) {} /** INIT block */ lp_var_t initErr = lp_var_t(sid.objectId, INIT_POS_X_ERR, this); @@ -556,10 +601,10 @@ class PosXSelfTestSet : public StaticLocalDataSet { class NegXSelfTestSet : public StaticLocalDataSet { public: NegXSelfTestSet(HasLocalDataPoolIF* owner) - : StaticLocalDataSet(owner, IMTQ::NEG_X_TEST_DATASET) {} + : StaticLocalDataSet(owner, IMTQ::SetIds::NEG_X_TEST) {} NegXSelfTestSet(object_id_t objectId) - : StaticLocalDataSet(sid_t(objectId, IMTQ::NEG_X_TEST_DATASET)) {} + : StaticLocalDataSet(sid_t(objectId, IMTQ::SetIds::NEG_X_TEST)) {} /** INIT block */ lp_var_t initErr = lp_var_t(sid.objectId, INIT_NEG_X_ERR, this); @@ -633,10 +678,10 @@ class NegXSelfTestSet : public StaticLocalDataSet { class PosYSelfTestSet : public StaticLocalDataSet { public: PosYSelfTestSet(HasLocalDataPoolIF* owner) - : StaticLocalDataSet(owner, IMTQ::POS_Y_TEST_DATASET) {} + : StaticLocalDataSet(owner, IMTQ::SetIds::POS_Y_TEST) {} PosYSelfTestSet(object_id_t objectId) - : StaticLocalDataSet(sid_t(objectId, IMTQ::POS_Y_TEST_DATASET)) {} + : StaticLocalDataSet(sid_t(objectId, IMTQ::SetIds::POS_Y_TEST)) {} /** INIT block */ lp_var_t initErr = lp_var_t(sid.objectId, INIT_POS_Y_ERR, this); @@ -710,10 +755,10 @@ class PosYSelfTestSet : public StaticLocalDataSet { class NegYSelfTestSet : public StaticLocalDataSet { public: NegYSelfTestSet(HasLocalDataPoolIF* owner) - : StaticLocalDataSet(owner, IMTQ::NEG_Y_TEST_DATASET) {} + : StaticLocalDataSet(owner, IMTQ::SetIds::NEG_Y_TEST) {} NegYSelfTestSet(object_id_t objectId) - : StaticLocalDataSet(sid_t(objectId, IMTQ::NEG_Y_TEST_DATASET)) {} + : StaticLocalDataSet(sid_t(objectId, IMTQ::SetIds::NEG_Y_TEST)) {} /** INIT block */ lp_var_t initErr = lp_var_t(sid.objectId, INIT_NEG_Y_ERR, this); @@ -787,10 +832,10 @@ class NegYSelfTestSet : public StaticLocalDataSet { class PosZSelfTestSet : public StaticLocalDataSet { public: PosZSelfTestSet(HasLocalDataPoolIF* owner) - : StaticLocalDataSet(owner, IMTQ::POS_Z_TEST_DATASET) {} + : StaticLocalDataSet(owner, IMTQ::SetIds::POS_Z_TEST) {} PosZSelfTestSet(object_id_t objectId) - : StaticLocalDataSet(sid_t(objectId, IMTQ::POS_Z_TEST_DATASET)) {} + : StaticLocalDataSet(sid_t(objectId, IMTQ::SetIds::POS_Z_TEST)) {} /** INIT block */ lp_var_t initErr = lp_var_t(sid.objectId, INIT_POS_Z_ERR, this); @@ -864,10 +909,10 @@ class PosZSelfTestSet : public StaticLocalDataSet { class NegZSelfTestSet : public StaticLocalDataSet { public: NegZSelfTestSet(HasLocalDataPoolIF* owner) - : StaticLocalDataSet(owner, IMTQ::NEG_Z_TEST_DATASET) {} + : StaticLocalDataSet(owner, IMTQ::SetIds::NEG_Z_TEST) {} NegZSelfTestSet(object_id_t objectId) - : StaticLocalDataSet(sid_t(objectId, IMTQ::NEG_Z_TEST_DATASET)) {} + : StaticLocalDataSet(sid_t(objectId, IMTQ::SetIds::NEG_Z_TEST)) {} /** INIT block */ lp_var_t initErr = lp_var_t(sid.objectId, INIT_NEG_Z_ERR, this); diff --git a/tmtc b/tmtc index b2bab4c9..87e40fab 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit b2bab4c964848d6f78a6f44525166dcf24cc46b6 +Subproject commit 87e40fab0f45b4b40f0f477ad5e946e61dcb5e07 -- 2.43.0 From 386fc604417f70abf9295d42d595915609eca983 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 19 Oct 2022 18:52:16 +0200 Subject: [PATCH 45/97] new static variables to make torque status available --- bsp_q7s/core/ObjectFactory.cpp | 4 +- mission/devices/CMakeLists.txt | 2 +- .../{IMTQHandler.cpp => ImtqHandler.cpp} | 82 +++++++++++-------- .../devices/{IMTQHandler.h => ImtqHandler.h} | 16 +++- 4 files changed, 63 insertions(+), 41 deletions(-) rename mission/devices/{IMTQHandler.cpp => ImtqHandler.cpp} (97%) rename mission/devices/{IMTQHandler.h => ImtqHandler.h} (95%) diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 74af9564..deee8c53 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -70,7 +70,7 @@ #include "mission/devices/BpxBatteryHandler.h" #include "mission/devices/GyroADIS1650XHandler.h" #include "mission/devices/HeaterHandler.h" -#include "mission/devices/IMTQHandler.h" +#include #include "mission/devices/Max31865PT1000Handler.h" #include "mission/devices/P60DockHandler.h" #include "mission/devices/PCDUHandler.h" @@ -889,7 +889,7 @@ void ObjectFactory::createStrComponents(PowerSwitchIF* pwrSwitcher) { void ObjectFactory::createImtqComponents(PowerSwitchIF* pwrSwitcher) { I2cCookie* imtqI2cCookie = new I2cCookie(addresses::IMTQ, IMTQ::MAX_REPLY_SIZE, q7s::I2C_DEFAULT_DEV); - auto imtqHandler = new IMTQHandler(objects::IMTQ_HANDLER, objects::I2C_COM_IF, imtqI2cCookie, + auto imtqHandler = new ImtqHandler(objects::IMTQ_HANDLER, objects::I2C_COM_IF, imtqI2cCookie, pcdu::Switches::PDU1_CH3_MGT_5V); imtqHandler->setPowerSwitcher(pwrSwitcher); static_cast(imtqHandler); diff --git a/mission/devices/CMakeLists.txt b/mission/devices/CMakeLists.txt index 56184ea4..0bfb1a2d 100644 --- a/mission/devices/CMakeLists.txt +++ b/mission/devices/CMakeLists.txt @@ -11,7 +11,7 @@ target_sources( SyrlinksHkHandler.cpp Max31865PT1000Handler.cpp Max31865EiveHandler.cpp - IMTQHandler.cpp + ImtqHandler.cpp HeaterHandler.cpp RadiationSensorHandler.cpp GyroADIS1650XHandler.cpp diff --git a/mission/devices/IMTQHandler.cpp b/mission/devices/ImtqHandler.cpp similarity index 97% rename from mission/devices/IMTQHandler.cpp rename to mission/devices/ImtqHandler.cpp index f6047c48..adb9f83b 100644 --- a/mission/devices/IMTQHandler.cpp +++ b/mission/devices/ImtqHandler.cpp @@ -1,13 +1,16 @@ -#include "IMTQHandler.h" - #include #include +#include #include #include "OBSWConfig.h" -IMTQHandler::IMTQHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie, +MutexIF* ImtqHandler::TORQUE_LOCK = nullptr; +bool ImtqHandler::TORQUEING = false; +Countdown ImtqHandler::TORQUE_COUNTDOWN = Countdown(); + +ImtqHandler::ImtqHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie, power::Switch_t pwrSwitcher) : DeviceHandlerBase(objectId, comIF, comCookie), engHkDataset(this), @@ -24,11 +27,12 @@ IMTQHandler::IMTQHandler(object_id_t objectId, object_id_t comIF, CookieIF* comC if (comCookie == nullptr) { sif::error << "IMTQHandler: Invalid com cookie" << std::endl; } + TORQUE_LOCK = MutexFactory::instance()->createMutex(); } -IMTQHandler::~IMTQHandler() {} +ImtqHandler::~ImtqHandler() {} -void IMTQHandler::doStartUp() { +void ImtqHandler::doStartUp() { if (goToNormalMode) { setMode(MODE_NORMAL); } else { @@ -36,9 +40,9 @@ void IMTQHandler::doStartUp() { } } -void IMTQHandler::doShutDown() { setMode(_MODE_POWER_DOWN); } +void ImtqHandler::doShutDown() { setMode(_MODE_POWER_DOWN); } -ReturnValue_t IMTQHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) { +ReturnValue_t ImtqHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) { switch (communicationStep) { case CommunicationStep::GET_ENG_HK_DATA: *id = IMTQ::GET_ENG_HK_DATA; @@ -64,11 +68,11 @@ ReturnValue_t IMTQHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) { return buildCommandFromCommand(*id, NULL, 0); } -ReturnValue_t IMTQHandler::buildTransitionDeviceCommand(DeviceCommandId_t* id) { +ReturnValue_t ImtqHandler::buildTransitionDeviceCommand(DeviceCommandId_t* id) { return NOTHING_TO_SEND; } -ReturnValue_t IMTQHandler::buildCommandFromCommand(DeviceCommandId_t deviceCommand, +ReturnValue_t ImtqHandler::buildCommandFromCommand(DeviceCommandId_t deviceCommand, const uint8_t* commandData, size_t commandDataLen) { switch (deviceCommand) { @@ -174,7 +178,7 @@ ReturnValue_t IMTQHandler::buildCommandFromCommand(DeviceCommandId_t deviceComma return returnvalue::FAILED; } -void IMTQHandler::fillCommandAndReplyMap() { +void ImtqHandler::fillCommandAndReplyMap() { this->insertInCommandAndReplyMap(IMTQ::POS_X_SELF_TEST, 1, nullptr, IMTQ::SIZE_STATUS_REPLY); this->insertInCommandAndReplyMap(IMTQ::NEG_X_SELF_TEST, 1, nullptr, IMTQ::SIZE_STATUS_REPLY); this->insertInCommandAndReplyMap(IMTQ::POS_Y_SELF_TEST, 1, nullptr, IMTQ::SIZE_STATUS_REPLY); @@ -197,7 +201,7 @@ void IMTQHandler::fillCommandAndReplyMap() { IMTQ::SIZE_GET_RAW_MTM_MEASUREMENT); } -ReturnValue_t IMTQHandler::scanForReply(const uint8_t* start, size_t remainingSize, +ReturnValue_t ImtqHandler::scanForReply(const uint8_t* start, size_t remainingSize, DeviceCommandId_t* foundId, size_t* foundLen) { ReturnValue_t result = returnvalue::OK; @@ -243,7 +247,7 @@ ReturnValue_t IMTQHandler::scanForReply(const uint8_t* start, size_t remainingSi return result; } -ReturnValue_t IMTQHandler::interpretDeviceReply(DeviceCommandId_t id, const uint8_t* packet) { +ReturnValue_t ImtqHandler::interpretDeviceReply(DeviceCommandId_t id, const uint8_t* packet) { ReturnValue_t result = returnvalue::OK; result = parseStatusByte(packet); @@ -287,9 +291,9 @@ ReturnValue_t IMTQHandler::interpretDeviceReply(DeviceCommandId_t id, const uint return returnvalue::OK; } -void IMTQHandler::setNormalDatapoolEntriesInvalid() {} +void ImtqHandler::setNormalDatapoolEntriesInvalid() {} -LocalPoolDataSetBase* IMTQHandler::getDataSetHandle(sid_t sid) { +LocalPoolDataSetBase* ImtqHandler::getDataSetHandle(sid_t sid) { if (sid == engHkDataset.getSid()) { return &engHkDataset; } else if (sid == calMtmMeasurementSet.getSid()) { @@ -314,9 +318,9 @@ LocalPoolDataSetBase* IMTQHandler::getDataSetHandle(sid_t sid) { } } -uint32_t IMTQHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 5000; } +uint32_t ImtqHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 5000; } -ReturnValue_t IMTQHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap, +ReturnValue_t ImtqHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap, LocalDataPoolManager& poolManager) { /** Entries of engineering housekeeping dataset */ localDataPoolMap.emplace(IMTQ::DIGITAL_VOLTAGE_MV, new PoolEntry({0})); @@ -612,7 +616,7 @@ ReturnValue_t IMTQHandler::initializeLocalDataPool(localpool::DataPool& localDat return returnvalue::OK; } -ReturnValue_t IMTQHandler::getSelfTestCommandId(DeviceCommandId_t* id) { +ReturnValue_t ImtqHandler::getSelfTestCommandId(DeviceCommandId_t* id) { DeviceCommandId_t commandId = getPendingCommand(); switch (commandId) { case IMTQ::POS_X_SELF_TEST: @@ -631,7 +635,7 @@ ReturnValue_t IMTQHandler::getSelfTestCommandId(DeviceCommandId_t* id) { return returnvalue::OK; } -ReturnValue_t IMTQHandler::parseStatusByte(const uint8_t* packet) { +ReturnValue_t ImtqHandler::parseStatusByte(const uint8_t* packet) { uint8_t cmdErrorField = *(packet + 1) & 0xF; switch (cmdErrorField) { case 0: @@ -662,7 +666,7 @@ ReturnValue_t IMTQHandler::parseStatusByte(const uint8_t* packet) { } } -void IMTQHandler::fillEngHkDataset(const uint8_t* packet) { +void ImtqHandler::fillEngHkDataset(const uint8_t* packet) { PoolReadGuard rg(&engHkDataset); uint8_t offset = 2; engHkDataset.digitalVoltageMv = *(packet + offset + 1) << 8 | *(packet + offset); @@ -709,9 +713,9 @@ void IMTQHandler::fillEngHkDataset(const uint8_t* packet) { } } -void IMTQHandler::setToGoToNormal(bool enable) { this->goToNormalMode = enable; } +void ImtqHandler::setToGoToNormal(bool enable) { this->goToNormalMode = enable; } -void IMTQHandler::handleDeviceTM(const uint8_t* data, size_t dataSize, DeviceCommandId_t replyId) { +void ImtqHandler::handleDeviceTM(const uint8_t* data, size_t dataSize, DeviceCommandId_t replyId) { if (wiretappingMode == RAW) { /* Data already sent in doGetRead() */ return; @@ -735,7 +739,7 @@ void IMTQHandler::handleDeviceTM(const uint8_t* data, size_t dataSize, DeviceCom } } -void IMTQHandler::handleGetCommandedDipoleReply(const uint8_t* packet) { +void ImtqHandler::handleGetCommandedDipoleReply(const uint8_t* packet) { uint8_t tmData[6]; /* Switching endianess of received dipole values */ tmData[0] = *(packet + 3); @@ -747,7 +751,7 @@ void IMTQHandler::handleGetCommandedDipoleReply(const uint8_t* packet) { handleDeviceTM(tmData, sizeof(tmData), IMTQ::GET_COMMANDED_DIPOLE); } -void IMTQHandler::fillCalibratedMtmDataset(const uint8_t* packet) { +void ImtqHandler::fillCalibratedMtmDataset(const uint8_t* packet) { PoolReadGuard rg(&calMtmMeasurementSet); calMtmMeasurementSet.setValidity(true, true); int8_t offset = 2; @@ -777,7 +781,7 @@ void IMTQHandler::fillCalibratedMtmDataset(const uint8_t* packet) { } } -void IMTQHandler::fillRawMtmDataset(const uint8_t* packet) { +void ImtqHandler::fillRawMtmDataset(const uint8_t* packet) { PoolReadGuard rg(&rawMtmMeasurementSet); unsigned int offset = 2; size_t deSerLen = 16; @@ -825,7 +829,7 @@ void IMTQHandler::fillRawMtmDataset(const uint8_t* packet) { } } -void IMTQHandler::handleSelfTestReply(const uint8_t* packet) { +void ImtqHandler::handleSelfTestReply(const uint8_t* packet) { uint16_t offset = 2; checkErrorByte(*(packet + offset), *(packet + offset + 1)); @@ -859,7 +863,7 @@ void IMTQHandler::handleSelfTestReply(const uint8_t* packet) { } } -void IMTQHandler::handlePositiveXSelfTestReply(const uint8_t* packet) { +void ImtqHandler::handlePositiveXSelfTestReply(const uint8_t* packet) { PoolReadGuard rg(&posXselfTestDataset); uint16_t offset = 2; @@ -1071,7 +1075,7 @@ void IMTQHandler::handlePositiveXSelfTestReply(const uint8_t* packet) { } } -void IMTQHandler::handleNegativeXSelfTestReply(const uint8_t* packet) { +void ImtqHandler::handleNegativeXSelfTestReply(const uint8_t* packet) { PoolReadGuard rg(&posXselfTestDataset); uint16_t offset = 2; @@ -1283,7 +1287,7 @@ void IMTQHandler::handleNegativeXSelfTestReply(const uint8_t* packet) { } } -void IMTQHandler::handlePositiveYSelfTestReply(const uint8_t* packet) { +void ImtqHandler::handlePositiveYSelfTestReply(const uint8_t* packet) { PoolReadGuard rg(&posXselfTestDataset); uint16_t offset = 2; @@ -1495,7 +1499,7 @@ void IMTQHandler::handlePositiveYSelfTestReply(const uint8_t* packet) { } } -void IMTQHandler::handleNegativeYSelfTestReply(const uint8_t* packet) { +void ImtqHandler::handleNegativeYSelfTestReply(const uint8_t* packet) { PoolReadGuard rg(&posXselfTestDataset); uint16_t offset = 2; @@ -1707,7 +1711,7 @@ void IMTQHandler::handleNegativeYSelfTestReply(const uint8_t* packet) { } } -void IMTQHandler::handlePositiveZSelfTestReply(const uint8_t* packet) { +void ImtqHandler::handlePositiveZSelfTestReply(const uint8_t* packet) { PoolReadGuard rg(&posXselfTestDataset); uint16_t offset = 2; @@ -1919,7 +1923,7 @@ void IMTQHandler::handlePositiveZSelfTestReply(const uint8_t* packet) { } } -void IMTQHandler::handleNegativeZSelfTestReply(const uint8_t* packet) { +void ImtqHandler::handleNegativeZSelfTestReply(const uint8_t* packet) { PoolReadGuard rg(&posXselfTestDataset); uint16_t offset = 2; @@ -2131,9 +2135,9 @@ void IMTQHandler::handleNegativeZSelfTestReply(const uint8_t* packet) { } } -void IMTQHandler::setDebugMode(bool enable) { this->debugMode = enable; } +void ImtqHandler::setDebugMode(bool enable) { this->debugMode = enable; } -void IMTQHandler::checkErrorByte(const uint8_t errorByte, const uint8_t step) { +void ImtqHandler::checkErrorByte(const uint8_t errorByte, const uint8_t step) { std::string stepString(""); if (step < 8) { stepString = makeStepString(step); @@ -2191,7 +2195,7 @@ void IMTQHandler::checkErrorByte(const uint8_t errorByte, const uint8_t step) { } } -std::string IMTQHandler::makeStepString(const uint8_t step) { +std::string ImtqHandler::makeStepString(const uint8_t step) { std::string stepString(""); switch (step) { case IMTQ::SELF_TEST_STEPS::INIT: @@ -2226,7 +2230,7 @@ std::string IMTQHandler::makeStepString(const uint8_t step) { return stepString; } -ReturnValue_t IMTQHandler::getSwitches(const uint8_t** switches, uint8_t* numberOfSwitches) { +ReturnValue_t ImtqHandler::getSwitches(const uint8_t** switches, uint8_t* numberOfSwitches) { if (switcher != power::NO_SWITCH) { *numberOfSwitches = 1; *switches = &switcher; @@ -2234,3 +2238,11 @@ ReturnValue_t IMTQHandler::getSwitches(const uint8_t** switches, uint8_t* number } return DeviceHandlerBase::NO_SWITCH; } + +bool ImtqHandler::mgtIsTorqueing(dur_millis_t *remainingTorqueDuration) { + MutexGuard mg(TORQUE_LOCK); + if (TORQUEING and remainingTorqueDuration != nullptr) { + *remainingTorqueDuration = TORQUE_COUNTDOWN.getRemainingMillis() + TORQUE_BUFFER_TIME_MS; + } + return TORQUEING; +} diff --git a/mission/devices/IMTQHandler.h b/mission/devices/ImtqHandler.h similarity index 95% rename from mission/devices/IMTQHandler.h rename to mission/devices/ImtqHandler.h index 92df8aae..612eff7f 100644 --- a/mission/devices/IMTQHandler.h +++ b/mission/devices/ImtqHandler.h @@ -13,11 +13,11 @@ * * @author J. Meier */ -class IMTQHandler : public DeviceHandlerBase { +class ImtqHandler : public DeviceHandlerBase { public: - IMTQHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie, + ImtqHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie, power::Switch_t pwrSwitcher); - virtual ~IMTQHandler(); + virtual ~ImtqHandler(); /** * @brief Sets mode to MODE_NORMAL. Can be used for debugging. @@ -206,6 +206,16 @@ class IMTQHandler : public DeviceHandlerBase { void checkErrorByte(const uint8_t errorByte, const uint8_t step); std::string makeStepString(const uint8_t step); + + static MutexIF* TORQUE_LOCK; + static bool TORQUEING; + static Countdown TORQUE_COUNTDOWN; + // Additional buffer time to accont for time until I2C command arrives and ramp up / ramp down + // time of the MGT + static constexpr dur_millis_t TORQUE_BUFFER_TIME_MS = 20; + + static bool mgtIsTorqueing(dur_millis_t* remainingTorqueDuration); + }; #endif /* MISSION_DEVICES_IMTQHANDLER_H_ */ -- 2.43.0 From 6bdc420d0ecd906fb8ea819350d57450e412cc5d Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 19 Oct 2022 19:08:36 +0200 Subject: [PATCH 46/97] bump tmtc --- mission/devices/ImtqHandler.cpp | 5 ++++- tmtc | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/mission/devices/ImtqHandler.cpp b/mission/devices/ImtqHandler.cpp index adb9f83b..e8cb8c6b 100644 --- a/mission/devices/ImtqHandler.cpp +++ b/mission/devices/ImtqHandler.cpp @@ -1,5 +1,6 @@ #include #include +#include #include #include @@ -692,7 +693,9 @@ void ImtqHandler::fillEngHkDataset(const uint8_t* packet) { offset += 2; engHkDataset.coilZTemperature = (*(packet + offset + 1) << 8 | *(packet + offset)); offset += 2; - engHkDataset.mcuTemperature = (*(packet + offset + 1) << 8 | *(packet + offset)); + size_t dummy = 2; + SerializeAdapter::deSerialize(&engHkDataset.mcuTemperature.value, packet + offset, &dummy, + SerializeIF::Endianness::LITTLE); engHkDataset.setValidity(true, true); diff --git a/tmtc b/tmtc index 87e40fab..42b962de 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 87e40fab0f45b4b40f0f477ad5e946e61dcb5e07 +Subproject commit 42b962dede547975488e72b22abe2360065c0404 -- 2.43.0 From 42bb2f554fa46eae403a570d719901c8a597cdbb Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 19 Oct 2022 19:11:21 +0200 Subject: [PATCH 47/97] added fat TODO --- mission/devices/ImtqHandler.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mission/devices/ImtqHandler.cpp b/mission/devices/ImtqHandler.cpp index e8cb8c6b..f040edf2 100644 --- a/mission/devices/ImtqHandler.cpp +++ b/mission/devices/ImtqHandler.cpp @@ -44,6 +44,11 @@ void ImtqHandler::doStartUp() { void ImtqHandler::doShutDown() { setMode(_MODE_POWER_DOWN); } ReturnValue_t ImtqHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) { + // TODO: Add IMTQ torque handling here, will be set in the software and thus must be part + // of normal handling. Keep in mind that torqueing should happen after all HK data was read + // because the MGM values might be useless if the IMTQ is torqueing. Also, remove + // calibrated MGM polling, we have our own calibration. Thus, there are 3 communication + // steps per IMTQ cycle. switch (communicationStep) { case CommunicationStep::GET_ENG_HK_DATA: *id = IMTQ::GET_ENG_HK_DATA; -- 2.43.0 From ab273a8a597348e285d70fcf5b4ad5a64b396bb3 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 20 Oct 2022 10:32:17 +0200 Subject: [PATCH 48/97] re-use dipole set in IMTQ handler --- bsp_q7s/core/ObjectFactory.cpp | 3 +- mission/controller/AcsController.h | 2 - mission/devices/ImtqHandler.cpp | 109 ++++++++++++++---- mission/devices/ImtqHandler.h | 14 ++- .../IMTQHandlerDefinitions.h | 13 ++- 5 files changed, 107 insertions(+), 34 deletions(-) diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index deee8c53..f6beadb6 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -47,6 +47,8 @@ #if OBSW_TEST_LIBGPIOD == 1 #include "linux/boardtest/LibgpiodTest.h" #endif +#include + #include #include "fsfw/datapoollocal/LocalDataPoolManager.h" @@ -70,7 +72,6 @@ #include "mission/devices/BpxBatteryHandler.h" #include "mission/devices/GyroADIS1650XHandler.h" #include "mission/devices/HeaterHandler.h" -#include #include "mission/devices/Max31865PT1000Handler.h" #include "mission/devices/P60DockHandler.h" #include "mission/devices/PCDUHandler.h" diff --git a/mission/controller/AcsController.h b/mission/controller/AcsController.h index b1ad7090..290938b4 100644 --- a/mission/controller/AcsController.h +++ b/mission/controller/AcsController.h @@ -71,8 +71,6 @@ class AcsController : public ExtendedControllerBase { SUS::SusDataset(objects::SUS_11_R_LOC_XBYMZB_PT_ZB), }; - - // Initial delay to make sure all pool variables have been initialized their owners Countdown initialCountdown = Countdown(INIT_DELAY); }; diff --git a/mission/devices/ImtqHandler.cpp b/mission/devices/ImtqHandler.cpp index f040edf2..23de759b 100644 --- a/mission/devices/ImtqHandler.cpp +++ b/mission/devices/ImtqHandler.cpp @@ -1,11 +1,29 @@ +#include +#include +#include #include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include #include #include - -#include "OBSWConfig.h" +#include MutexIF* ImtqHandler::TORQUE_LOCK = nullptr; bool ImtqHandler::TORQUEING = false; @@ -56,22 +74,43 @@ ReturnValue_t ImtqHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) { break; case CommunicationStep::START_MTM_MEASUREMENT: *id = IMTQ::START_MTM_MEASUREMENT; - communicationStep = CommunicationStep::GET_CAL_MTM_MEASUREMENT; - break; - case CommunicationStep::GET_CAL_MTM_MEASUREMENT: - *id = IMTQ::GET_CAL_MTM_MEASUREMENT; - communicationStep = CommunicationStep::GET_RAW_MTM_MEASUREMENT; + if (pollingMode == NormalPollingMode::BOTH or + pollingMode == NormalPollingMode::UNCALIBRATED) { + communicationStep = CommunicationStep::GET_RAW_MTM_MEASUREMENT; + } else { + communicationStep = CommunicationStep::GET_CAL_MTM_MEASUREMENT; + } break; case CommunicationStep::GET_RAW_MTM_MEASUREMENT: + if (integrationTimeCd.getRemainingMillis() > 0) { + TaskFactory::delayTask(integrationTimeCd.getRemainingMillis()); + } *id = IMTQ::GET_RAW_MTM_MEASUREMENT; + if (pollingMode == NormalPollingMode::BOTH) { + communicationStep = CommunicationStep::GET_CAL_MTM_MEASUREMENT; + } else { + communicationStep = CommunicationStep::DIPOLE_ACTUATION; + } + break; + case CommunicationStep::GET_CAL_MTM_MEASUREMENT: + if (integrationTimeCd.getRemainingMillis() > 0) { + TaskFactory::delayTask(integrationTimeCd.getRemainingMillis()); + } + *id = IMTQ::GET_CAL_MTM_MEASUREMENT; + communicationStep = CommunicationStep::DIPOLE_ACTUATION; + break; + case CommunicationStep::DIPOLE_ACTUATION: { + // TODO: Set correct ID if actuation is necessary + *id = IMTQ::START_ACTUATION_DIPOLE; communicationStep = CommunicationStep::GET_ENG_HK_DATA; break; + } default: sif::debug << "IMTQHandler::buildNormalDeviceCommand: Invalid communication step" << std::endl; break; } - return buildCommandFromCommand(*id, NULL, 0); + return buildCommandFromCommand(*id, nullptr, 0); } ReturnValue_t ImtqHandler::buildTransitionDeviceCommand(DeviceCommandId_t* id) { @@ -133,20 +172,27 @@ ReturnValue_t ImtqHandler::buildCommandFromCommand(DeviceCommandId_t deviceComma case (IMTQ::START_ACTUATION_DIPOLE): { /* IMTQ expects low byte first */ commandBuffer[0] = IMTQ::CC::START_ACTUATION_DIPOLE; - if (commandData == nullptr) { + if (commandData != nullptr && commandDataLen < 8) { return DeviceHandlerIF::INVALID_COMMAND_PARAMETER; } - commandBuffer[1] = commandData[1]; - commandBuffer[2] = commandData[0]; - commandBuffer[3] = commandData[3]; - commandBuffer[4] = commandData[2]; - commandBuffer[5] = commandData[5]; - commandBuffer[6] = commandData[4]; - commandBuffer[7] = commandData[7]; - commandBuffer[8] = commandData[6]; - rawPacket = commandBuffer; - rawPacketLen = 9; - return returnvalue::OK; + PoolReadGuard pg(&dipoleSet); + ReturnValue_t result; + // Commands override anything which was set in the software + if (commandBuffer != nullptr) { + result = + dipoleSet.deSerialize(&commandData, &commandDataLen, SerializeIF::Endianness::NETWORK); + if (result != returnvalue::OK) { + return result; + } + } + result = buildDipoleActuationCommand(); + if (result != returnvalue::OK) { + return result; + } + MutexGuard mg(TORQUE_LOCK); + TORQUEING = true; + TORQUE_COUNTDOWN.setTimeout(dipoleSet.currentTorqueDurationMs.value); + return result; } case (IMTQ::GET_ENG_HK_DATA): { commandBuffer[0] = IMTQ::CC::GET_ENG_HK_DATA; @@ -162,6 +208,7 @@ ReturnValue_t ImtqHandler::buildCommandFromCommand(DeviceCommandId_t deviceComma } case (IMTQ::START_MTM_MEASUREMENT): { commandBuffer[0] = IMTQ::CC::START_MTM_MEASUREMENT; + integrationTimeCd.resetTimer(); rawPacket = commandBuffer; rawPacketLen = 1; return returnvalue::OK; @@ -184,6 +231,22 @@ ReturnValue_t ImtqHandler::buildCommandFromCommand(DeviceCommandId_t deviceComma return returnvalue::FAILED; } +ReturnValue_t ImtqHandler::buildDipoleActuationCommand() { + commandBuffer[0] = IMTQ::CC::START_ACTUATION_DIPOLE; + uint8_t* serPtr = commandBuffer + 1; + size_t serSize = 1; + dipoleSet.setValidityBufferGeneration(false); + ReturnValue_t result = dipoleSet.serialize(&serPtr, &serSize, sizeof(commandBuffer), + SerializeIF::Endianness::LITTLE); + dipoleSet.setValidityBufferGeneration(true); + if (result != returnvalue::OK) { + return result; + } + rawPacket = commandBuffer; + rawPacketLen = 9; + return result; +} + void ImtqHandler::fillCommandAndReplyMap() { this->insertInCommandAndReplyMap(IMTQ::POS_X_SELF_TEST, 1, nullptr, IMTQ::SIZE_STATUS_REPLY); this->insertInCommandAndReplyMap(IMTQ::NEG_X_SELF_TEST, 1, nullptr, IMTQ::SIZE_STATUS_REPLY); @@ -700,7 +763,7 @@ void ImtqHandler::fillEngHkDataset(const uint8_t* packet) { offset += 2; size_t dummy = 2; SerializeAdapter::deSerialize(&engHkDataset.mcuTemperature.value, packet + offset, &dummy, - SerializeIF::Endianness::LITTLE); + SerializeIF::Endianness::LITTLE); engHkDataset.setValidity(true, true); @@ -2247,7 +2310,7 @@ ReturnValue_t ImtqHandler::getSwitches(const uint8_t** switches, uint8_t* number return DeviceHandlerBase::NO_SWITCH; } -bool ImtqHandler::mgtIsTorqueing(dur_millis_t *remainingTorqueDuration) { +bool ImtqHandler::mgtIsTorqueing(dur_millis_t* remainingTorqueDuration) { MutexGuard mg(TORQUE_LOCK); if (TORQUEING and remainingTorqueDuration != nullptr) { *remainingTorqueDuration = TORQUE_COUNTDOWN.getRemainingMillis() + TORQUE_BUFFER_TIME_MS; diff --git a/mission/devices/ImtqHandler.h b/mission/devices/ImtqHandler.h index 612eff7f..401c6743 100644 --- a/mission/devices/ImtqHandler.h +++ b/mission/devices/ImtqHandler.h @@ -15,10 +15,14 @@ */ class ImtqHandler : public DeviceHandlerBase { public: + enum NormalPollingMode { UNCALIBRATED = 0, CALIBRATED = 1, BOTH = 2 }; + ImtqHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie, power::Switch_t pwrSwitcher); virtual ~ImtqHandler(); + void setPollingMode(NormalPollingMode pollMode); + /** * @brief Sets mode to MODE_NORMAL. Can be used for debugging. */ @@ -103,7 +107,12 @@ class ImtqHandler : public DeviceHandlerBase { IMTQ::PosZSelfTestSet posZselfTestDataset; IMTQ::NegZSelfTestSet negZselfTestDataset; + NormalPollingMode pollingMode = NormalPollingMode::BOTH; + PoolEntry mgmCalEntry = PoolEntry(3); + // Hardcoded to default integration time of 10 ms. + // SHOULDDO: Support for other integration times + Countdown integrationTimeCd = Countdown(10); power::Switch_t switcher = power::NO_SWITCH; @@ -115,7 +124,8 @@ class ImtqHandler : public DeviceHandlerBase { GET_ENG_HK_DATA, START_MTM_MEASUREMENT, GET_CAL_MTM_MEASUREMENT, - GET_RAW_MTM_MEASUREMENT + GET_RAW_MTM_MEASUREMENT, + DIPOLE_ACTUATION }; CommunicationStep communicationStep = CommunicationStep::GET_ENG_HK_DATA; @@ -197,6 +207,7 @@ class ImtqHandler : public DeviceHandlerBase { void handlePositiveZSelfTestReply(const uint8_t* packet); void handleNegativeZSelfTestReply(const uint8_t* packet); + ReturnValue_t buildDipoleActuationCommand(); /** * @brief This function checks the error byte of a self test measurement. * @@ -215,7 +226,6 @@ class ImtqHandler : public DeviceHandlerBase { static constexpr dur_millis_t TORQUE_BUFFER_TIME_MS = 20; static bool mgtIsTorqueing(dur_millis_t* remainingTorqueDuration); - }; #endif /* MISSION_DEVICES_IMTQHANDLER_H_ */ diff --git a/mission/devices/devicedefinitions/IMTQHandlerDefinitions.h b/mission/devices/devicedefinitions/IMTQHandlerDefinitions.h index ddb0af5b..df9aa44e 100644 --- a/mission/devices/devicedefinitions/IMTQHandlerDefinitions.h +++ b/mission/devices/devicedefinitions/IMTQHandlerDefinitions.h @@ -448,6 +448,11 @@ class CommandDipolePacket : public SerialLinkedListAdapter { public: CommandDipolePacket() { setLinks(); } + SerializeElement xDipole; + SerializeElement yDipole; + SerializeElement zDipole; + SerializeElement duration; + private: /** * @brief Constructor @@ -467,10 +472,6 @@ class CommandDipolePacket : public SerialLinkedListAdapter { yDipole.setNext(&zDipole); zDipole.setNext(&duration); } - SerializeElement xDipole; - SerializeElement yDipole; - SerializeElement zDipole; - SerializeElement duration; }; class DipoleActuationSet : public StaticLocalDataSet<4> { @@ -498,13 +499,13 @@ class DipoleActuationSet : public StaticLocalDataSet<4> { zDipole = zDipole_; currentTorqueDurationMs = currentTorqueDurationMs_; } - - private: lp_var_t xDipole = lp_var_t(sid.objectId, DIPOLES_X, this); lp_var_t yDipole = lp_var_t(sid.objectId, DIPOLES_Y, this); lp_var_t zDipole = lp_var_t(sid.objectId, DIPOLES_Z, this); lp_var_t currentTorqueDurationMs = lp_var_t(sid.objectId, CURRENT_TORQUE_DURATION, this); + + private: bool newActuation = false; }; /** -- 2.43.0 From 2b6334b9dcbc2d49e650f0bf9d68b949713071e8 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 20 Oct 2022 10:44:28 +0200 Subject: [PATCH 49/97] this works --- mission/devices/ImtqHandler.cpp | 11 +++++++++-- mission/devices/ImtqHandler.h | 4 ++++ .../devicedefinitions/IMTQHandlerDefinitions.h | 8 +++++++- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/mission/devices/ImtqHandler.cpp b/mission/devices/ImtqHandler.cpp index 23de759b..5e78b90f 100644 --- a/mission/devices/ImtqHandler.cpp +++ b/mission/devices/ImtqHandler.cpp @@ -100,8 +100,10 @@ ReturnValue_t ImtqHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) { communicationStep = CommunicationStep::DIPOLE_ACTUATION; break; case CommunicationStep::DIPOLE_ACTUATION: { - // TODO: Set correct ID if actuation is necessary - *id = IMTQ::START_ACTUATION_DIPOLE; + // The dipoles will be set by the ACS controller directly using the dipole local pool set. + if (dipoleSet.newActuation) { + *id = IMTQ::START_ACTUATION_DIPOLE; + } communicationStep = CommunicationStep::GET_ENG_HK_DATA; break; } @@ -404,6 +406,11 @@ ReturnValue_t ImtqHandler::initializeLocalDataPool(localpool::DataPool& localDat localDataPoolMap.emplace(IMTQ::COIL_Z_TEMPERATURE, new PoolEntry({0})); localDataPoolMap.emplace(IMTQ::MCU_TEMPERATURE, new PoolEntry({0})); + localDataPoolMap.emplace(IMTQ::DIPOLES_X, &dipoleXEntry); + localDataPoolMap.emplace(IMTQ::DIPOLES_Y, &dipoleYEntry); + localDataPoolMap.emplace(IMTQ::DIPOLES_Z, &dipoleZEntry); + localDataPoolMap.emplace(IMTQ::CURRENT_TORQUE_DURATION, &torqueDurationEntry); + /** Entries of calibrated MTM measurement dataset */ localDataPoolMap.emplace(IMTQ::MGM_CAL_NT, &mgmCalEntry); localDataPoolMap.emplace(IMTQ::ACTUATION_CAL_STATUS, new PoolEntry({0})); diff --git a/mission/devices/ImtqHandler.h b/mission/devices/ImtqHandler.h index 401c6743..7ddb4e4c 100644 --- a/mission/devices/ImtqHandler.h +++ b/mission/devices/ImtqHandler.h @@ -110,6 +110,10 @@ class ImtqHandler : public DeviceHandlerBase { NormalPollingMode pollingMode = NormalPollingMode::BOTH; PoolEntry mgmCalEntry = PoolEntry(3); + PoolEntry dipoleXEntry = PoolEntry(0, false); + PoolEntry dipoleYEntry = PoolEntry(0, false); + PoolEntry dipoleZEntry = PoolEntry(0, false); + PoolEntry torqueDurationEntry = PoolEntry(0, false); // Hardcoded to default integration time of 10 ms. // SHOULDDO: Support for other integration times Countdown integrationTimeCd = Countdown(10); diff --git a/mission/devices/devicedefinitions/IMTQHandlerDefinitions.h b/mission/devices/devicedefinitions/IMTQHandlerDefinitions.h index df9aa44e..3ec0aedd 100644 --- a/mission/devices/devicedefinitions/IMTQHandlerDefinitions.h +++ b/mission/devices/devicedefinitions/IMTQHandlerDefinitions.h @@ -4,6 +4,8 @@ #include #include +class ImtqHandler; + namespace IMTQ { static const DeviceCommandId_t NONE = 0x0; @@ -475,6 +477,8 @@ class CommandDipolePacket : public SerialLinkedListAdapter { }; class DipoleActuationSet : public StaticLocalDataSet<4> { + friend class ::ImtqHandler; + public: DipoleActuationSet(HasLocalDataPoolIF& owner) : StaticLocalDataSet(&owner, IMTQ::SetIds::DIPOLES) {} @@ -499,15 +503,17 @@ class DipoleActuationSet : public StaticLocalDataSet<4> { zDipole = zDipole_; currentTorqueDurationMs = currentTorqueDurationMs_; } + + private: lp_var_t xDipole = lp_var_t(sid.objectId, DIPOLES_X, this); lp_var_t yDipole = lp_var_t(sid.objectId, DIPOLES_Y, this); lp_var_t zDipole = lp_var_t(sid.objectId, DIPOLES_Z, this); lp_var_t currentTorqueDurationMs = lp_var_t(sid.objectId, CURRENT_TORQUE_DURATION, this); - private: bool newActuation = false; }; + /** * @brief This dataset can be used to store the self test results of the +X self test. * -- 2.43.0 From 07fe2cb1229f0f4b20f5eb019c8cc313eb21518b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 20 Oct 2022 10:51:19 +0200 Subject: [PATCH 50/97] some tweaks for dipole set handling --- mission/devices/ImtqHandler.cpp | 5 ++++- .../devicedefinitions/IMTQHandlerDefinitions.h | 13 ++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/mission/devices/ImtqHandler.cpp b/mission/devices/ImtqHandler.cpp index 5e78b90f..5a331c11 100644 --- a/mission/devices/ImtqHandler.cpp +++ b/mission/devices/ImtqHandler.cpp @@ -100,7 +100,10 @@ ReturnValue_t ImtqHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) { communicationStep = CommunicationStep::DIPOLE_ACTUATION; break; case CommunicationStep::DIPOLE_ACTUATION: { - // The dipoles will be set by the ACS controller directly using the dipole local pool set. + // If the dipole is not commanded but set by the ACS control algorithm, + // the dipoles will be set by the ACS controller directly using the dipole local pool set. + // This set has a flag to determine whether the ACS controller actually set any new input. + PoolReadGuard pg(&dipoleSet); if (dipoleSet.newActuation) { *id = IMTQ::START_ACTUATION_DIPOLE; } diff --git a/mission/devices/devicedefinitions/IMTQHandlerDefinitions.h b/mission/devices/devicedefinitions/IMTQHandlerDefinitions.h index 3ec0aedd..320220dd 100644 --- a/mission/devices/devicedefinitions/IMTQHandlerDefinitions.h +++ b/mission/devices/devicedefinitions/IMTQHandlerDefinitions.h @@ -485,9 +485,14 @@ class DipoleActuationSet : public StaticLocalDataSet<4> { DipoleActuationSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, IMTQ::SetIds::DIPOLES)) {} + // Refresh torque command without changing any of the set dipoles. + void refreshTorqueing(uint16_t durationMs_) { + newActuation = true; + currentTorqueDurationMs = durationMs_; + } + void setDipoles(uint16_t xDipole_, uint16_t yDipole_, uint16_t zDipole_, uint16_t currentTorqueDurationMs_) { - PoolReadGuard pg(this); newActuation = false; if (xDipole.value != xDipole_) { newActuation = true; @@ -504,6 +509,12 @@ class DipoleActuationSet : public StaticLocalDataSet<4> { currentTorqueDurationMs = currentTorqueDurationMs_; } + void getDipoles(uint16_t& xDipole_, uint16_t& yDipole_, uint16_t& zDipole_) { + xDipole_ = xDipole.value; + yDipole_ = yDipole.value; + zDipole_ = zDipole.value; + } + private: lp_var_t xDipole = lp_var_t(sid.objectId, DIPOLES_X, this); lp_var_t yDipole = lp_var_t(sid.objectId, DIPOLES_Y, this); -- 2.43.0 From ada1111252229ad544667f34a2c44030d0ec8521 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 20 Oct 2022 10:52:13 +0200 Subject: [PATCH 51/97] removed TODO --- mission/devices/ImtqHandler.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/mission/devices/ImtqHandler.cpp b/mission/devices/ImtqHandler.cpp index 5a331c11..cc80d1f9 100644 --- a/mission/devices/ImtqHandler.cpp +++ b/mission/devices/ImtqHandler.cpp @@ -62,11 +62,7 @@ void ImtqHandler::doStartUp() { void ImtqHandler::doShutDown() { setMode(_MODE_POWER_DOWN); } ReturnValue_t ImtqHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) { - // TODO: Add IMTQ torque handling here, will be set in the software and thus must be part - // of normal handling. Keep in mind that torqueing should happen after all HK data was read - // because the MGM values might be useless if the IMTQ is torqueing. Also, remove - // calibrated MGM polling, we have our own calibration. Thus, there are 3 communication - // steps per IMTQ cycle. + // Depending on the normal polling mode configuration, 3-4 communication steps are recommended switch (communicationStep) { case CommunicationStep::GET_ENG_HK_DATA: *id = IMTQ::GET_ENG_HK_DATA; -- 2.43.0 From 29a34256a72c97391556d6b970161a2b6f2fc620 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 20 Oct 2022 15:08:33 +0200 Subject: [PATCH 52/97] old code seems to work --- dummies/ImtqDummy.cpp | 2 +- fsfw | 2 +- mission/controller/AcsController.cpp | 11 +++ mission/controller/AcsController.h | 2 +- mission/controller/ThermalController.cpp | 2 +- mission/devices/CMakeLists.txt | 3 +- mission/devices/ImtqHandler.cpp | 74 +++++++++---------- mission/devices/ImtqHandler.h | 13 +--- ...Definitions.h => imtqHandlerDefinitions.h} | 17 +---- mission/devices/torquer.cpp | 27 +++++++ mission/devices/torquer.h | 22 ++++++ tmtc | 2 +- 12 files changed, 108 insertions(+), 69 deletions(-) rename mission/devices/devicedefinitions/{IMTQHandlerDefinitions.h => imtqHandlerDefinitions.h} (98%) create mode 100644 mission/devices/torquer.cpp create mode 100644 mission/devices/torquer.h diff --git a/dummies/ImtqDummy.cpp b/dummies/ImtqDummy.cpp index 6dc451b3..aad1478b 100644 --- a/dummies/ImtqDummy.cpp +++ b/dummies/ImtqDummy.cpp @@ -1,6 +1,6 @@ #include "ImtqDummy.h" -#include +#include ImtqDummy::ImtqDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie) : DeviceHandlerBase(objectId, comif, comCookie) {} diff --git a/fsfw b/fsfw index 692be9df..0c5c2f6c 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 692be9df8d06beb3bfc83aad77cefd727d8f7c35 +Subproject commit 0c5c2f6c4f07959a73a083eb3c6e1f3125642477 diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index 09e91e26..b8b1e8ca 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -2,6 +2,8 @@ #include +#include "mission/devices/torquer.h" + AcsController::AcsController(object_id_t objectId) : ExtendedControllerBase(objectId, objects::NO_OBJECT), mgmData(this) {} @@ -29,6 +31,15 @@ void AcsController::performControlOperation() { break; } + { + // TODO: Calculate actuator output + PoolReadGuard pg(&dipoleSet); + MutexGuard mg(torquer::lazyLock()); + torquer::NEW_ACTUATION_FLAG = true; + // TODO: Insert correct values here + dipoleSet.setDipoles(500, 500, 500, 150); + } + { PoolReadGuard pg(&mgmData); if (pg.getReadResult() == returnvalue::OK) { diff --git a/mission/controller/AcsController.h b/mission/controller/AcsController.h index 290938b4..adb6fbb6 100644 --- a/mission/controller/AcsController.h +++ b/mission/controller/AcsController.h @@ -7,8 +7,8 @@ #include "eive/objects.h" #include "fsfw_hal/devicehandlers/MgmLIS3MDLHandler.h" #include "fsfw_hal/devicehandlers/MgmRM3100Handler.h" -#include "mission/devices/devicedefinitions/IMTQHandlerDefinitions.h" #include "mission/devices/devicedefinitions/SusDefinitions.h" +#include "mission/devices/devicedefinitions/imtqHandlerDefinitions.h" class AcsController : public ExtendedControllerBase { public: diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index 608b68b7..174d1e9f 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -8,9 +8,9 @@ #include #include #include -#include #include #include +#include #include #include diff --git a/mission/devices/CMakeLists.txt b/mission/devices/CMakeLists.txt index 0bfb1a2d..b8fb326c 100644 --- a/mission/devices/CMakeLists.txt +++ b/mission/devices/CMakeLists.txt @@ -20,6 +20,7 @@ target_sources( SusHandler.cpp PayloadPcduHandler.cpp SolarArrayDeploymentHandler.cpp - ScexDeviceHandler.cpp) + ScexDeviceHandler.cpp + torquer.cpp) add_subdirectory(devicedefinitions) diff --git a/mission/devices/ImtqHandler.cpp b/mission/devices/ImtqHandler.cpp index cc80d1f9..c65674ce 100644 --- a/mission/devices/ImtqHandler.cpp +++ b/mission/devices/ImtqHandler.cpp @@ -25,9 +25,7 @@ #include #include -MutexIF* ImtqHandler::TORQUE_LOCK = nullptr; -bool ImtqHandler::TORQUEING = false; -Countdown ImtqHandler::TORQUE_COUNTDOWN = Countdown(); +#include "mission/devices/torquer.h" ImtqHandler::ImtqHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie, power::Switch_t pwrSwitcher) @@ -46,7 +44,6 @@ ImtqHandler::ImtqHandler(object_id_t objectId, object_id_t comIF, CookieIF* comC if (comCookie == nullptr) { sif::error << "IMTQHandler: Invalid com cookie" << std::endl; } - TORQUE_LOCK = MutexFactory::instance()->createMutex(); } ImtqHandler::~ImtqHandler() {} @@ -62,6 +59,7 @@ void ImtqHandler::doStartUp() { void ImtqHandler::doShutDown() { setMode(_MODE_POWER_DOWN); } ReturnValue_t ImtqHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) { + bool buildCommand = true; // Depending on the normal polling mode configuration, 3-4 communication steps are recommended switch (communicationStep) { case CommunicationStep::GET_ENG_HK_DATA: @@ -99,9 +97,12 @@ ReturnValue_t ImtqHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) { // If the dipole is not commanded but set by the ACS control algorithm, // the dipoles will be set by the ACS controller directly using the dipole local pool set. // This set has a flag to determine whether the ACS controller actually set any new input. - PoolReadGuard pg(&dipoleSet); - if (dipoleSet.newActuation) { + MutexGuard mg(torquer::lazyLock()); + if (torquer::NEW_ACTUATION_FLAG) { *id = IMTQ::START_ACTUATION_DIPOLE; + torquer::NEW_ACTUATION_FLAG = false; + } else { + buildCommand = false; } communicationStep = CommunicationStep::GET_ENG_HK_DATA; break; @@ -111,7 +112,10 @@ ReturnValue_t ImtqHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) { << std::endl; break; } - return buildCommandFromCommand(*id, nullptr, 0); + if (buildCommand) { + return buildCommandFromCommand(*id, nullptr, 0); + } + return NOTHING_TO_SEND; } ReturnValue_t ImtqHandler::buildTransitionDeviceCommand(DeviceCommandId_t* id) { @@ -176,23 +180,27 @@ ReturnValue_t ImtqHandler::buildCommandFromCommand(DeviceCommandId_t deviceComma if (commandData != nullptr && commandDataLen < 8) { return DeviceHandlerIF::INVALID_COMMAND_PARAMETER; } - PoolReadGuard pg(&dipoleSet); ReturnValue_t result; // Commands override anything which was set in the software if (commandBuffer != nullptr) { + dipoleSet.setValidityBufferGeneration(false); result = dipoleSet.deSerialize(&commandData, &commandDataLen, SerializeIF::Endianness::NETWORK); + dipoleSet.setValidityBufferGeneration(true); if (result != returnvalue::OK) { return result; } + } else { + // Read set dipole values from local pool + PoolReadGuard pg(&dipoleSet); } result = buildDipoleActuationCommand(); if (result != returnvalue::OK) { return result; } - MutexGuard mg(TORQUE_LOCK); - TORQUEING = true; - TORQUE_COUNTDOWN.setTimeout(dipoleSet.currentTorqueDurationMs.value); + MutexGuard mg(torquer::lazyLock()); + torquer::TORQUEING = true; + torquer::TORQUE_COUNTDOWN.setTimeout(dipoleSet.currentTorqueDurationMs.value); return result; } case (IMTQ::GET_ENG_HK_DATA): { @@ -249,26 +257,22 @@ ReturnValue_t ImtqHandler::buildDipoleActuationCommand() { } void ImtqHandler::fillCommandAndReplyMap() { - this->insertInCommandAndReplyMap(IMTQ::POS_X_SELF_TEST, 1, nullptr, IMTQ::SIZE_STATUS_REPLY); - this->insertInCommandAndReplyMap(IMTQ::NEG_X_SELF_TEST, 1, nullptr, IMTQ::SIZE_STATUS_REPLY); - this->insertInCommandAndReplyMap(IMTQ::POS_Y_SELF_TEST, 1, nullptr, IMTQ::SIZE_STATUS_REPLY); - this->insertInCommandAndReplyMap(IMTQ::NEG_Y_SELF_TEST, 1, nullptr, IMTQ::SIZE_STATUS_REPLY); - this->insertInCommandAndReplyMap(IMTQ::POS_Z_SELF_TEST, 1, nullptr, IMTQ::SIZE_STATUS_REPLY); - this->insertInCommandAndReplyMap(IMTQ::NEG_Z_SELF_TEST, 1, nullptr, IMTQ::SIZE_STATUS_REPLY); - this->insertInCommandAndReplyMap(IMTQ::GET_SELF_TEST_RESULT, 1, nullptr, - IMTQ::SIZE_SELF_TEST_RESULTS); - this->insertInCommandAndReplyMap(IMTQ::START_ACTUATION_DIPOLE, 1, nullptr, - IMTQ::SIZE_STATUS_REPLY); - this->insertInCommandAndReplyMap(IMTQ::GET_ENG_HK_DATA, 1, &engHkDataset, - IMTQ::SIZE_ENG_HK_DATA_REPLY); - this->insertInCommandAndReplyMap(IMTQ::GET_COMMANDED_DIPOLE, 1, nullptr, - IMTQ::SIZE_GET_COMMANDED_DIPOLE_REPLY); - this->insertInCommandAndReplyMap(IMTQ::START_MTM_MEASUREMENT, 1, nullptr, - IMTQ::SIZE_STATUS_REPLY); - this->insertInCommandAndReplyMap(IMTQ::GET_CAL_MTM_MEASUREMENT, 1, &calMtmMeasurementSet, - IMTQ::SIZE_GET_CAL_MTM_MEASUREMENT); - this->insertInCommandAndReplyMap(IMTQ::GET_RAW_MTM_MEASUREMENT, 1, &rawMtmMeasurementSet, - IMTQ::SIZE_GET_RAW_MTM_MEASUREMENT); + insertInCommandAndReplyMap(IMTQ::POS_X_SELF_TEST, 1, nullptr, IMTQ::SIZE_STATUS_REPLY); + insertInCommandAndReplyMap(IMTQ::NEG_X_SELF_TEST, 1, nullptr, IMTQ::SIZE_STATUS_REPLY); + insertInCommandAndReplyMap(IMTQ::POS_Y_SELF_TEST, 1, nullptr, IMTQ::SIZE_STATUS_REPLY); + insertInCommandAndReplyMap(IMTQ::NEG_Y_SELF_TEST, 1, nullptr, IMTQ::SIZE_STATUS_REPLY); + insertInCommandAndReplyMap(IMTQ::POS_Z_SELF_TEST, 1, nullptr, IMTQ::SIZE_STATUS_REPLY); + insertInCommandAndReplyMap(IMTQ::NEG_Z_SELF_TEST, 1, nullptr, IMTQ::SIZE_STATUS_REPLY); + insertInCommandAndReplyMap(IMTQ::GET_SELF_TEST_RESULT, 1, nullptr, IMTQ::SIZE_SELF_TEST_RESULTS); + insertInCommandAndReplyMap(IMTQ::START_ACTUATION_DIPOLE, 1, nullptr, IMTQ::SIZE_STATUS_REPLY); + insertInCommandAndReplyMap(IMTQ::GET_ENG_HK_DATA, 1, &engHkDataset, IMTQ::SIZE_ENG_HK_DATA_REPLY); + insertInCommandAndReplyMap(IMTQ::GET_COMMANDED_DIPOLE, 1, nullptr, + IMTQ::SIZE_GET_COMMANDED_DIPOLE_REPLY); + insertInCommandAndReplyMap(IMTQ::START_MTM_MEASUREMENT, 1, nullptr, IMTQ::SIZE_STATUS_REPLY); + insertInCommandAndReplyMap(IMTQ::GET_CAL_MTM_MEASUREMENT, 1, &calMtmMeasurementSet, + IMTQ::SIZE_GET_CAL_MTM_MEASUREMENT); + insertInCommandAndReplyMap(IMTQ::GET_RAW_MTM_MEASUREMENT, 1, &rawMtmMeasurementSet, + IMTQ::SIZE_GET_RAW_MTM_MEASUREMENT); } ReturnValue_t ImtqHandler::scanForReply(const uint8_t* start, size_t remainingSize, @@ -2315,11 +2319,3 @@ ReturnValue_t ImtqHandler::getSwitches(const uint8_t** switches, uint8_t* number } return DeviceHandlerBase::NO_SWITCH; } - -bool ImtqHandler::mgtIsTorqueing(dur_millis_t* remainingTorqueDuration) { - MutexGuard mg(TORQUE_LOCK); - if (TORQUEING and remainingTorqueDuration != nullptr) { - *remainingTorqueDuration = TORQUE_COUNTDOWN.getRemainingMillis() + TORQUE_BUFFER_TIME_MS; - } - return TORQUEING; -} diff --git a/mission/devices/ImtqHandler.h b/mission/devices/ImtqHandler.h index 7ddb4e4c..d414be0f 100644 --- a/mission/devices/ImtqHandler.h +++ b/mission/devices/ImtqHandler.h @@ -2,7 +2,7 @@ #define MISSION_DEVICES_IMTQHANDLER_H_ #include -#include +#include #include #include "events/subsystemIdRanges.h" @@ -107,7 +107,7 @@ class ImtqHandler : public DeviceHandlerBase { IMTQ::PosZSelfTestSet posZselfTestDataset; IMTQ::NegZSelfTestSet negZselfTestDataset; - NormalPollingMode pollingMode = NormalPollingMode::BOTH; + NormalPollingMode pollingMode = NormalPollingMode::UNCALIBRATED; PoolEntry mgmCalEntry = PoolEntry(3); PoolEntry dipoleXEntry = PoolEntry(0, false); @@ -221,15 +221,6 @@ class ImtqHandler : public DeviceHandlerBase { void checkErrorByte(const uint8_t errorByte, const uint8_t step); std::string makeStepString(const uint8_t step); - - static MutexIF* TORQUE_LOCK; - static bool TORQUEING; - static Countdown TORQUE_COUNTDOWN; - // Additional buffer time to accont for time until I2C command arrives and ramp up / ramp down - // time of the MGT - static constexpr dur_millis_t TORQUE_BUFFER_TIME_MS = 20; - - static bool mgtIsTorqueing(dur_millis_t* remainingTorqueDuration); }; #endif /* MISSION_DEVICES_IMTQHANDLER_H_ */ diff --git a/mission/devices/devicedefinitions/IMTQHandlerDefinitions.h b/mission/devices/devicedefinitions/imtqHandlerDefinitions.h similarity index 98% rename from mission/devices/devicedefinitions/IMTQHandlerDefinitions.h rename to mission/devices/devicedefinitions/imtqHandlerDefinitions.h index 320220dd..1799d347 100644 --- a/mission/devices/devicedefinitions/IMTQHandlerDefinitions.h +++ b/mission/devices/devicedefinitions/imtqHandlerDefinitions.h @@ -486,24 +486,17 @@ class DipoleActuationSet : public StaticLocalDataSet<4> { : StaticLocalDataSet(sid_t(objectId, IMTQ::SetIds::DIPOLES)) {} // Refresh torque command without changing any of the set dipoles. - void refreshTorqueing(uint16_t durationMs_) { - newActuation = true; - currentTorqueDurationMs = durationMs_; - } + void refreshTorqueing(uint16_t durationMs_) { currentTorqueDurationMs = durationMs_; } void setDipoles(uint16_t xDipole_, uint16_t yDipole_, uint16_t zDipole_, uint16_t currentTorqueDurationMs_) { - newActuation = false; if (xDipole.value != xDipole_) { - newActuation = true; } xDipole = xDipole_; if (yDipole.value != yDipole_) { - newActuation = true; } yDipole = yDipole_; if (zDipole.value != zDipole_) { - newActuation = true; } zDipole = zDipole_; currentTorqueDurationMs = currentTorqueDurationMs_; @@ -516,13 +509,11 @@ class DipoleActuationSet : public StaticLocalDataSet<4> { } private: - lp_var_t xDipole = lp_var_t(sid.objectId, DIPOLES_X, this); - lp_var_t yDipole = lp_var_t(sid.objectId, DIPOLES_Y, this); - lp_var_t zDipole = lp_var_t(sid.objectId, DIPOLES_Z, this); + lp_var_t xDipole = lp_var_t(sid.objectId, DIPOLES_X, this); + lp_var_t yDipole = lp_var_t(sid.objectId, DIPOLES_Y, this); + lp_var_t zDipole = lp_var_t(sid.objectId, DIPOLES_Z, this); lp_var_t currentTorqueDurationMs = lp_var_t(sid.objectId, CURRENT_TORQUE_DURATION, this); - - bool newActuation = false; }; /** diff --git a/mission/devices/torquer.cpp b/mission/devices/torquer.cpp new file mode 100644 index 00000000..27a32bef --- /dev/null +++ b/mission/devices/torquer.cpp @@ -0,0 +1,27 @@ +#include "torquer.h" + +#include + +MutexIF* TORQUE_LOCK = nullptr; + +namespace torquer { + +bool TORQUEING = false; +bool NEW_ACTUATION_FLAG = false; +Countdown TORQUE_COUNTDOWN = Countdown(); + +bool mgtIsTorqueing(dur_millis_t* remainingTorqueDuration) { + if (TORQUEING and remainingTorqueDuration != nullptr) { + *remainingTorqueDuration = TORQUE_COUNTDOWN.getRemainingMillis() + TORQUE_BUFFER_TIME_MS; + } + return TORQUEING; +} + +MutexIF* lazyLock() { + if (TORQUE_LOCK == nullptr) { + TORQUE_LOCK = MutexFactory::instance()->createMutex(); + } + return TORQUE_LOCK; +} + +} // namespace torquer diff --git a/mission/devices/torquer.h b/mission/devices/torquer.h new file mode 100644 index 00000000..10a27991 --- /dev/null +++ b/mission/devices/torquer.h @@ -0,0 +1,22 @@ +#ifndef MISSION_DEVICES_TOQUER_H_ +#define MISSION_DEVICES_TOQUER_H_ + +#include +#include + +namespace torquer { + +// Additional buffer time to accont for time until I2C command arrives and ramp up / ramp down +// time of the MGT +static constexpr dur_millis_t TORQUE_BUFFER_TIME_MS = 20; + +MutexIF* lazyLock(); +extern bool TORQUEING; +extern bool NEW_ACTUATION_FLAG; +extern Countdown TORQUE_COUNTDOWN; + +bool mgtIsTorqueing(dur_millis_t* remainingTorqueDuration); + +} // namespace torquer + +#endif /* MISSION_DEVICES_TOQUER_H_ */ diff --git a/tmtc b/tmtc index 42b962de..1dfc2fca 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 42b962dede547975488e72b22abe2360065c0404 +Subproject commit 1dfc2fca2f58f8d226fab01c87eb529ba7ec8376 -- 2.43.0 From 75a4cd1b6977166bdfaaf684ad10917aea161cdc Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 20 Oct 2022 16:09:18 +0200 Subject: [PATCH 53/97] awful solution but works --- fsfw | 2 +- .../pollingSequenceFactory.cpp | 18 ++++++++++--- mission/controller/AcsController.cpp | 12 ++++----- mission/controller/AcsController.h | 1 - mission/devices/ImtqHandler.cpp | 27 ++++++++++++++++--- mission/devices/ImtqHandler.h | 1 + .../imtqHandlerDefinitions.h | 1 + 7 files changed, 47 insertions(+), 15 deletions(-) diff --git a/fsfw b/fsfw index 0c5c2f6c..73454c62 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 0c5c2f6c4f07959a73a083eb3c6e1f3125642477 +Subproject commit 73454c629c042de8efe7aa4fa6dcbf1e184b0961 diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp index 0d75588f..59f07d1f 100644 --- a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp @@ -430,11 +430,21 @@ ReturnValue_t pst::pstI2c(FixedTimeslotTaskIF *thisSequence) { uint32_t length = thisSequence->getPeriodMs(); static_cast(length); #if OBSW_ADD_MGT == 1 - thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.2, DeviceHandlerIF::PERFORM_OPERATION); thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.2, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.4, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.6, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.8, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.2, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.2, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.2, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.2, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.2, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.2, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.2, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.2, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.2, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.2, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.2, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.2, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.2, DeviceHandlerIF::GET_READ); #endif #if OBSW_ADD_BPX_BATTERY_HANDLER == 1 thisSequence->addSlot(objects::BPX_BATT_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index b8b1e8ca..c94a2cb6 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -32,12 +32,12 @@ void AcsController::performControlOperation() { } { - // TODO: Calculate actuator output - PoolReadGuard pg(&dipoleSet); - MutexGuard mg(torquer::lazyLock()); - torquer::NEW_ACTUATION_FLAG = true; - // TODO: Insert correct values here - dipoleSet.setDipoles(500, 500, 500, 150); + // TODO: Calculate actuator output + // PoolReadGuard pg(&dipoleSet); + // MutexGuard mg(torquer::lazyLock()); + // torquer::NEW_ACTUATION_FLAG = true; + // TODO: Insert correct values here + // dipoleSet.setDipoles(500, 500, 500, 150); } { diff --git a/mission/controller/AcsController.h b/mission/controller/AcsController.h index adb6fbb6..0cf38bc7 100644 --- a/mission/controller/AcsController.h +++ b/mission/controller/AcsController.h @@ -20,7 +20,6 @@ class AcsController : public ExtendedControllerBase { enum class InternalState { STARTUP, INITIAL_DELAY, READY }; InternalState internalState = InternalState::STARTUP; - ReturnValue_t handleCommandMessage(CommandMessage* message) override; void performControlOperation() override; diff --git a/mission/devices/ImtqHandler.cpp b/mission/devices/ImtqHandler.cpp index c65674ce..bec21d95 100644 --- a/mission/devices/ImtqHandler.cpp +++ b/mission/devices/ImtqHandler.cpp @@ -27,6 +27,8 @@ #include "mission/devices/torquer.h" +static constexpr bool ACTUATION_WIRETAPPING = false; + ImtqHandler::ImtqHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie, power::Switch_t pwrSwitcher) : DeviceHandlerBase(objectId, comIF, comCookie), @@ -46,7 +48,7 @@ ImtqHandler::ImtqHandler(object_id_t objectId, object_id_t comIF, CookieIF* comC } } -ImtqHandler::~ImtqHandler() {} +ImtqHandler::~ImtqHandler() = default; void ImtqHandler::doStartUp() { if (goToNormalMode) { @@ -182,7 +184,7 @@ ReturnValue_t ImtqHandler::buildCommandFromCommand(DeviceCommandId_t deviceComma } ReturnValue_t result; // Commands override anything which was set in the software - if (commandBuffer != nullptr) { + if (commandData != nullptr) { dipoleSet.setValidityBufferGeneration(false); result = dipoleSet.deSerialize(&commandData, &commandDataLen, SerializeIF::Endianness::NETWORK); @@ -194,6 +196,11 @@ ReturnValue_t ImtqHandler::buildCommandFromCommand(DeviceCommandId_t deviceComma // Read set dipole values from local pool PoolReadGuard pg(&dipoleSet); } + if (ACTUATION_WIRETAPPING) { + sif::debug << "Actuating IMTQ with parameters x = " << dipoleSet.xDipole.value + << ", y = " << dipoleSet.yDipole.value << ", z = " << dipoleSet.zDipole.value + << ", duration = " << dipoleSet.currentTorqueDurationMs.value << std::endl; + } result = buildDipoleActuationCommand(); if (result != returnvalue::OK) { return result; @@ -312,8 +319,17 @@ ReturnValue_t ImtqHandler::scanForReply(const uint8_t* start, size_t remainingSi *foundLen = IMTQ::SIZE_SELF_TEST_RESULTS; *foundId = IMTQ::GET_SELF_TEST_RESULT; break; + case (IMTQ::CC::PAST_AVAILABLE_RESPONSE_BYTES): { + sif::warning << "IMTQHandler::scanForReply: Read 0xFF command byte, reading past available " + "bytes. Keep 1 ms delay" + " between I2C send and read" + << std::endl; + result = IGNORE_REPLY_DATA; + break; + } default: - sif::debug << "IMTQHandler::scanForReply: Reply contains invalid command code" << std::endl; + sif::debug << "IMTQHandler::scanForReply: Reply with length " << remainingSize + << "contains invalid command code " << static_cast(*start) << std::endl; result = IGNORE_REPLY_DATA; break; } @@ -2276,6 +2292,11 @@ void ImtqHandler::checkErrorByte(const uint8_t errorByte, const uint8_t step) { } } +void ImtqHandler::doSendRead() { + TaskFactory::delayTask(1); + DeviceHandlerBase::doSendRead(); +} + std::string ImtqHandler::makeStepString(const uint8_t step) { std::string stepString(""); switch (step) { diff --git a/mission/devices/ImtqHandler.h b/mission/devices/ImtqHandler.h index d414be0f..cfad9d7f 100644 --- a/mission/devices/ImtqHandler.h +++ b/mission/devices/ImtqHandler.h @@ -23,6 +23,7 @@ class ImtqHandler : public DeviceHandlerBase { void setPollingMode(NormalPollingMode pollMode); + void doSendRead() override; /** * @brief Sets mode to MODE_NORMAL. Can be used for debugging. */ diff --git a/mission/devices/devicedefinitions/imtqHandlerDefinitions.h b/mission/devices/devicedefinitions/imtqHandlerDefinitions.h index 1799d347..b3598970 100644 --- a/mission/devices/devicedefinitions/imtqHandlerDefinitions.h +++ b/mission/devices/devicedefinitions/imtqHandlerDefinitions.h @@ -86,6 +86,7 @@ static const uint8_t GET_COMMANDED_DIPOLE = 0x46; static const uint8_t GET_RAW_MTM_MEASUREMENT = 0x42; static const uint8_t GET_CAL_MTM_MEASUREMENT = 0x43; static const uint8_t GET_SELF_TEST_RESULT = 0x47; +static const uint8_t PAST_AVAILABLE_RESPONSE_BYTES = 0xff; }; // namespace CC namespace SELF_TEST_AXIS { -- 2.43.0 From bff4f6fa8d0b03cb81e5bae60f22b5df2ac08cb0 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 20 Oct 2022 16:09:49 +0200 Subject: [PATCH 54/97] reformatinng --- mission/devices/ImtqHandler.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mission/devices/ImtqHandler.cpp b/mission/devices/ImtqHandler.cpp index bec21d95..d27b6f65 100644 --- a/mission/devices/ImtqHandler.cpp +++ b/mission/devices/ImtqHandler.cpp @@ -321,9 +321,7 @@ ReturnValue_t ImtqHandler::scanForReply(const uint8_t* start, size_t remainingSi break; case (IMTQ::CC::PAST_AVAILABLE_RESPONSE_BYTES): { sif::warning << "IMTQHandler::scanForReply: Read 0xFF command byte, reading past available " - "bytes. Keep 1 ms delay" - " between I2C send and read" - << std::endl; + "bytes. Keep 1 ms delay between I2C send and read" << std::endl; result = IGNORE_REPLY_DATA; break; } -- 2.43.0 From def93d3e59c07fb7e68d8417f63918a7bd16c898 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 20 Oct 2022 17:09:38 +0200 Subject: [PATCH 55/97] bump deps --- fsfw | 2 +- tmtc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fsfw b/fsfw index 692be9df..73454c62 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 692be9df8d06beb3bfc83aad77cefd727d8f7c35 +Subproject commit 73454c629c042de8efe7aa4fa6dcbf1e184b0961 diff --git a/tmtc b/tmtc index 9493cdaa..1dfc2fca 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 9493cdaabf3cef636dcab2c98768215b0e58636b +Subproject commit 1dfc2fca2f58f8d226fab01c87eb529ba7ec8376 -- 2.43.0 From 5abbaeddb06c461a2c3a425d5a5fbba3cb55da6a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 20 Oct 2022 17:16:37 +0200 Subject: [PATCH 56/97] update EM obj factory --- bsp_q7s/em/emObjectFactory.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bsp_q7s/em/emObjectFactory.cpp b/bsp_q7s/em/emObjectFactory.cpp index b8e83862..d80d0af7 100644 --- a/bsp_q7s/em/emObjectFactory.cpp +++ b/bsp_q7s/em/emObjectFactory.cpp @@ -43,13 +43,14 @@ void ObjectFactory::produce(void* args) { // createSunSensorComponents(gpioComIF, spiMainComIF, pwrSwitcher, q7s::SPI_DEFAULT_DEV); // createRtdComponents(q7s::SPI_DEFAULT_DEV, gpioComIF, pwrSwitcher, spiMainComIF); // createTmpComponents(); + // createSolarArrayDeploymentComponents(); createRadSensorComponent(gpioComIF); #if OBSW_ADD_ACS_BOARD == 1 createAcsBoardComponents(gpioComIF, uartComIF, pwrSwitcher); #endif createHeaterComponents(gpioComIF, pwrSwitcher, healthTable); - createSolarArrayDeploymentComponents(); + createPayloadComponents(gpioComIF); #if OBSW_ADD_MGT == 1 @@ -71,6 +72,9 @@ void ObjectFactory::produce(void* args) { #if OBSW_ADD_TEST_CODE == 1 createTestComponents(gpioComIF); #endif /* OBSW_ADD_TEST_CODE == 1 */ +#if OBSW_ADD_SCEX_DEVICE == 1 + createScexComponents(q7s::UART_SCEX_DEV, pwrSwitcher, *SdCardManager::instance(), true, std::nullopt); +#endif createMiscComponents(); createAcsController(); -- 2.43.0 From da177f117093e489897eabcb229bef613177d847 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 20 Oct 2022 17:25:27 +0200 Subject: [PATCH 57/97] create SA deployment dummy --- dummies/CMakeLists.txt | 1 + dummies/SaDeploymentDummy.cpp | 10 ++++++++++ dummies/SaDeploymentDummy.h | 19 +++++++++++++++++++ dummies/helpers.cpp | 2 ++ 4 files changed, 32 insertions(+) create mode 100644 dummies/SaDeploymentDummy.cpp create mode 100644 dummies/SaDeploymentDummy.h diff --git a/dummies/CMakeLists.txt b/dummies/CMakeLists.txt index 4cb05289..677120fb 100644 --- a/dummies/CMakeLists.txt +++ b/dummies/CMakeLists.txt @@ -12,6 +12,7 @@ target_sources( AcuDummy.cpp PduDummy.cpp P60DockDummy.cpp + SaDeploymentDummy.cpp GyroAdisDummy.cpp GyroL3GD20Dummy.cpp MgmLIS3MDLDummy.cpp diff --git a/dummies/SaDeploymentDummy.cpp b/dummies/SaDeploymentDummy.cpp new file mode 100644 index 00000000..8ea80545 --- /dev/null +++ b/dummies/SaDeploymentDummy.cpp @@ -0,0 +1,10 @@ +#include "SaDeploymentDummy.h" + +SaDeplDummy::SaDeplDummy(object_id_t objectId): SystemObject(objectId) { +} + +SaDeplDummy::~SaDeplDummy() = default; + +ReturnValue_t SaDeplDummy::performOperation(uint8_t opCode) { + return returnvalue::OK; +} diff --git a/dummies/SaDeploymentDummy.h b/dummies/SaDeploymentDummy.h new file mode 100644 index 00000000..a0b5ccdf --- /dev/null +++ b/dummies/SaDeploymentDummy.h @@ -0,0 +1,19 @@ + +#ifndef DUMMIES_SADEPLOYMENT_H_ +#define DUMMIES_SADEPLOYMENT_H_ + +#include "SaDeploymentDummy.h" +#include + +class SaDeplDummy : public SystemObject, public ExecutableObjectIF { + public: + + SaDeplDummy(object_id_t objectId); + virtual ~SaDeplDummy(); + + ReturnValue_t performOperation(uint8_t opCode) override; + + protected: +}; + +#endif /* DUMMIES_SADEPLOYMENT_H_ */ diff --git a/dummies/helpers.cpp b/dummies/helpers.cpp index 8eb73250..2b18cffd 100644 --- a/dummies/helpers.cpp +++ b/dummies/helpers.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -35,6 +36,7 @@ void dummy::createDummies(DummyCfg cfg) { new RwDummy(objects::RW2, objects::DUMMY_COM_IF, comCookieDummy); new RwDummy(objects::RW3, objects::DUMMY_COM_IF, comCookieDummy); new RwDummy(objects::RW4, objects::DUMMY_COM_IF, comCookieDummy); + new SaDeplDummy(objects::SOLAR_ARRAY_DEPL_HANDLER); new StarTrackerDummy(objects::STAR_TRACKER, objects::DUMMY_COM_IF, comCookieDummy); new SyrlinksDummy(objects::SYRLINKS_HK_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); new ImtqDummy(objects::IMTQ_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); -- 2.43.0 From 6effbaa85ed7c317f3fea5b89c5a53ba31f655a3 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 20 Oct 2022 18:03:37 +0200 Subject: [PATCH 58/97] EM installer updates --- CMakeLists.txt | 2 +- q7s-env-em.sh | 2 +- scripts/install-obsw-yocto.sh | 11 ++++------- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d6a73014..43336bdd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -105,7 +105,7 @@ set(OBSW_ADD_ACS_CTRL ${INIT_VAL} CACHE STRING "Add ACS controller") set(OBSW_ADD_RTD_DEVICES - 1 + ${INIT_VAL} CACHE STRING "Add RTD devices") set(OBSW_ADD_RAD_SENSORS ${INIT_VAL} diff --git a/q7s-env-em.sh b/q7s-env-em.sh index e8be1467..86737627 100755 --- a/q7s-env-em.sh +++ b/q7s-env-em.sh @@ -19,5 +19,5 @@ if [[ -d "eive-obsw" ]]; then export PATH=$PATH:"$(pwd)/eive-obsw/scripts" cd "eive-obsw" fi -export CONSOLE_PREFIX="[Q7S ENV]" +export CONSOLE_PREFIX="[Q7S ENV EM]" /bin/bash diff --git a/scripts/install-obsw-yocto.sh b/scripts/install-obsw-yocto.sh index c7880d2f..d9d94818 100755 --- a/scripts/install-obsw-yocto.sh +++ b/scripts/install-obsw-yocto.sh @@ -2,13 +2,10 @@ # This is a helper script to install the compiles EIVE OBSW files # into the yocto repository to re-generate the mission root filesystem build_dir=cmake-build-release-q7s -em_install="0" -if [ ! -z ${1} ]; then - if [[ "${1}" == "em" ]]; then - echo "-I- Installing EM binaries" - em_install="1" - build_dir=cmake-build-release-q7s-em - fi +if [ ! -z ${1} && "${1}" == "em" ] || [[ ${EIVE_Q7S_EM} == "1" ]]; then + echo "-I- Installing EM binaries" + em_install="1" + build_dir=cmake-build-release-q7s-em fi init_dir=$(pwd) -- 2.43.0 From f29b578caed987a69eef89de5a0845f5667cf05c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 20 Oct 2022 18:14:26 +0200 Subject: [PATCH 59/97] do not install watchdog in yocto install script --- scripts/install-obsw-yocto.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/scripts/install-obsw-yocto.sh b/scripts/install-obsw-yocto.sh index d9d94818..a7e3f20a 100755 --- a/scripts/install-obsw-yocto.sh +++ b/scripts/install-obsw-yocto.sh @@ -81,17 +81,17 @@ else echo "-I- Installed EIVE OBSW into yocto repository successfully" fi -if [ ! -f ${build_dir}/${watchdog_bin_name} ]; then - echo "-W- No EIVE Watchdog found to intall to yocto" -else - cp_cmd="cp $(pwd)/${build_dir}/${watchdog_bin_name} ${yocto_root}/${yocto_watchdog_path}/${watchdog_target_name}" - echo "-I- Executing: ${cp_cmd}" - eval ${cp_cmd} - cp_ver_cmd="cp $(pwd)/${obsw_version_filename} ${yocto_root}/${yocto_watchdog_path}" - echo "-I- Executing: ${cp_ver_cmd}" - eval ${cp_ver_cmd} - echo "-I- Installed EIVE watchdog into yocto repository successfully" -fi +#if [ ! -f ${build_dir}/${watchdog_bin_name} ]; then +# echo "-W- No EIVE Watchdog found to intall to yocto" +#else +# cp_cmd="cp $(pwd)/${build_dir}/${watchdog_bin_name} ${yocto_root}/${yocto_watchdog_path}/${watchdog_target_name}" +# echo "-I- Executing: ${cp_cmd}" +# eval ${cp_cmd} +# cp_ver_cmd="cp $(pwd)/${obsw_version_filename} ${yocto_root}/${yocto_watchdog_path}" +# echo "-I- Executing: ${cp_ver_cmd}" +# eval ${cp_ver_cmd} +# echo "-I- Installed EIVE watchdog into yocto repository successfully" +#fi if [ -f $(pwd)/${obsw_version_filename} ]; then rm $(pwd)/${obsw_version_filename} -- 2.43.0 From 22d4d7085d55f29d3b33137adf82a9a6b95437a5 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 21 Oct 2022 11:31:38 +0200 Subject: [PATCH 60/97] adaptions so it compiles --- fsfw | 2 +- mission/tmtc/CCSDSHandler.cpp | 4 ++-- mission/tmtc/CCSDSHandler.h | 2 +- mission/tmtc/TmFunnel.cpp | 2 +- mission/tmtc/TmFunnel.h | 2 +- mission/tmtc/VirtualChannel.cpp | 2 +- mission/tmtc/VirtualChannel.h | 2 +- tmtc | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/fsfw b/fsfw index 73454c62..2de9e25c 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 73454c629c042de8efe7aa4fa6dcbf1e184b0961 +Subproject commit 2de9e25cebd3b0cfdac538b5c4dd88e0274ebbac diff --git a/mission/tmtc/CCSDSHandler.cpp b/mission/tmtc/CCSDSHandler.cpp index b3b03d40..26abec25 100644 --- a/mission/tmtc/CCSDSHandler.cpp +++ b/mission/tmtc/CCSDSHandler.cpp @@ -180,9 +180,9 @@ void CCSDSHandler::addVirtualChannel(VcId_t vcId, VirtualChannel* virtualChannel } } -MessageQueueId_t CCSDSHandler::getReportReceptionQueue(uint8_t virtualChannel) { +MessageQueueId_t CCSDSHandler::getReportReceptionQueue(uint8_t virtualChannel) const { if (virtualChannel < common::NUMBER_OF_VIRTUAL_CHANNELS) { - VirtualChannelMapIter iter = virtualChannelMap.find(virtualChannel); + auto iter = virtualChannelMap.find(virtualChannel); if (iter != virtualChannelMap.end()) { return iter->second->getReportReceptionQueue(); } else { diff --git a/mission/tmtc/CCSDSHandler.h b/mission/tmtc/CCSDSHandler.h index 035f9e31..d76dbdaf 100644 --- a/mission/tmtc/CCSDSHandler.h +++ b/mission/tmtc/CCSDSHandler.h @@ -67,7 +67,7 @@ class CCSDSHandler : public SystemObject, */ void addVirtualChannel(VcId_t virtualChannelId, VirtualChannel* virtualChannel); - MessageQueueId_t getReportReceptionQueue(uint8_t virtualChannel = 0); + MessageQueueId_t getReportReceptionQueue(uint8_t virtualChannel = 0) const override; ReturnValue_t getParameter(uint8_t domainId, uint8_t uniqueIdentifier, ParameterWrapper* parameterWrapper, const ParameterWrapper* newValues, uint16_t startAtIndex); diff --git a/mission/tmtc/TmFunnel.cpp b/mission/tmtc/TmFunnel.cpp index 49e9ba6e..7763bd45 100644 --- a/mission/tmtc/TmFunnel.cpp +++ b/mission/tmtc/TmFunnel.cpp @@ -25,7 +25,7 @@ TmFunnel::TmFunnel(object_id_t objectId, CdsShortTimeStamper& timeReader, uint32 TmFunnel::~TmFunnel() {} -MessageQueueId_t TmFunnel::getReportReceptionQueue(uint8_t virtualChannel) { +MessageQueueId_t TmFunnel::getReportReceptionQueue(uint8_t virtualChannel) const { return tmQueue->getId(); } diff --git a/mission/tmtc/TmFunnel.h b/mission/tmtc/TmFunnel.h index 325f3709..07f9382a 100644 --- a/mission/tmtc/TmFunnel.h +++ b/mission/tmtc/TmFunnel.h @@ -29,7 +29,7 @@ class TmFunnel : public AcceptsTelemetryIF, public ExecutableObjectIF, public Sy virtual ~TmFunnel(); const char* getName() const override; - MessageQueueId_t getReportReceptionQueue(uint8_t virtualChannel = 0) override; + MessageQueueId_t getReportReceptionQueue(uint8_t virtualChannel = 0) const override; ReturnValue_t performOperation(uint8_t operationCode = 0) override; ReturnValue_t initialize() override; diff --git a/mission/tmtc/VirtualChannel.cpp b/mission/tmtc/VirtualChannel.cpp index 6ba404e4..96a37b3b 100644 --- a/mission/tmtc/VirtualChannel.cpp +++ b/mission/tmtc/VirtualChannel.cpp @@ -53,7 +53,7 @@ ReturnValue_t VirtualChannel::performOperation() { return result; } -MessageQueueId_t VirtualChannel::getReportReceptionQueue(uint8_t virtualChannel) { +MessageQueueId_t VirtualChannel::getReportReceptionQueue(uint8_t virtualChannel) const { return tmQueue->getId(); } diff --git a/mission/tmtc/VirtualChannel.h b/mission/tmtc/VirtualChannel.h index b6ba8241..024ccee6 100644 --- a/mission/tmtc/VirtualChannel.h +++ b/mission/tmtc/VirtualChannel.h @@ -27,7 +27,7 @@ class VirtualChannel : public AcceptsTelemetryIF { VirtualChannel(uint8_t vcId, uint32_t tmQueueDepth, object_id_t ownerId); ReturnValue_t initialize(); - MessageQueueId_t getReportReceptionQueue(uint8_t virtualChannel = 0) override; + MessageQueueId_t getReportReceptionQueue(uint8_t virtualChannel = 0) const override; ReturnValue_t performOperation(); /** diff --git a/tmtc b/tmtc index 1dfc2fca..3cbfeb70 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 1dfc2fca2f58f8d226fab01c87eb529ba7ec8376 +Subproject commit 3cbfeb70156d2b60c2cce1fc28b4ace7f58e8af3 -- 2.43.0 From dc45c53e383e4492991081f5d4cf846221377520 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 21 Oct 2022 11:51:44 +0200 Subject: [PATCH 61/97] add new CFDP and PUS TM funnel --- bsp_q7s/core/ObjectFactory.cpp | 14 +-- bsp_q7s/em/emObjectFactory.cpp | 3 +- dummies/SaDeploymentDummy.cpp | 7 +- dummies/SaDeploymentDummy.h | 4 +- linux/fsfwconfig/objects/systemObjectList.h | 2 + mission/core/GenericFactory.cpp | 50 ++++---- mission/tmtc/CMakeLists.txt | 5 +- mission/tmtc/CfdpTmFunnel.cpp | 84 +++++++++++++ mission/tmtc/CfdpTmFunnel.h | 27 +++++ mission/tmtc/PusTmFunnel.cpp | 69 +++++++++++ mission/tmtc/PusTmFunnel.h | 39 ++++++ mission/tmtc/TmFunnel.cpp | 127 ++------------------ mission/tmtc/TmFunnel.h | 38 ++---- 13 files changed, 285 insertions(+), 184 deletions(-) create mode 100644 mission/tmtc/CfdpTmFunnel.cpp create mode 100644 mission/tmtc/CfdpTmFunnel.h create mode 100644 mission/tmtc/PusTmFunnel.cpp create mode 100644 mission/tmtc/PusTmFunnel.h diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 74af9564..3d48e52f 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -108,13 +108,13 @@ void Factory::setStaticFrameworkObjectIds() { DeviceHandlerBase::powerSwitcherId = objects::PCDU_HANDLER; #endif /* OBSW_Q7S_EM == 1 */ -#if OBSW_TM_TO_PTME == 1 - TmFunnel::downlinkDestination = objects::CCSDS_HANDLER; -#else - TmFunnel::downlinkDestination = objects::TMTC_BRIDGE; -#endif /* OBSW_TM_TO_PTME == 1 */ - // No storage object for now. - TmFunnel::storageDestination = objects::NO_OBJECT; + //#if OBSW_TM_TO_PTME == 1 + // TmFunnel::downlinkDestination = objects::CCSDS_HANDLER; + //#else + // TmFunnel::downlinkDestination = objects::TMTC_BRIDGE; + //#endif /* OBSW_TM_TO_PTME == 1 */ + // // No storage object for now. + // TmFunnel::storageDestination = objects::NO_OBJECT; LocalDataPoolManager::defaultHkDestination = objects::PUS_SERVICE_3_HOUSEKEEPING; diff --git a/bsp_q7s/em/emObjectFactory.cpp b/bsp_q7s/em/emObjectFactory.cpp index d80d0af7..4202cfdd 100644 --- a/bsp_q7s/em/emObjectFactory.cpp +++ b/bsp_q7s/em/emObjectFactory.cpp @@ -73,7 +73,8 @@ void ObjectFactory::produce(void* args) { createTestComponents(gpioComIF); #endif /* OBSW_ADD_TEST_CODE == 1 */ #if OBSW_ADD_SCEX_DEVICE == 1 - createScexComponents(q7s::UART_SCEX_DEV, pwrSwitcher, *SdCardManager::instance(), true, std::nullopt); + createScexComponents(q7s::UART_SCEX_DEV, pwrSwitcher, *SdCardManager::instance(), true, + std::nullopt); #endif createMiscComponents(); diff --git a/dummies/SaDeploymentDummy.cpp b/dummies/SaDeploymentDummy.cpp index 8ea80545..28588ea7 100644 --- a/dummies/SaDeploymentDummy.cpp +++ b/dummies/SaDeploymentDummy.cpp @@ -1,10 +1,7 @@ #include "SaDeploymentDummy.h" -SaDeplDummy::SaDeplDummy(object_id_t objectId): SystemObject(objectId) { -} +SaDeplDummy::SaDeplDummy(object_id_t objectId) : SystemObject(objectId) {} SaDeplDummy::~SaDeplDummy() = default; -ReturnValue_t SaDeplDummy::performOperation(uint8_t opCode) { - return returnvalue::OK; -} +ReturnValue_t SaDeplDummy::performOperation(uint8_t opCode) { return returnvalue::OK; } diff --git a/dummies/SaDeploymentDummy.h b/dummies/SaDeploymentDummy.h index a0b5ccdf..a9b72391 100644 --- a/dummies/SaDeploymentDummy.h +++ b/dummies/SaDeploymentDummy.h @@ -2,12 +2,12 @@ #ifndef DUMMIES_SADEPLOYMENT_H_ #define DUMMIES_SADEPLOYMENT_H_ -#include "SaDeploymentDummy.h" #include +#include "SaDeploymentDummy.h" + class SaDeplDummy : public SystemObject, public ExecutableObjectIF { public: - SaDeplDummy(object_id_t objectId); virtual ~SaDeplDummy(); diff --git a/linux/fsfwconfig/objects/systemObjectList.h b/linux/fsfwconfig/objects/systemObjectList.h index 51f6b919..e09e5f5f 100644 --- a/linux/fsfwconfig/objects/systemObjectList.h +++ b/linux/fsfwconfig/objects/systemObjectList.h @@ -41,6 +41,8 @@ enum sourceObjects : uint32_t { CCSDS_IP_CORE_BRIDGE = 0x73500000, TM_FUNNEL = 0x73000100, + PUS_TM_FUNNEL = 0x73000101, + CFDP_TM_FUNNEL = 0x73000102, /* 0x49 ('I') for Communication Interfaces **/ ARDUINO_COM_IF = 0x49000000, diff --git a/mission/core/GenericFactory.cpp b/mission/core/GenericFactory.cpp index 24870504..6158af5c 100644 --- a/mission/core/GenericFactory.cpp +++ b/mission/core/GenericFactory.cpp @@ -22,6 +22,8 @@ #include #include #include +#include +#include #include #include "OBSWConfig.h" @@ -94,6 +96,26 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_) { new PoolManager(objects::IPC_STORE, poolCfg); } +#if OBSW_ADD_TCPIP_BRIDGE == 1 +#if OBSW_USE_TMTC_TCP_BRIDGE == 0 + auto tmtcBridge = new UdpTmTcBridge(objects::TMTC_BRIDGE, objects::CCSDS_PACKET_DISTRIBUTOR); + new UdpTcPollingTask(objects::TMTC_POLLING_TASK, objects::TMTC_BRIDGE); + sif::info << "Created UDP server for TMTC commanding with listener port " + << udpBridge->getUdpPort() << std::endl; +#else + auto tmtcBridge = new TcpTmTcBridge(objects::TMTC_BRIDGE, objects::CCSDS_PACKET_DISTRIBUTOR); + auto tcpServer = new TcpTmTcServer(objects::TMTC_POLLING_TASK, objects::TMTC_BRIDGE); + // 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; +#if OBSW_TCP_SERVER_WIRETAPPING == 1 + tcpServer->enableWiretapping(true); +#endif /* OBSW_TCP_SERVER_WIRETAPPING == 1 */ +#endif /* OBSW_USE_TMTC_TCP_BRIDGE == 0 */ + tmtcBridge->setMaxNumberOfPacketsStored(300); +#endif /* OBSW_ADD_TCPIP_BRIDGE == 1 */ + auto* ccsdsDistrib = new CcsdsDistributor(config::EIVE_PUS_APID, objects::CCSDS_PACKET_DISTRIBUTOR); new PusDistributor(config::EIVE_PUS_APID, objects::PUS_PACKET_DISTRIBUTOR, ccsdsDistrib); @@ -102,8 +124,12 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_) { #if OBSW_TM_TO_PTME == 1 vc = config::LIVE_TM; #endif + auto* cfdpFunnel = + new CfdpTmFunnel(objects::CFDP_TM_FUNNEL, config::EIVE_CFDP_APID, *tmtcBridge, *tmStore); + auto* pusFunnel = + new PusTmFunnel(objects::PUS_TM_FUNNEL, *tmtcBridge, *timeStamper, *tmStore, vc); // Every TM packet goes through this funnel - auto* funnel = new TmFunnel(objects::TM_FUNNEL, *timeStamper, 50, vc); + new TmFunnel(objects::TM_FUNNEL, *pusFunnel, *cfdpFunnel); // PUS service stack new Service1TelecommandVerification(objects::PUS_SERVICE_1_VERIFICATION, config::EIVE_PUS_APID, @@ -131,25 +157,6 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_) { pus::PUS_SERVICE_200, 8); new CService201HealthCommanding(objects::PUS_SERVICE_201_HEALTH, config::EIVE_PUS_APID, pus::PUS_SERVICE_201); -#if OBSW_ADD_TCPIP_BRIDGE == 1 -#if OBSW_USE_TMTC_TCP_BRIDGE == 0 - auto tmtcBridge = new UdpTmTcBridge(objects::TMTC_BRIDGE, objects::CCSDS_PACKET_DISTRIBUTOR); - new UdpTcPollingTask(objects::TMTC_POLLING_TASK, objects::TMTC_BRIDGE); - sif::info << "Created UDP server for TMTC commanding with listener port " - << udpBridge->getUdpPort() << std::endl; -#else - auto tmtcBridge = new TcpTmTcBridge(objects::TMTC_BRIDGE, objects::CCSDS_PACKET_DISTRIBUTOR); - auto tcpServer = new TcpTmTcServer(objects::TMTC_POLLING_TASK, objects::TMTC_BRIDGE); - // 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; -#if OBSW_TCP_SERVER_WIRETAPPING == 1 - tcpServer->enableWiretapping(true); -#endif /* OBSW_TCP_SERVER_WIRETAPPING == 1 */ -#endif /* OBSW_USE_TMTC_TCP_BRIDGE == 0 */ - tmtcBridge->setMaxNumberOfPacketsStored(300); -#endif /* OBSW_ADD_TCPIP_BRIDGE == 1 */ #if OBSW_ADD_CFDP_COMPONENTS == 1 using namespace cfdp; @@ -158,7 +165,8 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_) { new CfdpDistributor(distribCfg); auto* msgQueue = QueueFactory::instance()->createMessageQueue(32); - FsfwHandlerParams params(objects::CFDP_HANDLER, HOST_FS, *funnel, *tcStore, *tmStore, *msgQueue); + FsfwHandlerParams params(objects::CFDP_HANDLER, HOST_FS, *cfdpFunnel, *tcStore, *tmStore, + *msgQueue); cfdp::IndicationCfg indicationCfg; UnsignedByteField apid(config::EIVE_LOCAL_CFDP_ENTITY_ID); cfdp::EntityId localId(apid); diff --git a/mission/tmtc/CMakeLists.txt b/mission/tmtc/CMakeLists.txt index 0a931d0f..f34f9ccc 100644 --- a/mission/tmtc/CMakeLists.txt +++ b/mission/tmtc/CMakeLists.txt @@ -1,2 +1,3 @@ -target_sources(${LIB_EIVE_MISSION} PRIVATE CCSDSHandler.cpp VirtualChannel.cpp - TmFunnel.cpp) +target_sources( + ${LIB_EIVE_MISSION} PRIVATE CCSDSHandler.cpp VirtualChannel.cpp TmFunnel.cpp + CfdpTmFunnel.cpp PusTmFunnel.cpp) diff --git a/mission/tmtc/CfdpTmFunnel.cpp b/mission/tmtc/CfdpTmFunnel.cpp new file mode 100644 index 00000000..56b57ef9 --- /dev/null +++ b/mission/tmtc/CfdpTmFunnel.cpp @@ -0,0 +1,84 @@ +#include "CfdpTmFunnel.h" + +#include "fsfw/ipc/QueueFactory.h" +#include "fsfw/tmtcpacket/ccsds/SpacePacketCreator.h" +#include "fsfw/tmtcservices/TmTcMessage.h" + +CfdpTmFunnel::CfdpTmFunnel(object_id_t objectId, uint16_t cfdpInCcsdsApid, + const AcceptsTelemetryIF& downlinkDestination, StorageManagerIF& tmStore) + : SystemObject(objectId), cfdpInCcsdsApid(cfdpInCcsdsApid), tmStore(tmStore) { + msgQueue = QueueFactory::instance()->createMessageQueue(5); + msgQueue->setDefaultDestination(downlinkDestination.getReportReceptionQueue()); +} + +const char* CfdpTmFunnel::getName() const { return "CFDP TM Funnel"; } + +MessageQueueId_t CfdpTmFunnel::getReportReceptionQueue(uint8_t virtualChannel) const { + return msgQueue->getId(); +} + +ReturnValue_t CfdpTmFunnel::performOperation(uint8_t) { + TmTcMessage currentMessage; + ReturnValue_t status = msgQueue->receiveMessage(¤tMessage); + while (status == returnvalue::OK) { + status = handlePacket(currentMessage); + if (status != returnvalue::OK) { + sif::warning << "CfdpTmFunnel packet handling failed" << std::endl; + break; + } + status = msgQueue->receiveMessage(¤tMessage); + } + + if (status == MessageQueueIF::EMPTY) { + return returnvalue::OK; + } + return status; +} + +ReturnValue_t CfdpTmFunnel::initialize() { return returnvalue::OK; } + +ReturnValue_t CfdpTmFunnel::handlePacket(TmTcMessage& msg) { + const uint8_t* cfdpPacket = nullptr; + size_t cfdpPacketLen = 0; + ReturnValue_t result = tmStore.getData(msg.getStorageId(), &cfdpPacket, &cfdpPacketLen); + if (result != returnvalue::OK) { + return result; + } + auto spacePacketHeader = + SpacePacketCreator(ccsds::PacketType::TM, false, cfdpInCcsdsApid, + ccsds::SequenceFlags::UNSEGMENTED, sourceSequenceCount++, 0); + sourceSequenceCount = sourceSequenceCount & ccsds::LIMIT_SEQUENCE_COUNT; + spacePacketHeader.setCcsdsLenFromTotalDataFieldLen(cfdpPacketLen); + uint8_t* newPacketData = nullptr; + store_address_t newStoreId{}; + result = + tmStore.getFreeElement(&newStoreId, spacePacketHeader.getFullPacketLen(), &newPacketData); + if (result != returnvalue::OK) { +#if FSFW_CPP_OSTREAM_ENABLED == 1 + sif::warning << "CfdpTmFunnel::handlePacket: Error getting TM store element of size " + << spacePacketHeader.getFullPacketLen() << std::endl; +#endif + return result; + } + size_t serSize = 0; + result = + spacePacketHeader.serializeBe(&newPacketData, &serSize, spacePacketHeader.getFullPacketLen()); + if (result != returnvalue::OK) { +#if FSFW_CPP_OSTREAM_ENABLED == 1 + sif::error << "CfdpTmFunnel::handlePacket: Error serializing packet" << std::endl; +#endif + return result; + } + std::memcpy(newPacketData, cfdpPacket, cfdpPacketLen); + // Delete old packet + tmStore.deleteData(msg.getStorageId()); + msg.setStorageId(newStoreId); + result = msgQueue->sendToDefault(&msg); + if (result != returnvalue::OK) { + tmStore.deleteData(msg.getStorageId()); +#if FSFW_CPP_OSTREAM_ENABLED == 1 + sif::error << "CfdpTmFunnel::handlePacket: Error sending TM to downlink handler" << std::endl; +#endif + } + return result; +} diff --git a/mission/tmtc/CfdpTmFunnel.h b/mission/tmtc/CfdpTmFunnel.h new file mode 100644 index 00000000..615f91df --- /dev/null +++ b/mission/tmtc/CfdpTmFunnel.h @@ -0,0 +1,27 @@ +#ifndef FSFW_EXAMPLE_COMMON_CFDPTMFUNNEL_H +#define FSFW_EXAMPLE_COMMON_CFDPTMFUNNEL_H + +#include "fsfw/objectmanager/SystemObject.h" +#include "fsfw/storagemanager/StorageManagerIF.h" +#include "fsfw/tmtcservices/AcceptsTelemetryIF.h" +#include "fsfw/tmtcservices/TmTcMessage.h" + +class CfdpTmFunnel : public AcceptsTelemetryIF, public SystemObject { + public: + CfdpTmFunnel(object_id_t objectId, uint16_t cfdpInCcsdsApid, + const AcceptsTelemetryIF& downlinkDestination, StorageManagerIF& tmStore); + [[nodiscard]] const char* getName() const override; + [[nodiscard]] MessageQueueId_t getReportReceptionQueue(uint8_t virtualChannel) const override; + + ReturnValue_t performOperation(uint8_t opCode); + ReturnValue_t initialize() override; + + private: + ReturnValue_t handlePacket(TmTcMessage& msg); + + uint16_t sourceSequenceCount = 0; + uint16_t cfdpInCcsdsApid; + MessageQueueIF* msgQueue; + StorageManagerIF& tmStore; +}; +#endif // FSFW_EXAMPLE_COMMON_CFDPTMFUNNEL_H diff --git a/mission/tmtc/PusTmFunnel.cpp b/mission/tmtc/PusTmFunnel.cpp new file mode 100644 index 00000000..f4072f0f --- /dev/null +++ b/mission/tmtc/PusTmFunnel.cpp @@ -0,0 +1,69 @@ +#include "PusTmFunnel.h" + +#include "fsfw/ipc/QueueFactory.h" +#include "fsfw/objectmanager.h" +#include "fsfw/tmtcpacket/pus/tm/PusTmZcWriter.h" + +PusTmFunnel::PusTmFunnel(object_id_t objectId, const AcceptsTelemetryIF &downlinkDestination, + TimeReaderIF &timeReader, StorageManagerIF &tmStore, uint8_t vcId, + uint32_t messageDepth) + : SystemObject(objectId), timeReader(timeReader), tmStore(tmStore) { + tmQueue = QueueFactory::instance()->createMessageQueue(messageDepth, + MessageQueueMessage::MAX_MESSAGE_SIZE); + tmQueue->setDefaultDestination(downlinkDestination.getReportReceptionQueue(vcId)); +} + +PusTmFunnel::~PusTmFunnel() = default; + +MessageQueueId_t PusTmFunnel::getReportReceptionQueue(uint8_t virtualChannel) const { + return tmQueue->getId(); +} + +ReturnValue_t PusTmFunnel::performOperation(uint8_t) { + TmTcMessage currentMessage; + ReturnValue_t status = tmQueue->receiveMessage(¤tMessage); + while (status == returnvalue::OK) { + status = handlePacket(currentMessage); + if (status != returnvalue::OK) { + sif::warning << "TmFunnel packet handling failed" << std::endl; + break; + } + status = tmQueue->receiveMessage(¤tMessage); + } + + if (status == MessageQueueIF::EMPTY) { + return returnvalue::OK; + } + return status; +} + +ReturnValue_t PusTmFunnel::handlePacket(TmTcMessage &message) { + uint8_t *packetData = nullptr; + size_t size = 0; + ReturnValue_t result = tmStore.modifyData(message.getStorageId(), &packetData, &size); + if (result != returnvalue::OK) { + return result; + } + PusTmZeroCopyWriter packet(timeReader, packetData, size); + result = packet.parseDataWithoutCrcCheck(); + if (result != returnvalue::OK) { +#if FSFW_CPP_OSTREAM_ENABLED == 1 + sif::warning << "PusTmFunnel::handlePacket: Error parsing received PUS packet" << std::endl; +#endif + return result; + } + packet.setSequenceCount(sourceSequenceCount++); + sourceSequenceCount = sourceSequenceCount % ccsds::LIMIT_SEQUENCE_COUNT; + packet.updateErrorControl(); + + result = tmQueue->sendToDefault(&message); + if (result != returnvalue::OK) { + tmStore.deleteData(message.getStorageId()); +#if FSFW_CPP_OSTREAM_ENABLED == 1 + sif::error << "PusTmFunnel::handlePacket: Error sending TM to downlink handler" << std::endl; +#endif + } + return result; +} + +const char *PusTmFunnel::getName() const { return "PUS TM Funnel"; } diff --git a/mission/tmtc/PusTmFunnel.h b/mission/tmtc/PusTmFunnel.h new file mode 100644 index 00000000..70be0248 --- /dev/null +++ b/mission/tmtc/PusTmFunnel.h @@ -0,0 +1,39 @@ +#ifndef FSFW_EXAMPLE_COMMON_PUSTMFUNNEL_H +#define FSFW_EXAMPLE_COMMON_PUSTMFUNNEL_H + +#include +#include +#include +#include +#include + +#include "fsfw/timemanager/TimeReaderIF.h" + +/** + * @brief TM Recipient. + * @details + * Main telemetry receiver. All generated telemetry is funneled into + * this object. + * @ingroup utility + * @author J. Meier + */ +class PusTmFunnel : public AcceptsTelemetryIF, public SystemObject { + public: + explicit PusTmFunnel(object_id_t objectId, const AcceptsTelemetryIF &downlinkDestination, + TimeReaderIF &timeReader, StorageManagerIF &tmStore, uint8_t vdId, + uint32_t messageDepth = 20); + [[nodiscard]] const char *getName() const override; + ~PusTmFunnel() override; + + [[nodiscard]] MessageQueueId_t getReportReceptionQueue(uint8_t virtualChannel) const override; + ReturnValue_t performOperation(uint8_t operationCode); + + private: + uint16_t sourceSequenceCount = 0; + TimeReaderIF &timeReader; + StorageManagerIF &tmStore; + MessageQueueIF *tmQueue = nullptr; + ReturnValue_t handlePacket(TmTcMessage &message); +}; + +#endif // FSFW_EXAMPLE_COMMON_PUSTMFUNNEL_H diff --git a/mission/tmtc/TmFunnel.cpp b/mission/tmtc/TmFunnel.cpp index 7763bd45..01bf0437 100644 --- a/mission/tmtc/TmFunnel.cpp +++ b/mission/tmtc/TmFunnel.cpp @@ -1,125 +1,16 @@ +#include "TmFunnel.h" + #include -#include -#include -#include -#include -#include -#include "OBSWConfig.h" +TmFunnel::TmFunnel(object_id_t objectId, PusTmFunnel& pusFunnel, CfdpTmFunnel& cfdpFunnel) + : SystemObject(objectId), pusFunnel(pusFunnel), cfdpFunnel(cfdpFunnel) {} -object_id_t TmFunnel::downlinkDestination = objects::NO_OBJECT; -object_id_t TmFunnel::storageDestination = objects::NO_OBJECT; - -TmFunnel::TmFunnel(object_id_t objectId, CdsShortTimeStamper& timeReader, uint32_t messageDepth, - uint8_t reportReceptionVc) - : SystemObject(objectId), - timeReader(timeReader), - messageDepth(messageDepth), - reportReceptionVc(reportReceptionVc) { - auto mqArgs = MqArgs(objectId, static_cast(this)); - tmQueue = QueueFactory::instance()->createMessageQueue( - messageDepth, MessageQueueMessage::MAX_MESSAGE_SIZE, &mqArgs); - storageQueue = QueueFactory::instance()->createMessageQueue( - messageDepth, MessageQueueMessage::MAX_MESSAGE_SIZE, &mqArgs); -} - -TmFunnel::~TmFunnel() {} - -MessageQueueId_t TmFunnel::getReportReceptionQueue(uint8_t virtualChannel) const { - return tmQueue->getId(); -} +TmFunnel::~TmFunnel() = default; ReturnValue_t TmFunnel::performOperation(uint8_t operationCode) { - TmTcMessage currentMessage; - ReturnValue_t status = tmQueue->receiveMessage(¤tMessage); - while (status == returnvalue::OK) { - status = handlePacket(¤tMessage); - if (status != returnvalue::OK) { - break; - } - status = tmQueue->receiveMessage(¤tMessage); - } - - if (status == MessageQueueIF::EMPTY) { - return returnvalue::OK; - } else { - return status; - } + pusFunnel.performOperation(operationCode); + cfdpFunnel.performOperation(operationCode); + return returnvalue::OK; } -ReturnValue_t TmFunnel::handlePacket(TmTcMessage* message) { - uint8_t* packetData = nullptr; - size_t size = 0; - ReturnValue_t result = tmStore->modifyData(message->getStorageId(), &packetData, &size); - if (result != returnvalue::OK) { - return result; - } - - PusTmZeroCopyWriter packet(timeReader, packetData, size); - result = packet.parseDataWithoutCrcCheck(); - if (result != returnvalue::OK) { - return result; - } - packet.setSequenceCount(sourceSequenceCount++); - sourceSequenceCount = sourceSequenceCount % ccsds::LIMIT_SEQUENCE_COUNT; - packet.updateErrorControl(); - - result = tmQueue->sendToDefault(message); - if (result != returnvalue::OK) { - tmStore->deleteData(message->getStorageId()); - sif::error << "TmFunnel::handlePacket: Error sending to downlink " - "handler" - << std::endl; - return result; - } - - if (storageDestination != objects::NO_OBJECT) { - result = storageQueue->sendToDefault(message); - if (result != returnvalue::OK) { - tmStore->deleteData(message->getStorageId()); - sif::error << "TmFunnel::handlePacket: Error sending to storage " - "handler" - << std::endl; - return result; - } - } - return result; -} - -ReturnValue_t TmFunnel::initialize() { - tmStore = ObjectManager::instance()->get(objects::TM_STORE); - if (tmStore == nullptr) { - sif::error << "TmFunnel::initialize: TM store not set." << std::endl; - sif::error << "Make sure the tm store is set up properly" - " and implements StorageManagerIF" - << std::endl; - return ObjectManagerIF::CHILD_INIT_FAILED; - } - - AcceptsTelemetryIF* tmTarget = - ObjectManager::instance()->get(downlinkDestination); - if (tmTarget == nullptr) { - sif::error << "TmFunnel::initialize: Downlink Destination not set." << std::endl; - sif::error << "Make sure the downlink destination object is set up " - "properly and implements AcceptsTelemetryIF" - << std::endl; - return ObjectManagerIF::CHILD_INIT_FAILED; - } - - tmQueue->setDefaultDestination(tmTarget->getReportReceptionQueue(reportReceptionVc)); - - // Storage destination is optional. - if (storageDestination == objects::NO_OBJECT) { - return SystemObject::initialize(); - } - - AcceptsTelemetryIF* storageTarget = - ObjectManager::instance()->get(storageDestination); - if (storageTarget != nullptr) { - storageQueue->setDefaultDestination(storageTarget->getReportReceptionQueue(0)); - } - - return SystemObject::initialize(); -} - -const char* TmFunnel::getName() const { return "TM Funnel"; } +ReturnValue_t TmFunnel::initialize() { return returnvalue::OK; } diff --git a/mission/tmtc/TmFunnel.h b/mission/tmtc/TmFunnel.h index 07f9382a..5441db2b 100644 --- a/mission/tmtc/TmFunnel.h +++ b/mission/tmtc/TmFunnel.h @@ -4,13 +4,12 @@ #include #include #include -#include #include #include -namespace Factory { -void setStaticFrameworkObjectIds(); -} +#include "CfdpTmFunnel.h" +#include "PusTmFunnel.h" +#include "fsfw/timemanager/TimeReaderIF.h" /** * @brief TM Recipient. @@ -18,36 +17,19 @@ void setStaticFrameworkObjectIds(); * Main telemetry receiver. All generated telemetry is funneled into * this object. * @ingroup utility - * @author J. Meier + * @author J. Meier, R. Mueller */ -class TmFunnel : public AcceptsTelemetryIF, public ExecutableObjectIF, public SystemObject { - friend void(Factory::setStaticFrameworkObjectIds)(); - +class TmFunnel : public ExecutableObjectIF, public SystemObject { public: - TmFunnel(object_id_t objectId, CdsShortTimeStamper& timeReader, uint32_t messageDepth = 20, - uint8_t reportReceptionVc = 0); - virtual ~TmFunnel(); + TmFunnel(object_id_t objectId, PusTmFunnel& pusFunnel, CfdpTmFunnel& cfdpFunnel); + ~TmFunnel() override; - const char* getName() const override; - MessageQueueId_t getReportReceptionQueue(uint8_t virtualChannel = 0) const override; - ReturnValue_t performOperation(uint8_t operationCode = 0) override; + ReturnValue_t performOperation(uint8_t operationCode) override; ReturnValue_t initialize() override; - protected: - static object_id_t downlinkDestination; - static object_id_t storageDestination; - private: - CdsShortTimeStamper& timeReader; - uint32_t messageDepth = 0; - uint8_t reportReceptionVc = 0; - uint16_t sourceSequenceCount = 0; - MessageQueueIF* tmQueue = nullptr; - MessageQueueIF* storageQueue = nullptr; - - StorageManagerIF* tmStore = nullptr; - - ReturnValue_t handlePacket(TmTcMessage* message); + PusTmFunnel& pusFunnel; + CfdpTmFunnel& cfdpFunnel; }; #endif /* MISSION_UTILITY_TMFUNNEL_H_ */ -- 2.43.0 From b6a5c8c85450a7aca7e7b6ef504158de153096b3 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 21 Oct 2022 11:54:14 +0200 Subject: [PATCH 62/97] added TODO, remove obsolete code --- bsp_q7s/core/ObjectFactory.cpp | 8 -------- mission/tmtc/PusTmFunnel.h | 5 ++++- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 3d48e52f..6adc07f8 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -108,14 +108,6 @@ void Factory::setStaticFrameworkObjectIds() { DeviceHandlerBase::powerSwitcherId = objects::PCDU_HANDLER; #endif /* OBSW_Q7S_EM == 1 */ - //#if OBSW_TM_TO_PTME == 1 - // TmFunnel::downlinkDestination = objects::CCSDS_HANDLER; - //#else - // TmFunnel::downlinkDestination = objects::TMTC_BRIDGE; - //#endif /* OBSW_TM_TO_PTME == 1 */ - // // No storage object for now. - // TmFunnel::storageDestination = objects::NO_OBJECT; - LocalDataPoolManager::defaultHkDestination = objects::PUS_SERVICE_3_HOUSEKEEPING; VerificationReporter::DEFAULT_RECEIVER = objects::PUS_SERVICE_1_VERIFICATION; diff --git a/mission/tmtc/PusTmFunnel.h b/mission/tmtc/PusTmFunnel.h index 70be0248..ae0390b3 100644 --- a/mission/tmtc/PusTmFunnel.h +++ b/mission/tmtc/PusTmFunnel.h @@ -12,10 +12,13 @@ /** * @brief TM Recipient. * @details + * TODO: Add support for TM storage by using the (or a) LIVE flag provided by the CCSDS or Syrlinks + * handler. If we are in LIVE TM mode, forward TM to downlink destination directly. Otherwise, + * forward to TM storage backend which stores TMs into files. * Main telemetry receiver. All generated telemetry is funneled into * this object. * @ingroup utility - * @author J. Meier + * @author J. Meier, R. Mueller */ class PusTmFunnel : public AcceptsTelemetryIF, public SystemObject { public: -- 2.43.0 From c0c83faf649f9858b2d39bb01264b58abe26b0c2 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 21 Oct 2022 12:01:07 +0200 Subject: [PATCH 63/97] hosted compiles again --- bsp_hosted/ObjectFactory.cpp | 4 ---- bsp_hosted/fsfwconfig/objects/systemObjectList.h | 2 -- common/config/eive/objects.h | 5 ++++- linux/fsfwconfig/objects/systemObjectList.h | 3 --- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/bsp_hosted/ObjectFactory.cpp b/bsp_hosted/ObjectFactory.cpp index 28762871..f4607de4 100644 --- a/bsp_hosted/ObjectFactory.cpp +++ b/bsp_hosted/ObjectFactory.cpp @@ -54,10 +54,6 @@ void Factory::setStaticFrameworkObjectIds() { CommandingServiceBase::defaultPacketSource = objects::PUS_PACKET_DISTRIBUTOR; CommandingServiceBase::defaultPacketDestination = objects::TM_FUNNEL; - TmFunnel::downlinkDestination = objects::TMTC_BRIDGE; - // No storage object for now. - TmFunnel::storageDestination = objects::NO_OBJECT; - VerificationReporter::DEFAULT_RECEIVER = objects::PUS_SERVICE_1_VERIFICATION; } diff --git a/bsp_hosted/fsfwconfig/objects/systemObjectList.h b/bsp_hosted/fsfwconfig/objects/systemObjectList.h index 8b264882..703cd8b8 100644 --- a/bsp_hosted/fsfwconfig/objects/systemObjectList.h +++ b/bsp_hosted/fsfwconfig/objects/systemObjectList.h @@ -16,8 +16,6 @@ enum sourceObjects : uint32_t { PUS_SERVICE_23 = 0x51002300, PUS_SERVICE_201 = 0x51020100, - TM_FUNNEL = 0x52000002, - /* Test Task */ TEST_TASK = 0x42694269, diff --git a/common/config/eive/objects.h b/common/config/eive/objects.h index 67fb36d2..25bebe25 100644 --- a/common/config/eive/objects.h +++ b/common/config/eive/objects.h @@ -128,7 +128,10 @@ enum commonObjects : uint32_t { TCS_BOARD_ASS = 0x73000003, RW_ASS = 0x73000004, CFDP_HANDLER = 0x73000005, - CFDP_DISTRIBUTOR = 0x73000006 + CFDP_DISTRIBUTOR = 0x73000006, + TM_FUNNEL = 0x73000100, + PUS_TM_FUNNEL = 0x73000101, + CFDP_TM_FUNNEL = 0x73000102, }; } diff --git a/linux/fsfwconfig/objects/systemObjectList.h b/linux/fsfwconfig/objects/systemObjectList.h index e09e5f5f..dba8c630 100644 --- a/linux/fsfwconfig/objects/systemObjectList.h +++ b/linux/fsfwconfig/objects/systemObjectList.h @@ -40,9 +40,6 @@ enum sourceObjects : uint32_t { PUS_SERVICE_6 = 0x51000500, CCSDS_IP_CORE_BRIDGE = 0x73500000, - TM_FUNNEL = 0x73000100, - PUS_TM_FUNNEL = 0x73000101, - CFDP_TM_FUNNEL = 0x73000102, /* 0x49 ('I') for Communication Interfaces **/ ARDUINO_COM_IF = 0x49000000, -- 2.43.0 From b9b850f621d86d407bf63bca297fe65ca08bf807 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 21 Oct 2022 14:49:54 +0200 Subject: [PATCH 64/97] object ID corrections --- bsp_q7s/core/ObjectFactory.cpp | 4 ++-- mission/core/GenericFactory.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 6adc07f8..4ffdd48e 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -97,10 +97,10 @@ ResetArgs RESET_ARGS_GNSS; void Factory::setStaticFrameworkObjectIds() { PusServiceBase::PUS_DISTRIBUTOR = objects::PUS_PACKET_DISTRIBUTOR; - PusServiceBase::PACKET_DESTINATION = objects::TM_FUNNEL; + PusServiceBase::PACKET_DESTINATION = objects::PUS_TM_FUNNEL; CommandingServiceBase::defaultPacketSource = objects::PUS_PACKET_DISTRIBUTOR; - CommandingServiceBase::defaultPacketDestination = objects::TM_FUNNEL; + CommandingServiceBase::defaultPacketDestination = objects::PUS_TM_FUNNEL; #if OBSW_Q7S_EM == 1 DeviceHandlerBase::powerSwitcherId = objects::NO_OBJECT; diff --git a/mission/core/GenericFactory.cpp b/mission/core/GenericFactory.cpp index 6158af5c..900edb56 100644 --- a/mission/core/GenericFactory.cpp +++ b/mission/core/GenericFactory.cpp @@ -133,7 +133,7 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_) { // PUS service stack new Service1TelecommandVerification(objects::PUS_SERVICE_1_VERIFICATION, config::EIVE_PUS_APID, - pus::PUS_SERVICE_1, objects::TM_FUNNEL, 20); + pus::PUS_SERVICE_1, objects::PUS_TM_FUNNEL, 20); new Service2DeviceAccess(objects::PUS_SERVICE_2_DEVICE_ACCESS, config::EIVE_PUS_APID, pus::PUS_SERVICE_2, 3, 10); new Service3Housekeeping(objects::PUS_SERVICE_3_HOUSEKEEPING, config::EIVE_PUS_APID, -- 2.43.0 From 917d746d1a4d957a3785c2dac191932fdfeb4e41 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 21 Oct 2022 15:19:47 +0200 Subject: [PATCH 65/97] small fix (which is not an issue right now) --- mission/core/GenericFactory.cpp | 2 +- mission/tmtc/CfdpTmFunnel.cpp | 5 +++-- mission/tmtc/CfdpTmFunnel.h | 3 ++- tmtc | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/mission/core/GenericFactory.cpp b/mission/core/GenericFactory.cpp index 900edb56..e81818e9 100644 --- a/mission/core/GenericFactory.cpp +++ b/mission/core/GenericFactory.cpp @@ -125,7 +125,7 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_) { vc = config::LIVE_TM; #endif auto* cfdpFunnel = - new CfdpTmFunnel(objects::CFDP_TM_FUNNEL, config::EIVE_CFDP_APID, *tmtcBridge, *tmStore); + new CfdpTmFunnel(objects::CFDP_TM_FUNNEL, config::EIVE_CFDP_APID, *tmtcBridge, *tmStore, vc); auto* pusFunnel = new PusTmFunnel(objects::PUS_TM_FUNNEL, *tmtcBridge, *timeStamper, *tmStore, vc); // Every TM packet goes through this funnel diff --git a/mission/tmtc/CfdpTmFunnel.cpp b/mission/tmtc/CfdpTmFunnel.cpp index 56b57ef9..7969961b 100644 --- a/mission/tmtc/CfdpTmFunnel.cpp +++ b/mission/tmtc/CfdpTmFunnel.cpp @@ -5,10 +5,11 @@ #include "fsfw/tmtcservices/TmTcMessage.h" CfdpTmFunnel::CfdpTmFunnel(object_id_t objectId, uint16_t cfdpInCcsdsApid, - const AcceptsTelemetryIF& downlinkDestination, StorageManagerIF& tmStore) + const AcceptsTelemetryIF& downlinkDestination, StorageManagerIF& tmStore, + uint8_t vc) : SystemObject(objectId), cfdpInCcsdsApid(cfdpInCcsdsApid), tmStore(tmStore) { msgQueue = QueueFactory::instance()->createMessageQueue(5); - msgQueue->setDefaultDestination(downlinkDestination.getReportReceptionQueue()); + msgQueue->setDefaultDestination(downlinkDestination.getReportReceptionQueue(vc)); } const char* CfdpTmFunnel::getName() const { return "CFDP TM Funnel"; } diff --git a/mission/tmtc/CfdpTmFunnel.h b/mission/tmtc/CfdpTmFunnel.h index 615f91df..fe2d664d 100644 --- a/mission/tmtc/CfdpTmFunnel.h +++ b/mission/tmtc/CfdpTmFunnel.h @@ -9,7 +9,8 @@ class CfdpTmFunnel : public AcceptsTelemetryIF, public SystemObject { public: CfdpTmFunnel(object_id_t objectId, uint16_t cfdpInCcsdsApid, - const AcceptsTelemetryIF& downlinkDestination, StorageManagerIF& tmStore); + const AcceptsTelemetryIF& downlinkDestination, StorageManagerIF& tmStore, + uint8_t vc); [[nodiscard]] const char* getName() const override; [[nodiscard]] MessageQueueId_t getReportReceptionQueue(uint8_t virtualChannel) const override; diff --git a/tmtc b/tmtc index 3cbfeb70..8028f024 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 3cbfeb70156d2b60c2cce1fc28b4ace7f58e8af3 +Subproject commit 8028f024a4ad04474d227cf6b99d7f088818f3e1 -- 2.43.0 From 440bc22a83b43288db44f5147e89ead9e67cbe3b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 21 Oct 2022 15:25:07 +0200 Subject: [PATCH 66/97] bump tmtc --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index 8028f024..d9a17846 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 8028f024a4ad04474d227cf6b99d7f088818f3e1 +Subproject commit d9a178460b887c3d9349a5602ae2706ccbc4130f -- 2.43.0 From bf5474fd24ea815425b9c9d5ece3ab85a3190a7a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 21 Oct 2022 15:30:36 +0200 Subject: [PATCH 67/97] repoint submodules --- fsfw | 2 +- tmtc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fsfw b/fsfw index 2de9e25c..754b71a3 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 2de9e25cebd3b0cfdac538b5c4dd88e0274ebbac +Subproject commit 754b71a35fc27208d7c679ea58783cacda973996 diff --git a/tmtc b/tmtc index d9a17846..c13f4a85 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit d9a178460b887c3d9349a5602ae2706ccbc4130f +Subproject commit c13f4a8575f99c0e9f17b1868e7abfbe28fa5648 -- 2.43.0 From 72d9775de04ed53340af2b485a4ada9a584fb322 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 21 Oct 2022 15:42:08 +0200 Subject: [PATCH 68/97] re-run generators --- generators/bsp_q7s_events.csv | 4 ++++ generators/bsp_q7s_objects.csv | 2 ++ generators/events/translateEvents.cpp | 16 ++++++++++++++-- generators/objects/translateObjects.cpp | 10 ++++++++-- linux/fsfwconfig/events/translateEvents.cpp | 16 ++++++++++++++-- linux/fsfwconfig/objects/translateObjects.cpp | 10 ++++++++-- tmtc | 2 +- 7 files changed, 51 insertions(+), 9 deletions(-) diff --git a/generators/bsp_q7s_events.csv b/generators/bsp_q7s_events.csv index 5a662fb5..8a69c7a0 100644 --- a/generators/bsp_q7s_events.csv +++ b/generators/bsp_q7s_events.csv @@ -80,6 +80,9 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 9100;0x238c;TC_DELETION_FAILED;MEDIUM;Deletion of a TC from the map failed. P1: First 32 bit of request ID, P2. Last 32 bit of Request ID;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h 9700;0x25e4;TEST;INFO;;fsfw/src/fsfw/pus/Service17Test.h 10600;0x2968;CHANGE_OF_SETUP_PARAMETER;LOW;;fsfw/src/fsfw_hal/devicehandlers/MgmLIS3MDLHandler.h +10800;0x2a30;STORE_ERROR;LOW;;fsfw/src/fsfw/cfdp/handler/defs.h +10801;0x2a31;MSG_QUEUE_ERROR;LOW;;fsfw/src/fsfw/cfdp/handler/defs.h +10802;0x2a32;SERIALIZATION_ERROR;LOW;;fsfw/src/fsfw/cfdp/handler/defs.h 11300;0x2c24;SWITCH_CMD_SENT;INFO;Indicates that a FSFW object requested setting a switch P1: 1 if on was requested, 0 for off | P2: Switch Index;mission/devices/devicedefinitions/powerDefinitions.h 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/devices/devicedefinitions/powerDefinitions.h 11302;0x2c26;SWITCHING_Q7S_DENIED;MEDIUM;;mission/devices/devicedefinitions/powerDefinitions.h @@ -220,6 +223,7 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 13701;0x3585;REBOOT_SW;MEDIUM; Software reboot occurred. Can also be a systemd reboot. P1: Current Chip, P2: Current Copy;bsp_q7s/core/CoreController.h 13702;0x3586;REBOOT_MECHANISM_TRIGGERED;MEDIUM;The reboot mechanism was triggered. P1: First 16 bits: Last Chip, Last 16 bits: Last Copy, P2: Each byte is the respective reboot count for the slots;bsp_q7s/core/CoreController.h 13703;0x3587;REBOOT_HW;MEDIUM;;bsp_q7s/core/CoreController.h +13704;0x3588;NO_SD_CARD_ACTIVE;HIGH;No SD card was active. Core controller will attempt to re-initialize a SD card.;bsp_q7s/core/CoreController.h 13800;0x35e8;MISSING_PACKET;LOW;;mission/devices/devicedefinitions/ScexDefinitions.h 13801;0x35e9;EXPERIMENT_TIMEDOUT;LOW;;mission/devices/devicedefinitions/ScexDefinitions.h 13802;0x35ea;MULTI_PACKET_COMMAND_DONE;INFO;;mission/devices/devicedefinitions/ScexDefinitions.h diff --git a/generators/bsp_q7s_objects.csv b/generators/bsp_q7s_objects.csv index 94f508bc..1e44c67b 100644 --- a/generators/bsp_q7s_objects.csv +++ b/generators/bsp_q7s_objects.csv @@ -134,5 +134,7 @@ 0x73000005;CFDP_HANDLER 0x73000006;CFDP_DISTRIBUTOR 0x73000100;TM_FUNNEL +0x73000101;PUS_TM_FUNNEL +0x73000102;CFDP_TM_FUNNEL 0x73500000;CCSDS_IP_CORE_BRIDGE 0xFFFFFFFF;NO_OBJECT diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index b27c54fc..69e22777 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 229 translations. + * @brief Auto-generated event translation file. Contains 233 translations. * @details - * Generated on: 2022-10-14 14:54:47 + * Generated on: 2022-10-21 15:41:33 */ #include "translateEvents.h" @@ -86,6 +86,9 @@ const char *CLOCK_SET_FAILURE_STRING = "CLOCK_SET_FAILURE"; const char *TC_DELETION_FAILED_STRING = "TC_DELETION_FAILED"; const char *TEST_STRING = "TEST"; const char *CHANGE_OF_SETUP_PARAMETER_STRING = "CHANGE_OF_SETUP_PARAMETER"; +const char *STORE_ERROR_STRING = "STORE_ERROR"; +const char *MSG_QUEUE_ERROR_STRING = "MSG_QUEUE_ERROR"; +const char *SERIALIZATION_ERROR_STRING = "SERIALIZATION_ERROR"; 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"; @@ -222,6 +225,7 @@ const char *ALLOC_FAILURE_STRING = "ALLOC_FAILURE"; const char *REBOOT_SW_STRING = "REBOOT_SW"; const char *REBOOT_MECHANISM_TRIGGERED_STRING = "REBOOT_MECHANISM_TRIGGERED"; const char *REBOOT_HW_STRING = "REBOOT_HW"; +const char *NO_SD_CARD_ACTIVE_STRING = "NO_SD_CARD_ACTIVE"; const char *MISSING_PACKET_STRING = "MISSING_PACKET"; const char *EXPERIMENT_TIMEDOUT_STRING = "EXPERIMENT_TIMEDOUT"; const char *MULTI_PACKET_COMMAND_DONE_STRING = "MULTI_PACKET_COMMAND_DONE"; @@ -395,6 +399,12 @@ const char *translateEvents(Event event) { return TEST_STRING; case (10600): return CHANGE_OF_SETUP_PARAMETER_STRING; + case (10800): + return STORE_ERROR_STRING; + case (10801): + return MSG_QUEUE_ERROR_STRING; + case (10802): + return SERIALIZATION_ERROR_STRING; case (11300): return SWITCH_CMD_SENT_STRING; case (11301): @@ -667,6 +677,8 @@ const char *translateEvents(Event event) { return REBOOT_MECHANISM_TRIGGERED_STRING; case (13703): return REBOOT_HW_STRING; + case (13704): + return NO_SD_CARD_ACTIVE_STRING; case (13800): return MISSING_PACKET_STRING; case (13801): diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index a855e48a..65f8ea62 100644 --- a/generators/objects/translateObjects.cpp +++ b/generators/objects/translateObjects.cpp @@ -1,8 +1,8 @@ /** * @brief Auto-generated object translation file. * @details - * Contains 138 translations. - * Generated on: 2022-10-14 14:54:47 + * Contains 140 translations. + * Generated on: 2022-10-21 15:41:33 */ #include "translateObjects.h" @@ -142,6 +142,8 @@ const char *RW_ASS_STRING = "RW_ASS"; const char *CFDP_HANDLER_STRING = "CFDP_HANDLER"; const char *CFDP_DISTRIBUTOR_STRING = "CFDP_DISTRIBUTOR"; const char *TM_FUNNEL_STRING = "TM_FUNNEL"; +const char *PUS_TM_FUNNEL_STRING = "PUS_TM_FUNNEL"; +const char *CFDP_TM_FUNNEL_STRING = "CFDP_TM_FUNNEL"; const char *CCSDS_IP_CORE_BRIDGE_STRING = "CCSDS_IP_CORE_BRIDGE"; const char *NO_OBJECT_STRING = "NO_OBJECT"; @@ -419,6 +421,10 @@ const char *translateObject(object_id_t object) { return CFDP_DISTRIBUTOR_STRING; case 0x73000100: return TM_FUNNEL_STRING; + case 0x73000101: + return PUS_TM_FUNNEL_STRING; + case 0x73000102: + return CFDP_TM_FUNNEL_STRING; case 0x73500000: return CCSDS_IP_CORE_BRIDGE_STRING; case 0xFFFFFFFF: diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index b27c54fc..69e22777 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 229 translations. + * @brief Auto-generated event translation file. Contains 233 translations. * @details - * Generated on: 2022-10-14 14:54:47 + * Generated on: 2022-10-21 15:41:33 */ #include "translateEvents.h" @@ -86,6 +86,9 @@ const char *CLOCK_SET_FAILURE_STRING = "CLOCK_SET_FAILURE"; const char *TC_DELETION_FAILED_STRING = "TC_DELETION_FAILED"; const char *TEST_STRING = "TEST"; const char *CHANGE_OF_SETUP_PARAMETER_STRING = "CHANGE_OF_SETUP_PARAMETER"; +const char *STORE_ERROR_STRING = "STORE_ERROR"; +const char *MSG_QUEUE_ERROR_STRING = "MSG_QUEUE_ERROR"; +const char *SERIALIZATION_ERROR_STRING = "SERIALIZATION_ERROR"; 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"; @@ -222,6 +225,7 @@ const char *ALLOC_FAILURE_STRING = "ALLOC_FAILURE"; const char *REBOOT_SW_STRING = "REBOOT_SW"; const char *REBOOT_MECHANISM_TRIGGERED_STRING = "REBOOT_MECHANISM_TRIGGERED"; const char *REBOOT_HW_STRING = "REBOOT_HW"; +const char *NO_SD_CARD_ACTIVE_STRING = "NO_SD_CARD_ACTIVE"; const char *MISSING_PACKET_STRING = "MISSING_PACKET"; const char *EXPERIMENT_TIMEDOUT_STRING = "EXPERIMENT_TIMEDOUT"; const char *MULTI_PACKET_COMMAND_DONE_STRING = "MULTI_PACKET_COMMAND_DONE"; @@ -395,6 +399,12 @@ const char *translateEvents(Event event) { return TEST_STRING; case (10600): return CHANGE_OF_SETUP_PARAMETER_STRING; + case (10800): + return STORE_ERROR_STRING; + case (10801): + return MSG_QUEUE_ERROR_STRING; + case (10802): + return SERIALIZATION_ERROR_STRING; case (11300): return SWITCH_CMD_SENT_STRING; case (11301): @@ -667,6 +677,8 @@ const char *translateEvents(Event event) { return REBOOT_MECHANISM_TRIGGERED_STRING; case (13703): return REBOOT_HW_STRING; + case (13704): + return NO_SD_CARD_ACTIVE_STRING; case (13800): return MISSING_PACKET_STRING; case (13801): diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index a855e48a..65f8ea62 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 138 translations. - * Generated on: 2022-10-14 14:54:47 + * Contains 140 translations. + * Generated on: 2022-10-21 15:41:33 */ #include "translateObjects.h" @@ -142,6 +142,8 @@ const char *RW_ASS_STRING = "RW_ASS"; const char *CFDP_HANDLER_STRING = "CFDP_HANDLER"; const char *CFDP_DISTRIBUTOR_STRING = "CFDP_DISTRIBUTOR"; const char *TM_FUNNEL_STRING = "TM_FUNNEL"; +const char *PUS_TM_FUNNEL_STRING = "PUS_TM_FUNNEL"; +const char *CFDP_TM_FUNNEL_STRING = "CFDP_TM_FUNNEL"; const char *CCSDS_IP_CORE_BRIDGE_STRING = "CCSDS_IP_CORE_BRIDGE"; const char *NO_OBJECT_STRING = "NO_OBJECT"; @@ -419,6 +421,10 @@ const char *translateObject(object_id_t object) { return CFDP_DISTRIBUTOR_STRING; case 0x73000100: return TM_FUNNEL_STRING; + case 0x73000101: + return PUS_TM_FUNNEL_STRING; + case 0x73000102: + return CFDP_TM_FUNNEL_STRING; case 0x73500000: return CCSDS_IP_CORE_BRIDGE_STRING; case 0xFFFFFFFF: diff --git a/tmtc b/tmtc index c13f4a85..ff1b4016 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit c13f4a8575f99c0e9f17b1868e7abfbe28fa5648 +Subproject commit ff1b401622cf430f8c312f3c0ca0132918dbf346 -- 2.43.0 From a3ed5aef8e85001b4163239c3dcebdf056817216 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 24 Oct 2022 14:26:35 +0200 Subject: [PATCH 69/97] bump fsfw --- fsfw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsfw b/fsfw index 754b71a3..b0c5a49b 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 754b71a35fc27208d7c679ea58783cacda973996 +Subproject commit b0c5a49b504708ec9130228100d7bbd49025598d -- 2.43.0 From a9096a46c0a14419a24c5c4cd35ac56cbcb5b175 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 25 Oct 2022 11:04:24 +0200 Subject: [PATCH 70/97] safety mechanism on reboots --- bsp_q7s/core/CoreController.cpp | 4 ++++ bsp_q7s/fs/SdCardManager.cpp | 12 ++++++++++++ bsp_q7s/fs/SdCardManager.h | 3 +++ 3 files changed, 19 insertions(+) diff --git a/bsp_q7s/core/CoreController.cpp b/bsp_q7s/core/CoreController.cpp index 95700148..6b3c08a9 100644 --- a/bsp_q7s/core/CoreController.cpp +++ b/bsp_q7s/core/CoreController.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include "OBSWVersion.h" #include "fsfw/serviceinterface/ServiceInterface.h" @@ -932,6 +933,9 @@ ReturnValue_t CoreController::actionReboot(const uint8_t *data, size_t size) { ReturnValue_t CoreController::gracefulShutdownTasks(xsc::Chip chip, xsc::Copy copy, bool &protOpPerformed) { sdcMan->setBlocking(true); + sdcMan->markUnusable(); + // Wait two seconds to ensure no one uses the SD cards + TaskFactory::delayTask(2000); // Attempt graceful shutdown by unmounting and switching off SD cards sdcMan->switchOffSdCard(sd::SdCard::SLOT_0); sdcMan->switchOffSdCard(sd::SdCard::SLOT_1); diff --git a/bsp_q7s/fs/SdCardManager.cpp b/bsp_q7s/fs/SdCardManager.cpp index 42182829..4a6c12a1 100644 --- a/bsp_q7s/fs/SdCardManager.cpp +++ b/bsp_q7s/fs/SdCardManager.cpp @@ -460,6 +460,13 @@ void SdCardManager::setBlocking(bool blocking) { this->blocking = blocking; } void SdCardManager::setPrintCommandOutput(bool print) { this->printCmdOutput = print; } bool SdCardManager::isSdCardUsable(sd::SdCard sdCard) { + { + MutexGuard mg(mutex); + if (markedUnusable) { + return false; + } + } + SdCardManager::SdStatePair active; ReturnValue_t result = this->getSdCardsStatus(active); @@ -562,3 +569,8 @@ std::optional SdCardManager::getActiveSdCard() const { MutexGuard mg(mutex); return sdInfo.active; } + +void SdCardManager::markUnusable() { + MutexGuard mg(mutex); + markedUnusable = true; +} diff --git a/bsp_q7s/fs/SdCardManager.h b/bsp_q7s/fs/SdCardManager.h index 52c8ed9b..8ce13dbc 100644 --- a/bsp_q7s/fs/SdCardManager.h +++ b/bsp_q7s/fs/SdCardManager.h @@ -214,12 +214,15 @@ class SdCardManager : public SystemObject, public SdCardMountedIF { ReturnValue_t performFsck(sd::SdCard sdcard, bool printOutput, int& linuxError); + void markUnusable(); + private: CommandExecutor cmdExecutor; Operations currentOp = Operations::IDLE; bool blocking = false; bool sdCardActive = true; bool printCmdOutput = true; + bool markedUnusable = false; MutexIF* mutex = nullptr; SdCardManager(); -- 2.43.0 From f198a401f27cd1fce86ae1ee1adb0374105be3c5 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 25 Oct 2022 11:22:31 +0200 Subject: [PATCH 71/97] this should work as well --- bsp_q7s/fs/SdCardManager.cpp | 18 ++++++++++++++---- bsp_q7s/fs/SdCardManager.h | 2 +- mission/devices/ScexDeviceHandler.cpp | 9 +++++++++ mission/memory/SdCardMountedIF.h | 2 +- 4 files changed, 25 insertions(+), 6 deletions(-) diff --git a/bsp_q7s/fs/SdCardManager.cpp b/bsp_q7s/fs/SdCardManager.cpp index 4a6c12a1..8cea0991 100644 --- a/bsp_q7s/fs/SdCardManager.cpp +++ b/bsp_q7s/fs/SdCardManager.cpp @@ -459,7 +459,7 @@ void SdCardManager::setBlocking(bool blocking) { this->blocking = blocking; } void SdCardManager::setPrintCommandOutput(bool print) { this->printCmdOutput = print; } -bool SdCardManager::isSdCardUsable(sd::SdCard sdCard) { +bool SdCardManager::isSdCardUsable(std::optional sdCard) { { MutexGuard mg(mutex); if (markedUnusable) { @@ -474,20 +474,27 @@ bool SdCardManager::isSdCardUsable(sd::SdCard sdCard) { sif::debug << "SdCardManager::isSdCardMounted: Failed to get SD card active state"; return false; } + if (not sdCard) { + sdCard == sd::BOTH; + } if (sdCard == sd::SLOT_0) { if (active.first == sd::MOUNTED) { return true; } else { return false; } - } else if (sdCard == sd::SLOT_1) { + } + if (sdCard == sd::SLOT_1) { if (active.second == sd::MOUNTED) { return true; } else { return false; } - } else { - sif::debug << "SdCardManager::isSdCardMounted: Unknown SD card specified" << std::endl; + } + if (sdCard == sd::BOTH) { + if (active.first == sd::MOUNTED && active.second == sd::MOUNTED) { + return true; + } } return false; } @@ -567,6 +574,9 @@ void SdCardManager::setActiveSdCard(sd::SdCard sdCard) { std::optional SdCardManager::getActiveSdCard() const { MutexGuard mg(mutex); + if(markedUnusable) { + return std::nullopt; + } return sdInfo.active; } diff --git a/bsp_q7s/fs/SdCardManager.h b/bsp_q7s/fs/SdCardManager.h index 8ce13dbc..749cae62 100644 --- a/bsp_q7s/fs/SdCardManager.h +++ b/bsp_q7s/fs/SdCardManager.h @@ -206,7 +206,7 @@ class SdCardManager : public SystemObject, public SdCardMountedIF { * * @return true if mounted, otherwise false */ - bool isSdCardUsable(sd::SdCard sdCard) override; + bool isSdCardUsable(std::optional sdCard) override; ReturnValue_t isSdCardMountedReadOnly(sd::SdCard sdcard, bool& readOnly); diff --git a/mission/devices/ScexDeviceHandler.cpp b/mission/devices/ScexDeviceHandler.cpp index 1cc2cd39..db562f66 100644 --- a/mission/devices/ScexDeviceHandler.cpp +++ b/mission/devices/ScexDeviceHandler.cpp @@ -1,5 +1,6 @@ #include "ScexDeviceHandler.h" +#include #include #include @@ -200,6 +201,10 @@ ReturnValue_t ScexDeviceHandler::interpretDeviceReply(DeviceCommandId_t id, cons ReturnValue_t status = OK; auto oneFileHandler = [&](std::string cmdName) { + auto activeSd = sdcMan.getActiveSdCard(); + if (not activeSd) { + return HasFileSystemIF::GENERIC_FILE_ERROR; + } fileId = date_time_string(); std::ostringstream oss; auto prefix = sdcMan.getCurrentMountPrefix(); @@ -216,6 +221,10 @@ ReturnValue_t ScexDeviceHandler::interpretDeviceReply(DeviceCommandId_t id, cons }; auto multiFileHandler = [&](std::string cmdName) { if ((helper.getPacketCounter() == 1) or (not fileNameSet)) { + auto activeSd = sdcMan.getActiveSdCard(); + if (not activeSd) { + return HasFileSystemIF::GENERIC_FILE_ERROR; + } fileId = date_time_string(); std::ostringstream oss; auto prefix = sdcMan.getCurrentMountPrefix(); diff --git a/mission/memory/SdCardMountedIF.h b/mission/memory/SdCardMountedIF.h index d88bb57a..ac705e8d 100644 --- a/mission/memory/SdCardMountedIF.h +++ b/mission/memory/SdCardMountedIF.h @@ -10,7 +10,7 @@ class SdCardMountedIF { public: virtual ~SdCardMountedIF(){}; virtual const std::string& getCurrentMountPrefix() const = 0; - virtual bool isSdCardUsable(sd::SdCard sdCard) = 0; + virtual bool isSdCardUsable(std::optional sdCard) = 0; virtual std::optional getPreferredSdCard() const = 0; virtual void setActiveSdCard(sd::SdCard sdCard) = 0; virtual std::optional getActiveSdCard() const = 0; -- 2.43.0 From b1e8be2ba5a25a0518998e44d9f8e79f5d1dc5db Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 25 Oct 2022 11:31:06 +0200 Subject: [PATCH 72/97] checked FS usage --- bsp_q7s/fs/SdCardManager.cpp | 2 +- fsfw | 2 +- linux/devices/ploc/PlocSupervisorHandler.cpp | 5 +++++ linux/devices/ploc/PlocSupvHelper.cpp | 6 +++++ linux/devices/startracker/StrHelper.cpp | 22 +++++++++++++++++++ mission/devices/ScexDeviceHandler.cpp | 4 ++-- .../devices/SolarArrayDeploymentHandler.cpp | 1 + 7 files changed, 38 insertions(+), 4 deletions(-) diff --git a/bsp_q7s/fs/SdCardManager.cpp b/bsp_q7s/fs/SdCardManager.cpp index 8cea0991..e547a6d0 100644 --- a/bsp_q7s/fs/SdCardManager.cpp +++ b/bsp_q7s/fs/SdCardManager.cpp @@ -574,7 +574,7 @@ void SdCardManager::setActiveSdCard(sd::SdCard sdCard) { std::optional SdCardManager::getActiveSdCard() const { MutexGuard mg(mutex); - if(markedUnusable) { + if (markedUnusable) { return std::nullopt; } return sdInfo.active; diff --git a/fsfw b/fsfw index b0c5a49b..1f05e6b2 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit b0c5a49b504708ec9130228100d7bbd49025598d +Subproject commit 1f05e6b297af8a6d310394e959c4d0cf13632831 diff --git a/linux/devices/ploc/PlocSupervisorHandler.cpp b/linux/devices/ploc/PlocSupervisorHandler.cpp index f36c5a8d..dcdff2c3 100644 --- a/linux/devices/ploc/PlocSupervisorHandler.cpp +++ b/linux/devices/ploc/PlocSupervisorHandler.cpp @@ -1917,6 +1917,11 @@ ReturnValue_t PlocSupervisorHandler::checkMramPacketApid() { } ReturnValue_t PlocSupervisorHandler::handleMramDumpFile(DeviceCommandId_t id) { +#ifdef XIPHOS_Q7S + if (not sdcMan->getActiveSdCard()) { + return HasFileSystemIF::FILESYSTEM_INACTIVE; + } +#endif ReturnValue_t result = returnvalue::OK; uint16_t packetLen = readSpacePacketLength(spacePacketBuffer); uint8_t sequenceFlags = readSequenceFlags(spacePacketBuffer); diff --git a/linux/devices/ploc/PlocSupvHelper.cpp b/linux/devices/ploc/PlocSupvHelper.cpp index f0f94635..186eef6b 100644 --- a/linux/devices/ploc/PlocSupvHelper.cpp +++ b/linux/devices/ploc/PlocSupvHelper.cpp @@ -1,6 +1,7 @@ #include "PlocSupvHelper.h" #include +#include #include #include @@ -748,6 +749,11 @@ uint32_t PlocSupvHelper::getFileSize(std::string filename) { ReturnValue_t PlocSupvHelper::handleEventBufferReception(ploc::SpTmReader& reader) { ReturnValue_t result = returnvalue::OK; +#ifdef XIPHOS_Q7S + if (not sdcMan->getActiveSdCard()) { + return HasFileSystemIF::FILESYSTEM_INACTIVE; + } +#endif std::string filename = Filenaming::generateAbsoluteFilename( eventBufferReq.path, eventBufferReq.filename, timestamping); std::ofstream file(filename, std::ios_base::app | std::ios_base::out); diff --git a/linux/devices/startracker/StrHelper.cpp b/linux/devices/startracker/StrHelper.cpp index 685cf3b3..1f6472bb 100644 --- a/linux/devices/startracker/StrHelper.cpp +++ b/linux/devices/startracker/StrHelper.cpp @@ -1,5 +1,7 @@ #include "StrHelper.h" +#include + #include #include @@ -176,6 +178,11 @@ void StrHelper::disableTimestamping() { timestamping = false; } void StrHelper::enableTimestamping() { timestamping = true; } ReturnValue_t StrHelper::performImageDownload() { +#ifdef XIPHOS_Q7S + if (not sdcMan->getActiveSdCard()) { + return HasFileSystemIF::FILESYSTEM_INACTIVE; + } +#endif ReturnValue_t result; #if OBSW_DEBUG_STARTRACKER == 1 ProgressPrinter progressPrinter("Image download", ImageDownload::LAST_POSITION); @@ -244,6 +251,11 @@ ReturnValue_t StrHelper::performImageUpload() { uint32_t imageSize = 0; struct UploadActionRequest uploadReq; uploadReq.position = 0; +#ifdef XIPHOS_Q7S + if (not sdcMan->getActiveSdCard()) { + return HasFileSystemIF::FILESYSTEM_INACTIVE; + } +#endif std::memset(&uploadReq.data, 0, sizeof(uploadReq.data)); if (not std::filesystem::exists(uploadImage.uploadFile)) { triggerEvent(STR_HELPER_FILE_NOT_EXISTS, static_cast(internalState)); @@ -315,6 +327,11 @@ ReturnValue_t StrHelper::performFirmwareUpdate() { } ReturnValue_t StrHelper::performFlashWrite() { +#ifdef XIPHOS_Q7S + if (not sdcMan->getActiveSdCard()) { + return HasFileSystemIF::FILESYSTEM_INACTIVE; + } +#endif ReturnValue_t result = returnvalue::OK; uint32_t size = 0; uint32_t bytesWritten = 0; @@ -394,6 +411,11 @@ ReturnValue_t StrHelper::performFlashWrite() { } ReturnValue_t StrHelper::performFlashRead() { +#ifdef XIPHOS_Q7S + if (not sdcMan->getActiveSdCard()) { + return HasFileSystemIF::FILESYSTEM_INACTIVE; + } +#endif ReturnValue_t result; #if OBSW_DEBUG_STARTRACKER == 1 ProgressPrinter progressPrinter("Flash read", flashRead.size); diff --git a/mission/devices/ScexDeviceHandler.cpp b/mission/devices/ScexDeviceHandler.cpp index db562f66..8819cd95 100644 --- a/mission/devices/ScexDeviceHandler.cpp +++ b/mission/devices/ScexDeviceHandler.cpp @@ -203,7 +203,7 @@ ReturnValue_t ScexDeviceHandler::interpretDeviceReply(DeviceCommandId_t id, cons auto oneFileHandler = [&](std::string cmdName) { auto activeSd = sdcMan.getActiveSdCard(); if (not activeSd) { - return HasFileSystemIF::GENERIC_FILE_ERROR; + return HasFileSystemIF::FILESYSTEM_INACTIVE; } fileId = date_time_string(); std::ostringstream oss; @@ -223,7 +223,7 @@ ReturnValue_t ScexDeviceHandler::interpretDeviceReply(DeviceCommandId_t id, cons if ((helper.getPacketCounter() == 1) or (not fileNameSet)) { auto activeSd = sdcMan.getActiveSdCard(); if (not activeSd) { - return HasFileSystemIF::GENERIC_FILE_ERROR; + return HasFileSystemIF::FILESYSTEM_INACTIVE; } fileId = date_time_string(); std::ostringstream oss; diff --git a/mission/devices/SolarArrayDeploymentHandler.cpp b/mission/devices/SolarArrayDeploymentHandler.cpp index affc0e2e..6a29ecd5 100644 --- a/mission/devices/SolarArrayDeploymentHandler.cpp +++ b/mission/devices/SolarArrayDeploymentHandler.cpp @@ -1,5 +1,6 @@ #include "SolarArrayDeploymentHandler.h" +#include #include #include -- 2.43.0 From 0135bebc70f8875d4cafa024b276b385188e27f0 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 25 Oct 2022 11:33:21 +0200 Subject: [PATCH 73/97] impl bugfix --- bsp_q7s/fs/SdCardManager.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bsp_q7s/fs/SdCardManager.cpp b/bsp_q7s/fs/SdCardManager.cpp index e547a6d0..0207cfbb 100644 --- a/bsp_q7s/fs/SdCardManager.cpp +++ b/bsp_q7s/fs/SdCardManager.cpp @@ -475,7 +475,9 @@ bool SdCardManager::isSdCardUsable(std::optional sdCard) { return false; } if (not sdCard) { - sdCard == sd::BOTH; + if (active.first == sd::MOUNTED or active.second == sd::MOUNTED) { + return true; + } } if (sdCard == sd::SLOT_0) { if (active.first == sd::MOUNTED) { -- 2.43.0 From 4af8c85a8413fcbed0d8427407009efc5f855036 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 25 Oct 2022 11:39:57 +0200 Subject: [PATCH 74/97] small fix --- bsp_q7s/fs/SdCardManager.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/bsp_q7s/fs/SdCardManager.cpp b/bsp_q7s/fs/SdCardManager.cpp index 0207cfbb..9d5fcd6e 100644 --- a/bsp_q7s/fs/SdCardManager.cpp +++ b/bsp_q7s/fs/SdCardManager.cpp @@ -478,6 +478,7 @@ bool SdCardManager::isSdCardUsable(std::optional sdCard) { if (active.first == sd::MOUNTED or active.second == sd::MOUNTED) { return true; } + return false; } if (sdCard == sd::SLOT_0) { if (active.first == sd::MOUNTED) { -- 2.43.0 From 4a8096998de2df347c29d0162b3040c1fdc9ac62 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 25 Oct 2022 18:21:48 +0200 Subject: [PATCH 75/97] added two todos and new uio file names --- bsp_q7s/boardconfig/busConf.h | 8 ++++---- linux/obc/PdecHandler.cpp | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/bsp_q7s/boardconfig/busConf.h b/bsp_q7s/boardconfig/busConf.h index 4ccdc78d..529c0264 100644 --- a/bsp_q7s/boardconfig/busConf.h +++ b/bsp_q7s/boardconfig/busConf.h @@ -17,10 +17,10 @@ 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/ttyS-SCEX"; -static constexpr char UIO_PDEC_REGISTERS[] = "/dev/uio0"; -static constexpr char UIO_PTME[] = "/dev/uio1"; -static constexpr char UIO_PDEC_CONFIG_MEMORY[] = "/dev/uio2"; -static constexpr char UIO_PDEC_RAM[] = "/dev/uio3"; +static constexpr char UIO_PDEC_REGISTERS[] = "/dev/uio_pdec_regs"; +static constexpr char UIO_PTME[] = "/dev/uio_ptme"; +static constexpr char UIO_PDEC_CONFIG_MEMORY[] = "/dev/uio_pdec_cfg_mem"; +static constexpr char UIO_PDEC_RAM[] = "/dev/pdec_ram"; static constexpr int MAP_ID_PTME_CONFIG = 3; namespace uiomapids { diff --git a/linux/obc/PdecHandler.cpp b/linux/obc/PdecHandler.cpp index 6199853f..c009d8a6 100644 --- a/linux/obc/PdecHandler.cpp +++ b/linux/obc/PdecHandler.cpp @@ -88,6 +88,7 @@ void PdecHandler::writePdecConfig() { // Configure all MAP IDs as invalid for (int idx = 0; idx <= MAX_MAP_ADDR; idx += 4) { + // TODO: adding 1 / 4 results in + 0. Check correctness *(memoryBaseAddress + MAP_ADDR_LUT_OFFSET + idx + 1 / 4) = NO_DESTINATION << 24 | NO_DESTINATION << 16 | NO_DESTINATION << 8 | NO_DESTINATION; } @@ -99,6 +100,7 @@ void PdecHandler::writePdecConfig() { // Write map id clock frequencies for (int idx = 0; idx <= MAX_MAP_ADDR; idx += 4) { + // TODO: adding 1 / 4 results in + 0. Check correctness *(memoryBaseAddress + MAP_CLK_FREQ_OFFSET + idx / 4) = MAP_CLK_FREQ << 24 | MAP_CLK_FREQ << 16 | MAP_CLK_FREQ << 8 | MAP_CLK_FREQ; } -- 2.43.0 From d25e883e65ad9505a15d7e6f64e3dbc8e662655b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 26 Oct 2022 15:30:04 +0200 Subject: [PATCH 76/97] further reduce EM obj factory --- bsp_q7s/em/emObjectFactory.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bsp_q7s/em/emObjectFactory.cpp b/bsp_q7s/em/emObjectFactory.cpp index 4202cfdd..7b80225c 100644 --- a/bsp_q7s/em/emObjectFactory.cpp +++ b/bsp_q7s/em/emObjectFactory.cpp @@ -44,6 +44,7 @@ void ObjectFactory::produce(void* args) { // createRtdComponents(q7s::SPI_DEFAULT_DEV, gpioComIF, pwrSwitcher, spiMainComIF); // createTmpComponents(); // createSolarArrayDeploymentComponents(); + // createPayloadComponents(gpioComIF); createRadSensorComponent(gpioComIF); #if OBSW_ADD_ACS_BOARD == 1 @@ -51,12 +52,14 @@ void ObjectFactory::produce(void* args) { #endif createHeaterComponents(gpioComIF, pwrSwitcher, healthTable); - createPayloadComponents(gpioComIF); #if OBSW_ADD_MGT == 1 createImtqComponents(pwrSwitcher); #endif + +#if OBSW_ADD_RW == 1 createReactionWheelComponents(gpioComIF, pwrSwitcher); +#endif #if OBSW_ADD_BPX_BATTERY_HANDLER == 1 createBpxBatteryComponent(); @@ -76,7 +79,5 @@ void ObjectFactory::produce(void* args) { createScexComponents(q7s::UART_SCEX_DEV, pwrSwitcher, *SdCardManager::instance(), true, std::nullopt); #endif - - createMiscComponents(); createAcsController(); } -- 2.43.0 From c2845aefafd6560dc5a02fcc9a78c0633aced4a1 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 26 Oct 2022 15:31:04 +0200 Subject: [PATCH 77/97] further reduce EM SW --- bsp_q7s/em/emObjectFactory.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bsp_q7s/em/emObjectFactory.cpp b/bsp_q7s/em/emObjectFactory.cpp index 7b80225c..cc314e06 100644 --- a/bsp_q7s/em/emObjectFactory.cpp +++ b/bsp_q7s/em/emObjectFactory.cpp @@ -45,13 +45,12 @@ void ObjectFactory::produce(void* args) { // createTmpComponents(); // createSolarArrayDeploymentComponents(); // createPayloadComponents(gpioComIF); + // createHeaterComponents(gpioComIF, pwrSwitcher, healthTable); createRadSensorComponent(gpioComIF); #if OBSW_ADD_ACS_BOARD == 1 createAcsBoardComponents(gpioComIF, uartComIF, pwrSwitcher); #endif - createHeaterComponents(gpioComIF, pwrSwitcher, healthTable); - #if OBSW_ADD_MGT == 1 createImtqComponents(pwrSwitcher); -- 2.43.0 From 00059251f0dcd37a13d5f7b331041161bb63a71c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 26 Oct 2022 15:47:23 +0200 Subject: [PATCH 78/97] further clean up em and general code --- CMakeLists.txt | 12 ++++++++++++ bsp_q7s/OBSWConfig.h.in | 6 ++++-- bsp_q7s/boardtest/Q7STestTask.cpp | 6 ++++-- bsp_q7s/boardtest/Q7STestTask.h | 1 + bsp_q7s/core/InitMission.cpp | 10 +++++++++- bsp_q7s/em/emObjectFactory.cpp | 1 + .../pollingSequenceFactory.cpp | 19 ++++--------------- mission/devices/ImtqHandler.cpp | 3 ++- 8 files changed, 37 insertions(+), 21 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 43336bdd..8e0537f5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -101,6 +101,18 @@ set(OBSW_ADD_GPS_CTRL set(OBSW_ADD_TCS_CTRL ${INIT_VAL} CACHE STRING "Add TCS controllers") +set(OBSW_ADD_HEATERS + ${INIT_VAL} + CACHE STRING "Add TCS heaters") +set(OBSW_ADD_PLOC_SUPERVISOR + ${INIT_VAL} + 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} + CACHE STRING "Add MPSoC handler") set(OBSW_ADD_ACS_CTRL ${INIT_VAL} CACHE STRING "Add ACS controller") diff --git a/bsp_q7s/OBSWConfig.h.in b/bsp_q7s/OBSWConfig.h.in index f3cfa907..bf113173 100644 --- a/bsp_q7s/OBSWConfig.h.in +++ b/bsp_q7s/OBSWConfig.h.in @@ -24,8 +24,8 @@ #define OBSW_ADD_MGT @OBSW_ADD_MGT@ #define OBSW_ADD_BPX_BATTERY_HANDLER @OBSW_ADD_BPX_BATTERY_HANDLER@ #define OBSW_ADD_STAR_TRACKER @OBSW_ADD_STAR_TRACKER@ -#define OBSW_ADD_PLOC_SUPERVISOR 1 -#define OBSW_ADD_PLOC_MPSOC 1 +#define OBSW_ADD_PLOC_SUPERVISOR @OBSW_ADD_PLOC_SUPERVISOR@ +#define OBSW_ADD_PLOC_MPSOC @OBSW_ADD_PLOC_MPSOC@ #define OBSW_ADD_SUN_SENSORS @OBSW_ADD_SUN_SENSORS@ #define OBSW_ADD_SUS_BOARD_ASS @OBSW_ADD_SUS_BOARD_ASS@ #define OBSW_ADD_ACS_BOARD @OBSW_ADD_ACS_BOARD@ @@ -34,7 +34,9 @@ #define OBSW_ADD_TCS_CTRL @OBSW_ADD_TCS_CTRL@ #define OBSW_ADD_RW @OBSW_ADD_RW@ #define OBSW_ADD_RTD_DEVICES @OBSW_ADD_RTD_DEVICES@ +#define OBSW_ADD_SA_DEPL @OBSW_ADD_SA_DEPL@ #define OBSW_ADD_SCEX_DEVICE @OBSW_ADD_SCEX_DEVICE@ +#define OBSW_ADD_HEATERS @OBSW_ADD_HEATERS@ #define OBSW_ADD_TMP_DEVICES @OBSW_ADD_TMP_DEVICES@ #define OBSW_ADD_RAD_SENSORS @OBSW_ADD_RAD_SENSORS@ #define OBSW_ADD_PL_PCDU @OBSW_ADD_PL_PCDU@ diff --git a/bsp_q7s/boardtest/Q7STestTask.cpp b/bsp_q7s/boardtest/Q7STestTask.cpp index a782ff6d..50a34284 100644 --- a/bsp_q7s/boardtest/Q7STestTask.cpp +++ b/bsp_q7s/boardtest/Q7STestTask.cpp @@ -75,8 +75,10 @@ ReturnValue_t Q7STestTask::performOneShotAction() { if (doTestProtHandler) { testProtHandler(); } - FsOpCodes opCode = FsOpCodes::CREATE_EMPTY_FILE_IN_TMP; - testFileSystemHandlerDirect(opCode); + if (DO_TEST_FS_HANDLER) { + FsOpCodes opCode = FsOpCodes::CREATE_EMPTY_FILE_IN_TMP; + testFileSystemHandlerDirect(opCode); + } return TestTask::performOneShotAction(); } diff --git a/bsp_q7s/boardtest/Q7STestTask.h b/bsp_q7s/boardtest/Q7STestTask.h index 9e39e8b3..dcfc3e96 100644 --- a/bsp_q7s/boardtest/Q7STestTask.h +++ b/bsp_q7s/boardtest/Q7STestTask.h @@ -18,6 +18,7 @@ class Q7STestTask : public TestTask { bool doTestScratchApi = false; static constexpr bool DO_TEST_GOMSPACE_API = false; static constexpr bool DO_TEST_GOMSPACE_GET_CONFIG = false; + static constexpr bool DO_TEST_FS_HANDLER = false; bool doTestGpsShm = false; bool doTestGpsSocket = false; bool doTestProtHandler = false; diff --git a/bsp_q7s/core/InitMission.cpp b/bsp_q7s/core/InitMission.cpp index df36df33..f6b9f9f3 100644 --- a/bsp_q7s/core/InitMission.cpp +++ b/bsp_q7s/core/InitMission.cpp @@ -73,6 +73,7 @@ void initmission::initTasks() { if (result != returnvalue::OK) { initmission::printAddObjectError("CORE_CTRL", objects::CORE_CONTROLLER); } +#if OBSW_ADD_SA_DEPL == 1 // Could add this to the core controller but the core controller does so many thing that I would // prefer to have the solar array deployment in a seprate task. PeriodicTaskIF* solarArrayDeplTask = factory->createPeriodicTask( @@ -81,6 +82,7 @@ void initmission::initTasks() { if (result != returnvalue::OK) { initmission::printAddObjectError("SOLAR_ARRAY_DEPL", objects::SOLAR_ARRAY_DEPL_HANDLER); } +#endif /* TMTC Distribution */ PeriodicTaskIF* tmTcDistributor = factory->createPeriodicTask( @@ -234,10 +236,12 @@ void initmission::initTasks() { initmission::printAddObjectError("THERMAL_CONTROLLER", objects::THERMAL_CONTROLLER); } #endif +#if OBSW_ADD_HEATERS == 1 result = tcsSystemTask->addComponent(objects::HEATER_HANDLER); if (result != returnvalue::OK) { initmission::printAddObjectError("HEATER_HANDLER", objects::HEATER_HANDLER); } +#endif #if OBSW_ADD_STAR_TRACKER == 1 PeriodicTaskIF* strHelperTask = factory->createPeriodicTask( @@ -313,7 +317,9 @@ void initmission::initTasks() { #endif /* OBSW_USE_CCSDS_IP_CORE == 1 */ sysCtrlTask->startTask(); +#if OBSW_ADD_SA_DEPL == 1 solarArrayDeplTask->startTask(); +#endif taskStarter(pstTasks, "PST task vector"); taskStarter(pusTasks, "PUS task vector"); @@ -340,7 +346,9 @@ void initmission::initTasks() { tcsPollingTask->startTask(); tcsTask->startTask(); #endif /* OBSW_ADD_RTD_DEVICES == 1 */ - tcsSystemTask->startTask(); + if (not tcsSystemTask->isEmpty()) { + tcsSystemTask->startTask(); + } #if OBSW_ADD_PLOC_SUPERVISOR == 1 supvHelperTask->startTask(); #endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */ diff --git a/bsp_q7s/em/emObjectFactory.cpp b/bsp_q7s/em/emObjectFactory.cpp index cc314e06..055113e9 100644 --- a/bsp_q7s/em/emObjectFactory.cpp +++ b/bsp_q7s/em/emObjectFactory.cpp @@ -35,6 +35,7 @@ void ObjectFactory::produce(void* args) { gpioCallbacks::disableAllDecoder(gpioComIF); PowerSwitchIF* pwrSwitcher = new DummyPowerSwitcher(objects::PCDU_HANDLER, 18, 0); + static_cast(pwrSwitcher); // Regular FM code, does not work for EM if the hardware is not connected // createPcduComponents(gpioComIF, &pwrSwitcher); diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp index 59f07d1f..6aa6f929 100644 --- a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp @@ -460,20 +460,18 @@ ReturnValue_t pst::pstI2c(FixedTimeslotTaskIF *thisSequence) { ReturnValue_t pst::pstUart(FixedTimeslotTaskIF *thisSequence) { // Length of a communication cycle uint32_t length = thisSequence->getPeriodMs(); - bool uartPstEmpty = true; - + static_cast(length); #if OBSW_ADD_PLOC_MPSOC == 1 - uartPstEmpty = false; thisSequence->addSlot(objects::PLOC_MPSOC_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); thisSequence->addSlot(objects::PLOC_MPSOC_HANDLER, length * 0.2, DeviceHandlerIF::SEND_WRITE); thisSequence->addSlot(objects::PLOC_MPSOC_HANDLER, length * 0.4, DeviceHandlerIF::GET_WRITE); thisSequence->addSlot(objects::PLOC_MPSOC_HANDLER, length * 0.6, DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::PLOC_MPSOC_HANDLER, length * 0.8, DeviceHandlerIF::GET_READ); -#endif - thisSequence->addSlot(objects::PLOC_MEMORY_DUMPER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); +#endif + #if OBSW_ADD_PLOC_SUPERVISOR == 1 thisSequence->addSlot(objects::PLOC_SUPERVISOR_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); @@ -485,7 +483,6 @@ ReturnValue_t pst::pstUart(FixedTimeslotTaskIF *thisSequence) { #endif #if OBSW_ADD_SYRLINKS == 1 - uartPstEmpty = false; thisSequence->addSlot(objects::SYRLINKS_HK_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); thisSequence->addSlot(objects::SYRLINKS_HK_HANDLER, length * 0.2, DeviceHandlerIF::SEND_WRITE); @@ -502,15 +499,7 @@ ReturnValue_t pst::pstUart(FixedTimeslotTaskIF *thisSequence) { thisSequence->addSlot(objects::STAR_TRACKER, length * 0.6, DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::STAR_TRACKER, length * 0.8, DeviceHandlerIF::GET_READ); #endif - static_cast(length); - if (uartPstEmpty) { - return returnvalue::OK; - } - if (thisSequence->checkSequence() != returnvalue::OK) { - sif::error << "UART PST initialization failed" << std::endl; - return returnvalue::FAILED; - } - return returnvalue::OK; + return thisSequence->checkSequence(); } ReturnValue_t pst::pstGompaceCan(FixedTimeslotTaskIF *thisSequence) { diff --git a/mission/devices/ImtqHandler.cpp b/mission/devices/ImtqHandler.cpp index d27b6f65..a0e717f8 100644 --- a/mission/devices/ImtqHandler.cpp +++ b/mission/devices/ImtqHandler.cpp @@ -321,7 +321,8 @@ ReturnValue_t ImtqHandler::scanForReply(const uint8_t* start, size_t remainingSi break; case (IMTQ::CC::PAST_AVAILABLE_RESPONSE_BYTES): { sif::warning << "IMTQHandler::scanForReply: Read 0xFF command byte, reading past available " - "bytes. Keep 1 ms delay between I2C send and read" << std::endl; + "bytes. Keep 1 ms delay between I2C send and read" + << std::endl; result = IGNORE_REPLY_DATA; break; } -- 2.43.0 From 3475e167eef6dfdd83dc1b045c686f092fa50919 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 26 Oct 2022 15:57:07 +0200 Subject: [PATCH 79/97] perform SD card check more often for 2-3 cycles --- bsp_q7s/core/CoreController.cpp | 6 ++++++ bsp_q7s/core/CoreController.h | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/bsp_q7s/core/CoreController.cpp b/bsp_q7s/core/CoreController.cpp index 6b3c08a9..b7da3e20 100644 --- a/bsp_q7s/core/CoreController.cpp +++ b/bsp_q7s/core/CoreController.cpp @@ -82,6 +82,12 @@ void CoreController::performControlOperation() { sdStateMachine(); performMountedSdCardOperations(); if (sdCardCheckCd.hasTimedOut()) { + if (shortSdCardCdCounter < 2) { + shortSdCardCdCounter++; + } + if (shortSdCardCdCounter == 2) { + sdCardCheckCd.setTimeout(DEFAULT_SD_CARD_CHECK_TIMEOUT); + } performSdCardCheck(); sdCardCheckCd.resetTimer(); } diff --git a/bsp_q7s/core/CoreController.h b/bsp_q7s/core/CoreController.h index 460c0f8a..c3c830cc 100644 --- a/bsp_q7s/core/CoreController.h +++ b/bsp_q7s/core/CoreController.h @@ -70,6 +70,9 @@ class CoreController : public ExtendedControllerBase { static constexpr char CHIP_1_COPY_0_MOUNT_DIR[] = "/tmp/mntupdate-xdi-qspi1-nom-rootfs"; static constexpr char CHIP_1_COPY_1_MOUNT_DIR[] = "/tmp/mntupdate-xdi-qspi1-gold-rootfs"; + static constexpr dur_millis_t INIT_SD_CARD_CHECK_TIMEOUT = 5000; + static constexpr dur_millis_t DEFAULT_SD_CARD_CHECK_TIMEOUT = 60000; + static constexpr ActionId_t LIST_DIRECTORY_INTO_FILE = 0; static constexpr ActionId_t SWITCH_REBOOT_FILE_HANDLING = 5; static constexpr ActionId_t RESET_REBOOT_COUNTERS = 6; @@ -210,6 +213,8 @@ class CoreController : public ExtendedControllerBase { RebootFile rebootFile = {}; std::string currMntPrefix; bool performOneShotSdCardOpsSwitch = false; + uint8_t shortSdCardCdCounter = 0; + Countdown sdCardCheckCd = Countdown(INIT_SD_CARD_CHECK_TIMEOUT); /** * Index 0: Chip 0 Copy 0 @@ -229,7 +234,7 @@ class CoreController : public ExtendedControllerBase { ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap, LocalDataPoolManager& poolManager) override; - Countdown sdCardCheckCd = Countdown(120000); + LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override; ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode, uint32_t* msToReachTheMode); void performMountedSdCardOperations(); -- 2.43.0 From d7ff74b6bdc30c92264d3c61043ce90ba41b05d6 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 26 Oct 2022 16:11:34 +0200 Subject: [PATCH 80/97] better configurability for PDEC/PTME usage --- CMakeLists.txt | 9 +++++++++ bsp_hosted/fsfwconfig/OBSWConfig.h.in | 2 +- bsp_linux_board/OBSWConfig.h.in | 2 +- bsp_q7s/OBSWConfig.h.in | 11 +++++------ bsp_q7s/core/InitMission.cpp | 10 +++++----- bsp_q7s/em/emObjectFactory.cpp | 4 ++-- bsp_q7s/fmObjectFactory.cpp | 4 ++-- bsp_te0720_1cfa/InitMission.cpp | 8 ++++---- bsp_te0720_1cfa/OBSWConfig.h.in | 2 +- 9 files changed, 30 insertions(+), 22 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8e0537f5..a0287ef2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -98,6 +98,15 @@ set(OBSW_ADD_ACS_BOARD set(OBSW_ADD_GPS_CTRL ${INIT_VAL} CACHE STRING "Add GPS controllers") +set(OBSW_ADD_CCSDS_IP_CORES + ${INIT_VAL} + CACHE STRING "Add CCSDS IP cores") +set(OBSW_TM_TO_PTME + ${INIT_VAL} + CACHE STRING "Send telemetry to PTME IP core") +set(OBSW_TC_FROM_PDEC + ${INIT_VAL} + CACHE STRING "Poll telecommand from PDEC IP core") set(OBSW_ADD_TCS_CTRL ${INIT_VAL} CACHE STRING "Add TCS controllers") diff --git a/bsp_hosted/fsfwconfig/OBSWConfig.h.in b/bsp_hosted/fsfwconfig/OBSWConfig.h.in index 69029c23..b7de30f0 100644 --- a/bsp_hosted/fsfwconfig/OBSWConfig.h.in +++ b/bsp_hosted/fsfwconfig/OBSWConfig.h.in @@ -16,7 +16,7 @@ debugging. */ #define OBSW_VEBOSE_LEVEL 1 -#define OBSW_USE_CCSDS_IP_CORE 0 +#define OBSW_ADD_CCSDS_IP_CORES 0 // Set to 1 if all telemetry should be sent to the PTME IP Core #define OBSW_TM_TO_PTME 0 // Set to 1 if telecommands are received via the PDEC IP Core diff --git a/bsp_linux_board/OBSWConfig.h.in b/bsp_linux_board/OBSWConfig.h.in index f17c3d48..04b90ed9 100644 --- a/bsp_linux_board/OBSWConfig.h.in +++ b/bsp_linux_board/OBSWConfig.h.in @@ -103,7 +103,7 @@ /*******************************************************************/ #cmakedefine EIVE_BUILD_GPSD_GPS_HANDLER -#define OBSW_USE_CCSDS_IP_CORE 0 +#define OBSW_ADD_CCSDS_IP_CORES 0 // Set to 1 if all telemetry should be sent to the PTME IP Core #define OBSW_TM_TO_PTME 0 // Set to 1 if telecommands are received via the PDEC IP Core diff --git a/bsp_q7s/OBSWConfig.h.in b/bsp_q7s/OBSWConfig.h.in index bf113173..76173c1b 100644 --- a/bsp_q7s/OBSWConfig.h.in +++ b/bsp_q7s/OBSWConfig.h.in @@ -14,12 +14,6 @@ /** All of the following flags should be enabled for mission code */ /*******************************************************************/ -#define OBSW_USE_CCSDS_IP_CORE 1 -// Set to 1 if all telemetry should be sent to the PTME IP Core -#define OBSW_TM_TO_PTME 0 -// Set to 1 if telecommands are received via the PDEC IP Core -#define OBSW_TC_FROM_PDEC 0 - #define OBSW_ADD_GOMSPACE_PCDU @OBSW_ADD_GOMSPACE_PCDU@ #define OBSW_ADD_MGT @OBSW_ADD_MGT@ #define OBSW_ADD_BPX_BATTERY_HANDLER @OBSW_ADD_BPX_BATTERY_HANDLER@ @@ -41,6 +35,11 @@ #define OBSW_ADD_RAD_SENSORS @OBSW_ADD_RAD_SENSORS@ #define OBSW_ADD_PL_PCDU @OBSW_ADD_PL_PCDU@ #define OBSW_ADD_SYRLINKS @OBSW_ADD_SYRLINKS@ +#define OBSW_ADD_CCSDS_IP_CORES @OBSW_ADD_CCSDS_IP_CORES@ +// Set to 1 if all telemetry should be sent to the PTME IP Core +#define OBSW_TM_TO_PTME @OBSW_TM_TO_PTME@ +// Set to 1 if telecommands are received via the PDEC IP Core +#define OBSW_TC_FROM_PDEC @OBSW_TC_FROM_PDEC@ #define OBSW_ENABLE_SYRLINKS_TRANSMIT_TIMEOUT 0 // Configuration parameter which causes the core controller to try to keep at least one SD card diff --git a/bsp_q7s/core/InitMission.cpp b/bsp_q7s/core/InitMission.cpp index f6b9f9f3..ebbb4432 100644 --- a/bsp_q7s/core/InitMission.cpp +++ b/bsp_q7s/core/InitMission.cpp @@ -119,7 +119,7 @@ void initmission::initTasks() { } #endif -#if OBSW_USE_CCSDS_IP_CORE == 1 +#if OBSW_ADD_CCSDS_IP_CORES == 1 PeriodicTaskIF* ccsdsHandlerTask = factory->createPeriodicTask( "CCSDS_HANDLER", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc); result = ccsdsHandlerTask->addComponent(objects::CCSDS_HANDLER); @@ -136,7 +136,7 @@ void initmission::initTasks() { if (result != returnvalue::OK) { initmission::printAddObjectError("PDEC Handler", objects::PDEC_HANDLER); } -#endif /* OBSW_USE_CCSDS_IP_CORE == 1 */ +#endif /* OBSW_ADD_CCSDS_IP_CORE == 1 */ #if OBSW_ADD_CFDP_COMPONENTS == 1 PeriodicTaskIF* cfdpTask = factory->createPeriodicTask( @@ -311,12 +311,12 @@ void initmission::initTasks() { tmtcPollingTask->startTask(); #endif -#if OBSW_USE_CCSDS_IP_CORE == 1 +#if OBSW_ADD_CCSDS_IP_CORES == 1 ccsdsHandlerTask->startTask(); pdecHandlerTask->startTask(); -#endif /* OBSW_USE_CCSDS_IP_CORE == 1 */ +#endif /* OBSW_ADD_CCSDS_IP_CORES == 1 */ - sysCtrlTask->startTask(); + // sysCtrlTask->startTask(); #if OBSW_ADD_SA_DEPL == 1 solarArrayDeplTask->startTask(); #endif diff --git a/bsp_q7s/em/emObjectFactory.cpp b/bsp_q7s/em/emObjectFactory.cpp index 055113e9..5361eacb 100644 --- a/bsp_q7s/em/emObjectFactory.cpp +++ b/bsp_q7s/em/emObjectFactory.cpp @@ -68,9 +68,9 @@ void ObjectFactory::produce(void* args) { #if OBSW_ADD_STAR_TRACKER == 1 createStrComponents(pwrSwitcher); #endif /* OBSW_ADD_STAR_TRACKER == 1 */ -#if OBSW_USE_CCSDS_IP_CORE == 1 +#if OBSW_ADD_CCSDS_IP_CORES == 1 createCcsdsComponents(gpioComIF); -#endif /* OBSW_USE_CCSDS_IP_CORE == 1 */ +#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 d28b7248..f38621f7 100644 --- a/bsp_q7s/fmObjectFactory.cpp +++ b/bsp_q7s/fmObjectFactory.cpp @@ -55,9 +55,9 @@ void ObjectFactory::produce(void* args) { #if OBSW_ADD_STAR_TRACKER == 1 createStrComponents(pwrSwitcher); #endif /* OBSW_ADD_STAR_TRACKER == 1 */ -#if OBSW_USE_CCSDS_IP_CORE == 1 +#if OBSW_ADD_CCSDS_IP_CORES == 1 createCcsdsComponents(gpioComIF); -#endif /* OBSW_USE_CCSDS_IP_CORE == 1 */ +#endif /* OBSW_ADD_CCSDS_IP_CORES == 1 */ #if OBSW_ADD_SCEX_DEVICE == 1 createScexComponents(q7s::UART_SCEX_DEV, pwrSwitcher, *SdCardManager::instance(), false, diff --git a/bsp_te0720_1cfa/InitMission.cpp b/bsp_te0720_1cfa/InitMission.cpp index b7c6b683..d303d41b 100644 --- a/bsp_te0720_1cfa/InitMission.cpp +++ b/bsp_te0720_1cfa/InitMission.cpp @@ -107,7 +107,7 @@ void initmission::initTasks() { } #endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */ -#if OBSW_USE_CCSDS_IP_CORE == 1 +#if OBSW_ADD_CCSDS_IP_CORE == 1 PeriodicTaskIF* ccsdsHandlerTask = factory->createPeriodicTask( "CCSDS_HANDLER", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc); result = ccsdsHandlerTask->addComponent(objects::CCSDS_HANDLER); @@ -124,7 +124,7 @@ void initmission::initTasks() { if (result != returnvalue::OK) { initmission::printAddObjectError("PDEC Handler", objects::PDEC_HANDLER); } -#endif /* OBSW_USE_CCSDS_IP_CORE == 1 */ +#endif /* OBSW_ADD_CCSDS_IP_CORE == 1 */ auto taskStarter = [](std::vector& taskVector, std::string name) { for (const auto& task : taskVector) { @@ -140,10 +140,10 @@ void initmission::initTasks() { tmtcDistributor->startTask(); tmtcBridgeTask->startTask(); tmtcPollingTask->startTask(); -#if OBSW_USE_CCSDS_IP_CORE == 1 +#if OBSW_ADD_CCSDS_IP_CORE == 1 pdecHandlerTask->startTask(); ccsdsHandlerTask->startTask(); -#endif /* #if OBSW_USE_CCSDS_IP_CORE == 1 */ +#endif /* #if OBSW_ADD_CCSDS_IP_CORE == 1 */ #if OBSW_ADD_PLOC_SUPERVISOR == 1 supvHelperTask->startTask(); #endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */ diff --git a/bsp_te0720_1cfa/OBSWConfig.h.in b/bsp_te0720_1cfa/OBSWConfig.h.in index 2f887daa..d2efda38 100644 --- a/bsp_te0720_1cfa/OBSWConfig.h.in +++ b/bsp_te0720_1cfa/OBSWConfig.h.in @@ -13,7 +13,7 @@ /** All of the following flags should be enabled for mission code */ /*******************************************************************/ -#define OBSW_USE_CCSDS_IP_CORE 0 +#define OBSW_ADD_CCSDS_IP_CORE 0 // Set to 1 if all telemetry should be sent to the PTME IP Core #define OBSW_TM_TO_PTME 0 // Set to 1 if telecommands are received via the PDEC IP Core -- 2.43.0 From 5173a0c9cbfa062da0ba2368e84d0fe8e65066ab Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 26 Oct 2022 17:11:57 +0200 Subject: [PATCH 81/97] its the rad sensor --- bsp_q7s/callbacks/rwSpiCallback.cpp | 28 ++++++++++++------------ bsp_q7s/core/ObjectFactory.cpp | 12 +++++----- bsp_q7s/core/ObjectFactory.h | 2 +- bsp_q7s/em/emObjectFactory.cpp | 10 +++++++-- bsp_q7s/fmObjectFactory.cpp | 8 ++++--- fsfw | 2 +- mission/devices/GyroADIS1650XHandler.cpp | 8 +++---- mission/devices/PayloadPcduHandler.cpp | 12 +++++----- 8 files changed, 46 insertions(+), 36 deletions(-) diff --git a/bsp_q7s/callbacks/rwSpiCallback.cpp b/bsp_q7s/callbacks/rwSpiCallback.cpp index ae23d64d..74ede602 100644 --- a/bsp_q7s/callbacks/rwSpiCallback.cpp +++ b/bsp_q7s/callbacks/rwSpiCallback.cpp @@ -41,19 +41,19 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen uint8_t writeSize = 0; gpioId_t gpioId = cookie->getChipSelectPin(); - GpioIF* gpioIF = comIf->getGpioInterface(); + GpioIF& gpioIF = comIf->getGpioInterface(); MutexIF::TimeoutType timeoutType = MutexIF::TimeoutType::WAITING; uint32_t timeoutMs = 0; MutexIF* mutex = comIf->getCsMutex(); cookie->getMutexParams(timeoutType, timeoutMs); - if (mutex == nullptr or gpioIF == nullptr) { + if (mutex == nullptr) { sif::debug << "rwSpiCallback::spiCallback: Mutex or GPIO interface invalid" << std::endl; return returnvalue::FAILED; } int fileDescriptor = 0; const std::string& dev = comIf->getSpiDev(); - result = openSpi(dev, O_RDWR, gpioIF, gpioId, mutex, timeoutType, timeoutMs, fileDescriptor); + result = openSpi(dev, O_RDWR, &gpioIF, gpioId, mutex, timeoutType, timeoutMs, fileDescriptor); if (result != returnvalue::OK) { return result; } @@ -75,7 +75,7 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen if (write(fileDescriptor, writeBuffer, writeSize) != static_cast(writeSize)) { sif::error << "rwSpiCallback::spiCallback: Write failed!" << std::endl; - closeSpi(fileDescriptor, gpioId, gpioIF, mutex); + closeSpi(fileDescriptor, gpioId, &gpioIF, mutex); return RwHandler::SPI_WRITE_FAILURE; } @@ -100,7 +100,7 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen } if (write(fileDescriptor, writeBuffer, writeSize) != static_cast(writeSize)) { sif::error << "rwSpiCallback::spiCallback: Write failed!" << std::endl; - closeSpi(fileDescriptor, gpioId, gpioIF, mutex); + closeSpi(fileDescriptor, gpioId, &gpioIF, mutex); return RwHandler::SPI_WRITE_FAILURE; } idx++; @@ -112,14 +112,14 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen if (write(fileDescriptor, writeBuffer, writeSize) != static_cast(writeSize)) { sif::error << "rwSpiCallback::spiCallback: Write failed!" << std::endl; - closeSpi(fileDescriptor, gpioId, gpioIF, mutex); + closeSpi(fileDescriptor, gpioId, &gpioIF, mutex); return RwHandler::SPI_WRITE_FAILURE; } uint8_t* rxBuf = nullptr; result = comIf->getReadBuffer(cookie->getSpiAddress(), &rxBuf); if (result != returnvalue::OK) { - closeSpi(fileDescriptor, gpioId, gpioIF, mutex); + closeSpi(fileDescriptor, gpioId, &gpioIF, mutex); return result; } @@ -127,9 +127,9 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen // There must be a delay of at least 20 ms after sending the command. // Delay for 70 ms here and release the SPI bus for that duration. - closeSpi(fileDescriptor, gpioId, gpioIF, mutex); + closeSpi(fileDescriptor, gpioId, &gpioIF, mutex); usleep(RwDefinitions::SPI_REPLY_DELAY); - result = openSpi(dev, O_RDWR, gpioIF, gpioId, mutex, timeoutType, timeoutMs, fileDescriptor); + result = openSpi(dev, O_RDWR, &gpioIF, gpioId, mutex, timeoutType, timeoutMs, fileDescriptor); if (result != returnvalue::OK) { return result; } @@ -142,13 +142,13 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen for (int idx = 0; idx < 10; idx++) { if (read(fileDescriptor, &byteRead, 1) != 1) { sif::error << "rwSpiCallback::spiCallback: Read failed" << std::endl; - closeSpi(fileDescriptor, gpioId, gpioIF, mutex); + closeSpi(fileDescriptor, gpioId, &gpioIF, mutex); return RwHandler::SPI_READ_FAILURE; } if (idx == 0) { if (byteRead != FLAG_BYTE) { sif::error << "Invalid data, expected start marker" << std::endl; - closeSpi(fileDescriptor, gpioId, gpioIF, mutex); + closeSpi(fileDescriptor, gpioId, &gpioIF, mutex); return RwHandler::NO_START_MARKER; } } @@ -159,7 +159,7 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen if (idx == 9) { sif::error << "rwSpiCallback::spiCallback: Empty frame timeout" << std::endl; - closeSpi(fileDescriptor, gpioId, gpioIF, mutex); + closeSpi(fileDescriptor, gpioId, &gpioIF, mutex); return RwHandler::NO_REPLY; } } @@ -199,7 +199,7 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen continue; } else { sif::error << "rwSpiCallback::spiCallback: Invalid substitute" << std::endl; - closeSpi(fileDescriptor, gpioId, gpioIF, mutex); + closeSpi(fileDescriptor, gpioId, &gpioIF, mutex); result = RwHandler::INVALID_SUBSTITUTE; break; } @@ -233,7 +233,7 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen cookie->setTransferSize(decodedFrameLen); - closeSpi(fileDescriptor, gpioId, gpioIF, mutex); + closeSpi(fileDescriptor, gpioId, &gpioIF, mutex); return result; } diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 36a9d590..07f3fe9c 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -145,10 +145,8 @@ void ObjectFactory::createCommunicationInterfaces(LinuxLibgpioIF** gpioComIF, Ua new CspComIF(objects::CSP_COM_IF); *i2cComIF = new I2cComIF(objects::I2C_COM_IF); *uartComIF = new UartComIF(objects::UART_COM_IF); - *spiMainComIF = new SpiComIF(objects::SPI_MAIN_COM_IF, q7s::SPI_DEFAULT_DEV, *gpioComIF); - *spiRWComIF = new SpiComIF(objects::SPI_RW_COM_IF, q7s::SPI_RW_DEV, *gpioComIF); - /* Adding gpios for chip select decoding to the gpioComIf */ - q7s::gpioCallbacks::initSpiCsDecoder(*gpioComIF); + *spiMainComIF = new SpiComIF(objects::SPI_MAIN_COM_IF, q7s::SPI_DEFAULT_DEV, **gpioComIF); + *spiRWComIF = new SpiComIF(objects::SPI_RW_COM_IF, q7s::SPI_RW_DEV, **gpioComIF); } void ObjectFactory::createPcduComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchIF** pwrSwitcher) { @@ -193,8 +191,11 @@ void ObjectFactory::createPcduComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchI #endif } -void ObjectFactory::createRadSensorComponent(LinuxLibgpioIF* gpioComIF) { +ReturnValue_t ObjectFactory::createRadSensorComponent(LinuxLibgpioIF* gpioComIF) { using namespace gpio; + if(gpioComIF == nullptr) { + return returnvalue::FAILED; + } GpioCookie* gpioCookieRadSensor = new GpioCookie; std::stringstream consumer; consumer << "0x" << std::hex << objects::RAD_SENSOR; @@ -220,6 +221,7 @@ void ObjectFactory::createRadSensorComponent(LinuxLibgpioIF* gpioComIF) { #if OBSW_DEBUG_RAD_SENSOR == 1 radSensor->enablePeriodicDataPrint(true); #endif + return returnvalue::OK; } void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComIF* uartComIF, diff --git a/bsp_q7s/core/ObjectFactory.h b/bsp_q7s/core/ObjectFactory.h index 88881090..76660f30 100644 --- a/bsp_q7s/core/ObjectFactory.h +++ b/bsp_q7s/core/ObjectFactory.h @@ -26,7 +26,7 @@ void createPcduComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchIF** pwrSwitcher void createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF, PowerSwitchIF* pwrSwitcher); void createTmpComponents(); -void createRadSensorComponent(LinuxLibgpioIF* gpioComIF); +ReturnValue_t createRadSensorComponent(LinuxLibgpioIF* gpioComIF); void createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComIF* uartComIF, PowerSwitchIF* pwrSwitcher); void createHeaterComponents(GpioIF* gpioIF, PowerSwitchIF* pwrSwitcher, HealthTableIF* healthTable); diff --git a/bsp_q7s/em/emObjectFactory.cpp b/bsp_q7s/em/emObjectFactory.cpp index 5361eacb..4fd6df50 100644 --- a/bsp_q7s/em/emObjectFactory.cpp +++ b/bsp_q7s/em/emObjectFactory.cpp @@ -1,3 +1,4 @@ +#include #include #include @@ -24,6 +25,9 @@ void ObjectFactory::produce(void* args) { I2cComIF* i2cComIF = nullptr; SpiComIF* spiRwComIF = nullptr; createCommunicationInterfaces(&gpioComIF, &uartComIF, &spiMainComIF, &i2cComIF, &spiRwComIF); + /* Adding gpios for chip select decoding to the gpioComIf */ + q7s::gpioCallbacks::initSpiCsDecoder(gpioComIF); + gpioCallbacks::disableAllDecoder(gpioComIF); // Hardware is usually not connected to EM, so we need to create dummies which replace lower // level components. @@ -33,7 +37,6 @@ void ObjectFactory::produce(void* args) { new CoreController(objects::CORE_CONTROLLER); - gpioCallbacks::disableAllDecoder(gpioComIF); PowerSwitchIF* pwrSwitcher = new DummyPowerSwitcher(objects::PCDU_HANDLER, 18, 0); static_cast(pwrSwitcher); @@ -47,7 +50,10 @@ void ObjectFactory::produce(void* args) { // createSolarArrayDeploymentComponents(); // createPayloadComponents(gpioComIF); // createHeaterComponents(gpioComIF, pwrSwitcher, healthTable); - createRadSensorComponent(gpioComIF); + + // TODO: Careful! Swichting this on somehow messes with the communication with the ProASIC + // and will cause xsc_boot_copy commands to always boot to 0 0 + // createRadSensorComponent(gpioComIF); #if OBSW_ADD_ACS_BOARD == 1 createAcsBoardComponents(gpioComIF, uartComIF, pwrSwitcher); diff --git a/bsp_q7s/fmObjectFactory.cpp b/bsp_q7s/fmObjectFactory.cpp index f38621f7..885f0def 100644 --- a/bsp_q7s/fmObjectFactory.cpp +++ b/bsp_q7s/fmObjectFactory.cpp @@ -1,3 +1,4 @@ +#include #include #include "OBSWConfig.h" @@ -23,10 +24,11 @@ void ObjectFactory::produce(void* args) { PowerSwitchIF* pwrSwitcher = nullptr; SpiComIF* spiRwComIF = nullptr; createCommunicationInterfaces(&gpioComIF, &uartComIF, &spiMainComIF, &i2cComIF, &spiRwComIF); - createTmpComponents(); - new CoreController(objects::CORE_CONTROLLER); - + /* Adding gpios for chip select decoding to the gpioComIf */ + q7s::gpioCallbacks::initSpiCsDecoder(gpioComIF); gpioCallbacks::disableAllDecoder(gpioComIF); + + new CoreController(objects::CORE_CONTROLLER); createPcduComponents(gpioComIF, &pwrSwitcher); createRadSensorComponent(gpioComIF); createSunSensorComponents(gpioComIF, spiMainComIF, pwrSwitcher, q7s::SPI_DEFAULT_DEV); diff --git a/fsfw b/fsfw index 1f05e6b2..60ff4117 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 1f05e6b297af8a6d310394e959c4d0cf13632831 +Subproject commit 60ff411721909bd6e4c34523a2248d8dca2507b1 diff --git a/mission/devices/GyroADIS1650XHandler.cpp b/mission/devices/GyroADIS1650XHandler.cpp index 5ff84a96..fe8d07c6 100644 --- a/mission/devices/GyroADIS1650XHandler.cpp +++ b/mission/devices/GyroADIS1650XHandler.cpp @@ -422,12 +422,12 @@ ReturnValue_t GyroADIS1650XHandler::spiSendCallback(SpiComIF *comIf, SpiCookie * cookie->setTransferSize(2); gpioId_t gpioId = cookie->getChipSelectPin(); - GpioIF *gpioIF = comIf->getGpioInterface(); + GpioIF& gpioIF = comIf->getGpioInterface(); MutexIF::TimeoutType timeoutType = MutexIF::TimeoutType::WAITING; uint32_t timeoutMs = 0; MutexIF *mutex = comIf->getCsMutex(); cookie->getMutexParams(timeoutType, timeoutMs); - if (mutex == nullptr or gpioIF == nullptr) { + if (mutex == nullptr) { #if OBSW_VERBOSE_LEVEL >= 1 sif::warning << "GyroADIS16507Handler::spiSendCallback: " "Mutex or GPIO interface invalid" @@ -453,7 +453,7 @@ ReturnValue_t GyroADIS1650XHandler::spiSendCallback(SpiComIF *comIf, SpiCookie * while (idx < sendLen) { // Pull SPI CS low. For now, no support for active high given if (gpioId != gpio::NO_GPIO) { - gpioIF->pullLow(gpioId); + gpioIF.pullLow(gpioId); } // Execute transfer @@ -468,7 +468,7 @@ ReturnValue_t GyroADIS1650XHandler::spiSendCallback(SpiComIF *comIf, SpiCookie * #endif /* FSFW_LINUX_SPI_WIRETAPPING == 1 */ if (gpioId != gpio::NO_GPIO) { - gpioIF->pullHigh(gpioId); + gpioIF.pullHigh(gpioId); } idx += 2; diff --git a/mission/devices/PayloadPcduHandler.cpp b/mission/devices/PayloadPcduHandler.cpp index d9e41c7f..725e05df 100644 --- a/mission/devices/PayloadPcduHandler.cpp +++ b/mission/devices/PayloadPcduHandler.cpp @@ -719,11 +719,11 @@ ReturnValue_t PayloadPcduHandler::transferAsTwo(SpiComIF* comIf, SpiCookie* cook cookie->setTransferSize(transferLen); gpioId_t gpioId = cookie->getChipSelectPin(); - GpioIF* gpioIF = comIf->getGpioInterface(); + GpioIF& gpioIF = comIf->getGpioInterface(); MutexIF::TimeoutType timeoutType = MutexIF::TimeoutType::WAITING; uint32_t timeoutMs = 0; MutexIF* mutex = comIf->getCsMutex(); - if (mutex == nullptr or gpioIF == nullptr) { + if (mutex == nullptr) { #if OBSW_VERBOSE_LEVEL >= 1 sif::warning << "GyroADIS16507Handler::spiSendCallback: " "Mutex or GPIO interface invalid" @@ -753,7 +753,7 @@ ReturnValue_t PayloadPcduHandler::transferAsTwo(SpiComIF* comIf, SpiCookie* cook transferStruct->len = transferLen; // Pull SPI CS low. For now, no support for active high given if (gpioId != gpio::NO_GPIO) { - gpioIF->pullLow(gpioId); + gpioIF.pullLow(gpioId); } // Execute transfer @@ -768,14 +768,14 @@ ReturnValue_t PayloadPcduHandler::transferAsTwo(SpiComIF* comIf, SpiCookie* cook #endif /* FSFW_LINUX_SPI_WIRETAPPING == 1 */ if (gpioId != gpio::NO_GPIO) { - gpioIF->pullHigh(gpioId); + gpioIF.pullHigh(gpioId); } transferStruct->tx_buf += transferLen; transferStruct->rx_buf += transferLen; transferStruct->len = plpcdu::TEMP_REPLY_SIZE - 1; if (gpioId != gpio::NO_GPIO) { - gpioIF->pullLow(gpioId); + gpioIF.pullLow(gpioId); } // Execute transfer @@ -790,7 +790,7 @@ ReturnValue_t PayloadPcduHandler::transferAsTwo(SpiComIF* comIf, SpiCookie* cook #endif /* FSFW_LINUX_SPI_WIRETAPPING == 1 */ if (gpioId != gpio::NO_GPIO) { - gpioIF->pullHigh(gpioId); + gpioIF.pullHigh(gpioId); } transferStruct->tx_buf = origTx; -- 2.43.0 From 451581e1aad98eb7ade70e32bb8c028baaf20437 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 26 Oct 2022 17:18:23 +0200 Subject: [PATCH 82/97] enable IP core components for both EM and FM --- CMakeLists.txt | 6 +++--- bsp_q7s/em/emObjectFactory.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a0287ef2..1d283085 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -99,13 +99,13 @@ set(OBSW_ADD_GPS_CTRL ${INIT_VAL} CACHE STRING "Add GPS controllers") set(OBSW_ADD_CCSDS_IP_CORES - ${INIT_VAL} + 1 CACHE STRING "Add CCSDS IP cores") set(OBSW_TM_TO_PTME - ${INIT_VAL} + 1 CACHE STRING "Send telemetry to PTME IP core") set(OBSW_TC_FROM_PDEC - ${INIT_VAL} + 1 CACHE STRING "Poll telecommand from PDEC IP core") set(OBSW_ADD_TCS_CTRL ${INIT_VAL} diff --git a/bsp_q7s/em/emObjectFactory.cpp b/bsp_q7s/em/emObjectFactory.cpp index 4fd6df50..13ae55d6 100644 --- a/bsp_q7s/em/emObjectFactory.cpp +++ b/bsp_q7s/em/emObjectFactory.cpp @@ -51,7 +51,7 @@ void ObjectFactory::produce(void* args) { // createPayloadComponents(gpioComIF); // createHeaterComponents(gpioComIF, pwrSwitcher, healthTable); - // TODO: Careful! Swichting this on somehow messes with the communication with the ProASIC + // TODO: Careful! Switching this on somehow messes with the communication with the ProASIC // and will cause xsc_boot_copy commands to always boot to 0 0 // createRadSensorComponent(gpioComIF); -- 2.43.0 From e86831fb4008c459c86175dcd937abc5e40e1cf2 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 26 Oct 2022 17:21:35 +0200 Subject: [PATCH 83/97] initialize value --- mission/devices/SolarArrayDeploymentHandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mission/devices/SolarArrayDeploymentHandler.cpp b/mission/devices/SolarArrayDeploymentHandler.cpp index 6a29ecd5..5656692d 100644 --- a/mission/devices/SolarArrayDeploymentHandler.cpp +++ b/mission/devices/SolarArrayDeploymentHandler.cpp @@ -151,7 +151,7 @@ bool SolarArrayDeploymentHandler::autonomousDeplForFile(sd::SdCard sdCard, const string line; string word; unsigned int lineNum = 0; - AutonomousDeplState deplState; + AutonomousDeplState deplState = AutonomousDeplState::INIT; bool stateSwitch = false; uint32_t secsSinceBoot = 0; while (std::getline(file, line)) { -- 2.43.0 From 2256ffecbe2020ef4e8e1c06eea390608fd721b1 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 26 Oct 2022 18:32:53 +0200 Subject: [PATCH 84/97] scex speed is now set from cfg --- common/config/devConf.h | 2 +- fsfw | 2 +- linux/devices/ScexUartReader.cpp | 5 +---- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/common/config/devConf.h b/common/config/devConf.h index 68a3e199..88e78e1e 100644 --- a/common/config/devConf.h +++ b/common/config/devConf.h @@ -55,7 +55,7 @@ namespace uart { static constexpr size_t HYPERION_GPS_REPLY_MAX_BUFFER = 1024; static constexpr UartBaudRate SYRLINKS_BAUD = UartBaudRate::RATE_38400; -static constexpr UartBaudRate SCEX_BAUD = UartBaudRate::RATE_57600; +static constexpr UartBaudRate SCEX_BAUD = UartBaudRate::RATE_38400; static constexpr UartBaudRate GNSS_BAUD = UartBaudRate::RATE_9600; static constexpr UartBaudRate PLOC_MPSOC_BAUD = UartBaudRate::RATE_115200; static constexpr UartBaudRate PLOC_SUPV_BAUD = UartBaudRate::RATE_115200; diff --git a/fsfw b/fsfw index 60ff4117..1b7e94d7 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 60ff411721909bd6e4c34523a2248d8dca2507b1 +Subproject commit 1b7e94d718ba8f526dd53324d33d0e577cbfc81b diff --git a/linux/devices/ScexUartReader.cpp b/linux/devices/ScexUartReader.cpp index 24461395..d128fa63 100644 --- a/linux/devices/ScexUartReader.cpp +++ b/linux/devices/ScexUartReader.cpp @@ -118,10 +118,7 @@ ReturnValue_t ScexUartReader::initializeInterface(CookieIF *cookie) { tty.c_cc[VTIME] = 0; tty.c_cc[VMIN] = 0; - // The SCEX experiment has a fixed baud rate. - if (cfsetispeed(&tty, B38400) != 0) { - sif::warning << "ScexUartReader::initializeInterface: Setting baud rate failed" << std::endl; - } + uart::setBaudrate(tty, uartCookie->getBaudrate()); if (tcsetattr(serialPort, TCSANOW, &tty) != 0) { sif::warning << "ScexUartReader::initializeInterface: tcsetattr call failed with error [" << errno << ", " << strerror(errno) << std::endl; -- 2.43.0 From e200e2d0dff18d258178d4fbad0c2f5c3bb39756 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 27 Oct 2022 08:28:43 +0200 Subject: [PATCH 85/97] remove boolean which does not exist anymore --- linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp index 6aa6f929..f0a1c2fb 100644 --- a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp @@ -492,7 +492,6 @@ ReturnValue_t pst::pstUart(FixedTimeslotTaskIF *thisSequence) { #endif #if OBSW_ADD_STAR_TRACKER == 1 - uartPstEmpty = false; thisSequence->addSlot(objects::STAR_TRACKER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); thisSequence->addSlot(objects::STAR_TRACKER, length * 0.2, DeviceHandlerIF::SEND_WRITE); thisSequence->addSlot(objects::STAR_TRACKER, length * 0.4, DeviceHandlerIF::GET_WRITE); -- 2.43.0 From 23238a1e5857be1c17f151c41a93e62bf6c97e63 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 27 Oct 2022 08:48:46 +0200 Subject: [PATCH 86/97] reenable core ctrl + minor fm fix --- bsp_q7s/core/InitMission.cpp | 2 +- bsp_q7s/fmObjectFactory.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/bsp_q7s/core/InitMission.cpp b/bsp_q7s/core/InitMission.cpp index ebbb4432..fb75964a 100644 --- a/bsp_q7s/core/InitMission.cpp +++ b/bsp_q7s/core/InitMission.cpp @@ -316,7 +316,7 @@ void initmission::initTasks() { pdecHandlerTask->startTask(); #endif /* OBSW_ADD_CCSDS_IP_CORES == 1 */ - // sysCtrlTask->startTask(); + sysCtrlTask->startTask(); #if OBSW_ADD_SA_DEPL == 1 solarArrayDeplTask->startTask(); #endif diff --git a/bsp_q7s/fmObjectFactory.cpp b/bsp_q7s/fmObjectFactory.cpp index 885f0def..57023c3c 100644 --- a/bsp_q7s/fmObjectFactory.cpp +++ b/bsp_q7s/fmObjectFactory.cpp @@ -37,6 +37,9 @@ void ObjectFactory::produce(void* args) { createAcsBoardComponents(gpioComIF, uartComIF, pwrSwitcher); #endif createHeaterComponents(gpioComIF, pwrSwitcher, healthTable); +#if OBSW_ADD_TMP_DEVICES == 1 + createTmpComponents(); +#endif createSolarArrayDeploymentComponents(*pwrSwitcher, *gpioComIF); createPlPcduComponents(gpioComIF, spiMainComIF, pwrSwitcher); #if OBSW_ADD_SYRLINKS == 1 -- 2.43.0 From 8dd1d81e0d22371e8e33262c55ccfe5b03612d59 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 27 Oct 2022 08:51:49 +0200 Subject: [PATCH 87/97] consistent dev names --- bsp_q7s/boardconfig/busConf.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/bsp_q7s/boardconfig/busConf.h b/bsp_q7s/boardconfig/busConf.h index 4ccdc78d..bbd91103 100644 --- a/bsp_q7s/boardconfig/busConf.h +++ b/bsp_q7s/boardconfig/busConf.h @@ -3,19 +3,19 @@ namespace q7s { -static constexpr char SPI_DEFAULT_DEV[] = "/dev/spi-main"; +static constexpr char SPI_DEFAULT_DEV[] = "/dev/spi_main"; static constexpr uint32_t SPI_MAIN_BUS_LOCK_TIMEOUT = 50; -static constexpr char SPI_RW_DEV[] = "/dev/spi-rw"; +static constexpr char SPI_RW_DEV[] = "/dev/spi_rw"; -static constexpr char I2C_DEFAULT_DEV[] = "/dev/i2c-eive"; +static constexpr char I2C_DEFAULT_DEV[] = "/dev/i2c_eive"; 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/ul-plsv"; -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/ttyS-SCEX"; +static constexpr char UART_PLOC_MPSOC_DEV[] = "/dev/ul_plmpsoc"; +static constexpr char UART_PLOC_SUPERVSIOR_DEV[] = "/dev/ul_plsv"; +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"; static constexpr char UIO_PDEC_REGISTERS[] = "/dev/uio0"; static constexpr char UIO_PTME[] = "/dev/uio1"; -- 2.43.0 From 921f4138884c71cf3b6459565e978adf8280d33d Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 27 Oct 2022 08:53:03 +0200 Subject: [PATCH 88/97] small bugfix --- linux/obc/PdecHandler.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/linux/obc/PdecHandler.cpp b/linux/obc/PdecHandler.cpp index c009d8a6..ebd17957 100644 --- a/linux/obc/PdecHandler.cpp +++ b/linux/obc/PdecHandler.cpp @@ -88,8 +88,7 @@ void PdecHandler::writePdecConfig() { // Configure all MAP IDs as invalid for (int idx = 0; idx <= MAX_MAP_ADDR; idx += 4) { - // TODO: adding 1 / 4 results in + 0. Check correctness - *(memoryBaseAddress + MAP_ADDR_LUT_OFFSET + idx + 1 / 4) = + *(memoryBaseAddress + MAP_ADDR_LUT_OFFSET + idx / 4) = NO_DESTINATION << 24 | NO_DESTINATION << 16 | NO_DESTINATION << 8 | NO_DESTINATION; } @@ -100,7 +99,6 @@ void PdecHandler::writePdecConfig() { // Write map id clock frequencies for (int idx = 0; idx <= MAX_MAP_ADDR; idx += 4) { - // TODO: adding 1 / 4 results in + 0. Check correctness *(memoryBaseAddress + MAP_CLK_FREQ_OFFSET + idx / 4) = MAP_CLK_FREQ << 24 | MAP_CLK_FREQ << 16 | MAP_CLK_FREQ << 8 | MAP_CLK_FREQ; } -- 2.43.0 From e1c0a451ee54c4979d9d749ac39052633915c5ab Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 27 Oct 2022 08:56:20 +0200 Subject: [PATCH 89/97] update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d2e94db..28b31e95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,10 @@ list yields a list of all related PRs for each release. # [unreleased] +# [v1.15.0] + +- Consistent device file naming + # [v1.14.1] - Various bugfixes and regression fixes -- 2.43.0 From 0f60c7f356ea8ed4ae7ea0f4cd3b0a268a05d591 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 27 Oct 2022 08:57:47 +0200 Subject: [PATCH 90/97] bump minor version --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1d283085..38a09a9a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,8 +10,8 @@ cmake_minimum_required(VERSION 3.13) set(OBSW_VERSION_MAJOR_IF_GIT_FAILS 1) -set(OBSW_VERSION_MINOR_IF_GIT_FAILS 14) -set(OBSW_VERSION_REVISION_IF_GIT_FAILS 1) +set(OBSW_VERSION_MINOR_IF_GIT_FAILS 15) +set(OBSW_VERSION_REVISION_IF_GIT_FAILS 0) # set(CMAKE_VERBOSE TRUE) -- 2.43.0 From ae16dcc4a7bd80532eb842047e6d54c3eda0d43a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 27 Oct 2022 09:00:21 +0200 Subject: [PATCH 91/97] afmt + changelog --- CHANGELOG.md | 3 +++ bsp_q7s/core/ObjectFactory.cpp | 4 ++-- mission/devices/GyroADIS1650XHandler.cpp | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 28b31e95..7c3ed689 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,9 @@ list yields a list of all related PRs for each release. # [v1.15.0] - Consistent device file naming +- Remove rad sensor from EM build, lead to weird bugs on EM which + prevented `xsc_boot_copy` from working properly +- CFDP closure handling is now working # [v1.14.1] diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 07f3fe9c..82d066c8 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -193,8 +193,8 @@ void ObjectFactory::createPcduComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchI ReturnValue_t ObjectFactory::createRadSensorComponent(LinuxLibgpioIF* gpioComIF) { using namespace gpio; - if(gpioComIF == nullptr) { - return returnvalue::FAILED; + if (gpioComIF == nullptr) { + return returnvalue::FAILED; } GpioCookie* gpioCookieRadSensor = new GpioCookie; std::stringstream consumer; diff --git a/mission/devices/GyroADIS1650XHandler.cpp b/mission/devices/GyroADIS1650XHandler.cpp index fe8d07c6..79e529b6 100644 --- a/mission/devices/GyroADIS1650XHandler.cpp +++ b/mission/devices/GyroADIS1650XHandler.cpp @@ -422,7 +422,7 @@ ReturnValue_t GyroADIS1650XHandler::spiSendCallback(SpiComIF *comIf, SpiCookie * cookie->setTransferSize(2); gpioId_t gpioId = cookie->getChipSelectPin(); - GpioIF& gpioIF = comIf->getGpioInterface(); + GpioIF &gpioIF = comIf->getGpioInterface(); MutexIF::TimeoutType timeoutType = MutexIF::TimeoutType::WAITING; uint32_t timeoutMs = 0; MutexIF *mutex = comIf->getCsMutex(); -- 2.43.0 From 35f986986148b748f42ad8b48046bd6fc2e20e9e Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 27 Oct 2022 09:01:09 +0200 Subject: [PATCH 92/97] tab replacements --- bsp_q7s/OBSWConfig.h.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bsp_q7s/OBSWConfig.h.in b/bsp_q7s/OBSWConfig.h.in index 76173c1b..c0c713a9 100644 --- a/bsp_q7s/OBSWConfig.h.in +++ b/bsp_q7s/OBSWConfig.h.in @@ -28,9 +28,9 @@ #define OBSW_ADD_TCS_CTRL @OBSW_ADD_TCS_CTRL@ #define OBSW_ADD_RW @OBSW_ADD_RW@ #define OBSW_ADD_RTD_DEVICES @OBSW_ADD_RTD_DEVICES@ -#define OBSW_ADD_SA_DEPL @OBSW_ADD_SA_DEPL@ +#define OBSW_ADD_SA_DEPL @OBSW_ADD_SA_DEPL@ #define OBSW_ADD_SCEX_DEVICE @OBSW_ADD_SCEX_DEVICE@ -#define OBSW_ADD_HEATERS @OBSW_ADD_HEATERS@ +#define OBSW_ADD_HEATERS @OBSW_ADD_HEATERS@ #define OBSW_ADD_TMP_DEVICES @OBSW_ADD_TMP_DEVICES@ #define OBSW_ADD_RAD_SENSORS @OBSW_ADD_RAD_SENSORS@ #define OBSW_ADD_PL_PCDU @OBSW_ADD_PL_PCDU@ -- 2.43.0 From b059e831c006d25501c2a92862e293bf0a4b6715 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 27 Oct 2022 09:02:55 +0200 Subject: [PATCH 93/97] complete changelog --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c3ed689..1ace22e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,13 @@ list yields a list of all related PRs for each release. - Remove rad sensor from EM build, lead to weird bugs on EM which prevented `xsc_boot_copy` from working properly - CFDP closure handling is now working + PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/307 +- Safety mechanism for SD card handling on graceful reboots + PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/308 +- Solar Array Deployment handler update + PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/305 +- IMTQ updates as preparation for ACS controller expansion + PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/306 # [v1.14.1] -- 2.43.0 From cd1eb02f02f9f288b692f599f115a273fac28235 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 27 Oct 2022 09:03:39 +0200 Subject: [PATCH 94/97] re-run generators --- generators/bsp_q7s_events.csv | 16 +- generators/bsp_q7s_returnvalues.csv | 667 +++++++++--------- generators/events/translateEvents.cpp | 2 +- generators/objects/translateObjects.cpp | 2 +- linux/fsfwconfig/events/translateEvents.cpp | 2 +- linux/fsfwconfig/objects/translateObjects.cpp | 2 +- tmtc | 2 +- 7 files changed, 347 insertions(+), 346 deletions(-) diff --git a/generators/bsp_q7s_events.csv b/generators/bsp_q7s_events.csv index 8a69c7a0..b3f2fc73 100644 --- a/generators/bsp_q7s_events.csv +++ b/generators/bsp_q7s_events.csv @@ -110,14 +110,14 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 11604;0x2d54;MPSOC_HANDLER_CRC_FAILURE;LOW;PLOC reply has invalid crc;linux/devices/ploc/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/devices/ploc/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/devices/ploc/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/devices/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/devices/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/devices/IMTQHandler.h -11704;0x2db8;SELF_TEST_PWM_FAILURE;LOW;Get self test result returns PWM failure which concerns the coil actuation. 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/devices/IMTQHandler.h -11705;0x2db9;SELF_TEST_TC_FAILURE;LOW;Get self test result returns TC failure (system 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/devices/IMTQHandler.h -11706;0x2dba;SELF_TEST_MTM_RANGE_FAILURE;LOW;Get self test result returns failure that MTM values were outside of the expected range. 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/devices/IMTQHandler.h -11707;0x2dbb;SELF_TEST_COIL_CURRENT_FAILURE;LOW;Get self test result returns failure indicating that the coil current was outside of the expected range 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/devices/IMTQHandler.h -11708;0x2dbc;INVALID_ERROR_BYTE;LOW;Received invalid error byte. This indicates an error of the communication link between IMTQ and OBC.;mission/devices/IMTQHandler.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/devices/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/devices/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/devices/ImtqHandler.h +11704;0x2db8;SELF_TEST_PWM_FAILURE;LOW;Get self test result returns PWM failure which concerns the coil actuation. 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/devices/ImtqHandler.h +11705;0x2db9;SELF_TEST_TC_FAILURE;LOW;Get self test result returns TC failure (system 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/devices/ImtqHandler.h +11706;0x2dba;SELF_TEST_MTM_RANGE_FAILURE;LOW;Get self test result returns failure that MTM values were outside of the expected range. 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/devices/ImtqHandler.h +11707;0x2dbb;SELF_TEST_COIL_CURRENT_FAILURE;LOW;Get self test result returns failure indicating that the coil current was outside of the expected range 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/devices/ImtqHandler.h +11708;0x2dbc;INVALID_ERROR_BYTE;LOW;Received invalid error byte. This indicates an error of the communication link between IMTQ and OBC.;mission/devices/ImtqHandler.h 11801;0x2e19;ERROR_STATE;HIGH;Reaction wheel signals an error state;mission/devices/devicedefinitions/RwDefinitions.h 11802;0x2e1a;RESET_OCCURED;LOW;;mission/devices/devicedefinitions/RwDefinitions.h 11901;0x2e7d;BOOTING_FIRMWARE_FAILED;LOW;Failed to boot firmware;linux/devices/startracker/StarTrackerHandler.h diff --git a/generators/bsp_q7s_returnvalues.csv b/generators/bsp_q7s_returnvalues.csv index 7fccee95..fe4c5cfc 100644 --- a/generators/bsp_q7s_returnvalues.csv +++ b/generators/bsp_q7s_returnvalues.csv @@ -1,14 +1,13 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x0000;OK;System-wide code for ok.;0;HasReturnvaluesIF;fsfw/returnvalues/returnvalue.h 0x0001;Failed;Unspecified system-wide code for failed.;1;HasReturnvaluesIF;fsfw/returnvalues/returnvalue.h -0x63a0;NVMB_KeyNotExists;Specified key does not exist in json file;160;NVM_PARAM_BASE;mission/memory/NVMParameterBase.h -0x58a0;SUSS_ErrorUnlockMutex;;160;SUS_HANDLER;mission/devices/SusHandler.h -0x58a1;SUSS_ErrorLockMutex;;161;SUS_HANDLER;mission/devices/SusHandler.h -0x66a0;SADPL_CommandNotSupported;;160;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h -0x66a1;SADPL_DeploymentAlreadyExecuting;;161;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h -0x66a2;SADPL_MainSwitchTimeoutFailure;;162;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h -0x66a3;SADPL_SwitchingDeplSa1Failed;;163;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h -0x66a4;SADPL_SwitchingDeplSa2Failed;;164;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h +0x60a0;CCSDS_CommandNotImplemented;Received action message with unknown action id;160;CCSDS_HANDLER;mission/tmtc/CCSDSHandler.h +0x5d00;GOMS_PacketTooLong;;0;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h +0x5d01;GOMS_InvalidTableId;;1;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h +0x5d02;GOMS_InvalidAddress;;2;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h +0x5d03;GOMS_InvalidParamSize;;3;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h +0x5d04;GOMS_InvalidPayloadSize;;4;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h +0x5d05;GOMS_UnknownReplyId;;5;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h 0x52b0;RWHA_SpiWriteFailure;;176;RW_HANDLER;mission/devices/RwHandler.h 0x52b1;RWHA_SpiReadFailure;Used by the spi send function to tell a failing read call;177;RW_HANDLER;mission/devices/RwHandler.h 0x52b2;RWHA_MissingStartSign;Can be used by the HDLC decoding mechanism to inform about a missing start sign 0x7E;178;RW_HANDLER;mission/devices/RwHandler.h @@ -21,20 +20,21 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x52a2;RWHA_SetSpeedCommandInvalidLength;Received set speed command has invalid length. Should be 6.;162;RW_HANDLER;mission/devices/RwHandler.h 0x52a3;RWHA_ExecutionFailed;Command execution failed;163;RW_HANDLER;mission/devices/RwHandler.h 0x52a4;RWHA_CrcError;Reaction wheel reply has invalid crc;164;RW_HANDLER;mission/devices/RwHandler.h -0x5d00;GOMS_PacketTooLong;;0;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h -0x5d01;GOMS_InvalidTableId;;1;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h -0x5d02;GOMS_InvalidAddress;;2;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h -0x5d03;GOMS_InvalidParamSize;;3;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h -0x5d04;GOMS_InvalidPayloadSize;;4;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h -0x5d05;GOMS_UnknownReplyId;;5;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h -0x51a0;IMTQ_InvalidCommandCode;;160;IMTQ_HANDLER;mission/devices/IMTQHandler.h -0x51a1;IMTQ_ParameterMissing;;161;IMTQ_HANDLER;mission/devices/IMTQHandler.h -0x51a2;IMTQ_ParameterInvalid;;162;IMTQ_HANDLER;mission/devices/IMTQHandler.h -0x51a3;IMTQ_CcUnavailable;;163;IMTQ_HANDLER;mission/devices/IMTQHandler.h -0x51a4;IMTQ_InternalProcessingError;;164;IMTQ_HANDLER;mission/devices/IMTQHandler.h -0x51a5;IMTQ_RejectedWithoutReason;;165;IMTQ_HANDLER;mission/devices/IMTQHandler.h -0x51a6;IMTQ_CmdErrUnknown;;166;IMTQ_HANDLER;mission/devices/IMTQHandler.h -0x51a7;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.;167;IMTQ_HANDLER;mission/devices/IMTQHandler.h +0x4fa1;HEATER_CommandNotSupported;;161;HEATER_HANDLER;mission/devices/HeaterHandler.h +0x4fa2;HEATER_InitFailed;;162;HEATER_HANDLER;mission/devices/HeaterHandler.h +0x4fa3;HEATER_InvalidSwitchNr;;163;HEATER_HANDLER;mission/devices/HeaterHandler.h +0x4fa4;HEATER_MainSwitchSetTimeout;;164;HEATER_HANDLER;mission/devices/HeaterHandler.h +0x4fa5;HEATER_CommandAlreadyWaiting;;165;HEATER_HANDLER;mission/devices/HeaterHandler.h +0x58a0;SUSS_ErrorUnlockMutex;;160;SUS_HANDLER;mission/devices/SusHandler.h +0x58a1;SUSS_ErrorLockMutex;;161;SUS_HANDLER;mission/devices/SusHandler.h +0x51a0;IMTQ_InvalidCommandCode;;160;IMTQ_HANDLER;mission/devices/ImtqHandler.h +0x51a1;IMTQ_ParameterMissing;;161;IMTQ_HANDLER;mission/devices/ImtqHandler.h +0x51a2;IMTQ_ParameterInvalid;;162;IMTQ_HANDLER;mission/devices/ImtqHandler.h +0x51a3;IMTQ_CcUnavailable;;163;IMTQ_HANDLER;mission/devices/ImtqHandler.h +0x51a4;IMTQ_InternalProcessingError;;164;IMTQ_HANDLER;mission/devices/ImtqHandler.h +0x51a5;IMTQ_RejectedWithoutReason;;165;IMTQ_HANDLER;mission/devices/ImtqHandler.h +0x51a6;IMTQ_CmdErrUnknown;;166;IMTQ_HANDLER;mission/devices/ImtqHandler.h +0x51a7;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.;167;IMTQ_HANDLER;mission/devices/ImtqHandler.h 0x50a0;SYRLINKS_CrcFailure;;160;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h 0x50a1;SYRLINKS_UartFraminOrParityErrorAck;;161;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h 0x50a2;SYRLINKS_BadCharacterAck;;162;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h @@ -44,115 +44,130 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x50a6;SYRLINKS_BadCrcAck;;166;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h 0x50a7;SYRLINKS_ReplyWrongSize;;167;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h 0x50a8;SYRLINKS_MissingStartFrameCharacter;;168;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h -0x4fa1;HEATER_CommandNotSupported;;161;HEATER_HANDLER;mission/devices/HeaterHandler.h -0x4fa2;HEATER_InitFailed;;162;HEATER_HANDLER;mission/devices/HeaterHandler.h -0x4fa3;HEATER_InvalidSwitchNr;;163;HEATER_HANDLER;mission/devices/HeaterHandler.h -0x4fa4;HEATER_MainSwitchSetTimeout;;164;HEATER_HANDLER;mission/devices/HeaterHandler.h -0x4fa5;HEATER_CommandAlreadyWaiting;;165;HEATER_HANDLER;mission/devices/HeaterHandler.h -0x60a0;CCSDS_CommandNotImplemented;Received action message with unknown action id;160;CCSDS_HANDLER;mission/tmtc/CCSDSHandler.h -0x4500;HSPI_OpeningFileFailed;;0;HAL_SPI;fsfw/src/fsfw_hal/linux/spi/SpiComIF.h -0x4501;HSPI_FullDuplexTransferFailed;;1;HAL_SPI;fsfw/src/fsfw_hal/linux/spi/SpiComIF.h -0x4502;HSPI_HalfDuplexTransferFailed;;2;HAL_SPI;fsfw/src/fsfw_hal/linux/spi/SpiComIF.h -0x4801;HGIO_UnknownGpioId;;1;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4802;HGIO_DriveGpioFailure;;2;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4803;HGIO_GpioTypeFailure;;3;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4804;HGIO_GpioInvalidInstance;;4;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4805;HGIO_GpioDuplicateDetected;;5;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4806;HGIO_GpioInitFailed;;6;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4807;HGIO_GpioGetValueFailed;;7;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4601;HURT_UartReadFailure;;1;HAL_UART;fsfw/src/fsfw_hal/linux/uart/UartComIF.h -0x4602;HURT_UartReadSizeMissmatch;;2;HAL_UART;fsfw/src/fsfw_hal/linux/uart/UartComIF.h -0x4603;HURT_UartRxBufferTooSmall;;3;HAL_UART;fsfw/src/fsfw_hal/linux/uart/UartComIF.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;;6;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h -0x2801;SM_DataTooLarge;;1;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h -0x2802;SM_DataStorageFull;;2;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h -0x2803;SM_IllegalStorageId;;3;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h -0x2804;SM_DataDoesNotExist;;4;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h -0x2805;SM_IllegalAddress;;5;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h -0x2806;SM_PoolTooLarge;;6;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h -0x0601;PP_DoItMyself;;1;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x0602;PP_PointsToVariable;;2;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x0603;PP_PointsToMemory;;3;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x0604;PP_ActivityCompleted;;4;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x0605;PP_PointsToVectorUint8;;5;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x0606;PP_PointsToVectorUint16;;6;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x0607;PP_PointsToVectorUint32;;7;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x0608;PP_PointsToVectorFloat;;8;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x06a0;PP_DumpNotSupported;;160;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x06e0;PP_InvalidSize;;224;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x06e1;PP_InvalidAddress;;225;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x06e2;PP_InvalidContent;;226;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x06e3;PP_UnalignedAccess;;227;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x06e4;PP_WriteProtected;;228;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x13e0;MH_UnknownCmd;;224;MEMORY_HELPER;fsfw/src/fsfw/memory/MemoryHelper.h -0x13e1;MH_InvalidAddress;;225;MEMORY_HELPER;fsfw/src/fsfw/memory/MemoryHelper.h -0x13e2;MH_InvalidSize;;226;MEMORY_HELPER;fsfw/src/fsfw/memory/MemoryHelper.h -0x13e3;MH_StateMismatch;;227;MEMORY_HELPER;fsfw/src/fsfw/memory/MemoryHelper.h -0x38a1;SGP4_InvalidEccentricity;;161;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h -0x38a2;SGP4_InvalidMeanMotion;;162;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h -0x38a3;SGP4_InvalidPerturbationElements;;163;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h -0x38a4;SGP4_InvalidSemiLatusRectum;;164;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h -0x38a5;SGP4_InvalidEpochElements;;165;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h -0x38a6;SGP4_SatelliteHasDecayed;;166;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h -0x38b1;SGP4_TleTooOld;;177;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h -0x38b2;SGP4_TleNotInitialized;;178;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h -0x1101;AL_Full;;1;ARRAY_LIST;fsfw/src/fsfw/container/ArrayList.h -0x1501;FM_KeyAlreadyExists;;1;FIXED_MAP;fsfw/src/fsfw/container/FixedMap.h -0x1502;FM_MapFull;;2;FIXED_MAP;fsfw/src/fsfw/container/FixedMap.h -0x1503;FM_KeyDoesNotExist;;3;FIXED_MAP;fsfw/src/fsfw/container/FixedMap.h -0x1801;FF_Full;;1;FIFO_CLASS;fsfw/src/fsfw/container/FIFOBase.h -0x1802;FF_Empty;;2;FIFO_CLASS;fsfw/src/fsfw/container/FIFOBase.h -0x1601;FMM_MapFull;;1;FIXED_MULTIMAP;fsfw/src/fsfw/container/FixedOrderedMultimap.h -0x1602;FMM_KeyDoesNotExist;;2;FIXED_MULTIMAP;fsfw/src/fsfw/container/FixedOrderedMultimap.h -0x3901;MUX_NotEnoughResources;;1;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3902;MUX_InsufficientMemory;;2;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3903;MUX_NoPrivilege;;3;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3904;MUX_WrongAttributeSetting;;4;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3905;MUX_MutexAlreadyLocked;;5;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3906;MUX_MutexNotFound;;6;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3907;MUX_MutexMaxLocks;;7;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3908;MUX_CurrThreadAlreadyOwnsMutex;;8;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3909;MUX_CurrThreadDoesNotOwnMutex;;9;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x390a;MUX_MutexTimeout;;10;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x390b;MUX_MutexInvalidId;;11;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x390c;MUX_MutexDestroyedWhileWaiting;;12;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3a01;MQI_Empty;;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 -0x0f01;CM_UnknownCommand;;1;COMMAND_MESSAGE;fsfw/src/fsfw/ipc/CommandMessageIF.h +0x66a0;SADPL_CommandNotSupported;;160;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h +0x66a1;SADPL_DeploymentAlreadyExecuting;;161;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h +0x66a2;SADPL_MainSwitchTimeoutFailure;;162;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h +0x66a3;SADPL_SwitchingDeplSa1Failed;;163;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h +0x66a4;SADPL_SwitchingDeplSa2Failed;;164;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h +0x63a0;NVMB_KeyNotExists;Specified key does not exist in json file;160;NVM_PARAM_BASE;mission/memory/NVMParameterBase.h +0x2c01;CCS_BcIsSetVrCommand;;1;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2c02;CCS_BcIsUnlockCommand;;2;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cb0;CCS_BcIllegalCommand;;176;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cb1;CCS_BoardReadingNotFinished;;177;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cf0;CCS_NsPositiveW;;240;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cf1;CCS_NsNegativeW;;241;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cf2;CCS_NsLockout;;242;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cf3;CCS_FarmInLockout;;243;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cf4;CCS_FarmInWait;;244;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce0;CCS_WrongSymbol;;224;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce1;CCS_DoubleStart;;225;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce2;CCS_StartSymbolMissed;;226;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce3;CCS_EndWithoutStart;;227;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce4;CCS_TooLarge;;228;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce5;CCS_TooShort;;229;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce6;CCS_WrongTfVersion;;230;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce7;CCS_WrongSpacecraftId;;231;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce8;CCS_NoValidFrameType;;232;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce9;CCS_CrcFailed;;233;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cea;CCS_VcNotFound;;234;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ceb;CCS_ForwardingFailed;;235;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cec;CCS_ContentTooLarge;;236;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ced;CCS_ResidualData;;237;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cee;CCS_DataCorrupted;;238;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cef;CCS_IllegalSegmentationFlag;;239;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cd0;CCS_IllegalFlagCombination;;208;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cd1;CCS_ShorterThanHeader;;209;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cd2;CCS_TooShortBlockedPacket;;210;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cd3;CCS_TooShortMapExtraction;;211;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x3b00;SPH_ConnBroken;;0;SEMAPHORE_IF;fsfw/src/fsfw/osal/common/TcpTmTcServer.h +0x2a01;IEC_NoConfigurationTable;;1;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a02;IEC_NoCpuTable;;2;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a03;IEC_InvalidWorkspaceAddress;;3;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a04;IEC_TooLittleWorkspace;;4;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a05;IEC_WorkspaceAllocation;;5;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a06;IEC_InterruptStackTooSmall;;6;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a07;IEC_ThreadExitted;;7;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a08;IEC_InconsistentMpInformation;;8;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a09;IEC_InvalidNode;;9;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a0a;IEC_NoMpci;;10;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a0b;IEC_BadPacket;;11;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a0c;IEC_OutOfPackets;;12;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a0d;IEC_OutOfGlobalObjects;;13;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a0e;IEC_OutOfProxies;;14;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a0f;IEC_InvalidGlobalId;;15;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a10;IEC_BadStackHook;;16;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a11;IEC_BadAttributes;;17;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a12;IEC_ImplementationKeyCreateInconsistency;;18;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a13;IEC_ImplementationBlockingOperationCancel;;19;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a14;IEC_MutexObtainFromBadState;;20;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a15;IEC_UnlimitedAndMaximumIs0;;21;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h 0x0e01;HM_InvalidMode;;1;HAS_MODES_IF;fsfw/src/fsfw/modes/HasModesIF.h 0x0e02;HM_TransNotAllowed;;2;HAS_MODES_IF;fsfw/src/fsfw/modes/HasModesIF.h 0x0e03;HM_InTransition;;3;HAS_MODES_IF;fsfw/src/fsfw/modes/HasModesIF.h 0x0e04;HM_InvalidSubmode;;4;HAS_MODES_IF;fsfw/src/fsfw/modes/HasModesIF.h -0x0c02;MS_InvalidEntry;;2;MODE_STORE_IF;fsfw/src/fsfw/subsystem/modes/ModeStoreIF.h -0x0c03;MS_TooManyElements;;3;MODE_STORE_IF;fsfw/src/fsfw/subsystem/modes/ModeStoreIF.h -0x0c04;MS_CantStoreEmpty;;4;MODE_STORE_IF;fsfw/src/fsfw/subsystem/modes/ModeStoreIF.h -0x0b01;SB_ChildNotFound;;1;SUBSYSTEM_BASE;fsfw/src/fsfw/subsystem/SubsystemBase.h -0x0b02;SB_ChildInfoUpdated;;2;SUBSYSTEM_BASE;fsfw/src/fsfw/subsystem/SubsystemBase.h -0x0b03;SB_ChildDoesntHaveModes;;3;SUBSYSTEM_BASE;fsfw/src/fsfw/subsystem/SubsystemBase.h -0x0b04;SB_CouldNotInsertChild;;4;SUBSYSTEM_BASE;fsfw/src/fsfw/subsystem/SubsystemBase.h -0x0b05;SB_TableContainsInvalidObjectId;;5;SUBSYSTEM_BASE;fsfw/src/fsfw/subsystem/SubsystemBase.h -0x0d01;SS_SequenceAlreadyExists;;1;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0d02;SS_TableAlreadyExists;;2;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0d03;SS_TableDoesNotExist;;3;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0d04;SS_TableOrSequenceLengthInvalid;;4;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0d05;SS_SequenceDoesNotExist;;5;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0d06;SS_TableContainsInvalidObjectId;;6;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0d07;SS_FallbackSequenceDoesNotExist;;7;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0d08;SS_NoTargetTable;;8;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0d09;SS_SequenceOrTableTooLong;;9;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0d0b;SS_IsFallbackSequence;;11;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0d0c;SS_AccessDenied;;12;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0d0e;SS_TableInUse;;14;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0da1;SS_TargetTableNotReached;;161;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0da2;SS_TableCheckFailed;;162;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x2501;EV_ListenerNotFound;;1;EVENT_MANAGER_IF;fsfw/src/fsfw/events/EventManagerIF.h +0x2e01;HPA_InvalidIdentifierId;;1;HAS_PARAMETERS_IF;fsfw/src/fsfw/parameters/HasParametersIF.h +0x2e02;HPA_InvalidDomainId;;2;HAS_PARAMETERS_IF;fsfw/src/fsfw/parameters/HasParametersIF.h +0x2e03;HPA_InvalidValue;;3;HAS_PARAMETERS_IF;fsfw/src/fsfw/parameters/HasParametersIF.h +0x2e05;HPA_ReadOnly;;5;HAS_PARAMETERS_IF;fsfw/src/fsfw/parameters/HasParametersIF.h +0x2d01;PAW_UnknownDatatype;;1;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h +0x2d02;PAW_DatatypeMissmatch;;2;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h +0x2d03;PAW_Readonly;;3;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h +0x2d04;PAW_TooBig;;4;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h +0x2d05;PAW_SourceNotSet;;5;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h +0x2d06;PAW_OutOfBounds;;6;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h +0x2d07;PAW_NotSet;;7;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h +0x2d08;PAW_ColumnOrRowsZero;;8;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h +0x3201;CF_ObjectHasNoFunctions;;1;COMMANDS_ACTIONS_IF;fsfw/src/fsfw/action/CommandsActionsIF.h +0x3202;CF_AlreadyCommanding;;2;COMMANDS_ACTIONS_IF;fsfw/src/fsfw/action/CommandsActionsIF.h +0x3301;HF_IsBusy;;1;HAS_ACTIONS_IF;fsfw/src/fsfw/action/HasActionsIF.h +0x3302;HF_InvalidParameters;;2;HAS_ACTIONS_IF;fsfw/src/fsfw/action/HasActionsIF.h +0x3303;HF_ExecutionFinished;;3;HAS_ACTIONS_IF;fsfw/src/fsfw/action/HasActionsIF.h +0x3304;HF_InvalidActionId;;4;HAS_ACTIONS_IF;fsfw/src/fsfw/action/HasActionsIF.h +0x0201;OM_InsertionFailed;;1;OBJECT_MANAGER_IF;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h +0x0202;OM_NotFound;;2;OBJECT_MANAGER_IF;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h +0x0203;OM_ChildInitFailed;;3;OBJECT_MANAGER_IF;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h +0x0204;OM_InternalErrReporterUninit;;4;OBJECT_MANAGER_IF;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h +0x2600;FDI_YourFault;;0;HANDLES_FAILURES_IF;fsfw/src/fsfw/fdir/ConfirmsFailuresIF.h +0x2601;FDI_MyFault;;1;HANDLES_FAILURES_IF;fsfw/src/fsfw/fdir/ConfirmsFailuresIF.h +0x2602;FDI_ConfirmLater;;2;HANDLES_FAILURES_IF;fsfw/src/fsfw/fdir/ConfirmsFailuresIF.h +0x2201;TMF_Busy;;1;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h +0x2202;TMF_LastPacketFound;;2;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h +0x2203;TMF_StopFetch;;3;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h +0x2204;TMF_Timeout;;4;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h +0x2205;TMF_TmChannelFull;;5;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h +0x2206;TMF_NotStored;;6;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h +0x2207;TMF_AllDeleted;;7;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h +0x2208;TMF_InvalidData;;8;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h +0x2209;TMF_NotReady;;9;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h +0x2101;TMB_Busy;;1;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x2102;TMB_Full;;2;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x2103;TMB_Empty;;3;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x2104;TMB_NullRequested;;4;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x2105;TMB_TooLarge;;5;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x2106;TMB_NotReady;;6;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x2107;TMB_DumpError;;7;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x2108;TMB_CrcError;;8;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x2109;TMB_Timeout;;9;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x210a;TMB_IdlePacketFound;;10;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x210b;TMB_TelecommandFound;;11;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x210c;TMB_NoPusATm;;12;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x210d;TMB_TooSmall;;13;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x210e;TMB_BlockNotFound;;14;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x210f;TMB_InvalidRequest;;15;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x1c01;TCD_PacketLost;;1;PACKET_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/TcDistributorBase.h +0x1c02;TCD_DestinationNotFound;;2;PACKET_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/TcDistributorBase.h +0x1c03;TCD_ServiceIdAlreadyExists;;3;PACKET_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/TcDistributorBase.h +0x1b00;TCC_NoDestinationFound;;0;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h +0x1b01;TCC_InvalidCcsdsVersion;;1;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h +0x1b02;TCC_InvalidApid;;2;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h +0x1b03;TCC_InvalidPacketType;;3;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h +0x1b04;TCC_InvalidSecHeaderField;;4;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h +0x1b05;TCC_IncorrectPrimaryHeader;;5;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h +0x1b07;TCC_IncompletePacket;;7;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h +0x1b08;TCC_InvalidPusVersion;;8;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h +0x1b09;TCC_IncorrectChecksum;;9;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h +0x1b0a;TCC_IllegalPacketSubtype;;10;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h +0x1b0b;TCC_IncorrectSecondaryHeader;;11;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h 0x04e1;RMP_CommandNoDescriptorsAvailable;;225;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h 0x04e2;RMP_CommandBufferFull;;226;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h 0x04e3;RMP_CommandChannelOutOfRange;;227;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h @@ -193,9 +208,95 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x040a;RMP_ReplyCommandNotImplementedOrNotAuthorised;;10;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h 0x040b;RMP_ReplyRmwDataLengthError;;11;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h 0x040c;RMP_ReplyInvalidTargetLogicalAddress;;12;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h -0x1401;SE_BufferTooShort;;1;SERIALIZE_IF;fsfw/src/fsfw/serialize/SerializeIF.h -0x1402;SE_StreamTooShort;;2;SERIALIZE_IF;fsfw/src/fsfw/serialize/SerializeIF.h -0x1403;SE_TooManyElements;;3;SERIALIZE_IF;fsfw/src/fsfw/serialize/SerializeIF.h +0x2801;SM_DataTooLarge;;1;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h +0x2802;SM_DataStorageFull;;2;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h +0x2803;SM_IllegalStorageId;;3;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h +0x2804;SM_DataDoesNotExist;;4;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h +0x2805;SM_IllegalAddress;;5;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h +0x2806;SM_PoolTooLarge;;6;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h +0x38a1;SGP4_InvalidEccentricity;;161;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x38a2;SGP4_InvalidMeanMotion;;162;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x38a3;SGP4_InvalidPerturbationElements;;163;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x38a4;SGP4_InvalidSemiLatusRectum;;164;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x38a5;SGP4_InvalidEpochElements;;165;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x38a6;SGP4_SatelliteHasDecayed;;166;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x38b1;SGP4_TleTooOld;;177;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x38b2;SGP4_TleNotInitialized;;178;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x2401;MT_NoPacketFound;;1;MATCH_TREE_CLASS;fsfw/src/fsfw/globalfunctions/DleParser.h +0x2402;MT_PossiblePacketLoss;;2;MATCH_TREE_CLASS;fsfw/src/fsfw/globalfunctions/DleParser.h +0x2403;MT_NoMatch;;3;MATCH_TREE_CLASS;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h +0x2404;MT_Full;;4;MATCH_TREE_CLASS;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h +0x2405;MT_NewNodeCreated;;5;MATCH_TREE_CLASS;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h +0x3f01;DLEE_StreamTooShort;;1;DLE_ENCODER;fsfw/src/fsfw/globalfunctions/DleEncoder.h +0x3f02;DLEE_DecodingError;;2;DLE_ENCODER;fsfw/src/fsfw/globalfunctions/DleEncoder.h +0x2f01;ASC_TooLongForTargetType;;1;ASCII_CONVERTER;fsfw/src/fsfw/globalfunctions/AsciiConverter.h +0x2f02;ASC_InvalidCharacters;;2;ASCII_CONVERTER;fsfw/src/fsfw/globalfunctions/AsciiConverter.h +0x2f03;ASC_BufferTooSmall;;3;ASCII_CONVERTER;fsfw/src/fsfw/globalfunctions/AsciiConverter.h +0x0f01;CM_UnknownCommand;;1;COMMAND_MESSAGE;fsfw/src/fsfw/ipc/CommandMessageIF.h +0x3a01;MQI_Empty;;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 +0x3901;MUX_NotEnoughResources;;1;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3902;MUX_InsufficientMemory;;2;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3903;MUX_NoPrivilege;;3;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3904;MUX_WrongAttributeSetting;;4;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3905;MUX_MutexAlreadyLocked;;5;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3906;MUX_MutexNotFound;;6;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3907;MUX_MutexMaxLocks;;7;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3908;MUX_CurrThreadAlreadyOwnsMutex;;8;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3909;MUX_CurrThreadDoesNotOwnMutex;;9;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x390a;MUX_MutexTimeout;;10;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x390b;MUX_MutexInvalidId;;11;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x390c;MUX_MutexDestroyedWhileWaiting;;12;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3b01;SPH_SemaphoreTimeout;;1;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h +0x3b02;SPH_SemaphoreNotOwned;;2;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h +0x3b03;SPH_SemaphoreInvalid;;3;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h +0x1e00;PUS_InvalidPusVersion;;0;PUS_IF;fsfw/src/fsfw/tmtcpacket/pus/PusIF.h +0x1e01;PUS_InvalidCrc16;;1;PUS_IF;fsfw/src/fsfw/tmtcpacket/pus/PusIF.h +0x3601;CFDP_InvalidTlvType;;1;CFDP;fsfw/src/fsfw/cfdp/definitions.h +0x3602;CFDP_InvalidDirectiveField;;2;CFDP;fsfw/src/fsfw/cfdp/definitions.h +0x3603;CFDP_InvalidPduDatafieldLen;;3;CFDP;fsfw/src/fsfw/cfdp/definitions.h +0x3604;CFDP_InvalidAckDirectiveFields;;4;CFDP;fsfw/src/fsfw/cfdp/definitions.h +0x3605;CFDP_MetadataCantParseOptions;;5;CFDP;fsfw/src/fsfw/cfdp/definitions.h +0x3606;CFDP_NakCantParseOptions;;6;CFDP;fsfw/src/fsfw/cfdp/definitions.h +0x3607;CFDP_FinishedCantParseFsResponses;;7;CFDP;fsfw/src/fsfw/cfdp/definitions.h +0x3608;CFDP_FilestoreRequiresSecondFile;;8;CFDP;fsfw/src/fsfw/cfdp/definitions.h +0x3609;CFDP_FilestoreResponseCantParseFsMessage;;9;CFDP;fsfw/src/fsfw/cfdp/definitions.h +0x360a;CFDP_InvalidPduFormat;;10;CFDP;fsfw/src/fsfw/cfdp/definitions.h +0x2901;TC_InvalidTargetState;;1;THERMAL_COMPONENT_IF;fsfw/src/fsfw/thermal/ThermalComponentIF.h +0x29f1;TC_AboveOperationalLimit;;241;THERMAL_COMPONENT_IF;fsfw/src/fsfw/thermal/ThermalComponentIF.h +0x29f2;TC_BelowOperationalLimit;;242;THERMAL_COMPONENT_IF;fsfw/src/fsfw/thermal/ThermalComponentIF.h +0x0c02;MS_InvalidEntry;;2;MODE_STORE_IF;fsfw/src/fsfw/subsystem/modes/ModeStoreIF.h +0x0c03;MS_TooManyElements;;3;MODE_STORE_IF;fsfw/src/fsfw/subsystem/modes/ModeStoreIF.h +0x0c04;MS_CantStoreEmpty;;4;MODE_STORE_IF;fsfw/src/fsfw/subsystem/modes/ModeStoreIF.h +0x0d01;SS_SequenceAlreadyExists;;1;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d02;SS_TableAlreadyExists;;2;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d03;SS_TableDoesNotExist;;3;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d04;SS_TableOrSequenceLengthInvalid;;4;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d05;SS_SequenceDoesNotExist;;5;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d06;SS_TableContainsInvalidObjectId;;6;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d07;SS_FallbackSequenceDoesNotExist;;7;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d08;SS_NoTargetTable;;8;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d09;SS_SequenceOrTableTooLong;;9;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d0b;SS_IsFallbackSequence;;11;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d0c;SS_AccessDenied;;12;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d0e;SS_TableInUse;;14;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0da1;SS_TargetTableNotReached;;161;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0da2;SS_TableCheckFailed;;162;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0b01;SB_ChildNotFound;;1;SUBSYSTEM_BASE;fsfw/src/fsfw/subsystem/SubsystemBase.h +0x0b02;SB_ChildInfoUpdated;;2;SUBSYSTEM_BASE;fsfw/src/fsfw/subsystem/SubsystemBase.h +0x0b03;SB_ChildDoesntHaveModes;;3;SUBSYSTEM_BASE;fsfw/src/fsfw/subsystem/SubsystemBase.h +0x0b04;SB_CouldNotInsertChild;;4;SUBSYSTEM_BASE;fsfw/src/fsfw/subsystem/SubsystemBase.h +0x0b05;SB_TableContainsInvalidObjectId;;5;SUBSYSTEM_BASE;fsfw/src/fsfw/subsystem/SubsystemBase.h +0x3e00;HKM_QueueOrDestinationInvalid;;0;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h +0x3e01;HKM_WrongHkPacketType;;1;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h +0x3e02;HKM_ReportingStatusUnchanged;;2;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h +0x3e03;HKM_PeriodicHelperInvalid;;3;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h +0x3e04;HKM_PoolobjectNotFound;;4;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h +0x3e05;HKM_DatasetNotFound;;5;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h +0x3c00;LPIF_PoolEntryNotFound;;0;LOCAL_POOL_OWNER_IF;fsfw/src/fsfw/datapoollocal/localPoolDefinitions.h +0x3c01;LPIF_PoolEntryTypeConflict;;1;LOCAL_POOL_OWNER_IF;fsfw/src/fsfw/datapoollocal/localPoolDefinitions.h 0x3da0;PVA_InvalidReadWriteMode;;160;POOL_VARIABLE_IF;fsfw/src/fsfw/datapool/PoolVariableIF.h 0x3da1;PVA_InvalidPoolEntry;;161;POOL_VARIABLE_IF;fsfw/src/fsfw/datapool/PoolVariableIF.h 0x0801;DPS_InvalidParameterDefinition;;1;DATA_SET_CLASS;fsfw/src/fsfw/datapool/DataSetIF.h @@ -204,20 +305,39 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x0804;DPS_DataSetUninitialised;;4;DATA_SET_CLASS;fsfw/src/fsfw/datapool/DataSetIF.h 0x0805;DPS_DataSetFull;;5;DATA_SET_CLASS;fsfw/src/fsfw/datapool/DataSetIF.h 0x0806;DPS_PoolVarNull;;6;DATA_SET_CLASS;fsfw/src/fsfw/datapool/DataSetIF.h -0x1c01;TCD_PacketLost;;1;PACKET_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/TcDistributorBase.h -0x1c02;TCD_DestinationNotFound;;2;PACKET_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/TcDistributorBase.h -0x1c03;TCD_ServiceIdAlreadyExists;;3;PACKET_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/TcDistributorBase.h -0x1b00;TCC_NoDestinationFound;;0;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h -0x1b01;TCC_InvalidCcsdsVersion;;1;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h -0x1b02;TCC_InvalidApid;;2;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h -0x1b03;TCC_InvalidPacketType;;3;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h -0x1b04;TCC_InvalidSecHeaderField;;4;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h -0x1b05;TCC_IncorrectPrimaryHeader;;5;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h -0x1b07;TCC_IncompletePacket;;7;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h -0x1b08;TCC_InvalidPusVersion;;8;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h -0x1b09;TCC_IncorrectChecksum;;9;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h -0x1b0a;TCC_IllegalPacketSubtype;;10;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h -0x1b0b;TCC_IncorrectSecondaryHeader;;11;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h +0x1000;TIM_UnsupportedTimeFormat;;0;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h +0x1001;TIM_NotEnoughInformationForTargetFormat;;1;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h +0x1002;TIM_LengthMismatch;;2;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h +0x1003;TIM_InvalidTimeFormat;;3;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h +0x1004;TIM_InvalidDayOfYear;;4;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h +0x1005;TIM_TimeDoesNotFitFormat;;5;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h +0x3701;TSI_BadTimestamp;;1;TIME_STAMPER_IF;fsfw/src/fsfw/timemanager/TimeStampIF.h +0x1d01;ATC_ActivityStarted;;1;ACCEPTS_TELECOMMANDS_IF;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h +0x1d02;ATC_InvalidSubservice;;2;ACCEPTS_TELECOMMANDS_IF;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h +0x1d03;ATC_IllegalApplicationData;;3;ACCEPTS_TELECOMMANDS_IF;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h +0x1d04;ATC_SendTmFailed;;4;ACCEPTS_TELECOMMANDS_IF;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h +0x1d05;ATC_Timeout;;5;ACCEPTS_TELECOMMANDS_IF;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h +0x4c00;SPPA_NoPacketFound;;0;SPACE_PACKET_PARSER;fsfw/src/fsfw/tmtcservices/SpacePacketParser.h +0x4c01;SPPA_SplitPacket;;1;SPACE_PACKET_PARSER;fsfw/src/fsfw/tmtcservices/SpacePacketParser.h +0x2001;CSB_ExecutionComplete;;1;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h +0x2002;CSB_NoStepMessage;;2;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h +0x2003;CSB_ObjectBusy;;3;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h +0x2004;CSB_Busy;;4;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h +0x2005;CSB_InvalidTc;;5;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h +0x2006;CSB_InvalidObject;;6;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h +0x2007;CSB_InvalidReply;;7;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h +0x1101;AL_Full;;1;ARRAY_LIST;fsfw/src/fsfw/container/ArrayList.h +0x1801;FF_Full;;1;FIFO_CLASS;fsfw/src/fsfw/container/FIFOBase.h +0x1802;FF_Empty;;2;FIFO_CLASS;fsfw/src/fsfw/container/FIFOBase.h +0x1601;FMM_MapFull;;1;FIXED_MULTIMAP;fsfw/src/fsfw/container/FixedOrderedMultimap.h +0x1602;FMM_KeyDoesNotExist;;2;FIXED_MULTIMAP;fsfw/src/fsfw/container/FixedOrderedMultimap.h +0x1501;FM_KeyAlreadyExists;;1;FIXED_MAP;fsfw/src/fsfw/container/FixedMap.h +0x1502;FM_MapFull;;2;FIXED_MAP;fsfw/src/fsfw/container/FixedMap.h +0x1503;FM_KeyDoesNotExist;;3;FIXED_MAP;fsfw/src/fsfw/container/FixedMap.h +0x2501;EV_ListenerNotFound;;1;EVENT_MANAGER_IF;fsfw/src/fsfw/events/EventManagerIF.h +0x1701;HHI_ObjectNotHealthy;;1;HAS_HEALTH_IF;fsfw/src/fsfw/health/HasHealthIF.h +0x1702;HHI_InvalidHealthState;;2;HAS_HEALTH_IF;fsfw/src/fsfw/health/HasHealthIF.h +0x1703;HHI_IsExternallyControlled;;3;HAS_HEALTH_IF;fsfw/src/fsfw/health/HasHealthIF.h 0x3001;POS_InPowerTransition;;1;POWER_SWITCHER;fsfw/src/fsfw/power/PowerSwitcher.h 0x3002;POS_SwitchStateMismatch;;2;POWER_SWITCHER;fsfw/src/fsfw/power/PowerSwitcher.h 0x0501;PS_SwitchOn;;1;POWER_SWITCH_IF;fsfw/src/fsfw/power/PowerSwitchIF.h @@ -225,76 +345,23 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x0502;PS_SwitchTimeout;;2;POWER_SWITCH_IF;fsfw/src/fsfw/power/PowerSwitchIF.h 0x0503;PS_FuseOn;;3;POWER_SWITCH_IF;fsfw/src/fsfw/power/PowerSwitchIF.h 0x0504;PS_FuseOff;;4;POWER_SWITCH_IF;fsfw/src/fsfw/power/PowerSwitchIF.h -0x3b00;SPH_ConnBroken;;0;SEMAPHORE_IF;fsfw/src/fsfw/osal/common/TcpTmTcServer.h -0x2a01;IEC_NoConfigurationTable;;1;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a02;IEC_NoCpuTable;;2;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a03;IEC_InvalidWorkspaceAddress;;3;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a04;IEC_TooLittleWorkspace;;4;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a05;IEC_WorkspaceAllocation;;5;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a06;IEC_InterruptStackTooSmall;;6;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a07;IEC_ThreadExitted;;7;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a08;IEC_InconsistentMpInformation;;8;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a09;IEC_InvalidNode;;9;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a0a;IEC_NoMpci;;10;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a0b;IEC_BadPacket;;11;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a0c;IEC_OutOfPackets;;12;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a0d;IEC_OutOfGlobalObjects;;13;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a0e;IEC_OutOfProxies;;14;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a0f;IEC_InvalidGlobalId;;15;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a10;IEC_BadStackHook;;16;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a11;IEC_BadAttributes;;17;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a12;IEC_ImplementationKeyCreateInconsistency;;18;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a13;IEC_ImplementationBlockingOperationCancel;;19;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a14;IEC_MutexObtainFromBadState;;20;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a15;IEC_UnlimitedAndMaximumIs0;;21;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2600;FDI_YourFault;;0;HANDLES_FAILURES_IF;fsfw/src/fsfw/fdir/ConfirmsFailuresIF.h -0x2601;FDI_MyFault;;1;HANDLES_FAILURES_IF;fsfw/src/fsfw/fdir/ConfirmsFailuresIF.h -0x2602;FDI_ConfirmLater;;2;HANDLES_FAILURES_IF;fsfw/src/fsfw/fdir/ConfirmsFailuresIF.h -0x1e00;PUS_InvalidPusVersion;;0;PUS_IF;fsfw/src/fsfw/tmtcpacket/pus/PusIF.h -0x1e01;PUS_InvalidCrc16;;1;PUS_IF;fsfw/src/fsfw/tmtcpacket/pus/PusIF.h -0x0201;OM_InsertionFailed;;1;OBJECT_MANAGER_IF;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h -0x0202;OM_NotFound;;2;OBJECT_MANAGER_IF;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h -0x0203;OM_ChildInitFailed;;3;OBJECT_MANAGER_IF;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h -0x0204;OM_InternalErrReporterUninit;;4;OBJECT_MANAGER_IF;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h -0x2201;TMF_Busy;;1;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h -0x2202;TMF_LastPacketFound;;2;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h -0x2203;TMF_StopFetch;;3;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h -0x2204;TMF_Timeout;;4;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h -0x2205;TMF_TmChannelFull;;5;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h -0x2206;TMF_NotStored;;6;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h -0x2207;TMF_AllDeleted;;7;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h -0x2208;TMF_InvalidData;;8;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h -0x2209;TMF_NotReady;;9;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h -0x2101;TMB_Busy;;1;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x2102;TMB_Full;;2;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x2103;TMB_Empty;;3;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x2104;TMB_NullRequested;;4;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x2105;TMB_TooLarge;;5;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x2106;TMB_NotReady;;6;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x2107;TMB_DumpError;;7;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x2108;TMB_CrcError;;8;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x2109;TMB_Timeout;;9;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x210a;TMB_IdlePacketFound;;10;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x210b;TMB_TelecommandFound;;11;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x210c;TMB_NoPusATm;;12;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x210d;TMB_TooSmall;;13;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x210e;TMB_BlockNotFound;;14;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x210f;TMB_InvalidRequest;;15;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x2d01;PAW_UnknownDatatype;;1;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h -0x2d02;PAW_DatatypeMissmatch;;2;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h -0x2d03;PAW_Readonly;;3;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h -0x2d04;PAW_TooBig;;4;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h -0x2d05;PAW_SourceNotSet;;5;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h -0x2d06;PAW_OutOfBounds;;6;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h -0x2d07;PAW_NotSet;;7;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h -0x2d08;PAW_ColumnOrRowsZero;;8;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h -0x2e01;HPA_InvalidIdentifierId;;1;HAS_PARAMETERS_IF;fsfw/src/fsfw/parameters/HasParametersIF.h -0x2e02;HPA_InvalidDomainId;;2;HAS_PARAMETERS_IF;fsfw/src/fsfw/parameters/HasParametersIF.h -0x2e03;HPA_InvalidValue;;3;HAS_PARAMETERS_IF;fsfw/src/fsfw/parameters/HasParametersIF.h -0x2e05;HPA_ReadOnly;;5;HAS_PARAMETERS_IF;fsfw/src/fsfw/parameters/HasParametersIF.h -0x3b01;SPH_SemaphoreTimeout;;1;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h -0x3b02;SPH_SemaphoreNotOwned;;2;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h -0x3b03;SPH_SemaphoreInvalid;;3;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h +0x4300;FILS_GenericFileError;;0;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4301;FILS_GenericDirError;;1;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4302;FILS_FilesystemInactive;;2;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4303;FILS_GenericRenameError;;3;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4304;FILS_IsBusy;;4;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4305;FILS_InvalidParameters;;5;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x430a;FILS_FileDoesNotExist;;10;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x430b;FILS_FileAlreadyExists;;11;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x430c;FILS_NotAFile;;12;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x430d;FILS_FileLocked;;13;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x430e;FILS_PermissionDenied;;14;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4315;FILS_DirectoryDoesNotExist;;21;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4316;FILS_DirectoryAlreadyExists;;22;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4317;FILS_NotADirectory;;23;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4318;FILS_DirectoryNotEmpty;;24;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x431e;FILS_SequencePacketMissingWrite;;30;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x431f;FILS_SequencePacketMissingRead;;31;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h 0x1a01;TRC_NotEnoughSensors;;1;TRIPLE_REDUNDACY_CHECK;fsfw/src/fsfw/monitoring/TriplexMonitor.h 0x1a02;TRC_LowestValueOol;;2;TRIPLE_REDUNDACY_CHECK;fsfw/src/fsfw/monitoring/TriplexMonitor.h 0x1a03;TRC_HighestValueOol;;3;TRIPLE_REDUNDACY_CHECK;fsfw/src/fsfw/monitoring/TriplexMonitor.h @@ -313,71 +380,34 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x31e2;LIM_WrongPid;;226;LIMITS_IF;fsfw/src/fsfw/monitoring/MonitoringIF.h 0x31e3;LIM_WrongLimitId;;227;LIMITS_IF;fsfw/src/fsfw/monitoring/MonitoringIF.h 0x31ee;LIM_MonitorNotFound;;238;LIMITS_IF;fsfw/src/fsfw/monitoring/MonitoringIF.h -0x3601;CFDP_InvalidTlvType;;1;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x3602;CFDP_InvalidDirectiveField;;2;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x3603;CFDP_InvalidPduDatafieldLen;;3;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x3604;CFDP_InvalidAckDirectiveFields;;4;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x3605;CFDP_MetadataCantParseOptions;;5;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x3606;CFDP_NakCantParseOptions;;6;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x3607;CFDP_FinishedCantParseFsResponses;;7;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x3608;CFDP_FilestoreRequiresSecondFile;;8;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x3609;CFDP_FilestoreResponseCantParseFsMessage;;9;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x360a;CFDP_InvalidPduFormat;;10;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x4300;FILS_GenericFileError;;0;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x4301;FILS_GenericDirError;;1;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x4303;FILS_GenericRenameError;;3;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x4304;FILS_IsBusy;;4;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x4305;FILS_InvalidParameters;;5;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x430a;FILS_FileDoesNotExist;;10;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x430b;FILS_FileAlreadyExists;;11;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x430c;FILS_NotAFile;;12;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x430d;FILS_FileLocked;;13;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x430e;FILS_PermissionDenied;;14;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x4315;FILS_DirectoryDoesNotExist;;21;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x4316;FILS_DirectoryAlreadyExists;;22;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x4317;FILS_NotADirectory;;23;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x4318;FILS_DirectoryNotEmpty;;24;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x431e;FILS_SequencePacketMissingWrite;;30;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x431f;FILS_SequencePacketMissingRead;;31;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x2c01;CCS_BcIsSetVrCommand;;1;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2c02;CCS_BcIsUnlockCommand;;2;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2cb0;CCS_BcIllegalCommand;;176;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2cb1;CCS_BoardReadingNotFinished;;177;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2cf0;CCS_NsPositiveW;;240;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2cf1;CCS_NsNegativeW;;241;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2cf2;CCS_NsLockout;;242;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2cf3;CCS_FarmInLockout;;243;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2cf4;CCS_FarmInWait;;244;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2ce0;CCS_WrongSymbol;;224;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2ce1;CCS_DoubleStart;;225;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2ce2;CCS_StartSymbolMissed;;226;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2ce3;CCS_EndWithoutStart;;227;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2ce4;CCS_TooLarge;;228;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2ce5;CCS_TooShort;;229;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2ce6;CCS_WrongTfVersion;;230;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2ce7;CCS_WrongSpacecraftId;;231;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2ce8;CCS_NoValidFrameType;;232;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2ce9;CCS_CrcFailed;;233;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2cea;CCS_VcNotFound;;234;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2ceb;CCS_ForwardingFailed;;235;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2cec;CCS_ContentTooLarge;;236;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2ced;CCS_ResidualData;;237;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2cee;CCS_DataCorrupted;;238;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2cef;CCS_IllegalSegmentationFlag;;239;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2cd0;CCS_IllegalFlagCombination;;208;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2cd1;CCS_ShorterThanHeader;;209;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2cd2;CCS_TooShortBlockedPacket;;210;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2cd3;CCS_TooShortMapExtraction;;211;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h 0x4201;PUS11_InvalidTypeTimeWindow;;1;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h 0x4202;PUS11_InvalidTimeWindow;;2;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h 0x4203;PUS11_TimeshiftingNotPossible;;3;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h 0x4204;PUS11_InvalidRelativeTime;;4;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h -0x3401;DC_NoReplyReceived;;1;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h -0x3402;DC_ProtocolError;;2;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h -0x3403;DC_Nullpointer;;3;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h -0x3404;DC_InvalidCookieType;;4;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h -0x3405;DC_NotActive;;5;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h -0x3406;DC_TooMuchData;;6;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h +0x0601;PP_DoItMyself;;1;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x0602;PP_PointsToVariable;;2;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x0603;PP_PointsToMemory;;3;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x0604;PP_ActivityCompleted;;4;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x0605;PP_PointsToVectorUint8;;5;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x0606;PP_PointsToVectorUint16;;6;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x0607;PP_PointsToVectorUint32;;7;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x0608;PP_PointsToVectorFloat;;8;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x06a0;PP_DumpNotSupported;;160;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x06e0;PP_InvalidSize;;224;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x06e1;PP_InvalidAddress;;225;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x06e2;PP_InvalidContent;;226;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x06e3;PP_UnalignedAccess;;227;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x06e4;PP_WriteProtected;;228;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x13e0;MH_UnknownCmd;;224;MEMORY_HELPER;fsfw/src/fsfw/memory/MemoryHelper.h +0x13e1;MH_InvalidAddress;;225;MEMORY_HELPER;fsfw/src/fsfw/memory/MemoryHelper.h +0x13e2;MH_InvalidSize;;226;MEMORY_HELPER;fsfw/src/fsfw/memory/MemoryHelper.h +0x13e3;MH_StateMismatch;;227;MEMORY_HELPER;fsfw/src/fsfw/memory/MemoryHelper.h +0x1201;AB_NeedSecondStep;;1;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h +0x1202;AB_NeedToReconfigure;;2;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h +0x1203;AB_ModeFallback;;3;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h +0x1204;AB_ChildNotCommandable;;4;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h +0x1205;AB_NeedToChangeHealth;;5;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h +0x12a1;AB_NotEnoughChildrenInCorrectState;;161;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h 0x03a0;DHB_InvalidChannel;;160;DEVICE_HANDLER_BASE;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h 0x03b0;DHB_AperiodicReply;;176;DEVICE_HANDLER_BASE;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h 0x03b1;DHB_IgnoreReplyData;;177;DEVICE_HANDLER_BASE;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h @@ -387,12 +417,12 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x03d0;DHB_NoSwitch;;208;DEVICE_HANDLER_BASE;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h 0x03e0;DHB_ChildTimeout;;224;DEVICE_HANDLER_BASE;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h 0x03e1;DHB_SwitchFailed;;225;DEVICE_HANDLER_BASE;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h -0x1201;AB_NeedSecondStep;;1;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h -0x1202;AB_NeedToReconfigure;;2;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h -0x1203;AB_ModeFallback;;3;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h -0x1204;AB_ChildNotCommandable;;4;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h -0x1205;AB_NeedToChangeHealth;;5;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h -0x12a1;AB_NotEnoughChildrenInCorrectState;;161;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h +0x3401;DC_NoReplyReceived;;1;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h +0x3402;DC_ProtocolError;;2;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h +0x3403;DC_Nullpointer;;3;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h +0x3404;DC_InvalidCookieType;;4;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h +0x3405;DC_NotActive;;5;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h +0x3406;DC_TooMuchData;;6;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h 0x27a0;DHI_NoCommandData;;160;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h 0x27a1;DHI_CommandNotSupported;;161;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h 0x27a2;DHI_CommandAlreadySent;;162;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h @@ -414,58 +444,28 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x27c3;DHI_DeviceReplyInvalid;;195;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h 0x27d0;DHI_InvalidCommandParameter;;208;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h 0x27d1;DHI_InvalidNumberOrLengthOfParameters;;209;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h -0x2401;MT_TooDetailedRequest;;1;MATCH_TREE_CLASS;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h -0x2402;MT_TooGeneralRequest;;2;MATCH_TREE_CLASS;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h -0x2403;MT_NoMatch;;3;MATCH_TREE_CLASS;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h -0x2404;MT_Full;;4;MATCH_TREE_CLASS;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h -0x2405;MT_NewNodeCreated;;5;MATCH_TREE_CLASS;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h -0x3f01;DLEE_NoPacketFound;;1;DLE_ENCODER;fsfw/src/fsfw/globalfunctions/DleParser.h -0x3f02;DLEE_PossiblePacketLoss;;2;DLE_ENCODER;fsfw/src/fsfw/globalfunctions/DleParser.h -0x2f01;ASC_TooLongForTargetType;;1;ASCII_CONVERTER;fsfw/src/fsfw/globalfunctions/AsciiConverter.h -0x2f02;ASC_InvalidCharacters;;2;ASCII_CONVERTER;fsfw/src/fsfw/globalfunctions/AsciiConverter.h -0x2f03;ASC_BufferTooSmall;;3;ASCII_CONVERTER;fsfw/src/fsfw/globalfunctions/AsciiConverter.h -0x1701;HHI_ObjectNotHealthy;;1;HAS_HEALTH_IF;fsfw/src/fsfw/health/HasHealthIF.h -0x1702;HHI_InvalidHealthState;;2;HAS_HEALTH_IF;fsfw/src/fsfw/health/HasHealthIF.h -0x1703;HHI_IsExternallyControlled;;3;HAS_HEALTH_IF;fsfw/src/fsfw/health/HasHealthIF.h -0x3201;CF_ObjectHasNoFunctions;;1;COMMANDS_ACTIONS_IF;fsfw/src/fsfw/action/CommandsActionsIF.h -0x3202;CF_AlreadyCommanding;;2;COMMANDS_ACTIONS_IF;fsfw/src/fsfw/action/CommandsActionsIF.h -0x3301;HF_IsBusy;;1;HAS_ACTIONS_IF;fsfw/src/fsfw/action/HasActionsIF.h -0x3302;HF_InvalidParameters;;2;HAS_ACTIONS_IF;fsfw/src/fsfw/action/HasActionsIF.h -0x3303;HF_ExecutionFinished;;3;HAS_ACTIONS_IF;fsfw/src/fsfw/action/HasActionsIF.h -0x3304;HF_InvalidActionId;;4;HAS_ACTIONS_IF;fsfw/src/fsfw/action/HasActionsIF.h -0x1000;TIM_UnsupportedTimeFormat;;0;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h -0x1001;TIM_NotEnoughInformationForTargetFormat;;1;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h -0x1002;TIM_LengthMismatch;;2;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h -0x1003;TIM_InvalidTimeFormat;;3;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h -0x1004;TIM_InvalidDayOfYear;;4;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h -0x1005;TIM_TimeDoesNotFitFormat;;5;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h -0x3701;TSI_BadTimestamp;;1;TIME_STAMPER_IF;fsfw/src/fsfw/timemanager/TimeStampIF.h -0x3c00;LPIF_PoolEntryNotFound;;0;LOCAL_POOL_OWNER_IF;fsfw/src/fsfw/datapoollocal/localPoolDefinitions.h -0x3c01;LPIF_PoolEntryTypeConflict;;1;LOCAL_POOL_OWNER_IF;fsfw/src/fsfw/datapoollocal/localPoolDefinitions.h -0x3e00;HKM_QueueOrDestinationInvalid;;0;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h -0x3e01;HKM_WrongHkPacketType;;1;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h -0x3e02;HKM_ReportingStatusUnchanged;;2;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h -0x3e03;HKM_PeriodicHelperInvalid;;3;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h -0x3e04;HKM_PoolobjectNotFound;;4;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h -0x3e05;HKM_DatasetNotFound;;5;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h -0x2901;TC_InvalidTargetState;;1;THERMAL_COMPONENT_IF;fsfw/src/fsfw/thermal/ThermalComponentIF.h -0x29f1;TC_AboveOperationalLimit;;241;THERMAL_COMPONENT_IF;fsfw/src/fsfw/thermal/ThermalComponentIF.h -0x29f2;TC_BelowOperationalLimit;;242;THERMAL_COMPONENT_IF;fsfw/src/fsfw/thermal/ThermalComponentIF.h -0x2001;CSB_ExecutionComplete;;1;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h -0x2002;CSB_NoStepMessage;;2;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h -0x2003;CSB_ObjectBusy;;3;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h -0x2004;CSB_Busy;;4;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h -0x2005;CSB_InvalidTc;;5;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h -0x2006;CSB_InvalidObject;;6;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h -0x2007;CSB_InvalidReply;;7;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h -0x4c00;SPPA_NoPacketFound;;0;SPACE_PACKET_PARSER;fsfw/src/fsfw/tmtcservices/SpacePacketParser.h -0x4c01;SPPA_SplitPacket;;1;SPACE_PACKET_PARSER;fsfw/src/fsfw/tmtcservices/SpacePacketParser.h -0x1d01;ATC_ActivityStarted;;1;ACCEPTS_TELECOMMANDS_IF;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h -0x1d02;ATC_InvalidSubservice;;2;ACCEPTS_TELECOMMANDS_IF;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h -0x1d03;ATC_IllegalApplicationData;;3;ACCEPTS_TELECOMMANDS_IF;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h -0x1d04;ATC_SendTmFailed;;4;ACCEPTS_TELECOMMANDS_IF;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h -0x1d05;ATC_Timeout;;5;ACCEPTS_TELECOMMANDS_IF;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h -0x6b00;SCBU_KeyNotFound;;0;SCRATCH_BUFFER;bsp_q7s/memory/scratchApi.h +0x1401;SE_BufferTooShort;;1;SERIALIZE_IF;fsfw/src/fsfw/serialize/SerializeIF.h +0x1402;SE_StreamTooShort;;2;SERIALIZE_IF;fsfw/src/fsfw/serialize/SerializeIF.h +0x1403;SE_TooManyElements;;3;SERIALIZE_IF;fsfw/src/fsfw/serialize/SerializeIF.h +0x4500;HSPI_HalTimeoutRetval;;0;HAL_SPI;fsfw/src/fsfw_hal/stm32h7/spi/spiDefinitions.h +0x4501;HSPI_HalBusyRetval;;1;HAL_SPI;fsfw/src/fsfw_hal/stm32h7/spi/spiDefinitions.h +0x4502;HSPI_HalErrorRetval;;2;HAL_SPI;fsfw/src/fsfw_hal/stm32h7/spi/spiDefinitions.h +0x4601;HURT_UartReadFailure;;1;HAL_UART;fsfw/src/fsfw_hal/linux/uart/UartComIF.h +0x4602;HURT_UartReadSizeMissmatch;;2;HAL_UART;fsfw/src/fsfw_hal/linux/uart/UartComIF.h +0x4603;HURT_UartRxBufferTooSmall;;3;HAL_UART;fsfw/src/fsfw_hal/linux/uart/UartComIF.h +0x4801;HGIO_UnknownGpioId;;1;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4802;HGIO_DriveGpioFailure;;2;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4803;HGIO_GpioTypeFailure;;3;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4804;HGIO_GpioInvalidInstance;;4;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4805;HGIO_GpioDuplicateDetected;;5;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4806;HGIO_GpioInitFailed;;6;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4807;HGIO_GpioGetValueFailed;;7;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.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;;6;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.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 0x6a00;SDMA_OpOngoing;;0;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h @@ -478,3 +478,4 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x6a0d;SDMA_UnmountError;;13;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h 0x6a0e;SDMA_SystemCallError;;14;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h 0x6a0f;SDMA_PopenCallError;;15;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h +0x6b00;SCBU_KeyNotFound;;0;SCRATCH_BUFFER;bsp_q7s/memory/scratchApi.h diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index 69e22777..c49fa15a 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 233 translations. * @details - * Generated on: 2022-10-21 15:41:33 + * Generated on: 2022-10-27 09:03:07 */ #include "translateEvents.h" diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index 65f8ea62..157ad167 100644 --- a/generators/objects/translateObjects.cpp +++ b/generators/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 140 translations. - * Generated on: 2022-10-21 15:41:33 + * Generated on: 2022-10-27 09:03:07 */ #include "translateObjects.h" diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index 69e22777..c49fa15a 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 233 translations. * @details - * Generated on: 2022-10-21 15:41:33 + * Generated on: 2022-10-27 09:03:07 */ #include "translateEvents.h" diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index 65f8ea62..157ad167 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 140 translations. - * Generated on: 2022-10-21 15:41:33 + * Generated on: 2022-10-27 09:03:07 */ #include "translateObjects.h" diff --git a/tmtc b/tmtc index ff1b4016..4420bf3d 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit ff1b401622cf430f8c312f3c0ca0132918dbf346 +Subproject commit 4420bf3df94f26b3270dd91ac0ef80cb3f8699df -- 2.43.0 From b54c40db11172bd2ed033935b07be3af2e148ab1 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 27 Oct 2022 09:06:34 +0200 Subject: [PATCH 95/97] missing define renaming --- bsp_te0720_1cfa/InitMission.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bsp_te0720_1cfa/InitMission.cpp b/bsp_te0720_1cfa/InitMission.cpp index d303d41b..a3e3a004 100644 --- a/bsp_te0720_1cfa/InitMission.cpp +++ b/bsp_te0720_1cfa/InitMission.cpp @@ -107,7 +107,7 @@ void initmission::initTasks() { } #endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */ -#if OBSW_ADD_CCSDS_IP_CORE == 1 +#if OBSW_ADD_CCSDS_IP_CORES == 1 PeriodicTaskIF* ccsdsHandlerTask = factory->createPeriodicTask( "CCSDS_HANDLER", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc); result = ccsdsHandlerTask->addComponent(objects::CCSDS_HANDLER); @@ -124,7 +124,7 @@ void initmission::initTasks() { if (result != returnvalue::OK) { initmission::printAddObjectError("PDEC Handler", objects::PDEC_HANDLER); } -#endif /* OBSW_ADD_CCSDS_IP_CORE == 1 */ +#endif /* OBSW_ADD_CCSDS_IP_CORES == 1 */ auto taskStarter = [](std::vector& taskVector, std::string name) { for (const auto& task : taskVector) { -- 2.43.0 From 1d6b5cbda4f3f9f0aee83d7f994d74ad7f7d1f99 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 27 Oct 2022 09:08:26 +0200 Subject: [PATCH 96/97] add missing changelog entry --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ace22e0..baf0bc3a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,8 @@ list yields a list of all related PRs for each release. PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/305 - IMTQ updates as preparation for ACS controller expansion PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/306 +- P60 Module: Reduce number of set IDs, use same set IDs for core, auxiliary + and config HK set across the three PCDU modules # [v1.14.1] -- 2.43.0 From d6adde92fccaf3d458d60400e16651392026f984 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 27 Oct 2022 09:11:10 +0200 Subject: [PATCH 97/97] add dates to changelog --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index baf0bc3a..5cceecb3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ list yields a list of all related PRs for each release. # [unreleased] -# [v1.15.0] +# [v1.15.0] 27.10.2022 - Consistent device file naming - Remove rad sensor from EM build, lead to weird bugs on EM which @@ -26,14 +26,14 @@ list yields a list of all related PRs for each release. - P60 Module: Reduce number of set IDs, use same set IDs for core, auxiliary and config HK set across the three PCDU modules -# [v1.14.1] +# [v1.14.1] 11.10.2022 - Various bugfixes and regression fixes - General file handling at program initialization now works properly again - Scratch buffer preferred SD card handling works again - Use scoped locks in TCS controller to avoid deadlocks -# [v1.14.0] +# [v1.14.0] 10.10.2022 - Provide full SW update capability for the OBSW. This includes very basic CFDP integration, a software update -- 2.43.0