From ca6556c000c297adec08c6b6a4b43a1b63d98b8c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 6 Mar 2023 15:41:56 +0100 Subject: [PATCH 01/22] add health handling for TCS ASSY --- mission/system/objects/TcsBoardAssembly.cpp | 27 +++++++++++++++++++-- mission/system/objects/TcsBoardAssembly.h | 1 + 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/mission/system/objects/TcsBoardAssembly.cpp b/mission/system/objects/TcsBoardAssembly.cpp index 88075fdc..974c073e 100644 --- a/mission/system/objects/TcsBoardAssembly.cpp +++ b/mission/system/objects/TcsBoardAssembly.cpp @@ -41,6 +41,12 @@ ReturnValue_t TcsBoardAssembly::commandChildren(Mode_t mode, Submode_t submode) modeTable[idx].setMode(MODE_OFF); modeTable[idx].setSubmode(SUBMODE_NONE); } + if (recoveryState == RecoveryState::RECOVERY_IDLE) { + result = checkAndHandleHealthStates(mode, submode); + if (result == NEED_TO_CHANGE_HEALTH) { + return returnvalue::OK; + } + } if (recoveryState != RecoveryState::RECOVERY_STARTED) { if (mode == DeviceHandlerIF::MODE_NORMAL or mode == MODE_ON) { result = handleNormalOrOnModeCmd(mode, submode); @@ -180,9 +186,26 @@ void TcsBoardAssembly::handleModeReached() { } void TcsBoardAssembly::handleChildrenLostMode(ReturnValue_t result) { - // TODO: Maybe try a reboot once here? triggerEvent(CHILDREN_LOST_MODE, result); - return; + startTransition(mode, submode); +} + +ReturnValue_t TcsBoardAssembly::checkAndHandleHealthStates(Mode_t deviceMode, + Submode_t deviceSubmode) { + ReturnValue_t status = returnvalue::OK; + auto overwriteHealthForOneDev = [&](object_id_t dev) { + HealthState health = healthHelper.healthTable->getHealth(dev); + if (health == FAULTY or health == PERMANENT_FAULTY) { + overwriteDeviceHealth(dev, health); + status = NEED_TO_CHANGE_HEALTH; + } else if (health == EXTERNAL_CONTROL) { + modeHelper.setForced(true); + } + }; + for (const auto& dev : helper.rtdInfos) { + overwriteHealthForOneDev(dev.first); + } + return returnvalue::OK; } void TcsBoardAssembly::handleModeTransitionFailed(ReturnValue_t result) { diff --git a/mission/system/objects/TcsBoardAssembly.h b/mission/system/objects/TcsBoardAssembly.h index fb5f7d38..3c3fc0d6 100644 --- a/mission/system/objects/TcsBoardAssembly.h +++ b/mission/system/objects/TcsBoardAssembly.h @@ -52,6 +52,7 @@ class TcsBoardAssembly : public AssemblyBase, public ConfirmsFailuresIF { ReturnValue_t isModeCombinationValid(Mode_t mode, Submode_t submode) override; void startTransition(Mode_t mode, Submode_t submode) override; void handleModeReached() override; + ReturnValue_t checkAndHandleHealthStates(Mode_t deviceMode, Submode_t deviceSubmode); // These two overrides prevent a transition of the whole assembly back to off just because // some devices are not working From cee56f6d02a4f489247800aa263cd51b422417b6 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 6 Mar 2023 15:58:19 +0100 Subject: [PATCH 02/22] changelog update --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b08ae006..0ddb1cfb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,10 @@ will consitute of a breaking change warranting a new major release: # [unreleased] +## Fixed + +- Health handling for TCS board assembly + # [v1.35.1] 2023-03-04 ## Fixed From 2ccd2a832c85459501685ddce661a1f7885c8ecf Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 6 Mar 2023 17:34:04 +0100 Subject: [PATCH 03/22] tricky --- mission/system/objects/TcsBoardAssembly.cpp | 23 ++++++++++++--------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/mission/system/objects/TcsBoardAssembly.cpp b/mission/system/objects/TcsBoardAssembly.cpp index 974c073e..4c8da92f 100644 --- a/mission/system/objects/TcsBoardAssembly.cpp +++ b/mission/system/objects/TcsBoardAssembly.cpp @@ -68,10 +68,10 @@ ReturnValue_t TcsBoardAssembly::checkChildrenStateOn(Mode_t wantedMode, Submode_ } catch (const std::out_of_range& e) { sif::error << "TcsBoardAssembly: Invalid children map: " << e.what() << std::endl; } - if (devsInWrongMode >= 3) { + if (devsInWrongMode == NUMBER_RTDS) { if (warningSwitch) { - sif::warning << "TcsBoardAssembly::checkChildrenStateOn: " << devsInWrongMode << " devices in" - << " wrong mode" << std::endl; + sif::warning << "TcsBoardAssembly::checkChildrenStateOn: All devices in wrong mode" + << std::endl; warningSwitch = false; } return NOT_ENOUGH_CHILDREN_IN_CORRECT_STATE; @@ -193,19 +193,22 @@ void TcsBoardAssembly::handleChildrenLostMode(ReturnValue_t result) { ReturnValue_t TcsBoardAssembly::checkAndHandleHealthStates(Mode_t deviceMode, Submode_t deviceSubmode) { ReturnValue_t status = returnvalue::OK; - auto overwriteHealthForOneDev = [&](object_id_t dev) { - HealthState health = healthHelper.healthTable->getHealth(dev); + for (const auto& dev : helper.rtdInfos) { + HealthState health = healthHelper.healthTable->getHealth(dev.first); + if (health == HealthState::HEALTHY) { + return returnvalue::OK; + } + } + + for (const auto& dev : helper.rtdInfos) { + HealthState health = healthHelper.healthTable->getHealth(dev.first); if (health == FAULTY or health == PERMANENT_FAULTY) { - overwriteDeviceHealth(dev, health); status = NEED_TO_CHANGE_HEALTH; } else if (health == EXTERNAL_CONTROL) { modeHelper.setForced(true); } - }; - for (const auto& dev : helper.rtdInfos) { - overwriteHealthForOneDev(dev.first); } - return returnvalue::OK; + return status; } void TcsBoardAssembly::handleModeTransitionFailed(ReturnValue_t result) { From db2905c834d1faa922a9e48cc06bc6aa43204dcb Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 6 Mar 2023 17:59:28 +0100 Subject: [PATCH 04/22] order bugfix for TCS subsystem --- mission/system/tree/tcsModeTree.cpp | 31 +++++++++++++++-------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/mission/system/tree/tcsModeTree.cpp b/mission/system/tree/tcsModeTree.cpp index d411161a..43ed2e85 100644 --- a/mission/system/tree/tcsModeTree.cpp +++ b/mission/system/tree/tcsModeTree.cpp @@ -19,8 +19,8 @@ static const auto NML = DeviceHandlerIF::MODE_NORMAL; auto TCS_SEQUENCE_OFF = std::make_pair(OFF, FixedArrayList()); auto TCS_TABLE_OFF_TGT = std::make_pair((OFF << 24) | 1, FixedArrayList()); -auto TCS_TABLE_OFF_TRANS_0 = std::make_pair((OFF << 24) | 2, FixedArrayList()); -auto TCS_TABLE_OFF_TRANS_1 = std::make_pair((OFF << 24) | 3, FixedArrayList()); +auto TCS_TABLE_OFF_TRANS_0 = std::make_pair((OFF << 24) | 2, FixedArrayList()); +auto TCS_TABLE_OFF_TRANS_1 = std::make_pair((OFF << 24) | 3, FixedArrayList()); auto TCS_SEQUENCE_NORMAL = std::make_pair(NML, FixedArrayList()); auto TCS_TABLE_NORMAL_TGT = std::make_pair((NML << 24) | 1, FixedArrayList()); @@ -59,18 +59,19 @@ void buildOffSequence(Subsystem& ss, ModeListEntry& eh) { // OFF target table is empty check(ss.addTable(TableEntry(TCS_TABLE_OFF_TGT.first, &TCS_TABLE_OFF_TGT.second)), ctxc); - iht(objects::TCS_BOARD_ASS, OFF, 0, TCS_TABLE_OFF_TRANS_0.second); - iht(objects::TMP1075_HANDLER_TCS_0, OFF, 0, TCS_TABLE_OFF_TRANS_0.second); - iht(objects::TMP1075_HANDLER_TCS_1, OFF, 0, TCS_TABLE_OFF_TRANS_0.second); - iht(objects::TMP1075_HANDLER_PLPCDU_0, OFF, 0, TCS_TABLE_OFF_TRANS_0.second); - // damaged - // iht(objects::TMP1075_HANDLER_PLPCDU_1, OFF, 0, TCS_TABLE_OFF_TRANS_0.second); - iht(objects::TMP1075_HANDLER_IF_BOARD, OFF, 0, TCS_TABLE_OFF_TRANS_0.second); - check(ss.addTable(TableEntry(TCS_TABLE_OFF_TRANS_0.first, &TCS_TABLE_OFF_TRANS_0.second)), ctxc); - + // Transition 1 iht(objects::THERMAL_CONTROLLER, OFF, 0, TCS_TABLE_OFF_TRANS_0.second); + check(ss.addTable(TableEntry(TCS_TABLE_OFF_TRANS_1.first, &TCS_TABLE_OFF_TRANS_0.second)), ctxc); + + iht(objects::TCS_BOARD_ASS, OFF, 0, TCS_TABLE_OFF_TRANS_1.second); + iht(objects::TMP1075_HANDLER_TCS_0, OFF, 0, TCS_TABLE_OFF_TRANS_1.second); + iht(objects::TMP1075_HANDLER_TCS_1, OFF, 0, TCS_TABLE_OFF_TRANS_1.second); + iht(objects::TMP1075_HANDLER_PLPCDU_0, OFF, 0, TCS_TABLE_OFF_TRANS_1.second); + // TMP PL PCDU 1 is damaged + iht(objects::TMP1075_HANDLER_IF_BOARD, OFF, 0, TCS_TABLE_OFF_TRANS_1.second); check(ss.addTable(TableEntry(TCS_TABLE_OFF_TRANS_1.first, &TCS_TABLE_OFF_TRANS_1.second)), ctxc); + ihs(TCS_SEQUENCE_OFF.second, TCS_TABLE_OFF_TGT.first, 0, false); ihs(TCS_SEQUENCE_OFF.second, TCS_TABLE_OFF_TRANS_0.first, 0, false); ihs(TCS_SEQUENCE_OFF.second, TCS_TABLE_OFF_TRANS_1.first, 0, false); @@ -98,20 +99,20 @@ void buildNormalSequence(Subsystem& ss, ModeListEntry& eh) { check(sequence.insert(eh), ctxc); }; - // OFF target table is empty + // Normal target table is empty check(ss.addTable(TableEntry(TCS_TABLE_NORMAL_TGT.first, &TCS_TABLE_NORMAL_TGT.second)), ctxc); iht(objects::TCS_BOARD_ASS, NML, 0, TCS_TABLE_NORMAL_TRANS_0.second); iht(objects::TMP1075_HANDLER_TCS_0, NML, 0, TCS_TABLE_NORMAL_TRANS_0.second); iht(objects::TMP1075_HANDLER_TCS_1, NML, 0, TCS_TABLE_NORMAL_TRANS_0.second); iht(objects::TMP1075_HANDLER_PLPCDU_0, NML, 0, TCS_TABLE_NORMAL_TRANS_0.second); - // damaged - // iht(objects::TMP1075_HANDLER_PLPCDU_1, NML, 0, TCS_TABLE_NORMAL_TRANS_0.second); + // TMP PL PCDU 1 is damaged iht(objects::TMP1075_HANDLER_IF_BOARD, NML, 0, TCS_TABLE_NORMAL_TRANS_0.second); check(ss.addTable(TableEntry(TCS_TABLE_NORMAL_TRANS_0.first, &TCS_TABLE_NORMAL_TRANS_0.second)), ctxc); - iht(objects::THERMAL_CONTROLLER, NML, 0, TCS_TABLE_NORMAL_TRANS_0.second); + // Transition 1 + iht(objects::THERMAL_CONTROLLER, NML, 0, TCS_TABLE_NORMAL_TRANS_1.second); check(ss.addTable(TableEntry(TCS_TABLE_NORMAL_TRANS_1.first, &TCS_TABLE_NORMAL_TRANS_1.second)), ctxc); From 52182028241769a4692b3c1371f0e61ee2979b64 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 7 Mar 2023 10:16:32 +0100 Subject: [PATCH 05/22] bump tmtc --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index 9462a6e2..e74e7511 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 9462a6e2459e11ac03c2bb9694772959ac228cd0 +Subproject commit e74e751142e46c801852a110bef11510cc7c7bfa From e48d0806737585ad8b01c9161f8e6c168fb7834a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 7 Mar 2023 17:08:33 +0100 Subject: [PATCH 06/22] small tweak --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 49badb4a..0edc354f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ will consitute of a breaking change warranting a new major release: ## Fixed - Health handling for TCS board assembly + ## Changed - Transmitter timeout set to 2 minutes instead of 15 minutes. This will prevent to discharge the battery From 4863dad1cd4e7e8231f23b02a5b80c23dcd40293 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 8 Mar 2023 18:59:22 +0100 Subject: [PATCH 07/22] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index de02ac75..d348f8fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ will consitute of a breaking change warranting a new major release: ## Fixed +- Command TCS controller off first for TCS subsystem transition to off. - Health handling for TCS board assembly - Mode fallback from IDLE mode to SAFE mode due to ACS errors/events now works properly for the ACS subsystem From 101117cebe3d1ce0156024148c493efcc3d55c2b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 8 Mar 2023 19:06:48 +0100 Subject: [PATCH 08/22] small fix --- mission/system/tree/tcsModeTree.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mission/system/tree/tcsModeTree.cpp b/mission/system/tree/tcsModeTree.cpp index 43ed2e85..a3bd4319 100644 --- a/mission/system/tree/tcsModeTree.cpp +++ b/mission/system/tree/tcsModeTree.cpp @@ -61,7 +61,7 @@ void buildOffSequence(Subsystem& ss, ModeListEntry& eh) { // Transition 1 iht(objects::THERMAL_CONTROLLER, OFF, 0, TCS_TABLE_OFF_TRANS_0.second); - check(ss.addTable(TableEntry(TCS_TABLE_OFF_TRANS_1.first, &TCS_TABLE_OFF_TRANS_0.second)), ctxc); + check(ss.addTable(TableEntry(TCS_TABLE_OFF_TRANS_0.first, &TCS_TABLE_OFF_TRANS_0.second)), ctxc); iht(objects::TCS_BOARD_ASS, OFF, 0, TCS_TABLE_OFF_TRANS_1.second); iht(objects::TMP1075_HANDLER_TCS_0, OFF, 0, TCS_TABLE_OFF_TRANS_1.second); From 0a37db617b63dfc54b9a16cecebfc74630112650 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 8 Mar 2023 19:12:10 +0100 Subject: [PATCH 09/22] tmtc update --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index af17e306..d758a1f1 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit af17e30676b3c4e364b6969873519951453181e2 +Subproject commit d758a1f11ac4d39eda08918c124d8736da104687 From 8821cc107922be9633fa185ebf03f80628ef9f1e Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 8 Mar 2023 19:17:24 +0100 Subject: [PATCH 10/22] prep v1.36.0 --- CHANGELOG.md | 2 ++ CMakeLists.txt | 4 ++-- mission/system/tree/system.cpp | 2 ++ mission/system/tree/tcsModeTree.cpp | 1 - 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d348f8fa..9646ff2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ will consitute of a breaking change warranting a new major release: # [unreleased] +# [v1.36.0] 2023-03-08 + ## Added - Star Tracker Assembly diff --git a/CMakeLists.txt b/CMakeLists.txt index 6bf2a95a..7cd09271 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,8 +10,8 @@ cmake_minimum_required(VERSION 3.13) set(OBSW_VERSION_MAJOR 1) -set(OBSW_VERSION_MINOR 35) -set(OBSW_VERSION_REVISION 1) +set(OBSW_VERSION_MINOR 36) +set(OBSW_VERSION_REVISION 0) # set(CMAKE_VERBOSE TRUE) diff --git a/mission/system/tree/system.cpp b/mission/system/tree/system.cpp index d1b127d4..215f1b02 100644 --- a/mission/system/tree/system.cpp +++ b/mission/system/tree/system.cpp @@ -83,6 +83,8 @@ void buildSafeSequence(Subsystem& ss, ModeListEntry& eh) { // Do no track ACS for now because it might jump to detumble mode and back to safe as part of // normal operations. + // UPDATE: This could be re-enabled as soon as the detumble mode is a submode of + // ACS CTRL safe mode. // iht(objects::ACS_SUBSYSTEM, acs::AcsMode::SAFE, 0, EIVE_TABLE_SAFE_TGT.second, true); iht(objects::PL_SUBSYSTEM, OFF, 0, EIVE_TABLE_SAFE_TGT.second); check(ss.addTable(TableEntry(EIVE_TABLE_SAFE_TGT.first, &EIVE_TABLE_SAFE_TGT.second)), ctxc); diff --git a/mission/system/tree/tcsModeTree.cpp b/mission/system/tree/tcsModeTree.cpp index a3bd4319..b7188b17 100644 --- a/mission/system/tree/tcsModeTree.cpp +++ b/mission/system/tree/tcsModeTree.cpp @@ -71,7 +71,6 @@ void buildOffSequence(Subsystem& ss, ModeListEntry& eh) { iht(objects::TMP1075_HANDLER_IF_BOARD, OFF, 0, TCS_TABLE_OFF_TRANS_1.second); check(ss.addTable(TableEntry(TCS_TABLE_OFF_TRANS_1.first, &TCS_TABLE_OFF_TRANS_1.second)), ctxc); - ihs(TCS_SEQUENCE_OFF.second, TCS_TABLE_OFF_TGT.first, 0, false); ihs(TCS_SEQUENCE_OFF.second, TCS_TABLE_OFF_TRANS_0.first, 0, false); ihs(TCS_SEQUENCE_OFF.second, TCS_TABLE_OFF_TRANS_1.first, 0, false); From 2f5f47a02ced53e209e769186302dab6f407c271 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 8 Mar 2023 19:20:18 +0100 Subject: [PATCH 11/22] tmtc bump --- CHANGELOG.md | 2 ++ tmtc | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9646ff2c..8ab39c23 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,8 @@ will consitute of a breaking change warranting a new major release: # [v1.36.0] 2023-03-08 +eive-tmtc: v2.17.2 + ## Added - Star Tracker Assembly diff --git a/tmtc b/tmtc index d758a1f1..a3e03350 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit d758a1f11ac4d39eda08918c124d8736da104687 +Subproject commit a3e03350faf3055835e65e744bc177761448ce20 From ac2c4c7abcb76786d0d6a0da1160a9198ecbbd2b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 9 Mar 2023 16:43:35 +0100 Subject: [PATCH 12/22] heater name bugfix --- common/config/eive/objects.h | 2 +- fsfw | 2 +- mission/core/GenericFactory.cpp | 2 +- tmtc | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common/config/eive/objects.h b/common/config/eive/objects.h index cb468ef2..31d1862d 100644 --- a/common/config/eive/objects.h +++ b/common/config/eive/objects.h @@ -136,7 +136,7 @@ enum commonObjects : uint32_t { HEATER_4_CAMERA = 0x60000004, HEATER_5_STR = 0x60000005, HEATER_6_DRO = 0x60000006, - HEATER_7_HPA = 0x60000007, + HEATER_7_SYRLINKS = 0x60000007, // 0x73 ('s') for assemblies and system/subsystem components ACS_BOARD_ASS = 0x73000001, diff --git a/fsfw b/fsfw index 26e44451..23d9b44b 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 26e4445189b676eaee11840e5a9d0ede25cf3896 +Subproject commit 23d9b44b3e02bb0d35e4622d125b48e9b44fee2c diff --git a/mission/core/GenericFactory.cpp b/mission/core/GenericFactory.cpp index b6119eda..c6a3e216 100644 --- a/mission/core/GenericFactory.cpp +++ b/mission/core/GenericFactory.cpp @@ -224,7 +224,7 @@ void ObjectFactory::createGenericHeaterComponents(GpioIF& gpioIF, PowerSwitchIF& {new HealthDevice(objects::HEATER_4_CAMERA, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_4}, {new HealthDevice(objects::HEATER_5_STR, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_5}, {new HealthDevice(objects::HEATER_6_DRO, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_6}, - {new HealthDevice(objects::HEATER_7_HPA, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_7}, + {new HealthDevice(objects::HEATER_7_SYRLINKS, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_7}, }}); heaterHandler = new HeaterHandler(objects::HEATER_HANDLER, &gpioIF, helper, &pwrSwitcher, pcdu::Switches::PDU2_CH3_TCS_BOARD_HEATER_IN_8V); diff --git a/tmtc b/tmtc index a3e03350..bf158bee 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit a3e03350faf3055835e65e744bc177761448ce20 +Subproject commit bf158bee2d79c95de3ac2e38f4e7d977699711b1 From 9f9b1e440ab3f02de3783cfb7aee691ac1a6c5a9 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 9 Mar 2023 16:52:47 +0100 Subject: [PATCH 13/22] changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ab39c23..4d2e2cbb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,10 @@ will consitute of a breaking change warranting a new major release: # [unreleased] +## Fixed + +- Fix for heater names: HPA heater (index 7) is now the Syrlinks heater. + # [v1.36.0] 2023-03-08 eive-tmtc: v2.17.2 From dd8b6ced8f3c1c094390985c9e7cf86dbe3170c4 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 9 Mar 2023 20:51:22 +0100 Subject: [PATCH 14/22] set initial mode --- mission/system/tree/system.cpp | 1 + tmtc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/mission/system/tree/system.cpp b/mission/system/tree/system.cpp index 215f1b02..242ed8ef 100644 --- a/mission/system/tree/system.cpp +++ b/mission/system/tree/system.cpp @@ -35,6 +35,7 @@ void satsystem::init() { ModeListEntry entry; buildSafeSequence(EIVE_SYSTEM, entry); buildIdleSequence(EIVE_SYSTEM, entry); + EIVE_SYSTEM.setInitialMode(acs::AcsMode::SAFE, 0); } EiveSystem satsystem::EIVE_SYSTEM = EiveSystem(objects::EIVE_SYSTEM, 12, 24); diff --git a/tmtc b/tmtc index bf158bee..b0f51072 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit bf158bee2d79c95de3ac2e38f4e7d977699711b1 +Subproject commit b0f51072b20e4835a3e2143d8b3fb40d14240bfb From f8d432f6eb780b5b9ee66ff37e607ea6b5e501b8 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 9 Mar 2023 20:55:28 +0100 Subject: [PATCH 15/22] initial mode is off now --- mission/system/tree/system.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mission/system/tree/system.cpp b/mission/system/tree/system.cpp index 242ed8ef..a7814fa1 100644 --- a/mission/system/tree/system.cpp +++ b/mission/system/tree/system.cpp @@ -35,7 +35,7 @@ void satsystem::init() { ModeListEntry entry; buildSafeSequence(EIVE_SYSTEM, entry); buildIdleSequence(EIVE_SYSTEM, entry); - EIVE_SYSTEM.setInitialMode(acs::AcsMode::SAFE, 0); + EIVE_SYSTEM.setInitialMode(HasModesIF::MODE_OFF, 0); } EiveSystem satsystem::EIVE_SYSTEM = EiveSystem(objects::EIVE_SYSTEM, 12, 24); From 55bd87abb6283ffec95d00fbbc0f8623827d8b7e Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 9 Mar 2023 23:33:53 +0100 Subject: [PATCH 16/22] smaller tweaks --- bsp_q7s/core/scheduling.cpp | 1 - bsp_q7s/fs/SdCardManager.h | 2 +- linux/devices/ImtqPollingTask.cpp | 5 +++++ mission/system/objects/AcsSubsystem.cpp | 1 + 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/bsp_q7s/core/scheduling.cpp b/bsp_q7s/core/scheduling.cpp index ec47232d..616e7fe9 100644 --- a/bsp_q7s/core/scheduling.cpp +++ b/bsp_q7s/core/scheduling.cpp @@ -235,7 +235,6 @@ void scheduling::initTasks() { PeriodicTaskIF* acsSysTask = factory->createPeriodicTask( "ACS_SYS_TASK", 55, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.4, missedDeadlineFunc); - static_cast(acsSysTask); result = acsSysTask->addComponent(objects::ACS_SUBSYSTEM); if (result != returnvalue::OK) { scheduling::printAddObjectError("ACS_SUBSYSTEM", objects::ACS_SUBSYSTEM); diff --git a/bsp_q7s/fs/SdCardManager.h b/bsp_q7s/fs/SdCardManager.h index 1cd09d7d..874fd786 100644 --- a/bsp_q7s/fs/SdCardManager.h +++ b/bsp_q7s/fs/SdCardManager.h @@ -227,7 +227,7 @@ class SdCardManager : public SystemObject, public SdCardMountedIF { MutexIF* prefLock = nullptr; MutexIF* defaultLock = nullptr; static constexpr MutexIF::TimeoutType LOCK_TYPE = MutexIF::TimeoutType::WAITING; - static constexpr uint32_t SD_LOCK_TIMEOUT = 250; + static constexpr uint32_t SD_LOCK_TIMEOUT = 400; static constexpr uint32_t OTHER_TIMEOUT = 20; static constexpr char LOCK_CTX[] = "SdCardManager"; diff --git a/linux/devices/ImtqPollingTask.cpp b/linux/devices/ImtqPollingTask.cpp index ad4b80ac..c15acd29 100644 --- a/linux/devices/ImtqPollingTask.cpp +++ b/linux/devices/ImtqPollingTask.cpp @@ -120,6 +120,11 @@ void ImtqPollingTask::handleMeasureStep() { } } + // The I2C IP core on EIVE sometimes glitches out. Send start MTM measurement twice. + cmdBuf[0] = imtq::CC::START_MTM_MEASUREMENT; + if (i2cCmdExecMeasure(imtq::CC::START_MTM_MEASUREMENT) != returnvalue::OK) { + return; + } cmdBuf[0] = imtq::CC::START_MTM_MEASUREMENT; if (i2cCmdExecMeasure(imtq::CC::START_MTM_MEASUREMENT) != returnvalue::OK) { return; diff --git a/mission/system/objects/AcsSubsystem.cpp b/mission/system/objects/AcsSubsystem.cpp index e4969ac1..3bab5273 100644 --- a/mission/system/objects/AcsSubsystem.cpp +++ b/mission/system/objects/AcsSubsystem.cpp @@ -56,6 +56,7 @@ ReturnValue_t AcsSubsystem::initialize() { } void AcsSubsystem::performChildOperation() { + // sif::debug << "ACS system thread running" << std::endl; handleEventMessages(); return Subsystem::performChildOperation(); } From fae83a0fca90c23a9ae2918ae1d3cef29fd94ea4 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 10 Mar 2023 02:29:28 +0100 Subject: [PATCH 17/22] this should avoid lock issues al together --- bsp_q7s/core/CoreController.cpp | 25 +++++---- bsp_q7s/fs/SdCardManager.cpp | 89 ++++++++++++++++----------------- bsp_q7s/fs/SdCardManager.h | 10 ++-- 3 files changed, 65 insertions(+), 59 deletions(-) diff --git a/bsp_q7s/core/CoreController.cpp b/bsp_q7s/core/CoreController.cpp index f51f6bf9..d5023111 100644 --- a/bsp_q7s/core/CoreController.cpp +++ b/bsp_q7s/core/CoreController.cpp @@ -42,6 +42,11 @@ CoreController::CoreController(object_id_t objectId) if (not BLOCKING_SD_INIT) { sdcMan->setBlocking(false); } + Stopwatch watch; + sdcMan->updateSdCardStateFile(true); + sdcMan->updateSdStatePair(); + SdCardManager::SdStatePair sdStates; + sdcMan->getSdCardsStatus(sdStates); auto sdCard = sdcMan->getPreferredSdCard(); if (not sdCard.has_value()) { sif::error << "CoreController::initializeAfterTaskCreation: " @@ -50,7 +55,11 @@ CoreController::CoreController(object_id_t objectId) sdCard = sd::SdCard::SLOT_0; } sdInfo.active = sdCard.value(); - sdcMan->setActiveSdCard(sdInfo.active); + if (sdStates.first == sd::SdState::MOUNTED) { + sdcMan->setActiveSdCard(sd::SdCard::SLOT_0); + } else if (sdStates.second == sd::SdState::MOUNTED) { + sdcMan->setActiveSdCard(sd::SdCard::SLOT_1); + } currMntPrefix = sdcMan->getCurrentMountPrefix(); getCurrentBootCopy(CURRENT_CHIP, CURRENT_COPY); @@ -314,7 +323,7 @@ ReturnValue_t CoreController::checkModeCommand(Mode_t mode, Submode_t submode, ReturnValue_t CoreController::initSdCardBlocking() { // Create update status file - ReturnValue_t result = sdcMan->updateSdCardStateFile(); + ReturnValue_t result = sdcMan->updateSdCardStateFile(true); if (result != returnvalue::OK) { sif::warning << "CoreController::initialize: Updating SD card state file failed" << std::endl; } @@ -334,7 +343,7 @@ ReturnValue_t CoreController::initSdCardBlocking() { << static_cast(sdInfo.active) << std::endl; result = sdColdRedundantBlockingInit(); // Update status file - sdcMan->updateSdCardStateFile(); + sdcMan->updateSdCardStateFile(true); return result; } if (sdInfo.cfgMode == SdCfgMode::HOT_REDUNDANT) { @@ -342,7 +351,7 @@ ReturnValue_t CoreController::initSdCardBlocking() { sdCardSetup(sd::SdCard::SLOT_0, sd::SdState::MOUNTED, "0", false); sdCardSetup(sd::SdCard::SLOT_1, sd::SdState::MOUNTED, "1", false); // Update status file - sdcMan->updateSdCardStateFile(); + sdcMan->updateSdCardStateFile(true); } return returnvalue::OK; } @@ -395,7 +404,7 @@ ReturnValue_t CoreController::sdStateMachine() { if (sdFsmState == SdStates::GET_INFO) { if (not sdInfo.commandExecuted) { // Create updated status file - result = sdcMan->updateSdCardStateFile(); + result = sdcMan->updateSdCardStateFile(false); if (result != returnvalue::OK) { sif::warning << "CoreController::sdStateMachine: Updating SD card state file failed" << std::endl; @@ -543,12 +552,8 @@ ReturnValue_t CoreController::sdStateMachine() { if (sdFsmState == SdStates::SKIP_CYCLE_BEFORE_INFO_UPDATE) { sdFsmState = SdStates::UPDATE_INFO; } else if (sdFsmState == SdStates::UPDATE_INFO) { - // It is assumed that all tasks are running by the point this section is reached. - // Therefore, perform this operation in blocking mode because it does not take long - // and the ready state of the SD card is available sooner - sdcMan->setBlocking(true); // Update status file - result = sdcMan->updateSdCardStateFile(); + result = sdcMan->updateSdCardStateFile(true); if (result != returnvalue::OK) { sif::warning << "CoreController::initialize: Updating SD card state file failed" << std::endl; } diff --git a/bsp_q7s/fs/SdCardManager.cpp b/bsp_q7s/fs/SdCardManager.cpp index fa46f8e0..41569000 100644 --- a/bsp_q7s/fs/SdCardManager.cpp +++ b/bsp_q7s/fs/SdCardManager.cpp @@ -195,29 +195,9 @@ ReturnValue_t SdCardManager::setSdCardState(sd::SdCard sdCard, bool on) { return result; } -ReturnValue_t SdCardManager::getSdCardsStatus(SdStatePair& active) { - using namespace std; +ReturnValue_t SdCardManager::getSdCardsStatus(SdStatePair& sdStates) { MutexGuard mg(sdLock, LOCK_TYPE, SD_LOCK_TIMEOUT, LOCK_CTX); - std::error_code e; - if (not filesystem::exists(SD_STATE_FILE, e)) { - return STATUS_FILE_NEXISTS; - } - - // Now the file should exist in any case. Still check whether it exists. - fstream sdStatus(SD_STATE_FILE); - if (not sdStatus.good()) { - return STATUS_FILE_NEXISTS; - } - string line; - uint8_t idx = 0; - sd::SdCard currentSd = sd::SdCard::SLOT_0; - // Process status file line by line - while (std::getline(sdStatus, line)) { - processSdStatusLine(active, line, idx, currentSd); - } - if (active.first != sd::SdState::MOUNTED && active.second != sd::SdState::MOUNTED) { - sdCardActive = false; - } + sdStates = this->sdStates; return returnvalue::OK; } @@ -309,10 +289,9 @@ ReturnValue_t SdCardManager::sanitizeState(SdStatePair* statusPair, sd::SdCard p resetNonBlockingState = true; } if (statusPair == nullptr) { - sdStatusPtr = std::make_unique(); - statusPair = sdStatusPtr.get(); - getSdCardsStatus(*statusPair); + return returnvalue::FAILED; } + getSdCardsStatus(*statusPair); if (statusPair->first == sd::SdState::ON) { result = mountSdCard(prefSdCard); @@ -330,8 +309,34 @@ void SdCardManager::resetState() { currentOp = Operations::IDLE; } -void SdCardManager::processSdStatusLine(std::pair& active, - std::string& line, uint8_t& idx, sd::SdCard& currentSd) { +ReturnValue_t SdCardManager::updateSdStatePair() { + using namespace std; + + MutexGuard mg(sdLock, LOCK_TYPE, SD_LOCK_TIMEOUT, LOCK_CTX); + std::error_code e; + if (not filesystem::exists(SD_STATE_FILE, e)) { + return STATUS_FILE_NEXISTS; + } + + // Now the file should exist in any case. Still check whether it exists. + fstream sdStatus(SD_STATE_FILE); + if (not sdStatus.good()) { + return STATUS_FILE_NEXISTS; + } + string line; + uint8_t idx = 0; + sd::SdCard currentSd = sd::SdCard::SLOT_0; + // Process status file line by line + while (std::getline(sdStatus, line)) { + processSdStatusLine(line, idx, currentSd); + } + if (sdStates.first != sd::SdState::MOUNTED && sdStates.second != sd::SdState::MOUNTED) { + sdCardActive = false; + } + return returnvalue::OK; +} + +void SdCardManager::processSdStatusLine(std::string& line, uint8_t& idx, sd::SdCard& currentSd) { using namespace std; istringstream iss(line); string word; @@ -352,24 +357,24 @@ void SdCardManager::processSdStatusLine(std::pair& act if (word == "on") { if (currentSd == sd::SdCard::SLOT_0) { - active.first = sd::SdState::ON; + sdStates.first = sd::SdState::ON; } else { - active.second = sd::SdState::ON; + sdStates.second = sd::SdState::ON; } } else if (word == "off") { if (currentSd == sd::SdCard::SLOT_0) { - active.first = sd::SdState::OFF; + sdStates.first = sd::SdState::OFF; } else { - active.second = sd::SdState::OFF; + sdStates.second = sd::SdState::OFF; } } } if (mountLine) { if (currentSd == sd::SdCard::SLOT_0) { - active.first = sd::SdState::MOUNTED; + sdStates.first = sd::SdState::MOUNTED; } else { - active.second = sd::SdState::MOUNTED; + sdStates.second = sd::SdState::MOUNTED; } } @@ -400,7 +405,7 @@ ReturnValue_t SdCardManager::setPreferredSdCard(sd::SdCard sdCard) { return scratch::writeNumber(scratch::PREFERED_SDC_KEY, static_cast(sdCard)); } -ReturnValue_t SdCardManager::updateSdCardStateFile() { +ReturnValue_t SdCardManager::updateSdCardStateFile(bool blocking) { if (cmdExecutor.getCurrentState() == CommandExecutor::States::PENDING) { return CommandExecutor::COMMAND_PENDING; } @@ -475,35 +480,29 @@ bool SdCardManager::isSdCardUsable(std::optional sdCard) { } } - SdCardManager::SdStatePair active; - ReturnValue_t result = this->getSdCardsStatus(active); - - if (result != returnvalue::OK) { - sif::debug << "SdCardManager::isSdCardMounted: Failed to get SD card active state"; - return false; - } + MutexGuard mg(sdLock, LOCK_TYPE, SD_LOCK_TIMEOUT, LOCK_CTX); if (not sdCard) { - if (active.first == sd::MOUNTED or active.second == sd::MOUNTED) { + if (sdStates.first == sd::MOUNTED or sdStates.second == sd::MOUNTED) { return true; } return false; } if (sdCard == sd::SLOT_0) { - if (active.first == sd::MOUNTED) { + if (sdStates.first == sd::MOUNTED) { return true; } else { return false; } } if (sdCard == sd::SLOT_1) { - if (active.second == sd::MOUNTED) { + if (sdStates.second == sd::MOUNTED) { return true; } else { return false; } } if (sdCard == sd::BOTH) { - if (active.first == sd::MOUNTED && active.second == sd::MOUNTED) { + if (sdStates.first == sd::MOUNTED && sdStates.second == sd::MOUNTED) { return true; } } diff --git a/bsp_q7s/fs/SdCardManager.h b/bsp_q7s/fs/SdCardManager.h index 1cd09d7d..adc44bb8 100644 --- a/bsp_q7s/fs/SdCardManager.h +++ b/bsp_q7s/fs/SdCardManager.h @@ -25,7 +25,7 @@ class MutexIF; * state */ class SdCardManager : public SystemObject, public SdCardMountedIF { - friend class SdCardAccess; + friend class CoreController; public: using mountInitCb = ReturnValue_t (*)(void* args); @@ -125,7 +125,7 @@ class SdCardManager : public SystemObject, public SdCardMountedIF { * - CommandExecutor::COMMAND_PENDING: Non-blocking command is pending * - returnvalue::FAILED: blocking command failed */ - ReturnValue_t updateSdCardStateFile(); + ReturnValue_t updateSdCardStateFile(bool blocking); /** * Get the state of the SD cards. If the state file does not exist, this function will @@ -218,6 +218,7 @@ class SdCardManager : public SystemObject, public SdCardMountedIF { private: CommandExecutor cmdExecutor; + SdStatePair sdStates; Operations currentOp = Operations::IDLE; bool blocking = false; bool sdCardActive = true; @@ -233,10 +234,11 @@ class SdCardManager : public SystemObject, public SdCardMountedIF { SdCardManager(); + ReturnValue_t updateSdStatePair(); + ReturnValue_t setSdCardState(sd::SdCard sdCard, bool on); - void processSdStatusLine(SdStatePair& active, std::string& line, uint8_t& idx, - sd::SdCard& currentSd); + void processSdStatusLine(std::string& line, uint8_t& idx, sd::SdCard& currentSd); std::optional currentPrefix; From 677a3f95bda21e1a04d8662b29338e750dc3505c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 10 Mar 2023 02:45:21 +0100 Subject: [PATCH 18/22] always update sd state file in blocking manner --- bsp_q7s/core/CoreController.cpp | 19 +++++++++++-------- bsp_q7s/fs/SdCardManager.cpp | 4 ++-- bsp_q7s/fs/SdCardManager.h | 2 +- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/bsp_q7s/core/CoreController.cpp b/bsp_q7s/core/CoreController.cpp index d5023111..7eb0fe5f 100644 --- a/bsp_q7s/core/CoreController.cpp +++ b/bsp_q7s/core/CoreController.cpp @@ -42,8 +42,9 @@ CoreController::CoreController(object_id_t objectId) if (not BLOCKING_SD_INIT) { sdcMan->setBlocking(false); } - Stopwatch watch; - sdcMan->updateSdCardStateFile(true); + // Set up state of SD card manager and own initial state. + // Stopwatch watch; + sdcMan->updateSdCardStateFile(); sdcMan->updateSdStatePair(); SdCardManager::SdStatePair sdStates; sdcMan->getSdCardsStatus(sdStates); @@ -323,7 +324,7 @@ ReturnValue_t CoreController::checkModeCommand(Mode_t mode, Submode_t submode, ReturnValue_t CoreController::initSdCardBlocking() { // Create update status file - ReturnValue_t result = sdcMan->updateSdCardStateFile(true); + ReturnValue_t result = sdcMan->updateSdCardStateFile(); if (result != returnvalue::OK) { sif::warning << "CoreController::initialize: Updating SD card state file failed" << std::endl; } @@ -343,7 +344,7 @@ ReturnValue_t CoreController::initSdCardBlocking() { << static_cast(sdInfo.active) << std::endl; result = sdColdRedundantBlockingInit(); // Update status file - sdcMan->updateSdCardStateFile(true); + sdcMan->updateSdCardStateFile(); return result; } if (sdInfo.cfgMode == SdCfgMode::HOT_REDUNDANT) { @@ -351,7 +352,7 @@ ReturnValue_t CoreController::initSdCardBlocking() { sdCardSetup(sd::SdCard::SLOT_0, sd::SdState::MOUNTED, "0", false); sdCardSetup(sd::SdCard::SLOT_1, sd::SdState::MOUNTED, "1", false); // Update status file - sdcMan->updateSdCardStateFile(true); + sdcMan->updateSdCardStateFile(); } return returnvalue::OK; } @@ -404,12 +405,14 @@ ReturnValue_t CoreController::sdStateMachine() { if (sdFsmState == SdStates::GET_INFO) { if (not sdInfo.commandExecuted) { // Create updated status file - result = sdcMan->updateSdCardStateFile(false); + result = sdcMan->updateSdCardStateFile(); if (result != returnvalue::OK) { sif::warning << "CoreController::sdStateMachine: Updating SD card state file failed" << std::endl; } - sdInfo.commandExecuted = true; + sdFsmState = SdStates::SET_STATE_SELF; + sdInfo.commandExecuted = false; + sdInfo.cycleCount = 0; } else { nonBlockingOpChecking(SdStates::SET_STATE_SELF, 4, "Updating SDC file"); } @@ -553,7 +556,7 @@ ReturnValue_t CoreController::sdStateMachine() { sdFsmState = SdStates::UPDATE_INFO; } else if (sdFsmState == SdStates::UPDATE_INFO) { // Update status file - result = sdcMan->updateSdCardStateFile(true); + result = sdcMan->updateSdCardStateFile(); if (result != returnvalue::OK) { sif::warning << "CoreController::initialize: Updating SD card state file failed" << std::endl; } diff --git a/bsp_q7s/fs/SdCardManager.cpp b/bsp_q7s/fs/SdCardManager.cpp index 41569000..0ced8a04 100644 --- a/bsp_q7s/fs/SdCardManager.cpp +++ b/bsp_q7s/fs/SdCardManager.cpp @@ -405,14 +405,14 @@ ReturnValue_t SdCardManager::setPreferredSdCard(sd::SdCard sdCard) { return scratch::writeNumber(scratch::PREFERED_SDC_KEY, static_cast(sdCard)); } -ReturnValue_t SdCardManager::updateSdCardStateFile(bool blocking) { +ReturnValue_t SdCardManager::updateSdCardStateFile() { if (cmdExecutor.getCurrentState() == CommandExecutor::States::PENDING) { return CommandExecutor::COMMAND_PENDING; } MutexGuard mg(sdLock, LOCK_TYPE, SD_LOCK_TIMEOUT, LOCK_CTX); // Use q7hw utility and pipe the command output into the state file std::string updateCmd = "q7hw sd info all > " + std::string(SD_STATE_FILE); - cmdExecutor.load(updateCmd, blocking, printCmdOutput); + cmdExecutor.load(updateCmd, true, printCmdOutput); ReturnValue_t result = cmdExecutor.execute(); if (blocking and result != returnvalue::OK) { utility::handleSystemError(cmdExecutor.getLastError(), "SdCardManager::mountSdCard"); diff --git a/bsp_q7s/fs/SdCardManager.h b/bsp_q7s/fs/SdCardManager.h index adc44bb8..cee06894 100644 --- a/bsp_q7s/fs/SdCardManager.h +++ b/bsp_q7s/fs/SdCardManager.h @@ -125,7 +125,7 @@ class SdCardManager : public SystemObject, public SdCardMountedIF { * - CommandExecutor::COMMAND_PENDING: Non-blocking command is pending * - returnvalue::FAILED: blocking command failed */ - ReturnValue_t updateSdCardStateFile(bool blocking); + ReturnValue_t updateSdCardStateFile(); /** * Get the state of the SD cards. If the state file does not exist, this function will From a9b514ddc80dcfd409754bb10cc9e24a1d8edddb Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 10 Mar 2023 11:12:44 +0100 Subject: [PATCH 19/22] solved in different PR --- bsp_q7s/fs/SdCardManager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsp_q7s/fs/SdCardManager.h b/bsp_q7s/fs/SdCardManager.h index 874fd786..1cd09d7d 100644 --- a/bsp_q7s/fs/SdCardManager.h +++ b/bsp_q7s/fs/SdCardManager.h @@ -227,7 +227,7 @@ class SdCardManager : public SystemObject, public SdCardMountedIF { MutexIF* prefLock = nullptr; MutexIF* defaultLock = nullptr; static constexpr MutexIF::TimeoutType LOCK_TYPE = MutexIF::TimeoutType::WAITING; - static constexpr uint32_t SD_LOCK_TIMEOUT = 400; + static constexpr uint32_t SD_LOCK_TIMEOUT = 250; static constexpr uint32_t OTHER_TIMEOUT = 20; static constexpr char LOCK_CTX[] = "SdCardManager"; From cca8734908168e42943eda1efc85652b4ae48165 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 10 Mar 2023 11:15:08 +0100 Subject: [PATCH 20/22] add it at actuate step as well --- linux/devices/ImtqPollingTask.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/linux/devices/ImtqPollingTask.cpp b/linux/devices/ImtqPollingTask.cpp index c15acd29..fbd5f847 100644 --- a/linux/devices/ImtqPollingTask.cpp +++ b/linux/devices/ImtqPollingTask.cpp @@ -182,6 +182,11 @@ void ImtqPollingTask::handleActuateStep() { TaskFactory::delayTask(10); cmdLen = 1; + // The I2C IP core on EIVE sometimes glitches out. Send start MTM measurement twice. + cmdBuf[0] = imtq::CC::START_MTM_MEASUREMENT; + if (i2cCmdExecActuate(imtq::CC::START_MTM_MEASUREMENT) != returnvalue::OK) { + return; + } cmdBuf[0] = imtq::CC::START_MTM_MEASUREMENT; if (i2cCmdExecActuate(imtq::CC::START_MTM_MEASUREMENT) != returnvalue::OK) { return; From 86e48eea6deb048bbe00a7d64913bda28717ccea Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 10 Mar 2023 11:16:02 +0100 Subject: [PATCH 21/22] changelog update --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d2e2cbb..b601b8bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,11 @@ will consitute of a breaking change warranting a new major release: - Fix for heater names: HPA heater (index 7) is now the Syrlinks heater. +## Changed + +- Request raw MTM measurement twice for IMTQ, might reduce number of times measurement could not + be retrieved. + # [v1.36.0] 2023-03-08 eive-tmtc: v2.17.2 From 3caa9dea75b6de4ef84fc0df63591a006afc7cb2 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 10 Mar 2023 11:18:34 +0100 Subject: [PATCH 22/22] changelog --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d2e2cbb..bfcb003c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,13 @@ will consitute of a breaking change warranting a new major release: - Fix for heater names: HPA heater (index 7) is now the Syrlinks heater. +## Changed + +- More fixes and improvements for SD card handling. Extend SD card setup in core controller to + create full initial state for SD card manager are core controller as early as possible, turn + execution of setup file update blocking. This might solve the issue with the SD card manager + sometimes blocking for a long time. + # [v1.36.0] 2023-03-08 eive-tmtc: v2.17.2