From c53c052876eade22eda09ff92dab7b9e96ccabae Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 27 Mar 2023 17:02:02 +0200 Subject: [PATCH 01/27] lower delays --- linux/ipcore/PapbVcInterface.cpp | 17 ++++++++++------- linux/ipcore/PapbVcInterface.h | 4 +++- mission/tmtc/PersistentLogTmStoreTask.cpp | 8 ++------ mission/tmtc/PersistentSingleTmStoreTask.cpp | 10 ++-------- mission/tmtc/PersistentTmStore.cpp | 2 +- tmtc | 2 +- 6 files changed, 19 insertions(+), 24 deletions(-) diff --git a/linux/ipcore/PapbVcInterface.cpp b/linux/ipcore/PapbVcInterface.cpp index 8c98df90..57dcb963 100644 --- a/linux/ipcore/PapbVcInterface.cpp +++ b/linux/ipcore/PapbVcInterface.cpp @@ -26,20 +26,20 @@ ReturnValue_t PapbVcInterface::initialize() { } ReturnValue_t PapbVcInterface::write(const uint8_t* data, size_t size) { - if (pollPapbBusySignal(0, 0) == returnvalue::OK) { + if (pollPapbBusySignal(0) == returnvalue::OK) { startPacketTransfer(); } else { return DirectTmSinkIF::IS_BUSY; } for (size_t idx = 0; idx < size; idx++) { - if (pollPapbBusySignal(10, 10) == returnvalue::OK) { + if (pollPapbBusySignal(5) == returnvalue::OK) { *(vcBaseReg + DATA_REG_OFFSET) = static_cast(data[idx]); } else { abortPacketTransfer(); return returnvalue::FAILED; } } - if (pollPapbBusySignal(10, 10) == returnvalue::OK) { + if (pollPapbBusySignal(5) == returnvalue::OK) { completePacketTransfer(); } else { abortPacketTransfer(); @@ -52,11 +52,11 @@ void PapbVcInterface::startPacketTransfer() { *vcBaseReg = CONFIG_START; } void PapbVcInterface::completePacketTransfer() { *vcBaseReg = CONFIG_END; } -ReturnValue_t PapbVcInterface::pollPapbBusySignal(uint32_t maxPollRetries, - uint32_t retryDelayUs) const { +ReturnValue_t PapbVcInterface::pollPapbBusySignal(uint32_t maxPollRetries) const { gpio::Levels papbBusyState = gpio::Levels::LOW; ReturnValue_t result; uint32_t busyIdx = 0; + uint32_t nextDelay = 1; while (true) { /** Check if PAPB interface is ready to receive data */ @@ -75,7 +75,10 @@ ReturnValue_t PapbVcInterface::pollPapbBusySignal(uint32_t maxPollRetries, return PAPB_BUSY; } - usleep(retryDelayUs); + usleep(nextDelay); + if (nextDelay * 2 <= MAX_DELAY_PAPB_POLLING_US) { + nextDelay *= 2; + } } return returnvalue::OK; } @@ -100,7 +103,7 @@ void PapbVcInterface::isVcInterfaceBufferEmpty() { return; } -bool PapbVcInterface::isBusy() const { return pollPapbBusySignal(0, 0) == PAPB_BUSY; } +bool PapbVcInterface::isBusy() const { return pollPapbBusySignal(0) == PAPB_BUSY; } void PapbVcInterface::cancelTransfer() { abortPacketTransfer(); } diff --git a/linux/ipcore/PapbVcInterface.h b/linux/ipcore/PapbVcInterface.h index 7491398c..f0cd327b 100644 --- a/linux/ipcore/PapbVcInterface.h +++ b/linux/ipcore/PapbVcInterface.h @@ -76,6 +76,8 @@ class PapbVcInterface : public VirtualChannelIF { */ static const int DATA_REG_OFFSET = 256; + static constexpr uint32_t MAX_DELAY_PAPB_POLLING_US = 4; + LinuxLibgpioIF* gpioComIF = nullptr; /** Pulled to low when virtual channel not ready to receive data */ @@ -111,7 +113,7 @@ class PapbVcInterface : public VirtualChannelIF { * * @return returnvalue::OK when ready to receive data else PAPB_BUSY. */ - ReturnValue_t pollPapbBusySignal(uint32_t maxPollRetries, uint32_t retryDelayUs) const; + ReturnValue_t pollPapbBusySignal(uint32_t maxPollRetries) const; /** * @brief This function can be used for debugging to check whether there are packets in diff --git a/mission/tmtc/PersistentLogTmStoreTask.cpp b/mission/tmtc/PersistentLogTmStoreTask.cpp index ccabb16d..2b7e1333 100644 --- a/mission/tmtc/PersistentLogTmStoreTask.cpp +++ b/mission/tmtc/PersistentLogTmStoreTask.cpp @@ -33,12 +33,8 @@ ReturnValue_t PersistentLogTmStoreTask::performOperation(uint8_t opCode) { stateHandlingForStore(handleOneStore(stores.miscStore, miscStoreContext)); if (not someonesBusy) { TaskFactory::delayTask(100); - } else /* and graceDelayDuringDumping.hasTimedOut()*/ { - if (someFileWasSwapped) { - TaskFactory::delayTask(20); - } - // TaskFactory::delayTask(2); - // graceDelayDuringDumping.resetTimer(); + } else if (someFileWasSwapped) { + TaskFactory::delayTask(2); } } } diff --git a/mission/tmtc/PersistentSingleTmStoreTask.cpp b/mission/tmtc/PersistentSingleTmStoreTask.cpp index a814694e..32ae06c4 100644 --- a/mission/tmtc/PersistentSingleTmStoreTask.cpp +++ b/mission/tmtc/PersistentSingleTmStoreTask.cpp @@ -18,14 +18,8 @@ ReturnValue_t PersistentSingleTmStoreTask::performOperation(uint8_t opCode) { bool busy = handleOneStore(storeWithQueue, dumpContext); if (not busy) { TaskFactory::delayTask(100); - } else { - if (fileHasSwapped) { - TaskFactory::delayTask(20); - } - // if (fileHasSwapped and graceDelayDuringDumping.hasTimedOut()) { - // TaskFactory::delayTask(2); - // graceDelayDuringDumping.resetTimer(); - // } + } else if (fileHasSwapped) { + TaskFactory::delayTask(2); } } } diff --git a/mission/tmtc/PersistentTmStore.cpp b/mission/tmtc/PersistentTmStore.cpp index 6cbcac86..949657d5 100644 --- a/mission/tmtc/PersistentTmStore.cpp +++ b/mission/tmtc/PersistentTmStore.cpp @@ -212,7 +212,7 @@ ReturnValue_t PersistentTmStore::loadNextDumpFile() { sif::error << "PersistentTmStore: Could not retrieve file size: " << e.message() << std::endl; continue; } - sif::debug << "Path: " << dumpParams.dirEntry.path() << std::endl; + // sif::debug << "Path: " << dumpParams.dirEntry.path() << std::endl; // File empty or can't even read CCSDS header. if (dumpParams.fileSize <= 6) { diff --git a/tmtc b/tmtc index f6fcb2fb..3f352346 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit f6fcb2fb282d79b1e250722eba46a319603b0232 +Subproject commit 3f3523465a141bc2a2c36cbc9cbbf6ab7b3a9d70 -- 2.43.0 From 1a0e632d2f442f13a439a35fa8d270641d041568 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 27 Mar 2023 17:42:54 +0200 Subject: [PATCH 02/27] go down to nanoseconds --- linux/ipcore/PapbVcInterface.cpp | 9 +++++---- linux/ipcore/PapbVcInterface.h | 3 ++- mission/tmtc/PersistentLogTmStoreTask.cpp | 2 +- mission/tmtc/PersistentSingleTmStoreTask.cpp | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/linux/ipcore/PapbVcInterface.cpp b/linux/ipcore/PapbVcInterface.cpp index 57dcb963..e41bf23b 100644 --- a/linux/ipcore/PapbVcInterface.cpp +++ b/linux/ipcore/PapbVcInterface.cpp @@ -3,6 +3,7 @@ #include #include "fsfw/serviceinterface/ServiceInterface.h" +#include PapbVcInterface::PapbVcInterface(LinuxLibgpioIF* gpioComIF, gpioId_t papbBusyId, gpioId_t papbEmptyId, std::string uioFile, int mapNum) @@ -56,7 +57,7 @@ ReturnValue_t PapbVcInterface::pollPapbBusySignal(uint32_t maxPollRetries) const gpio::Levels papbBusyState = gpio::Levels::LOW; ReturnValue_t result; uint32_t busyIdx = 0; - uint32_t nextDelay = 1; + struct timespec nextDelay = {.tv_sec = 0, .tv_nsec = 10}; while (true) { /** Check if PAPB interface is ready to receive data */ @@ -75,9 +76,9 @@ ReturnValue_t PapbVcInterface::pollPapbBusySignal(uint32_t maxPollRetries) const return PAPB_BUSY; } - usleep(nextDelay); - if (nextDelay * 2 <= MAX_DELAY_PAPB_POLLING_US) { - nextDelay *= 2; + nanosleep(&nextDelay, const_cast(&remDelay)); + if (nextDelay.tv_nsec * 2 <= MAX_DELAY_PAPB_POLLING_NS) { + nextDelay.tv_nsec *= 2; } } return returnvalue::OK; diff --git a/linux/ipcore/PapbVcInterface.h b/linux/ipcore/PapbVcInterface.h index f0cd327b..59200207 100644 --- a/linux/ipcore/PapbVcInterface.h +++ b/linux/ipcore/PapbVcInterface.h @@ -76,7 +76,7 @@ class PapbVcInterface : public VirtualChannelIF { */ static const int DATA_REG_OFFSET = 256; - static constexpr uint32_t MAX_DELAY_PAPB_POLLING_US = 4; + static constexpr long int MAX_DELAY_PAPB_POLLING_NS = 40; LinuxLibgpioIF* gpioComIF = nullptr; @@ -87,6 +87,7 @@ class PapbVcInterface : public VirtualChannelIF { std::string uioFile; int mapNum = 0; + struct timespec remDelay; volatile uint32_t* vcBaseReg = nullptr; diff --git a/mission/tmtc/PersistentLogTmStoreTask.cpp b/mission/tmtc/PersistentLogTmStoreTask.cpp index 2b7e1333..2f30dafc 100644 --- a/mission/tmtc/PersistentLogTmStoreTask.cpp +++ b/mission/tmtc/PersistentLogTmStoreTask.cpp @@ -34,7 +34,7 @@ ReturnValue_t PersistentLogTmStoreTask::performOperation(uint8_t opCode) { if (not someonesBusy) { TaskFactory::delayTask(100); } else if (someFileWasSwapped) { - TaskFactory::delayTask(2); + TaskFactory::delayTask(1); } } } diff --git a/mission/tmtc/PersistentSingleTmStoreTask.cpp b/mission/tmtc/PersistentSingleTmStoreTask.cpp index 32ae06c4..693d2c2c 100644 --- a/mission/tmtc/PersistentSingleTmStoreTask.cpp +++ b/mission/tmtc/PersistentSingleTmStoreTask.cpp @@ -19,7 +19,7 @@ ReturnValue_t PersistentSingleTmStoreTask::performOperation(uint8_t opCode) { if (not busy) { TaskFactory::delayTask(100); } else if (fileHasSwapped) { - TaskFactory::delayTask(2); + TaskFactory::delayTask(1); } } } -- 2.43.0 From 363fc892099ae38aa286f4c81974606a663c9574 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 27 Mar 2023 17:43:52 +0200 Subject: [PATCH 03/27] thsi is cleaner --- linux/ipcore/PapbVcInterface.cpp | 3 ++- linux/ipcore/PapbVcInterface.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/linux/ipcore/PapbVcInterface.cpp b/linux/ipcore/PapbVcInterface.cpp index e41bf23b..586bf9b3 100644 --- a/linux/ipcore/PapbVcInterface.cpp +++ b/linux/ipcore/PapbVcInterface.cpp @@ -76,7 +76,8 @@ ReturnValue_t PapbVcInterface::pollPapbBusySignal(uint32_t maxPollRetries) const return PAPB_BUSY; } - nanosleep(&nextDelay, const_cast(&remDelay)); + // Ignore signal handling here for now. + nanosleep(&nextDelay, &remDelay); if (nextDelay.tv_nsec * 2 <= MAX_DELAY_PAPB_POLLING_NS) { nextDelay.tv_nsec *= 2; } diff --git a/linux/ipcore/PapbVcInterface.h b/linux/ipcore/PapbVcInterface.h index 59200207..3d150806 100644 --- a/linux/ipcore/PapbVcInterface.h +++ b/linux/ipcore/PapbVcInterface.h @@ -87,7 +87,7 @@ class PapbVcInterface : public VirtualChannelIF { std::string uioFile; int mapNum = 0; - struct timespec remDelay; + mutable struct timespec remDelay; volatile uint32_t* vcBaseReg = nullptr; -- 2.43.0 From fcb5613aa84c908fbee909d4b69db4671faa2dae Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 27 Mar 2023 17:44:51 +0200 Subject: [PATCH 04/27] changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7cb32c1f..ab321fec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,8 @@ will consitute of a breaking change warranting a new major release: - Proper Faulty/External Control handling for the dual lane assemblies. - ACS board devices: Go to ON mode instead of going to NORMAL mode directly. - SUS device handlers: Go to ON mode on startup instead of NORMAL mode. +- Tweaks for the delay handling for the persistent TM stores. This allows pushing the full + high datarate when dumping telemetry. ## Changed -- 2.43.0 From f1774fe80f6e5d421ecb385dc99d91ca417e0a20 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 27 Mar 2023 18:13:00 +0200 Subject: [PATCH 05/27] docs --- linux/ipcore/PapbVcInterface.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/linux/ipcore/PapbVcInterface.cpp b/linux/ipcore/PapbVcInterface.cpp index 586bf9b3..e0773afe 100644 --- a/linux/ipcore/PapbVcInterface.cpp +++ b/linux/ipcore/PapbVcInterface.cpp @@ -78,6 +78,7 @@ ReturnValue_t PapbVcInterface::pollPapbBusySignal(uint32_t maxPollRetries) const // Ignore signal handling here for now. nanosleep(&nextDelay, &remDelay); + // Adaptive delay. if (nextDelay.tv_nsec * 2 <= MAX_DELAY_PAPB_POLLING_NS) { nextDelay.tv_nsec *= 2; } -- 2.43.0 From 1727168ee5a200bbd6bc006d300fe28b0379df86 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 27 Mar 2023 18:39:53 +0200 Subject: [PATCH 06/27] now its getitng weird --- linux/ipcore/PapbVcInterface.cpp | 6 +++--- linux/ipcore/PapbVcInterface.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/linux/ipcore/PapbVcInterface.cpp b/linux/ipcore/PapbVcInterface.cpp index e0773afe..11c520de 100644 --- a/linux/ipcore/PapbVcInterface.cpp +++ b/linux/ipcore/PapbVcInterface.cpp @@ -33,14 +33,14 @@ ReturnValue_t PapbVcInterface::write(const uint8_t* data, size_t size) { return DirectTmSinkIF::IS_BUSY; } for (size_t idx = 0; idx < size; idx++) { - if (pollPapbBusySignal(5) == returnvalue::OK) { + if (pollPapbBusySignal(10) == returnvalue::OK) { *(vcBaseReg + DATA_REG_OFFSET) = static_cast(data[idx]); } else { abortPacketTransfer(); return returnvalue::FAILED; } } - if (pollPapbBusySignal(5) == returnvalue::OK) { + if (pollPapbBusySignal(10) == returnvalue::OK) { completePacketTransfer(); } else { abortPacketTransfer(); @@ -57,7 +57,7 @@ ReturnValue_t PapbVcInterface::pollPapbBusySignal(uint32_t maxPollRetries) const gpio::Levels papbBusyState = gpio::Levels::LOW; ReturnValue_t result; uint32_t busyIdx = 0; - struct timespec nextDelay = {.tv_sec = 0, .tv_nsec = 10}; + struct timespec nextDelay = {.tv_sec = 0, .tv_nsec = 1000}; while (true) { /** Check if PAPB interface is ready to receive data */ diff --git a/linux/ipcore/PapbVcInterface.h b/linux/ipcore/PapbVcInterface.h index 3d150806..17bc6f94 100644 --- a/linux/ipcore/PapbVcInterface.h +++ b/linux/ipcore/PapbVcInterface.h @@ -76,7 +76,7 @@ class PapbVcInterface : public VirtualChannelIF { */ static const int DATA_REG_OFFSET = 256; - static constexpr long int MAX_DELAY_PAPB_POLLING_NS = 40; + static constexpr long int MAX_DELAY_PAPB_POLLING_NS = 4000; LinuxLibgpioIF* gpioComIF = nullptr; -- 2.43.0 From 7023fe5c4299521d16aee0ce6b35a258bb73b597 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 27 Mar 2023 18:59:31 +0200 Subject: [PATCH 07/27] this is weird --- linux/ipcore/PapbVcInterface.cpp | 6 +++--- linux/ipcore/PapbVcInterface.h | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/linux/ipcore/PapbVcInterface.cpp b/linux/ipcore/PapbVcInterface.cpp index 11c520de..d9ff4ce5 100644 --- a/linux/ipcore/PapbVcInterface.cpp +++ b/linux/ipcore/PapbVcInterface.cpp @@ -33,14 +33,14 @@ ReturnValue_t PapbVcInterface::write(const uint8_t* data, size_t size) { return DirectTmSinkIF::IS_BUSY; } for (size_t idx = 0; idx < size; idx++) { - if (pollPapbBusySignal(10) == returnvalue::OK) { + if (pollPapbBusySignal(20) == returnvalue::OK) { *(vcBaseReg + DATA_REG_OFFSET) = static_cast(data[idx]); } else { abortPacketTransfer(); return returnvalue::FAILED; } } - if (pollPapbBusySignal(10) == returnvalue::OK) { + if (pollPapbBusySignal(20) == returnvalue::OK) { completePacketTransfer(); } else { abortPacketTransfer(); @@ -57,7 +57,7 @@ ReturnValue_t PapbVcInterface::pollPapbBusySignal(uint32_t maxPollRetries) const gpio::Levels papbBusyState = gpio::Levels::LOW; ReturnValue_t result; uint32_t busyIdx = 0; - struct timespec nextDelay = {.tv_sec = 0, .tv_nsec = 1000}; + nextDelay.tv_nsec = 1000; while (true) { /** Check if PAPB interface is ready to receive data */ diff --git a/linux/ipcore/PapbVcInterface.h b/linux/ipcore/PapbVcInterface.h index 17bc6f94..484390b2 100644 --- a/linux/ipcore/PapbVcInterface.h +++ b/linux/ipcore/PapbVcInterface.h @@ -87,6 +87,7 @@ class PapbVcInterface : public VirtualChannelIF { std::string uioFile; int mapNum = 0; + mutable struct timespec nextDelay = {.tv_sec = 0, .tv_nsec = 1000}; mutable struct timespec remDelay; volatile uint32_t* vcBaseReg = nullptr; -- 2.43.0 From fb324516bb497af4541d51017c184d077e63fe47 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 27 Mar 2023 21:23:09 +0200 Subject: [PATCH 08/27] this is insane --- linux/ipcore/PapbVcInterface.cpp | 4 ++-- mission/tmtc/PersistentLogTmStoreTask.cpp | 2 +- mission/tmtc/PersistentSingleTmStoreTask.cpp | 21 +++++++++++++++++++- mission/tmtc/TmStoreTaskBase.cpp | 17 +++++++++++++++- mission/tmtc/TmStoreTaskBase.h | 4 +++- mission/tmtc/VirtualChannel.cpp | 16 +++++++-------- mission/tmtc/VirtualChannel.h | 2 +- 7 files changed, 51 insertions(+), 15 deletions(-) diff --git a/linux/ipcore/PapbVcInterface.cpp b/linux/ipcore/PapbVcInterface.cpp index d9ff4ce5..df9df839 100644 --- a/linux/ipcore/PapbVcInterface.cpp +++ b/linux/ipcore/PapbVcInterface.cpp @@ -33,14 +33,14 @@ ReturnValue_t PapbVcInterface::write(const uint8_t* data, size_t size) { return DirectTmSinkIF::IS_BUSY; } for (size_t idx = 0; idx < size; idx++) { - if (pollPapbBusySignal(20) == returnvalue::OK) { + if (pollPapbBusySignal(5) == returnvalue::OK) { *(vcBaseReg + DATA_REG_OFFSET) = static_cast(data[idx]); } else { abortPacketTransfer(); return returnvalue::FAILED; } } - if (pollPapbBusySignal(20) == returnvalue::OK) { + if (pollPapbBusySignal(5) == returnvalue::OK) { completePacketTransfer(); } else { abortPacketTransfer(); diff --git a/mission/tmtc/PersistentLogTmStoreTask.cpp b/mission/tmtc/PersistentLogTmStoreTask.cpp index 2f30dafc..2b7e1333 100644 --- a/mission/tmtc/PersistentLogTmStoreTask.cpp +++ b/mission/tmtc/PersistentLogTmStoreTask.cpp @@ -34,7 +34,7 @@ ReturnValue_t PersistentLogTmStoreTask::performOperation(uint8_t opCode) { if (not someonesBusy) { TaskFactory::delayTask(100); } else if (someFileWasSwapped) { - TaskFactory::delayTask(1); + TaskFactory::delayTask(2); } } } diff --git a/mission/tmtc/PersistentSingleTmStoreTask.cpp b/mission/tmtc/PersistentSingleTmStoreTask.cpp index 693d2c2c..01a7c206 100644 --- a/mission/tmtc/PersistentSingleTmStoreTask.cpp +++ b/mission/tmtc/PersistentSingleTmStoreTask.cpp @@ -1,6 +1,7 @@ #include #include #include +#include PersistentSingleTmStoreTask::PersistentSingleTmStoreTask( object_id_t objectId, StorageManagerIF& ipcStore, PersistentTmStoreWithTmQueue& tmStore, @@ -10,6 +11,7 @@ PersistentSingleTmStoreTask::PersistentSingleTmStoreTask( dumpContext(eventIfDumpDone) {} ReturnValue_t PersistentSingleTmStoreTask::performOperation(uint8_t opCode) { + uint32_t dummy = 0; while (true) { // Delay done by the check if (not cyclicStoreCheck()) { @@ -18,9 +20,26 @@ ReturnValue_t PersistentSingleTmStoreTask::performOperation(uint8_t opCode) { bool busy = handleOneStore(storeWithQueue, dumpContext); if (not busy) { TaskFactory::delayTask(100); + } else if(dumpContext.vcBusyDuringDump) { + TaskFactory::delayTask(30); } else if (fileHasSwapped) { - TaskFactory::delayTask(1); + TaskFactory::delayTask(30); + } else if(dumpContext.packetWasDumped and dumpContext.numberOfDumpedPackets % 5 == 0) { + TaskFactory::delayTask(30); + } else { +// dummy++; +// if(dummy % 2000 == 0) { +// sif::warning << "persistent tm store is stupid" << std::endl; +// } + TaskFactory::delayTask(2); +// continue; } + dummy = 0; + //else if(dumpContext.numberOfDumpedPackets % 20 == 0) { + // Manual load management because I don't know what the scheduler is doing.. + // Removing this delay can lead to evil side effects. + //TaskFactory::delayTask(5); + //} } } diff --git a/mission/tmtc/TmStoreTaskBase.cpp b/mission/tmtc/TmStoreTaskBase.cpp index eefe9dc6..dc32d6e2 100644 --- a/mission/tmtc/TmStoreTaskBase.cpp +++ b/mission/tmtc/TmStoreTaskBase.cpp @@ -17,23 +17,33 @@ bool TmStoreTaskBase::handleOneStore(PersistentTmStoreWithTmQueue& store, bool tmToStoreReceived = false; bool tcRequestReceived = false; bool dumpsPerformed = false; + fileHasSwapped = false; + // Store TM persistently result = store.handleNextTm(); if (result == returnvalue::OK) { tmToStoreReceived = true; } + dumpContext.vcBusyDuringDump = false; // Dump TMs when applicable if (store.getState() == PersistentTmStore::State::DUMPING) { size_t dumpedLen = 0; if (not channel.isBusy()) { + dumpContext.ptmeBusyCounter = 0; tmSinkBusyCd.resetTimer(); - result = store.dumpNextPacket(channel, dumpedLen, fileHasSwapped); + bool fileHasSwappedLocal = false; + result = store.dumpNextPacket(channel, dumpedLen, fileHasSwappedLocal); if (result == DirectTmSinkIF::IS_BUSY) { sif::warning << "Unexpected PAPB busy" << std::endl; } if ((result == PersistentTmStore::DUMP_DONE or result == returnvalue::OK) and dumpedLen > 0) { dumpContext.dumpedBytes += dumpedLen; dumpContext.numberOfDumpedPackets += 1; + dumpContext.packetWasDumped = true; + // Only register file swaps if more than 0 bytes were dumped. + if(fileHasSwappedLocal) { + fileHasSwapped = true; + } } if (result == PersistentTmStore::DUMP_DONE) { uint32_t startTime; @@ -46,11 +56,16 @@ bool TmStoreTaskBase::handleOneStore(PersistentTmStoreWithTmQueue& store, dumpsPerformed = true; } } else { + dumpContext.vcBusyDuringDump = true; dumpContext.ptmeBusyCounter++; if (dumpContext.ptmeBusyCounter == 50) { + // If this happens, something is probably wrong. sif::warning << "PTME busy for longer period. Dumped length so far: " << dumpContext.dumpedBytes << std::endl; dumpContext.ptmeBusyCounter = 0; + triggerEvent(persTmStore::DUMP_WAS_CANCELLED, store.getObjectId()); + store.cancelDump(); + channel.cancelTransfer(); } } if (cancelDumpCd.hasTimedOut() or tmSinkBusyCd.hasTimedOut()) { diff --git a/mission/tmtc/TmStoreTaskBase.h b/mission/tmtc/TmStoreTaskBase.h index aa0efbb4..b9a81bec 100644 --- a/mission/tmtc/TmStoreTaskBase.h +++ b/mission/tmtc/TmStoreTaskBase.h @@ -17,6 +17,8 @@ class TmStoreTaskBase : public SystemObject { uint32_t numberOfDumpedPackets = 0; uint32_t dumpedBytes = 0; uint32_t ptmeBusyCounter = 0; + bool packetWasDumped = false; + bool vcBusyDuringDump = false; }; TmStoreTaskBase(object_id_t objectId, StorageManagerIF& ipcStore, VirtualChannel& channel, @@ -43,7 +45,7 @@ class TmStoreTaskBase : public SystemObject { // 20 minutes are allowed as maximum dump time. Countdown cancelDumpCd = Countdown(60 * 20 * 1000); // If the TM sink is busy for 1 minute for whatever reason, cancel the dump. - Countdown tmSinkBusyCd = Countdown(60 * 1000); + Countdown tmSinkBusyCd = Countdown(60 * 20 * 1000);//Countdown(60 * 1000 ); VirtualChannel& channel; bool storesInitialized = false; bool fileHasSwapped = false; diff --git a/mission/tmtc/VirtualChannel.cpp b/mission/tmtc/VirtualChannel.cpp index 4fed30b1..2c03f361 100644 --- a/mission/tmtc/VirtualChannel.cpp +++ b/mission/tmtc/VirtualChannel.cpp @@ -1,12 +1,12 @@ #include "VirtualChannel.h" VirtualChannel::VirtualChannel(object_id_t objectId, uint8_t vcId, const char* vcName, PtmeIF& ptme, - const std::atomic_bool& linkStateProvider) + const std::atomic_bool& txOn) : SystemObject(objectId), ptme(ptme), vcId(vcId), vcName(vcName), - linkStateProvider(linkStateProvider) {} + txOn(txOn) {} ReturnValue_t VirtualChannel::initialize() { return returnvalue::OK; } @@ -15,10 +15,10 @@ ReturnValue_t VirtualChannel::sendNextTm(const uint8_t* data, size_t size) { } ReturnValue_t VirtualChannel::write(const uint8_t* data, size_t size) { - if (linkStateProvider.load()) { + //if (txOn) { return ptme.writeToVc(vcId, data, size); - } - return returnvalue::OK; + //} + //return returnvalue::OK; } uint8_t VirtualChannel::getVcid() const { return vcId; } @@ -27,9 +27,9 @@ const char* VirtualChannel::getName() const { return vcName.c_str(); } bool VirtualChannel::isBusy() const { // Data is discarded, so channel is not busy. - if (linkStateProvider.load()) { - return false; - } + //if (not txOn) { + // return false; + //} return ptme.isBusy(vcId); } diff --git a/mission/tmtc/VirtualChannel.h b/mission/tmtc/VirtualChannel.h index 4cad3305..7de0633f 100644 --- a/mission/tmtc/VirtualChannel.h +++ b/mission/tmtc/VirtualChannel.h @@ -37,5 +37,5 @@ class VirtualChannel : public SystemObject, public VirtualChannelIF { PtmeIF& ptme; uint8_t vcId = 0; std::string vcName; - const std::atomic_bool& linkStateProvider; + const std::atomic_bool& txOn; }; -- 2.43.0 From 00214dc378027835db8cb69bbecc14a000f9ddfe Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 27 Mar 2023 21:39:37 +0200 Subject: [PATCH 09/27] found some more bugs --- linux/ipcore/PapbVcInterface.cpp | 7 ++--- mission/tmtc/PersistentSingleTmStoreTask.cpp | 27 ++++++++------------ mission/tmtc/TmStoreTaskBase.cpp | 16 ++++++------ mission/tmtc/TmStoreTaskBase.h | 7 ++++- mission/tmtc/VirtualChannel.cpp | 14 ++++------ 5 files changed, 33 insertions(+), 38 deletions(-) diff --git a/linux/ipcore/PapbVcInterface.cpp b/linux/ipcore/PapbVcInterface.cpp index df9df839..1808d935 100644 --- a/linux/ipcore/PapbVcInterface.cpp +++ b/linux/ipcore/PapbVcInterface.cpp @@ -2,9 +2,10 @@ #include #include -#include "fsfw/serviceinterface/ServiceInterface.h" #include +#include "fsfw/serviceinterface/ServiceInterface.h" + PapbVcInterface::PapbVcInterface(LinuxLibgpioIF* gpioComIF, gpioId_t papbBusyId, gpioId_t papbEmptyId, std::string uioFile, int mapNum) : gpioComIF(gpioComIF), @@ -33,14 +34,14 @@ ReturnValue_t PapbVcInterface::write(const uint8_t* data, size_t size) { return DirectTmSinkIF::IS_BUSY; } for (size_t idx = 0; idx < size; idx++) { - if (pollPapbBusySignal(5) == returnvalue::OK) { + if (pollPapbBusySignal(3) == returnvalue::OK) { *(vcBaseReg + DATA_REG_OFFSET) = static_cast(data[idx]); } else { abortPacketTransfer(); return returnvalue::FAILED; } } - if (pollPapbBusySignal(5) == returnvalue::OK) { + if (pollPapbBusySignal(3) == returnvalue::OK) { completePacketTransfer(); } else { abortPacketTransfer(); diff --git a/mission/tmtc/PersistentSingleTmStoreTask.cpp b/mission/tmtc/PersistentSingleTmStoreTask.cpp index 01a7c206..8b7272c4 100644 --- a/mission/tmtc/PersistentSingleTmStoreTask.cpp +++ b/mission/tmtc/PersistentSingleTmStoreTask.cpp @@ -11,7 +11,6 @@ PersistentSingleTmStoreTask::PersistentSingleTmStoreTask( dumpContext(eventIfDumpDone) {} ReturnValue_t PersistentSingleTmStoreTask::performOperation(uint8_t opCode) { - uint32_t dummy = 0; while (true) { // Delay done by the check if (not cyclicStoreCheck()) { @@ -20,25 +19,19 @@ ReturnValue_t PersistentSingleTmStoreTask::performOperation(uint8_t opCode) { bool busy = handleOneStore(storeWithQueue, dumpContext); if (not busy) { TaskFactory::delayTask(100); - } else if(dumpContext.vcBusyDuringDump) { - TaskFactory::delayTask(30); + } else if (dumpContext.vcBusyDuringDump) { + TaskFactory::delayTask(10); } else if (fileHasSwapped) { - TaskFactory::delayTask(30); - } else if(dumpContext.packetWasDumped and dumpContext.numberOfDumpedPackets % 5 == 0) { - TaskFactory::delayTask(30); + TaskFactory::delayTask(10); + } else if (dumpContext.packetWasDumped and dumpContext.numberOfDumpedPackets % 50 == 0) { + TaskFactory::delayTask(10); } else { -// dummy++; -// if(dummy % 2000 == 0) { -// sif::warning << "persistent tm store is stupid" << std::endl; -// } - TaskFactory::delayTask(2); -// continue; + // TaskFactory::delayTask(5); } - dummy = 0; - //else if(dumpContext.numberOfDumpedPackets % 20 == 0) { - // Manual load management because I don't know what the scheduler is doing.. - // Removing this delay can lead to evil side effects. - //TaskFactory::delayTask(5); + // else if(dumpContext.numberOfDumpedPackets % 20 == 0) { + // Manual load management because I don't know what the scheduler is doing.. + // Removing this delay can lead to evil side effects. + // TaskFactory::delayTask(5); //} } } diff --git a/mission/tmtc/TmStoreTaskBase.cpp b/mission/tmtc/TmStoreTaskBase.cpp index dc32d6e2..2175b164 100644 --- a/mission/tmtc/TmStoreTaskBase.cpp +++ b/mission/tmtc/TmStoreTaskBase.cpp @@ -18,21 +18,21 @@ bool TmStoreTaskBase::handleOneStore(PersistentTmStoreWithTmQueue& store, bool tcRequestReceived = false; bool dumpsPerformed = false; fileHasSwapped = false; + dumpContext.packetWasDumped = false; + dumpContext.vcBusyDuringDump = false; // Store TM persistently result = store.handleNextTm(); if (result == returnvalue::OK) { tmToStoreReceived = true; } - dumpContext.vcBusyDuringDump = false; // Dump TMs when applicable if (store.getState() == PersistentTmStore::State::DUMPING) { size_t dumpedLen = 0; if (not channel.isBusy()) { dumpContext.ptmeBusyCounter = 0; tmSinkBusyCd.resetTimer(); - bool fileHasSwappedLocal = false; - result = store.dumpNextPacket(channel, dumpedLen, fileHasSwappedLocal); + result = store.dumpNextPacket(channel, dumpedLen, fileHasSwapped); if (result == DirectTmSinkIF::IS_BUSY) { sif::warning << "Unexpected PAPB busy" << std::endl; } @@ -40,10 +40,6 @@ bool TmStoreTaskBase::handleOneStore(PersistentTmStoreWithTmQueue& store, dumpContext.dumpedBytes += dumpedLen; dumpContext.numberOfDumpedPackets += 1; dumpContext.packetWasDumped = true; - // Only register file swaps if more than 0 bytes were dumped. - if(fileHasSwappedLocal) { - fileHasSwapped = true; - } } if (result == PersistentTmStore::DUMP_DONE) { uint32_t startTime; @@ -51,6 +47,7 @@ bool TmStoreTaskBase::handleOneStore(PersistentTmStoreWithTmQueue& store, store.getStartAndEndTimeCurrentOrLastDump(startTime, endTime); triggerEvent(dumpContext.eventIfDone, dumpContext.numberOfDumpedPackets, dumpContext.dumpedBytes); + dumpContext.reset(); dumpsPerformed = true; } else if (result == returnvalue::OK) { dumpsPerformed = true; @@ -62,14 +59,15 @@ bool TmStoreTaskBase::handleOneStore(PersistentTmStoreWithTmQueue& store, // If this happens, something is probably wrong. sif::warning << "PTME busy for longer period. Dumped length so far: " << dumpContext.dumpedBytes << std::endl; - dumpContext.ptmeBusyCounter = 0; triggerEvent(persTmStore::DUMP_WAS_CANCELLED, store.getObjectId()); + dumpContext.reset(); store.cancelDump(); channel.cancelTransfer(); } } if (cancelDumpCd.hasTimedOut() or tmSinkBusyCd.hasTimedOut()) { triggerEvent(persTmStore::DUMP_WAS_CANCELLED, store.getObjectId()); + dumpDoneHandler(dumpContext); store.cancelDump(); } } else { @@ -109,3 +107,5 @@ bool TmStoreTaskBase::cyclicStoreCheck() { } return true; } + +void TmStoreTaskBase::dumpDoneHandler(DumpContext& ctx) { ctx.reset(); } diff --git a/mission/tmtc/TmStoreTaskBase.h b/mission/tmtc/TmStoreTaskBase.h index b9a81bec..d911c343 100644 --- a/mission/tmtc/TmStoreTaskBase.h +++ b/mission/tmtc/TmStoreTaskBase.h @@ -12,6 +12,9 @@ class TmStoreTaskBase : public SystemObject { void reset() { numberOfDumpedPackets = 0; dumpedBytes = 0; + vcBusyDuringDump = false; + packetWasDumped = false; + ptmeBusyCounter = 0; } const Event eventIfDone; uint32_t numberOfDumpedPackets = 0; @@ -45,11 +48,13 @@ class TmStoreTaskBase : public SystemObject { // 20 minutes are allowed as maximum dump time. Countdown cancelDumpCd = Countdown(60 * 20 * 1000); // If the TM sink is busy for 1 minute for whatever reason, cancel the dump. - Countdown tmSinkBusyCd = Countdown(60 * 20 * 1000);//Countdown(60 * 1000 ); + Countdown tmSinkBusyCd = Countdown(60 * 20 * 1000); // Countdown(60 * 1000 ); VirtualChannel& channel; bool storesInitialized = false; bool fileHasSwapped = false; SdCardMountedIF& sdcMan; + + void dumpDoneHandler(DumpContext& ctx); }; #endif /* MISSION_TMTC_TMSTORETASKBASE_H_ */ diff --git a/mission/tmtc/VirtualChannel.cpp b/mission/tmtc/VirtualChannel.cpp index 2c03f361..94d05678 100644 --- a/mission/tmtc/VirtualChannel.cpp +++ b/mission/tmtc/VirtualChannel.cpp @@ -2,11 +2,7 @@ VirtualChannel::VirtualChannel(object_id_t objectId, uint8_t vcId, const char* vcName, PtmeIF& ptme, const std::atomic_bool& txOn) - : SystemObject(objectId), - ptme(ptme), - vcId(vcId), - vcName(vcName), - txOn(txOn) {} + : SystemObject(objectId), ptme(ptme), vcId(vcId), vcName(vcName), txOn(txOn) {} ReturnValue_t VirtualChannel::initialize() { return returnvalue::OK; } @@ -15,10 +11,10 @@ ReturnValue_t VirtualChannel::sendNextTm(const uint8_t* data, size_t size) { } ReturnValue_t VirtualChannel::write(const uint8_t* data, size_t size) { - //if (txOn) { - return ptme.writeToVc(vcId, data, size); + // if (txOn) { + return ptme.writeToVc(vcId, data, size); //} - //return returnvalue::OK; + // return returnvalue::OK; } uint8_t VirtualChannel::getVcid() const { return vcId; } @@ -27,7 +23,7 @@ const char* VirtualChannel::getName() const { return vcName.c_str(); } bool VirtualChannel::isBusy() const { // Data is discarded, so channel is not busy. - //if (not txOn) { + // if (not txOn) { // return false; //} return ptme.isBusy(vcId); -- 2.43.0 From bc72f59abbc1bd56a6684b16e9e05b83603aba20 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 27 Mar 2023 21:46:12 +0200 Subject: [PATCH 10/27] now its just trying things out --- mission/tmtc/PersistentSingleTmStoreTask.cpp | 12 +++++++----- mission/tmtc/TmStoreTaskBase.h | 6 ++++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/mission/tmtc/PersistentSingleTmStoreTask.cpp b/mission/tmtc/PersistentSingleTmStoreTask.cpp index 8b7272c4..2584d975 100644 --- a/mission/tmtc/PersistentSingleTmStoreTask.cpp +++ b/mission/tmtc/PersistentSingleTmStoreTask.cpp @@ -20,13 +20,15 @@ ReturnValue_t PersistentSingleTmStoreTask::performOperation(uint8_t opCode) { if (not busy) { TaskFactory::delayTask(100); } else if (dumpContext.vcBusyDuringDump) { - TaskFactory::delayTask(10); + TaskFactory::delayTask(20); } else if (fileHasSwapped) { - TaskFactory::delayTask(10); - } else if (dumpContext.packetWasDumped and dumpContext.numberOfDumpedPackets % 50 == 0) { - TaskFactory::delayTask(10); + TaskFactory::delayTask(20); + } else if (dumpContext.packetWasDumped and + dumpContext.numberOfDumpedPackets - dumpContext.bytesDumpedAtLastDelay >= 2048) { + dumpContext.bytesDumpedAtLastDelay = dumpContext.dumpedBytes; + TaskFactory::delayTask(20); } else { - // TaskFactory::delayTask(5); + TaskFactory::delayTask(10); } // else if(dumpContext.numberOfDumpedPackets % 20 == 0) { // Manual load management because I don't know what the scheduler is doing.. diff --git a/mission/tmtc/TmStoreTaskBase.h b/mission/tmtc/TmStoreTaskBase.h index d911c343..780210b8 100644 --- a/mission/tmtc/TmStoreTaskBase.h +++ b/mission/tmtc/TmStoreTaskBase.h @@ -14,11 +14,13 @@ class TmStoreTaskBase : public SystemObject { dumpedBytes = 0; vcBusyDuringDump = false; packetWasDumped = false; + bytesDumpedAtLastDelay = 0; ptmeBusyCounter = 0; } const Event eventIfDone; - uint32_t numberOfDumpedPackets = 0; - uint32_t dumpedBytes = 0; + size_t numberOfDumpedPackets = 0; + size_t bytesDumpedAtLastDelay = 0; + size_t dumpedBytes = 0; uint32_t ptmeBusyCounter = 0; bool packetWasDumped = false; bool vcBusyDuringDump = false; -- 2.43.0 From 9613d4aa5156f4536e2c4cb705719bfda3986128 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 27 Mar 2023 22:06:16 +0200 Subject: [PATCH 11/27] add single store delay handling for log store as well --- mission/tmtc/PersistentLogTmStoreTask.cpp | 27 ++++++++++++++++---- mission/tmtc/PersistentSingleTmStoreTask.cpp | 10 +++----- 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/mission/tmtc/PersistentLogTmStoreTask.cpp b/mission/tmtc/PersistentLogTmStoreTask.cpp index 2b7e1333..906c7547 100644 --- a/mission/tmtc/PersistentLogTmStoreTask.cpp +++ b/mission/tmtc/PersistentLogTmStoreTask.cpp @@ -14,13 +14,22 @@ PersistentLogTmStoreTask::PersistentLogTmStoreTask(object_id_t objectId, Storage ReturnValue_t PersistentLogTmStoreTask::performOperation(uint8_t opCode) { bool someonesBusy = false; - auto stateHandlingForStore = [&](bool storeIsBusy) { + bool vcBusyDuringDump = false; + bool byteFlowControl = false; + auto stateHandlingForStore = [&](bool storeIsBusy, DumpContext& ctx) { if (storeIsBusy) { someonesBusy = true; } if (fileHasSwapped) { someFileWasSwapped = fileHasSwapped; } + if(ctx.vcBusyDuringDump) { + vcBusyDuringDump = true; + } + if(ctx.dumpedBytes - ctx.bytesDumpedAtLastDelay >= 2048) { + byteFlowControl = true; + ctx.bytesDumpedAtLastDelay = ctx.dumpedBytes; + } }; while (true) { if (not cyclicStoreCheck()) { @@ -28,13 +37,21 @@ ReturnValue_t PersistentLogTmStoreTask::performOperation(uint8_t opCode) { } someonesBusy = false; someFileWasSwapped = false; - stateHandlingForStore(handleOneStore(stores.okStore, okStoreContext)); - stateHandlingForStore(handleOneStore(stores.notOkStore, notOkStoreContext)); - stateHandlingForStore(handleOneStore(stores.miscStore, miscStoreContext)); + vcBusyDuringDump = false; + stateHandlingForStore(handleOneStore(stores.okStore, okStoreContext), okStoreContext); + stateHandlingForStore(handleOneStore(stores.notOkStore, notOkStoreContext), notOkStoreContext); + stateHandlingForStore(handleOneStore(stores.miscStore, miscStoreContext), miscStoreContext); if (not someonesBusy) { TaskFactory::delayTask(100); } else if (someFileWasSwapped) { - TaskFactory::delayTask(2); + TaskFactory::delayTask(20); + } else if(vcBusyDuringDump) { + TaskFactory::delayTask(20); + } else if(byteFlowControl) { + TaskFactory::delayTask(10); + } else { + // TODO: Lower this as much as possible... + TaskFactory::delayTask(10); } } } diff --git a/mission/tmtc/PersistentSingleTmStoreTask.cpp b/mission/tmtc/PersistentSingleTmStoreTask.cpp index 2584d975..ae6b8700 100644 --- a/mission/tmtc/PersistentSingleTmStoreTask.cpp +++ b/mission/tmtc/PersistentSingleTmStoreTask.cpp @@ -24,17 +24,13 @@ ReturnValue_t PersistentSingleTmStoreTask::performOperation(uint8_t opCode) { } else if (fileHasSwapped) { TaskFactory::delayTask(20); } else if (dumpContext.packetWasDumped and - dumpContext.numberOfDumpedPackets - dumpContext.bytesDumpedAtLastDelay >= 2048) { + dumpContext.dumpedBytes - dumpContext.bytesDumpedAtLastDelay >= 2048) { dumpContext.bytesDumpedAtLastDelay = dumpContext.dumpedBytes; TaskFactory::delayTask(20); } else { - TaskFactory::delayTask(10); + // TODO: Lower this as much as possible... + TaskFactory::delayTask(5); } - // else if(dumpContext.numberOfDumpedPackets % 20 == 0) { - // Manual load management because I don't know what the scheduler is doing.. - // Removing this delay can lead to evil side effects. - // TaskFactory::delayTask(5); - //} } } -- 2.43.0 From 534945cfeca2b9d90f467d200af33134f4d90606 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 27 Mar 2023 22:57:01 +0200 Subject: [PATCH 12/27] last know working cfg for slow downlink --- linux/ipcore/PapbVcInterface.cpp | 6 ++++-- linux/ipcore/PapbVcInterface.h | 3 ++- mission/tmtc/PersistentSingleTmStoreTask.cpp | 14 ++++++++------ mission/tmtc/TmStoreTaskBase.cpp | 2 +- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/linux/ipcore/PapbVcInterface.cpp b/linux/ipcore/PapbVcInterface.cpp index 1808d935..5d88de94 100644 --- a/linux/ipcore/PapbVcInterface.cpp +++ b/linux/ipcore/PapbVcInterface.cpp @@ -58,7 +58,7 @@ ReturnValue_t PapbVcInterface::pollPapbBusySignal(uint32_t maxPollRetries) const gpio::Levels papbBusyState = gpio::Levels::LOW; ReturnValue_t result; uint32_t busyIdx = 0; - nextDelay.tv_nsec = 1000; + nextDelay.tv_nsec = 0; while (true) { /** Check if PAPB interface is ready to receive data */ @@ -80,7 +80,9 @@ ReturnValue_t PapbVcInterface::pollPapbBusySignal(uint32_t maxPollRetries) const // Ignore signal handling here for now. nanosleep(&nextDelay, &remDelay); // Adaptive delay. - if (nextDelay.tv_nsec * 2 <= MAX_DELAY_PAPB_POLLING_NS) { + if(nextDelay.tv_nsec == 0) { + nextDelay.tv_nsec = FIRST_NON_NULL_DELAY_NS; + } else if (nextDelay.tv_nsec * 2 <= MAX_DELAY_PAPB_POLLING_NS) { nextDelay.tv_nsec *= 2; } } diff --git a/linux/ipcore/PapbVcInterface.h b/linux/ipcore/PapbVcInterface.h index 484390b2..8545a7ec 100644 --- a/linux/ipcore/PapbVcInterface.h +++ b/linux/ipcore/PapbVcInterface.h @@ -76,6 +76,7 @@ class PapbVcInterface : public VirtualChannelIF { */ static const int DATA_REG_OFFSET = 256; + static constexpr long int FIRST_NON_NULL_DELAY_NS = 1000; static constexpr long int MAX_DELAY_PAPB_POLLING_NS = 4000; LinuxLibgpioIF* gpioComIF = nullptr; @@ -87,7 +88,7 @@ class PapbVcInterface : public VirtualChannelIF { std::string uioFile; int mapNum = 0; - mutable struct timespec nextDelay = {.tv_sec = 0, .tv_nsec = 1000}; + mutable struct timespec nextDelay = {.tv_sec = 0, .tv_nsec = 0}; mutable struct timespec remDelay; volatile uint32_t* vcBaseReg = nullptr; diff --git a/mission/tmtc/PersistentSingleTmStoreTask.cpp b/mission/tmtc/PersistentSingleTmStoreTask.cpp index ae6b8700..ec507a44 100644 --- a/mission/tmtc/PersistentSingleTmStoreTask.cpp +++ b/mission/tmtc/PersistentSingleTmStoreTask.cpp @@ -11,6 +11,7 @@ PersistentSingleTmStoreTask::PersistentSingleTmStoreTask( dumpContext(eventIfDumpDone) {} ReturnValue_t PersistentSingleTmStoreTask::performOperation(uint8_t opCode) { + ReturnValue_t result = returnvalue::OK; while (true) { // Delay done by the check if (not cyclicStoreCheck()) { @@ -18,18 +19,19 @@ ReturnValue_t PersistentSingleTmStoreTask::performOperation(uint8_t opCode) { } bool busy = handleOneStore(storeWithQueue, dumpContext); if (not busy) { - TaskFactory::delayTask(100); + result = TaskFactory::delayTask(100); } else if (dumpContext.vcBusyDuringDump) { - TaskFactory::delayTask(20); - } else if (fileHasSwapped) { - TaskFactory::delayTask(20); + result = TaskFactory::delayTask(10); } else if (dumpContext.packetWasDumped and dumpContext.dumpedBytes - dumpContext.bytesDumpedAtLastDelay >= 2048) { dumpContext.bytesDumpedAtLastDelay = dumpContext.dumpedBytes; - TaskFactory::delayTask(20); + result = TaskFactory::delayTask(10); } else { // TODO: Lower this as much as possible... - TaskFactory::delayTask(5); + result = TaskFactory::delayTask(10); + } + if(result != returnvalue::OK) { + sif::warning << "TmStoreTask: Delay failed" << std::endl; } } } diff --git a/mission/tmtc/TmStoreTaskBase.cpp b/mission/tmtc/TmStoreTaskBase.cpp index 2175b164..d2fff5e7 100644 --- a/mission/tmtc/TmStoreTaskBase.cpp +++ b/mission/tmtc/TmStoreTaskBase.cpp @@ -55,7 +55,7 @@ bool TmStoreTaskBase::handleOneStore(PersistentTmStoreWithTmQueue& store, } else { dumpContext.vcBusyDuringDump = true; dumpContext.ptmeBusyCounter++; - if (dumpContext.ptmeBusyCounter == 50) { + if (dumpContext.ptmeBusyCounter == 100) { // If this happens, something is probably wrong. sif::warning << "PTME busy for longer period. Dumped length so far: " << dumpContext.dumpedBytes << std::endl; -- 2.43.0 From 437288de1eb34aa91b45bfaf713aaf9a338577a3 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 27 Mar 2023 23:09:26 +0200 Subject: [PATCH 13/27] small fix --- mission/tmtc/PersistentTmStore.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mission/tmtc/PersistentTmStore.cpp b/mission/tmtc/PersistentTmStore.cpp index 949657d5..bf8f2a4f 100644 --- a/mission/tmtc/PersistentTmStore.cpp +++ b/mission/tmtc/PersistentTmStore.cpp @@ -171,7 +171,7 @@ void PersistentTmStore::deleteUpTo(uint32_t unixSeconds) { // Convert file time to the UNIX epoch struct tm fileTime {}; if (pathToTime(file.path(), fileTime) != returnvalue::OK) { - sif::error << "Time extraction for " << file << "failed" << std::endl; + sif::error << "Time extraction for " << file << " failed" << std::endl; continue; } time_t fileEpoch = timegm(&fileTime); -- 2.43.0 From 746254a8385d9bbf34d8a103924b3c6b7131bdb3 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 28 Mar 2023 10:13:39 +0200 Subject: [PATCH 14/27] cancel transfer on TX disabled --- mission/tmtc/TmStoreTaskBase.cpp | 21 +++++++++++++++------ mission/tmtc/TmStoreTaskBase.h | 2 +- mission/tmtc/VirtualChannel.cpp | 22 ++++++++++++++-------- mission/tmtc/VirtualChannel.h | 1 + 4 files changed, 31 insertions(+), 15 deletions(-) diff --git a/mission/tmtc/TmStoreTaskBase.cpp b/mission/tmtc/TmStoreTaskBase.cpp index d2fff5e7..ea1153ff 100644 --- a/mission/tmtc/TmStoreTaskBase.cpp +++ b/mission/tmtc/TmStoreTaskBase.cpp @@ -28,6 +28,12 @@ bool TmStoreTaskBase::handleOneStore(PersistentTmStoreWithTmQueue& store, } // Dump TMs when applicable if (store.getState() == PersistentTmStore::State::DUMPING) { + // The PTME might have been reset an transmitter state change, so there is + // not point in continuing the dump. + if(not channel.isTxOn()) { + cancelDump(dumpContext, store, false); + return returnvalue::OK; + } size_t dumpedLen = 0; if (not channel.isBusy()) { dumpContext.ptmeBusyCounter = 0; @@ -60,15 +66,12 @@ bool TmStoreTaskBase::handleOneStore(PersistentTmStoreWithTmQueue& store, sif::warning << "PTME busy for longer period. Dumped length so far: " << dumpContext.dumpedBytes << std::endl; triggerEvent(persTmStore::DUMP_WAS_CANCELLED, store.getObjectId()); - dumpContext.reset(); - store.cancelDump(); - channel.cancelTransfer(); + cancelDump(dumpContext, store, channel.isTxOn()); } } if (cancelDumpCd.hasTimedOut() or tmSinkBusyCd.hasTimedOut()) { triggerEvent(persTmStore::DUMP_WAS_CANCELLED, store.getObjectId()); - dumpDoneHandler(dumpContext); - store.cancelDump(); + cancelDump(dumpContext, store, channel.isTxOn()); } } else { Command_t execCmd; @@ -108,4 +111,10 @@ bool TmStoreTaskBase::cyclicStoreCheck() { return true; } -void TmStoreTaskBase::dumpDoneHandler(DumpContext& ctx) { ctx.reset(); } +void TmStoreTaskBase::cancelDump(DumpContext& ctx, PersistentTmStore& store, bool isTxOn) { + ctx.reset(); + store.cancelDump(); + if(isTxOn) { + channel.cancelTransfer(); + } +} diff --git a/mission/tmtc/TmStoreTaskBase.h b/mission/tmtc/TmStoreTaskBase.h index 780210b8..149f0804 100644 --- a/mission/tmtc/TmStoreTaskBase.h +++ b/mission/tmtc/TmStoreTaskBase.h @@ -56,7 +56,7 @@ class TmStoreTaskBase : public SystemObject { bool fileHasSwapped = false; SdCardMountedIF& sdcMan; - void dumpDoneHandler(DumpContext& ctx); + void cancelDump(DumpContext& ctx, PersistentTmStore& store, bool isTxOn); }; #endif /* MISSION_TMTC_TMSTORETASKBASE_H_ */ diff --git a/mission/tmtc/VirtualChannel.cpp b/mission/tmtc/VirtualChannel.cpp index 94d05678..5724ae69 100644 --- a/mission/tmtc/VirtualChannel.cpp +++ b/mission/tmtc/VirtualChannel.cpp @@ -11,10 +11,10 @@ ReturnValue_t VirtualChannel::sendNextTm(const uint8_t* data, size_t size) { } ReturnValue_t VirtualChannel::write(const uint8_t* data, size_t size) { - // if (txOn) { - return ptme.writeToVc(vcId, data, size); - //} - // return returnvalue::OK; + if (txOn) { + return ptme.writeToVc(vcId, data, size); + } + return returnvalue::OK; } uint8_t VirtualChannel::getVcid() const { return vcId; } @@ -23,10 +23,16 @@ const char* VirtualChannel::getName() const { return vcName.c_str(); } bool VirtualChannel::isBusy() const { // Data is discarded, so channel is not busy. - // if (not txOn) { - // return false; - //} + if (not txOn) { + return false; + } return ptme.isBusy(vcId); } -void VirtualChannel::cancelTransfer() { ptme.cancelTransfer(vcId); } +void VirtualChannel::cancelTransfer() { + ptme.cancelTransfer(vcId); +} + +bool VirtualChannel::isTxOn() const { + return txOn; +} diff --git a/mission/tmtc/VirtualChannel.h b/mission/tmtc/VirtualChannel.h index 7de0633f..98aba903 100644 --- a/mission/tmtc/VirtualChannel.h +++ b/mission/tmtc/VirtualChannel.h @@ -30,6 +30,7 @@ class VirtualChannel : public SystemObject, public VirtualChannelIF { ReturnValue_t write(const uint8_t* data, size_t size) override; void cancelTransfer() override; uint8_t getVcid() const; + bool isTxOn() const; const char* getName() const; -- 2.43.0 From 1f6c986a0cf6542e48fc7ef7ae4427b63c6a7989 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 28 Mar 2023 14:59:31 +0200 Subject: [PATCH 15/27] add instrumentation code --- linux/ipcore/PapbVcInterface.cpp | 2 +- mission/tmtc/PersistentLogTmStoreTask.cpp | 8 +- mission/tmtc/PersistentSingleTmStoreTask.cpp | 18 +++- mission/tmtc/TmStoreTaskBase.cpp | 107 +++++++++++-------- mission/tmtc/TmStoreTaskBase.h | 3 + mission/tmtc/VirtualChannel.cpp | 8 +- mission/tmtc/VirtualChannelWithQueue.cpp | 10 +- 7 files changed, 89 insertions(+), 67 deletions(-) diff --git a/linux/ipcore/PapbVcInterface.cpp b/linux/ipcore/PapbVcInterface.cpp index 5d88de94..b7081f0f 100644 --- a/linux/ipcore/PapbVcInterface.cpp +++ b/linux/ipcore/PapbVcInterface.cpp @@ -80,7 +80,7 @@ ReturnValue_t PapbVcInterface::pollPapbBusySignal(uint32_t maxPollRetries) const // Ignore signal handling here for now. nanosleep(&nextDelay, &remDelay); // Adaptive delay. - if(nextDelay.tv_nsec == 0) { + if (nextDelay.tv_nsec == 0) { nextDelay.tv_nsec = FIRST_NON_NULL_DELAY_NS; } else if (nextDelay.tv_nsec * 2 <= MAX_DELAY_PAPB_POLLING_NS) { nextDelay.tv_nsec *= 2; diff --git a/mission/tmtc/PersistentLogTmStoreTask.cpp b/mission/tmtc/PersistentLogTmStoreTask.cpp index 906c7547..84886cf6 100644 --- a/mission/tmtc/PersistentLogTmStoreTask.cpp +++ b/mission/tmtc/PersistentLogTmStoreTask.cpp @@ -23,10 +23,10 @@ ReturnValue_t PersistentLogTmStoreTask::performOperation(uint8_t opCode) { if (fileHasSwapped) { someFileWasSwapped = fileHasSwapped; } - if(ctx.vcBusyDuringDump) { + if (ctx.vcBusyDuringDump) { vcBusyDuringDump = true; } - if(ctx.dumpedBytes - ctx.bytesDumpedAtLastDelay >= 2048) { + if (ctx.dumpedBytes - ctx.bytesDumpedAtLastDelay >= 2048) { byteFlowControl = true; ctx.bytesDumpedAtLastDelay = ctx.dumpedBytes; } @@ -45,9 +45,9 @@ ReturnValue_t PersistentLogTmStoreTask::performOperation(uint8_t opCode) { TaskFactory::delayTask(100); } else if (someFileWasSwapped) { TaskFactory::delayTask(20); - } else if(vcBusyDuringDump) { + } else if (vcBusyDuringDump) { TaskFactory::delayTask(20); - } else if(byteFlowControl) { + } else if (byteFlowControl) { TaskFactory::delayTask(10); } else { // TODO: Lower this as much as possible... diff --git a/mission/tmtc/PersistentSingleTmStoreTask.cpp b/mission/tmtc/PersistentSingleTmStoreTask.cpp index ec507a44..121df1b7 100644 --- a/mission/tmtc/PersistentSingleTmStoreTask.cpp +++ b/mission/tmtc/PersistentSingleTmStoreTask.cpp @@ -12,6 +12,10 @@ PersistentSingleTmStoreTask::PersistentSingleTmStoreTask( ReturnValue_t PersistentSingleTmStoreTask::performOperation(uint8_t opCode) { ReturnValue_t result = returnvalue::OK; + uint32_t delaysVcBusyDuringDump = 0; + uint32_t delaysFlowControl = 0; + uint32_t delayNotBusy = 0; + uint32_t delayHotLoop = 0; while (true) { // Delay done by the check if (not cyclicStoreCheck()) { @@ -20,17 +24,27 @@ ReturnValue_t PersistentSingleTmStoreTask::performOperation(uint8_t opCode) { bool busy = handleOneStore(storeWithQueue, dumpContext); if (not busy) { result = TaskFactory::delayTask(100); + delayNotBusy++; } else if (dumpContext.vcBusyDuringDump) { + delaysVcBusyDuringDump++; result = TaskFactory::delayTask(10); } else if (dumpContext.packetWasDumped and dumpContext.dumpedBytes - dumpContext.bytesDumpedAtLastDelay >= 2048) { dumpContext.bytesDumpedAtLastDelay = dumpContext.dumpedBytes; result = TaskFactory::delayTask(10); + delaysFlowControl++; } else { // TODO: Lower this as much as possible... - result = TaskFactory::delayTask(10); + result = TaskFactory::delayTask(5); + delayHotLoop++; } - if(result != returnvalue::OK) { + if ((delaysVcBusyDuringDump + delaysFlowControl + delayNotBusy + delayHotLoop) % 2000000 == 0) { + sif::debug << "DLY NBUSY: " << delayNotBusy << std::endl; + sif::debug << "DLY FLCTRL: " << delaysFlowControl << std::endl; + sif::debug << "DLY BUSYDUMP: " << delaysVcBusyDuringDump << std::endl; + sif::debug << "DLY HOTLOOP: " << delayHotLoop << std::endl; + } + if (result != returnvalue::OK) { sif::warning << "TmStoreTask: Delay failed" << std::endl; } } diff --git a/mission/tmtc/TmStoreTaskBase.cpp b/mission/tmtc/TmStoreTaskBase.cpp index ea1153ff..d0787535 100644 --- a/mission/tmtc/TmStoreTaskBase.cpp +++ b/mission/tmtc/TmStoreTaskBase.cpp @@ -16,7 +16,7 @@ bool TmStoreTaskBase::handleOneStore(PersistentTmStoreWithTmQueue& store, ReturnValue_t result; bool tmToStoreReceived = false; bool tcRequestReceived = false; - bool dumpsPerformed = false; + bool dumpPerformed = false; fileHasSwapped = false; dumpContext.packetWasDumped = false; dumpContext.vcBusyDuringDump = false; @@ -28,50 +28,8 @@ bool TmStoreTaskBase::handleOneStore(PersistentTmStoreWithTmQueue& store, } // Dump TMs when applicable if (store.getState() == PersistentTmStore::State::DUMPING) { - // The PTME might have been reset an transmitter state change, so there is - // not point in continuing the dump. - if(not channel.isTxOn()) { - cancelDump(dumpContext, store, false); - return returnvalue::OK; - } - size_t dumpedLen = 0; - if (not channel.isBusy()) { - dumpContext.ptmeBusyCounter = 0; - tmSinkBusyCd.resetTimer(); - result = store.dumpNextPacket(channel, dumpedLen, fileHasSwapped); - if (result == DirectTmSinkIF::IS_BUSY) { - sif::warning << "Unexpected PAPB busy" << std::endl; - } - if ((result == PersistentTmStore::DUMP_DONE or result == returnvalue::OK) and dumpedLen > 0) { - dumpContext.dumpedBytes += dumpedLen; - dumpContext.numberOfDumpedPackets += 1; - dumpContext.packetWasDumped = true; - } - if (result == PersistentTmStore::DUMP_DONE) { - uint32_t startTime; - uint32_t endTime; - store.getStartAndEndTimeCurrentOrLastDump(startTime, endTime); - triggerEvent(dumpContext.eventIfDone, dumpContext.numberOfDumpedPackets, - dumpContext.dumpedBytes); - dumpContext.reset(); - dumpsPerformed = true; - } else if (result == returnvalue::OK) { - dumpsPerformed = true; - } - } else { - dumpContext.vcBusyDuringDump = true; - dumpContext.ptmeBusyCounter++; - if (dumpContext.ptmeBusyCounter == 100) { - // If this happens, something is probably wrong. - sif::warning << "PTME busy for longer period. Dumped length so far: " - << dumpContext.dumpedBytes << std::endl; - triggerEvent(persTmStore::DUMP_WAS_CANCELLED, store.getObjectId()); - cancelDump(dumpContext, store, channel.isTxOn()); - } - } - if (cancelDumpCd.hasTimedOut() or tmSinkBusyCd.hasTimedOut()) { - triggerEvent(persTmStore::DUMP_WAS_CANCELLED, store.getObjectId()); - cancelDump(dumpContext, store, channel.isTxOn()); + if (handleOneDump(store, dumpContext, dumpPerformed) != returnvalue::OK) { + return result; } } else { Command_t execCmd; @@ -86,7 +44,7 @@ bool TmStoreTaskBase::handleOneStore(PersistentTmStoreWithTmQueue& store, tcRequestReceived = true; } } - if (tcRequestReceived or tmToStoreReceived or dumpsPerformed) { + if (tcRequestReceived or tmToStoreReceived or dumpPerformed) { return true; } return false; @@ -114,7 +72,62 @@ bool TmStoreTaskBase::cyclicStoreCheck() { void TmStoreTaskBase::cancelDump(DumpContext& ctx, PersistentTmStore& store, bool isTxOn) { ctx.reset(); store.cancelDump(); - if(isTxOn) { + if (isTxOn) { channel.cancelTransfer(); } } + +ReturnValue_t TmStoreTaskBase::handleOneDump(PersistentTmStoreWithTmQueue& store, + DumpContext& dumpContext, bool& dumpPerformed) { + ReturnValue_t result = returnvalue::OK; + // The PTME might have been reset an transmitter state change, so there is + // not point in continuing the dump. + if (not channel.isTxOn()) { + cancelDump(dumpContext, store, false); + return returnvalue::FAILED; + } + size_t dumpedLen = 0; + if (not channel.isBusy()) { + // Dump the next packet into the PTME. + dumpContext.ptmeBusyCounter = 0; + tmSinkBusyCd.resetTimer(); + result = store.dumpNextPacket(channel, dumpedLen, fileHasSwapped); + if (result == DirectTmSinkIF::IS_BUSY) { + sif::warning << "Unexpected PAPB busy" << std::endl; + } + if ((result == PersistentTmStore::DUMP_DONE or result == returnvalue::OK)) { + dumpPerformed = true; + if (dumpedLen > 0) { + dumpContext.dumpedBytes += dumpedLen; + dumpContext.numberOfDumpedPackets += 1; + dumpContext.packetWasDumped = true; + } + } + if (result == PersistentTmStore::DUMP_DONE) { + uint32_t startTime; + uint32_t endTime; + store.getStartAndEndTimeCurrentOrLastDump(startTime, endTime); + triggerEvent(dumpContext.eventIfDone, dumpContext.numberOfDumpedPackets, + dumpContext.dumpedBytes); + dumpContext.reset(); + } + } else { + // The PTME might be at full load, so it might sense to delay for a bit to let it do + // its work until some more bandwidth is available. Set a flag here so the upper layer can + // do ths. + dumpContext.vcBusyDuringDump = true; + dumpContext.ptmeBusyCounter++; + if (dumpContext.ptmeBusyCounter == 100) { + // If this happens, something is probably wrong. + sif::warning << "PTME busy for longer period. Dumped length so far: " + << dumpContext.dumpedBytes << std::endl; + triggerEvent(persTmStore::DUMP_WAS_CANCELLED, store.getObjectId()); + cancelDump(dumpContext, store, channel.isTxOn()); + } + } + if (cancelDumpCd.hasTimedOut() or tmSinkBusyCd.hasTimedOut()) { + triggerEvent(persTmStore::DUMP_WAS_CANCELLED, store.getObjectId()); + cancelDump(dumpContext, store, channel.isTxOn()); + } + return result; +} diff --git a/mission/tmtc/TmStoreTaskBase.h b/mission/tmtc/TmStoreTaskBase.h index 149f0804..c75ac8e4 100644 --- a/mission/tmtc/TmStoreTaskBase.h +++ b/mission/tmtc/TmStoreTaskBase.h @@ -37,6 +37,9 @@ class TmStoreTaskBase : public SystemObject { */ bool handleOneStore(PersistentTmStoreWithTmQueue& store, DumpContext& dumpContext); + ReturnValue_t handleOneDump(PersistentTmStoreWithTmQueue& store, DumpContext& dumpContext, + bool& dumpPerformed); + /** * Occasionally check whether SD card is okay to be used. If not, poll whether it is ready to * be used again and re-initialize stores. Returns whether store is okay to be used. diff --git a/mission/tmtc/VirtualChannel.cpp b/mission/tmtc/VirtualChannel.cpp index 5724ae69..8e225674 100644 --- a/mission/tmtc/VirtualChannel.cpp +++ b/mission/tmtc/VirtualChannel.cpp @@ -29,10 +29,6 @@ bool VirtualChannel::isBusy() const { return ptme.isBusy(vcId); } -void VirtualChannel::cancelTransfer() { - ptme.cancelTransfer(vcId); -} +void VirtualChannel::cancelTransfer() { ptme.cancelTransfer(vcId); } -bool VirtualChannel::isTxOn() const { - return txOn; -} +bool VirtualChannel::isTxOn() const { return txOn; } diff --git a/mission/tmtc/VirtualChannelWithQueue.cpp b/mission/tmtc/VirtualChannelWithQueue.cpp index bfc74907..44a20031 100644 --- a/mission/tmtc/VirtualChannelWithQueue.cpp +++ b/mission/tmtc/VirtualChannelWithQueue.cpp @@ -37,14 +37,10 @@ ReturnValue_t VirtualChannelWithQueue::sendNextTm() { } result = write(data, size); - if (result != returnvalue::OK) { - return result; - } + // Try delete in any case, ignore failures (which should not happen), it is more important to + // propagate write errors. tmStore.deleteData(storeId); - if (result != returnvalue::OK) { - return result; - } - return returnvalue::OK; + return result; } MessageQueueId_t VirtualChannelWithQueue::getReportReceptionQueue(uint8_t virtualChannel) const { -- 2.43.0 From 0bba9b53ba016877c38eb97a5fb83476c6ae7781 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 28 Mar 2023 15:03:34 +0200 Subject: [PATCH 16/27] some more documentation --- mission/tmtc/TmStoreTaskBase.cpp | 4 ++-- mission/tmtc/TmStoreTaskBase.h | 30 ++++++++++++++++++------------ 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/mission/tmtc/TmStoreTaskBase.cpp b/mission/tmtc/TmStoreTaskBase.cpp index d0787535..191272ed 100644 --- a/mission/tmtc/TmStoreTaskBase.cpp +++ b/mission/tmtc/TmStoreTaskBase.cpp @@ -80,8 +80,8 @@ void TmStoreTaskBase::cancelDump(DumpContext& ctx, PersistentTmStore& store, boo ReturnValue_t TmStoreTaskBase::handleOneDump(PersistentTmStoreWithTmQueue& store, DumpContext& dumpContext, bool& dumpPerformed) { ReturnValue_t result = returnvalue::OK; - // The PTME might have been reset an transmitter state change, so there is - // not point in continuing the dump. + // The PTME might have been reset an transmitter state change, so there is no point in continuing + // the dump. if (not channel.isTxOn()) { cancelDump(dumpContext, store, false); return returnvalue::FAILED; diff --git a/mission/tmtc/TmStoreTaskBase.h b/mission/tmtc/TmStoreTaskBase.h index c75ac8e4..319e3361 100644 --- a/mission/tmtc/TmStoreTaskBase.h +++ b/mission/tmtc/TmStoreTaskBase.h @@ -5,6 +5,10 @@ #include #include +/** + * Generic class which composes a Virtual Channel and a persistent TM stores. This allows dumping + * the TM store into the virtual channel directly. + */ class TmStoreTaskBase : public SystemObject { public: struct DumpContext { @@ -30,7 +34,21 @@ class TmStoreTaskBase : public SystemObject { SdCardMountedIF& sdcMan); protected: + StorageManagerIF& ipcStore; + Countdown sdCardCheckCd = Countdown(800); + // 20 minutes are allowed as maximum dump time. + Countdown cancelDumpCd = Countdown(60 * 20 * 1000); + // If the TM sink is busy for 1 minute for whatever reason, cancel the dump. + // TODO: Reset this to default value. + Countdown tmSinkBusyCd = Countdown(60 * 20 * 1000); // Countdown(60 * 1000 ); + VirtualChannel& channel; + bool storesInitialized = false; + bool fileHasSwapped = false; + SdCardMountedIF& sdcMan; + + void cancelDump(DumpContext& ctx, PersistentTmStore& store, bool isTxOn); /** + * * Handling for one store. Returns if anything was done. * @param store * @return @@ -48,18 +66,6 @@ class TmStoreTaskBase : public SystemObject { virtual bool initStoresIfPossible() = 0; - StorageManagerIF& ipcStore; - Countdown sdCardCheckCd = Countdown(800); - // 20 minutes are allowed as maximum dump time. - Countdown cancelDumpCd = Countdown(60 * 20 * 1000); - // If the TM sink is busy for 1 minute for whatever reason, cancel the dump. - Countdown tmSinkBusyCd = Countdown(60 * 20 * 1000); // Countdown(60 * 1000 ); - VirtualChannel& channel; - bool storesInitialized = false; - bool fileHasSwapped = false; - SdCardMountedIF& sdcMan; - - void cancelDump(DumpContext& ctx, PersistentTmStore& store, bool isTxOn); }; #endif /* MISSION_TMTC_TMSTORETASKBASE_H_ */ -- 2.43.0 From 0adfb0cd3c60b3f0d3b35492beac8fcd64181c06 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 28 Mar 2023 15:06:03 +0200 Subject: [PATCH 17/27] add missing override specifiers --- mission/tmtc/PersistentLogTmStoreTask.h | 2 +- mission/tmtc/PersistentSingleTmStoreTask.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mission/tmtc/PersistentLogTmStoreTask.h b/mission/tmtc/PersistentLogTmStoreTask.h index cb87ba6c..116b369e 100644 --- a/mission/tmtc/PersistentLogTmStoreTask.h +++ b/mission/tmtc/PersistentLogTmStoreTask.h @@ -35,7 +35,7 @@ class PersistentLogTmStoreTask : public TmStoreTaskBase, public ExecutableObject Countdown graceDelayDuringDumping = Countdown(200); bool someFileWasSwapped = false; - bool initStoresIfPossible(); + bool initStoresIfPossible() override; }; #endif /* MISSION_TMTC_PERSISTENTLOGTMSTORETASK_H_ */ diff --git a/mission/tmtc/PersistentSingleTmStoreTask.h b/mission/tmtc/PersistentSingleTmStoreTask.h index 7a4dd7ca..07e0f05f 100644 --- a/mission/tmtc/PersistentSingleTmStoreTask.h +++ b/mission/tmtc/PersistentSingleTmStoreTask.h @@ -21,7 +21,7 @@ class PersistentSingleTmStoreTask : public TmStoreTaskBase, public ExecutableObj Countdown tcHandlingCd = Countdown(400); Countdown graceDelayDuringDumping = Countdown(100); - bool initStoresIfPossible(); + bool initStoresIfPossible() override; }; #endif /* MISSION_TMTC_PERSISTENTSINGLETMSTORETASK_H_ */ -- 2.43.0 From 33babebb6f554abedec11d2fbea2f0ba310d91ab Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 28 Mar 2023 15:15:38 +0200 Subject: [PATCH 18/27] cancel events --- bsp_q7s/core/ObjectFactory.cpp | 4 ++-- mission/persistentTmStoreDefs.h | 13 +++++++++++-- mission/tmtc/PersistentLogTmStoreTask.cpp | 6 +++--- mission/tmtc/PersistentSingleTmStoreTask.cpp | 4 ++-- mission/tmtc/PersistentSingleTmStoreTask.h | 3 ++- mission/tmtc/TmStoreTaskBase.cpp | 6 ++---- mission/tmtc/TmStoreTaskBase.h | 5 +++-- 7 files changed, 25 insertions(+), 16 deletions(-) diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 3845a294..313c7aa6 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -808,14 +808,14 @@ ReturnValue_t ObjectFactory::createCcsdsComponents(CcsdsComponentArgs& args) { // Core task which handles the HK store and takes care of dumping it as TM using a VC directly new PersistentSingleTmStoreTask(objects::HK_STORE_AND_TM_TASK, args.ipcStore, *args.stores.hkStore, *vc, persTmStore::DUMP_HK_STORE_DONE, - *SdCardManager::instance()); + persTmStore::DUMP_HK_STORE_DONE, *SdCardManager::instance()); vc = new VirtualChannel(objects::PTME_VC3_CFDP_TM, ccsds::VC3, "PTME VC3 CFDP TM", *ptme, LINK_STATE); // Core task which handles the CFDP store and takes care of dumping it as TM using a VC directly new PersistentSingleTmStoreTask(objects::CFDP_STORE_AND_TM_TASK, args.ipcStore, *args.stores.cfdpStore, *vc, persTmStore::DUMP_CFDP_STORE_DONE, - *SdCardManager::instance()); + persTmStore::DUMP_CFDP_CANCELLED, *SdCardManager::instance()); ReturnValue_t result = (*args.ipCoreHandler)->connectModeTreeParent(satsystem::com::SUBSYSTEM); if (result != returnvalue::OK) { diff --git a/mission/persistentTmStoreDefs.h b/mission/persistentTmStoreDefs.h index 2498536d..8b8873de 100644 --- a/mission/persistentTmStoreDefs.h +++ b/mission/persistentTmStoreDefs.h @@ -25,8 +25,6 @@ static constexpr Event POSSIBLE_FILE_CORRUPTION = event::makeEvent(SUBSYSTEM_ID, //! P2: Allowed file size static constexpr Event FILE_TOO_LARGE = event::makeEvent(SUBSYSTEM_ID, 1, severity::LOW); static constexpr Event BUSY_DUMPING_EVENT = event::makeEvent(SUBSYSTEM_ID, 2, severity::INFO); -//! [EXPORT] : [COMMENT] Dump was cancelled. P1: Object ID of store. -static constexpr Event DUMP_WAS_CANCELLED = event::makeEvent(SUBSYSTEM_ID, 3, severity::LOW); //! [EXPORT] : [COMMENT] P1: Number of dumped packets. P2: Total dumped bytes. static constexpr Event DUMP_OK_STORE_DONE = event::makeEvent(SUBSYSTEM_ID, 5, severity::INFO); @@ -38,6 +36,17 @@ static constexpr Event DUMP_MISC_STORE_DONE = event::makeEvent(SUBSYSTEM_ID, 7, static constexpr Event DUMP_HK_STORE_DONE = event::makeEvent(SUBSYSTEM_ID, 8, severity::INFO); //! [EXPORT] : [COMMENT] P1: Number of dumped packets. P2: Total dumped bytes. static constexpr Event DUMP_CFDP_STORE_DONE = event::makeEvent(SUBSYSTEM_ID, 9, severity::INFO); + +//! [EXPORT] : [COMMENT] P1: Number of dumped packets. P2: Total dumped bytes. +static constexpr Event DUMP_OK_CANCELLED = event::makeEvent(SUBSYSTEM_ID, 10, severity::LOW); +//! [EXPORT] : [COMMENT] P1: Number of dumped packets. P2: Total dumped bytes. +static constexpr Event DUMP_NOK_CANCELLED = event::makeEvent(SUBSYSTEM_ID, 11, severity::LOW); +//! [EXPORT] : [COMMENT] P1: Number of dumped packets. P2: Total dumped bytes. +static constexpr Event DUMP_MISC_CANCELLED = event::makeEvent(SUBSYSTEM_ID, 12, severity::LOW); +//! [EXPORT] : [COMMENT] P1: Number of dumped packets. P2: Total dumped bytes. +static constexpr Event DUMP_HK_CANCELLED = event::makeEvent(SUBSYSTEM_ID, 13, severity::LOW); +//! [EXPORT] : [COMMENT] P1: Number of dumped packets. P2: Total dumped bytes. +static constexpr Event DUMP_CFDP_CANCELLED = event::makeEvent(SUBSYSTEM_ID, 14, severity::LOW); }; // namespace persTmStore #endif /* MISSION_PERSISTENTTMSTOREDEFS_H_ */ diff --git a/mission/tmtc/PersistentLogTmStoreTask.cpp b/mission/tmtc/PersistentLogTmStoreTask.cpp index 84886cf6..67371ab0 100644 --- a/mission/tmtc/PersistentLogTmStoreTask.cpp +++ b/mission/tmtc/PersistentLogTmStoreTask.cpp @@ -8,9 +8,9 @@ PersistentLogTmStoreTask::PersistentLogTmStoreTask(object_id_t objectId, Storage SdCardMountedIF& sdcMan) : TmStoreTaskBase(objectId, ipcStore, channel, sdcMan), stores(stores), - okStoreContext(persTmStore::DUMP_OK_STORE_DONE), - notOkStoreContext(persTmStore::DUMP_NOK_STORE_DONE), - miscStoreContext(persTmStore::DUMP_MISC_STORE_DONE) {} + okStoreContext(persTmStore::DUMP_OK_STORE_DONE, persTmStore::DUMP_OK_CANCELLED), + notOkStoreContext(persTmStore::DUMP_NOK_STORE_DONE, persTmStore::DUMP_NOK_CANCELLED), + miscStoreContext(persTmStore::DUMP_MISC_STORE_DONE, persTmStore::DUMP_MISC_CANCELLED) {} ReturnValue_t PersistentLogTmStoreTask::performOperation(uint8_t opCode) { bool someonesBusy = false; diff --git a/mission/tmtc/PersistentSingleTmStoreTask.cpp b/mission/tmtc/PersistentSingleTmStoreTask.cpp index 121df1b7..2e57ceea 100644 --- a/mission/tmtc/PersistentSingleTmStoreTask.cpp +++ b/mission/tmtc/PersistentSingleTmStoreTask.cpp @@ -5,10 +5,10 @@ PersistentSingleTmStoreTask::PersistentSingleTmStoreTask( object_id_t objectId, StorageManagerIF& ipcStore, PersistentTmStoreWithTmQueue& tmStore, - VirtualChannel& channel, Event eventIfDumpDone, SdCardMountedIF& sdcMan) + VirtualChannel& channel, Event eventIfDumpDone, Event eventIfCancelled, SdCardMountedIF& sdcMan) : TmStoreTaskBase(objectId, ipcStore, channel, sdcMan), storeWithQueue(tmStore), - dumpContext(eventIfDumpDone) {} + dumpContext(eventIfDumpDone, eventIfCancelled) {} ReturnValue_t PersistentSingleTmStoreTask::performOperation(uint8_t opCode) { ReturnValue_t result = returnvalue::OK; diff --git a/mission/tmtc/PersistentSingleTmStoreTask.h b/mission/tmtc/PersistentSingleTmStoreTask.h index 07e0f05f..1529928f 100644 --- a/mission/tmtc/PersistentSingleTmStoreTask.h +++ b/mission/tmtc/PersistentSingleTmStoreTask.h @@ -11,7 +11,8 @@ class PersistentSingleTmStoreTask : public TmStoreTaskBase, public ExecutableObj public: PersistentSingleTmStoreTask(object_id_t objectId, StorageManagerIF& ipcStore, PersistentTmStoreWithTmQueue& storeWithQueue, VirtualChannel& channel, - Event eventIfDumpDone, SdCardMountedIF& sdcMan); + Event eventIfDumpDone, Event eventIfCancelled, + SdCardMountedIF& sdcMan); ReturnValue_t performOperation(uint8_t opCode) override; diff --git a/mission/tmtc/TmStoreTaskBase.cpp b/mission/tmtc/TmStoreTaskBase.cpp index 191272ed..7ca03488 100644 --- a/mission/tmtc/TmStoreTaskBase.cpp +++ b/mission/tmtc/TmStoreTaskBase.cpp @@ -70,6 +70,7 @@ bool TmStoreTaskBase::cyclicStoreCheck() { } void TmStoreTaskBase::cancelDump(DumpContext& ctx, PersistentTmStore& store, bool isTxOn) { + triggerEvent(ctx.eventIfCancelled, ctx.numberOfDumpedPackets, ctx.dumpedBytes); ctx.reset(); store.cancelDump(); if (isTxOn) { @@ -119,14 +120,11 @@ ReturnValue_t TmStoreTaskBase::handleOneDump(PersistentTmStoreWithTmQueue& store dumpContext.ptmeBusyCounter++; if (dumpContext.ptmeBusyCounter == 100) { // If this happens, something is probably wrong. - sif::warning << "PTME busy for longer period. Dumped length so far: " - << dumpContext.dumpedBytes << std::endl; - triggerEvent(persTmStore::DUMP_WAS_CANCELLED, store.getObjectId()); + sif::warning << "PTME busy for longer period. Cancelling dump" << std::endl; cancelDump(dumpContext, store, channel.isTxOn()); } } if (cancelDumpCd.hasTimedOut() or tmSinkBusyCd.hasTimedOut()) { - triggerEvent(persTmStore::DUMP_WAS_CANCELLED, store.getObjectId()); cancelDump(dumpContext, store, channel.isTxOn()); } return result; diff --git a/mission/tmtc/TmStoreTaskBase.h b/mission/tmtc/TmStoreTaskBase.h index 319e3361..54dcc6a4 100644 --- a/mission/tmtc/TmStoreTaskBase.h +++ b/mission/tmtc/TmStoreTaskBase.h @@ -12,7 +12,8 @@ class TmStoreTaskBase : public SystemObject { public: struct DumpContext { - DumpContext(Event eventIfDone) : eventIfDone(eventIfDone) {} + DumpContext(Event eventIfDone, Event eventIfCancelled) + : eventIfDone(eventIfDone), eventIfCancelled(eventIfCancelled) {} void reset() { numberOfDumpedPackets = 0; dumpedBytes = 0; @@ -22,6 +23,7 @@ class TmStoreTaskBase : public SystemObject { ptmeBusyCounter = 0; } const Event eventIfDone; + const Event eventIfCancelled; size_t numberOfDumpedPackets = 0; size_t bytesDumpedAtLastDelay = 0; size_t dumpedBytes = 0; @@ -65,7 +67,6 @@ class TmStoreTaskBase : public SystemObject { bool cyclicStoreCheck(); virtual bool initStoresIfPossible() = 0; - }; #endif /* MISSION_TMTC_TMSTORETASKBASE_H_ */ -- 2.43.0 From c474d6ed1d4a75972c09dee183c4f32d880e354e Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 28 Mar 2023 19:50:19 +0200 Subject: [PATCH 19/27] bump tmtc --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index 3f352346..f2897fa6 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 3f3523465a141bc2a2c36cbc9cbbf6ab7b3a9d70 +Subproject commit f2897fa6060e178ef8d11c9d29faa058896c9253 -- 2.43.0 From d09b53f6df97379e5efdea7404509d576f746927 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 28 Mar 2023 21:45:04 +0200 Subject: [PATCH 20/27] ns delay between gpio polls solves it --- linux/ipcore/PapbVcInterface.cpp | 8 ++++-- linux/ipcore/PapbVcInterface.h | 7 ++--- mission/tmtc/PersistentLogTmStoreTask.cpp | 8 +----- mission/tmtc/PersistentSingleTmStoreTask.cpp | 28 +++++++------------- 4 files changed, 21 insertions(+), 30 deletions(-) diff --git a/linux/ipcore/PapbVcInterface.cpp b/linux/ipcore/PapbVcInterface.cpp index b7081f0f..3e7210cc 100644 --- a/linux/ipcore/PapbVcInterface.cpp +++ b/linux/ipcore/PapbVcInterface.cpp @@ -34,14 +34,18 @@ ReturnValue_t PapbVcInterface::write(const uint8_t* data, size_t size) { return DirectTmSinkIF::IS_BUSY; } for (size_t idx = 0; idx < size; idx++) { - if (pollPapbBusySignal(3) == returnvalue::OK) { + // This delay is super-important, DO NOT REMOVE! + // Polling the GPIO + nanosleep(&BETWEEN_POLL_DELAY, &remDelay); + if (pollPapbBusySignal(2) == returnvalue::OK) { *(vcBaseReg + DATA_REG_OFFSET) = static_cast(data[idx]); } else { abortPacketTransfer(); return returnvalue::FAILED; } } - if (pollPapbBusySignal(3) == returnvalue::OK) { + nanosleep(&BETWEEN_POLL_DELAY, &remDelay); + if (pollPapbBusySignal(2) == returnvalue::OK) { completePacketTransfer(); } else { abortPacketTransfer(); diff --git a/linux/ipcore/PapbVcInterface.h b/linux/ipcore/PapbVcInterface.h index 8545a7ec..b4454dae 100644 --- a/linux/ipcore/PapbVcInterface.h +++ b/linux/ipcore/PapbVcInterface.h @@ -76,8 +76,8 @@ class PapbVcInterface : public VirtualChannelIF { */ static const int DATA_REG_OFFSET = 256; - static constexpr long int FIRST_NON_NULL_DELAY_NS = 1000; - static constexpr long int MAX_DELAY_PAPB_POLLING_NS = 4000; + static constexpr long int FIRST_NON_NULL_DELAY_NS = 10; + static constexpr long int MAX_DELAY_PAPB_POLLING_NS = 40; LinuxLibgpioIF* gpioComIF = nullptr; @@ -89,6 +89,7 @@ class PapbVcInterface : public VirtualChannelIF { std::string uioFile; int mapNum = 0; mutable struct timespec nextDelay = {.tv_sec = 0, .tv_nsec = 0}; + const struct timespec BETWEEN_POLL_DELAY = {.tv_sec = 0, .tv_nsec = 5}; mutable struct timespec remDelay; volatile uint32_t* vcBaseReg = nullptr; @@ -116,7 +117,7 @@ class PapbVcInterface : public VirtualChannelIF { * * @return returnvalue::OK when ready to receive data else PAPB_BUSY. */ - ReturnValue_t pollPapbBusySignal(uint32_t maxPollRetries) const; + inline ReturnValue_t pollPapbBusySignal(uint32_t maxPollRetries) const; /** * @brief This function can be used for debugging to check whether there are packets in diff --git a/mission/tmtc/PersistentLogTmStoreTask.cpp b/mission/tmtc/PersistentLogTmStoreTask.cpp index 67371ab0..c13b88f6 100644 --- a/mission/tmtc/PersistentLogTmStoreTask.cpp +++ b/mission/tmtc/PersistentLogTmStoreTask.cpp @@ -43,15 +43,9 @@ ReturnValue_t PersistentLogTmStoreTask::performOperation(uint8_t opCode) { stateHandlingForStore(handleOneStore(stores.miscStore, miscStoreContext), miscStoreContext); if (not someonesBusy) { TaskFactory::delayTask(100); - } else if (someFileWasSwapped) { - TaskFactory::delayTask(20); } else if (vcBusyDuringDump) { + // TODO: Might not be necessary TaskFactory::delayTask(20); - } else if (byteFlowControl) { - TaskFactory::delayTask(10); - } else { - // TODO: Lower this as much as possible... - TaskFactory::delayTask(10); } } } diff --git a/mission/tmtc/PersistentSingleTmStoreTask.cpp b/mission/tmtc/PersistentSingleTmStoreTask.cpp index 2e57ceea..33492d43 100644 --- a/mission/tmtc/PersistentSingleTmStoreTask.cpp +++ b/mission/tmtc/PersistentSingleTmStoreTask.cpp @@ -23,30 +23,22 @@ ReturnValue_t PersistentSingleTmStoreTask::performOperation(uint8_t opCode) { } bool busy = handleOneStore(storeWithQueue, dumpContext); if (not busy) { - result = TaskFactory::delayTask(100); + TaskFactory::delayTask(100); delayNotBusy++; } else if (dumpContext.vcBusyDuringDump) { + // TODO: Might not be necessary delaysVcBusyDuringDump++; - result = TaskFactory::delayTask(10); - } else if (dumpContext.packetWasDumped and - dumpContext.dumpedBytes - dumpContext.bytesDumpedAtLastDelay >= 2048) { - dumpContext.bytesDumpedAtLastDelay = dumpContext.dumpedBytes; - result = TaskFactory::delayTask(10); - delaysFlowControl++; + TaskFactory::delayTask(10); } else { - // TODO: Lower this as much as possible... - result = TaskFactory::delayTask(5); delayHotLoop++; } - if ((delaysVcBusyDuringDump + delaysFlowControl + delayNotBusy + delayHotLoop) % 2000000 == 0) { - sif::debug << "DLY NBUSY: " << delayNotBusy << std::endl; - sif::debug << "DLY FLCTRL: " << delaysFlowControl << std::endl; - sif::debug << "DLY BUSYDUMP: " << delaysVcBusyDuringDump << std::endl; - sif::debug << "DLY HOTLOOP: " << delayHotLoop << std::endl; - } - if (result != returnvalue::OK) { - sif::warning << "TmStoreTask: Delay failed" << std::endl; - } + // if ((delaysVcBusyDuringDump + delaysFlowControl + delayNotBusy + delayHotLoop) % 2000 == + // 0) { + // sif::debug << "DLY NBUSY: " << delayNotBusy << std::endl; + // sif::debug << "DLY FLCTRL: " << delaysFlowControl << std::endl; + // sif::debug << "DLY BUSYDUMP: " << delaysVcBusyDuringDump << std::endl; + // sif::debug << "DLY HOTLOOP: " << delayHotLoop << std::endl; + // } } } -- 2.43.0 From 053cfed0934809faa7581768367010a42d0ccb5d Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 28 Mar 2023 21:49:16 +0200 Subject: [PATCH 21/27] docs --- linux/ipcore/PapbVcInterface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/ipcore/PapbVcInterface.cpp b/linux/ipcore/PapbVcInterface.cpp index 3e7210cc..c130d31e 100644 --- a/linux/ipcore/PapbVcInterface.cpp +++ b/linux/ipcore/PapbVcInterface.cpp @@ -35,7 +35,7 @@ ReturnValue_t PapbVcInterface::write(const uint8_t* data, size_t size) { } for (size_t idx = 0; idx < size; idx++) { // This delay is super-important, DO NOT REMOVE! - // Polling the GPIO + // Polling the GPIO too often can mess up the scheduler. nanosleep(&BETWEEN_POLL_DELAY, &remDelay); if (pollPapbBusySignal(2) == returnvalue::OK) { *(vcBaseReg + DATA_REG_OFFSET) = static_cast(data[idx]); -- 2.43.0 From 4d1fbbcabda165ddf2c842df6a04f79d11a5d71c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 28 Mar 2023 21:51:54 +0200 Subject: [PATCH 22/27] re-generate files --- .../fsfwconfig/events/translateEvents.cpp | 25 +++++++++++---- .../fsfwconfig/objects/translateObjects.cpp | 2 +- generators/bsp_hosted_events.csv | 6 +++- generators/bsp_hosted_returnvalues.csv | 28 ++++++++-------- generators/bsp_q7s_events.csv | 6 +++- generators/bsp_q7s_returnvalues.csv | 32 +++++++++---------- generators/events/translateEvents.cpp | 22 ++++++++++--- generators/objects/translateObjects.cpp | 2 +- linux/fsfwconfig/events/translateEvents.cpp | 25 +++++++++++---- linux/fsfwconfig/objects/translateObjects.cpp | 2 +- tmtc | 2 +- 11 files changed, 95 insertions(+), 57 deletions(-) diff --git a/bsp_hosted/fsfwconfig/events/translateEvents.cpp b/bsp_hosted/fsfwconfig/events/translateEvents.cpp index c3d0a8a8..1be6ee7c 100644 --- a/bsp_hosted/fsfwconfig/events/translateEvents.cpp +++ b/bsp_hosted/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 279 translations. + * @brief Auto-generated event translation file. Contains 283 translations. * @details - * Generated on: 2023-03-26 16:40:57 + * Generated on: 2023-03-28 21:50:28 */ #include "translateEvents.h" @@ -212,8 +212,7 @@ const char *SIDE_SWITCH_TRANSITION_NOT_ALLOWED_STRING = "SIDE_SWITCH_TRANSITION_ const char *TRANSITION_OTHER_SIDE_FAILED_12900_STRING = "TRANSITION_OTHER_SIDE_FAILED_12900"; const char *NOT_ENOUGH_DEVICES_DUAL_MODE_12901_STRING = "NOT_ENOUGH_DEVICES_DUAL_MODE_12901"; const char *POWER_STATE_MACHINE_TIMEOUT_12902_STRING = "POWER_STATE_MACHINE_TIMEOUT_12902"; -const char *SIDE_SWITCH_TRANSITION_NOT_ALLOWED_12903_STRING = - "SIDE_SWITCH_TRANSITION_NOT_ALLOWED_12903"; +const char *SIDE_SWITCH_TRANSITION_NOT_ALLOWED_12903_STRING = "SIDE_SWITCH_TRANSITION_NOT_ALLOWED_12903"; const char *CHILDREN_LOST_MODE_STRING = "CHILDREN_LOST_MODE"; const char *GPS_FIX_CHANGE_STRING = "GPS_FIX_CHANGE"; const char *CANT_GET_FIX_STRING = "CANT_GET_FIX"; @@ -279,12 +278,16 @@ const char *BIT_LOCK_TX_ON_STRING = "BIT_LOCK_TX_ON"; const char *POSSIBLE_FILE_CORRUPTION_STRING = "POSSIBLE_FILE_CORRUPTION"; const char *FILE_TOO_LARGE_STRING = "FILE_TOO_LARGE"; const char *BUSY_DUMPING_EVENT_STRING = "BUSY_DUMPING_EVENT"; -const char *DUMP_WAS_CANCELLED_STRING = "DUMP_WAS_CANCELLED"; const char *DUMP_OK_STORE_DONE_STRING = "DUMP_OK_STORE_DONE"; const char *DUMP_NOK_STORE_DONE_STRING = "DUMP_NOK_STORE_DONE"; const char *DUMP_MISC_STORE_DONE_STRING = "DUMP_MISC_STORE_DONE"; const char *DUMP_HK_STORE_DONE_STRING = "DUMP_HK_STORE_DONE"; const char *DUMP_CFDP_STORE_DONE_STRING = "DUMP_CFDP_STORE_DONE"; +const char *DUMP_OK_CANCELLED_STRING = "DUMP_OK_CANCELLED"; +const char *DUMP_NOK_CANCELLED_STRING = "DUMP_NOK_CANCELLED"; +const char *DUMP_MISC_CANCELLED_STRING = "DUMP_MISC_CANCELLED"; +const char *DUMP_HK_CANCELLED_STRING = "DUMP_HK_CANCELLED"; +const char *DUMP_CFDP_CANCELLED_STRING = "DUMP_CFDP_CANCELLED"; const char *translateEvents(Event event) { switch ((event & 0xFFFF)) { @@ -834,8 +837,6 @@ const char *translateEvents(Event event) { return FILE_TOO_LARGE_STRING; case (14302): return BUSY_DUMPING_EVENT_STRING; - case (14303): - return DUMP_WAS_CANCELLED_STRING; case (14305): return DUMP_OK_STORE_DONE_STRING; case (14306): @@ -846,6 +847,16 @@ const char *translateEvents(Event event) { return DUMP_HK_STORE_DONE_STRING; case (14309): return DUMP_CFDP_STORE_DONE_STRING; + case (14310): + return DUMP_OK_CANCELLED_STRING; + case (14311): + return DUMP_NOK_CANCELLED_STRING; + case (14312): + return DUMP_MISC_CANCELLED_STRING; + case (14313): + return DUMP_HK_CANCELLED_STRING; + case (14314): + return DUMP_CFDP_CANCELLED_STRING; default: return "UNKNOWN_EVENT"; } diff --git a/bsp_hosted/fsfwconfig/objects/translateObjects.cpp b/bsp_hosted/fsfwconfig/objects/translateObjects.cpp index 0b3c7d14..694fbf85 100644 --- a/bsp_hosted/fsfwconfig/objects/translateObjects.cpp +++ b/bsp_hosted/fsfwconfig/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 169 translations. - * Generated on: 2023-03-26 16:40:57 + * Generated on: 2023-03-28 21:50:28 */ #include "translateObjects.h" diff --git a/generators/bsp_hosted_events.csv b/generators/bsp_hosted_events.csv index 19f38913..45403043 100644 --- a/generators/bsp_hosted_events.csv +++ b/generators/bsp_hosted_events.csv @@ -272,9 +272,13 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 14300;0x37dc;POSSIBLE_FILE_CORRUPTION;LOW;P1: Result code of TM packet parser. P2: Timestamp of possibly corrupt file as a unix timestamp.;mission/persistentTmStoreDefs.h 14301;0x37dd;FILE_TOO_LARGE;LOW;File in store too large. P1: Detected file size P2: Allowed file size;mission/persistentTmStoreDefs.h 14302;0x37de;BUSY_DUMPING_EVENT;INFO;No description;mission/persistentTmStoreDefs.h -14303;0x37df;DUMP_WAS_CANCELLED;LOW;Dump was cancelled. P1: Object ID of store.;mission/persistentTmStoreDefs.h 14305;0x37e1;DUMP_OK_STORE_DONE;INFO;P1: Number of dumped packets. P2: Total dumped bytes.;mission/persistentTmStoreDefs.h 14306;0x37e2;DUMP_NOK_STORE_DONE;INFO;P1: Number of dumped packets. P2: Total dumped bytes.;mission/persistentTmStoreDefs.h 14307;0x37e3;DUMP_MISC_STORE_DONE;INFO;P1: Number of dumped packets. P2: Total dumped bytes.;mission/persistentTmStoreDefs.h 14308;0x37e4;DUMP_HK_STORE_DONE;INFO;P1: Number of dumped packets. P2: Total dumped bytes.;mission/persistentTmStoreDefs.h 14309;0x37e5;DUMP_CFDP_STORE_DONE;INFO;P1: Number of dumped packets. P2: Total dumped bytes.;mission/persistentTmStoreDefs.h +14310;0x37e6;DUMP_OK_CANCELLED;LOW;P1: Number of dumped packets. P2: Total dumped bytes.;mission/persistentTmStoreDefs.h +14311;0x37e7;DUMP_NOK_CANCELLED;LOW;P1: Number of dumped packets. P2: Total dumped bytes.;mission/persistentTmStoreDefs.h +14312;0x37e8;DUMP_MISC_CANCELLED;LOW;P1: Number of dumped packets. P2: Total dumped bytes.;mission/persistentTmStoreDefs.h +14313;0x37e9;DUMP_HK_CANCELLED;LOW;P1: Number of dumped packets. P2: Total dumped bytes.;mission/persistentTmStoreDefs.h +14314;0x37ea;DUMP_CFDP_CANCELLED;LOW;P1: Number of dumped packets. P2: Total dumped bytes.;mission/persistentTmStoreDefs.h diff --git a/generators/bsp_hosted_returnvalues.csv b/generators/bsp_hosted_returnvalues.csv index 09429179..dc960aa3 100644 --- a/generators/bsp_hosted_returnvalues.csv +++ b/generators/bsp_hosted_returnvalues.csv @@ -291,8 +291,8 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x2e02;HPA_InvalidDomainId;No description;2;HAS_PARAMETERS_IF;fsfw/src/fsfw/parameters/HasParametersIF.h 0x2e03;HPA_InvalidValue;No description;3;HAS_PARAMETERS_IF;fsfw/src/fsfw/parameters/HasParametersIF.h 0x2e05;HPA_ReadOnly;No description;5;HAS_PARAMETERS_IF;fsfw/src/fsfw/parameters/HasParametersIF.h -0x2f01;ASC_NoPacketFound;No description;1;ASCII_CONVERTER;fsfw/src/fsfw/globalfunctions/DleParser.h -0x2f02;ASC_PossiblePacketLoss;No description;2;ASCII_CONVERTER;fsfw/src/fsfw/globalfunctions/DleParser.h +0x2f01;ASC_TooLongForTargetType;No description;1;ASCII_CONVERTER;fsfw/src/fsfw/globalfunctions/AsciiConverter.h +0x2f02;ASC_InvalidCharacters;No description;2;ASCII_CONVERTER;fsfw/src/fsfw/globalfunctions/AsciiConverter.h 0x2f03;ASC_BufferTooSmall;No description;3;ASCII_CONVERTER;fsfw/src/fsfw/globalfunctions/AsciiConverter.h 0x3001;POS_InPowerTransition;No description;1;POWER_SWITCHER;fsfw/src/fsfw/power/PowerSwitcher.h 0x3002;POS_SwitchStateMismatch;No description;2;POWER_SWITCHER;fsfw/src/fsfw/power/PowerSwitcher.h @@ -371,8 +371,8 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x3e03;HKM_PeriodicHelperInvalid;No description;3;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h 0x3e04;HKM_PoolobjectNotFound;No description;4;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h 0x3e05;HKM_DatasetNotFound;No description;5;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h -0x3f01;DLEE_StreamTooShort;No description;1;DLE_ENCODER;fsfw/src/fsfw/globalfunctions/DleEncoder.h -0x3f02;DLEE_DecodingError;No description;2;DLE_ENCODER;fsfw/src/fsfw/globalfunctions/DleEncoder.h +0x3f01;DLEE_NoPacketFound;No description;1;DLE_ENCODER;fsfw/src/fsfw/globalfunctions/DleParser.h +0x3f02;DLEE_PossiblePacketLoss;No description;2;DLE_ENCODER;fsfw/src/fsfw/globalfunctions/DleParser.h 0x4201;PUS11_InvalidTypeTimeWindow;No description;1;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h 0x4202;PUS11_InvalidTimeWindow;No description;2;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h 0x4203;PUS11_TimeshiftingNotPossible;No description;3;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h @@ -402,9 +402,9 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x4403;UXOS_CommandError;Command execution failed;3;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h 0x4404;UXOS_NoCommandLoadedOrPending;;4;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h 0x4406;UXOS_PcloseCallError;No description;6;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h -0x4500;HSPI_HalTimeoutRetval;No description;0;HAL_SPI;fsfw/src/fsfw_hal/stm32h7/spi/spiDefinitions.h -0x4501;HSPI_HalBusyRetval;No description;1;HAL_SPI;fsfw/src/fsfw_hal/stm32h7/spi/spiDefinitions.h -0x4502;HSPI_HalErrorRetval;No description;2;HAL_SPI;fsfw/src/fsfw_hal/stm32h7/spi/spiDefinitions.h +0x4500;HSPI_OpeningFileFailed;No description;0;HAL_SPI;fsfw/src/fsfw_hal/linux/spi/SpiComIF.h +0x4501;HSPI_FullDuplexTransferFailed;No description;1;HAL_SPI;fsfw/src/fsfw_hal/linux/spi/SpiComIF.h +0x4502;HSPI_HalfDuplexTransferFailed;No description;2;HAL_SPI;fsfw/src/fsfw_hal/linux/spi/SpiComIF.h 0x4601;HURT_UartReadFailure;No description;1;HAL_UART;fsfw/src/fsfw_hal/linux/serial/SerialComIF.h 0x4602;HURT_UartReadSizeMissmatch;No description;2;HAL_UART;fsfw/src/fsfw_hal/linux/serial/SerialComIF.h 0x4603;HURT_UartRxBufferTooSmall;No description;3;HAL_UART;fsfw/src/fsfw_hal/linux/serial/SerialComIF.h @@ -415,12 +415,6 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x4805;HGIO_GpioDuplicateDetected;No description;5;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h 0x4806;HGIO_GpioInitFailed;No description;6;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h 0x4807;HGIO_GpioGetValueFailed;No description;7;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4aa0;MGMLIS3_InvalidSpeed;Action Message with invalid speed was received. Valid speeds must be in the range of [-65000, 1000] or [1000, 65000];160;MGM_LIS3MDL;mission/acs/RwHandler.h -0x4aa1;MGMLIS3_InvalidRampTime;Action Message with invalid ramp time was received.;161;MGM_LIS3MDL;mission/acs/RwHandler.h -0x4aa2;MGMLIS3_SetSpeedCommandInvalidLength;Received set speed command has invalid length. Should be 6.;162;MGM_LIS3MDL;mission/acs/RwHandler.h -0x4aa3;MGMLIS3_ExecutionFailed;Command execution failed;163;MGM_LIS3MDL;mission/acs/RwHandler.h -0x4aa4;MGMLIS3_CrcError;Reaction wheel reply has invalid crc;164;MGM_LIS3MDL;mission/acs/RwHandler.h -0x4aa5;MGMLIS3_ValueNotRead;No description;165;MGM_LIS3MDL;mission/acs/RwHandler.h 0x4c00;SPPA_NoPacketFound;No description;0;SPACE_PACKET_PARSER;fsfw/src/fsfw/tmtcservices/SpacePacketParser.h 0x4c01;SPPA_SplitPacket;No description;1;SPACE_PACKET_PARSER;fsfw/src/fsfw/tmtcservices/SpacePacketParser.h 0x4fa1;HEATER_CommandNotSupported;No description;161;HEATER_HANDLER;mission/tcs/HeaterHandler.h @@ -480,8 +474,12 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x53b6;STRH_StartrackerAlreadyBooted;Star tracker is already in firmware mode;182;STR_HANDLER;mission/acs/str/StarTrackerHandler.h 0x53b7;STRH_StartrackerNotRunningFirmware;Star tracker must be in firmware mode to run this command;183;STR_HANDLER;mission/acs/str/StarTrackerHandler.h 0x53b8;STRH_StartrackerNotRunningBootloader;Star tracker must be in bootloader mode to run this command;184;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x58a0;SUSS_ErrorUnlockMutex;No description;160;SUS_HANDLER;mission/acs/archive/LegacySusHandler.h -0x58a1;SUSS_ErrorLockMutex;No description;161;SUS_HANDLER;mission/acs/archive/LegacySusHandler.h +0x58a0;SUSS_InvalidSpeed;Action Message with invalid speed was received. Valid speeds must be in the range of [-65000, 1000] or [1000, 65000];160;SUS_HANDLER;mission/acs/RwHandler.h +0x58a1;SUSS_InvalidRampTime;Action Message with invalid ramp time was received.;161;SUS_HANDLER;mission/acs/RwHandler.h +0x58a2;SUSS_SetSpeedCommandInvalidLength;Received set speed command has invalid length. Should be 6.;162;SUS_HANDLER;mission/acs/RwHandler.h +0x58a3;SUSS_ExecutionFailed;Command execution failed;163;SUS_HANDLER;mission/acs/RwHandler.h +0x58a4;SUSS_CrcError;Reaction wheel reply has invalid crc;164;SUS_HANDLER;mission/acs/RwHandler.h +0x58a5;SUSS_ValueNotRead;No description;165;SUS_HANDLER;mission/acs/RwHandler.h 0x5d00;GOMS_PacketTooLong;No description;0;GOM_SPACE_HANDLER;mission/power/GomspaceDeviceHandler.h 0x5d01;GOMS_InvalidTableId;No description;1;GOM_SPACE_HANDLER;mission/power/GomspaceDeviceHandler.h 0x5d02;GOMS_InvalidAddress;No description;2;GOM_SPACE_HANDLER;mission/power/GomspaceDeviceHandler.h diff --git a/generators/bsp_q7s_events.csv b/generators/bsp_q7s_events.csv index 19f38913..45403043 100644 --- a/generators/bsp_q7s_events.csv +++ b/generators/bsp_q7s_events.csv @@ -272,9 +272,13 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 14300;0x37dc;POSSIBLE_FILE_CORRUPTION;LOW;P1: Result code of TM packet parser. P2: Timestamp of possibly corrupt file as a unix timestamp.;mission/persistentTmStoreDefs.h 14301;0x37dd;FILE_TOO_LARGE;LOW;File in store too large. P1: Detected file size P2: Allowed file size;mission/persistentTmStoreDefs.h 14302;0x37de;BUSY_DUMPING_EVENT;INFO;No description;mission/persistentTmStoreDefs.h -14303;0x37df;DUMP_WAS_CANCELLED;LOW;Dump was cancelled. P1: Object ID of store.;mission/persistentTmStoreDefs.h 14305;0x37e1;DUMP_OK_STORE_DONE;INFO;P1: Number of dumped packets. P2: Total dumped bytes.;mission/persistentTmStoreDefs.h 14306;0x37e2;DUMP_NOK_STORE_DONE;INFO;P1: Number of dumped packets. P2: Total dumped bytes.;mission/persistentTmStoreDefs.h 14307;0x37e3;DUMP_MISC_STORE_DONE;INFO;P1: Number of dumped packets. P2: Total dumped bytes.;mission/persistentTmStoreDefs.h 14308;0x37e4;DUMP_HK_STORE_DONE;INFO;P1: Number of dumped packets. P2: Total dumped bytes.;mission/persistentTmStoreDefs.h 14309;0x37e5;DUMP_CFDP_STORE_DONE;INFO;P1: Number of dumped packets. P2: Total dumped bytes.;mission/persistentTmStoreDefs.h +14310;0x37e6;DUMP_OK_CANCELLED;LOW;P1: Number of dumped packets. P2: Total dumped bytes.;mission/persistentTmStoreDefs.h +14311;0x37e7;DUMP_NOK_CANCELLED;LOW;P1: Number of dumped packets. P2: Total dumped bytes.;mission/persistentTmStoreDefs.h +14312;0x37e8;DUMP_MISC_CANCELLED;LOW;P1: Number of dumped packets. P2: Total dumped bytes.;mission/persistentTmStoreDefs.h +14313;0x37e9;DUMP_HK_CANCELLED;LOW;P1: Number of dumped packets. P2: Total dumped bytes.;mission/persistentTmStoreDefs.h +14314;0x37ea;DUMP_CFDP_CANCELLED;LOW;P1: Number of dumped packets. P2: Total dumped bytes.;mission/persistentTmStoreDefs.h diff --git a/generators/bsp_q7s_returnvalues.csv b/generators/bsp_q7s_returnvalues.csv index d91b080f..9f6f0379 100644 --- a/generators/bsp_q7s_returnvalues.csv +++ b/generators/bsp_q7s_returnvalues.csv @@ -291,8 +291,8 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x2e02;HPA_InvalidDomainId;No description;2;HAS_PARAMETERS_IF;fsfw/src/fsfw/parameters/HasParametersIF.h 0x2e03;HPA_InvalidValue;No description;3;HAS_PARAMETERS_IF;fsfw/src/fsfw/parameters/HasParametersIF.h 0x2e05;HPA_ReadOnly;No description;5;HAS_PARAMETERS_IF;fsfw/src/fsfw/parameters/HasParametersIF.h -0x2f01;ASC_NoPacketFound;No description;1;ASCII_CONVERTER;fsfw/src/fsfw/globalfunctions/DleParser.h -0x2f02;ASC_PossiblePacketLoss;No description;2;ASCII_CONVERTER;fsfw/src/fsfw/globalfunctions/DleParser.h +0x2f01;ASC_TooLongForTargetType;No description;1;ASCII_CONVERTER;fsfw/src/fsfw/globalfunctions/AsciiConverter.h +0x2f02;ASC_InvalidCharacters;No description;2;ASCII_CONVERTER;fsfw/src/fsfw/globalfunctions/AsciiConverter.h 0x2f03;ASC_BufferTooSmall;No description;3;ASCII_CONVERTER;fsfw/src/fsfw/globalfunctions/AsciiConverter.h 0x3001;POS_InPowerTransition;No description;1;POWER_SWITCHER;fsfw/src/fsfw/power/PowerSwitcher.h 0x3002;POS_SwitchStateMismatch;No description;2;POWER_SWITCHER;fsfw/src/fsfw/power/PowerSwitcher.h @@ -371,8 +371,8 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x3e03;HKM_PeriodicHelperInvalid;No description;3;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h 0x3e04;HKM_PoolobjectNotFound;No description;4;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h 0x3e05;HKM_DatasetNotFound;No description;5;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h -0x3f01;DLEE_StreamTooShort;No description;1;DLE_ENCODER;fsfw/src/fsfw/globalfunctions/DleEncoder.h -0x3f02;DLEE_DecodingError;No description;2;DLE_ENCODER;fsfw/src/fsfw/globalfunctions/DleEncoder.h +0x3f01;DLEE_NoPacketFound;No description;1;DLE_ENCODER;fsfw/src/fsfw/globalfunctions/DleParser.h +0x3f02;DLEE_PossiblePacketLoss;No description;2;DLE_ENCODER;fsfw/src/fsfw/globalfunctions/DleParser.h 0x4201;PUS11_InvalidTypeTimeWindow;No description;1;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h 0x4202;PUS11_InvalidTimeWindow;No description;2;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h 0x4203;PUS11_TimeshiftingNotPossible;No description;3;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h @@ -402,9 +402,9 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x4403;UXOS_CommandError;Command execution failed;3;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h 0x4404;UXOS_NoCommandLoadedOrPending;;4;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h 0x4406;UXOS_PcloseCallError;No description;6;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h -0x4500;HSPI_HalTimeoutRetval;No description;0;HAL_SPI;fsfw/src/fsfw_hal/stm32h7/spi/spiDefinitions.h -0x4501;HSPI_HalBusyRetval;No description;1;HAL_SPI;fsfw/src/fsfw_hal/stm32h7/spi/spiDefinitions.h -0x4502;HSPI_HalErrorRetval;No description;2;HAL_SPI;fsfw/src/fsfw_hal/stm32h7/spi/spiDefinitions.h +0x4500;HSPI_OpeningFileFailed;No description;0;HAL_SPI;fsfw/src/fsfw_hal/linux/spi/SpiComIF.h +0x4501;HSPI_FullDuplexTransferFailed;No description;1;HAL_SPI;fsfw/src/fsfw_hal/linux/spi/SpiComIF.h +0x4502;HSPI_HalfDuplexTransferFailed;No description;2;HAL_SPI;fsfw/src/fsfw_hal/linux/spi/SpiComIF.h 0x4601;HURT_UartReadFailure;No description;1;HAL_UART;fsfw/src/fsfw_hal/linux/serial/SerialComIF.h 0x4602;HURT_UartReadSizeMissmatch;No description;2;HAL_UART;fsfw/src/fsfw_hal/linux/serial/SerialComIF.h 0x4603;HURT_UartRxBufferTooSmall;No description;3;HAL_UART;fsfw/src/fsfw_hal/linux/serial/SerialComIF.h @@ -415,12 +415,6 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x4805;HGIO_GpioDuplicateDetected;No description;5;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h 0x4806;HGIO_GpioInitFailed;No description;6;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h 0x4807;HGIO_GpioGetValueFailed;No description;7;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4aa0;MGMLIS3_InvalidSpeed;Action Message with invalid speed was received. Valid speeds must be in the range of [-65000, 1000] or [1000, 65000];160;MGM_LIS3MDL;mission/acs/RwHandler.h -0x4aa1;MGMLIS3_InvalidRampTime;Action Message with invalid ramp time was received.;161;MGM_LIS3MDL;mission/acs/RwHandler.h -0x4aa2;MGMLIS3_SetSpeedCommandInvalidLength;Received set speed command has invalid length. Should be 6.;162;MGM_LIS3MDL;mission/acs/RwHandler.h -0x4aa3;MGMLIS3_ExecutionFailed;Command execution failed;163;MGM_LIS3MDL;mission/acs/RwHandler.h -0x4aa4;MGMLIS3_CrcError;Reaction wheel reply has invalid crc;164;MGM_LIS3MDL;mission/acs/RwHandler.h -0x4aa5;MGMLIS3_ValueNotRead;No description;165;MGM_LIS3MDL;mission/acs/RwHandler.h 0x4c00;SPPA_NoPacketFound;No description;0;SPACE_PACKET_PARSER;fsfw/src/fsfw/tmtcservices/SpacePacketParser.h 0x4c01;SPPA_SplitPacket;No description;1;SPACE_PACKET_PARSER;fsfw/src/fsfw/tmtcservices/SpacePacketParser.h 0x4fa1;HEATER_CommandNotSupported;No description;161;HEATER_HANDLER;mission/tcs/HeaterHandler.h @@ -492,12 +486,16 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x57a1;PLSPVhLP_ProcessTerminated;Process has been terminated by command;161;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h 0x57a2;PLSPVhLP_PathNotExists;Received command with invalid pathname;162;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h 0x57a3;PLSPVhLP_EventBufferReplyInvalidApid;Expected event buffer TM but received space packet with other APID;163;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h -0x58a0;SUSS_ErrorUnlockMutex;No description;160;SUS_HANDLER;mission/acs/archive/LegacySusHandler.h -0x58a1;SUSS_ErrorLockMutex;No description;161;SUS_HANDLER;mission/acs/archive/LegacySusHandler.h +0x58a0;SUSS_InvalidSpeed;Action Message with invalid speed was received. Valid speeds must be in the range of [-65000, 1000] or [1000, 65000];160;SUS_HANDLER;mission/acs/RwHandler.h +0x58a1;SUSS_InvalidRampTime;Action Message with invalid ramp time was received.;161;SUS_HANDLER;mission/acs/RwHandler.h +0x58a2;SUSS_SetSpeedCommandInvalidLength;Received set speed command has invalid length. Should be 6.;162;SUS_HANDLER;mission/acs/RwHandler.h +0x58a3;SUSS_ExecutionFailed;Command execution failed;163;SUS_HANDLER;mission/acs/RwHandler.h +0x58a4;SUSS_CrcError;Reaction wheel reply has invalid crc;164;SUS_HANDLER;mission/acs/RwHandler.h +0x58a5;SUSS_ValueNotRead;No description;165;SUS_HANDLER;mission/acs/RwHandler.h +0x5900;IPCI_NoReplyAvailable;No description;0;CCSDS_IP_CORE_BRIDGE;linux/acs/ImtqPollingTask.h 0x5901;IPCI_NoPacketFound;No description;1;CCSDS_IP_CORE_BRIDGE;linux/com/SyrlinksComHandler.h 0x59a0;IPCI_PapbBusy;No description;160;CCSDS_IP_CORE_BRIDGE;linux/ipcore/PapbVcInterface.h 0x5aa0;PTME_UnknownVcId;No description;160;PTME;linux/ipcore/Ptme.h -0x5c00;STRHLP_NoReplyAvailable;No description;0;STR_HELPER;linux/acs/ImtqPollingTask.h 0x5c01;STRHLP_SdNotMounted;SD card specified in path string not mounted;1;STR_HELPER;linux/acs/StrComHandler.h 0x5c02;STRHLP_FileNotExists;Specified file does not exist on filesystem;2;STR_HELPER;linux/acs/StrComHandler.h 0x5c03;STRHLP_PathNotExists;Specified path does not exist;3;STR_HELPER;linux/acs/StrComHandler.h @@ -515,7 +513,6 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x5d03;GOMS_InvalidParamSize;No description;3;GOM_SPACE_HANDLER;mission/power/GomspaceDeviceHandler.h 0x5d04;GOMS_InvalidPayloadSize;No description;4;GOM_SPACE_HANDLER;mission/power/GomspaceDeviceHandler.h 0x5d05;GOMS_UnknownReplyId;No description;5;GOM_SPACE_HANDLER;mission/power/GomspaceDeviceHandler.h -0x5e02;PLMEMDUMP_InvalidCrc;No description;2;PLOC_MEMORY_DUMPER;linux/payload/ScexHelper.h 0x5ea0;PLMEMDUMP_MramAddressTooHigh;The capacity of the MRAM amounts to 512 kB. Thus the maximum address must not be higher than 0x7d000.;160;PLOC_MEMORY_DUMPER;linux/payload/PlocMemoryDumper.h 0x5ea1;PLMEMDUMP_MramInvalidAddressCombination;The specified end address is lower than the start address;161;PLOC_MEMORY_DUMPER;linux/payload/PlocMemoryDumper.h 0x5fa0;PDEC_AbandonedCltuRetval;No description;160;PDEC_HANDLER;linux/ipcore/PdecHandler.h @@ -544,6 +541,7 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x63a0;NVMB_KeyNotExists;Specified key does not exist in json file;160;NVM_PARAM_BASE;mission/memory/NvmParameterBase.h 0x64a0;FSHLP_SdNotMounted;SD card specified with path string not mounted;160;FILE_SYSTEM_HELPER;bsp_q7s/fs/FilesystemHelper.h 0x64a1;FSHLP_FileNotExists;Specified file does not exist on filesystem;161;FILE_SYSTEM_HELPER;bsp_q7s/fs/FilesystemHelper.h +0x6502;PLMPHLP_InvalidCrc;No description;2;PLOC_MPSOC_HELPER;linux/payload/ScexHelper.h 0x65a0;PLMPHLP_FileClosedAccidentally;File accidentally close;160;PLOC_MPSOC_HELPER;linux/payload/PlocMpsocHelper.h 0x66a0;SADPL_CommandNotSupported;No description;160;SA_DEPL_HANDLER;mission/SolarArrayDeploymentHandler.h 0x66a1;SADPL_DeploymentAlreadyExecuting;No description;161;SA_DEPL_HANDLER;mission/SolarArrayDeploymentHandler.h diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index 45bee897..1be6ee7c 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 279 translations. + * @brief Auto-generated event translation file. Contains 283 translations. * @details - * Generated on: 2023-03-26 16:40:57 + * Generated on: 2023-03-28 21:50:28 */ #include "translateEvents.h" @@ -278,12 +278,16 @@ const char *BIT_LOCK_TX_ON_STRING = "BIT_LOCK_TX_ON"; const char *POSSIBLE_FILE_CORRUPTION_STRING = "POSSIBLE_FILE_CORRUPTION"; const char *FILE_TOO_LARGE_STRING = "FILE_TOO_LARGE"; const char *BUSY_DUMPING_EVENT_STRING = "BUSY_DUMPING_EVENT"; -const char *DUMP_WAS_CANCELLED_STRING = "DUMP_WAS_CANCELLED"; const char *DUMP_OK_STORE_DONE_STRING = "DUMP_OK_STORE_DONE"; const char *DUMP_NOK_STORE_DONE_STRING = "DUMP_NOK_STORE_DONE"; const char *DUMP_MISC_STORE_DONE_STRING = "DUMP_MISC_STORE_DONE"; const char *DUMP_HK_STORE_DONE_STRING = "DUMP_HK_STORE_DONE"; const char *DUMP_CFDP_STORE_DONE_STRING = "DUMP_CFDP_STORE_DONE"; +const char *DUMP_OK_CANCELLED_STRING = "DUMP_OK_CANCELLED"; +const char *DUMP_NOK_CANCELLED_STRING = "DUMP_NOK_CANCELLED"; +const char *DUMP_MISC_CANCELLED_STRING = "DUMP_MISC_CANCELLED"; +const char *DUMP_HK_CANCELLED_STRING = "DUMP_HK_CANCELLED"; +const char *DUMP_CFDP_CANCELLED_STRING = "DUMP_CFDP_CANCELLED"; const char *translateEvents(Event event) { switch ((event & 0xFFFF)) { @@ -833,8 +837,6 @@ const char *translateEvents(Event event) { return FILE_TOO_LARGE_STRING; case (14302): return BUSY_DUMPING_EVENT_STRING; - case (14303): - return DUMP_WAS_CANCELLED_STRING; case (14305): return DUMP_OK_STORE_DONE_STRING; case (14306): @@ -845,6 +847,16 @@ const char *translateEvents(Event event) { return DUMP_HK_STORE_DONE_STRING; case (14309): return DUMP_CFDP_STORE_DONE_STRING; + case (14310): + return DUMP_OK_CANCELLED_STRING; + case (14311): + return DUMP_NOK_CANCELLED_STRING; + case (14312): + return DUMP_MISC_CANCELLED_STRING; + case (14313): + return DUMP_HK_CANCELLED_STRING; + case (14314): + return DUMP_CFDP_CANCELLED_STRING; default: return "UNKNOWN_EVENT"; } diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index 8d3455e3..682e515a 100644 --- a/generators/objects/translateObjects.cpp +++ b/generators/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 173 translations. - * Generated on: 2023-03-26 16:40:57 + * Generated on: 2023-03-28 21:50:28 */ #include "translateObjects.h" diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index c3d0a8a8..1be6ee7c 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 279 translations. + * @brief Auto-generated event translation file. Contains 283 translations. * @details - * Generated on: 2023-03-26 16:40:57 + * Generated on: 2023-03-28 21:50:28 */ #include "translateEvents.h" @@ -212,8 +212,7 @@ const char *SIDE_SWITCH_TRANSITION_NOT_ALLOWED_STRING = "SIDE_SWITCH_TRANSITION_ const char *TRANSITION_OTHER_SIDE_FAILED_12900_STRING = "TRANSITION_OTHER_SIDE_FAILED_12900"; const char *NOT_ENOUGH_DEVICES_DUAL_MODE_12901_STRING = "NOT_ENOUGH_DEVICES_DUAL_MODE_12901"; const char *POWER_STATE_MACHINE_TIMEOUT_12902_STRING = "POWER_STATE_MACHINE_TIMEOUT_12902"; -const char *SIDE_SWITCH_TRANSITION_NOT_ALLOWED_12903_STRING = - "SIDE_SWITCH_TRANSITION_NOT_ALLOWED_12903"; +const char *SIDE_SWITCH_TRANSITION_NOT_ALLOWED_12903_STRING = "SIDE_SWITCH_TRANSITION_NOT_ALLOWED_12903"; const char *CHILDREN_LOST_MODE_STRING = "CHILDREN_LOST_MODE"; const char *GPS_FIX_CHANGE_STRING = "GPS_FIX_CHANGE"; const char *CANT_GET_FIX_STRING = "CANT_GET_FIX"; @@ -279,12 +278,16 @@ const char *BIT_LOCK_TX_ON_STRING = "BIT_LOCK_TX_ON"; const char *POSSIBLE_FILE_CORRUPTION_STRING = "POSSIBLE_FILE_CORRUPTION"; const char *FILE_TOO_LARGE_STRING = "FILE_TOO_LARGE"; const char *BUSY_DUMPING_EVENT_STRING = "BUSY_DUMPING_EVENT"; -const char *DUMP_WAS_CANCELLED_STRING = "DUMP_WAS_CANCELLED"; const char *DUMP_OK_STORE_DONE_STRING = "DUMP_OK_STORE_DONE"; const char *DUMP_NOK_STORE_DONE_STRING = "DUMP_NOK_STORE_DONE"; const char *DUMP_MISC_STORE_DONE_STRING = "DUMP_MISC_STORE_DONE"; const char *DUMP_HK_STORE_DONE_STRING = "DUMP_HK_STORE_DONE"; const char *DUMP_CFDP_STORE_DONE_STRING = "DUMP_CFDP_STORE_DONE"; +const char *DUMP_OK_CANCELLED_STRING = "DUMP_OK_CANCELLED"; +const char *DUMP_NOK_CANCELLED_STRING = "DUMP_NOK_CANCELLED"; +const char *DUMP_MISC_CANCELLED_STRING = "DUMP_MISC_CANCELLED"; +const char *DUMP_HK_CANCELLED_STRING = "DUMP_HK_CANCELLED"; +const char *DUMP_CFDP_CANCELLED_STRING = "DUMP_CFDP_CANCELLED"; const char *translateEvents(Event event) { switch ((event & 0xFFFF)) { @@ -834,8 +837,6 @@ const char *translateEvents(Event event) { return FILE_TOO_LARGE_STRING; case (14302): return BUSY_DUMPING_EVENT_STRING; - case (14303): - return DUMP_WAS_CANCELLED_STRING; case (14305): return DUMP_OK_STORE_DONE_STRING; case (14306): @@ -846,6 +847,16 @@ const char *translateEvents(Event event) { return DUMP_HK_STORE_DONE_STRING; case (14309): return DUMP_CFDP_STORE_DONE_STRING; + case (14310): + return DUMP_OK_CANCELLED_STRING; + case (14311): + return DUMP_NOK_CANCELLED_STRING; + case (14312): + return DUMP_MISC_CANCELLED_STRING; + case (14313): + return DUMP_HK_CANCELLED_STRING; + case (14314): + return DUMP_CFDP_CANCELLED_STRING; default: return "UNKNOWN_EVENT"; } diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index 8d3455e3..682e515a 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 173 translations. - * Generated on: 2023-03-26 16:40:57 + * Generated on: 2023-03-28 21:50:28 */ #include "translateObjects.h" diff --git a/tmtc b/tmtc index f2897fa6..e0a31cb9 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit f2897fa6060e178ef8d11c9d29faa058896c9253 +Subproject commit e0a31cb992bbf0884d4b2b10ffcdca30b0ec9351 -- 2.43.0 From 4c57e4839947a92f8a795ab3be46466c7922c515 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 28 Mar 2023 21:58:04 +0200 Subject: [PATCH 23/27] cleaning up --- mission/tmtc/PersistentLogTmStoreTask.cpp | 7 +------ mission/tmtc/PersistentSingleTmStoreTask.cpp | 16 ---------------- 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/mission/tmtc/PersistentLogTmStoreTask.cpp b/mission/tmtc/PersistentLogTmStoreTask.cpp index c13b88f6..dcd78b54 100644 --- a/mission/tmtc/PersistentLogTmStoreTask.cpp +++ b/mission/tmtc/PersistentLogTmStoreTask.cpp @@ -15,7 +15,6 @@ PersistentLogTmStoreTask::PersistentLogTmStoreTask(object_id_t objectId, Storage ReturnValue_t PersistentLogTmStoreTask::performOperation(uint8_t opCode) { bool someonesBusy = false; bool vcBusyDuringDump = false; - bool byteFlowControl = false; auto stateHandlingForStore = [&](bool storeIsBusy, DumpContext& ctx) { if (storeIsBusy) { someonesBusy = true; @@ -26,10 +25,6 @@ ReturnValue_t PersistentLogTmStoreTask::performOperation(uint8_t opCode) { if (ctx.vcBusyDuringDump) { vcBusyDuringDump = true; } - if (ctx.dumpedBytes - ctx.bytesDumpedAtLastDelay >= 2048) { - byteFlowControl = true; - ctx.bytesDumpedAtLastDelay = ctx.dumpedBytes; - } }; while (true) { if (not cyclicStoreCheck()) { @@ -45,7 +40,7 @@ ReturnValue_t PersistentLogTmStoreTask::performOperation(uint8_t opCode) { TaskFactory::delayTask(100); } else if (vcBusyDuringDump) { // TODO: Might not be necessary - TaskFactory::delayTask(20); + TaskFactory::delayTask(10); } } } diff --git a/mission/tmtc/PersistentSingleTmStoreTask.cpp b/mission/tmtc/PersistentSingleTmStoreTask.cpp index 33492d43..a2d57208 100644 --- a/mission/tmtc/PersistentSingleTmStoreTask.cpp +++ b/mission/tmtc/PersistentSingleTmStoreTask.cpp @@ -11,11 +11,6 @@ PersistentSingleTmStoreTask::PersistentSingleTmStoreTask( dumpContext(eventIfDumpDone, eventIfCancelled) {} ReturnValue_t PersistentSingleTmStoreTask::performOperation(uint8_t opCode) { - ReturnValue_t result = returnvalue::OK; - uint32_t delaysVcBusyDuringDump = 0; - uint32_t delaysFlowControl = 0; - uint32_t delayNotBusy = 0; - uint32_t delayHotLoop = 0; while (true) { // Delay done by the check if (not cyclicStoreCheck()) { @@ -24,21 +19,10 @@ ReturnValue_t PersistentSingleTmStoreTask::performOperation(uint8_t opCode) { bool busy = handleOneStore(storeWithQueue, dumpContext); if (not busy) { TaskFactory::delayTask(100); - delayNotBusy++; } else if (dumpContext.vcBusyDuringDump) { // TODO: Might not be necessary - delaysVcBusyDuringDump++; TaskFactory::delayTask(10); - } else { - delayHotLoop++; } - // if ((delaysVcBusyDuringDump + delaysFlowControl + delayNotBusy + delayHotLoop) % 2000 == - // 0) { - // sif::debug << "DLY NBUSY: " << delayNotBusy << std::endl; - // sif::debug << "DLY FLCTRL: " << delaysFlowControl << std::endl; - // sif::debug << "DLY BUSYDUMP: " << delaysVcBusyDuringDump << std::endl; - // sif::debug << "DLY HOTLOOP: " << delayHotLoop << std::endl; - // } } } -- 2.43.0 From eafc47f7a17b39accf71f278db63ce307aec33ac Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 28 Mar 2023 21:59:38 +0200 Subject: [PATCH 24/27] some more cleaning up --- mission/tmtc/TmStoreTaskBase.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mission/tmtc/TmStoreTaskBase.h b/mission/tmtc/TmStoreTaskBase.h index 54dcc6a4..5fef74ff 100644 --- a/mission/tmtc/TmStoreTaskBase.h +++ b/mission/tmtc/TmStoreTaskBase.h @@ -41,8 +41,7 @@ class TmStoreTaskBase : public SystemObject { // 20 minutes are allowed as maximum dump time. Countdown cancelDumpCd = Countdown(60 * 20 * 1000); // If the TM sink is busy for 1 minute for whatever reason, cancel the dump. - // TODO: Reset this to default value. - Countdown tmSinkBusyCd = Countdown(60 * 20 * 1000); // Countdown(60 * 1000 ); + Countdown tmSinkBusyCd = Countdown(60 * 1000); VirtualChannel& channel; bool storesInitialized = false; bool fileHasSwapped = false; -- 2.43.0 From 9cfee1277461323a95e1b72f0d8218fd386b0bd5 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 28 Mar 2023 22:04:40 +0200 Subject: [PATCH 25/27] docs + TODO --- linux/ipcore/PapbVcInterface.cpp | 3 +++ mission/tmtc/TmStoreTaskBase.h | 1 + 2 files changed, 4 insertions(+) diff --git a/linux/ipcore/PapbVcInterface.cpp b/linux/ipcore/PapbVcInterface.cpp index c130d31e..eacfce33 100644 --- a/linux/ipcore/PapbVcInterface.cpp +++ b/linux/ipcore/PapbVcInterface.cpp @@ -36,6 +36,9 @@ ReturnValue_t PapbVcInterface::write(const uint8_t* data, size_t size) { for (size_t idx = 0; idx < size; idx++) { // This delay is super-important, DO NOT REMOVE! // Polling the GPIO too often can mess up the scheduler. + // TODO: Maybe this should not be done like this. It would be better if there was a custom + // FPGA module which can accept packets and then takes care of dumping that packet into + // the PTME. DMA would be an ideal solution for this. nanosleep(&BETWEEN_POLL_DELAY, &remDelay); if (pollPapbBusySignal(2) == returnvalue::OK) { *(vcBaseReg + DATA_REG_OFFSET) = static_cast(data[idx]); diff --git a/mission/tmtc/TmStoreTaskBase.h b/mission/tmtc/TmStoreTaskBase.h index 5fef74ff..7ef34c9a 100644 --- a/mission/tmtc/TmStoreTaskBase.h +++ b/mission/tmtc/TmStoreTaskBase.h @@ -36,6 +36,7 @@ class TmStoreTaskBase : public SystemObject { SdCardMountedIF& sdcMan); protected: + StorageManagerIF& ipcStore; Countdown sdCardCheckCd = Countdown(800); // 20 minutes are allowed as maximum dump time. -- 2.43.0 From f29163e8a9879c4b56a1a3544db2ed3175fc9fdd Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 28 Mar 2023 22:08:08 +0200 Subject: [PATCH 26/27] changelog note --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab321fec..13b0af36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,7 +22,9 @@ will consitute of a breaking change warranting a new major release: - ACS board devices: Go to ON mode instead of going to NORMAL mode directly. - SUS device handlers: Go to ON mode on startup instead of NORMAL mode. - Tweaks for the delay handling for the persistent TM stores. This allows pushing the full - high datarate when dumping telemetry. + high datarate when dumping telemetry. The most important and interesting fix is that + there needs to be a small delay between the polling of the GPIO. Polling the GPIO + without any delay consecutively can lead to scheduling issues. ## Changed -- 2.43.0 From 9c743eb0d9c0372070b4c16e390d24c014607907 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 28 Mar 2023 22:17:54 +0200 Subject: [PATCH 27/27] bump fsfw and changelog --- CHANGELOG.md | 2 ++ fsfw | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 13b0af36..0b68b945 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,8 @@ will consitute of a breaking change warranting a new major release: high datarate when dumping telemetry. The most important and interesting fix is that there needs to be a small delay between the polling of the GPIO. Polling the GPIO without any delay consecutively can lead to scheduling issues. +- Bump FSFW for fix of `ControllerBase` class `startTransition` implementation. +- Bump FSFW for possible fix of `PowerSwitcherComponent`: Initial mode `MODE_UNDEFINED`. ## Changed diff --git a/fsfw b/fsfw index 314f0fa2..4f632e2c 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 314f0fa2cde749ee1021d311e222bb0044cc2e5b +Subproject commit 4f632e2c6866cee88dd9920a965aa0d079799aa3 -- 2.43.0