fix conflict
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit

This commit is contained in:
Jakob Meier 2022-04-30 09:28:22 +02:00
commit 6f53c39485
5 changed files with 126 additions and 31 deletions

View File

@ -29,6 +29,9 @@ static const DeviceCommandId_t TC_MODE_REPLAY = 16;
static const DeviceCommandId_t TC_CAM_CMD_SEND = 17; static const DeviceCommandId_t TC_CAM_CMD_SEND = 17;
static const DeviceCommandId_t TC_MODE_IDLE = 18; static const DeviceCommandId_t TC_MODE_IDLE = 18;
static const DeviceCommandId_t TM_CAM_CMD_RPT = 19; static const DeviceCommandId_t TM_CAM_CMD_RPT = 19;
static const DeviceCommandId_t SET_UART_TX_TRISTATE = 20;
static const DeviceCommandId_t RELEASE_UART_TX = 21;
// Will reset the sequence count of the OBSW // Will reset the sequence count of the OBSW
static const DeviceCommandId_t OBSW_RESET_SEQ_COUNT = 50; static const DeviceCommandId_t OBSW_RESET_SEQ_COUNT = 50;

View File

@ -1304,8 +1304,8 @@ class VerificationReport : public TmPacket {
uint16_t refApid = 0; uint16_t refApid = 0;
size_t size = 0; size_t size = 0;
uint8_t* refApidPtr = this->getPacketData(); uint8_t* refApidPtr = this->getPacketData();
ReturnValue_t result = SerializeAdapter::deSerialize(&refApid, refApidPtr, &size, ReturnValue_t result =
SerializeIF::Endianness::BIG); SerializeAdapter::deSerialize(&refApid, refApidPtr, &size, SerializeIF::Endianness::BIG);
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
sif::debug << "ExecutionReport: Failed to deserialize reference APID field" << std::endl; sif::debug << "ExecutionReport: Failed to deserialize reference APID field" << std::endl;
return result; return result;
@ -1378,8 +1378,8 @@ class AcknowledgmentReport : public VerificationReport {
break; break;
} }
case StatusCode::DEFAULT_NAK: { case StatusCode::DEFAULT_NAK: {
sif::warning << "Supervisor acknowledgment report status: Default code for nak" << sif::warning << "Supervisor acknowledgment report status: Default code for nak"
std::endl; << std::endl;
break; break;
} }
case StatusCode::ROUTE_PACKET: { case StatusCode::ROUTE_PACKET: {
@ -1456,20 +1456,21 @@ class ExecutionReport : public VerificationReport {
MPSOC_BOOT_FAILED = 0x106, MPSOC_BOOT_FAILED = 0x106,
SP_NOT_AVAILABLE = 0x200, SP_NOT_AVAILABLE = 0x200,
SP_DATA_INSUFFICIENT = 0x201, SP_DATA_INSUFFICIENT = 0x201,
MPSOC_NOT_IN_RESET = 0x202, SP_MEMORY_ID_INVALID = 0x202,
FLASH_INIT_FAILED = 0x203, MPSOC_NOT_IN_RESET = 0x203,
FLASH_ERASE_FAILED = 0x204, FLASH_INIT_FAILED = 0x204,
FLASH_WRITE_FAILED = 0x205, FLASH_ERASE_FAILED = 0x205,
FLASH_VERIFY_FAILED = 0x206, FLASH_WRITE_FAILED = 0x206,
CANNOT_ACCESS_TM = 0x207, FLASH_VERIFY_FAILED = 0x207,
CANNOT_SEND_TM = 0x208, CANNOT_ACCESS_TM = 0x208,
CANNOT_SEND_TM = 0x209,
PG_LOW = 0x300, PG_LOW = 0x300,
PG_5V_LOW = 0x301, PG_5V_LOW = 0x301,
PG_0V85_LOW = 0x302, PG_0V85_LOW = 0x302,
PG_1V8_LOW = 0x303, PG_1V8_LOW = 0x303,
PG_MISC_LOW = 0x304, PG_MISC_LOW = 0x304,
PG_3V3_LOW = 0x305, PG_3V3_LOW = 0x305,
PG__MB_VAIO_LOW = 0x306, PG_MB_VAIO_LOW = 0x306,
PG_MB_MPSOCIO_LOW = 0x307 PG_MB_MPSOCIO_LOW = 0x307
}; };
@ -1581,18 +1582,87 @@ class ExecutionReport : public VerificationReport {
break; break;
} }
case StatusCode::OUT_OF_HEAP_MEMORY: { case StatusCode::OUT_OF_HEAP_MEMORY: {
sif::warning sif::warning << "Supervisor execution report status: Out of heap memory" << std::endl;
<< "Supervisor execution report status: Out of heap memory" << std::endl;
break; break;
} }
case StatusCode::INVALID_STATE_TRANSITION: { case StatusCode::INVALID_STATE_TRANSITION: {
sif::warning sif::warning << "Supervisor execution report status: Invalid state transition" << std::endl;
<< "Supervisor execution report status: Invalid state transition" << std::endl;
break; break;
} }
case StatusCode::MPSOC_BOOT_FAILED: { case StatusCode::MPSOC_BOOT_FAILED: {
sif::warning sif::warning << "Supervisor execution report status: MPSoC boot failed" << std::endl;
<< "Supervisor execution report status: MPSoC boot failed" << std::endl; break;
}
case StatusCode::SP_NOT_AVAILABLE: {
sif::warning << "Supervisor execution report status: SP not available" << std::endl;
break;
}
case StatusCode::SP_DATA_INSUFFICIENT: {
sif::warning << "Supervisor execution report status: SP data insufficient" << std::endl;
break;
}
case StatusCode::SP_MEMORY_ID_INVALID: {
sif::warning << "Supervisor execution report status: SP data insufficient" << std::endl;
break;
}
case StatusCode::MPSOC_NOT_IN_RESET: {
sif::warning << "Supervisor execution report status: MPSoC not in reset" << std::endl;
break;
}
case StatusCode::FLASH_INIT_FAILED: {
sif::warning << "Supervisor execution report status: Flash init failed" << std::endl;
break;
}
case StatusCode::FLASH_ERASE_FAILED: {
sif::warning << "Supervisor execution report status: Flash erase failed" << std::endl;
break;
}
case StatusCode::FLASH_WRITE_FAILED: {
sif::warning << "Supervisor execution report status: Flash write failed" << std::endl;
break;
}
case StatusCode::FLASH_VERIFY_FAILED: {
sif::warning << "Supervisor execution report status: Flash verify failed" << std::endl;
break;
}
case StatusCode::CANNOT_ACCESS_TM: {
sif::warning << "Supervisor execution report status: Can not access tm" << std::endl;
break;
}
case StatusCode::CANNOT_SEND_TM: {
sif::warning << "Supervisor execution report status: Can not access tm" << std::endl;
break;
}
case StatusCode::PG_LOW: {
sif::warning << "Supervisor execution report status: PG low" << std::endl;
break;
}
case StatusCode::PG_5V_LOW: {
sif::warning << "Supervisor execution report status: PG 5V low" << std::endl;
break;
}
case StatusCode::PG_0V85_LOW: {
sif::warning << "Supervisor execution report status: PG 0V85 low" << std::endl;
break;
}
case StatusCode::PG_1V8_LOW: {
sif::warning << "Supervisor execution report status: PG 1V8 low" << std::endl;
break;
}
case StatusCode::PG_MISC_LOW: {
sif::warning << "Supervisor execution report status: PG misc low" << std::endl;
break;
}
case StatusCode::PG_3V3_LOW: {
sif::warning << "Supervisor execution report status: PG 3V3 low" << std::endl;
break;
}
case StatusCode::PG_MB_VAIO_LOW: {
sif::warning << "Supervisor execution report status: PG mb vaio low" << std::endl;
break;
}
case StatusCode::PG_MB_MPSOCIO_LOW: {
sif::warning << "Supervisor execution report status: PG mb mpsocio low" << std::endl;
break; break;
} }
default: default:

