From 01fbb2d9fd4f052abf81ec53fd1609a2fb38fb64 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sun, 19 Feb 2023 17:06:08 +0100 Subject: [PATCH 1/6] improvements --- mission/devices/HeaterHandler.cpp | 1 + mission/tmtc/CfdpTmFunnel.cpp | 6 ++++++ mission/tmtc/PusTmFunnel.cpp | 6 ++++++ mission/tmtc/VirtualChannel.cpp | 8 +++++--- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/mission/devices/HeaterHandler.cpp b/mission/devices/HeaterHandler.cpp index 9600c0db..1af82604 100644 --- a/mission/devices/HeaterHandler.cpp +++ b/mission/devices/HeaterHandler.cpp @@ -95,6 +95,7 @@ void HeaterHandler::readCommandQueue() { break; } else if (result != returnvalue::OK) { sif::warning << "HeaterHandler::readCommandQueue: Message reception error" << std::endl; + break; } result = actionHelper.handleActionMessage(&command); if (result == returnvalue::OK) { diff --git a/mission/tmtc/CfdpTmFunnel.cpp b/mission/tmtc/CfdpTmFunnel.cpp index f19d5360..50a7b24a 100644 --- a/mission/tmtc/CfdpTmFunnel.cpp +++ b/mission/tmtc/CfdpTmFunnel.cpp @@ -12,6 +12,7 @@ const char* CfdpTmFunnel::getName() const { return "CFDP TM Funnel"; } ReturnValue_t CfdpTmFunnel::performOperation(uint8_t) { TmTcMessage currentMessage; + unsigned int count = 0; ReturnValue_t status = tmQueue->receiveMessage(¤tMessage); while (status == returnvalue::OK) { status = handlePacket(currentMessage); @@ -19,6 +20,11 @@ ReturnValue_t CfdpTmFunnel::performOperation(uint8_t) { sif::warning << "CfdpTmFunnel packet handling failed" << std::endl; break; } + count++; + if(count == 500) { + sif::error << "CfdpTmFunnel: Possible message storm detected" << std::endl; + break; + } status = tmQueue->receiveMessage(¤tMessage); } diff --git a/mission/tmtc/PusTmFunnel.cpp b/mission/tmtc/PusTmFunnel.cpp index dda854a6..e239afc9 100644 --- a/mission/tmtc/PusTmFunnel.cpp +++ b/mission/tmtc/PusTmFunnel.cpp @@ -12,6 +12,7 @@ PusTmFunnel::~PusTmFunnel() = default; ReturnValue_t PusTmFunnel::performOperation(uint8_t) { TmTcMessage currentMessage; + unsigned int count = 0; ReturnValue_t status = tmQueue->receiveMessage(¤tMessage); while (status == returnvalue::OK) { status = handlePacket(currentMessage); @@ -19,6 +20,11 @@ ReturnValue_t PusTmFunnel::performOperation(uint8_t) { sif::warning << "TmFunnel packet handling failed" << std::endl; break; } + count++; + if(count == 500) { + sif::error << "PusTmFunnel: Possible message storm detected" << std::endl; + break; + } status = tmQueue->receiveMessage(¤tMessage); } diff --git a/mission/tmtc/VirtualChannel.cpp b/mission/tmtc/VirtualChannel.cpp index b0f9391d..a33a7dba 100644 --- a/mission/tmtc/VirtualChannel.cpp +++ b/mission/tmtc/VirtualChannel.cpp @@ -28,6 +28,7 @@ ReturnValue_t VirtualChannel::performOperation() { ReturnValue_t result = returnvalue::OK; TmTcMessage message; + unsigned int count = 0; while (tmQueue->receiveMessage(&message) == returnvalue::OK) { store_address_t storeId = message.getStorageId(); const uint8_t* data = nullptr; @@ -45,9 +46,10 @@ ReturnValue_t VirtualChannel::performOperation() { } tmStore->deleteData(storeId); - - if (result != returnvalue::OK) { - return result; + count++; + if(count == 500) { + sif::error << "VirtualChannel: Possible message storm detected" << std::endl; + break; } } return result; From 4b6e0addf1ede2d5005605adad89c29022e6c9e0 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sun, 19 Feb 2023 17:07:48 +0100 Subject: [PATCH 2/6] changelog --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 891a4d76..0c9a05df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,15 @@ change warranting a new major release: - git post checkout hook which initializes and updates the submodules automatically. +## Fixed + +- Limit number of handled messages for core TM handlers: + - https://egit.irs.uni-stuttgart.de/eive/eive-obsw/issues/391 + - https://egit.irs.uni-stuttgart.de/eive/eive-obsw/issues/390 + - https://egit.irs.uni-stuttgart.de/eive/eive-obsw/issues/389 +- HeaterHandler better handling for faulty message reception + Issue: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/issues/388 + # [v1.28.0] 2023-02-17 eive-tmtc: v2.12.7 From 9a9574369a36142a2458008e420d2339a2e26d1e Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sun, 19 Feb 2023 17:08:55 +0100 Subject: [PATCH 3/6] deleted accidentaly --- mission/tmtc/VirtualChannel.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mission/tmtc/VirtualChannel.cpp b/mission/tmtc/VirtualChannel.cpp index a33a7dba..64c7b006 100644 --- a/mission/tmtc/VirtualChannel.cpp +++ b/mission/tmtc/VirtualChannel.cpp @@ -44,8 +44,11 @@ ReturnValue_t VirtualChannel::performOperation() { if (linkIsUp) { result = ptme->writeToVc(vcId, data, size); } - tmStore->deleteData(storeId); + if (result != returnvalue::OK) { + return result; + } + count++; if(count == 500) { sif::error << "VirtualChannel: Possible message storm detected" << std::endl; From 7aa977efdf2e66dbcc0e8b594dee1d237225174d Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 21 Feb 2023 11:32:51 +0100 Subject: [PATCH 4/6] move changelog entry --- CHANGELOG.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a230adad..2134fe20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,15 @@ change warranting a new major release: # [unreleased] +## Fixed + +- Limit number of handled messages for core TM handlers: + - https://egit.irs.uni-stuttgart.de/eive/eive-obsw/issues/391 + - https://egit.irs.uni-stuttgart.de/eive/eive-obsw/issues/390 + - https://egit.irs.uni-stuttgart.de/eive/eive-obsw/issues/389 +- HeaterHandler better handling for faulty message reception + Issue: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/issues/388 + # [v1.29.0] eive-tmtc: v2.13.0 @@ -63,15 +72,6 @@ eive-tmtc: v2.13.0 - git post checkout hook which initializes and updates the submodules automatically. -## Fixed - -- Limit number of handled messages for core TM handlers: - - https://egit.irs.uni-stuttgart.de/eive/eive-obsw/issues/391 - - https://egit.irs.uni-stuttgart.de/eive/eive-obsw/issues/390 - - https://egit.irs.uni-stuttgart.de/eive/eive-obsw/issues/389 -- HeaterHandler better handling for faulty message reception - Issue: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/issues/388 - # [v1.28.0] 2023-02-17 eive-tmtc: v2.12.7 From d9ef0f9a9df91f67948f25daa5e2e6a0e0f742b4 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 21 Feb 2023 11:39:56 +0100 Subject: [PATCH 5/6] small tweak --- CHANGELOG.md | 4 ++++ linux/devices/Max31865RtdPolling.cpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fe2ef411..ddfaf36b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,10 @@ change warranting a new major release: # [unreleased] +# [v1.29.1] + +- Disable stopwatch in MAX31865 polling task + # [v1.29.0] eive-tmtc: v2.13.0 diff --git a/linux/devices/Max31865RtdPolling.cpp b/linux/devices/Max31865RtdPolling.cpp index a22ec145..e59c2ef2 100644 --- a/linux/devices/Max31865RtdPolling.cpp +++ b/linux/devices/Max31865RtdPolling.cpp @@ -26,7 +26,7 @@ ReturnValue_t Max31865RtdPolling::performOperation(uint8_t operationCode) { using namespace MAX31865; ReturnValue_t result = returnvalue::OK; static_cast(result); - Stopwatch watch; + // Stopwatch watch; if (periodicInitHandling()) { #if OBSW_RTD_AUTO_MODE == 0 // 10 ms delay for VBIAS startup From 243088252c2065e063792ea46274cc3db5d3380a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 21 Feb 2023 11:41:38 +0100 Subject: [PATCH 6/6] bump revision --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 688cdceb..076c9ae7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,7 @@ cmake_minimum_required(VERSION 3.13) set(OBSW_VERSION_MAJOR 1) set(OBSW_VERSION_MINOR 29) -set(OBSW_VERSION_REVISION 0) +set(OBSW_VERSION_REVISION 1) # set(CMAKE_VERBOSE TRUE)