From 05b88dd29432b8abeeac75c025a7fadc4a976857 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 24 Jan 2024 14:20:15 +0100 Subject: [PATCH 1/5] add new parameter to skip SUPV commanding --- linux/payload/PlocMpsocHandler.cpp | 20 ++++++++++++++++++++ linux/payload/PlocMpsocHandler.h | 2 ++ linux/payload/plocMpsocHelpers.h | 4 ++++ 3 files changed, 26 insertions(+) diff --git a/linux/payload/PlocMpsocHandler.cpp b/linux/payload/PlocMpsocHandler.cpp index 05b3a04e..6601d957 100644 --- a/linux/payload/PlocMpsocHandler.cpp +++ b/linux/payload/PlocMpsocHandler.cpp @@ -7,6 +7,7 @@ #include "OBSWConfig.h" #include "fsfw/datapool/PoolReadGuard.h" #include "fsfw/globalfunctions/CRC.h" +#include "fsfw/parameters/HasParametersIF.h" PlocMpsocHandler::PlocMpsocHandler(object_id_t objectId, object_id_t uartComIFid, CookieIF* comCookie, PlocMpsocSpecialComHelper* plocMPSoCHelper, @@ -1395,6 +1396,9 @@ bool PlocMpsocHandler::handleHwStartup() { return true; #endif if (powerState == PowerState::IDLE) { + if (skipSupvCommandingToOn) { + powerState = PowerState::DONE; + } if (supv::SUPV_ON) { commandActionHelper.commandAction(supervisorHandler, supv::START_MPSOC); supvTransitionCd.resetTimer(); @@ -1532,3 +1536,19 @@ ReturnValue_t PlocMpsocHandler::checkModeCommand(Mode_t commandedMode, Submode_t } return DeviceHandlerBase::checkModeCommand(commandedMode, commandedSubmode, msToReachTheMode); } + +ReturnValue_t PlocMpsocHandler::getParameter(uint8_t domainId, uint8_t uniqueId, + ParameterWrapper* parameterWrapper, + const ParameterWrapper* newValues, + uint16_t startAtIndex) { + if (uniqueId == mpsoc::ParamId::SKIP_SUPV_ON_COMMANDING) { + uint8_t value = 0; + newValues->getElement(&value); + if (value > 1) { + return HasParametersIF::INVALID_VALUE; + } + parameterWrapper->set(skipSupvCommandingToOn); + } + return DeviceHandlerBase::getParameter(domainId, uniqueId, parameterWrapper, newValues, + startAtIndex); +} diff --git a/linux/payload/PlocMpsocHandler.h b/linux/payload/PlocMpsocHandler.h index 5d584943..42da39de 100644 --- a/linux/payload/PlocMpsocHandler.h +++ b/linux/payload/PlocMpsocHandler.h @@ -201,6 +201,8 @@ class PlocMpsocHandler : public DeviceHandlerBase, public CommandsActionsIF { PowerState powerState = PowerState::IDLE; + uint8_t skipSupvCommandingToOn = false; + /** * @brief Handles events received from the PLOC MPSoC helper */ diff --git a/linux/payload/plocMpsocHelpers.h b/linux/payload/plocMpsocHelpers.h index c9b08a28..f0a69049 100644 --- a/linux/payload/plocMpsocHelpers.h +++ b/linux/payload/plocMpsocHelpers.h @@ -13,6 +13,10 @@ namespace mpsoc { +enum ParamId: uint8_t { + SKIP_SUPV_ON_COMMANDING = 0x01 +}; + enum FileAccessModes : uint8_t { // Opens a file, fails if the file does not exist. OPEN_EXISTING = 0x00, From 928dd9e2e0d24625da2b62f22ee3eebf49020154 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 24 Jan 2024 14:34:34 +0100 Subject: [PATCH 2/5] some fixes --- linux/payload/PlocMpsocHandler.h | 3 +++ linux/payload/plocMpsocHelpers.h | 4 +--- tmtc | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/linux/payload/PlocMpsocHandler.h b/linux/payload/PlocMpsocHandler.h index 42da39de..cdab5884 100644 --- a/linux/payload/PlocMpsocHandler.h +++ b/linux/payload/PlocMpsocHandler.h @@ -318,6 +318,9 @@ class PlocMpsocHandler : public DeviceHandlerBase, public CommandsActionsIF { pwrctrl::EnablePl enablePl = pwrctrl::EnablePl(objects::POWER_CONTROLLER); ReturnValue_t checkModeCommand(Mode_t commandedMode, Submode_t commandedSubmode, uint32_t* msToReachTheMode) override; + + ReturnValue_t getParameter(uint8_t domainId, uint8_t uniqueId, ParameterWrapper* parameterWrapper, + const ParameterWrapper* newValues, uint16_t startAtIndex) override; }; #endif /* BSP_Q7S_DEVICES_PLOC_PLOCMPSOCHANDLER_H_ */ diff --git a/linux/payload/plocMpsocHelpers.h b/linux/payload/plocMpsocHelpers.h index f0a69049..ffd077d9 100644 --- a/linux/payload/plocMpsocHelpers.h +++ b/linux/payload/plocMpsocHelpers.h @@ -13,9 +13,7 @@ namespace mpsoc { -enum ParamId: uint8_t { - SKIP_SUPV_ON_COMMANDING = 0x01 -}; +enum ParamId : uint8_t { SKIP_SUPV_ON_COMMANDING = 0x01 }; enum FileAccessModes : uint8_t { // Opens a file, fails if the file does not exist. diff --git a/tmtc b/tmtc index 747ad34e..1831ea8b 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 747ad34eec5baa5199de49a1330687508c991550 +Subproject commit 1831ea8b7aa4b32d9fdc6b6598269a95b9f71a14 From 5df5c30e3037ca977bfae7c8a4da34ee0bc0979f Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 25 Jan 2024 11:02:39 +0100 Subject: [PATCH 3/5] skip param works --- linux/payload/PlocMpsocHandler.cpp | 18 ++++++++++-------- tmtc | 2 +- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/linux/payload/PlocMpsocHandler.cpp b/linux/payload/PlocMpsocHandler.cpp index 6601d957..9aa110e1 100644 --- a/linux/payload/PlocMpsocHandler.cpp +++ b/linux/payload/PlocMpsocHandler.cpp @@ -1398,15 +1398,16 @@ bool PlocMpsocHandler::handleHwStartup() { if (powerState == PowerState::IDLE) { if (skipSupvCommandingToOn) { powerState = PowerState::DONE; - } - if (supv::SUPV_ON) { - commandActionHelper.commandAction(supervisorHandler, supv::START_MPSOC); - supvTransitionCd.resetTimer(); - powerState = PowerState::PENDING_STARTUP; } else { - triggerEvent(SUPV_NOT_ON, 1); - // Set back to OFF for now, failing the transition. - setMode(MODE_OFF); + if (supv::SUPV_ON) { + commandActionHelper.commandAction(supervisorHandler, supv::START_MPSOC); + supvTransitionCd.resetTimer(); + powerState = PowerState::PENDING_STARTUP; + } else { + triggerEvent(SUPV_NOT_ON, 1); + // Set back to OFF for now, failing the transition. + setMode(MODE_OFF); + } } } if (powerState == PowerState::SUPV_FAILED) { @@ -1548,6 +1549,7 @@ ReturnValue_t PlocMpsocHandler::getParameter(uint8_t domainId, uint8_t uniqueId, return HasParametersIF::INVALID_VALUE; } parameterWrapper->set(skipSupvCommandingToOn); + return returnvalue::OK; } return DeviceHandlerBase::getParameter(domainId, uniqueId, parameterWrapper, newValues, startAtIndex); diff --git a/tmtc b/tmtc index 1831ea8b..bcdd12ca 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 1831ea8b7aa4b32d9fdc6b6598269a95b9f71a14 +Subproject commit bcdd12caf05b6a874b0d3ac2b9436c4061545312 From e4f8f20d784623220a2ad6fff9ae05a0a4a8754a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 25 Jan 2024 11:13:37 +0100 Subject: [PATCH 4/5] allow slightly more time for on cmd --- linux/payload/plocSupvDefs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/payload/plocSupvDefs.h b/linux/payload/plocSupvDefs.h index a770fb49..c3c042e3 100644 --- a/linux/payload/plocSupvDefs.h +++ b/linux/payload/plocSupvDefs.h @@ -49,7 +49,7 @@ static const Event SUPV_EXE_ACK_UNKNOWN_COMMAND = MAKE_EVENT(10, severity::LOW); extern std::atomic_bool SUPV_ON; static constexpr uint32_t INTER_COMMAND_DELAY = 20; static constexpr uint32_t BOOT_TIMEOUT_MS = 4000; -static constexpr uint32_t MAX_TRANSITION_TIME_TO_ON_MS = BOOT_TIMEOUT_MS + 2000; +static constexpr uint32_t MAX_TRANSITION_TIME_TO_ON_MS = BOOT_TIMEOUT_MS + 3000; static constexpr uint32_t MAX_TRANSITION_TIME_TO_OFF_MS = 1000; namespace result { From a778daacfd14b968a6070a512a0ad9d13a9def59 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 25 Jan 2024 11:14:57 +0100 Subject: [PATCH 5/5] changelog --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8202cea7..825810a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,14 @@ will consitute of a breaking change warranting a new major release: # [unreleased] +## Added + +- Added new parameter for MPSoC which allows to skip SUPV commanding. + +## Changed + +- Increased allowed mode transition time for PLOC SUPV. + # [v7.5.5] 2024-01-22 ## Fixed