PLOC MPSoC dir content report #634

Merged
meggert merged 54 commits from ploc_mpsoc_dir_content_report_2 into v2.1.0-dev 2023-05-15 09:40:03 +02:00
8 changed files with 48 additions and 14 deletions
Showing only changes of commit af20a36634 - Show all commits

View File

@ -49,6 +49,10 @@ will consitute of a breaking change warranting a new major release:
16505 type. 16505 type.
- Host build is working again. Added reduced live TM helper which schedules the PUS and CFDP - Host build is working again. Added reduced live TM helper which schedules the PUS and CFDP
funnel. funnel.
- PLOC Supervisor handler now has a power switcher assigned to make PLOC power switching work
without an additional PCDU power switch command.
- The PLOC Supervisor handler now waits for the replies to the `SET_TIME` command to verify working
communication.
# [v2.0.5] 2023-05-11 # [v2.0.5] 2023-05-11

View File

@ -644,6 +644,7 @@ void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF, PowerSwit
auto* supvHandler = new PlocSupervisorHandler(objects::PLOC_SUPERVISOR_HANDLER, supervisorCookie, auto* supvHandler = new PlocSupervisorHandler(objects::PLOC_SUPERVISOR_HANDLER, supervisorCookie,
Gpio(gpioIds::ENABLE_SUPV_UART, gpioComIF), Gpio(gpioIds::ENABLE_SUPV_UART, gpioComIF),
power::PDU1_CH6_PLOC_12V, *supvHelper); power::PDU1_CH6_PLOC_12V, *supvHelper);
supvHandler->setPowerSwitcher(&pwrSwitch);
supvHandler->connectModeTreeParent(satsystem::payload::SUBSYSTEM); supvHandler->connectModeTreeParent(satsystem::payload::SUBSYSTEM);
#endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */ #endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */
static_cast<void>(consumer); static_cast<void>(consumer);

View File

