Merge pull request 'Payload: Fixes and improvements' (#637) from ploc-code-improvenemts-2 into v2.1.0-dev
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good

Reviewed-on: #637
This commit is contained in:
Marius Eggert 2023-05-12 09:47:32 +02:00
commit c9121c5214
6 changed files with 21 additions and 5 deletions

View File

@ -46,6 +46,10 @@ will consitute of a breaking change warranting a new major release:
16505 type.
- Host build is working again. Added reduced live TM helper which schedules the PUS and CFDP
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

View File

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

View File

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

View File

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

View File

@ -99,7 +99,14 @@ class PlocSupervisorHandler : public DeviceHandlerBase {
static const uint32_t MRAM_DUMP_TIMEOUT = 60000;
// 4 s
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;

2
tmtc

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