Merge branch 'develop' into eggert/acs
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
This commit is contained in:
commit
00d4a7602a
@ -10,10 +10,16 @@ list yields a list of all related PRs for each release.
|
|||||||
|
|
||||||
# [unreleased]
|
# [unreleased]
|
||||||
|
|
||||||
|
## Fixed
|
||||||
|
|
||||||
|
- PLOC SUPV: Minor adaptions and important bugfix for UART manager
|
||||||
|
|
||||||
## Added
|
## Added
|
||||||
|
|
||||||
- First version of ACS controller
|
- First version of ACS controller
|
||||||
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/329
|
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/329
|
||||||
|
- Allow commanding the 5V stack internally in software
|
||||||
|
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/334
|
||||||
|
|
||||||
# [v1.18.0] 01.12.2022
|
# [v1.18.0] 01.12.2022
|
||||||
|
|
||||||
|
@ -1323,7 +1323,7 @@ void CoreController::performRebootFileHandling(bool recreateFile) {
|
|||||||
#if OBSW_VERBOSE_LEVEL >= 1
|
#if OBSW_VERBOSE_LEVEL >= 1
|
||||||
sif::info << "CoreController::performRebootFileHandling: Recreating reboot file" << std::endl;
|
sif::info << "CoreController::performRebootFileHandling: Recreating reboot file" << std::endl;
|
||||||
#endif
|
#endif
|
||||||
rebootFile.enabled = true;
|
rebootFile.enabled = false;
|
||||||
rebootFile.img00Cnt = 0;
|
rebootFile.img00Cnt = 0;
|
||||||
rebootFile.img01Cnt = 0;
|
rebootFile.img01Cnt = 0;
|
||||||
rebootFile.img10Cnt = 0;
|
rebootFile.img10Cnt = 0;
|
||||||
|
@ -33,8 +33,12 @@ void ObjectFactory::produce(void* args) {
|
|||||||
|
|
||||||
new CoreController(objects::CORE_CONTROLLER);
|
new CoreController(objects::CORE_CONTROLLER);
|
||||||
createPcduComponents(gpioComIF, &pwrSwitcher);
|
createPcduComponents(gpioComIF, &pwrSwitcher);
|
||||||
|
#if OBSW_ADD_RAD_SENSORS == 1
|
||||||
createRadSensorComponent(gpioComIF);
|
createRadSensorComponent(gpioComIF);
|
||||||
|
#endif
|
||||||
|
#if OBSW_ADD_SUN_SENSORS == 1
|
||||||
createSunSensorComponents(gpioComIF, spiMainComIF, pwrSwitcher, q7s::SPI_DEFAULT_DEV);
|
createSunSensorComponents(gpioComIF, spiMainComIF, pwrSwitcher, q7s::SPI_DEFAULT_DEV);
|
||||||
|
#endif
|
||||||
|
|
||||||
#if OBSW_ADD_ACS_BOARD == 1
|
#if OBSW_ADD_ACS_BOARD == 1
|
||||||
createAcsBoardComponents(gpioComIF, uartComIF, pwrSwitcher);
|
createAcsBoardComponents(gpioComIF, uartComIF, pwrSwitcher);
|
||||||
|
@ -152,7 +152,7 @@ class TcBase : public ploc::SpTcBase, public MPSoCReturnValuesIF {
|
|||||||
* sent and received packets.
|
* sent and received packets.
|
||||||
*/
|
*/
|
||||||
TcBase(ploc::SpTcParams params, uint16_t apid, uint16_t sequenceCount)
|
TcBase(ploc::SpTcParams params, uint16_t apid, uint16_t sequenceCount)
|
||||||
: ploc::SpTcBase(params, apid, sequenceCount) {
|
: ploc::SpTcBase(params, apid, 0, sequenceCount) {
|
||||||
spParams.setFullPayloadLen(INIT_LENGTH);
|
spParams.setFullPayloadLen(INIT_LENGTH);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -730,17 +730,13 @@ class FactoryReset : public TcBase {
|
|||||||
: TcBase(params, Apid::DATA_LOGGER,
|
: TcBase(params, Apid::DATA_LOGGER,
|
||||||
static_cast<uint8_t>(tc::DataLoggerServiceId::FACTORY_RESET), 0) {}
|
static_cast<uint8_t>(tc::DataLoggerServiceId::FACTORY_RESET), 0) {}
|
||||||
|
|
||||||
ReturnValue_t buildPacket(std::optional<uint8_t> op) {
|
ReturnValue_t buildPacket(uint8_t op) {
|
||||||
if (op) {
|
|
||||||
setLenFromPayloadLen(1);
|
setLenFromPayloadLen(1);
|
||||||
}
|
|
||||||
auto res = checkSizeAndSerializeHeader();
|
auto res = checkSizeAndSerializeHeader();
|
||||||
if (res != returnvalue::OK) {
|
if (res != returnvalue::OK) {
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
if (op) {
|
payloadStart[0] = op;
|
||||||
payloadStart[0] = op.value();
|
|
||||||
}
|
|
||||||
return calcAndSetCrc();
|
return calcAndSetCrc();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -184,12 +184,14 @@ void PlocMPSoCHandler::doShutDown() {
|
|||||||
powerState = PowerState::SHUTDOWN;
|
powerState = PowerState::SHUTDOWN;
|
||||||
break;
|
break;
|
||||||
case PowerState::OFF:
|
case PowerState::OFF:
|
||||||
|
sequenceCount = 0;
|
||||||
setMode(_MODE_POWER_DOWN);
|
setMode(_MODE_POWER_DOWN);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
sequenceCount = 0;
|
||||||
uartIsolatorSwitch.pullLow();
|
uartIsolatorSwitch.pullLow();
|
||||||
setMode(_MODE_POWER_DOWN);
|
setMode(_MODE_POWER_DOWN);
|
||||||
powerState = PowerState::OFF;
|
powerState = PowerState::OFF;
|
||||||
@ -340,7 +342,6 @@ ReturnValue_t PlocMPSoCHandler::scanForReply(const uint8_t* start, size_t remain
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sequenceCount++;
|
|
||||||
uint16_t recvSeqCnt = (*(start + 2) << 8 | *(start + 3)) & PACKET_SEQUENCE_COUNT_MASK;
|
uint16_t recvSeqCnt = (*(start + 2) << 8 | *(start + 3)) & PACKET_SEQUENCE_COUNT_MASK;
|
||||||
if (recvSeqCnt != sequenceCount) {
|
if (recvSeqCnt != sequenceCount) {
|
||||||
triggerEvent(MPSOC_HANDLER_SEQUENCE_COUNT_MISMATCH, sequenceCount, recvSeqCnt);
|
triggerEvent(MPSOC_HANDLER_SEQUENCE_COUNT_MISMATCH, sequenceCount, recvSeqCnt);
|
||||||
@ -403,11 +404,9 @@ void PlocMPSoCHandler::handleEvent(EventMessage* eventMessage) {
|
|||||||
ReturnValue_t PlocMPSoCHandler::prepareTcMemWrite(const uint8_t* commandData,
|
ReturnValue_t PlocMPSoCHandler::prepareTcMemWrite(const uint8_t* commandData,
|
||||||
size_t commandDataLen) {
|
size_t commandDataLen) {
|
||||||
ReturnValue_t result = returnvalue::OK;
|
ReturnValue_t result = returnvalue::OK;
|
||||||
sequenceCount++;
|
|
||||||
mpsoc::TcMemWrite tcMemWrite(spParams, sequenceCount);
|
mpsoc::TcMemWrite tcMemWrite(spParams, sequenceCount);
|
||||||
result = tcMemWrite.buildPacket(commandData, commandDataLen);
|
result = tcMemWrite.buildPacket(commandData, commandDataLen);
|
||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
sequenceCount--;
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
finishTcPrep(tcMemWrite.getFullPacketLen());
|
finishTcPrep(tcMemWrite.getFullPacketLen());
|
||||||
@ -417,11 +416,9 @@ ReturnValue_t PlocMPSoCHandler::prepareTcMemWrite(const uint8_t* commandData,
|
|||||||
ReturnValue_t PlocMPSoCHandler::prepareTcMemRead(const uint8_t* commandData,
|
ReturnValue_t PlocMPSoCHandler::prepareTcMemRead(const uint8_t* commandData,
|
||||||
size_t commandDataLen) {
|
size_t commandDataLen) {
|
||||||
ReturnValue_t result = returnvalue::OK;
|
ReturnValue_t result = returnvalue::OK;
|
||||||
sequenceCount++;
|
|
||||||
mpsoc::TcMemRead tcMemRead(spParams, sequenceCount);
|
mpsoc::TcMemRead tcMemRead(spParams, sequenceCount);
|
||||||
result = tcMemRead.buildPacket(commandData, commandDataLen);
|
result = tcMemRead.buildPacket(commandData, commandDataLen);
|
||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
sequenceCount--;
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
finishTcPrep(tcMemRead.getFullPacketLen());
|
finishTcPrep(tcMemRead.getFullPacketLen());
|
||||||
@ -435,12 +432,10 @@ ReturnValue_t PlocMPSoCHandler::prepareTcFlashDelete(const uint8_t* commandData,
|
|||||||
return MPSoCReturnValuesIF::NAME_TOO_LONG;
|
return MPSoCReturnValuesIF::NAME_TOO_LONG;
|
||||||
}
|
}
|
||||||
ReturnValue_t result = returnvalue::OK;
|
ReturnValue_t result = returnvalue::OK;
|
||||||
sequenceCount++;
|
|
||||||
mpsoc::TcFlashDelete tcFlashDelete(spParams, sequenceCount);
|
mpsoc::TcFlashDelete tcFlashDelete(spParams, sequenceCount);
|
||||||
result = tcFlashDelete.buildPacket(
|
result = tcFlashDelete.buildPacket(
|
||||||
std::string(reinterpret_cast<const char*>(commandData), commandDataLen));
|
std::string(reinterpret_cast<const char*>(commandData), commandDataLen));
|
||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
sequenceCount--;
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
finishTcPrep(tcFlashDelete.getFullPacketLen());
|
finishTcPrep(tcFlashDelete.getFullPacketLen());
|
||||||
@ -450,11 +445,9 @@ ReturnValue_t PlocMPSoCHandler::prepareTcFlashDelete(const uint8_t* commandData,
|
|||||||
ReturnValue_t PlocMPSoCHandler::prepareTcReplayStart(const uint8_t* commandData,
|
ReturnValue_t PlocMPSoCHandler::prepareTcReplayStart(const uint8_t* commandData,
|
||||||
size_t commandDataLen) {
|
size_t commandDataLen) {
|
||||||
ReturnValue_t result = returnvalue::OK;
|
ReturnValue_t result = returnvalue::OK;
|
||||||
sequenceCount++;
|
|
||||||
mpsoc::TcReplayStart tcReplayStart(spParams, sequenceCount);
|
mpsoc::TcReplayStart tcReplayStart(spParams, sequenceCount);
|
||||||
result = tcReplayStart.buildPacket(commandData, commandDataLen);
|
result = tcReplayStart.buildPacket(commandData, commandDataLen);
|
||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
sequenceCount--;
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
finishTcPrep(tcReplayStart.getFullPacketLen());
|
finishTcPrep(tcReplayStart.getFullPacketLen());
|
||||||
@ -463,11 +456,9 @@ ReturnValue_t PlocMPSoCHandler::prepareTcReplayStart(const uint8_t* commandData,
|
|||||||
|
|
||||||
ReturnValue_t PlocMPSoCHandler::prepareTcReplayStop() {
|
ReturnValue_t PlocMPSoCHandler::prepareTcReplayStop() {
|
||||||
ReturnValue_t result = returnvalue::OK;
|
ReturnValue_t result = returnvalue::OK;
|
||||||
sequenceCount++;
|
|
||||||
mpsoc::TcReplayStop tcReplayStop(spParams, sequenceCount);
|
mpsoc::TcReplayStop tcReplayStop(spParams, sequenceCount);
|
||||||
result = tcReplayStop.buildPacket();
|
result = tcReplayStop.buildPacket();
|
||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
sequenceCount--;
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
finishTcPrep(tcReplayStop.getFullPacketLen());
|
finishTcPrep(tcReplayStop.getFullPacketLen());
|
||||||
@ -477,11 +468,9 @@ ReturnValue_t PlocMPSoCHandler::prepareTcReplayStop() {
|
|||||||
ReturnValue_t PlocMPSoCHandler::prepareTcDownlinkPwrOn(const uint8_t* commandData,
|
ReturnValue_t PlocMPSoCHandler::prepareTcDownlinkPwrOn(const uint8_t* commandData,
|
||||||
size_t commandDataLen) {
|
size_t commandDataLen) {
|
||||||
ReturnValue_t result = returnvalue::OK;
|
ReturnValue_t result = returnvalue::OK;
|
||||||
sequenceCount++;
|
|
||||||
mpsoc::TcDownlinkPwrOn tcDownlinkPwrOn(spParams, sequenceCount);
|
mpsoc::TcDownlinkPwrOn tcDownlinkPwrOn(spParams, sequenceCount);
|
||||||
result = tcDownlinkPwrOn.buildPacket(commandData, commandDataLen);
|
result = tcDownlinkPwrOn.buildPacket(commandData, commandDataLen);
|
||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
sequenceCount--;
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
finishTcPrep(tcDownlinkPwrOn.getFullPacketLen());
|
finishTcPrep(tcDownlinkPwrOn.getFullPacketLen());
|
||||||
@ -490,11 +479,9 @@ ReturnValue_t PlocMPSoCHandler::prepareTcDownlinkPwrOn(const uint8_t* commandDat
|
|||||||
|
|
||||||
ReturnValue_t PlocMPSoCHandler::prepareTcDownlinkPwrOff() {
|
ReturnValue_t PlocMPSoCHandler::prepareTcDownlinkPwrOff() {
|
||||||
ReturnValue_t result = returnvalue::OK;
|
ReturnValue_t result = returnvalue::OK;
|
||||||
sequenceCount++;
|
|
||||||
mpsoc::TcDownlinkPwrOff tcDownlinkPwrOff(spParams, sequenceCount);
|
mpsoc::TcDownlinkPwrOff tcDownlinkPwrOff(spParams, sequenceCount);
|
||||||
result = tcDownlinkPwrOff.buildPacket();
|
result = tcDownlinkPwrOff.buildPacket();
|
||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
sequenceCount--;
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
finishTcPrep(tcDownlinkPwrOff.getFullPacketLen());
|
finishTcPrep(tcDownlinkPwrOff.getFullPacketLen());
|
||||||
@ -504,11 +491,9 @@ ReturnValue_t PlocMPSoCHandler::prepareTcDownlinkPwrOff() {
|
|||||||
ReturnValue_t PlocMPSoCHandler::prepareTcReplayWriteSequence(const uint8_t* commandData,
|
ReturnValue_t PlocMPSoCHandler::prepareTcReplayWriteSequence(const uint8_t* commandData,
|
||||||
size_t commandDataLen) {
|
size_t commandDataLen) {
|
||||||
ReturnValue_t result = returnvalue::OK;
|
ReturnValue_t result = returnvalue::OK;
|
||||||
sequenceCount++;
|
|
||||||
mpsoc::TcReplayWriteSeq tcReplayWriteSeq(spParams, sequenceCount);
|
mpsoc::TcReplayWriteSeq tcReplayWriteSeq(spParams, sequenceCount);
|
||||||
result = tcReplayWriteSeq.buildPacket(commandData, commandDataLen);
|
result = tcReplayWriteSeq.buildPacket(commandData, commandDataLen);
|
||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
sequenceCount--;
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
finishTcPrep(tcReplayWriteSeq.getFullPacketLen());
|
finishTcPrep(tcReplayWriteSeq.getFullPacketLen());
|
||||||
@ -517,11 +502,9 @@ ReturnValue_t PlocMPSoCHandler::prepareTcReplayWriteSequence(const uint8_t* comm
|
|||||||
|
|
||||||
ReturnValue_t PlocMPSoCHandler::prepareTcModeReplay() {
|
ReturnValue_t PlocMPSoCHandler::prepareTcModeReplay() {
|
||||||
ReturnValue_t result = returnvalue::OK;
|
ReturnValue_t result = returnvalue::OK;
|
||||||
sequenceCount++;
|
|
||||||
mpsoc::TcModeReplay tcModeReplay(spParams, sequenceCount);
|
mpsoc::TcModeReplay tcModeReplay(spParams, sequenceCount);
|
||||||
result = tcModeReplay.buildPacket();
|
result = tcModeReplay.buildPacket();
|
||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
sequenceCount--;
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
finishTcPrep(tcModeReplay.getFullPacketLen());
|
finishTcPrep(tcModeReplay.getFullPacketLen());
|
||||||
@ -530,11 +513,9 @@ ReturnValue_t PlocMPSoCHandler::prepareTcModeReplay() {
|
|||||||
|
|
||||||
ReturnValue_t PlocMPSoCHandler::prepareTcModeIdle() {
|
ReturnValue_t PlocMPSoCHandler::prepareTcModeIdle() {
|
||||||
ReturnValue_t result = returnvalue::OK;
|
ReturnValue_t result = returnvalue::OK;
|
||||||
sequenceCount++;
|
|
||||||
mpsoc::TcModeIdle tcModeIdle(spParams, sequenceCount);
|
mpsoc::TcModeIdle tcModeIdle(spParams, sequenceCount);
|
||||||
result = tcModeIdle.buildPacket();
|
result = tcModeIdle.buildPacket();
|
||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
sequenceCount--;
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
finishTcPrep(tcModeIdle.getFullPacketLen());
|
finishTcPrep(tcModeIdle.getFullPacketLen());
|
||||||
@ -544,11 +525,9 @@ ReturnValue_t PlocMPSoCHandler::prepareTcModeIdle() {
|
|||||||
ReturnValue_t PlocMPSoCHandler::prepareTcCamCmdSend(const uint8_t* commandData,
|
ReturnValue_t PlocMPSoCHandler::prepareTcCamCmdSend(const uint8_t* commandData,
|
||||||
size_t commandDataLen) {
|
size_t commandDataLen) {
|
||||||
ReturnValue_t result = returnvalue::OK;
|
ReturnValue_t result = returnvalue::OK;
|
||||||
sequenceCount++;
|
|
||||||
mpsoc::TcCamcmdSend tcCamCmdSend(spParams, sequenceCount);
|
mpsoc::TcCamcmdSend tcCamCmdSend(spParams, sequenceCount);
|
||||||
result = tcCamCmdSend.buildPacket(commandData, commandDataLen);
|
result = tcCamCmdSend.buildPacket(commandData, commandDataLen);
|
||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
sequenceCount--;
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
finishTcPrep(tcCamCmdSend.getFullPacketLen());
|
finishTcPrep(tcCamCmdSend.getFullPacketLen());
|
||||||
@ -560,6 +539,7 @@ void PlocMPSoCHandler::finishTcPrep(size_t packetLen) {
|
|||||||
nextReplyId = mpsoc::ACK_REPORT;
|
nextReplyId = mpsoc::ACK_REPORT;
|
||||||
rawPacket = commandBuffer;
|
rawPacket = commandBuffer;
|
||||||
rawPacketLen = packetLen;
|
rawPacketLen = packetLen;
|
||||||
|
sequenceCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t PlocMPSoCHandler::verifyPacket(const uint8_t* start, size_t foundLen) {
|
ReturnValue_t PlocMPSoCHandler::verifyPacket(const uint8_t* start, size_t foundLen) {
|
||||||
|
@ -107,10 +107,7 @@ class PlocMPSoCHandler : public DeviceHandlerBase, public CommandsActionsIF {
|
|||||||
MessageQueueIF* eventQueue = nullptr;
|
MessageQueueIF* eventQueue = nullptr;
|
||||||
MessageQueueIF* commandActionHelperQueue = nullptr;
|
MessageQueueIF* commandActionHelperQueue = nullptr;
|
||||||
|
|
||||||
// Initiate the sequence count with the maximum value. It is incremented before
|
SourceSequenceCounter sequenceCount = SourceSequenceCounter(0);
|
||||||
// a packet is sent, so the first value will be 0 accordingly using
|
|
||||||
// the wrap around of the counter.
|
|
||||||
SourceSequenceCounter sequenceCount = SourceSequenceCounter(ccsds::LIMIT_SEQUENCE_COUNT - 1);
|
|
||||||
|
|
||||||
uint8_t commandBuffer[mpsoc::MAX_COMMAND_SIZE];
|
uint8_t commandBuffer[mpsoc::MAX_COMMAND_SIZE];
|
||||||
SpacePacketCreator creator;
|
SpacePacketCreator creator;
|
||||||
|
@ -136,7 +136,6 @@ ReturnValue_t PlocSupervisorHandler::executeAction(ActionId_t actionId,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PlocSupervisorHandler::doStartUp() {
|
void PlocSupervisorHandler::doStartUp() {
|
||||||
if (setTimeDuringStartup) {
|
|
||||||
if (startupState == StartupState::OFF) {
|
if (startupState == StartupState::OFF) {
|
||||||
bootTimeout.resetTimer();
|
bootTimeout.resetTimer();
|
||||||
startupState = StartupState::BOOTING;
|
startupState = StartupState::BOOTING;
|
||||||
@ -145,20 +144,26 @@ void PlocSupervisorHandler::doStartUp() {
|
|||||||
if (bootTimeout.hasTimedOut()) {
|
if (bootTimeout.hasTimedOut()) {
|
||||||
uartIsolatorSwitch.pullHigh();
|
uartIsolatorSwitch.pullHigh();
|
||||||
uartManager.start();
|
uartManager.start();
|
||||||
|
if (SET_TIME_DURING_BOOT) {
|
||||||
startupState = StartupState::SET_TIME;
|
startupState = StartupState::SET_TIME;
|
||||||
|
} else {
|
||||||
|
startupState = StartupState::ON;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (startupState == StartupState::SET_TIME_EXECUTING) {
|
||||||
|
startupState = StartupState::ON;
|
||||||
|
}
|
||||||
if (startupState == StartupState::ON) {
|
if (startupState == StartupState::ON) {
|
||||||
setMode(_MODE_TO_ON);
|
setMode(_MODE_TO_ON);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
uartIsolatorSwitch.pullHigh();
|
|
||||||
setMode(_MODE_TO_ON);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlocSupervisorHandler::doShutDown() {
|
void PlocSupervisorHandler::doShutDown() {
|
||||||
setMode(_MODE_POWER_DOWN);
|
setMode(_MODE_POWER_DOWN);
|
||||||
|
shutdownCmdSent = false;
|
||||||
|
packetInBuffer = false;
|
||||||
|
nextReplyId = supv::NONE;
|
||||||
uartManager.stop();
|
uartManager.stop();
|
||||||
uartIsolatorSwitch.pullLow();
|
uartIsolatorSwitch.pullLow();
|
||||||
startupState = StartupState::OFF;
|
startupState = StartupState::OFF;
|
||||||
@ -1467,11 +1472,10 @@ ReturnValue_t PlocSupervisorHandler::prepareReadGpioCmd(const uint8_t* commandDa
|
|||||||
ReturnValue_t PlocSupervisorHandler::prepareFactoryResetCmd(const uint8_t* commandData,
|
ReturnValue_t PlocSupervisorHandler::prepareFactoryResetCmd(const uint8_t* commandData,
|
||||||
size_t len) {
|
size_t len) {
|
||||||
FactoryReset resetCmd(spParams);
|
FactoryReset resetCmd(spParams);
|
||||||
std::optional<uint8_t> op;
|
if (len < 1) {
|
||||||
if (len > 0) {
|
return HasActionsIF::INVALID_PARAMETERS;
|
||||||
op = commandData[0];
|
|
||||||
}
|
}
|
||||||
ReturnValue_t result = resetCmd.buildPacket(op);
|
ReturnValue_t result = resetCmd.buildPacket(commandData[0]);
|
||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -1897,9 +1901,8 @@ ReturnValue_t PlocSupervisorHandler::handleExecutionSuccessReport(ExecutionRepor
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case supv::SET_TIME_REF: {
|
case supv::SET_TIME_REF: {
|
||||||
if (startupState == StartupState::SET_TIME_EXECUTING) {
|
// We could only allow proper bootup when the time was set successfully, but
|
||||||
startupState = StartupState::ON;
|
// this makes debugging difficult.
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
@ -97,11 +97,11 @@ class PlocSupervisorHandler : public DeviceHandlerBase {
|
|||||||
static const uint32_t COPY_ADC_TO_MRAM_TIMEOUT = 70000;
|
static const uint32_t COPY_ADC_TO_MRAM_TIMEOUT = 70000;
|
||||||
// 60 s
|
// 60 s
|
||||||
static const uint32_t MRAM_DUMP_TIMEOUT = 60000;
|
static const uint32_t MRAM_DUMP_TIMEOUT = 60000;
|
||||||
// 2 s
|
// 4 s
|
||||||
static const uint32_t BOOT_TIMEOUT = 2000;
|
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, SET_TIME_EXECUTING, ON };
|
||||||
|
|
||||||
bool setTimeDuringStartup = true;
|
static constexpr bool SET_TIME_DURING_BOOT = true;
|
||||||
|
|
||||||
StartupState startupState = StartupState::OFF;
|
StartupState startupState = StartupState::OFF;
|
||||||
|
|
||||||
@ -138,8 +138,6 @@ class PlocSupervisorHandler : public DeviceHandlerBase {
|
|||||||
uint32_t receivedMramDumpPackets = 0;
|
uint32_t receivedMramDumpPackets = 0;
|
||||||
/** Set to true as soon as a complete space packet is present in the spacePacketBuffer */
|
/** Set to true as soon as a complete space packet is present in the spacePacketBuffer */
|
||||||
bool packetInBuffer = false;
|
bool packetInBuffer = false;
|
||||||
/** Points to the next free position in the space packet buffer */
|
|
||||||
uint16_t bufferTop = 0;
|
|
||||||
|
|
||||||
/** This buffer is used to concatenate space packets received in two different read steps */
|
/** This buffer is used to concatenate space packets received in two different read steps */
|
||||||
uint8_t spacePacketBuffer[supv::MAX_PACKET_SIZE];
|
uint8_t spacePacketBuffer[supv::MAX_PACKET_SIZE];
|
||||||
|
@ -100,6 +100,7 @@ ReturnValue_t PlocSupvUartManager::performOperation(uint8_t operationCode) {
|
|||||||
state = InternalState::SLEEPING;
|
state = InternalState::SLEEPING;
|
||||||
lock->unlockMutex();
|
lock->unlockMutex();
|
||||||
semaphore->acquire();
|
semaphore->acquire();
|
||||||
|
putTaskToSleep = false;
|
||||||
while (true) {
|
while (true) {
|
||||||
if (putTaskToSleep) {
|
if (putTaskToSleep) {
|
||||||
performUartShutdown();
|
performUartShutdown();
|
||||||
@ -295,11 +296,14 @@ void PlocSupvUartManager::stop() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PlocSupvUartManager::start() {
|
void PlocSupvUartManager::start() {
|
||||||
|
{
|
||||||
MutexGuard mg(lock);
|
MutexGuard mg(lock);
|
||||||
if (state != InternalState::SLEEPING and state != InternalState::GO_TO_SLEEP) {
|
if (state != InternalState::SLEEPING and state != InternalState::GO_TO_SLEEP) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
state = InternalState::DEFAULT;
|
state = InternalState::DEFAULT;
|
||||||
|
}
|
||||||
|
|
||||||
semaphore->release();
|
semaphore->release();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -216,10 +216,9 @@ void AcsController::performDetumble() {
|
|||||||
{
|
{
|
||||||
PoolReadGuard pg(&actuatorCmdData);
|
PoolReadGuard pg(&actuatorCmdData);
|
||||||
if (pg.getReadResult() == returnvalue::OK) {
|
if (pg.getReadResult() == returnvalue::OK) {
|
||||||
int32_t zeroVec[4] = {0, 0, 0, 0};
|
std::memset(actuatorCmdData.rwTargetTorque.value, 0, 4 * sizeof(double));
|
||||||
std::memcpy(actuatorCmdData.rwTargetTorque.value, zeroVec, 4 * sizeof(double));
|
|
||||||
actuatorCmdData.rwTargetTorque.setValid(false);
|
actuatorCmdData.rwTargetTorque.setValid(false);
|
||||||
std::memcpy(actuatorCmdData.rwTargetSpeed.value, zeroVec, 4 * sizeof(int32_t));
|
std::memset(actuatorCmdData.rwTargetSpeed.value, 0, 4 * sizeof(int32_t));
|
||||||
actuatorCmdData.rwTargetSpeed.setValid(false);
|
actuatorCmdData.rwTargetSpeed.setValid(false);
|
||||||
std::memcpy(actuatorCmdData.mtqTargetDipole.value, cmdDipolUnitsInt, 3 * sizeof(int16_t));
|
std::memcpy(actuatorCmdData.mtqTargetDipole.value, cmdDipolUnitsInt, 3 * sizeof(int16_t));
|
||||||
actuatorCmdData.mtqTargetDipole.setValid(true);
|
actuatorCmdData.mtqTargetDipole.setValid(true);
|
||||||
@ -495,7 +494,7 @@ void AcsController::copyMgmData() {
|
|||||||
PoolReadGuard pg(&sensorValues.mgm3Rm3100Set);
|
PoolReadGuard pg(&sensorValues.mgm3Rm3100Set);
|
||||||
if (pg.getReadResult() == returnvalue::OK) {
|
if (pg.getReadResult() == returnvalue::OK) {
|
||||||
std::memcpy(mgmDataRaw.mgm3Rm3100.value, sensorValues.mgm3Rm3100Set.fieldStrengths.value,
|
std::memcpy(mgmDataRaw.mgm3Rm3100.value, sensorValues.mgm3Rm3100Set.fieldStrengths.value,
|
||||||
3 + sizeof(float));
|
3 * sizeof(float));
|
||||||
mgmDataRaw.mgm3Rm3100.setValid(sensorValues.mgm3Rm3100Set.fieldStrengths.isValid());
|
mgmDataRaw.mgm3Rm3100.setValid(sensorValues.mgm3Rm3100Set.fieldStrengths.isValid());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -321,6 +321,11 @@ ReturnValue_t PCDUHandler::sendSwitchCommand(uint8_t switchNr, ReturnValue_t onO
|
|||||||
pdu = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU2_HANDLER);
|
pdu = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU2_HANDLER);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case pcdu::P60_DOCK_5V_STACK: {
|
||||||
|
memoryAddress = P60Dock::CONFIG_ADDRESS_OUT_EN_5V_STACK;
|
||||||
|
pdu = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::P60DOCK_HANDLER);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
default: {
|
default: {
|
||||||
sif::error << "PCDUHandler::sendSwitchCommand: Invalid switch number " << std::endl;
|
sif::error << "PCDUHandler::sendSwitchCommand: Invalid switch number " << std::endl;
|
||||||
|
@ -69,6 +69,16 @@ void PayloadPcduHandler::doTransition(Mode_t modeFrom, Submode_t subModeFrom) {
|
|||||||
if (getMode() == _MODE_TO_NORMAL) {
|
if (getMode() == _MODE_TO_NORMAL) {
|
||||||
stateMachineToNormal(modeFrom, subModeFrom);
|
stateMachineToNormal(modeFrom, subModeFrom);
|
||||||
return;
|
return;
|
||||||
|
} else if (getMode() == _MODE_TO_ON and modeFrom == MODE_NORMAL) {
|
||||||
|
gpioIF->pullLow(gpioIds::PLPCDU_ENB_HPA);
|
||||||
|
gpioIF->pullLow(gpioIds::PLPCDU_ENB_MPA);
|
||||||
|
gpioIF->pullLow(gpioIds::PLPCDU_ENB_TX);
|
||||||
|
gpioIF->pullLow(gpioIds::PLPCDU_ENB_X8);
|
||||||
|
gpioIF->pullLow(gpioIds::PLPCDU_ENB_DRO);
|
||||||
|
gpioIF->pullLow(gpioIds::PLPCDU_ENB_TX);
|
||||||
|
gpioIF->pullLow(gpioIds::PLPCDU_ENB_VBAT0);
|
||||||
|
gpioIF->pullLow(gpioIds::PLPCDU_ENB_VBAT1);
|
||||||
|
state = States::POWER_CHANNELS_ON;
|
||||||
}
|
}
|
||||||
DeviceHandlerBase::doTransition(modeFrom, subModeFrom);
|
DeviceHandlerBase::doTransition(modeFrom, subModeFrom);
|
||||||
}
|
}
|
||||||
@ -144,6 +154,10 @@ ReturnValue_t PayloadPcduHandler::stateMachineToNormal(Mode_t modeFrom, Submode_
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// sif::debug << "DIFF MASK: " << (int)diffMask << std::endl;
|
||||||
|
|
||||||
|
// No handling for the SSRs: If those are pulled low, the ADC is off
|
||||||
|
// and normal mode does not really make sense anyway
|
||||||
switchHandler(DRO_ON, gpioIds::PLPCDU_ENB_DRO, "DRO");
|
switchHandler(DRO_ON, gpioIds::PLPCDU_ENB_DRO, "DRO");
|
||||||
switchHandler(X8_ON, gpioIds::PLPCDU_ENB_X8, "X8");
|
switchHandler(X8_ON, gpioIds::PLPCDU_ENB_X8, "X8");
|
||||||
switchHandler(TX_ON, gpioIds::PLPCDU_ENB_TX, "TX");
|
switchHandler(TX_ON, gpioIds::PLPCDU_ENB_TX, "TX");
|
||||||
|
@ -108,6 +108,8 @@ enum class SetIds : uint32_t { CORE = 1, AUX = 2, CONFIG = 3 };
|
|||||||
|
|
||||||
namespace P60Dock {
|
namespace P60Dock {
|
||||||
|
|
||||||
|
static const uint16_t CONFIG_ADDRESS_OUT_EN_5V_STACK = 0x72;
|
||||||
|
|
||||||
namespace pool {
|
namespace pool {
|
||||||
|
|
||||||
enum Ids : lp_id_t {
|
enum Ids : lp_id_t {
|
||||||
@ -733,7 +735,9 @@ enum Switches : power::Switch_t {
|
|||||||
PDU2_CH5_DEPLOYMENT_MECHANISM_8V,
|
PDU2_CH5_DEPLOYMENT_MECHANISM_8V,
|
||||||
PDU2_CH6_PL_PCDU_BATT_1_14V8,
|
PDU2_CH6_PL_PCDU_BATT_1_14V8,
|
||||||
PDU2_CH7_ACS_BOARD_SIDE_B_3V3,
|
PDU2_CH7_ACS_BOARD_SIDE_B_3V3,
|
||||||
PDU2_CH8_PAYLOAD_CAMERA
|
PDU2_CH8_PAYLOAD_CAMERA,
|
||||||
|
|
||||||
|
P60_DOCK_5V_STACK
|
||||||
};
|
};
|
||||||
|
|
||||||
static constexpr uint8_t NUMBER_OF_SWITCHES = 18;
|
static constexpr uint8_t NUMBER_OF_SWITCHES = 18;
|
||||||
|
2
tmtc
2
tmtc
@ -1 +1 @@
|
|||||||
Subproject commit 96e27e716349bf01cac11c7e7b0b497a36149e87
|
Subproject commit 5c675560eadadfbb5e674d9be87c206df09d1771
|
Loading…
Reference in New Issue
Block a user