PLOC MPSoC read file, fix write file #633
@ -13,7 +13,7 @@ PlocMpsocHandler::PlocMpsocHandler(object_id_t objectId, object_id_t uartComIFid
|
|||||||
Gpio uartIsolatorSwitch, object_id_t supervisorHandler)
|
Gpio uartIsolatorSwitch, object_id_t supervisorHandler)
|
||||||
: DeviceHandlerBase(objectId, uartComIFid, comCookie),
|
: DeviceHandlerBase(objectId, uartComIFid, comCookie),
|
||||||
hkReport(this),
|
hkReport(this),
|
||||||
plocMPSoCHelper(plocMPSoCHelper),
|
specialComHelper(plocMPSoCHelper),
|
||||||
uartIsolatorSwitch(uartIsolatorSwitch),
|
uartIsolatorSwitch(uartIsolatorSwitch),
|
||||||
supervisorHandler(supervisorHandler),
|
supervisorHandler(supervisorHandler),
|
||||||
commandActionHelper(this) {
|
commandActionHelper(this) {
|
||||||
@ -65,12 +65,12 @@ ReturnValue_t PlocMpsocHandler::initialize() {
|
|||||||
return ObjectManagerIF::CHILD_INIT_FAILED;
|
return ObjectManagerIF::CHILD_INIT_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = plocMPSoCHelper->setComIF(communicationInterface);
|
result = specialComHelper->setComIF(communicationInterface);
|
||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
return ObjectManagerIF::CHILD_INIT_FAILED;
|
return ObjectManagerIF::CHILD_INIT_FAILED;
|
||||||
}
|
}
|
||||||
plocMPSoCHelper->setComCookie(comCookie);
|
specialComHelper->setComCookie(comCookie);
|
||||||
plocMPSoCHelper->setSequenceCount(&sequenceCount);
|
specialComHelper->setSequenceCount(&sequenceCount);
|
||||||
result = commandActionHelper.initialize();
|
result = commandActionHelper.initialize();
|
||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
return ObjectManagerIF::CHILD_INIT_FAILED;
|
return ObjectManagerIF::CHILD_INIT_FAILED;
|
||||||
@ -136,8 +136,8 @@ ReturnValue_t PlocMpsocHandler::executeAction(ActionId_t actionId, MessageQueueI
|
|||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
plocMPSoCHelper->setSequenceCount(&sequenceCount);
|
specialComHelper->setSequenceCount(&sequenceCount);
|
||||||
result = plocMPSoCHelper->startFlashWrite(flashWritePusCmd.getObcFile(),
|
result = specialComHelper->startFlashWrite(flashWritePusCmd.getObcFile(),
|
||||||
flashWritePusCmd.getMPSoCFile());
|
flashWritePusCmd.getMPSoCFile());
|
||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
@ -151,10 +151,8 @@ ReturnValue_t PlocMpsocHandler::executeAction(ActionId_t actionId, MessageQueueI
|
|||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
sif::debug << "starting flash read" << std::endl;
|
specialComHelper->setSequenceCount(&sequenceCount);
|
||||||
sif::debug << "sequence count: " << sequenceCount.get() << std::endl;
|
result = specialComHelper->startFlashRead(flashReadPusCmd.getObcFile(),
|
||||||
plocMPSoCHelper->setSequenceCount(&sequenceCount);
|
|
||||||
result = plocMPSoCHelper->startFlashRead(flashReadPusCmd.getObcFile(),
|
|
||||||
flashReadPusCmd.getMPSoCFile(),
|
flashReadPusCmd.getMPSoCFile(),
|
||||||
flashReadPusCmd.getReadSize());
|
flashReadPusCmd.getReadSize());
|
||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
@ -790,10 +788,9 @@ ReturnValue_t PlocMpsocHandler::handleAckReport(const uint8_t* data) {
|
|||||||
|
|
||||||
switch (apid) {
|
switch (apid) {
|
||||||
case mpsoc::apid::ACK_FAILURE: {
|
case mpsoc::apid::ACK_FAILURE: {
|
||||||
sif::debug << "PlocMPSoCHandler::handleAckReport: Received Ack failure report" << std::endl;
|
|
||||||
DeviceCommandId_t commandId = getPendingCommand();
|
DeviceCommandId_t commandId = getPendingCommand();
|
||||||
uint16_t status = mpsoc::getStatusFromRawData(data);
|
uint16_t status = mpsoc::getStatusFromRawData(data);
|
||||||
sif::warning << "Verification report status: " << mpsoc::getStatusString(status) << std::endl;
|
sif::warning << "MPSoC ACK Failure: " << mpsoc::getStatusString(status) << std::endl;
|
||||||
if (commandId != DeviceHandlerIF::NO_COMMAND_ID) {
|
if (commandId != DeviceHandlerIF::NO_COMMAND_ID) {
|
||||||
triggerEvent(ACK_FAILURE, commandId, status);
|
triggerEvent(ACK_FAILURE, commandId, status);
|
||||||
}
|
}
|
||||||
@ -835,15 +832,12 @@ ReturnValue_t PlocMpsocHandler::handleExecutionReport(const uint8_t* data) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case (mpsoc::apid::EXE_FAILURE): {
|
case (mpsoc::apid::EXE_FAILURE): {
|
||||||
// TODO: Interpretation of status field in execution report
|
|
||||||
sif::warning << "PlocMPSoCHandler::handleExecutionReport: Received execution failure report"
|
|
||||||
<< std::endl;
|
|
||||||
DeviceCommandId_t commandId = getPendingCommand();
|
DeviceCommandId_t commandId = getPendingCommand();
|
||||||
if (commandId == DeviceHandlerIF::NO_COMMAND_ID) {
|
if (commandId == DeviceHandlerIF::NO_COMMAND_ID) {
|
||||||
sif::debug << "PlocMPSoCHandler::handleExecutionReport: Unknown command id" << std::endl;
|
sif::debug << "PlocMPSoCHandler::handleExecutionReport: Unknown command id" << std::endl;
|
||||||
}
|
}
|
||||||
uint16_t status = mpsoc::getStatusFromRawData(data);
|
uint16_t status = mpsoc::getStatusFromRawData(data);
|
||||||
sif::warning << "Verification report status: " << mpsoc::getStatusString(status) << std::endl;
|
sif::warning << "MPSoC EXE Failure: " << mpsoc::getStatusString(status) << std::endl;
|
||||||
triggerEvent(EXE_FAILURE, commandId, status);
|
triggerEvent(EXE_FAILURE, commandId, status);
|
||||||
sendFailureReport(mpsoc::EXE_REPORT, MPSoCReturnValuesIF::RECEIVED_EXE_FAILURE);
|
sendFailureReport(mpsoc::EXE_REPORT, MPSoCReturnValuesIF::RECEIVED_EXE_FAILURE);
|
||||||
result = IGNORE_REPLY_DATA;
|
result = IGNORE_REPLY_DATA;
|
||||||
|
@ -162,7 +162,7 @@ class PlocMpsocHandler : public DeviceHandlerBase, public CommandsActionsIF {
|
|||||||
|
|
||||||
SerialComIF* uartComIf = nullptr;
|
SerialComIF* uartComIf = nullptr;
|
||||||
|
|
||||||
PlocMpsocSpecialComHelper* plocMPSoCHelper = nullptr;
|
PlocMpsocSpecialComHelper* specialComHelper = nullptr;
|
||||||
Gpio uartIsolatorSwitch;
|
Gpio uartIsolatorSwitch;
|
||||||
object_id_t supervisorHandler = 0;
|
object_id_t supervisorHandler = 0;
|
||||||
CommandActionHelper commandActionHelper;
|
CommandActionHelper commandActionHelper;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user