Merge branch 'meier/ploc' into meier/plocSupv
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
This commit is contained in:
commit
4ba26f057d
@ -46,7 +46,7 @@ void ObjectFactory::produce(void* args) {
|
|||||||
Factory::setStaticFrameworkObjectIds();
|
Factory::setStaticFrameworkObjectIds();
|
||||||
ObjectFactory::produceGenericObjects();
|
ObjectFactory::produceGenericObjects();
|
||||||
|
|
||||||
new UartComIF(objects::UART_COM_IF);
|
new UartComIF(objects::UART_COM_IF);
|
||||||
|
|
||||||
#if OBSW_ADD_PLOC_MPSOC == 1
|
#if OBSW_ADD_PLOC_MPSOC == 1
|
||||||
UartCookie* mpsocUartCookie = new UartCookie(objects::PLOC_MPSOC_HANDLER, te0720_1cfa::MPSOC_UART,
|
UartCookie* mpsocUartCookie = new UartCookie(objects::PLOC_MPSOC_HANDLER, te0720_1cfa::MPSOC_UART,
|
||||||
@ -67,10 +67,9 @@ new UartComIF(objects::UART_COM_IF);
|
|||||||
supervisorCookie->setNoFixedSizeReply();
|
supervisorCookie->setNoFixedSizeReply();
|
||||||
auto supvGpioIF = new DummyGpioIF();
|
auto supvGpioIF = new DummyGpioIF();
|
||||||
auto supvHelper = new PlocSupvHelper(objects::PLOC_SUPERVISOR_HELPER);
|
auto supvHelper = new PlocSupvHelper(objects::PLOC_SUPERVISOR_HELPER);
|
||||||
auto plocSupervisor = new PlocSupervisorHandler(objects::PLOC_SUPERVISOR_HANDLER, objects::UART_COM_IF,
|
new PlocSupervisorHandler(objects::PLOC_SUPERVISOR_HANDLER, objects::UART_COM_IF,
|
||||||
supervisorCookie, Gpio(gpioIds::ENABLE_SUPV_UART, supvGpioIF),
|
supervisorCookie, Gpio(gpioIds::ENABLE_SUPV_UART, supvGpioIF),
|
||||||
pcdu::PDU1_CH6_PLOC_12V, supvHelper);
|
pcdu::PDU1_CH6_PLOC_12V, supvHelper);
|
||||||
plocSupervisor->setStartUpImmediately();
|
|
||||||
|
|
||||||
new PlocMemoryDumper(objects::PLOC_MEMORY_DUMPER);
|
new PlocMemoryDumper(objects::PLOC_MEMORY_DUMPER);
|
||||||
#endif
|
#endif
|
||||||
|
2
fsfw
2
fsfw
@ -1 +1 @@
|
|||||||
Subproject commit 789668ae50a26cda299cfd125011f9fb345824d9
|
Subproject commit 19bd26d9983d97c8daf010649e9142afac7e2650
|
@ -55,15 +55,16 @@ static const DeviceCommandId_t LOGGING_CLEAR_COUNTERS = 55;
|
|||||||
static const DeviceCommandId_t LOGGING_SET_TOPIC = 56;
|
static const DeviceCommandId_t LOGGING_SET_TOPIC = 56;
|
||||||
static const DeviceCommandId_t REQUEST_ADC_REPORT = 57;
|
static const DeviceCommandId_t REQUEST_ADC_REPORT = 57;
|
||||||
static const DeviceCommandId_t RESET_PL = 58;
|
static const DeviceCommandId_t RESET_PL = 58;
|
||||||
|
static const DeviceCommandId_t ENABLE_NVMS = 59;
|
||||||
|
|
||||||
/** Reply IDs */
|
/** Reply IDs */
|
||||||
static const DeviceCommandId_t ACK_REPORT = 50;
|
static const DeviceCommandId_t ACK_REPORT = 100;
|
||||||
static const DeviceCommandId_t EXE_REPORT = 51;
|
static const DeviceCommandId_t EXE_REPORT = 101;
|
||||||
static const DeviceCommandId_t HK_REPORT = 52;
|
static const DeviceCommandId_t HK_REPORT = 102;
|
||||||
static const DeviceCommandId_t BOOT_STATUS_REPORT = 53;
|
static const DeviceCommandId_t BOOT_STATUS_REPORT = 103;
|
||||||
static const DeviceCommandId_t LATCHUP_REPORT = 54;
|
static const DeviceCommandId_t LATCHUP_REPORT = 104;
|
||||||
static const DeviceCommandId_t LOGGING_REPORT = 55;
|
static const DeviceCommandId_t LOGGING_REPORT = 105;
|
||||||
static const DeviceCommandId_t ADC_REPORT = 56;
|
static const DeviceCommandId_t ADC_REPORT = 106;
|
||||||
|
|
||||||
// Size of complete space packet (6 byte header + size of data + 2 byte CRC)
|
// Size of complete space packet (6 byte header + size of data + 2 byte CRC)
|
||||||
static const uint16_t SIZE_ACK_REPORT = 14;
|
static const uint16_t SIZE_ACK_REPORT = 14;
|
||||||
@ -122,6 +123,7 @@ static const uint16_t APID_SET_ADC_THRESHOLD = 0xE3;
|
|||||||
static const uint16_t APID_GET_LATCHUP_STATUS_REPORT = 0xD9;
|
static const uint16_t APID_GET_LATCHUP_STATUS_REPORT = 0xD9;
|
||||||
static const uint16_t APID_COPY_ADC_DATA_TO_MRAM = 0xDA;
|
static const uint16_t APID_COPY_ADC_DATA_TO_MRAM = 0xDA;
|
||||||
static const uint16_t APID_REQUEST_ADC_REPORT = 0xDB;
|
static const uint16_t APID_REQUEST_ADC_REPORT = 0xDB;
|
||||||
|
static const uint16_t APID_ENABLE_NVMS = 0xF0;
|
||||||
static const uint16_t APID_RUN_AUTO_EM_TESTS = 0xF2;
|
static const uint16_t APID_RUN_AUTO_EM_TESTS = 0xF2;
|
||||||
static const uint16_t APID_WIPE_MRAM = 0xF3;
|
static const uint16_t APID_WIPE_MRAM = 0xF3;
|
||||||
static const uint16_t APID_DUMP_MRAM = 0xF4;
|
static const uint16_t APID_DUMP_MRAM = 0xF4;
|
||||||
@ -357,6 +359,50 @@ class MPSoCBootSelect : public SpacePacket {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This class creates the command to enable or disable the NVMs connected to the
|
||||||
|
* supervisor.
|
||||||
|
*/
|
||||||
|
class EnableNvms : public SpacePacket {
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* @brief Constructor
|
||||||
|
*
|
||||||
|
* @param mem The memory to boot from: NVM0 (0), NVM1 (1)
|
||||||
|
* @param bp0 Partition pin 0
|
||||||
|
* @param bp1 Partition pin 1
|
||||||
|
* @param bp2 Partition pin 2
|
||||||
|
*/
|
||||||
|
EnableNvms(uint8_t nvm01, uint8_t nvm3)
|
||||||
|
: SpacePacket(DATA_FIELD_LENGTH - 1, true, APID_ENABLE_NVMS, DEFAULT_SEQUENCE_COUNT),
|
||||||
|
nvm01(nvm01),
|
||||||
|
nvm3(nvm3) {
|
||||||
|
initPacket();
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
static const uint16_t DEFAULT_SEQUENCE_COUNT = 1;
|
||||||
|
static const uint8_t DATA_FIELD_LENGTH = 4;
|
||||||
|
static const uint8_t CRC_OFFSET = 2;
|
||||||
|
uint8_t nvm01 = 0;
|
||||||
|
uint8_t nvm3 = 0;
|
||||||
|
|
||||||
|
void initPacket() {
|
||||||
|
*(this->localData.fields.buffer) = nvm01;
|
||||||
|
*(this->localData.fields.buffer + 1) = nvm3;
|
||||||
|
|
||||||
|
/* Calculate crc */
|
||||||
|
uint16_t crc = CRC::crc16ccitt(this->localData.byteStream,
|
||||||
|
sizeof(CCSDSPrimaryHeader) + DATA_FIELD_LENGTH - 2);
|
||||||
|
|
||||||
|
/* Add crc to packet data field of space packet */
|
||||||
|
size_t serializedSize = 0;
|
||||||
|
uint8_t* crcPos = this->localData.fields.buffer + CRC_OFFSET;
|
||||||
|
SerializeAdapter::serialize<uint16_t>(&crc, &crcPos, &serializedSize, sizeof(crc),
|
||||||
|
SerializeIF::Endianness::BIG);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This class generates the space packet to update the time of the PLOC supervisor.
|
* @brief This class generates the space packet to update the time of the PLOC supervisor.
|
||||||
*/
|
*/
|
||||||
@ -1664,13 +1710,7 @@ class BootStatusReport : public StaticLocalDataSet<BOOT_REPORT_SET_ENTRIES> {
|
|||||||
*/
|
*/
|
||||||
class HkSet : public StaticLocalDataSet<HK_SET_ENTRIES> {
|
class HkSet : public StaticLocalDataSet<HK_SET_ENTRIES> {
|
||||||
public:
|
public:
|
||||||
|
enum class SocState { OFF = 0, BOOTING = 1, OPERATIONAL = 3, SHUTDOWN = 4 };
|
||||||
enum class SocState {
|
|
||||||
OFF = 0,
|
|
||||||
BOOTING = 1,
|
|
||||||
OPERATIONAL = 3,
|
|
||||||
SHUTDOWN = 4
|
|
||||||
};
|
|
||||||
|
|
||||||
HkSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, HK_SET_ID) {}
|
HkSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, HK_SET_ID) {}
|
||||||
|
|
||||||
|
@ -121,7 +121,10 @@ void PlocMemoryDumper::doStateMachine() {
|
|||||||
void PlocMemoryDumper::stepSuccessfulReceived(ActionId_t actionId, uint8_t step) {}
|
void PlocMemoryDumper::stepSuccessfulReceived(ActionId_t actionId, uint8_t step) {}
|
||||||
|
|
||||||
void PlocMemoryDumper::stepFailedReceived(ActionId_t actionId, uint8_t step,
|
void PlocMemoryDumper::stepFailedReceived(ActionId_t actionId, uint8_t step,
|
||||||
ReturnValue_t returnCode) {}
|
ReturnValue_t returnCode) {
|
||||||
|
triggerEvent(MRAM_DUMP_FAILED);
|
||||||
|
state = State::IDLE;
|
||||||
|
}
|
||||||
|
|
||||||
void PlocMemoryDumper::dataReceived(ActionId_t actionId, const uint8_t* data, uint32_t size) {}
|
void PlocMemoryDumper::dataReceived(ActionId_t actionId, const uint8_t* data, uint32_t size) {}
|
||||||
|
|
||||||
|
@ -137,7 +137,6 @@ ReturnValue_t PlocSupervisorHandler::executeAction(ActionId_t actionId,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PlocSupervisorHandler::doStartUp() {
|
void PlocSupervisorHandler::doStartUp() {
|
||||||
#ifdef XIPHOS_Q7S
|
|
||||||
switch (startupState) {
|
switch (startupState) {
|
||||||
case StartupState::OFF: {
|
case StartupState::OFF: {
|
||||||
bootTimeout.resetTimer();
|
bootTimeout.resetTimer();
|
||||||
@ -159,9 +158,6 @@ void PlocSupervisorHandler::doStartUp() {
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
setMode(_MODE_TO_ON);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlocSupervisorHandler::doShutDown() {
|
void PlocSupervisorHandler::doShutDown() {
|
||||||
@ -178,7 +174,7 @@ ReturnValue_t PlocSupervisorHandler::buildTransitionDeviceCommand(DeviceCommandI
|
|||||||
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::SET_TIME_EXECUTING;
|
||||||
return RETURN_OK;
|
return buildCommandFromCommand(*id, nullptr, 0);
|
||||||
}
|
}
|
||||||
return NOTHING_TO_SEND;
|
return NOTHING_TO_SEND;
|
||||||
}
|
}
|
||||||
@ -376,6 +372,10 @@ ReturnValue_t PlocSupervisorHandler::buildCommandFromCommand(DeviceCommandId_t d
|
|||||||
result = RETURN_OK;
|
result = RETURN_OK;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case ENABLE_NVMS: {
|
||||||
|
result = prepareEnableNvmsCommand(commandData);
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
sif::debug << "PlocSupervisorHandler::buildCommandFromCommand: Command not implemented"
|
sif::debug << "PlocSupervisorHandler::buildCommandFromCommand: Command not implemented"
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
@ -431,8 +431,11 @@ void PlocSupervisorHandler::fillCommandAndReplyMap() {
|
|||||||
this->insertInCommandMap(LOGGING_CLEAR_COUNTERS);
|
this->insertInCommandMap(LOGGING_CLEAR_COUNTERS);
|
||||||
this->insertInCommandMap(LOGGING_SET_TOPIC);
|
this->insertInCommandMap(LOGGING_SET_TOPIC);
|
||||||
this->insertInCommandMap(RESET_PL);
|
this->insertInCommandMap(RESET_PL);
|
||||||
this->insertInCommandAndReplyMap(FIRST_MRAM_DUMP, 3);
|
this->insertInCommandMap(ENABLE_NVMS);
|
||||||
this->insertInCommandAndReplyMap(CONSECUTIVE_MRAM_DUMP, 3);
|
this->insertInCommandAndReplyMap(FIRST_MRAM_DUMP, 0, nullptr, 0, false, false, FIRST_MRAM_DUMP,
|
||||||
|
&mramDumpTimeout);
|
||||||
|
this->insertInCommandAndReplyMap(CONSECUTIVE_MRAM_DUMP, 0, nullptr, 0, false, false,
|
||||||
|
CONSECUTIVE_MRAM_DUMP, &mramDumpTimeout);
|
||||||
this->insertInReplyMap(ACK_REPORT, 3, nullptr, SIZE_ACK_REPORT);
|
this->insertInReplyMap(ACK_REPORT, 3, nullptr, SIZE_ACK_REPORT);
|
||||||
this->insertInReplyMap(EXE_REPORT, 0, nullptr, SIZE_EXE_REPORT, false, &executionTimeout);
|
this->insertInReplyMap(EXE_REPORT, 0, nullptr, SIZE_EXE_REPORT, false, &executionTimeout);
|
||||||
this->insertInReplyMap(HK_REPORT, 3, &hkset, SIZE_HK_REPORT);
|
this->insertInReplyMap(HK_REPORT, 3, &hkset, SIZE_HK_REPORT);
|
||||||
@ -551,6 +554,7 @@ ReturnValue_t PlocSupervisorHandler::enableReplyInReplyMap(DeviceCommandMap::ite
|
|||||||
case LOGGING_CLEAR_COUNTERS:
|
case LOGGING_CLEAR_COUNTERS:
|
||||||
case LOGGING_SET_TOPIC:
|
case LOGGING_SET_TOPIC:
|
||||||
case RESET_PL:
|
case RESET_PL:
|
||||||
|
case ENABLE_NVMS:
|
||||||
enabledReplies = 2;
|
enabledReplies = 2;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -1310,6 +1314,10 @@ ReturnValue_t PlocSupervisorHandler::doSendReadHook() {
|
|||||||
return RETURN_OK;
|
return RETURN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PlocSupervisorHandler::doOffActivity() {
|
||||||
|
startupState = StartupState::OFF;
|
||||||
|
}
|
||||||
|
|
||||||
void PlocSupervisorHandler::handleDeviceTM(const uint8_t* data, size_t dataSize,
|
void PlocSupervisorHandler::handleDeviceTM(const uint8_t* data, size_t dataSize,
|
||||||
DeviceCommandId_t replyId) {
|
DeviceCommandId_t replyId) {
|
||||||
ReturnValue_t result = RETURN_OK;
|
ReturnValue_t result = RETURN_OK;
|
||||||
@ -1532,11 +1540,21 @@ ReturnValue_t PlocSupervisorHandler::prepareLoggingRequest(const uint8_t* comman
|
|||||||
return RETURN_OK;
|
return RETURN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ReturnValue_t PlocSupervisorHandler::prepareEnableNvmsCommand(const uint8_t* commandData) {
|
||||||
|
using namespace supv;
|
||||||
|
uint8_t nvm01 = *(commandData);
|
||||||
|
uint8_t nvm3 = *(commandData + 1);
|
||||||
|
EnableNvms packet(nvm01, nvm3);
|
||||||
|
packetToOutBuffer(packet.getWholeData(), packet.getFullSize());
|
||||||
|
return RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
void PlocSupervisorHandler::disableAllReplies() {
|
void PlocSupervisorHandler::disableAllReplies() {
|
||||||
|
using namespace supv;
|
||||||
DeviceReplyMap::iterator iter;
|
DeviceReplyMap::iterator iter;
|
||||||
|
|
||||||
/* Disable ack reply */
|
/* Disable ack reply */
|
||||||
iter = deviceReplyMap.find(supv::ACK_REPORT);
|
iter = deviceReplyMap.find(ACK_REPORT);
|
||||||
DeviceReplyInfo* info = &(iter->second);
|
DeviceReplyInfo* info = &(iter->second);
|
||||||
info->delayCycles = 0;
|
info->delayCycles = 0;
|
||||||
info->command = deviceCommandMap.end();
|
info->command = deviceCommandMap.end();
|
||||||
@ -1545,21 +1563,29 @@ void PlocSupervisorHandler::disableAllReplies() {
|
|||||||
|
|
||||||
/* If the command expects a telemetry packet the appropriate tm reply will be disabled here */
|
/* If the command expects a telemetry packet the appropriate tm reply will be disabled here */
|
||||||
switch (commandId) {
|
switch (commandId) {
|
||||||
case supv::GET_HK_REPORT: {
|
case GET_HK_REPORT: {
|
||||||
iter = deviceReplyMap.find(supv::GET_HK_REPORT);
|
disableReply(GET_HK_REPORT);
|
||||||
info = &(iter->second);
|
|
||||||
info->delayCycles = 0;
|
|
||||||
info->active = false;
|
|
||||||
info->command = deviceCommandMap.end();
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case supv::FIRST_MRAM_DUMP:
|
case FIRST_MRAM_DUMP:
|
||||||
case supv::CONSECUTIVE_MRAM_DUMP: {
|
case CONSECUTIVE_MRAM_DUMP: {
|
||||||
iter = deviceReplyMap.find(commandId);
|
disableReply(commandId);
|
||||||
info = &(iter->second);
|
break;
|
||||||
info->delayCycles = 0;
|
}
|
||||||
info->active = false;
|
case REQUEST_ADC_REPORT: {
|
||||||
info->command = deviceCommandMap.end();
|
disableReply(ADC_REPORT);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case GET_BOOT_STATUS_REPORT: {
|
||||||
|
disableReply(BOOT_STATUS_REPORT);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case GET_LATCHUP_STATUS_REPORT: {
|
||||||
|
disableReply(LATCHUP_REPORT);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case LOGGING_REQUEST_COUNTERS: {
|
||||||
|
disableReply(LOGGING_REPORT);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
@ -1571,6 +1597,14 @@ void PlocSupervisorHandler::disableAllReplies() {
|
|||||||
disableExeReportReply();
|
disableExeReportReply();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PlocSupervisorHandler::disableReply(DeviceCommandId_t replyId) {
|
||||||
|
DeviceReplyMap::iterator iter = deviceReplyMap.find(replyId);
|
||||||
|
DeviceReplyInfo* info = &(iter->second);
|
||||||
|
info->delayCycles = 0;
|
||||||
|
info->active = false;
|
||||||
|
info->command = deviceCommandMap.end();
|
||||||
|
}
|
||||||
|
|
||||||
void PlocSupervisorHandler::sendFailureReport(DeviceCommandId_t replyId, ReturnValue_t status) {
|
void PlocSupervisorHandler::sendFailureReport(DeviceCommandId_t replyId, ReturnValue_t status) {
|
||||||
DeviceReplyIter iter = deviceReplyMap.find(replyId);
|
DeviceReplyIter iter = deviceReplyMap.find(replyId);
|
||||||
|
|
||||||
@ -1648,9 +1682,13 @@ ReturnValue_t PlocSupervisorHandler::handleMramDumpPacket(DeviceCommandId_t id)
|
|||||||
sif::warning << "PlocSupervisorHandler::handleMramDumpPacket: CRC failure" << std::endl;
|
sif::warning << "PlocSupervisorHandler::handleMramDumpPacket: CRC failure" << std::endl;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
handleMramDumpFile(id);
|
result = handleMramDumpFile(id);
|
||||||
if (downlinkMramDump == true) {
|
if (result != RETURN_OK) {
|
||||||
handleDeviceTM(spacePacketBuffer + supv::SPACE_PACKET_HEADER_LENGTH, packetLen - 1, id);
|
DeviceCommandMap::iterator iter = deviceCommandMap.find(id);
|
||||||
|
actionHelper.finish(false, iter->second.sendReplyTo, id, result);
|
||||||
|
disableAllReplies();
|
||||||
|
nextReplyId = supv::NONE;
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
packetInBuffer = false;
|
packetInBuffer = false;
|
||||||
receivedMramDumpPackets++;
|
receivedMramDumpPackets++;
|
||||||
@ -1699,23 +1737,19 @@ void PlocSupervisorHandler::increaseExpectedMramReplies(DeviceCommandId_t id) {
|
|||||||
(sequenceFlags != static_cast<uint8_t>(supv::SequenceFlags::STANDALONE_PKT))) {
|
(sequenceFlags != static_cast<uint8_t>(supv::SequenceFlags::STANDALONE_PKT))) {
|
||||||
// Command expects at least one MRAM packet more and the execution report
|
// Command expects at least one MRAM packet more and the execution report
|
||||||
info->expectedReplies = 2;
|
info->expectedReplies = 2;
|
||||||
// Wait maximum of 2 cycles for next MRAM packet
|
mramReplyInfo->countdown->resetTimer();
|
||||||
mramReplyInfo->delayCycles = 2;
|
|
||||||
// Also adapting delay cycles for execution report
|
|
||||||
exeReplyInfo->delayCycles = 3;
|
|
||||||
} else {
|
} else {
|
||||||
// Command expects the execution report
|
// Command expects the execution report
|
||||||
info->expectedReplies = 1;
|
info->expectedReplies = 1;
|
||||||
mramReplyInfo->delayCycles = 0;
|
mramReplyInfo->active = false;
|
||||||
}
|
}
|
||||||
|
exeReplyInfo->countdown->resetTimer();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t PlocSupervisorHandler::checkMramPacketApid() {
|
ReturnValue_t PlocSupervisorHandler::checkMramPacketApid() {
|
||||||
uint16_t apid = (spacePacketBuffer[0] << 8 | spacePacketBuffer[1]) & supv::APID_MASK;
|
uint16_t apid = (spacePacketBuffer[0] << 8 | spacePacketBuffer[1]) & supv::APID_MASK;
|
||||||
if (apid != supv::APID_MRAM_DUMP_TM) {
|
if (apid != supv::APID_MRAM_DUMP_TM) {
|
||||||
sif::warning << "PlocSupervisorHandler::checkMramPacketApid: 0x" << std::hex << apid
|
|
||||||
<< std::endl;
|
|
||||||
return SupvReturnValuesIF::NO_MRAM_PACKET;
|
return SupvReturnValuesIF::NO_MRAM_PACKET;
|
||||||
}
|
}
|
||||||
return APERIODIC_REPLY;
|
return APERIODIC_REPLY;
|
||||||
@ -1788,7 +1822,7 @@ ReturnValue_t PlocSupervisorHandler::getTimeStampString(std::string& timeStamp)
|
|||||||
Clock::TimeOfDay_t time;
|
Clock::TimeOfDay_t time;
|
||||||
ReturnValue_t result = Clock::getDateAndTime(&time);
|
ReturnValue_t result = Clock::getDateAndTime(&time);
|
||||||
if (result != RETURN_OK) {
|
if (result != RETURN_OK) {
|
||||||
sif::warning << "PlocSupervisorHandler::createMramDumpFile: Failed to get current time"
|
sif::warning << "PlocSupervisorHandler::getTimeStampString: Failed to get current time"
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
return SupvReturnValuesIF::GET_TIME_FAILURE;
|
return SupvReturnValuesIF::GET_TIME_FAILURE;
|
||||||
}
|
}
|
||||||
@ -1871,8 +1905,8 @@ void PlocSupervisorHandler::handleExecutionSuccessReport(const uint8_t* data) {
|
|||||||
}
|
}
|
||||||
uint8_t data[sizeof(gpioState)];
|
uint8_t data[sizeof(gpioState)];
|
||||||
size_t size = 0;
|
size_t size = 0;
|
||||||
ReturnValue_t result = SerializeAdapter::serialize(
|
ReturnValue_t result = SerializeAdapter::serialize(&gpioState, data, &size, sizeof(gpioState),
|
||||||
&gpioState, data, &size, sizeof(gpioState), SerializeIF::Endianness::BIG);
|
SerializeIF::Endianness::BIG);
|
||||||
if (result != RETURN_OK) {
|
if (result != RETURN_OK) {
|
||||||
sif::debug << "PlocSupervisorHandler: Failed to deserialize GPIO state" << std::endl;
|
sif::debug << "PlocSupervisorHandler: Failed to deserialize GPIO state" << std::endl;
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,8 @@ class PlocSupervisorHandler : public DeviceHandlerBase {
|
|||||||
uint8_t expectedReplies = 1, bool useAlternateId = false,
|
uint8_t expectedReplies = 1, bool useAlternateId = false,
|
||||||
DeviceCommandId_t alternateReplyID = 0) override;
|
DeviceCommandId_t alternateReplyID = 0) override;
|
||||||
size_t getNextReplyLength(DeviceCommandId_t deviceCommand) override;
|
size_t getNextReplyLength(DeviceCommandId_t deviceCommand) override;
|
||||||
virtual ReturnValue_t doSendReadHook() override;
|
ReturnValue_t doSendReadHook() override;
|
||||||
|
void doOffActivity() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::PLOC_SUPERVISOR_HANDLER;
|
static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::PLOC_SUPERVISOR_HANDLER;
|
||||||
@ -86,6 +87,8 @@ class PlocSupervisorHandler : public DeviceHandlerBase {
|
|||||||
static const uint32_t MRAM_DUMP_EXECUTION_TIMEOUT = 60000;
|
static const uint32_t MRAM_DUMP_EXECUTION_TIMEOUT = 60000;
|
||||||
// 70 s
|
// 70 s
|
||||||
static const uint32_t COPY_ADC_TO_MRAM_TIMEOUT = 70000;
|
static const uint32_t COPY_ADC_TO_MRAM_TIMEOUT = 70000;
|
||||||
|
// 60 s
|
||||||
|
static const uint32_t MRAM_DUMP_TIMEOUT = 60000;
|
||||||
// 2 s
|
// 2 s
|
||||||
static const uint32_t BOOT_TIMEOUT = 2000;
|
static const uint32_t BOOT_TIMEOUT = 2000;
|
||||||
enum class StartupState: uint8_t {
|
enum class StartupState: uint8_t {
|
||||||
@ -141,15 +144,13 @@ class PlocSupervisorHandler : public DeviceHandlerBase {
|
|||||||
std::string supervisorFilePath = "ploc/supervisor";
|
std::string supervisorFilePath = "ploc/supervisor";
|
||||||
std::string activeMramFile;
|
std::string activeMramFile;
|
||||||
|
|
||||||
// Setting this variable to true will enable direct downlink of MRAM packets
|
|
||||||
bool downlinkMramDump = false;
|
|
||||||
|
|
||||||
// Supervisor helper class currently executing a command
|
// Supervisor helper class currently executing a command
|
||||||
bool plocSupvHelperExecuting = false;
|
bool plocSupvHelperExecuting = false;
|
||||||
|
|
||||||
Countdown executionTimeout = Countdown(EXECUTION_DEFAULT_TIMEOUT, false);
|
Countdown executionTimeout = Countdown(EXECUTION_DEFAULT_TIMEOUT, false);
|
||||||
// Vorago nees some time to boot properly
|
// Vorago nees some time to boot properly
|
||||||
Countdown bootTimeout = Countdown(BOOT_TIMEOUT);
|
Countdown bootTimeout = Countdown(BOOT_TIMEOUT);
|
||||||
|
Countdown mramDumpTimeout = Countdown(MRAM_DUMP_TIMEOUT);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Adjusts the timeout of the execution report dependent on command
|
* @brief Adjusts the timeout of the execution report dependent on command
|
||||||
@ -280,6 +281,7 @@ class PlocSupervisorHandler : public DeviceHandlerBase {
|
|||||||
void prepareSetGpioCmd(const uint8_t* commandData);
|
void prepareSetGpioCmd(const uint8_t* commandData);
|
||||||
void prepareReadGpioCmd(const uint8_t* commandData);
|
void prepareReadGpioCmd(const uint8_t* commandData);
|
||||||
ReturnValue_t prepareLoggingRequest(const uint8_t* commandData, size_t commandDataLen);
|
ReturnValue_t prepareLoggingRequest(const uint8_t* commandData, size_t commandDataLen);
|
||||||
|
ReturnValue_t prepareEnableNvmsCommand(const uint8_t* commandData);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Copies the content of a space packet to the command buffer.
|
* @brief Copies the content of a space packet to the command buffer.
|
||||||
@ -293,6 +295,8 @@ class PlocSupervisorHandler : public DeviceHandlerBase {
|
|||||||
*/
|
*/
|
||||||
void disableAllReplies();
|
void disableAllReplies();
|
||||||
|
|
||||||
|
void disableReply(DeviceCommandId_t replyId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This function sends a failure report if the active action was commanded by an other
|
* @brief This function sends a failure report if the active action was commanded by an other
|
||||||
* object.
|
* object.
|
||||||
|
2
tmtc
2
tmtc
@ -1 +1 @@
|
|||||||
Subproject commit a4bf730b22125a5e28f9186e13b7d3a419442b82
|
Subproject commit e62484ee80d160de704ec5a69a1f29c64f31b8d6
|
Loading…
Reference in New Issue
Block a user