From e5fdf23dd7c58946bff124533a99a7ad69bbcfb9 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Thu, 5 May 2022 09:15:05 +0200 Subject: [PATCH 1/7] tmtc update --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index a4bf730b..2e24f764 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit a4bf730b22125a5e28f9186e13b7d3a419442b82 +Subproject commit 2e24f764a65042fda2ea12e2b13cfab49ccc7b55 From 9bd559599979719af51ae4eb21eee6af33df55e3 Mon Sep 17 00:00:00 2001 From: Cleanroom Laptop L15 Date: Thu, 5 May 2022 10:50:23 +0200 Subject: [PATCH 2/7] no time command sent during startup of supervisor --- linux/devices/ploc/PlocSupervisorHandler.cpp | 3 ++- tmtc | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/linux/devices/ploc/PlocSupervisorHandler.cpp b/linux/devices/ploc/PlocSupervisorHandler.cpp index 3ea11f91..b295d3da 100644 --- a/linux/devices/ploc/PlocSupervisorHandler.cpp +++ b/linux/devices/ploc/PlocSupervisorHandler.cpp @@ -147,7 +147,8 @@ void PlocSupervisorHandler::doStartUp() { case StartupState::BOOTING: { if (bootTimeout.hasTimedOut()) { uartIsolatorSwitch.pullHigh(); - startupState = StartupState::SET_TIME; +// startupState = StartupState::SET_TIME; + startupState = StartupState::ON; } } case StartupState::SET_TIME_EXECUTING: diff --git a/tmtc b/tmtc index 2e24f764..2b8fa356 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 2e24f764a65042fda2ea12e2b13cfab49ccc7b55 +Subproject commit 2b8fa356c9f9de5fa4037eb836662f509327138b From 5911ca79b5a92b762df767ddb56064d18fd5029a Mon Sep 17 00:00:00 2001 From: Cleanroom Laptop L15 Date: Thu, 5 May 2022 19:18:39 +0200 Subject: [PATCH 3/7] nvm enable command --- .../PlocSupervisorDefinitions.h | 68 +++++++++++++++---- linux/devices/ploc/PlocSupervisorHandler.cpp | 25 +++++-- linux/devices/ploc/PlocSupervisorHandler.h | 1 + 3 files changed, 75 insertions(+), 19 deletions(-) diff --git a/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h b/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h index cec9fe34..1725f739 100644 --- a/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h +++ b/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h @@ -55,15 +55,16 @@ static const DeviceCommandId_t LOGGING_CLEAR_COUNTERS = 55; static const DeviceCommandId_t LOGGING_SET_TOPIC = 56; static const DeviceCommandId_t REQUEST_ADC_REPORT = 57; static const DeviceCommandId_t RESET_PL = 58; +static const DeviceCommandId_t ENABLE_NVMS = 59; /** Reply IDs */ -static const DeviceCommandId_t ACK_REPORT = 50; -static const DeviceCommandId_t EXE_REPORT = 51; -static const DeviceCommandId_t HK_REPORT = 52; -static const DeviceCommandId_t BOOT_STATUS_REPORT = 53; -static const DeviceCommandId_t LATCHUP_REPORT = 54; -static const DeviceCommandId_t LOGGING_REPORT = 55; -static const DeviceCommandId_t ADC_REPORT = 56; +static const DeviceCommandId_t ACK_REPORT = 100; +static const DeviceCommandId_t EXE_REPORT = 101; +static const DeviceCommandId_t HK_REPORT = 102; +static const DeviceCommandId_t BOOT_STATUS_REPORT = 103; +static const DeviceCommandId_t LATCHUP_REPORT = 104; +static const DeviceCommandId_t LOGGING_REPORT = 105; +static const DeviceCommandId_t ADC_REPORT = 106; // Size of complete space packet (6 byte header + size of data + 2 byte CRC) 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_COPY_ADC_DATA_TO_MRAM = 0xDA; 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_WIPE_MRAM = 0xF3; 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(&crc, &crcPos, &serializedSize, sizeof(crc), + SerializeIF::Endianness::BIG); + } +}; + /** * @brief This class generates the space packet to update the time of the PLOC supervisor. */ @@ -1664,13 +1710,7 @@ class BootStatusReport : public StaticLocalDataSet { */ class HkSet : public StaticLocalDataSet { 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) {} diff --git a/linux/devices/ploc/PlocSupervisorHandler.cpp b/linux/devices/ploc/PlocSupervisorHandler.cpp index b295d3da..f84b7276 100644 --- a/linux/devices/ploc/PlocSupervisorHandler.cpp +++ b/linux/devices/ploc/PlocSupervisorHandler.cpp @@ -147,7 +147,7 @@ void PlocSupervisorHandler::doStartUp() { case StartupState::BOOTING: { if (bootTimeout.hasTimedOut()) { uartIsolatorSwitch.pullHigh(); -// startupState = StartupState::SET_TIME; + // startupState = StartupState::SET_TIME; startupState = StartupState::ON; } } @@ -377,6 +377,10 @@ ReturnValue_t PlocSupervisorHandler::buildCommandFromCommand(DeviceCommandId_t d result = RETURN_OK; break; } + case ENABLE_NVMS: { + result = prepareEnableNvmsCommand(commandData); + break; + } default: sif::debug << "PlocSupervisorHandler::buildCommandFromCommand: Command not implemented" << std::endl; @@ -432,6 +436,7 @@ void PlocSupervisorHandler::fillCommandAndReplyMap() { this->insertInCommandMap(LOGGING_CLEAR_COUNTERS); this->insertInCommandMap(LOGGING_SET_TOPIC); this->insertInCommandMap(RESET_PL); + this->insertInCommandMap(ENABLE_NVMS); this->insertInCommandAndReplyMap(FIRST_MRAM_DUMP, 3); this->insertInCommandAndReplyMap(CONSECUTIVE_MRAM_DUMP, 3); this->insertInReplyMap(ACK_REPORT, 3, nullptr, SIZE_ACK_REPORT); @@ -552,6 +557,7 @@ ReturnValue_t PlocSupervisorHandler::enableReplyInReplyMap(DeviceCommandMap::ite case LOGGING_CLEAR_COUNTERS: case LOGGING_SET_TOPIC: case RESET_PL: + case ENABLE_NVMS: enabledReplies = 2; break; default: @@ -878,7 +884,7 @@ ReturnValue_t PlocSupervisorHandler::handleAckReport(const uint8_t* data) { case SupvReturnValuesIF::RECEIVED_ACK_FAILURE: { #if OBSW_DEBUG_PLOC_SUPERVISOR == 1 sif::debug << "PlocSupervisorHandler: Received Ack failure report with status code: 0x" - << std::hex << ack.getStatusCode() << std::endl; + << std::hex << ack.getStatusCode() << std::endl; #endif /* OBSW_DEBUG_PLOC_SUPERVISOR == 1 */ DeviceCommandId_t commandId = getPendingCommand(); if (commandId != DeviceHandlerIF::NO_COMMAND_ID) { @@ -1176,7 +1182,7 @@ ReturnValue_t PlocSupervisorHandler::handleLoggingReport(const uint8_t* data) { if (result == SupvReturnValuesIF::CRC_FAILURE) { sif::warning << "PlocSupervisorHandler::handleLoggingReport: Logging report has " - << "invalid crc" << std::endl; + << "invalid crc" << std::endl; return result; } @@ -1533,6 +1539,15 @@ ReturnValue_t PlocSupervisorHandler::prepareLoggingRequest(const uint8_t* comman 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() { DeviceReplyMap::iterator iter; @@ -1872,8 +1887,8 @@ void PlocSupervisorHandler::handleExecutionSuccessReport(const uint8_t* data) { } uint8_t data[sizeof(gpioState)]; size_t size = 0; - ReturnValue_t result = SerializeAdapter::serialize( - &gpioState, data, &size, sizeof(gpioState), SerializeIF::Endianness::BIG); + ReturnValue_t result = SerializeAdapter::serialize(&gpioState, data, &size, sizeof(gpioState), + SerializeIF::Endianness::BIG); if (result != RETURN_OK) { sif::debug << "PlocSupervisorHandler: Failed to deserialize GPIO state" << std::endl; } diff --git a/linux/devices/ploc/PlocSupervisorHandler.h b/linux/devices/ploc/PlocSupervisorHandler.h index 625e2810..060e02b0 100644 --- a/linux/devices/ploc/PlocSupervisorHandler.h +++ b/linux/devices/ploc/PlocSupervisorHandler.h @@ -280,6 +280,7 @@ class PlocSupervisorHandler : public DeviceHandlerBase { void prepareSetGpioCmd(const uint8_t* commandData); void prepareReadGpioCmd(const uint8_t* commandData); 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. From fabd81365b516f3a91556015c2a4e8a58638ca05 Mon Sep 17 00:00:00 2001 From: Cleanroom Laptop L15 Date: Thu, 5 May 2022 19:20:14 +0200 Subject: [PATCH 4/7] supervisor do startup set time --- linux/devices/ploc/PlocSupervisorHandler.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/linux/devices/ploc/PlocSupervisorHandler.cpp b/linux/devices/ploc/PlocSupervisorHandler.cpp index f84b7276..a0a79257 100644 --- a/linux/devices/ploc/PlocSupervisorHandler.cpp +++ b/linux/devices/ploc/PlocSupervisorHandler.cpp @@ -147,8 +147,7 @@ void PlocSupervisorHandler::doStartUp() { case StartupState::BOOTING: { if (bootTimeout.hasTimedOut()) { uartIsolatorSwitch.pullHigh(); - // startupState = StartupState::SET_TIME; - startupState = StartupState::ON; + startupState = StartupState::SET_TIME; } } case StartupState::SET_TIME_EXECUTING: From 5c7c5b468af389817e718f5ffa1e388edf5679a8 Mon Sep 17 00:00:00 2001 From: Cleanroom Laptop L15 Date: Thu, 5 May 2022 19:21:42 +0200 Subject: [PATCH 5/7] tmtc update --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index 2b8fa356..50a20cfd 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 2b8fa356c9f9de5fa4037eb836662f509327138b +Subproject commit 50a20cfdc27734305e3687b58546ff76b4411ee3 From 132751893b305f87e2672ad2493426673a75c141 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Fri, 6 May 2022 19:30:20 +0200 Subject: [PATCH 6/7] bugfix in missed reply hanling of supervsior MRAM dump --- bsp_te0720_1cfa/ObjectFactory.cpp | 5 +- fsfw | 2 +- linux/devices/ploc/PlocMemoryDumper.cpp | 5 +- linux/devices/ploc/PlocSupervisorHandler.cpp | 83 ++++++++++++-------- linux/devices/ploc/PlocSupervisorHandler.h | 11 ++- tmtc | 2 +- 6 files changed, 66 insertions(+), 42 deletions(-) diff --git a/bsp_te0720_1cfa/ObjectFactory.cpp b/bsp_te0720_1cfa/ObjectFactory.cpp index c09b818e..9fe7f3b0 100644 --- a/bsp_te0720_1cfa/ObjectFactory.cpp +++ b/bsp_te0720_1cfa/ObjectFactory.cpp @@ -46,7 +46,7 @@ void ObjectFactory::produce(void* args) { Factory::setStaticFrameworkObjectIds(); ObjectFactory::produceGenericObjects(); -new UartComIF(objects::UART_COM_IF); + new UartComIF(objects::UART_COM_IF); #if OBSW_ADD_PLOC_MPSOC == 1 UartCookie* mpsocUartCookie = new UartCookie(objects::PLOC_MPSOC_HANDLER, te0720_1cfa::MPSOC_UART, @@ -67,10 +67,9 @@ new UartComIF(objects::UART_COM_IF); supervisorCookie->setNoFixedSizeReply(); auto supvGpioIF = new DummyGpioIF(); 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), pcdu::PDU1_CH6_PLOC_12V, supvHelper); - plocSupervisor->setStartUpImmediately(); new PlocMemoryDumper(objects::PLOC_MEMORY_DUMPER); #endif diff --git a/fsfw b/fsfw index 789668ae..19bd26d9 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 789668ae50a26cda299cfd125011f9fb345824d9 +Subproject commit 19bd26d9983d97c8daf010649e9142afac7e2650 diff --git a/linux/devices/ploc/PlocMemoryDumper.cpp b/linux/devices/ploc/PlocMemoryDumper.cpp index a771e0fe..568c6152 100644 --- a/linux/devices/ploc/PlocMemoryDumper.cpp +++ b/linux/devices/ploc/PlocMemoryDumper.cpp @@ -121,7 +121,10 @@ void PlocMemoryDumper::doStateMachine() { void PlocMemoryDumper::stepSuccessfulReceived(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) {} diff --git a/linux/devices/ploc/PlocSupervisorHandler.cpp b/linux/devices/ploc/PlocSupervisorHandler.cpp index a0a79257..2f76233a 100644 --- a/linux/devices/ploc/PlocSupervisorHandler.cpp +++ b/linux/devices/ploc/PlocSupervisorHandler.cpp @@ -137,7 +137,6 @@ ReturnValue_t PlocSupervisorHandler::executeAction(ActionId_t actionId, } void PlocSupervisorHandler::doStartUp() { -#ifdef XIPHOS_Q7S switch (startupState) { case StartupState::OFF: { bootTimeout.resetTimer(); @@ -159,9 +158,6 @@ void PlocSupervisorHandler::doStartUp() { default: break; } -#else - setMode(_MODE_TO_ON); -#endif } void PlocSupervisorHandler::doShutDown() { @@ -178,7 +174,7 @@ ReturnValue_t PlocSupervisorHandler::buildTransitionDeviceCommand(DeviceCommandI if (startupState == StartupState::SET_TIME) { *id = supv::SET_TIME_REF; startupState = StartupState::SET_TIME_EXECUTING; - return RETURN_OK; + return buildCommandFromCommand(*id, nullptr, 0); } return NOTHING_TO_SEND; } @@ -436,8 +432,10 @@ void PlocSupervisorHandler::fillCommandAndReplyMap() { this->insertInCommandMap(LOGGING_SET_TOPIC); this->insertInCommandMap(RESET_PL); this->insertInCommandMap(ENABLE_NVMS); - this->insertInCommandAndReplyMap(FIRST_MRAM_DUMP, 3); - 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(EXE_REPORT, 0, nullptr, SIZE_EXE_REPORT, false, &executionTimeout); this->insertInReplyMap(HK_REPORT, 3, &hkset, SIZE_HK_REPORT); @@ -1316,6 +1314,10 @@ ReturnValue_t PlocSupervisorHandler::doSendReadHook() { return RETURN_OK; } +void PlocSupervisorHandler::doOffActivity() { + startupState = StartupState::OFF; +} + void PlocSupervisorHandler::handleDeviceTM(const uint8_t* data, size_t dataSize, DeviceCommandId_t replyId) { ReturnValue_t result = RETURN_OK; @@ -1548,10 +1550,11 @@ ReturnValue_t PlocSupervisorHandler::prepareEnableNvmsCommand(const uint8_t* com } void PlocSupervisorHandler::disableAllReplies() { + using namespace supv; DeviceReplyMap::iterator iter; /* Disable ack reply */ - iter = deviceReplyMap.find(supv::ACK_REPORT); + iter = deviceReplyMap.find(ACK_REPORT); DeviceReplyInfo* info = &(iter->second); info->delayCycles = 0; info->command = deviceCommandMap.end(); @@ -1560,21 +1563,29 @@ void PlocSupervisorHandler::disableAllReplies() { /* If the command expects a telemetry packet the appropriate tm reply will be disabled here */ switch (commandId) { - case supv::GET_HK_REPORT: { - iter = deviceReplyMap.find(supv::GET_HK_REPORT); - info = &(iter->second); - info->delayCycles = 0; - info->active = false; - info->command = deviceCommandMap.end(); + case GET_HK_REPORT: { + disableReply(GET_HK_REPORT); break; } - case supv::FIRST_MRAM_DUMP: - case supv::CONSECUTIVE_MRAM_DUMP: { - iter = deviceReplyMap.find(commandId); - info = &(iter->second); - info->delayCycles = 0; - info->active = false; - info->command = deviceCommandMap.end(); + case FIRST_MRAM_DUMP: + case CONSECUTIVE_MRAM_DUMP: { + disableReply(commandId); + break; + } + case REQUEST_ADC_REPORT: { + 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; } default: { @@ -1586,6 +1597,14 @@ void PlocSupervisorHandler::disableAllReplies() { 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) { DeviceReplyIter iter = deviceReplyMap.find(replyId); @@ -1663,9 +1682,13 @@ ReturnValue_t PlocSupervisorHandler::handleMramDumpPacket(DeviceCommandId_t id) sif::warning << "PlocSupervisorHandler::handleMramDumpPacket: CRC failure" << std::endl; return result; } - handleMramDumpFile(id); - if (downlinkMramDump == true) { - handleDeviceTM(spacePacketBuffer + supv::SPACE_PACKET_HEADER_LENGTH, packetLen - 1, id); + result = handleMramDumpFile(id); + if (result != RETURN_OK) { + DeviceCommandMap::iterator iter = deviceCommandMap.find(id); + actionHelper.finish(false, iter->second.sendReplyTo, id, result); + disableAllReplies(); + nextReplyId = supv::NONE; + return result; } packetInBuffer = false; receivedMramDumpPackets++; @@ -1714,23 +1737,19 @@ void PlocSupervisorHandler::increaseExpectedMramReplies(DeviceCommandId_t id) { (sequenceFlags != static_cast(supv::SequenceFlags::STANDALONE_PKT))) { // Command expects at least one MRAM packet more and the execution report info->expectedReplies = 2; - // Wait maximum of 2 cycles for next MRAM packet - mramReplyInfo->delayCycles = 2; - // Also adapting delay cycles for execution report - exeReplyInfo->delayCycles = 3; + mramReplyInfo->countdown->resetTimer(); } else { // Command expects the execution report info->expectedReplies = 1; - mramReplyInfo->delayCycles = 0; + mramReplyInfo->active = false; } + exeReplyInfo->countdown->resetTimer(); return; } ReturnValue_t PlocSupervisorHandler::checkMramPacketApid() { uint16_t apid = (spacePacketBuffer[0] << 8 | spacePacketBuffer[1]) & supv::APID_MASK; if (apid != supv::APID_MRAM_DUMP_TM) { - sif::warning << "PlocSupervisorHandler::checkMramPacketApid: 0x" << std::hex << apid - << std::endl; return SupvReturnValuesIF::NO_MRAM_PACKET; } return APERIODIC_REPLY; @@ -1803,7 +1822,7 @@ ReturnValue_t PlocSupervisorHandler::getTimeStampString(std::string& timeStamp) Clock::TimeOfDay_t time; ReturnValue_t result = Clock::getDateAndTime(&time); if (result != RETURN_OK) { - sif::warning << "PlocSupervisorHandler::createMramDumpFile: Failed to get current time" + sif::warning << "PlocSupervisorHandler::getTimeStampString: Failed to get current time" << std::endl; return SupvReturnValuesIF::GET_TIME_FAILURE; } diff --git a/linux/devices/ploc/PlocSupervisorHandler.h b/linux/devices/ploc/PlocSupervisorHandler.h index 060e02b0..2ee3e6e8 100644 --- a/linux/devices/ploc/PlocSupervisorHandler.h +++ b/linux/devices/ploc/PlocSupervisorHandler.h @@ -56,7 +56,8 @@ class PlocSupervisorHandler : public DeviceHandlerBase { uint8_t expectedReplies = 1, bool useAlternateId = false, DeviceCommandId_t alternateReplyID = 0) override; size_t getNextReplyLength(DeviceCommandId_t deviceCommand) override; - virtual ReturnValue_t doSendReadHook() override; + ReturnValue_t doSendReadHook() override; + void doOffActivity() override; private: 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 = 30000; // 70 s static const uint32_t COPY_ADC_TO_MRAM_TIMEOUT = 70000; + // 60 s + static const uint32_t MRAM_DUMP_TIMEOUT = 60000; // 2 s static const uint32_t BOOT_TIMEOUT = 2000; enum class StartupState: uint8_t { @@ -141,15 +144,13 @@ class PlocSupervisorHandler : public DeviceHandlerBase { std::string supervisorFilePath = "ploc/supervisor"; 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 bool plocSupvHelperExecuting = false; Countdown executionTimeout = Countdown(EXECUTION_DEFAULT_TIMEOUT, false); // Vorago nees some time to boot properly Countdown bootTimeout = Countdown(BOOT_TIMEOUT); + Countdown mramDumpTimeout = Countdown(MRAM_DUMP_TIMEOUT); /** * @brief Adjusts the timeout of the execution report dependent on command @@ -294,6 +295,8 @@ class PlocSupervisorHandler : public DeviceHandlerBase { */ void disableAllReplies(); + void disableReply(DeviceCommandId_t replyId); + /** * @brief This function sends a failure report if the active action was commanded by an other * object. diff --git a/tmtc b/tmtc index 50a20cfd..2e24f764 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 50a20cfdc27734305e3687b58546ff76b4411ee3 +Subproject commit 2e24f764a65042fda2ea12e2b13cfab49ccc7b55 From cbb3c92885ba91d7439a596bc18ad3ea2561e5df Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Fri, 6 May 2022 19:31:09 +0200 Subject: [PATCH 7/7] tmtc update --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index 2e24f764..e62484ee 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 2e24f764a65042fda2ea12e2b13cfab49ccc7b55 +Subproject commit e62484ee80d160de704ec5a69a1f29c64f31b8d6