From b8e73637448f125aafdbde93ee57f90ce95e4c7e Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 16 Oct 2023 14:36:30 +0200 Subject: [PATCH 1/5] mpsoc debug opt --- linux/payload/PlocMpsocHandler.cpp | 25 ++++++++++++++++++++----- linux/payload/PlocMpsocHandler.h | 2 ++ 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/linux/payload/PlocMpsocHandler.cpp b/linux/payload/PlocMpsocHandler.cpp index 66fba6d8..94fe4588 100644 --- a/linux/payload/PlocMpsocHandler.cpp +++ b/linux/payload/PlocMpsocHandler.cpp @@ -348,10 +348,17 @@ void PlocMpsocHandler::fillCommandAndReplyMap() { ReturnValue_t PlocMpsocHandler::scanForReply(const uint8_t* start, size_t remainingSize, DeviceCommandId_t* foundId, size_t* foundLen) { + // sif::debug << "received reply with length" << remainingSize << std::endl; + // arrayprinter::print(start, remainingSize); ReturnValue_t result = returnvalue::OK; SpacePacketReader spacePacket; spacePacket.setReadOnlyData(start, remainingSize); + if (DEBUG_MPSOC_COMMUNICATION) { + sif::debug << "RECV MPSOC packet. APID 0x" << std::hex << std::setw(3) << spacePacket.getApid() + << std::dec << " Size " << spacePacket.getFullPacketLen() << " SSC " + << spacePacket.getSequenceCount() << std::endl; + } if (spacePacket.isNull()) { return returnvalue::FAILED; } @@ -467,7 +474,7 @@ void PlocMpsocHandler::setNormalDatapoolEntriesInvalid() { hkReport.setValidity(false, true); } -uint32_t PlocMpsocHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 10000; } +uint32_t PlocMpsocHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 15000; } ReturnValue_t PlocMpsocHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap, LocalDataPoolManager& poolManager) { @@ -700,6 +707,12 @@ ReturnValue_t PlocMpsocHandler::finishTcPrep(mpsoc::TcBase& tcBase) { rawPacket = commandBuffer; rawPacketLen = tcBase.getFullPacketLen(); sequenceCount++; + + if (DEBUG_MPSOC_COMMUNICATION) { + sif::debug << "SEND MPSOC packet. APID 0x" << std::hex << std::setw(3) << tcBase.getApid() + << " Size " << std::dec << tcBase.getFullPacketLen() << " SSC " + << tcBase.getSeqCount() << std::endl; + } return returnvalue::OK; } @@ -1223,10 +1236,12 @@ void PlocMpsocHandler::dataReceived(ActionId_t actionId, const uint8_t* data, ui void PlocMpsocHandler::completionSuccessfulReceived(ActionId_t actionId) { if (actionId == supv::ACK_REPORT) { - sif::warning - << "PlocMpsocHandler::completionSuccessfulReceived: Only received ACK report. Consider " - "increasing the MPSoC boot timer." - << std::endl; + // I seriously don't know why this happens.. + // sif::warning + // << "PlocMpsocHandler::completionSuccessfulReceived: Only received ACK report. Consider + // " + // "increasing the MPSoC boot timer." + // << std::endl; } else if (actionId != supv::EXE_REPORT) { sif::warning << "PlocMpsocHandler::completionSuccessfulReceived: Did not expect the action " << "ID " << actionId << std::endl; diff --git a/linux/payload/PlocMpsocHandler.h b/linux/payload/PlocMpsocHandler.h index 0203b942..6cce4951 100644 --- a/linux/payload/PlocMpsocHandler.h +++ b/linux/payload/PlocMpsocHandler.h @@ -17,6 +17,8 @@ #include "fsfw_hal/linux/gpio/Gpio.h" #include "fsfw_hal/linux/serial/SerialComIF.h" +static constexpr bool DEBUG_MPSOC_COMMUNICATION = true; + /** * @brief This is the device handler for the MPSoC of the payload computer. * From 0ada9562858e76baac560562d5ce5021ee0aa9b2 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 16 Oct 2023 14:46:02 +0200 Subject: [PATCH 2/5] some more debugging --- linux/payload/PlocMpsocHandler.cpp | 4 +++- linux/payload/PlocMpsocHandler.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/linux/payload/PlocMpsocHandler.cpp b/linux/payload/PlocMpsocHandler.cpp index 94fe4588..eedfb95e 100644 --- a/linux/payload/PlocMpsocHandler.cpp +++ b/linux/payload/PlocMpsocHandler.cpp @@ -91,6 +91,8 @@ ReturnValue_t PlocMpsocHandler::initialize() { void PlocMpsocHandler::performOperationHook() { if (commandIsPending and cmdCountdown.hasTimedOut()) { + sif::warning << "PlocMpsocHandler: Command " << getPendingCommand() << " has timed out" + << std::endl; commandIsPending = false; // TODO: Better returnvalue? cmdDoneHandler(false, returnvalue::FAILED); @@ -215,7 +217,6 @@ ReturnValue_t PlocMpsocHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) if (not commandIsPending and not specialComHelperExecuting) { *id = mpsoc::TC_GET_HK_REPORT; commandIsPending = true; - cmdCountdown.resetTimer(); return buildCommandFromCommand(*id, nullptr, 0); } return NOTHING_TO_SEND; @@ -713,6 +714,7 @@ ReturnValue_t PlocMpsocHandler::finishTcPrep(mpsoc::TcBase& tcBase) { << " Size " << std::dec << tcBase.getFullPacketLen() << " SSC " << tcBase.getSeqCount() << std::endl; } + cmdCountdown.resetTimer(); return returnvalue::OK; } diff --git a/linux/payload/PlocMpsocHandler.h b/linux/payload/PlocMpsocHandler.h index 6cce4951..216001d6 100644 --- a/linux/payload/PlocMpsocHandler.h +++ b/linux/payload/PlocMpsocHandler.h @@ -186,7 +186,7 @@ class PlocMpsocHandler : public DeviceHandlerBase, public CommandsActionsIF { }; TmMemReadReport tmMemReadReport; - Countdown cmdCountdown = Countdown(10000); + Countdown cmdCountdown = Countdown(12000); struct TelemetryBuffer { uint16_t length = 0; From 31bf896a6ce3ef7075dd1516ff4bfab3c7370cfd Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 16 Oct 2023 15:06:02 +0200 Subject: [PATCH 3/5] disable debug mode --- linux/payload/PlocMpsocHandler.cpp | 2 +- linux/payload/PlocMpsocHandler.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/linux/payload/PlocMpsocHandler.cpp b/linux/payload/PlocMpsocHandler.cpp index eedfb95e..bca4280b 100644 --- a/linux/payload/PlocMpsocHandler.cpp +++ b/linux/payload/PlocMpsocHandler.cpp @@ -1507,7 +1507,7 @@ LocalPoolDataSetBase* PlocMpsocHandler::getDataSetHandle(sid_t sid) { bool PlocMpsocHandler::dontCheckQueue() { // The TC and TMs need to be handled strictly sequentially, so while a command is pending, - // more specifically while replies are still expected, do not check the queue.s + // more specifically while replies are still expected, do not check the queue. return commandIsPending; } diff --git a/linux/payload/PlocMpsocHandler.h b/linux/payload/PlocMpsocHandler.h index 216001d6..5d584943 100644 --- a/linux/payload/PlocMpsocHandler.h +++ b/linux/payload/PlocMpsocHandler.h @@ -17,7 +17,7 @@ #include "fsfw_hal/linux/gpio/Gpio.h" #include "fsfw_hal/linux/serial/SerialComIF.h" -static constexpr bool DEBUG_MPSOC_COMMUNICATION = true; +static constexpr bool DEBUG_MPSOC_COMMUNICATION = false; /** * @brief This is the device handler for the MPSoC of the payload computer. @@ -186,7 +186,7 @@ class PlocMpsocHandler : public DeviceHandlerBase, public CommandsActionsIF { }; TmMemReadReport tmMemReadReport; - Countdown cmdCountdown = Countdown(12000); + Countdown cmdCountdown = Countdown(10000); struct TelemetryBuffer { uint16_t length = 0; From 718277da283b48a38b0e040948506bb2e4554bb9 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 16 Oct 2023 15:18:32 +0200 Subject: [PATCH 4/5] remove dcommented code --- linux/payload/PlocMpsocHandler.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/linux/payload/PlocMpsocHandler.cpp b/linux/payload/PlocMpsocHandler.cpp index bca4280b..34053c70 100644 --- a/linux/payload/PlocMpsocHandler.cpp +++ b/linux/payload/PlocMpsocHandler.cpp @@ -349,8 +349,6 @@ void PlocMpsocHandler::fillCommandAndReplyMap() { ReturnValue_t PlocMpsocHandler::scanForReply(const uint8_t* start, size_t remainingSize, DeviceCommandId_t* foundId, size_t* foundLen) { - // sif::debug << "received reply with length" << remainingSize << std::endl; - // arrayprinter::print(start, remainingSize); ReturnValue_t result = returnvalue::OK; SpacePacketReader spacePacket; From c268977b3d75217effb825f01f39371499258ebc Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 16 Oct 2023 15:30:17 +0200 Subject: [PATCH 5/5] changelog --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d71df6e5..09055dd7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,8 +18,9 @@ will consitute of a breaking change warranting a new major release: ## Fixed -- PL Enable set of the power controller is now set to invalid properly - if the power controller is not in normal mode. +- PL Enable set of the power controller is now set to invalid properly if the power controller + is not in normal mode. +- MPSoC debug mode. # [v7.1.0] 2023-10-11