From b54f8e77380706476b2a6ae605518e8a841446ee Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 8 May 2024 10:03:32 +0200 Subject: [PATCH] some fixes for MPSoC --- linux/payload/FreshMpsocHandler.cpp | 9 +++++++-- linux/payload/PlocMpsocSpecialComHelper.cpp | 3 ++- tmtc | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/linux/payload/FreshMpsocHandler.cpp b/linux/payload/FreshMpsocHandler.cpp index e0bf75e4..299c1540 100644 --- a/linux/payload/FreshMpsocHandler.cpp +++ b/linux/payload/FreshMpsocHandler.cpp @@ -86,7 +86,7 @@ void FreshMpsocHandler::performDefaultDeviceOperation() { // We checked the action queue beforehand, so action commands should always be performed // before normal commands. - if (mode == MODE_NORMAL and not activeCmdInfo.pending) { + if (mode == MODE_NORMAL and not activeCmdInfo.pending and not specialComHelperExecuting) { ReturnValue_t result = commandTcGetHkReport(); if (result == returnvalue::OK) { commandInitHandling(mpsoc::TC_GET_HK_REPORT, MessageQueueIF::NO_QUEUE); @@ -763,7 +763,7 @@ ReturnValue_t FreshMpsocHandler::commandTcSimplexStreamFile(const uint8_t* comma } ReturnValue_t FreshMpsocHandler::commandTcSplitFile(const uint8_t* commandData, - size_t commandDataLen) { + size_t commandDataLen) { mpsoc::TcSplitFile tcSplitFile(spParams, commandSequenceCount); ReturnValue_t result = tcSplitFile.setPayload(commandData, commandDataLen); if (result != returnvalue::OK) { @@ -803,6 +803,11 @@ ReturnValue_t FreshMpsocHandler::commandTcModeSnapshot() { ReturnValue_t FreshMpsocHandler::finishAndSendTc(DeviceCommandId_t cmdId, mpsoc::TcBase& tcBase, uint32_t cmdCountdownMs) { + // Emit warning but still send command. + if (specialComHelperExecuting) { + sif::warning << "PLOC MPSoC: Sending command even though special COM helper is executing" + << std::endl; + } ReturnValue_t result = tcBase.finishPacket(); if (result != returnvalue::OK) { return result; diff --git a/linux/payload/PlocMpsocSpecialComHelper.cpp b/linux/payload/PlocMpsocSpecialComHelper.cpp index c3a70cd6..a81f8fd6 100644 --- a/linux/payload/PlocMpsocSpecialComHelper.cpp +++ b/linux/payload/PlocMpsocSpecialComHelper.cpp @@ -179,7 +179,8 @@ ReturnValue_t PlocMpsocSpecialComHelper::performFlashWrite() { ReturnValue_t PlocMpsocSpecialComHelper::performFlashRead() { std::error_code e; - std::ofstream ofile(flashReadAndWrite.obcFile, std::ios::trunc | std::ios::binary); + std::ofstream ofile(flashReadAndWrite.obcFile, + std::ios::trunc | std::ios::binary | std::ios::app); if (ofile.bad()) { return returnvalue::FAILED; } diff --git a/tmtc b/tmtc index 9a06c64d..5cf76c07 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 9a06c64dfac3f4283c2d5af72a9c095f4726480b +Subproject commit 5cf76c07e98494e7e2532c25dbff7753cb675cf5