mpsoc flash write command
This commit is contained in:
@ -507,10 +507,10 @@ ReturnValue_t PlocMPSoCHandler::handleExecutionReport(const uint8_t* data) {
|
||||
case (mpsoc::apid::EXE_FAILURE): {
|
||||
// TODO: Interpretation of status field in execution report
|
||||
sif::warning << "PlocMPSoCHandler::handleExecutionReport: Received execution failure report"
|
||||
<< std::endl;
|
||||
<< std::endl;
|
||||
DeviceCommandId_t commandId = getPendingCommand();
|
||||
if (commandId != DeviceHandlerIF::NO_COMMAND_ID) {
|
||||
uint16_t status = getStatus(data);
|
||||
uint16_t status = getStatus(data);
|
||||
triggerEvent(EXE_FAILURE, commandId, status);
|
||||
} else {
|
||||
sif::debug << "PlocMPSoCHandler::handleExecutionReport: Unknown command id" << std::endl;
|
||||
@ -536,7 +536,7 @@ ReturnValue_t PlocMPSoCHandler::handleMemoryReadReport(const uint8_t* data) {
|
||||
result = verifyPacket(data, tmMemReadReport.rememberRequestedSize);
|
||||
if (result == MPSoCReturnValuesIF::CRC_FAILURE) {
|
||||
sif::warning << "PlocMPSoCHandler::handleMemoryReadReport: Memory read report has invalid crc"
|
||||
<< std::endl;
|
||||
<< std::endl;
|
||||
}
|
||||
uint16_t memLen =
|
||||
*(data + mpsoc::MEM_READ_RPT_LEN_OFFSET) << 8 | *(data + mpsoc::MEM_READ_RPT_LEN_OFFSET + 1);
|
||||
@ -603,13 +603,15 @@ ReturnValue_t PlocMPSoCHandler::enableReplyInReplyMap(DeviceCommandMap::iterator
|
||||
switch (command->first) {
|
||||
case mpsoc::TC_REPLAY_WRITE_SEQUENCE: {
|
||||
DeviceReplyIter iter = deviceReplyMap.find(mpsoc::EXE_REPORT);
|
||||
if (iter != deviceReplyMap.end()) {
|
||||
// Overwrite delay cycles because replay write sequence command can required up to
|
||||
// 30 seconds for execution
|
||||
iter->second.delayCycles = mpsoc::TC_WRITE_SEQ_EXECUTION_DELAY;
|
||||
} else {
|
||||
sif::debug << "PlocMPSoCHandler::enableReplyInReplyMap: Unknown reply id" << std::endl;
|
||||
}
|
||||
// Overwrite delay cycles because replay write sequence command can required up to
|
||||
// 30 seconds for execution
|
||||
iter->second.delayCycles = mpsoc::TC_WRITE_SEQ_EXECUTION_DELAY;
|
||||
break;
|
||||
}
|
||||
case mpsoc::TC_DOWNLINK_PWR_ON: {
|
||||
DeviceReplyIter iter = deviceReplyMap.find(mpsoc::EXE_REPORT);
|
||||
//
|
||||
iter->second.delayCycles = mpsoc::TC_DOWNLINK_PWR_ON;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@ -719,6 +721,7 @@ void PlocMPSoCHandler::disableAllReplies() {
|
||||
|
||||
/* We must always disable the execution report reply here */
|
||||
disableExeReportReply();
|
||||
nextReplyId = mpsoc::NONE;
|
||||
}
|
||||
|
||||
void PlocMPSoCHandler::sendFailureReport(DeviceCommandId_t replyId, ReturnValue_t status) {
|
||||
@ -743,7 +746,7 @@ void PlocMPSoCHandler::disableExeReportReply() {
|
||||
DeviceReplyInfo* info = &(iter->second);
|
||||
info->delayCycles = 0;
|
||||
info->command = deviceCommandMap.end();
|
||||
/* Expected replies is set to one here. The value will set to 0 in replyToReply() */
|
||||
/* Expected replies is set to one here. The value will be set to 0 in replyToReply() */
|
||||
info->command->second.expectedReplies = 0;
|
||||
}
|
||||
|
||||
@ -753,5 +756,5 @@ void PlocMPSoCHandler::printStatus(const uint8_t* data) {
|
||||
}
|
||||
|
||||
uint16_t PlocMPSoCHandler::getStatus(const uint8_t* data) {
|
||||
return *(data + STATUS_OFFSET) << 8 | *(data + STATUS_OFFSET + 1);
|
||||
return *(data + STATUS_OFFSET) << 8 | *(data + STATUS_OFFSET + 1);
|
||||
}
|
||||
|
Reference in New Issue
Block a user