requires some wait cycles
All checks were successful
EIVE/eive-obsw/pipeline/pr-v2.1.0-dev This commit looks good

This commit is contained in:
Robin Müller 2023-05-12 12:37:25 +02:00
parent 699fc9a861
commit 2b999e7fa7
Signed by: muellerr
GPG Key ID: A649FB78196E3849
3 changed files with 41 additions and 32 deletions

View File

@ -152,33 +152,46 @@ ReturnValue_t PlocMPSoCHandler::executeAction(ActionId_t actionId, MessageQueueI
}
void PlocMPSoCHandler::doStartUp() {
if (startupState == StartupState::IDLE) {
startupState = StartupState::HW_INIT;
}
if (startupState == StartupState::HW_INIT) {
#ifdef XIPHOS_Q7S
#if not OBSW_MPSOC_JTAG_BOOT == 1
switch (powerState) {
case PowerState::OFF:
commandActionHelper.commandAction(supervisorHandler, supv::START_MPSOC);
powerState = PowerState::BOOTING;
break;
return;
case PowerState::ON:
hkReport.setReportingEnabled(true);
setMode(_MODE_TO_ON);
uartIsolatorSwitch.pullHigh();
startupState = StartupState::WAIT_CYCLES;
break;
default:
break;
return;
}
#else
powerState = PowerState::ON;
hkReport.setReportingEnabled(true);
setMode(_MODE_TO_ON);
uartIsolatorSwitch.pullHigh();
startupState = StartupState::WAIT_CYCLE;
#endif /* not MSPOC_JTAG_BOOT == 1 */
#else
startupState = StartupState::WAIT_CYCLES;
powerState = PowerState::ON;
hkReport.setReportingEnabled(true);
setMode(_MODE_TO_ON);
#endif /* XIPHOS_Q7S */
}
if (startupState == StartupState::WAIT_CYCLES) {
waitCycles++;
if (waitCycles == 2) {
startupState = StartupState::DONE;
waitCycles = 0;
}
}
if (startupState == StartupState::DONE) {
setMode(_MODE_TO_ON);
hkReport.setReportingEnabled(true);
startupState = StartupState::IDLE;
}
}
void PlocMPSoCHandler::doShutDown() {
#ifdef XIPHOS_Q7S
@ -205,10 +218,11 @@ void PlocMPSoCHandler::doShutDown() {
powerState = PowerState::OFF;
#endif
#endif
startupState = StartupState::IDLE;
}
ReturnValue_t PlocMPSoCHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) {
// testCycles ++;
if (getPendingCommand() == DeviceHandlerIF::NO_COMMAND_ID) {
*id = mpsoc::TC_GET_HK_REPORT;
return buildCommandFromCommand(*id, nullptr, 0);
@ -336,7 +350,6 @@ void PlocMPSoCHandler::fillCommandAndReplyMap() {
ReturnValue_t PlocMPSoCHandler::scanForReply(const uint8_t* start, size_t remainingSize,
DeviceCommandId_t* foundId, size_t* foundLen) {
ReturnValue_t result = returnvalue::OK;
sif::debug << "remaining size: " << remainingSize << std::endl;
SpacePacketReader spacePacket;
spacePacket.setReadOnlyData(start, remainingSize);
@ -369,14 +382,12 @@ ReturnValue_t PlocMPSoCHandler::scanForReply(const uint8_t* start, size_t remain
*foundId = mpsoc::TM_CAM_CMD_RPT;
break;
case (mpsoc::apid::TM_HK_GET_REPORT): {
sif::debug << "recv hk report" << std::endl;
*foundLen = spacePacket.getFullPacketLen();
foundPacketLen = *foundLen;
*foundId = mpsoc::TM_GET_HK_REPORT;
break;
}
case (mpsoc::apid::EXE_SUCCESS):
sif::debug << "recv exe success" << std::endl;
*foundLen = mpsoc::SIZE_EXE_REPORT;
*foundId = mpsoc::EXE_REPORT;
break;
@ -434,9 +445,7 @@ ReturnValue_t PlocMPSoCHandler::interpretDeviceReply(DeviceCommandId_t id, const
return result;
}
void PlocMPSoCHandler::setNormalDatapoolEntriesInvalid() {
hkReport.setValidity(false, true);
}
void PlocMPSoCHandler::setNormalDatapoolEntriesInvalid() { hkReport.setValidity(false, true); }
uint32_t PlocMPSoCHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 5000; }
@ -1151,7 +1160,6 @@ size_t PlocMPSoCHandler::getNextReplyLength(DeviceCommandId_t commandId) {
replyLen = mpsoc::SP_MAX_SIZE;
break;
default: {
sif::debug << "reply length " << iter->second.replyLen << std::endl;
replyLen = iter->second.replyLen;
break;
}

View File

@ -183,7 +183,9 @@ class PlocMPSoCHandler : public DeviceHandlerBase, public CommandsActionsIF {
size_t foundPacketLen = 0;
TelemetryBuffer tmBuffer;
uint32_t waitCycles = 0;
enum class StartupState { IDLE, HW_INIT, WAIT_CYCLES, DONE } startupState;
enum class PowerState { OFF, BOOTING, SHUTDOWN, ON };
PowerState powerState = PowerState::OFF;

View File

@ -882,8 +882,7 @@ class HkReport : public StaticLocalDataSet<36> {
lp_var_t<uint16_t>(sid.objectId, mpsoc::poolid::SEM_UNCORRECTABLE_ERRS, this);
lp_var_t<uint16_t> semCorrectableErrs =
lp_var_t<uint16_t>(sid.objectId, mpsoc::poolid::SEM_CORRECTABLE_ERRS, this);
lp_var_t<uint8_t> semStatus =
lp_var_t<uint8_t>(sid.objectId, mpsoc::poolid::SEM_CORRECTABLE_ERRS, this);
lp_var_t<uint8_t> semStatus = lp_var_t<uint8_t>(sid.objectId, mpsoc::poolid::SEM_STATUS, this);
lp_var_t<uint8_t> rebootMpsocRequired =
lp_var_t<uint8_t>(sid.objectId, mpsoc::poolid::REBOOT_MPSOC_REQUIRED, this);
};