diff --git a/fsfw b/fsfw index 6381d9a8..42867ad0 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 6381d9a83c439b1b092412dc4d59c1f515d236e7 +Subproject commit 42867ad0cba088ab1cb6cb672d001f991f7e4a60 diff --git a/linux/payload/MpsocCommunication.cpp b/linux/payload/MpsocCommunication.cpp index c3c0022b..edb88225 100644 --- a/linux/payload/MpsocCommunication.cpp +++ b/linux/payload/MpsocCommunication.cpp @@ -30,7 +30,7 @@ ReturnValue_t MpsocCommunication::parseAndRetrieveNextPacket() { return returnvalue::OK; } readRingBuf.readData(readBuf, availableReadData); - spReader.setReadOnlyData(readBuf, availableReadData); + spReader.setReadOnlyData(readBuf, sizeof(readBuf)); auto res = spReader.checkSize(); if (res != returnvalue::OK) { return res; diff --git a/linux/payload/PlocMpsocSpecialComHelper.cpp b/linux/payload/PlocMpsocSpecialComHelper.cpp index 220735ef..c3a70cd6 100644 --- a/linux/payload/PlocMpsocSpecialComHelper.cpp +++ b/linux/payload/PlocMpsocSpecialComHelper.cpp @@ -6,6 +6,7 @@ #include #include +#include "fsfw/serviceinterface/ServiceInterfacePrinter.h" #include "fsfw/serviceinterface/ServiceInterfaceStream.h" #include "fsfw/tmtcpacket/ccsds/SpacePacketReader.h" #include "linux/payload/MpsocCommunication.h" @@ -64,7 +65,8 @@ ReturnValue_t PlocMpsocSpecialComHelper::performOperation(uint8_t operationCode) if (result == returnvalue::OK) { triggerEvent(MPSOC_FLASH_READ_SUCCESSFUL, txSequenceCount.get()); } else { - triggerEvent(MPSOC_FLASH_READ_FAILED, txSequenceCount.get()); + sif::printWarning("PLOC MPSoC Helper: Flash read failed with code %04x\n", result); + triggerEvent(MPSOC_FLASH_READ_FAILED, txSequenceCount.get(), result); } internalState = InternalState::IDLE; break; @@ -393,14 +395,20 @@ ReturnValue_t PlocMpsocSpecialComHelper::handleTmReception() { return returnvalue::FAILED; } result = tryReceiveNextReply(); - if (result != MpsocCommunication::PACKET_RECEIVED and result != returnvalue::OK) { - return result; - } if (result == MpsocCommunication::PACKET_RECEIVED) { // Need to convert this, we are faking a synchronous API here. result = returnvalue::OK; break; } + if (result != returnvalue::OK) { + if (result == MpsocCommunication::FAULTY_PACKET_SIZE) { + sif::printWarning("PLOC MPSoC Helper: retrieving next reply failed: faulty packet size\n"); + } else if (result == MpsocCommunication::CRC_CHECK_FAILED) { + sif::printWarning("PLOC MPSoC Helper: retrieving next reply failed: CRC check failed\n"); + } + sif::printWarning("PLOC MPSoC Helper: retrieving next reply failed with code %d\n", result); + return result; + } usleep(usleepDelay); if (usleepDelay < 200000) { usleepDelay *= 4;