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(
${OBSW_NAME}
PUBLIC PlocMemoryDumper.cpp
PlocMpsocHandler.cpp
MpsocCommunication.cpp
SerialCommunicationHelper.cpp
FreshMpsocHandler.cpp
FreshSupvHandler.cpp
PlocMpsocSpecialComHelperLegacy.cpp
PlocMpsocSpecialComHelper.cpp
plocMpsocHelpers.cpp
PlocSupvUartMan.cpp

View File

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

View File

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