@ -52,12 +52,12 @@ void ObjectFactory::produce(void* args) {
// level components. // level components.
dummy::DummyCfg dummyCfg; dummy::DummyCfg dummyCfg;
dummyCfg.addCoreCtrlCfg = false; dummyCfg.addCoreCtrlCfg = false;
dummyCfg.addCamSwitcherDummy = false;
#if OBSW_ADD_SYRLINKS == 1 #if OBSW_ADD_SYRLINKS == 1
dummyCfg.addSyrlinksDummies = false; dummyCfg.addSyrlinksDummies = false;
#endif #endif
#if OBSW_ADD_PLOC_SUPERVISOR == 1 || OBSW_ADD_PLOC_MPSOC == 1 #if OBSW_ADD_PLOC_SUPERVISOR == 1 || OBSW_ADD_PLOC_MPSOC == 1
dummyCfg.addPlocDummies = false; dummyCfg.addPlocDummies = false;
dummyCfg.addCamSwitcherDummy = false;
#endif #endif
#if OBSW_ADD_GOMSPACE_PCDU == 1 #if OBSW_ADD_GOMSPACE_PCDU == 1
dummyCfg.addPowerDummies = false; dummyCfg.addPowerDummies = false;

View File

@ -207,10 +207,14 @@ void PlocMPSoCHandler::doShutDown() {
#endif #endif
} }
ReturnValue_t PlocMPSoCHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) { ReturnValue_t PlocMPSoCHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) {
if(getPendingCommand() == DeviceHandlerIF::NO_COMMAND_ID) {
*id = mpsoc::TC_GET_HK_REPORT; *id = mpsoc::TC_GET_HK_REPORT;
return buildCommandFromCommand(*id, nullptr, 0); return buildCommandFromCommand(*id, nullptr, 0);
} }
return NOTHING_TO_SEND;
}
ReturnValue_t PlocMPSoCHandler::buildTransitionDeviceCommand(DeviceCommandId_t* id) { ReturnValue_t PlocMPSoCHandler::buildTransitionDeviceCommand(DeviceCommandId_t* id) {
return NOTHING_TO_SEND; return NOTHING_TO_SEND;
@ -330,7 +334,7 @@ void PlocMPSoCHandler::fillCommandAndReplyMap() {
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);
this->insertInReplyMap(mpsoc::TM_GET_HK_REPORT, 2, nullptr, mpsoc::SIZE_TM_HK_REPORT); this->insertInReplyMap(mpsoc::TM_GET_HK_REPORT, 5, nullptr, mpsoc::SIZE_TM_HK_REPORT);
this->insertInReplyMap(mpsoc::TM_CAM_CMD_RPT, 2, nullptr, mpsoc::SP_MAX_SIZE); this->insertInReplyMap(mpsoc::TM_CAM_CMD_RPT, 2, nullptr, mpsoc::SP_MAX_SIZE);
this->insertInReplyMap(mpsoc::TM_FLASH_DIRECTORY_CONTENT, 2, nullptr, 0); this->insertInReplyMap(mpsoc::TM_FLASH_DIRECTORY_CONTENT, 2, nullptr, 0);
} }
@ -338,6 +342,7 @@ void PlocMPSoCHandler::fillCommandAndReplyMap() {
ReturnValue_t PlocMPSoCHandler::scanForReply(const uint8_t* start, size_t remainingSize, ReturnValue_t PlocMPSoCHandler::scanForReply(const uint8_t* start, size_t remainingSize,
DeviceCommandId_t* foundId, size_t* foundLen) { DeviceCommandId_t* foundId, size_t* foundLen) {
ReturnValue_t result = returnvalue::OK; ReturnValue_t result = returnvalue::OK;
sif::debug << "remaining size: " << remainingSize << std::endl;
SpacePacketReader spacePacket; SpacePacketReader spacePacket;
spacePacket.setReadOnlyData(start, remainingSize); spacePacket.setReadOnlyData(start, remainingSize);
@ -357,6 +362,7 @@ ReturnValue_t PlocMPSoCHandler::scanForReply(const uint8_t* start, size_t remain
}; };
switch (apid) { switch (apid) {
case (mpsoc::apid::ACK_SUCCESS): case (mpsoc::apid::ACK_SUCCESS):
sif::debug << "recv ack success" << std::endl;
*foundLen = mpsoc::SIZE_ACK_REPORT; *foundLen = mpsoc::SIZE_ACK_REPORT;
*foundId = mpsoc::ACK_REPORT; *foundId = mpsoc::ACK_REPORT;
break; break;
@ -380,6 +386,7 @@ ReturnValue_t PlocMPSoCHandler::scanForReply(const uint8_t* start, size_t remain
break; break;
} }
case (mpsoc::apid::EXE_SUCCESS): case (mpsoc::apid::EXE_SUCCESS):
sif::debug << "recv exe success" << std::endl;
*foundLen = mpsoc::SIZE_EXE_REPORT; *foundLen = mpsoc::SIZE_EXE_REPORT;
*foundId = mpsoc::EXE_REPORT; *foundId = mpsoc::EXE_REPORT;
break; break;
@ -596,13 +603,12 @@ ReturnValue_t PlocMPSoCHandler::prepareTcDownlinkPwrOff() {
} }
ReturnValue_t PlocMPSoCHandler::prepareTcGetHkReport() { ReturnValue_t PlocMPSoCHandler::prepareTcGetHkReport() {
ReturnValue_t result = returnvalue::OK; mpsoc::TcGetHkReport tcGetHkReport(spParams, sequenceCount);
mpsoc::TcGetHkReport tcDownlinkPwrOff(spParams, sequenceCount); ReturnValue_t result = tcGetHkReport.buildPacket();
result = tcDownlinkPwrOff.buildPacket();
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
return result; return result;
} }
finishTcPrep(tcDownlinkPwrOff.getFullPacketLen()); finishTcPrep(tcGetHkReport.getFullPacketLen());
return returnvalue::OK; return returnvalue::OK;
} }
@ -1144,6 +1150,10 @@ void PlocMPSoCHandler::setNextReplyId() {
case mpsoc::TC_MEM_READ: case mpsoc::TC_MEM_READ:
nextReplyId = mpsoc::TM_MEMORY_READ_REPORT; nextReplyId = mpsoc::TM_MEMORY_READ_REPORT;
break; break;
case mpsoc::TC_GET_HK_REPORT: {
nextReplyId = mpsoc::TM_GET_HK_REPORT;
break;
}
default: default:
/* If no telemetry is expected the next reply is always the execution report */ /* If no telemetry is expected the next reply is always the execution report */
nextReplyId = mpsoc::EXE_REPORT; nextReplyId = mpsoc::EXE_REPORT;
@ -1180,6 +1190,7 @@ size_t PlocMPSoCHandler::getNextReplyLength(DeviceCommandId_t commandId) {
replyLen = mpsoc::SP_MAX_SIZE; replyLen = mpsoc::SP_MAX_SIZE;
break; break;
default: { default: {
sif::debug << "reply length " << iter->second.replyLen << std::endl;
replyLen = iter->second.replyLen; replyLen = iter->second.replyLen;
break; break;
} }

View File

@ -151,7 +151,7 @@ void PlocSupervisorHandler::doStartUp() {
} }
} }
} }
if (startupState == StartupState::SET_TIME_EXECUTING) { if (startupState == StartupState::TIME_WAS_SET) {
startupState = StartupState::ON; startupState = StartupState::ON;
} }
if (startupState == StartupState::ON) { if (startupState == StartupState::ON) {
@ -176,7 +176,7 @@ ReturnValue_t PlocSupervisorHandler::buildNormalDeviceCommand(DeviceCommandId_t*
ReturnValue_t PlocSupervisorHandler::buildTransitionDeviceCommand(DeviceCommandId_t* id) { ReturnValue_t PlocSupervisorHandler::buildTransitionDeviceCommand(DeviceCommandId_t* id) {
if (startupState == StartupState::SET_TIME) { if (startupState == StartupState::SET_TIME) {
*id = supv::SET_TIME_REF; *id = supv::SET_TIME_REF;
startupState = StartupState::SET_TIME_EXECUTING; startupState = StartupState::WAIT_FOR_TIME_REPLY;
return buildCommandFromCommand(*id, nullptr, 0); return buildCommandFromCommand(*id, nullptr, 0);
} }
return NOTHING_TO_SEND; return NOTHING_TO_SEND;
@ -1909,6 +1909,10 @@ ReturnValue_t PlocSupervisorHandler::handleExecutionSuccessReport(ExecutionRepor
case supv::SET_TIME_REF: { case supv::SET_TIME_REF: {
// We could only allow proper bootup when the time was set successfully, but // We could only allow proper bootup when the time was set successfully, but
// this makes debugging difficult. // this makes debugging difficult.
if (startupState == StartupState::WAIT_FOR_TIME_REPLY) {
startupState = StartupState::TIME_WAS_SET;
}
break; break;
} }
default: default:

View File

@ -99,7 +99,14 @@ class PlocSupervisorHandler : public DeviceHandlerBase {
static const uint32_t MRAM_DUMP_TIMEOUT = 60000; static const uint32_t MRAM_DUMP_TIMEOUT = 60000;
// 4 s // 4 s
static const uint32_t BOOT_TIMEOUT = 4000; static const uint32_t BOOT_TIMEOUT = 4000;
enum class StartupState : uint8_t { OFF, BOOTING, SET_TIME, SET_TIME_EXECUTING, ON }; enum class StartupState : uint8_t {
OFF,
BOOTING,
SET_TIME,
WAIT_FOR_TIME_REPLY,
TIME_WAS_SET,
ON
};
static constexpr bool SET_TIME_DURING_BOOT = true; static constexpr bool SET_TIME_DURING_BOOT = true;

View File

@ -119,14 +119,15 @@ static const uint16_t TC_DOWNLINK_PWR_OFF = 0x124;
static const uint16_t TC_CAM_CMD_SEND = 0x12C; static const uint16_t TC_CAM_CMD_SEND = 0x12C;
static constexpr uint16_t TC_FLASH_COPY_FILE = 0x12E; static constexpr uint16_t TC_FLASH_COPY_FILE = 0x12E;
static const uint16_t TC_SIMPLEX_SEND_FILE = 0x130; static const uint16_t TC_SIMPLEX_SEND_FILE = 0x130;
static constexpr uint16_t TM_HK_GET_REPORT = 0x408;
static const uint16_t TM_MEMORY_READ_REPORT = 0x404;
static const uint16_t ACK_SUCCESS = 0x400; static const uint16_t ACK_SUCCESS = 0x400;
static const uint16_t ACK_FAILURE = 0x401; static const uint16_t ACK_FAILURE = 0x401;
static const uint16_t EXE_SUCCESS = 0x402; static const uint16_t EXE_SUCCESS = 0x402;
static const uint16_t EXE_FAILURE = 0x403; static const uint16_t EXE_FAILURE = 0x403;
static const uint16_t TM_MEMORY_READ_REPORT = 0x404;
static constexpr uint16_t TM_FLASH_DIRECTORY_CONTENT = 0x406; static constexpr uint16_t TM_FLASH_DIRECTORY_CONTENT = 0x406;
static const uint16_t TM_CAM_CMD_RPT = 0x407; static const uint16_t TM_CAM_CMD_RPT = 0x407;
static constexpr uint16_t TM_HK_GET_REPORT = 0x408;
} // namespace apid } // namespace apid
/** Offset from first byte in space packet to first byte of data field */ /** Offset from first byte in space packet to first byte of data field */
@ -614,6 +615,12 @@ class TcDownlinkPwrOn : public TcBase {
} }
}; };
class TcGetHkReport : public TcBase {
public:
TcGetHkReport(ploc::SpTcParams params, uint16_t sequenceCount)
: TcBase(params, apid::TC_HK_GET_REPORT, sequenceCount) {}
};
/** /**
* @brief Class to build replay stop space packet. * @brief Class to build replay stop space packet.
*/ */

2
tmtc

@ -1 +1 @@
Subproject commit 5fbd19bb6cca0790373a809d78f2307adca9d0c8 Subproject commit f090c3af66d1a0b760344e80053d6e83895e661a