View File

@ -99,6 +99,20 @@ void PlocMPSoCHandler::performOperationHook() {
ReturnValue_t PlocMPSoCHandler::executeAction(ActionId_t actionId, MessageQueueId_t commandedBy, ReturnValue_t PlocMPSoCHandler::executeAction(ActionId_t actionId, MessageQueueId_t commandedBy,
const uint8_t* data, size_t size) { const uint8_t* data, size_t size) {
ReturnValue_t result = RETURN_OK; ReturnValue_t result = RETURN_OK;
switch(actionId) {
case mpsoc::SET_UART_TX_TRISTATE: {
uartIsolatorSwitch.pullLow();
return EXECUTION_FINISHED;
break;
}
case mpsoc::RELEASE_UART_TX: {
uartIsolatorSwitch.pullHigh();
return EXECUTION_FINISHED;
break;
default:
break;
}
}
if (plocMPSoCHelperExecuting) { if (plocMPSoCHelperExecuting) {
return MPSoCReturnValuesIF::MPSOC_HELPER_EXECUTING; return MPSoCReturnValuesIF::MPSOC_HELPER_EXECUTING;
@ -267,6 +281,8 @@ void PlocMPSoCHandler::fillCommandAndReplyMap() {
this->insertInCommandMap(mpsoc::TC_MODE_REPLAY); this->insertInCommandMap(mpsoc::TC_MODE_REPLAY);
this->insertInCommandMap(mpsoc::TC_MODE_IDLE); this->insertInCommandMap(mpsoc::TC_MODE_IDLE);
this->insertInCommandMap(mpsoc::TC_CAM_CMD_SEND); this->insertInCommandMap(mpsoc::TC_CAM_CMD_SEND);
this->insertInCommandMap(mpsoc::RELEASE_UART_TX);
this->insertInCommandMap(mpsoc::SET_UART_TX_TRISTATE);
this->insertInReplyMap(mpsoc::ACK_REPORT, 3, nullptr, mpsoc::SIZE_ACK_REPORT); this->insertInReplyMap(mpsoc::ACK_REPORT, 3, nullptr, mpsoc::SIZE_ACK_REPORT);
this->insertInReplyMap(mpsoc::EXE_REPORT, 3, nullptr, mpsoc::SIZE_EXE_REPORT); this->insertInReplyMap(mpsoc::EXE_REPORT, 3, nullptr, mpsoc::SIZE_EXE_REPORT);
this->insertInReplyMap(mpsoc::TM_MEMORY_READ_REPORT, 2, nullptr, mpsoc::SIZE_TM_MEM_READ_REPORT); this->insertInReplyMap(mpsoc::TM_MEMORY_READ_REPORT, 2, nullptr, mpsoc::SIZE_TM_MEM_READ_REPORT);

View File

@ -827,10 +827,14 @@ ReturnValue_t PlocSupervisorHandler::verifyPacket(const uint8_t* start, size_t f
} }
ReturnValue_t PlocSupervisorHandler::handleAckReport(const uint8_t* data) { ReturnValue_t PlocSupervisorHandler::handleAckReport(const uint8_t* data) {
using namespace supv;
ReturnValue_t result = RETURN_OK; ReturnValue_t result = RETURN_OK;
result = verifyPacket(data, supv::SIZE_ACK_REPORT); AcknowledgmentReport ack;
if (result == SupvReturnValuesIF::CRC_FAILURE) { ack.addWholeData(data, SIZE_ACK_REPORT);
result = ack.checkCrc();
if (result != RETURN_OK) {
sif::error << "PlocSupervisorHandler::handleAckReport: CRC failure" << std::endl; sif::error << "PlocSupervisorHandler::handleAckReport: CRC failure" << std::endl;
nextReplyId = supv::NONE; nextReplyId = supv::NONE;
replyRawReplyIfnotWiretapped(data, supv::SIZE_ACK_REPORT); replyRawReplyIfnotWiretapped(data, supv::SIZE_ACK_REPORT);
@ -842,7 +846,9 @@ ReturnValue_t PlocSupervisorHandler::handleAckReport(const uint8_t* data) {
uint16_t apid = (*(data) << 8 | *(data + 1)) & APID_MASK; uint16_t apid = (*(data) << 8 | *(data + 1)) & APID_MASK;
switch (apid) { result = ack.checkApid();
switch (result) {
case supv::APID_ACK_FAILURE: { case supv::APID_ACK_FAILURE: {
// TODO: Interpretation of status field in acknowledgment report // TODO: Interpretation of status field in acknowledgment report
sif::debug << "PlocSupervisorHandler::handleAckReport: Received Ack failure report" sif::debug << "PlocSupervisorHandler::handleAckReport: Received Ack failure report"
@ -859,7 +865,6 @@ ReturnValue_t PlocSupervisorHandler::handleAckReport(const uint8_t* data) {
} }
case supv::APID_ACK_SUCCESS: { case supv::APID_ACK_SUCCESS: {
setNextReplyId(); setNextReplyId();
handleSpecialAcknowledgments(data);
break; break;
} }
default: { default: {
@ -887,6 +892,7 @@ ReturnValue_t PlocSupervisorHandler::handleExecutionReport(const uint8_t* data)
switch (apid) { switch (apid) {
case (supv::APID_EXE_SUCCESS): { case (supv::APID_EXE_SUCCESS): {
handleSpecialExecutionReport(data);
break; break;
} }
case (supv::APID_EXE_FAILURE): { case (supv::APID_EXE_FAILURE): {
@ -1813,17 +1819,17 @@ ReturnValue_t PlocSupervisorHandler::eventSubscription() {
return result; return result;
} }
void PlocSupervisorHandler::handleSpecialAcknowledgments(const uint8_t* data) { void PlocSupervisorHandler::handleSpecialExecutionReport(const uint8_t* data) {
DeviceCommandId_t commandId = getPendingCommand(); DeviceCommandId_t commandId = getPendingCommand();
switch(commandId) { switch(commandId) {
case supv::READ_GPIO: { case supv::READ_GPIO: {
supv::AcknowledgmentReport ack; supv::ExecutionReport exe;
ack.addWholeData(data, supv::SIZE_ACK_REPORT); exe.addWholeData(data, supv::SIZE_EXE_REPORT);
uint16_t gpioState = ack.getStatusCode(); uint16_t gpioState = exe.getStatusCode();
#if OBSW_DEBUG_PLOC_SUPERVISOR == 1 #if OBSW_DEBUG_PLOC_SUPERVISOR == 1
sif::info << "PlocsupervisorHandler: Read GPIO TM, State: " << gpioState << std::endl; sif::info << "PlocsupervisorHandler: Read GPIO TM, State: " << gpioState << std::endl;
#endif /* OBSW_DEBUG_PLOC_SUPERVISOR == 1 */ #endif /* OBSW_DEBUG_PLOC_SUPERVISOR == 1 */
handleDeviceTM(reinterpret_cast<uint8_t*>(&gpioState), sizeof(gpioState), supv::ACK_REPORT); handleDeviceTM(reinterpret_cast<uint8_t*>(&gpioState), sizeof(gpioState), supv::EXE_REPORT);
break; break;
} }
default: default:

View File

@ -351,9 +351,9 @@ class PlocSupervisorHandler : public DeviceHandlerBase {
ReturnValue_t eventSubscription(); ReturnValue_t eventSubscription();
/** /**
* @brief Handles acknowledgment reports which contains additional informations in the data field * @brief Handles execution reports which contains additional information in the data field
*/ */
void handleSpecialAcknowledgments(const uint8_t* data); void handleSpecialExecutionReport(const uint8_t* data);
}; };
#endif /* MISSION_DEVICES_PLOCSUPERVISORHANDLER_H_ */ #endif /* MISSION_DEVICES_PLOCSUPERVISORHANDLER_H_ */