diff --git a/fsfw b/fsfw index 88e86652..42e74d22 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 88e8665280a0381c41b724ab035a8c3eff1a23c1 +Subproject commit 42e74d22cc1b5d4060ce9923f674bdede0babaac diff --git a/linux/acs/StrComHandler.cpp b/linux/acs/StrComHandler.cpp index 243cb771..2db73f35 100644 --- a/linux/acs/StrComHandler.cpp +++ b/linux/acs/StrComHandler.cpp @@ -54,8 +54,8 @@ ReturnValue_t StrComHandler::performOperation(uint8_t operationCode) { switch (state) { case InternalState::POLL_ONE_REPLY: { // Stopwatch watch; - replyTimeout.setTimeout(400); - replyResult = readOneReply(static_cast(state)); + replyTimeout.setTimeout(200); + readOneReply(static_cast(state)); { MutexGuard mg(lock); replyWasReceived = true; @@ -684,7 +684,7 @@ ReturnValue_t StrComHandler::sendMessage(CookieIF* cookie, const uint8_t* sendDa size_t frameLen; datalinkLayer.encodeFrame(sendData, sendLen, &txFrame, frameLen); if (PACKET_WIRETAPPING) { - sif::debug << "Sendign STR frame" << std::endl; + sif::debug << "Sending STR frame" << std::endl; arrayprinter::print(txFrame, frameLen); } ssize_t bytesWritten = write(serialPort, txFrame, frameLen); @@ -716,13 +716,11 @@ ReturnValue_t StrComHandler::requestReceiveMessage(CookieIF* cookie, size_t requ } ReturnValue_t StrComHandler::readReceivedMessage(CookieIF* cookie, uint8_t** buffer, size_t* size) { - // Consider it a configuration error if the task is not done with a command -> reply cycle - // in time. bool replyWasReceived = false; { MutexGuard mg(lock); if (state != InternalState::SLEEPING) { - return BUSY; + return returnvalue::OK; } replyWasReceived = this->replyWasReceived; } @@ -735,7 +733,7 @@ ReturnValue_t StrComHandler::readReceivedMessage(CookieIF* cookie, uint8_t** buf *size = replyLen; } replyLen = 0; - return replyResult; + return returnvalue::OK; } ReturnValue_t StrComHandler::unlockAndEraseRegions(uint32_t from, uint32_t to) { diff --git a/mission/acs/str/StarTrackerHandler.cpp b/mission/acs/str/StarTrackerHandler.cpp index b9de5996..151410b2 100644 --- a/mission/acs/str/StarTrackerHandler.cpp +++ b/mission/acs/str/StarTrackerHandler.cpp @@ -325,7 +325,7 @@ ReturnValue_t StarTrackerHandler::buildNormalDeviceCommand(DeviceCommandId_t* id ReturnValue_t StarTrackerHandler::buildTransitionDeviceCommand(DeviceCommandId_t* id) { switch (internalState) { case InternalState::BOOT_FIRMWARE: { - if (bootState == FwBootState::WAIT_FOR_EXECUTION or bootState == FwBootState::VERIFY_BOOT) { + if (bootState == FwBootState::VERIFY_BOOT or isAwaitingReply()) { return NOTHING_TO_SEND; } if (bootState == FwBootState::NONE) { @@ -350,75 +350,61 @@ ReturnValue_t StarTrackerHandler::buildTransitionDeviceCommand(DeviceCommandId_t return buildCommandFromCommand(*id, nullptr, 0); } case (FwBootState::SET_TIME): { - bootState = FwBootState::WAIT_FOR_EXECUTION; *id = startracker::SET_TIME_FROM_SYS_TIME; return buildCommandFromCommand(*id, nullptr, 0); } case (FwBootState::LOGLEVEL): { - bootState = FwBootState::WAIT_FOR_EXECUTION; *id = startracker::LOGLEVEL; return buildCommandFromCommand( *id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); } case (FwBootState::LIMITS): { - bootState = FwBootState::WAIT_FOR_EXECUTION; *id = startracker::LIMITS; return buildCommandFromCommand( *id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); } case (FwBootState::TRACKING): { - bootState = FwBootState::WAIT_FOR_EXECUTION; *id = startracker::TRACKING; return buildCommandFromCommand( *id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); } case FwBootState::MOUNTING: - bootState = FwBootState::WAIT_FOR_EXECUTION; *id = startracker::MOUNTING; return buildCommandFromCommand( *id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); case FwBootState::IMAGE_PROCESSOR: - bootState = FwBootState::WAIT_FOR_EXECUTION; *id = startracker::IMAGE_PROCESSOR; return buildCommandFromCommand( *id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); case FwBootState::CAMERA: - bootState = FwBootState::WAIT_FOR_EXECUTION; *id = startracker::CAMERA; return buildCommandFromCommand( *id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); case FwBootState::CENTROIDING: - bootState = FwBootState::WAIT_FOR_EXECUTION; *id = startracker::CENTROIDING; return buildCommandFromCommand( *id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); case FwBootState::LISA: - bootState = FwBootState::WAIT_FOR_EXECUTION; *id = startracker::LISA; return buildCommandFromCommand( *id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); case FwBootState::MATCHING: - bootState = FwBootState::WAIT_FOR_EXECUTION; *id = startracker::MATCHING; return buildCommandFromCommand( *id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); case FwBootState::VALIDATION: - bootState = FwBootState::WAIT_FOR_EXECUTION; *id = startracker::VALIDATION; return buildCommandFromCommand( *id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); case FwBootState::ALGO: - bootState = FwBootState::WAIT_FOR_EXECUTION; *id = startracker::ALGO; return buildCommandFromCommand( *id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); case FwBootState::LOG_SUBSCRIPTION: - bootState = FwBootState::WAIT_FOR_EXECUTION; *id = startracker::LOGSUBSCRIPTION; return buildCommandFromCommand( *id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); case FwBootState::DEBUG_CAMERA: - bootState = FwBootState::WAIT_FOR_EXECUTION; *id = startracker::DEBUG_CAMERA; return buildCommandFromCommand( *id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); @@ -688,7 +674,7 @@ void StarTrackerHandler::fillCommandAndReplyMap() { startracker::MAX_FRAME_SIZE * 2 + 2); this->insertInCommandAndReplyMap(startracker::CAMERA, 3, nullptr, startracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startracker::CENTROIDING, 3, nullptr, + this->insertInCommandAndReplyMap(startracker::CENTROIDING, 2, nullptr, startracker::MAX_FRAME_SIZE * 2 + 2); this->insertInCommandAndReplyMap(startracker::LISA, 3, nullptr, startracker::MAX_FRAME_SIZE * 2 + 2); diff --git a/mission/acs/str/StarTrackerHandler.h b/mission/acs/str/StarTrackerHandler.h index 10397148..34a10746 100644 --- a/mission/acs/str/StarTrackerHandler.h +++ b/mission/acs/str/StarTrackerHandler.h @@ -281,6 +281,7 @@ class StarTrackerHandler : public DeviceHandlerBase { LOG_SUBSCRIPTION, DEBUG_CAMERA, WAIT_FOR_EXECUTION, + RETRY_CFG_CMD }; FwBootState bootState = FwBootState::NONE; diff --git a/mission/pollingSeqTables.cpp b/mission/pollingSeqTables.cpp index e18046d5..758361e3 100644 --- a/mission/pollingSeqTables.cpp +++ b/mission/pollingSeqTables.cpp @@ -341,6 +341,8 @@ ReturnValue_t pst::pstTcsAndAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::STAR_TRACKER, length * config::spiSched::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::STAR_TRACKER, length * config::spiSched::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::PERFORM_OPERATION); thisSequence->addSlot(objects::STAR_TRACKER, length * config::spiSched::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::SEND_WRITE); thisSequence->addSlot(objects::STAR_TRACKER, length * config::spiSched::SCHED_BLOCK_2_PERIOD, diff --git a/mission/system/acs/StrFdir.cpp b/mission/system/acs/StrFdir.cpp index 97a4162a..74284d55 100644 --- a/mission/system/acs/StrFdir.cpp +++ b/mission/system/acs/StrFdir.cpp @@ -3,7 +3,9 @@ #include "mission/acs/defs.h" StrFdir::StrFdir(object_id_t strObject) - : DeviceHandlerFailureIsolation(strObject, objects::NO_OBJECT) {} + : DeviceHandlerFailureIsolation(strObject, objects::NO_OBJECT) { + missedReplyCount.setFailureThreshold(30); +} ReturnValue_t StrFdir::eventReceived(EventMessage* event) { if (event->getEvent() == acs::MEKF_INVALID_MODE_VIOLATION) { diff --git a/tmtc b/tmtc index 62bd5356..26cf1121 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 62bd5356220bab1ce9f3ddaa7aaf75963b8bd596 +Subproject commit 26cf112121782e730057cda0766d435ee2077b6d