almost at the goal
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit

This commit is contained in:
Robin Müller 2024-04-17 12:12:01 +02:00
parent 9b9d8bd32f
commit 91fdd7e7ac
Signed by: muellerr
GPG Key ID: A649FB78196E3849
4 changed files with 22 additions and 20 deletions

2
fsfw

@ -1 +1 @@
Subproject commit 3b0ee7ca3121a8d9e3e4d10a0c301ef5d1755102 Subproject commit 0660457c92b4bc5a533e0821752b21c485e75fc7

View File

@ -1,12 +1,10 @@
target_sources( target_sources(
${OBSW_NAME} ${OBSW_NAME}
PUBLIC PlocMemoryDumper.cpp PUBLIC PlocMemoryDumper.cpp
PlocMpsocHandler.cpp
MpsocCommunication.cpp MpsocCommunication.cpp
SerialCommunicationHelper.cpp SerialCommunicationHelper.cpp
FreshMpsocHandler.cpp FreshMpsocHandler.cpp
FreshSupvHandler.cpp FreshSupvHandler.cpp
PlocMpsocSpecialComHelperLegacy.cpp
PlocMpsocSpecialComHelper.cpp PlocMpsocSpecialComHelper.cpp
plocMpsocHelpers.cpp plocMpsocHelpers.cpp
PlocSupvUartMan.cpp PlocSupvUartMan.cpp

View File

@ -4,6 +4,7 @@
#include "eive/objects.h" #include "eive/objects.h"
#include "fsfw/action/CommandActionHelper.h" #include "fsfw/action/CommandActionHelper.h"
#include "fsfw/datapool/PoolReadGuard.h" #include "fsfw/datapool/PoolReadGuard.h"
#include "fsfw/devicehandlers/DeviceHandlerIF.h"
#include "fsfw/devicehandlers/FreshDeviceHandlerBase.h" #include "fsfw/devicehandlers/FreshDeviceHandlerBase.h"
#include "fsfw/ipc/MessageQueueIF.h" #include "fsfw/ipc/MessageQueueIF.h"
#include "fsfw/ipc/QueueFactory.h" #include "fsfw/ipc/QueueFactory.h"
@ -43,9 +44,11 @@ void FreshMpsocHandler::performDeviceOperation(uint8_t opCode) {
// Handle all received packets. // Handle all received packets.
while (true) { while (true) {
ReturnValue_t result = comInterface.parseAndRetrieveNextPacket(); ReturnValue_t result = comInterface.parseAndRetrieveNextPacket();
if (result == returnvalue::OK) { if (result == MpsocCommunication::PACKET_RECEIVED) {
break; handleDeviceReply();
continue;
} }
break;
} }
} }
} }
@ -229,6 +232,11 @@ ReturnValue_t FreshMpsocHandler::executeAction(ActionId_t actionId, MessageQueue
return mpsoc::MPSOC_HELPER_EXECUTING; return mpsoc::MPSOC_HELPER_EXECUTING;
} }
// We do not accept the rest of the commands if we are not on.
if (mode != MODE_ON && mode != MODE_NORMAL) {
return HasModesIF::INVALID_MODE;
}
switch (actionId) { switch (actionId) {
case mpsoc::TC_FLASH_WRITE_FULL_FILE: { case mpsoc::TC_FLASH_WRITE_FULL_FILE: {
mpsoc::FlashBasePusCmd flashWritePusCmd; mpsoc::FlashBasePusCmd flashWritePusCmd;
@ -707,18 +715,14 @@ ReturnValue_t FreshMpsocHandler::handleDeviceReply() {
// SpacePacketReader spacePacket; // SpacePacketReader spacePacket;
// spacePacket.setReadOnlyData(start, remainingSize); // spacePacket.setReadOnlyData(start, remainingSize);
auto& replyReader = comInterface.getSpReader(); auto& replyReader = comInterface.getSpReader();
if (replyReader.isNull()) {
return returnvalue::FAILED;
}
if (MPSOC_RX_WIRETAPPING) { if (MPSOC_RX_WIRETAPPING) {
sif::debug << "RECV MPSOC packet. APID 0x" << std::hex << std::setw(3) << replyReader.getApid() sif::debug << "RECV MPSOC packet. APID 0x" << std::hex << std::setw(3) << replyReader.getApid()
<< std::dec << " Size " << replyReader.getFullPacketLen() << " SSC " << std::dec << " Size " << replyReader.getFullPacketLen() << " SSC "
<< replyReader.getSequenceCount() << std::endl; << replyReader.getSequenceCount() << std::endl;
} }
if (replyReader.isNull()) {
return returnvalue::FAILED;
}
auto res = replyReader.checkSize();
if (res != returnvalue::OK) {
return res;
}
uint16_t apid = replyReader.getApid(); uint16_t apid = replyReader.getApid();
switch (apid) { switch (apid) {
@ -728,22 +732,24 @@ ReturnValue_t FreshMpsocHandler::handleDeviceReply() {
case (mpsoc::apid::ACK_FAILURE): case (mpsoc::apid::ACK_FAILURE):
break; break;
case (mpsoc::apid::TM_MEMORY_READ_REPORT): case (mpsoc::apid::TM_MEMORY_READ_REPORT):
result = reportReplyData(); result = reportReplyData(mpsoc::TM_MEMORY_READ_REPORT);
break; break;
case (mpsoc::apid::TM_CAM_CMD_RPT): case (mpsoc::apid::TM_CAM_CMD_RPT):
result = reportReplyData(); result = reportReplyData(mpsoc::TM_CAM_CMD_RPT);
break; break;
case (mpsoc::apid::TM_HK_GET_REPORT): { case (mpsoc::apid::TM_HK_GET_REPORT): {
result = handleGetHkReport(); result = handleGetHkReport();
break; break;
} }
case (mpsoc::apid::TM_FLASH_DIRECTORY_CONTENT): { case (mpsoc::apid::TM_FLASH_DIRECTORY_CONTENT): {
result = reportReplyData(); result = reportReplyData(mpsoc::TM_FLASH_DIRECTORY_CONTENT);
break; break;
} }
case (mpsoc::apid::EXE_SUCCESS): case (mpsoc::apid::EXE_SUCCESS):
case (mpsoc::apid::EXE_FAILURE): {
result = handleExecutionReport(); result = handleExecutionReport();
break; break;
}
default: { default: {
sif::debug << "FreshMpsocHandler:: Reply has invalid APID 0x" << std::hex << std::setfill('0') sif::debug << "FreshMpsocHandler:: Reply has invalid APID 0x" << std::hex << std::setfill('0')
<< std::setw(2) << apid << std::dec << std::endl; << std::setw(2) << apid << std::dec << std::endl;
@ -779,7 +785,6 @@ ReturnValue_t FreshMpsocHandler::handleExecutionReport() {
uint16_t status = mpsoc::getStatusFromRawData(replyReader.getFullData()); uint16_t status = mpsoc::getStatusFromRawData(replyReader.getFullData());
sif::warning << "MPSoC EXE Failure: " << mpsoc::getStatusString(status) << std::endl; sif::warning << "MPSoC EXE Failure: " << mpsoc::getStatusString(status) << std::endl;
triggerEvent(mpsoc::EXE_FAILURE, commandId, status); triggerEvent(mpsoc::EXE_FAILURE, commandId, status);
sendFailureReport(mpsoc::EXE_REPORT, mpsoc::RECEIVED_EXE_FAILURE);
cmdDoneHandler(false, mpsoc::RECEIVED_EXE_FAILURE); cmdDoneHandler(false, mpsoc::RECEIVED_EXE_FAILURE);
break; break;
} }
@ -835,12 +840,11 @@ ReturnValue_t FreshMpsocHandler::getParameter(uint8_t domainId, uint8_t uniqueId
startAtIndex); startAtIndex);
} }
ReturnValue_t FreshMpsocHandler::reportReplyData() { ReturnValue_t FreshMpsocHandler::reportReplyData(DeviceCommandId_t tmId) {
auto& replyReader = comInterface.getSpReader(); auto& replyReader = comInterface.getSpReader();
if (activeCmdInfo.commandedBy != MessageQueueIF::NO_QUEUE) { if (activeCmdInfo.commandedBy != MessageQueueIF::NO_QUEUE) {
return actionHelper.reportData( return actionHelper.reportData(
activeCmdInfo.commandedBy, activeCmdInfo.pendingCmd, activeCmdInfo.commandedBy, tmId, replyReader.getFullData() + mpsoc::DATA_FIELD_OFFSET,
replyReader.getFullData() + mpsoc::DATA_FIELD_OFFSET,
replyReader.getFullPacketLen() - mpsoc::DATA_FIELD_OFFSET - mpsoc::CRC_SIZE); replyReader.getFullPacketLen() - mpsoc::DATA_FIELD_OFFSET - mpsoc::CRC_SIZE);
} }
return returnvalue::OK; return returnvalue::OK;

View File

@ -193,7 +193,7 @@ class FreshMpsocHandler : public FreshDeviceHandlerBase, public CommandsActionsI
ReturnValue_t handleAckReport(); ReturnValue_t handleAckReport();
ReturnValue_t handleExecutionReport(); ReturnValue_t handleExecutionReport();
void sendFailureReport(DeviceCommandId_t replyId, ReturnValue_t status); void sendFailureReport(DeviceCommandId_t replyId, ReturnValue_t status);
ReturnValue_t reportReplyData(); ReturnValue_t reportReplyData(DeviceCommandId_t tmId);
ReturnValue_t handleGetHkReport(); ReturnValue_t handleGetHkReport();
bool handleHwStartup(); bool handleHwStartup();
bool handleHwShutdown(); bool handleHwShutdown();