diff --git a/bsp_q7s/callbacks/pcduSwitchCb.cpp b/bsp_q7s/callbacks/pcduSwitchCb.cpp index ec5f4dc5..f9b6c761 100644 --- a/bsp_q7s/callbacks/pcduSwitchCb.cpp +++ b/bsp_q7s/callbacks/pcduSwitchCb.cpp @@ -10,8 +10,8 @@ void pcdu::switchCallback(GOMSPACE::Pdu pdu, uint8_t channel, bool state, void* return; } if (pdu == GOMSPACE::Pdu::PDU1) { - PDU1::SwitchChannels typedChannel = static_cast(channel); - if (typedChannel == PDU1::SwitchChannels::ACS_A_SIDE) { + PDU1::Channels typedChannel = static_cast(channel); + if (typedChannel == PDU1::Channels::ACS_A_SIDE) { if (state) { gpioComIF->pullHigh(gpioIds::GNSS_0_NRESET); } else { @@ -20,8 +20,8 @@ void pcdu::switchCallback(GOMSPACE::Pdu pdu, uint8_t channel, bool state, void* } } else if (pdu == GOMSPACE::Pdu::PDU2) { - PDU2::SwitchChannels typedChannel = static_cast(channel); - if (typedChannel == PDU2::SwitchChannels::ACS_B_SIDE) { + PDU2::Channels typedChannel = static_cast(channel); + if (typedChannel == PDU2::Channels::ACS_B_SIDE) { if (state) { gpioComIF->pullHigh(gpioIds::GNSS_1_NRESET); } else { diff --git a/bsp_q7s/core/CoreController.cpp b/bsp_q7s/core/CoreController.cpp index b0b7213c..42ba4307 100644 --- a/bsp_q7s/core/CoreController.cpp +++ b/bsp_q7s/core/CoreController.cpp @@ -1,6 +1,7 @@ #include "CoreController.h" #include +#include #include "OBSWConfig.h" #include "OBSWVersion.h" @@ -16,11 +17,13 @@ #include #include +#include #include #include "bsp_q7s/memory/SdCardManager.h" #include "bsp_q7s/memory/scratchApi.h" #include "bsp_q7s/xadc/Xadc.h" +#include "linux/utility/utility.h" xsc::Chip CoreController::CURRENT_CHIP = xsc::Chip::NO_CHIP; xsc::Copy CoreController::CURRENT_COPY = xsc::Copy::NO_COPY; @@ -50,6 +53,7 @@ CoreController::CoreController(object_id_t objectId) } catch (const std::filesystem::filesystem_error &e) { sif::error << "CoreController::CoreController: Failed with exception " << e.what() << std::endl; } + eventQueue = QueueFactory::instance()->createMessageQueue(5, EventMessage::MAX_MESSAGE_SIZE); } ReturnValue_t CoreController::handleCommandMessage(CommandMessage *message) { @@ -57,6 +61,16 @@ ReturnValue_t CoreController::handleCommandMessage(CommandMessage *message) { } void CoreController::performControlOperation() { + EventMessage event; + for (ReturnValue_t result = eventQueue->receiveMessage(&event); result == RETURN_OK; + result = eventQueue->receiveMessage(&event)) { + switch (event.getEvent()) { + case (GpsHyperion::GPS_FIX_CHANGE): { + gpsFix = static_cast(event.getParameter2()); + break; + } + } + } performWatchdogControlOperation(); sdStateMachine(); performMountedSdCardOperations(); @@ -79,8 +93,10 @@ LocalPoolDataSetBase *CoreController::getDataSetHandle(sid_t sid) { } ReturnValue_t CoreController::initialize() { - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; - + ReturnValue_t result = ExtendedControllerBase::initialize(); + if (result != HasReturnvaluesIF::RETURN_OK) { + sif::warning << "CoreController::initialize: Base init failed" << std::endl; + } result = scratch::writeNumber(scratch::ALLOC_FAILURE_COUNT, 0); if (result != HasReturnvaluesIF::RETURN_OK) { sif::warning << "CoreController::initialize: Setting up alloc failure " @@ -91,7 +107,23 @@ ReturnValue_t CoreController::initialize() { sdStateMachine(); triggerEvent(REBOOT_SW, CURRENT_CHIP, CURRENT_COPY); - return ExtendedControllerBase::initialize(); + EventManagerIF *eventManager = + ObjectManager::instance()->get(objects::EVENT_MANAGER); + if (eventManager == nullptr or eventQueue == nullptr) { + sif::warning << "CoreController::initialize: No valid event manager found or " + "queue invalid" + << std::endl; + } + result = eventManager->registerListener(eventQueue->getId()); + if (result != HasReturnvaluesIF::RETURN_OK) { + sif::warning << "CoreController::initialize: Registering as event listener failed" << std::endl; + } + result = eventManager->subscribeToEvent(eventQueue->getId(), + event::getEventId(GpsHyperion::GPS_FIX_CHANGE)); + if (result != HasReturnvaluesIF::RETURN_OK) { + sif::warning << "Subscribing for GPS GPS_FIX_CHANGE event failed" << std::endl; + } + return RETURN_OK; } ReturnValue_t CoreController::initializeAfterTaskCreation() { @@ -639,8 +671,7 @@ ReturnValue_t CoreController::initVersionFile() { fsfw::FSFW_VERSION.getVersion(versionString, sizeof(versionString)); std::string fullFsfwVersionString = "FSFW: v" + std::string(versionString); std::string systemString = "System: " + unameLine; - std::string mountPrefix = SdCardManager::instance()->getCurrentMountPrefix(); - std::string versionFilePath = mountPrefix + VERSION_FILE; + std::string versionFilePath = currMntPrefix + VERSION_FILE; std::fstream versionFile; if (not std::filesystem::exists(versionFilePath)) { @@ -1198,24 +1229,27 @@ void CoreController::performWatchdogControlOperation() { } void CoreController::performMountedSdCardOperations() { + currMntPrefix = sdcMan->getCurrentMountPrefix(); if (doPerformMountedSdCardOps) { bool sdCardMounted = false; sdCardMounted = sdcMan->isSdCardMounted(sdInfo.pref); if (sdCardMounted) { - std::string path = sdcMan->getCurrentMountPrefix(sdInfo.pref) + "/" + CONF_FOLDER; + std::string path = currMntPrefix + "/" + CONF_FOLDER; if (not std::filesystem::exists(path)) { std::filesystem::create_directory(path); } initVersionFile(); + initClockFromTimeFile(); performRebootFileHandling(false); doPerformMountedSdCardOps = false; } } + timeFileHandler(); } void CoreController::performRebootFileHandling(bool recreateFile) { using namespace std; - std::string path = sdcMan->getCurrentMountPrefix(sdInfo.pref) + REBOOT_FILE; + std::string path = currMntPrefix + REBOOT_FILE; if (not std::filesystem::exists(path) or recreateFile) { #if OBSW_VERBOSE_LEVEL >= 1 sif::info << "CoreController::performRebootFileHandling: Recreating reboot file" << std::endl; @@ -1594,7 +1628,7 @@ bool CoreController::parseRebootFile(std::string path, RebootFile &rf) { } void CoreController::resetRebootCount(xsc::Chip tgtChip, xsc::Copy tgtCopy) { - std::string path = sdcMan->getCurrentMountPrefix(sdInfo.pref) + REBOOT_FILE; + std::string path = currMntPrefix + REBOOT_FILE; // Disable the reboot file mechanism parseRebootFile(path, rebootFile); if (tgtChip == xsc::ALL_CHIP and tgtCopy == xsc::ALL_COPY) { @@ -1621,7 +1655,7 @@ void CoreController::resetRebootCount(xsc::Chip tgtChip, xsc::Copy tgtCopy) { } void CoreController::rewriteRebootFile(RebootFile file) { - std::string path = sdcMan->getCurrentMountPrefix(sdInfo.pref) + REBOOT_FILE; + std::string path = currMntPrefix + REBOOT_FILE; std::ofstream rebootFile(path); if (rebootFile.is_open()) { // Initiate reboot file first. Reboot handling will be on on initialization @@ -1657,6 +1691,57 @@ void CoreController::setRebootMechanismLock(bool lock, xsc::Chip tgtChip, xsc::C rewriteRebootFile(rebootFile); } +ReturnValue_t CoreController::timeFileHandler() { + if (gpsFix == GpsHyperion::FixMode::FIX_2D or gpsFix == GpsHyperion::FixMode::FIX_3D) { + // It is assumed that the system time is set from the GPS time + timeval currentTime = {}; + ReturnValue_t result = Clock::getClock_timeval(¤tTime); + if (result != HasReturnvaluesIF::RETURN_OK) { + return result; + } + std::ofstream timeFile(currMntPrefix + TIME_FILE); + timeFile << "UNIX SECONDS: " << currentTime.tv_sec << std::endl; + } + return RETURN_OK; +} + +ReturnValue_t CoreController::initClockFromTimeFile() { + using namespace GpsHyperion; + using namespace std; + std::string fileName = currMntPrefix + TIME_FILE; + if (std::filesystem::exists(fileName) and + ((gpsFix == FixMode::UNKNOWN or gpsFix == FixMode::NOT_SEEN) or + not utility::timeSanityCheck())) { + ifstream timeFile(fileName); + string nextWord; + getline(timeFile, nextWord); + istringstream iss(nextWord); + iss >> nextWord; + if (iss.bad() or nextWord != "UNIX") { + return RETURN_FAILED; + } + iss >> nextWord; + if (iss.bad() or nextWord != "SECONDS:") { + return RETURN_FAILED; + } + iss >> nextWord; + timeval currentTime = {}; + char *checkPtr; + currentTime.tv_sec = strtol(nextWord.c_str(), &checkPtr, 10); + if (iss.bad() or *checkPtr) { + return RETURN_FAILED; + } +#if OBSW_VERBOSE_LEVEL >= 1 + time_t timeRaw = currentTime.tv_sec; + std::tm *time = std::gmtime(&timeRaw); + sif::info << "Setting system time from time files: " << std::put_time(time, "%c %Z") + << std::endl; +#endif + return Clock::setClock(¤tTime); + } + return RETURN_OK; +} + void CoreController::readHkData() { ReturnValue_t result = RETURN_OK; result = hkSet.read(TIMEOUT_TYPE, MUTEX_TIMEOUT); @@ -1690,3 +1775,8 @@ void CoreController::readHkData() { return; } } + +bool CoreController::isNumber(const std::string &s) { + return !s.empty() && std::find_if(s.begin(), s.end(), + [](unsigned char c) { return !std::isdigit(c); }) == s.end(); +} diff --git a/bsp_q7s/core/CoreController.h b/bsp_q7s/core/CoreController.h index e31378ef..b5e4e511 100644 --- a/bsp_q7s/core/CoreController.h +++ b/bsp_q7s/core/CoreController.h @@ -10,6 +10,7 @@ #include "bsp_q7s/memory/SdCardManager.h" #include "events/subsystemIdRanges.h" #include "fsfw/controller/ExtendedControllerBase.h" +#include "mission/devices/devicedefinitions/GPSDefinitions.h" class Timer; class SdCardManager; @@ -53,10 +54,12 @@ class CoreController : public ExtendedControllerBase { static constexpr char CONF_FOLDER[] = "conf"; static constexpr char VERSION_FILE_NAME[] = "version.txt"; static constexpr char REBOOT_FILE_NAME[] = "reboot.txt"; + static constexpr char TIME_FILE_NAME[] = "time.txt"; const std::string VERSION_FILE = "/" + std::string(CONF_FOLDER) + "/" + std::string(VERSION_FILE_NAME); const std::string REBOOT_FILE = "/" + std::string(CONF_FOLDER) + "/" + std::string(REBOOT_FILE_NAME); + const std::string TIME_FILE = "/" + std::string(CONF_FOLDER) + "/" + std::string(TIME_FILE_NAME); static constexpr ActionId_t LIST_DIRECTORY_INTO_FILE = 0; static constexpr ActionId_t SWITCH_REBOOT_FILE_HANDLING = 5; @@ -126,6 +129,7 @@ class CoreController : public ExtendedControllerBase { // Designated value for rechecking FIFO open static constexpr int RETRY_FIFO_OPEN = -2; int watchdogFifoFd = 0; + GpsHyperion::FixMode gpsFix = GpsHyperion::FixMode::UNKNOWN; // States for SD state machine, which is used in non-blocking mode enum class SdStates { @@ -151,6 +155,7 @@ class CoreController : public ExtendedControllerBase { static constexpr bool BLOCKING_SD_INIT = false; SdCardManager* sdcMan = nullptr; + MessageQueueIF* eventQueue = nullptr; struct SdInfo { sd::SdCard pref = sd::SdCard::NONE; @@ -173,6 +178,7 @@ class CoreController : public ExtendedControllerBase { sd::SdState commandedState = sd::SdState::OFF; } sdInfo; RebootFile rebootFile = {}; + std::string currMntPrefix; bool doPerformMountedSdCardOps = true; /** @@ -192,6 +198,9 @@ class CoreController : public ExtendedControllerBase { ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode, uint32_t* msToReachTheMode); void performMountedSdCardOperations(); ReturnValue_t initVersionFile(); + + ReturnValue_t initClockFromTimeFile(); + ReturnValue_t timeFileHandler(); ReturnValue_t initBootCopy(); ReturnValue_t initWatchdogFifo(); ReturnValue_t initSdCardBlocking(); @@ -226,6 +235,7 @@ class CoreController : public ExtendedControllerBase { bool parseRebootFile(std::string path, RebootFile& file); void rewriteRebootFile(RebootFile file); void readHkData(); + bool isNumber(const std::string& s); }; #endif /* BSP_Q7S_CORE_CORECONTROLLER_H_ */ diff --git a/bsp_q7s/core/InitMission.cpp b/bsp_q7s/core/InitMission.cpp index 52a3495d..bf7d2afb 100644 --- a/bsp_q7s/core/InitMission.cpp +++ b/bsp_q7s/core/InitMission.cpp @@ -169,7 +169,7 @@ void initmission::initTasks() { #if OBSW_ADD_PLOC_SUPERVISOR == 1 PeriodicTaskIF* supvHelperTask = factory->createPeriodicTask( - "PLOC_SUPV_HELPER", 20, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc); + "PLOC_SUPV_HELPER", 10, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.3, missedDeadlineFunc); result = supvHelperTask->addComponent(objects::PLOC_SUPERVISOR_HELPER); if (result != HasReturnvaluesIF::RETURN_OK) { initmission::printAddObjectError("PLOC_SUPV_HELPER", objects::PLOC_SUPERVISOR_HELPER); @@ -239,7 +239,9 @@ void initmission::initTasks() { acsTask->startTask(); #endif sysTask->startTask(); +#if OBSW_ADD_PLOC_SUPERVISOR == 1 supvHelperTask->startTask(); +#endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */ sif::info << "Tasks started.." << std::endl; } diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 8bd2f8d0..93b70859 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -160,7 +160,9 @@ void ObjectFactory::produce(void* args) { #if OBSW_ADD_MGT == 1 I2cCookie* imtqI2cCookie = new I2cCookie(addresses::IMTQ, IMTQ::MAX_REPLY_SIZE, q7s::I2C_DEFAULT_DEV); - auto imtqHandler = new IMTQHandler(objects::IMTQ_HANDLER, objects::I2C_COM_IF, imtqI2cCookie); + auto imtqHandler = new IMTQHandler(objects::IMTQ_HANDLER, objects::I2C_COM_IF, imtqI2cCookie, + pcdu::Switches::PDU1_CH3_MGT_5V); + imtqHandler->setPowerSwitcher(pwrSwitcher); static_cast(imtqHandler); #if OBSW_DEBUG_IMTQ == 1 imtqHandler->setStartUpImmediately(); @@ -187,12 +189,14 @@ void ObjectFactory::produce(void* args) { #if OBSW_ADD_STAR_TRACKER == 1 UartCookie* starTrackerCookie = - new UartCookie(objects::STAR_TRACKER, q7s::UART_STAR_TRACKER_DEV, UartModes::NON_CANONICAL, - uart::STAR_TRACKER_BAUD, startracker::MAX_FRAME_SIZE * 2 + 2); + new UartCookie(objects::STAR_TRACKER, q7s::UART_STAR_TRACKER_DEV, uart::STAR_TRACKER_BAUD, + startracker::MAX_FRAME_SIZE * 2 + 2, UartModes::NON_CANONICAL); starTrackerCookie->setNoFixedSizeReply(); StrHelper* strHelper = new StrHelper(objects::STR_HELPER); - new StarTrackerHandler(objects::STAR_TRACKER, objects::UART_COM_IF, starTrackerCookie, strHelper, - pcduSwitches::PDU1_CH2_STAR_TRACKER_5V); + auto starTracker = + new StarTrackerHandler(objects::STAR_TRACKER, objects::UART_COM_IF, starTrackerCookie, + strHelper, pcdu::PDU1_CH2_STAR_TRACKER_5V); + starTracker->setPowerSwitcher(pwrSwitcher); #endif /* OBSW_ADD_STAR_TRACKER == 1 */ @@ -600,7 +604,7 @@ void ObjectFactory::createHeaterComponents() { heaterGpiosCookie->addGpio(gpioIds::HEATER_7, gpio); new HeaterHandler(objects::HEATER_HANDLER, objects::GPIO_IF, heaterGpiosCookie, - objects::PCDU_HANDLER, pcduSwitches::Switches::PDU2_CH3_TCS_BOARD_HEATER_IN_8V); + objects::PCDU_HANDLER, pcdu::Switches::PDU2_CH3_TCS_BOARD_HEATER_IN_8V); } void ObjectFactory::createSolarArrayDeploymentComponents() { @@ -620,18 +624,19 @@ void ObjectFactory::createSolarArrayDeploymentComponents() { // TODO: Find out burn time. For now set to 1000 ms. new SolarArrayDeploymentHandler(objects::SOLAR_ARRAY_DEPL_HANDLER, objects::GPIO_IF, solarArrayDeplCookie, objects::PCDU_HANDLER, - pcduSwitches::Switches::PDU2_CH5_DEPLOYMENT_MECHANISM_8V, + pcdu::Switches::PDU2_CH5_DEPLOYMENT_MECHANISM_8V, gpioIds::DEPLSA1, gpioIds::DEPLSA2, 1000); } -void ObjectFactory::createSyrlinksComponents() { +void ObjectFactory::createSyrlinksComponents(PowerSwitchIF* pwrSwitcher) { UartCookie* syrlinksUartCookie = - new UartCookie(objects::SYRLINKS_HK_HANDLER, q7s::UART_SYRLINKS_DEV, UartModes::NON_CANONICAL, - uart::SYRLINKS_BAUD, syrlinks::MAX_REPLY_SIZE); + new UartCookie(objects::SYRLINKS_HK_HANDLER, q7s::UART_SYRLINKS_DEV, uart::SYRLINKS_BAUD, + syrlinks::MAX_REPLY_SIZE, UartModes::NON_CANONICAL); syrlinksUartCookie->setParityEven(); - new SyrlinksHkHandler(objects::SYRLINKS_HK_HANDLER, objects::UART_COM_IF, syrlinksUartCookie, - pcduSwitches::PDU1_CH1_SYRLINKS_12V); + auto syrlinksHandler = new SyrlinksHkHandler(objects::SYRLINKS_HK_HANDLER, objects::UART_COM_IF, + syrlinksUartCookie, pcdu::PDU1_CH1_SYRLINKS_12V); + syrlinksHandler->setPowerSwitcher(pwrSwitcher); } void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF) { @@ -645,8 +650,8 @@ void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF) { mpsocGpioCookie->addGpio(gpioIds::ENABLE_MPSOC_UART, gpioConfigMPSoC); gpioComIF->addGpios(mpsocGpioCookie); auto mpsocCookie = - new UartCookie(objects::PLOC_MPSOC_HANDLER, q7s::UART_PLOC_MPSOC_DEV, - UartModes::NON_CANONICAL, uart::PLOC_MPSOC_BAUD, mpsoc::MAX_REPLY_SIZE); + new UartCookie(objects::PLOC_MPSOC_HANDLER, q7s::UART_PLOC_MPSOC_DEV, uart::PLOC_MPSOC_BAUD, + mpsoc::MAX_REPLY_SIZE, UartModes::NON_CANONICAL); mpsocCookie->setNoFixedSizeReply(); auto plocMpsocHelper = new PlocMPSoCHelper(objects::PLOC_MPSOC_HELPER); new PlocMPSoCHandler(objects::PLOC_MPSOC_HANDLER, objects::UART_COM_IF, mpsocCookie, @@ -661,14 +666,14 @@ void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF) { auto supvGpioCookie = new GpioCookie; supvGpioCookie->addGpio(gpioIds::ENABLE_SUPV_UART, gpioConfigSupv); gpioComIF->addGpios(supvGpioCookie); - auto supervisorCookie = new UartCookie(objects::PLOC_SUPERVISOR_HANDLER, - q7s::UART_PLOC_SUPERVSIOR_DEV, UartModes::NON_CANONICAL, - uart::PLOC_SUPV_BAUD, supv::MAX_PACKET_SIZE * 20); + auto supervisorCookie = + new UartCookie(objects::PLOC_SUPERVISOR_HANDLER, q7s::UART_PLOC_SUPERVSIOR_DEV, + uart::PLOC_SUPV_BAUD, supv::MAX_PACKET_SIZE * 20, UartModes::NON_CANONICAL); supervisorCookie->setNoFixedSizeReply(); auto supvHelper = new PlocSupvHelper(objects::PLOC_SUPERVISOR_HELPER); new PlocSupervisorHandler(objects::PLOC_SUPERVISOR_HANDLER, objects::UART_COM_IF, supervisorCookie, Gpio(gpioIds::ENABLE_SUPV_UART, gpioComIF), - pcduSwitches::PDU1_CH6_PLOC_12V, supvHelper); + pcdu::PDU1_CH6_PLOC_12V, supvHelper); #endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */ static_cast(consumer); } @@ -925,8 +930,8 @@ void ObjectFactory::createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* // Create device handler components auto plPcduHandler = new PayloadPcduHandler( objects::PLPCDU_HANDLER, objects::SPI_COM_IF, spiCookie, gpioComIF, SdCardManager::instance(), - pwrSwitcher, pcduSwitches::Switches::PDU2_CH1_PL_PCDU_BATT_0_14V8, - pcduSwitches::Switches::PDU2_CH6_PL_PCDU_BATT_1_14V8, false); + pwrSwitcher, pcdu::Switches::PDU2_CH1_PL_PCDU_BATT_0_14V8, + pcdu::Switches::PDU2_CH6_PL_PCDU_BATT_1_14V8, false); spiCookie->setCallbackMode(PayloadPcduHandler::extConvAsTwoCallback, plPcduHandler); // plPcduHandler->enablePeriodicPrintout(true, 5); // static_cast(plPcduHandler); diff --git a/bsp_q7s/core/ObjectFactory.h b/bsp_q7s/core/ObjectFactory.h index bfa045c1..a812be35 100644 --- a/bsp_q7s/core/ObjectFactory.h +++ b/bsp_q7s/core/ObjectFactory.h @@ -24,7 +24,7 @@ void createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComIF* uartComIF, PowerSwitchIF* pwrSwitcher); void createHeaterComponents(); void createSolarArrayDeploymentComponents(); -void createSyrlinksComponents(); +void createSyrlinksComponents(PowerSwitchIF* pwrSwitcher); void createPayloadComponents(LinuxLibgpioIF* gpioComIF); void createReactionWheelComponents(LinuxLibgpioIF* gpioComIF); void createCcsdsComponents(LinuxLibgpioIF* gpioComIF); diff --git a/common/config/commonSubsystemIds.h b/common/config/commonSubsystemIds.h index 6a4a6b03..d4942b64 100644 --- a/common/config/commonSubsystemIds.h +++ b/common/config/commonSubsystemIds.h @@ -6,24 +6,31 @@ namespace SUBSYSTEM_ID { enum: uint8_t { COMMON_SUBSYSTEM_ID_START = FW_SUBSYSTEM_ID_RANGE, - PCDU_HANDLER = 108, - HEATER_HANDLER = 109, - SA_DEPL_HANDLER = 110, - PLOC_MPSOC_HANDLER = 111, - IMTQ_HANDLER = 112, - RW_HANDLER = 113, - STR_HANDLER = 114, - PLOC_SUPERVISOR_HANDLER = 115, - FILE_SYSTEM = 116, - PLOC_SUPV_HELPER = 117, - PLOC_MEMORY_DUMPER = 118, - PDEC_HANDLER = 119, - STR_HELPER = 120, - PLOC_MPSOC_HELPER = 121, - PL_PCDU_HANDLER = 122, - ACS_BOARD_ASS = 123, - SUS_BOARD_ASS = 124, - TCS_BOARD_ASS = 125, + ACS_SUBSYSTEM = 112, + PCDU_HANDLER = 113, + HEATER_HANDLER = 114, + SA_DEPL_HANDLER = 115, + PLOC_MPSOC_HANDLER = 116, + IMTQ_HANDLER = 117, + RW_HANDLER = 118, + STR_HANDLER = 119, + PLOC_SUPERVISOR_HANDLER = 120, + FILE_SYSTEM = 121, + PLOC_UPDATER = 122, + PLOC_MEMORY_DUMPER = 123, + PDEC_HANDLER = 124, + STR_HELPER = 125, + PLOC_MPSOC_HELPER = 126, + PL_PCDU_HANDLER = 127, + ACS_BOARD_ASS = 128, + SUS_BOARD_ASS = 129, + TCS_BOARD_ASS = 130, + GPS_HANDLER = 131, + P60_DOCK_HANDLER = 132, + PDU1_HANDLER = 133, + PDU2_HANDLER = 134, + ACU_HANDLER = 135, + PLOC_SUPV_HELPER = 136, COMMON_SUBSYSTEM_ID_END }; } diff --git a/common/config/devices/powerSwitcherList.h b/common/config/devices/powerSwitcherList.h index 1981bb9c..d032428b 100644 --- a/common/config/devices/powerSwitcherList.h +++ b/common/config/devices/powerSwitcherList.h @@ -1,72 +1,6 @@ #ifndef FSFWCONFIG_DEVICES_POWERSWITCHERLIST_H_ #define FSFWCONFIG_DEVICES_POWERSWITCHERLIST_H_ -#include "OBSWConfig.h" - -#include - -#include -#include - -namespace pcduSwitches { - -/* Switches are uint8_t datatype and go from 0 to 255 */ -enum Switches: power::Switch_t { - PDU1_CH0_TCS_BOARD_3V3, - PDU1_CH1_SYRLINKS_12V, - PDU1_CH2_STAR_TRACKER_5V, - PDU1_CH3_MGT_5V, - PDU1_CH4_SUS_NOMINAL_3V3, - PDU1_CH5_SOLAR_CELL_EXP_5V, - PDU1_CH6_PLOC_12V, - PDU1_CH7_ACS_A_SIDE_3V3, - PDU1_CH8_UNOCCUPIED, - - PDU2_CH0_Q7S, - PDU2_CH1_PL_PCDU_BATT_0_14V8, - PDU2_CH2_RW_5V, - PDU2_CH3_TCS_BOARD_HEATER_IN_8V, - PDU2_CH4_SUS_REDUNDANT_3V3, - PDU2_CH5_DEPLOYMENT_MECHANISM_8V, - PDU2_CH6_PL_PCDU_BATT_1_14V8, - PDU2_CH7_ACS_BOARD_SIDE_B_3V3, - PDU2_CH8_PAYLOAD_CAMERA, - NUMBER_OF_SWITCHES -}; - -static const uint8_t ON = 1; -static const uint8_t OFF = 0; - -// Output states after reboot of the PDUs - -const std::array INIT_SWITCH_STATES = { - // PDU 1 -// Because the TE0720 is not connected to the PCDU, this switch is always on -#ifdef TE0720_1CFA - ON, -#else - OFF, -#endif - OFF, - OFF, - OFF, - OFF, - OFF, - OFF, - OFF, - OFF, - - // PDU 2 - ON, - OFF, - OFF, - OFF, - OFF, - OFF, - OFF, - OFF, - OFF -}; -} +#include "mission/devices/devicedefinitions/GomspaceDefinitions.h" #endif /* FSFWCONFIG_DEVICES_POWERSWITCHERLIST_H_ */ diff --git a/fsfw b/fsfw index ce17be63..e949368b 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit ce17be63f4f3bb8947843e423685c622510ae09f +Subproject commit e949368b062e8703c35d2043ece8d7258cd2608b diff --git a/generators/bsp_q7s_events.csv b/generators/bsp_q7s_events.csv index 7cc4be65..9a60709e 100644 --- a/generators/bsp_q7s_events.csv +++ b/generators/bsp_q7s_events.csv @@ -77,116 +77,116 @@ 8901;0x22c5;CLOCK_SET_FAILURE;LOW;;fsfw\src\fsfw\pus\Service9TimeManagement.h 9700;0x25e4;TEST;INFO;;fsfw\src\fsfw\pus\Service17Test.h 10600;0x2968;CHANGE_OF_SETUP_PARAMETER;LOW;;fsfw\hal\src\fsfw_hal\devicehandlers\MgmLIS3MDLHandler.h -10800;0x2a30;SWITCH_CMD_SENT;INFO;Indicates that a FSFW object requested setting a switch P1: 1 if on was requested, 0 for off | P2: Switch Index;mission\devices\devicedefinitions\powerDefinitions.h -10801;0x2a31;SWITCH_HAS_CHANGED;INFO;Indicated that a swithc state has changed P1: New switch state, 1 for on, 0 for off | P2: Switch Index;mission\devices\devicedefinitions\powerDefinitions.h -10802;0x2a32;SWITCHING_Q7S_DENIED;MEDIUM;;mission\devices\devicedefinitions\powerDefinitions.h -10900;0x2a94;GPIO_PULL_HIGH_FAILED;LOW;;mission\devices\HeaterHandler.h -10901;0x2a95;GPIO_PULL_LOW_FAILED;LOW;;mission\devices\HeaterHandler.h -10902;0x2a96;SWITCH_ALREADY_ON;LOW;;mission\devices\HeaterHandler.h -10903;0x2a97;SWITCH_ALREADY_OFF;LOW;;mission\devices\HeaterHandler.h -10904;0x2a98;MAIN_SWITCH_TIMEOUT;LOW;;mission\devices\HeaterHandler.h -11000;0x2af8;MAIN_SWITCH_ON_TIMEOUT;LOW;;mission\devices\SolarArrayDeploymentHandler.h -11001;0x2af9;MAIN_SWITCH_OFF_TIMEOUT;LOW;;mission\devices\SolarArrayDeploymentHandler.h -11002;0x2afa;DEPLOYMENT_FAILED;HIGH;;mission\devices\SolarArrayDeploymentHandler.h -11003;0x2afb;DEPL_SA1_GPIO_SWTICH_ON_FAILED;HIGH;;mission\devices\SolarArrayDeploymentHandler.h -11004;0x2afc;DEPL_SA2_GPIO_SWTICH_ON_FAILED;HIGH;;mission\devices\SolarArrayDeploymentHandler.h -11101;0x2b5d;MEMORY_READ_RPT_CRC_FAILURE;LOW;PLOC crc failure in telemetry packet;linux\devices\ploc\PlocMPSoCHandler.h -11102;0x2b5e;ACK_FAILURE;LOW;PLOC receive acknowledgment failure report P1: Command Id which leads the acknowledgment failure report P2: The status field inserted by the MPSoC into the data field;linux\devices\ploc\PlocMPSoCHandler.h -11103;0x2b5f;EXE_FAILURE;LOW;PLOC receive execution failure report P1: Command Id which leads the execution failure report P2: The status field inserted by the MPSoC into the data field;linux\devices\ploc\PlocMPSoCHandler.h -11104;0x2b60;MPSOC_HANDLER_CRC_FAILURE;LOW;PLOC reply has invalid crc;linux\devices\ploc\PlocMPSoCHandler.h -11105;0x2b61;MPSOC_HANDLER_SEQ_CNT_MISMATCH;LOW;Packet sequence count in received space packet does not match expected count P1: Expected sequence count P2: Received sequence count;linux\devices\ploc\PlocMPSoCHandler.h -11106;0x2b62;MPSOC_SHUTDOWN_FAILED;HIGH;Supervisor fails to shutdown MPSoC. Requires to power off the PLOC and thus also to shutdown the supervisor.;linux\devices\ploc\PlocMPSoCHandler.h -11201;0x2bc1;SELF_TEST_I2C_FAILURE;LOW;Get self test result returns I2C failure P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission\devices\IMTQHandler.h -11202;0x2bc2;SELF_TEST_SPI_FAILURE;LOW;Get self test result returns SPI failure. This concerns the MTM connectivity. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission\devices\IMTQHandler.h -11203;0x2bc3;SELF_TEST_ADC_FAILURE;LOW;Get self test result returns failure in measurement of current and temperature. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission\devices\IMTQHandler.h -11204;0x2bc4;SELF_TEST_PWM_FAILURE;LOW;Get self test result returns PWM failure which concerns the coil actuation. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission\devices\IMTQHandler.h -11205;0x2bc5;SELF_TEST_TC_FAILURE;LOW;Get self test result returns TC failure (system failure) P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission\devices\IMTQHandler.h -11206;0x2bc6;SELF_TEST_MTM_RANGE_FAILURE;LOW;Get self test result returns failure that MTM values were outside of the expected range. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission\devices\IMTQHandler.h -11207;0x2bc7;SELF_TEST_COIL_CURRENT_FAILURE;LOW;Get self test result returns failure indicating that the coil current was outside of the expected range P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission\devices\IMTQHandler.h -11208;0x2bc8;INVALID_ERROR_BYTE;LOW;Received invalid error byte. This indicates an error of the communication link between IMTQ and OBC.;mission\devices\IMTQHandler.h -11301;0x2c25;ERROR_STATE;HIGH;Reaction wheel signals an error state;mission\devices\RwHandler.h -11401;0x2c89;BOOTING_FIRMWARE_FAILED;LOW;Failed to boot firmware;linux\devices\startracker\StarTrackerHandler.h -11402;0x2c8a;BOOTING_BOOTLOADER_FAILED;LOW;Failed to boot star tracker into bootloader mode;linux\devices\startracker\StarTrackerHandler.h -11501;0x2ced;SUPV_MEMORY_READ_RPT_CRC_FAILURE;LOW;PLOC supervisor crc failure in telemetry packet;linux\devices\ploc\PlocSupervisorHandler.h -11502;0x2cee;SUPV_ACK_FAILURE;LOW;PLOC supervisor received acknowledgment failure report;linux\devices\ploc\PlocSupervisorHandler.h -11503;0x2cef;SUPV_EXE_FAILURE;LOW;PLOC received execution failure report;linux\devices\ploc\PlocSupervisorHandler.h -11504;0x2cf0;SUPV_CRC_FAILURE_EVENT;LOW;PLOC supervisor reply has invalid crc;linux\devices\ploc\PlocSupervisorHandler.h -11505;0x2cf1;SUPV_HELPER_EXECUTING;LOW;Supervisor helper currently executing a command;linux\devices\ploc\PlocSupervisorHandler.h -11600;0x2d50;SANITIZATION_FAILED;LOW;;bsp_q7s\memory\SdCardManager.h -11601;0x2d51;MOUNTED_SD_CARD;INFO;;bsp_q7s\memory\SdCardManager.h -11700;0x2db4;SUPV_UPDATE_FAILED;LOW;update failed;linux\devices\ploc\PlocSupvHelper.h -11701;0x2db5;SUPV_UPDATE_SUCCESSFUL;LOW;update successful;linux\devices\ploc\PlocSupvHelper.h -11702;0x2db6;TERMINATED_UPDATE_PROCEDURE;LOW;Terminated update procedure by command;linux\devices\ploc\PlocSupvHelper.h -11703;0x2db7;SUPV_EVENT_BUFFER_REQUEST_SUCCESSFUL;LOW;Requesting event buffer was successful;linux\devices\ploc\PlocSupvHelper.h -11704;0x2db8;SUPV_EVENT_BUFFER_REQUEST_FAILED;LOW;Requesting event buffer failed;linux\devices\ploc\PlocSupvHelper.h -11705;0x2db9;SUPV_EVENT_BUFFER_REQUEST_TERMINATED;LOW;Terminated event buffer request by command P1: Number of packets read before process was terminated;linux\devices\ploc\PlocSupvHelper.h -11706;0x2dba;SUPV_SENDING_COMMAND_FAILED;LOW;;linux\devices\ploc\PlocSupvHelper.h -11707;0x2dbb;SUPV_HELPER_REQUESTING_REPLY_FAILED;LOW;Request receive message of communication interface failed P1: Return value returned by the communication interface requestReceiveMessage function P2: Internal state of supervisor helper;linux\devices\ploc\PlocSupvHelper.h -11708;0x2dbc;SUPV_HELPER_READING_REPLY_FAILED;LOW;Reading receive message of communication interface failed P1: Return value returned by the communication interface readingReceivedMessage function P2: Internal state of supervisor helper;linux\devices\ploc\PlocSupvHelper.h -11709;0x2dbd;SUPV_MISSING_ACK;LOW;Did not receive acknowledgement report P1: Number of bytes missing P2: Internal state of MPSoC helper;linux\devices\ploc\PlocSupvHelper.h -11710;0x2dbe;SUPV_MISSING_EXE;LOW;Supervisor did not receive execution report P1: Number of bytes missing P2: Internal state of supervisor helper;linux\devices\ploc\PlocSupvHelper.h -11711;0x2dbf;SUPV_ACK_FAILURE_REPORT;LOW;Supervisor received acknowledgment failure report P1: Internal state of supervisor helper;linux\devices\ploc\PlocSupvHelper.h -11712;0x2dc0;SUPV_EXE_FAILURE_REPORT;LOW;Supervisor received execution failure report P1: Internal state of supervisor;linux\devices\ploc\PlocSupvHelper.h -11713;0x2dc1;SUPV_ACK_INVALID_APID;LOW;Supervisor expected acknowledgment report but received space packet with other apid P1: Apid of received space packet P2: Internal state of supervisor helper;linux\devices\ploc\PlocSupvHelper.h -11714;0x2dc2;SUPV_EXE_INVALID_APID;LOW;Supervisor helper expected execution report but received space packet with other apid P1: Apid of received space packet P2: Internal state of supervisor helper;linux\devices\ploc\PlocSupvHelper.h -11800;0x2e18;SEND_MRAM_DUMP_FAILED;LOW;Failed to send mram dump command to supervisor handler P1: Return value of commandAction function P2: Start address of MRAM to dump with this command;linux\devices\ploc\PlocMemoryDumper.h -11801;0x2e19;MRAM_DUMP_FAILED;LOW;Received completion failure report form PLOC supervisor handler P1: MRAM start address of failing dump command;linux\devices\ploc\PlocMemoryDumper.h -11802;0x2e1a;MRAM_DUMP_FINISHED;LOW;MRAM dump finished successfully;linux\devices\ploc\PlocMemoryDumper.h -11901;0x2e7d;INVALID_TC_FRAME;HIGH;;linux\obc\PdecHandler.h -11902;0x2e7e;INVALID_FAR;HIGH;Read invalid FAR from PDEC after startup;linux\obc\PdecHandler.h -11903;0x2e7f;CARRIER_LOCK;INFO;Carrier lock detected;linux\obc\PdecHandler.h -11904;0x2e80;BIT_LOCK_PDEC;INFO;Bit lock detected (data valid);linux\obc\PdecHandler.h -12000;0x2ee0;IMAGE_UPLOAD_FAILED;LOW;Image upload failed;linux\devices\startracker\StrHelper.h -12001;0x2ee1;IMAGE_DOWNLOAD_FAILED;LOW;Image download failed;linux\devices\startracker\StrHelper.h -12002;0x2ee2;IMAGE_UPLOAD_SUCCESSFUL;LOW;Uploading image to star tracker was successfulop;linux\devices\startracker\StrHelper.h -12003;0x2ee3;IMAGE_DOWNLOAD_SUCCESSFUL;LOW;Image download was successful;linux\devices\startracker\StrHelper.h -12004;0x2ee4;FLASH_WRITE_SUCCESSFUL;LOW;Finished flash write procedure successfully;linux\devices\startracker\StrHelper.h -12005;0x2ee5;FLASH_READ_SUCCESSFUL;LOW;Finished flash read procedure successfully;linux\devices\startracker\StrHelper.h -12006;0x2ee6;FLASH_READ_FAILED;LOW;Flash read procedure failed;linux\devices\startracker\StrHelper.h -12007;0x2ee7;FIRMWARE_UPDATE_SUCCESSFUL;LOW;Firmware update was successful;linux\devices\startracker\StrHelper.h -12008;0x2ee8;FIRMWARE_UPDATE_FAILED;LOW;Firmware update failed;linux\devices\startracker\StrHelper.h -12009;0x2ee9;STR_HELPER_READING_REPLY_FAILED;LOW;Failed to read communication interface reply data P1: Return code of failed communication interface read call P1: Upload/download position for which the read call failed;linux\devices\startracker\StrHelper.h -12010;0x2eea;STR_HELPER_COM_ERROR;LOW;Unexpected stop of decoding sequence P1: Return code of failed communication interface read call P1: Upload/download position for which the read call failed;linux\devices\startracker\StrHelper.h -12011;0x2eeb;STR_HELPER_NO_REPLY;LOW;Star tracker did not send replies (maybe device is powered off) P1: Position of upload or download packet for which no reply was sent;linux\devices\startracker\StrHelper.h -12012;0x2eec;STR_HELPER_DEC_ERROR;LOW;Error during decoding of received reply occurred P1: Return value of decoding function P2: Position of upload/download packet, or address of flash write/read request;linux\devices\startracker\StrHelper.h -12013;0x2eed;POSITION_MISMATCH;LOW;Position mismatch P1: The expected position and thus the position for which the image upload/download failed;linux\devices\startracker\StrHelper.h -12014;0x2eee;STR_HELPER_FILE_NOT_EXISTS;LOW;Specified file does not exist P1: Internal state of str helper;linux\devices\startracker\StrHelper.h -12015;0x2eef;STR_HELPER_SENDING_PACKET_FAILED;LOW;;linux\devices\startracker\StrHelper.h -12016;0x2ef0;STR_HELPER_REQUESTING_MSG_FAILED;LOW;;linux\devices\startracker\StrHelper.h -12100;0x2f44;MPSOC_FLASH_WRITE_FAILED;LOW;Flash write fails;linux\devices\ploc\PlocMPSoCHelper.h -12101;0x2f45;MPSOC_FLASH_WRITE_SUCCESSFUL;LOW;Flash write successful;linux\devices\ploc\PlocMPSoCHelper.h -12102;0x2f46;MPSOC_SENDING_COMMAND_FAILED;LOW;;linux\devices\ploc\PlocMPSoCHelper.h -12103;0x2f47;MPSOC_HELPER_REQUESTING_REPLY_FAILED;LOW;Request receive message of communication interface failed P1: Return value returned by the communication interface requestReceiveMessage function P2: Internal state of MPSoC helper;linux\devices\ploc\PlocMPSoCHelper.h -12104;0x2f48;MPSOC_HELPER_READING_REPLY_FAILED;LOW;Reading receive message of communication interface failed P1: Return value returned by the communication interface readingReceivedMessage function P2: Internal state of MPSoC helper;linux\devices\ploc\PlocMPSoCHelper.h -12105;0x2f49;MPSOC_MISSING_ACK;LOW;Did not receive acknowledgment report P1: Number of bytes missing P2: Internal state of MPSoC helper;linux\devices\ploc\PlocMPSoCHelper.h -12106;0x2f4a;MPSOC_MISSING_EXE;LOW;Did not receive execution report P1: Number of bytes missing P2: Internal state of MPSoC helper;linux\devices\ploc\PlocMPSoCHelper.h -12107;0x2f4b;MPSOC_ACK_FAILURE_REPORT;LOW;Received acknowledgment failure report P1: Internal state of MPSoC;linux\devices\ploc\PlocMPSoCHelper.h -12108;0x2f4c;MPSOC_EXE_FAILURE_REPORT;LOW;Received execution failure report P1: Internal state of MPSoC;linux\devices\ploc\PlocMPSoCHelper.h -12109;0x2f4d;MPSOC_ACK_INVALID_APID;LOW;Expected acknowledgment report but received space packet with other apid P1: Apid of received space packet P2: Internal state of MPSoC;linux\devices\ploc\PlocMPSoCHelper.h -12110;0x2f4e;MPSOC_EXE_INVALID_APID;LOW;Expected execution report but received space packet with other apid P1: Apid of received space packet P2: Internal state of MPSoC;linux\devices\ploc\PlocMPSoCHelper.h -12111;0x2f4f;MPSOC_HELPER_SEQ_CNT_MISMATCH;LOW;Received sequence count does not match expected sequence count P1: Expected sequence count P2: Received sequence count;linux\devices\ploc\PlocMPSoCHelper.h -12200;0x2fa8;TRANSITION_BACK_TO_OFF;MEDIUM;Could not transition properly and went back to ALL OFF;mission\devices\PayloadPcduHandler.h -12201;0x2fa9;NEG_V_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission\devices\PayloadPcduHandler.h -12202;0x2faa;U_DRO_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission\devices\PayloadPcduHandler.h -12203;0x2fab;I_DRO_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission\devices\PayloadPcduHandler.h -12204;0x2fac;U_X8_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission\devices\PayloadPcduHandler.h -12205;0x2fad;I_X8_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission\devices\PayloadPcduHandler.h -12206;0x2fae;U_TX_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission\devices\PayloadPcduHandler.h -12207;0x2faf;I_TX_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission\devices\PayloadPcduHandler.h -12208;0x2fb0;U_MPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission\devices\PayloadPcduHandler.h -12209;0x2fb1;I_MPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission\devices\PayloadPcduHandler.h -12210;0x2fb2;U_HPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission\devices\PayloadPcduHandler.h -12211;0x2fb3;I_HPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission\devices\PayloadPcduHandler.h -12300;0x300c;TRANSITION_OTHER_SIDE_FAILED;HIGH;;mission\system\AcsBoardAssembly.h -12301;0x300d;NOT_ENOUGH_DEVICES_DUAL_MODE;HIGH;;mission\system\AcsBoardAssembly.h -12302;0x300e;POWER_STATE_MACHINE_TIMEOUT;MEDIUM;;mission\system\AcsBoardAssembly.h -12303;0x300f;SIDE_SWITCH_TRANSITION_NOT_ALLOWED;LOW;Not implemented, would increase already high complexity. Operator should instead command the assembly off first and then command the assembly on into the desired mode/submode combination;mission\system\AcsBoardAssembly.h -12400;0x3070;TRANSITION_OTHER_SIDE_FAILED;HIGH;;mission\system\SusAssembly.h -12401;0x3071;NOT_ENOUGH_DEVICES_DUAL_MODE;HIGH;;mission\system\SusAssembly.h -12402;0x3072;POWER_STATE_MACHINE_TIMEOUT;MEDIUM;;mission\system\SusAssembly.h -12403;0x3073;SIDE_SWITCH_TRANSITION_NOT_ALLOWED;LOW;Not implemented, would increase already high complexity. Operator should instead command the assembly off first and then command the assembly on into the desired mode/submode combination;mission\system\SusAssembly.h -12500;0x30d4;CHILDREN_LOST_MODE;MEDIUM;;mission\system\TcsBoardAssembly.h -13600;0x3520;ALLOC_FAILURE;MEDIUM;;bsp_q7s\core\CoreController.h -13601;0x3521;REBOOT_SW;MEDIUM; Software reboot occured. Can also be a systemd reboot. P1: Current Chip, P2: Current Copy;bsp_q7s\core\CoreController.h -13602;0x3522;REBOOT_MECHANISM_TRIGGERED;MEDIUM;The reboot mechanism was triggered. P1: First 16 bits: Last Chip, Last 16 bits: Last Copy, P2: Each byte is the respective reboot count for the slots;bsp_q7s\core\CoreController.h -13603;0x3523;REBOOT_HW;MEDIUM;;bsp_q7s\core\CoreController.h +11300;0x2c24;SWITCH_CMD_SENT;INFO;Indicates that a FSFW object requested setting a switch P1: 1 if on was requested, 0 for off | P2: Switch Index;mission\devices\devicedefinitions\powerDefinitions.h +11301;0x2c25;SWITCH_HAS_CHANGED;INFO;Indicated that a swithc state has changed P1: New switch state, 1 for on, 0 for off | P2: Switch Index;mission\devices\devicedefinitions\powerDefinitions.h +11302;0x2c26;SWITCHING_Q7S_DENIED;MEDIUM;;mission\devices\devicedefinitions\powerDefinitions.h +11400;0x2c88;GPIO_PULL_HIGH_FAILED;LOW;;mission\devices\HeaterHandler.h +11401;0x2c89;GPIO_PULL_LOW_FAILED;LOW;;mission\devices\HeaterHandler.h +11402;0x2c8a;SWITCH_ALREADY_ON;LOW;;mission\devices\HeaterHandler.h +11403;0x2c8b;SWITCH_ALREADY_OFF;LOW;;mission\devices\HeaterHandler.h +11404;0x2c8c;MAIN_SWITCH_TIMEOUT;LOW;;mission\devices\HeaterHandler.h +11500;0x2cec;MAIN_SWITCH_ON_TIMEOUT;LOW;;mission\devices\SolarArrayDeploymentHandler.h +11501;0x2ced;MAIN_SWITCH_OFF_TIMEOUT;LOW;;mission\devices\SolarArrayDeploymentHandler.h +11502;0x2cee;DEPLOYMENT_FAILED;HIGH;;mission\devices\SolarArrayDeploymentHandler.h +11503;0x2cef;DEPL_SA1_GPIO_SWTICH_ON_FAILED;HIGH;;mission\devices\SolarArrayDeploymentHandler.h +11504;0x2cf0;DEPL_SA2_GPIO_SWTICH_ON_FAILED;HIGH;;mission\devices\SolarArrayDeploymentHandler.h +11601;0x2d51;MEMORY_READ_RPT_CRC_FAILURE;LOW;PLOC crc failure in telemetry packet;linux\devices\ploc\PlocMPSoCHandler.h +11602;0x2d52;ACK_FAILURE;LOW;PLOC receive acknowledgment failure report P1: Command Id which leads the acknowledgment failure report P2: The status field inserted by the MPSoC into the data field;linux\devices\ploc\PlocMPSoCHandler.h +11603;0x2d53;EXE_FAILURE;LOW;PLOC receive execution failure report P1: Command Id which leads the execution failure report P2: The status field inserted by the MPSoC into the data field;linux\devices\ploc\PlocMPSoCHandler.h +11604;0x2d54;MPSOC_HANDLER_CRC_FAILURE;LOW;PLOC reply has invalid crc;linux\devices\ploc\PlocMPSoCHandler.h +11605;0x2d55;MPSOC_HANDLER_SEQ_CNT_MISMATCH;LOW;Packet sequence count in received space packet does not match expected count P1: Expected sequence count P2: Received sequence count;linux\devices\ploc\PlocMPSoCHandler.h +11606;0x2d56;MPSOC_SHUTDOWN_FAILED;HIGH;Supervisor fails to shutdown MPSoC. Requires to power off the PLOC and thus also to shutdown the supervisor.;linux\devices\ploc\PlocMPSoCHandler.h +11701;0x2db5;SELF_TEST_I2C_FAILURE;LOW;Get self test result returns I2C failure P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission\devices\IMTQHandler.h +11702;0x2db6;SELF_TEST_SPI_FAILURE;LOW;Get self test result returns SPI failure. This concerns the MTM connectivity. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission\devices\IMTQHandler.h +11703;0x2db7;SELF_TEST_ADC_FAILURE;LOW;Get self test result returns failure in measurement of current and temperature. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission\devices\IMTQHandler.h +11704;0x2db8;SELF_TEST_PWM_FAILURE;LOW;Get self test result returns PWM failure which concerns the coil actuation. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission\devices\IMTQHandler.h +11705;0x2db9;SELF_TEST_TC_FAILURE;LOW;Get self test result returns TC failure (system failure) P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission\devices\IMTQHandler.h +11706;0x2dba;SELF_TEST_MTM_RANGE_FAILURE;LOW;Get self test result returns failure that MTM values were outside of the expected range. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission\devices\IMTQHandler.h +11707;0x2dbb;SELF_TEST_COIL_CURRENT_FAILURE;LOW;Get self test result returns failure indicating that the coil current was outside of the expected range P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission\devices\IMTQHandler.h +11708;0x2dbc;INVALID_ERROR_BYTE;LOW;Received invalid error byte. This indicates an error of the communication link between IMTQ and OBC.;mission\devices\IMTQHandler.h +11801;0x2e19;ERROR_STATE;HIGH;Reaction wheel signals an error state;mission\devices\RwHandler.h +11901;0x2e7d;BOOTING_FIRMWARE_FAILED;LOW;Failed to boot firmware;linux\devices\startracker\StarTrackerHandler.h +11902;0x2e7e;BOOTING_BOOTLOADER_FAILED;LOW;Failed to boot star tracker into bootloader mode;linux\devices\startracker\StarTrackerHandler.h +12001;0x2ee1;SUPV_MEMORY_READ_RPT_CRC_FAILURE;LOW;PLOC supervisor crc failure in telemetry packet;linux\devices\ploc\PlocSupervisorHandler.h +12002;0x2ee2;SUPV_ACK_FAILURE;LOW;PLOC supervisor received acknowledgment failure report;linux\devices\ploc\PlocSupervisorHandler.h +12003;0x2ee3;SUPV_EXE_FAILURE;LOW;PLOC received execution failure report;linux\devices\ploc\PlocSupervisorHandler.h +12004;0x2ee4;SUPV_CRC_FAILURE_EVENT;LOW;PLOC supervisor reply has invalid crc;linux\devices\ploc\PlocSupervisorHandler.h +12005;0x2ee5;SUPV_HELPER_EXECUTING;LOW;Supervisor helper currently executing a command;linux\devices\ploc\PlocSupervisorHandler.h +12100;0x2f44;SANITIZATION_FAILED;LOW;;bsp_q7s\memory\SdCardManager.h +12101;0x2f45;MOUNTED_SD_CARD;INFO;;bsp_q7s\memory\SdCardManager.h +12300;0x300c;SEND_MRAM_DUMP_FAILED;LOW;Failed to send mram dump command to supervisor handler P1: Return value of commandAction function P2: Start address of MRAM to dump with this command;linux\devices\ploc\PlocMemoryDumper.h +12301;0x300d;MRAM_DUMP_FAILED;LOW;Received completion failure report form PLOC supervisor handler P1: MRAM start address of failing dump command;linux\devices\ploc\PlocMemoryDumper.h +12302;0x300e;MRAM_DUMP_FINISHED;LOW;MRAM dump finished successfully;linux\devices\ploc\PlocMemoryDumper.h +12401;0x3071;INVALID_TC_FRAME;HIGH;;linux\obc\PdecHandler.h +12402;0x3072;INVALID_FAR;HIGH;Read invalid FAR from PDEC after startup;linux\obc\PdecHandler.h +12403;0x3073;CARRIER_LOCK;INFO;Carrier lock detected;linux\obc\PdecHandler.h +12404;0x3074;BIT_LOCK_PDEC;INFO;Bit lock detected (data valid);linux\obc\PdecHandler.h +12500;0x30d4;IMAGE_UPLOAD_FAILED;LOW;Image upload failed;linux\devices\startracker\StrHelper.h +12501;0x30d5;IMAGE_DOWNLOAD_FAILED;LOW;Image download failed;linux\devices\startracker\StrHelper.h +12502;0x30d6;IMAGE_UPLOAD_SUCCESSFUL;LOW;Uploading image to star tracker was successfulop;linux\devices\startracker\StrHelper.h +12503;0x30d7;IMAGE_DOWNLOAD_SUCCESSFUL;LOW;Image download was successful;linux\devices\startracker\StrHelper.h +12504;0x30d8;FLASH_WRITE_SUCCESSFUL;LOW;Finished flash write procedure successfully;linux\devices\startracker\StrHelper.h +12505;0x30d9;FLASH_READ_SUCCESSFUL;LOW;Finished flash read procedure successfully;linux\devices\startracker\StrHelper.h +12506;0x30da;FLASH_READ_FAILED;LOW;Flash read procedure failed;linux\devices\startracker\StrHelper.h +12507;0x30db;FIRMWARE_UPDATE_SUCCESSFUL;LOW;Firmware update was successful;linux\devices\startracker\StrHelper.h +12508;0x30dc;FIRMWARE_UPDATE_FAILED;LOW;Firmware update failed;linux\devices\startracker\StrHelper.h +12509;0x30dd;STR_HELPER_READING_REPLY_FAILED;LOW;Failed to read communication interface reply data P1: Return code of failed communication interface read call P1: Upload/download position for which the read call failed;linux\devices\startracker\StrHelper.h +12510;0x30de;STR_HELPER_COM_ERROR;LOW;Unexpected stop of decoding sequence P1: Return code of failed communication interface read call P1: Upload/download position for which the read call failed;linux\devices\startracker\StrHelper.h +12511;0x30df;STR_HELPER_NO_REPLY;LOW;Star tracker did not send replies (maybe device is powered off) P1: Position of upload or download packet for which no reply was sent;linux\devices\startracker\StrHelper.h +12512;0x30e0;STR_HELPER_DEC_ERROR;LOW;Error during decoding of received reply occurred P1: Return value of decoding function P2: Position of upload/download packet, or address of flash write/read request;linux\devices\startracker\StrHelper.h +12513;0x30e1;POSITION_MISMATCH;LOW;Position mismatch P1: The expected position and thus the position for which the image upload/download failed;linux\devices\startracker\StrHelper.h +12514;0x30e2;STR_HELPER_FILE_NOT_EXISTS;LOW;Specified file does not exist P1: Internal state of str helper;linux\devices\startracker\StrHelper.h +12515;0x30e3;STR_HELPER_SENDING_PACKET_FAILED;LOW;;linux\devices\startracker\StrHelper.h +12516;0x30e4;STR_HELPER_REQUESTING_MSG_FAILED;LOW;;linux\devices\startracker\StrHelper.h +12600;0x3138;MPSOC_FLASH_WRITE_FAILED;LOW;Flash write fails;linux\devices\ploc\PlocMPSoCHelper.h +12601;0x3139;MPSOC_FLASH_WRITE_SUCCESSFUL;LOW;Flash write successful;linux\devices\ploc\PlocMPSoCHelper.h +12602;0x313a;MPSOC_SENDING_COMMAND_FAILED;LOW;;linux\devices\ploc\PlocMPSoCHelper.h +12603;0x313b;MPSOC_HELPER_REQUESTING_REPLY_FAILED;LOW;Request receive message of communication interface failed P1: Return value returned by the communication interface requestReceiveMessage function P2: Internal state of MPSoC helper;linux\devices\ploc\PlocMPSoCHelper.h +12604;0x313c;MPSOC_HELPER_READING_REPLY_FAILED;LOW;Reading receive message of communication interface failed P1: Return value returned by the communication interface readingReceivedMessage function P2: Internal state of MPSoC helper;linux\devices\ploc\PlocMPSoCHelper.h +12605;0x313d;MPSOC_MISSING_ACK;LOW;Did not receive acknowledgment report P1: Number of bytes missing P2: Internal state of MPSoC helper;linux\devices\ploc\PlocMPSoCHelper.h +12606;0x313e;MPSOC_MISSING_EXE;LOW;Did not receive execution report P1: Number of bytes missing P2: Internal state of MPSoC helper;linux\devices\ploc\PlocMPSoCHelper.h +12607;0x313f;MPSOC_ACK_FAILURE_REPORT;LOW;Received acknowledgment failure report P1: Internal state of MPSoC;linux\devices\ploc\PlocMPSoCHelper.h +12608;0x3140;MPSOC_EXE_FAILURE_REPORT;LOW;Received execution failure report P1: Internal state of MPSoC;linux\devices\ploc\PlocMPSoCHelper.h +12609;0x3141;MPSOC_ACK_INVALID_APID;LOW;Expected acknowledgment report but received space packet with other apid P1: Apid of received space packet P2: Internal state of MPSoC;linux\devices\ploc\PlocMPSoCHelper.h +12610;0x3142;MPSOC_EXE_INVALID_APID;LOW;Expected execution report but received space packet with other apid P1: Apid of received space packet P2: Internal state of MPSoC;linux\devices\ploc\PlocMPSoCHelper.h +12611;0x3143;MPSOC_HELPER_SEQ_CNT_MISMATCH;LOW;Received sequence count does not match expected sequence count P1: Expected sequence count P2: Received sequence count;linux\devices\ploc\PlocMPSoCHelper.h +12700;0x319c;TRANSITION_BACK_TO_OFF;MEDIUM;Could not transition properly and went back to ALL OFF;mission\devices\PayloadPcduHandler.h +12701;0x319d;NEG_V_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission\devices\PayloadPcduHandler.h +12702;0x319e;U_DRO_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission\devices\PayloadPcduHandler.h +12703;0x319f;I_DRO_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission\devices\PayloadPcduHandler.h +12704;0x31a0;U_X8_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission\devices\PayloadPcduHandler.h +12705;0x31a1;I_X8_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission\devices\PayloadPcduHandler.h +12706;0x31a2;U_TX_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission\devices\PayloadPcduHandler.h +12707;0x31a3;I_TX_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission\devices\PayloadPcduHandler.h +12708;0x31a4;U_MPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission\devices\PayloadPcduHandler.h +12709;0x31a5;I_MPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission\devices\PayloadPcduHandler.h +12710;0x31a6;U_HPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission\devices\PayloadPcduHandler.h +12711;0x31a7;I_HPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission\devices\PayloadPcduHandler.h +12800;0x3200;TRANSITION_OTHER_SIDE_FAILED;HIGH;;mission\system\AcsBoardAssembly.h +12801;0x3201;NOT_ENOUGH_DEVICES_DUAL_MODE;HIGH;;mission\system\AcsBoardAssembly.h +12802;0x3202;POWER_STATE_MACHINE_TIMEOUT;MEDIUM;;mission\system\AcsBoardAssembly.h +12803;0x3203;SIDE_SWITCH_TRANSITION_NOT_ALLOWED;LOW;Not implemented, would increase already high complexity. Operator should instead command the assembly off first and then command the assembly on into the desired mode/submode combination;mission\system\AcsBoardAssembly.h +12900;0x3264;TRANSITION_OTHER_SIDE_FAILED;HIGH;;mission\system\SusAssembly.h +12901;0x3265;NOT_ENOUGH_DEVICES_DUAL_MODE;HIGH;;mission\system\SusAssembly.h +12902;0x3266;POWER_STATE_MACHINE_TIMEOUT;MEDIUM;;mission\system\SusAssembly.h +12903;0x3267;SIDE_SWITCH_TRANSITION_NOT_ALLOWED;LOW;Not implemented, would increase already high complexity. Operator should instead command the assembly off first and then command the assembly on into the desired mode/submode combination;mission\system\SusAssembly.h +13000;0x32c8;CHILDREN_LOST_MODE;MEDIUM;;mission\system\TcsBoardAssembly.h +13100;0x332c;GPS_FIX_CHANGE;INFO;Fix has changed. P1: Old fix. P2: New fix 0: Not seen, 1: No Fix, 2: 2D-Fix, 3: 3D-Fix;mission\devices\devicedefinitions\GPSDefinitions.h +13200;0x3390;P60_BOOT_COUNT;INFO;P60 boot count is broadcasted once at SW startup. P1: Boot count;mission\devices\P60DockHandler.h +13201;0x3391;BATT_MODE;INFO;Battery mode is broadcasted at startup. P1: Mode;mission\devices\P60DockHandler.h +13202;0x3392;BATT_MODE_CHANGED;MEDIUM;Battery mode has changed. P1: Old mode. P2: New mode;mission\devices\P60DockHandler.h +13600;0x3520;SUPV_UPDATE_FAILED;LOW;update failed;linux\devices\ploc\PlocSupvHelper.h +13601;0x3521;SUPV_UPDATE_SUCCESSFUL;LOW;update successful;linux\devices\ploc\PlocSupvHelper.h +13602;0x3522;TERMINATED_UPDATE_PROCEDURE;LOW;Terminated update procedure by command;linux\devices\ploc\PlocSupvHelper.h +13603;0x3523;SUPV_EVENT_BUFFER_REQUEST_SUCCESSFUL;LOW;Requesting event buffer was successful;linux\devices\ploc\PlocSupvHelper.h +13604;0x3524;SUPV_EVENT_BUFFER_REQUEST_FAILED;LOW;Requesting event buffer failed;linux\devices\ploc\PlocSupvHelper.h +13605;0x3525;SUPV_EVENT_BUFFER_REQUEST_TERMINATED;LOW;Terminated event buffer request by command P1: Number of packets read before process was terminated;linux\devices\ploc\PlocSupvHelper.h +13606;0x3526;SUPV_SENDING_COMMAND_FAILED;LOW;;linux\devices\ploc\PlocSupvHelper.h +13607;0x3527;SUPV_HELPER_REQUESTING_REPLY_FAILED;LOW;Request receive message of communication interface failed P1: Return value returned by the communication interface requestReceiveMessage function P2: Internal state of supervisor helper;linux\devices\ploc\PlocSupvHelper.h +13608;0x3528;SUPV_HELPER_READING_REPLY_FAILED;LOW;Reading receive message of communication interface failed P1: Return value returned by the communication interface readingReceivedMessage function P2: Internal state of supervisor helper;linux\devices\ploc\PlocSupvHelper.h +13609;0x3529;SUPV_MISSING_ACK;LOW;Did not receive acknowledgement report P1: Number of bytes missing P2: Internal state of MPSoC helper;linux\devices\ploc\PlocSupvHelper.h +13610;0x352a;SUPV_MISSING_EXE;LOW;Supervisor did not receive execution report P1: Number of bytes missing P2: Internal state of supervisor helper;linux\devices\ploc\PlocSupvHelper.h +13611;0x352b;SUPV_ACK_FAILURE_REPORT;LOW;Supervisor received acknowledgment failure report P1: Internal state of supervisor helper;linux\devices\ploc\PlocSupvHelper.h +13612;0x352c;SUPV_EXE_FAILURE_REPORT;LOW;Supervisor received execution failure report P1: Internal state of supervisor;linux\devices\ploc\PlocSupvHelper.h +13613;0x352d;SUPV_ACK_INVALID_APID;LOW;Supervisor expected acknowledgment report but received space packet with other apid P1: Apid of received space packet P2: Internal state of supervisor helper;linux\devices\ploc\PlocSupvHelper.h +13614;0x352e;SUPV_EXE_INVALID_APID;LOW;Supervisor helper expected execution report but received space packet with other apid P1: Apid of received space packet P2: Internal state of supervisor helper;linux\devices\ploc\PlocSupvHelper.h diff --git a/generators/events/event_parser.py b/generators/events/event_parser.py index 9398ba98..11aa80cd 100644 --- a/generators/events/event_parser.py +++ b/generators/events/event_parser.py @@ -72,7 +72,7 @@ def parse_events( LOGGER.info("EventParser: Parsing events: ") # Small delay for clean printout time.sleep(0.01) - event_list = generate_event_list() + event_list = generate_event_list()eive if print_events: PrettyPrinter.pprint(event_list) # Delay for clean printout diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index 842d6979..29b8fc52 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 192 translations. * @details - * Generated on: 2022-04-14 15:49:05 + * Generated on: 2022-04-16 17:47:08 */ #include "translateEvents.h" @@ -121,21 +121,6 @@ const char *SUPV_CRC_FAILURE_EVENT_STRING = "SUPV_CRC_FAILURE_EVENT"; const char *SUPV_HELPER_EXECUTING_STRING = "SUPV_HELPER_EXECUTING"; const char *SANITIZATION_FAILED_STRING = "SANITIZATION_FAILED"; const char *MOUNTED_SD_CARD_STRING = "MOUNTED_SD_CARD"; -const char *SUPV_UPDATE_FAILED_STRING = "SUPV_UPDATE_FAILED"; -const char *SUPV_UPDATE_SUCCESSFUL_STRING = "SUPV_UPDATE_SUCCESSFUL"; -const char *TERMINATED_UPDATE_PROCEDURE_STRING = "TERMINATED_UPDATE_PROCEDURE"; -const char *SUPV_EVENT_BUFFER_REQUEST_SUCCESSFUL_STRING = "SUPV_EVENT_BUFFER_REQUEST_SUCCESSFUL"; -const char *SUPV_EVENT_BUFFER_REQUEST_FAILED_STRING = "SUPV_EVENT_BUFFER_REQUEST_FAILED"; -const char *SUPV_EVENT_BUFFER_REQUEST_TERMINATED_STRING = "SUPV_EVENT_BUFFER_REQUEST_TERMINATED"; -const char *SUPV_SENDING_COMMAND_FAILED_STRING = "SUPV_SENDING_COMMAND_FAILED"; -const char *SUPV_HELPER_REQUESTING_REPLY_FAILED_STRING = "SUPV_HELPER_REQUESTING_REPLY_FAILED"; -const char *SUPV_HELPER_READING_REPLY_FAILED_STRING = "SUPV_HELPER_READING_REPLY_FAILED"; -const char *SUPV_MISSING_ACK_STRING = "SUPV_MISSING_ACK"; -const char *SUPV_MISSING_EXE_STRING = "SUPV_MISSING_EXE"; -const char *SUPV_ACK_FAILURE_REPORT_STRING = "SUPV_ACK_FAILURE_REPORT"; -const char *SUPV_EXE_FAILURE_REPORT_STRING = "SUPV_EXE_FAILURE_REPORT"; -const char *SUPV_ACK_INVALID_APID_STRING = "SUPV_ACK_INVALID_APID"; -const char *SUPV_EXE_INVALID_APID_STRING = "SUPV_EXE_INVALID_APID"; const char *SEND_MRAM_DUMP_FAILED_STRING = "SEND_MRAM_DUMP_FAILED"; const char *MRAM_DUMP_FAILED_STRING = "MRAM_DUMP_FAILED"; const char *MRAM_DUMP_FINISHED_STRING = "MRAM_DUMP_FINISHED"; @@ -189,10 +174,25 @@ const char *NOT_ENOUGH_DEVICES_DUAL_MODE_STRING = "NOT_ENOUGH_DEVICES_DUAL_MODE" const char *POWER_STATE_MACHINE_TIMEOUT_STRING = "POWER_STATE_MACHINE_TIMEOUT"; const char *SIDE_SWITCH_TRANSITION_NOT_ALLOWED_STRING = "SIDE_SWITCH_TRANSITION_NOT_ALLOWED"; const char *CHILDREN_LOST_MODE_STRING = "CHILDREN_LOST_MODE"; -const char *ALLOC_FAILURE_STRING = "ALLOC_FAILURE"; -const char *REBOOT_SW_STRING = "REBOOT_SW"; -const char *REBOOT_MECHANISM_TRIGGERED_STRING = "REBOOT_MECHANISM_TRIGGERED"; -const char *REBOOT_HW_STRING = "REBOOT_HW"; +const char *GPS_FIX_CHANGE_STRING = "GPS_FIX_CHANGE"; +const char *P60_BOOT_COUNT_STRING = "P60_BOOT_COUNT"; +const char *BATT_MODE_STRING = "BATT_MODE"; +const char *BATT_MODE_CHANGED_STRING = "BATT_MODE_CHANGED"; +const char *SUPV_UPDATE_FAILED_STRING = "SUPV_UPDATE_FAILED"; +const char *SUPV_UPDATE_SUCCESSFUL_STRING = "SUPV_UPDATE_SUCCESSFUL"; +const char *TERMINATED_UPDATE_PROCEDURE_STRING = "TERMINATED_UPDATE_PROCEDURE"; +const char *SUPV_EVENT_BUFFER_REQUEST_SUCCESSFUL_STRING = "SUPV_EVENT_BUFFER_REQUEST_SUCCESSFUL"; +const char *SUPV_EVENT_BUFFER_REQUEST_FAILED_STRING = "SUPV_EVENT_BUFFER_REQUEST_FAILED"; +const char *SUPV_EVENT_BUFFER_REQUEST_TERMINATED_STRING = "SUPV_EVENT_BUFFER_REQUEST_TERMINATED"; +const char *SUPV_SENDING_COMMAND_FAILED_STRING = "SUPV_SENDING_COMMAND_FAILED"; +const char *SUPV_HELPER_REQUESTING_REPLY_FAILED_STRING = "SUPV_HELPER_REQUESTING_REPLY_FAILED"; +const char *SUPV_HELPER_READING_REPLY_FAILED_STRING = "SUPV_HELPER_READING_REPLY_FAILED"; +const char *SUPV_MISSING_ACK_STRING = "SUPV_MISSING_ACK"; +const char *SUPV_MISSING_EXE_STRING = "SUPV_MISSING_EXE"; +const char *SUPV_ACK_FAILURE_REPORT_STRING = "SUPV_ACK_FAILURE_REPORT"; +const char *SUPV_EXE_FAILURE_REPORT_STRING = "SUPV_EXE_FAILURE_REPORT"; +const char *SUPV_ACK_INVALID_APID_STRING = "SUPV_ACK_INVALID_APID"; +const char *SUPV_EXE_INVALID_APID_STRING = "SUPV_EXE_INVALID_APID"; const char *translateEvents(Event event) { switch ((event & 0xFFFF)) { @@ -354,224 +354,224 @@ const char *translateEvents(Event event) { return TEST_STRING; case (10600): return CHANGE_OF_SETUP_PARAMETER_STRING; - case (10800): + case (11300): return SWITCH_CMD_SENT_STRING; - case (10801): - return SWITCH_HAS_CHANGED_STRING; - case (10802): - return SWITCHING_Q7S_DENIED_STRING; - case (10900): - return GPIO_PULL_HIGH_FAILED_STRING; - case (10901): - return GPIO_PULL_LOW_FAILED_STRING; - case (10902): - return SWITCH_ALREADY_ON_STRING; - case (10903): - return SWITCH_ALREADY_OFF_STRING; - case (10904): - return MAIN_SWITCH_TIMEOUT_STRING; - case (11000): - return MAIN_SWITCH_ON_TIMEOUT_STRING; - case (11001): - return MAIN_SWITCH_OFF_TIMEOUT_STRING; - case (11002): - return DEPLOYMENT_FAILED_STRING; - case (11003): - return DEPL_SA1_GPIO_SWTICH_ON_FAILED_STRING; - case (11004): - return DEPL_SA2_GPIO_SWTICH_ON_FAILED_STRING; - case (11101): - return MEMORY_READ_RPT_CRC_FAILURE_STRING; - case (11102): - return ACK_FAILURE_STRING; - case (11103): - return EXE_FAILURE_STRING; - case (11104): - return MPSOC_HANDLER_CRC_FAILURE_STRING; - case (11105): - return MPSOC_HANDLER_SEQ_CNT_MISMATCH_STRING; - case (11106): - return MPSOC_SHUTDOWN_FAILED_STRING; - case (11201): - return SELF_TEST_I2C_FAILURE_STRING; - case (11202): - return SELF_TEST_SPI_FAILURE_STRING; - case (11203): - return SELF_TEST_ADC_FAILURE_STRING; - case (11204): - return SELF_TEST_PWM_FAILURE_STRING; - case (11205): - return SELF_TEST_TC_FAILURE_STRING; - case (11206): - return SELF_TEST_MTM_RANGE_FAILURE_STRING; - case (11207): - return SELF_TEST_COIL_CURRENT_FAILURE_STRING; - case (11208): - return INVALID_ERROR_BYTE_STRING; case (11301): - return ERROR_STATE_STRING; + return SWITCH_HAS_CHANGED_STRING; + case (11302): + return SWITCHING_Q7S_DENIED_STRING; + case (11400): + return GPIO_PULL_HIGH_FAILED_STRING; case (11401): - return BOOTING_FIRMWARE_FAILED_STRING; + return GPIO_PULL_LOW_FAILED_STRING; case (11402): - return BOOTING_BOOTLOADER_FAILED_STRING; + return SWITCH_ALREADY_ON_STRING; + case (11403): + return SWITCH_ALREADY_OFF_STRING; + case (11404): + return MAIN_SWITCH_TIMEOUT_STRING; + case (11500): + return MAIN_SWITCH_ON_TIMEOUT_STRING; case (11501): - return SUPV_MEMORY_READ_RPT_CRC_FAILURE_STRING; + return MAIN_SWITCH_OFF_TIMEOUT_STRING; case (11502): - return SUPV_ACK_FAILURE_STRING; + return DEPLOYMENT_FAILED_STRING; case (11503): - return SUPV_EXE_FAILURE_STRING; + return DEPL_SA1_GPIO_SWTICH_ON_FAILED_STRING; case (11504): - return SUPV_CRC_FAILURE_EVENT_STRING; - case (11505): - return SUPV_HELPER_EXECUTING_STRING; - case (11600): - return SANITIZATION_FAILED_STRING; + return DEPL_SA2_GPIO_SWTICH_ON_FAILED_STRING; case (11601): - return MOUNTED_SD_CARD_STRING; - case (11700): - return SUPV_UPDATE_FAILED_STRING; + return MEMORY_READ_RPT_CRC_FAILURE_STRING; + case (11602): + return ACK_FAILURE_STRING; + case (11603): + return EXE_FAILURE_STRING; + case (11604): + return MPSOC_HANDLER_CRC_FAILURE_STRING; + case (11605): + return MPSOC_HANDLER_SEQ_CNT_MISMATCH_STRING; + case (11606): + return MPSOC_SHUTDOWN_FAILED_STRING; case (11701): - return SUPV_UPDATE_SUCCESSFUL_STRING; + return SELF_TEST_I2C_FAILURE_STRING; case (11702): - return TERMINATED_UPDATE_PROCEDURE_STRING; + return SELF_TEST_SPI_FAILURE_STRING; case (11703): - return SUPV_EVENT_BUFFER_REQUEST_SUCCESSFUL_STRING; + return SELF_TEST_ADC_FAILURE_STRING; case (11704): - return SUPV_EVENT_BUFFER_REQUEST_FAILED_STRING; + return SELF_TEST_PWM_FAILURE_STRING; case (11705): - return SUPV_EVENT_BUFFER_REQUEST_TERMINATED_STRING; + return SELF_TEST_TC_FAILURE_STRING; case (11706): - return SUPV_SENDING_COMMAND_FAILED_STRING; + return SELF_TEST_MTM_RANGE_FAILURE_STRING; case (11707): - return SUPV_HELPER_REQUESTING_REPLY_FAILED_STRING; + return SELF_TEST_COIL_CURRENT_FAILURE_STRING; case (11708): - return SUPV_HELPER_READING_REPLY_FAILED_STRING; - case (11709): - return SUPV_MISSING_ACK_STRING; - case (11710): - return SUPV_MISSING_EXE_STRING; - case (11711): - return SUPV_ACK_FAILURE_REPORT_STRING; - case (11712): - return SUPV_EXE_FAILURE_REPORT_STRING; - case (11713): - return SUPV_ACK_INVALID_APID_STRING; - case (11714): - return SUPV_EXE_INVALID_APID_STRING; - case (11800): - return SEND_MRAM_DUMP_FAILED_STRING; + return INVALID_ERROR_BYTE_STRING; case (11801): - return MRAM_DUMP_FAILED_STRING; - case (11802): - return MRAM_DUMP_FINISHED_STRING; + return ERROR_STATE_STRING; case (11901): - return INVALID_TC_FRAME_STRING; + return BOOTING_FIRMWARE_FAILED_STRING; case (11902): - return INVALID_FAR_STRING; - case (11903): - return CARRIER_LOCK_STRING; - case (11904): - return BIT_LOCK_PDEC_STRING; - case (12000): - return IMAGE_UPLOAD_FAILED_STRING; + return BOOTING_BOOTLOADER_FAILED_STRING; case (12001): - return IMAGE_DOWNLOAD_FAILED_STRING; + return SUPV_MEMORY_READ_RPT_CRC_FAILURE_STRING; case (12002): - return IMAGE_UPLOAD_SUCCESSFUL_STRING; + return SUPV_ACK_FAILURE_STRING; case (12003): - return IMAGE_DOWNLOAD_SUCCESSFUL_STRING; + return SUPV_EXE_FAILURE_STRING; case (12004): - return FLASH_WRITE_SUCCESSFUL_STRING; + return SUPV_CRC_FAILURE_EVENT_STRING; case (12005): - return FLASH_READ_SUCCESSFUL_STRING; - case (12006): - return FLASH_READ_FAILED_STRING; - case (12007): - return FIRMWARE_UPDATE_SUCCESSFUL_STRING; - case (12008): - return FIRMWARE_UPDATE_FAILED_STRING; - case (12009): - return STR_HELPER_READING_REPLY_FAILED_STRING; - case (12010): - return STR_HELPER_COM_ERROR_STRING; - case (12011): - return STR_HELPER_NO_REPLY_STRING; - case (12012): - return STR_HELPER_DEC_ERROR_STRING; - case (12013): - return POSITION_MISMATCH_STRING; - case (12014): - return STR_HELPER_FILE_NOT_EXISTS_STRING; - case (12015): - return STR_HELPER_SENDING_PACKET_FAILED_STRING; - case (12016): - return STR_HELPER_REQUESTING_MSG_FAILED_STRING; + return SUPV_HELPER_EXECUTING_STRING; case (12100): - return MPSOC_FLASH_WRITE_FAILED_STRING; + return SANITIZATION_FAILED_STRING; case (12101): - return MPSOC_FLASH_WRITE_SUCCESSFUL_STRING; - case (12102): - return MPSOC_SENDING_COMMAND_FAILED_STRING; - case (12103): - return MPSOC_HELPER_REQUESTING_REPLY_FAILED_STRING; - case (12104): - return MPSOC_HELPER_READING_REPLY_FAILED_STRING; - case (12105): - return MPSOC_MISSING_ACK_STRING; - case (12106): - return MPSOC_MISSING_EXE_STRING; - case (12107): - return MPSOC_ACK_FAILURE_REPORT_STRING; - case (12108): - return MPSOC_EXE_FAILURE_REPORT_STRING; - case (12109): - return MPSOC_ACK_INVALID_APID_STRING; - case (12110): - return MPSOC_EXE_INVALID_APID_STRING; - case (12111): - return MPSOC_HELPER_SEQ_CNT_MISMATCH_STRING; - case (12200): - return TRANSITION_BACK_TO_OFF_STRING; - case (12201): - return NEG_V_OUT_OF_BOUNDS_STRING; - case (12202): - return U_DRO_OUT_OF_BOUNDS_STRING; - case (12203): - return I_DRO_OUT_OF_BOUNDS_STRING; - case (12204): - return U_X8_OUT_OF_BOUNDS_STRING; - case (12205): - return I_X8_OUT_OF_BOUNDS_STRING; - case (12206): - return U_TX_OUT_OF_BOUNDS_STRING; - case (12207): - return I_TX_OUT_OF_BOUNDS_STRING; - case (12208): - return U_MPA_OUT_OF_BOUNDS_STRING; - case (12209): - return I_MPA_OUT_OF_BOUNDS_STRING; - case (12210): - return U_HPA_OUT_OF_BOUNDS_STRING; - case (12211): - return I_HPA_OUT_OF_BOUNDS_STRING; + return MOUNTED_SD_CARD_STRING; case (12300): - return TRANSITION_OTHER_SIDE_FAILED_STRING; + return SEND_MRAM_DUMP_FAILED_STRING; case (12301): - return NOT_ENOUGH_DEVICES_DUAL_MODE_STRING; + return MRAM_DUMP_FAILED_STRING; case (12302): - return POWER_STATE_MACHINE_TIMEOUT_STRING; - case (12303): - return SIDE_SWITCH_TRANSITION_NOT_ALLOWED_STRING; + return MRAM_DUMP_FINISHED_STRING; + case (12401): + return INVALID_TC_FRAME_STRING; + case (12402): + return INVALID_FAR_STRING; + case (12403): + return CARRIER_LOCK_STRING; + case (12404): + return BIT_LOCK_PDEC_STRING; case (12500): + return IMAGE_UPLOAD_FAILED_STRING; + case (12501): + return IMAGE_DOWNLOAD_FAILED_STRING; + case (12502): + return IMAGE_UPLOAD_SUCCESSFUL_STRING; + case (12503): + return IMAGE_DOWNLOAD_SUCCESSFUL_STRING; + case (12504): + return FLASH_WRITE_SUCCESSFUL_STRING; + case (12505): + return FLASH_READ_SUCCESSFUL_STRING; + case (12506): + return FLASH_READ_FAILED_STRING; + case (12507): + return FIRMWARE_UPDATE_SUCCESSFUL_STRING; + case (12508): + return FIRMWARE_UPDATE_FAILED_STRING; + case (12509): + return STR_HELPER_READING_REPLY_FAILED_STRING; + case (12510): + return STR_HELPER_COM_ERROR_STRING; + case (12511): + return STR_HELPER_NO_REPLY_STRING; + case (12512): + return STR_HELPER_DEC_ERROR_STRING; + case (12513): + return POSITION_MISMATCH_STRING; + case (12514): + return STR_HELPER_FILE_NOT_EXISTS_STRING; + case (12515): + return STR_HELPER_SENDING_PACKET_FAILED_STRING; + case (12516): + return STR_HELPER_REQUESTING_MSG_FAILED_STRING; + case (12600): + return MPSOC_FLASH_WRITE_FAILED_STRING; + case (12601): + return MPSOC_FLASH_WRITE_SUCCESSFUL_STRING; + case (12602): + return MPSOC_SENDING_COMMAND_FAILED_STRING; + case (12603): + return MPSOC_HELPER_REQUESTING_REPLY_FAILED_STRING; + case (12604): + return MPSOC_HELPER_READING_REPLY_FAILED_STRING; + case (12605): + return MPSOC_MISSING_ACK_STRING; + case (12606): + return MPSOC_MISSING_EXE_STRING; + case (12607): + return MPSOC_ACK_FAILURE_REPORT_STRING; + case (12608): + return MPSOC_EXE_FAILURE_REPORT_STRING; + case (12609): + return MPSOC_ACK_INVALID_APID_STRING; + case (12610): + return MPSOC_EXE_INVALID_APID_STRING; + case (12611): + return MPSOC_HELPER_SEQ_CNT_MISMATCH_STRING; + case (12700): + return TRANSITION_BACK_TO_OFF_STRING; + case (12701): + return NEG_V_OUT_OF_BOUNDS_STRING; + case (12702): + return U_DRO_OUT_OF_BOUNDS_STRING; + case (12703): + return I_DRO_OUT_OF_BOUNDS_STRING; + case (12704): + return U_X8_OUT_OF_BOUNDS_STRING; + case (12705): + return I_X8_OUT_OF_BOUNDS_STRING; + case (12706): + return U_TX_OUT_OF_BOUNDS_STRING; + case (12707): + return I_TX_OUT_OF_BOUNDS_STRING; + case (12708): + return U_MPA_OUT_OF_BOUNDS_STRING; + case (12709): + return I_MPA_OUT_OF_BOUNDS_STRING; + case (12710): + return U_HPA_OUT_OF_BOUNDS_STRING; + case (12711): + return I_HPA_OUT_OF_BOUNDS_STRING; + case (12800): + return TRANSITION_OTHER_SIDE_FAILED_STRING; + case (12801): + return NOT_ENOUGH_DEVICES_DUAL_MODE_STRING; + case (12802): + return POWER_STATE_MACHINE_TIMEOUT_STRING; + case (12803): + return SIDE_SWITCH_TRANSITION_NOT_ALLOWED_STRING; + case (13000): return CHILDREN_LOST_MODE_STRING; + case (13100): + return GPS_FIX_CHANGE_STRING; + case (13200): + return P60_BOOT_COUNT_STRING; + case (13201): + return BATT_MODE_STRING; + case (13202): + return BATT_MODE_CHANGED_STRING; case (13600): - return ALLOC_FAILURE_STRING; + return SUPV_UPDATE_FAILED_STRING; case (13601): - return REBOOT_SW_STRING; + return SUPV_UPDATE_SUCCESSFUL_STRING; case (13602): - return REBOOT_MECHANISM_TRIGGERED_STRING; + return TERMINATED_UPDATE_PROCEDURE_STRING; case (13603): - return REBOOT_HW_STRING; + return SUPV_EVENT_BUFFER_REQUEST_SUCCESSFUL_STRING; + case (13604): + return SUPV_EVENT_BUFFER_REQUEST_FAILED_STRING; + case (13605): + return SUPV_EVENT_BUFFER_REQUEST_TERMINATED_STRING; + case (13606): + return SUPV_SENDING_COMMAND_FAILED_STRING; + case (13607): + return SUPV_HELPER_REQUESTING_REPLY_FAILED_STRING; + case (13608): + return SUPV_HELPER_READING_REPLY_FAILED_STRING; + case (13609): + return SUPV_MISSING_ACK_STRING; + case (13610): + return SUPV_MISSING_EXE_STRING; + case (13611): + return SUPV_ACK_FAILURE_REPORT_STRING; + case (13612): + return SUPV_EXE_FAILURE_REPORT_STRING; + case (13613): + return SUPV_ACK_INVALID_APID_STRING; + case (13614): + return SUPV_EXE_INVALID_APID_STRING; default: return "UNKNOWN_EVENT"; } diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index a67bae74..bfb20d25 100644 --- a/generators/objects/translateObjects.cpp +++ b/generators/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 116 translations. - * Generated on: 2022-04-14 15:49:10 + * Generated on: 2022-04-16 17:47:17 */ #include "translateObjects.h" diff --git a/linux/ObjectFactory.cpp b/linux/ObjectFactory.cpp index 267b5f4d..7811fdbe 100644 --- a/linux/ObjectFactory.cpp +++ b/linux/ObjectFactory.cpp @@ -280,7 +280,7 @@ void ObjectFactory::createRtdComponents(std::string spiDev, GpioIF* gpioComIF, TcsBoardHelper helper(rtdIds); TcsBoardAssembly* tcsBoardAss = new TcsBoardAssembly(objects::TCS_BOARD_ASS, objects::NO_OBJECT, pwrSwitcher, - pcduSwitches::Switches::PDU1_CH0_TCS_BOARD_3V3, helper); + pcdu::Switches::PDU1_CH0_TCS_BOARD_3V3, helper); static_cast(tcsBoardAss); #endif // OBSW_ADD_RTD_DEVICES == 1 } diff --git a/linux/boardtest/SpiTestClass.cpp b/linux/boardtest/SpiTestClass.cpp index ff721967..d9eb6b5a 100644 --- a/linux/boardtest/SpiTestClass.cpp +++ b/linux/boardtest/SpiTestClass.cpp @@ -408,7 +408,7 @@ void SpiTestClass::max1227RadSensorTest(int fd) { transfer(fd, gpioIds::CS_RAD_SENSOR); usleep(65); spiTransferStruct[0].len = 24; - std::memcpy(sendBuffer.data(), sendBuffer.data() + 1, 24); + std::memmove(sendBuffer.data(), sendBuffer.data() + 1, 24); transfer(fd, gpioIds::CS_RAD_SENSOR); int16_t tempRaw = ((recvBuffer[22] & 0x0f) << 8) | recvBuffer[23]; float temp = max1227::getTemperature(tempRaw); diff --git a/linux/csp/CspComIF.cpp b/linux/csp/CspComIF.cpp index fa372d4d..9f346405 100644 --- a/linux/csp/CspComIF.cpp +++ b/linux/csp/CspComIF.cpp @@ -141,11 +141,12 @@ ReturnValue_t CspComIF::cspTransfer(uint8_t cspAddress, uint8_t cspPort, const u int cmdLen, uint16_t querySize) { uint32_t timeout_ms = 1000; uint16_t bytesRead = 0; - int32_t expectedSize = (int32_t)querySize; + int32_t expectedSize = static_cast(querySize); vectorBufferIter iter = cspDeviceMap.find(cspAddress); if (iter == cspDeviceMap.end()) { sif::error << "CSP device with address " << cspAddress << " no found in" << " device map" << std::endl; + return RETURN_FAILED; } uint8_t* replyBuffer = iter->second.data(); diff --git a/linux/devices/GPSHyperionLinuxController.cpp b/linux/devices/GPSHyperionLinuxController.cpp index a811fbc5..20860211 100644 --- a/linux/devices/GPSHyperionLinuxController.cpp +++ b/linux/devices/GPSHyperionLinuxController.cpp @@ -3,19 +3,24 @@ #include "OBSWConfig.h" #include "fsfw/datapool/PoolReadGuard.h" #include "fsfw/timemanager/Clock.h" +#include "linux/utility/utility.h" +#include "mission/utility/compileTime.h" #if FSFW_DEV_HYPERION_GPS_CREATE_NMEA_CSV == 1 #include #include #endif #include +#include GPSHyperionLinuxController::GPSHyperionLinuxController(object_id_t objectId, object_id_t parentId, bool debugHyperionGps) : ExtendedControllerBase(objectId, objects::NO_OBJECT), gpsSet(this), myGpsmm(GPSD_SHARED_MEMORY, nullptr), - debugHyperionGps(debugHyperionGps) {} + debugHyperionGps(debugHyperionGps) { + timeUpdateCd.resetTimer(); +} GPSHyperionLinuxController::~GPSHyperionLinuxController() {} @@ -76,9 +81,7 @@ ReturnValue_t GPSHyperionLinuxController::initializeLocalDataPool( localDataPoolMap.emplace(GpsHyperion::SATS_IN_USE, new PoolEntry()); localDataPoolMap.emplace(GpsHyperion::SATS_IN_VIEW, new PoolEntry()); localDataPoolMap.emplace(GpsHyperion::FIX_MODE, new PoolEntry()); -#if OBSW_ENABLE_PERIODIC_HK == 1 - poolManager.subscribeForPeriodicPacket(gpsSet.getSid(), true, 2.0, false); -#endif + poolManager.subscribeForPeriodicPacket(gpsSet.getSid(), false, 30.0, false); return HasReturnvaluesIF::RETURN_OK; } @@ -124,8 +127,17 @@ void GPSHyperionLinuxController::readGpsDataFromGpsd() { return; } + bool validFix = false; + static_cast(validFix); // 0: Not seen, 1: No fix, 2: 2D-Fix, 3: 3D-Fix - gpsSet.fixMode.value = gps->fix.mode; + int newFixMode = gps->fix.mode; + if (newFixMode == 2 or newFixMode == 3) { + validFix = true; + } + if (gpsSet.fixMode.value != newFixMode) { + triggerEvent(GpsHyperion::GPS_FIX_CHANGE, gpsSet.fixMode.value, newFixMode); + } + gpsSet.fixMode.value = newFixMode; if (gps->fix.mode == 0 or gps->fix.mode == 1) { if (modeCommanded and maxTimeToReachFix.hasTimedOut()) { // We are supposed to be on and functioning, but not fix was found @@ -172,6 +184,34 @@ void GPSHyperionLinuxController::readGpsDataFromGpsd() { timeval time = {}; time.tv_sec = gpsSet.unixSeconds.value; time.tv_usec = gps->fix.time.tv_nsec / 1000; + std::time_t t = std::time(nullptr); + if (time.tv_sec == t) { + timeIsConstantCounter++; + } else { + timeIsConstantCounter = 0; + } + if (timeInit and validFix) { + if (not utility::timeSanityCheck()) { +#if OBSW_VERBOSE_LEVEL >= 1 + time_t timeRaw = time.tv_sec; + std::tm *timeTm = std::gmtime(&timeRaw); + sif::info << "Setting invalid system time from GPS data directly: " + << std::put_time(timeTm, "%c %Z") << std::endl; +#endif + // For some reason, the clock needs to be somewhat correct for NTP to work. Really dumb.. + Clock::setClock(&time); + } + timeInit = false; + } + // If the received time does not change anymore for whatever reason, do not set it here + // to avoid stale times. Also, don't do it too often often to avoid jumping times + if (timeIsConstantCounter < 20 and timeUpdateCd.hasTimedOut()) { + // Update the system time here for now. NTP seems to be unable to do so for whatever reason. + // Further tests have shown that the time seems to be set by NTPD after some time.. + // Clock::setClock(&time); + timeUpdateCd.resetTimer(); + } + Clock::TimeOfDay_t timeOfDay = {}; Clock::convertTimevalToTimeOfDay(&time, &timeOfDay); gpsSet.year = timeOfDay.year; @@ -192,6 +232,9 @@ void GPSHyperionLinuxController::readGpsDataFromGpsd() { std::cout << "Longitude: " << gps->fix.longitude << std::endl; std::cout << "Altitude(MSL): " << gps->fix.altMSL << std::endl; std::cout << "Speed(m/s): " << gps->fix.speed << std::endl; + std::time_t t = std::time(nullptr); + std::tm tm = *std::gmtime(&t); + std::cout << "C Time: " << std::put_time(&tm, "%c") << std::endl; } } #endif diff --git a/linux/devices/GPSHyperionLinuxController.h b/linux/devices/GPSHyperionLinuxController.h index f0e4e6e0..dedd782c 100644 --- a/linux/devices/GPSHyperionLinuxController.h +++ b/linux/devices/GPSHyperionLinuxController.h @@ -1,6 +1,7 @@ #ifndef MISSION_DEVICES_GPSHYPERIONHANDLER_H_ #define MISSION_DEVICES_GPSHYPERIONHANDLER_H_ +#include "commonSubsystemIds.h" #include "fsfw/FSFW.h" #include "fsfw/controller/ExtendedControllerBase.h" #include "fsfw/devicehandlers/DeviceHandlerBase.h" @@ -22,6 +23,7 @@ class GPSHyperionLinuxController : public ExtendedControllerBase { public: static constexpr uint32_t MAX_SECONDS_TO_REACH_FIX = 60 * 60 * 5; + GPSHyperionLinuxController(object_id_t objectId, object_id_t parentId, bool debugHyperionGps = false); virtual ~GPSHyperionLinuxController(); @@ -49,8 +51,11 @@ class GPSHyperionLinuxController : public ExtendedControllerBase { GpsPrimaryDataset gpsSet; Countdown maxTimeToReachFix = Countdown(MAX_SECONDS_TO_REACH_FIX * 1000); bool modeCommanded = true; + bool timeInit = true; gpsmm myGpsmm; bool debugHyperionGps = false; + uint32_t timeIsConstantCounter = 0; + Countdown timeUpdateCd = Countdown(60); void readGpsDataFromGpsd(); }; diff --git a/linux/devices/ploc/PlocSupvHelper.cpp b/linux/devices/ploc/PlocSupvHelper.cpp index 2e78149a..e16ebf69 100644 --- a/linux/devices/ploc/PlocSupvHelper.cpp +++ b/linux/devices/ploc/PlocSupvHelper.cpp @@ -191,8 +191,8 @@ ReturnValue_t PlocSupvHelper::performUpdate() { bytesWritten += dataLength; #if OBSW_DEBUG_PLOC_SUPERVISOR == 1 progressPrinter.print(bytesWritten); - } #endif /* OBSW_DEBUG_PLOC_SUPERVISOR == 1 */ + } result = handleCheckMemoryCommand(); if (result != RETURN_OK) { return result; @@ -262,6 +262,7 @@ ReturnValue_t PlocSupvHelper::handlePacketTransmission(SpacePacket& packet) { ReturnValue_t PlocSupvHelper::sendCommand(SpacePacket& packet) { ReturnValue_t result = RETURN_OK; + rememberApid = packet.getAPID(); result = uartComIF->sendMessage(comCookie, packet.getWholeData(), packet.getFullSize()); if (result != RETURN_OK) { sif::warning << "PlocSupvHelper::sendCommand: Failed to send command" << std::endl; @@ -276,6 +277,7 @@ ReturnValue_t PlocSupvHelper::handleAck() { supv::TmPacket tmPacket; result = handleTmReception(&tmPacket, supv::SIZE_ACK_REPORT); if (result != RETURN_OK) { + triggerEvent(ACK_RECEPTION_FAILURE, result, static_cast(rememberApid)); sif::warning << "PlocSupvHelper::handleAck: Error in reception of acknowledgment report" << std::endl; return result; @@ -305,6 +307,7 @@ ReturnValue_t PlocSupvHelper::handleExe() { supv::TmPacket tmPacket; result = handleTmReception(&tmPacket, supv::SIZE_EXE_REPORT); if (result != RETURN_OK) { + triggerEvent(EXE_RECEPTION_FAILURE, result, static_cast(rememberApid)); sif::warning << "PlocSupvHelper::handleExe: Error in reception of execution report" << std::endl; return result; diff --git a/linux/devices/ploc/PlocSupvHelper.h b/linux/devices/ploc/PlocSupvHelper.h index 80ab4aeb..9326c3a9 100644 --- a/linux/devices/ploc/PlocSupvHelper.h +++ b/linux/devices/ploc/PlocSupvHelper.h @@ -72,6 +72,14 @@ class PlocSupvHelper : public SystemObject, public ExecutableObjectIF, public Ha //! P1: Apid of received space packet //! P2: Internal state of supervisor helper static const Event SUPV_EXE_INVALID_APID = MAKE_EVENT(14, severity::LOW); + //! [EXPORT] : [COMMENT] Failed to receive acknowledgment report + //! P1: Return value + //! P2: Apid of command for which the reception of the acknowledgment report failed + static const Event ACK_RECEPTION_FAILURE = MAKE_EVENT(15, severity::LOW); + //! [EXPORT] : [COMMENT] Failed to receive execution report + //! P1: Return value + //! P2: Apid of command for which the reception of the execution report failed + static const Event EXE_RECEPTION_FAILURE = MAKE_EVENT(16, severity::LOW); PlocSupvHelper(object_id_t objectId); virtual ~PlocSupvHelper(); @@ -167,6 +175,9 @@ class PlocSupvHelper : public SystemObject, public ExecutableObjectIF, public Ha bool timestamping = true; + // Remembers APID to know at which command a procedure failed + uint16_t rememberApid = 0; + ReturnValue_t performUpdate(); ReturnValue_t performEventBufferRequest(); ReturnValue_t handlePacketTransmission(SpacePacket& packet); diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index 842d6979..29b8fc52 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 192 translations. * @details - * Generated on: 2022-04-14 15:49:05 + * Generated on: 2022-04-16 17:47:08 */ #include "translateEvents.h" @@ -121,21 +121,6 @@ const char *SUPV_CRC_FAILURE_EVENT_STRING = "SUPV_CRC_FAILURE_EVENT"; const char *SUPV_HELPER_EXECUTING_STRING = "SUPV_HELPER_EXECUTING"; const char *SANITIZATION_FAILED_STRING = "SANITIZATION_FAILED"; const char *MOUNTED_SD_CARD_STRING = "MOUNTED_SD_CARD"; -const char *SUPV_UPDATE_FAILED_STRING = "SUPV_UPDATE_FAILED"; -const char *SUPV_UPDATE_SUCCESSFUL_STRING = "SUPV_UPDATE_SUCCESSFUL"; -const char *TERMINATED_UPDATE_PROCEDURE_STRING = "TERMINATED_UPDATE_PROCEDURE"; -const char *SUPV_EVENT_BUFFER_REQUEST_SUCCESSFUL_STRING = "SUPV_EVENT_BUFFER_REQUEST_SUCCESSFUL"; -const char *SUPV_EVENT_BUFFER_REQUEST_FAILED_STRING = "SUPV_EVENT_BUFFER_REQUEST_FAILED"; -const char *SUPV_EVENT_BUFFER_REQUEST_TERMINATED_STRING = "SUPV_EVENT_BUFFER_REQUEST_TERMINATED"; -const char *SUPV_SENDING_COMMAND_FAILED_STRING = "SUPV_SENDING_COMMAND_FAILED"; -const char *SUPV_HELPER_REQUESTING_REPLY_FAILED_STRING = "SUPV_HELPER_REQUESTING_REPLY_FAILED"; -const char *SUPV_HELPER_READING_REPLY_FAILED_STRING = "SUPV_HELPER_READING_REPLY_FAILED"; -const char *SUPV_MISSING_ACK_STRING = "SUPV_MISSING_ACK"; -const char *SUPV_MISSING_EXE_STRING = "SUPV_MISSING_EXE"; -const char *SUPV_ACK_FAILURE_REPORT_STRING = "SUPV_ACK_FAILURE_REPORT"; -const char *SUPV_EXE_FAILURE_REPORT_STRING = "SUPV_EXE_FAILURE_REPORT"; -const char *SUPV_ACK_INVALID_APID_STRING = "SUPV_ACK_INVALID_APID"; -const char *SUPV_EXE_INVALID_APID_STRING = "SUPV_EXE_INVALID_APID"; const char *SEND_MRAM_DUMP_FAILED_STRING = "SEND_MRAM_DUMP_FAILED"; const char *MRAM_DUMP_FAILED_STRING = "MRAM_DUMP_FAILED"; const char *MRAM_DUMP_FINISHED_STRING = "MRAM_DUMP_FINISHED"; @@ -189,10 +174,25 @@ const char *NOT_ENOUGH_DEVICES_DUAL_MODE_STRING = "NOT_ENOUGH_DEVICES_DUAL_MODE" const char *POWER_STATE_MACHINE_TIMEOUT_STRING = "POWER_STATE_MACHINE_TIMEOUT"; const char *SIDE_SWITCH_TRANSITION_NOT_ALLOWED_STRING = "SIDE_SWITCH_TRANSITION_NOT_ALLOWED"; const char *CHILDREN_LOST_MODE_STRING = "CHILDREN_LOST_MODE"; -const char *ALLOC_FAILURE_STRING = "ALLOC_FAILURE"; -const char *REBOOT_SW_STRING = "REBOOT_SW"; -const char *REBOOT_MECHANISM_TRIGGERED_STRING = "REBOOT_MECHANISM_TRIGGERED"; -const char *REBOOT_HW_STRING = "REBOOT_HW"; +const char *GPS_FIX_CHANGE_STRING = "GPS_FIX_CHANGE"; +const char *P60_BOOT_COUNT_STRING = "P60_BOOT_COUNT"; +const char *BATT_MODE_STRING = "BATT_MODE"; +const char *BATT_MODE_CHANGED_STRING = "BATT_MODE_CHANGED"; +const char *SUPV_UPDATE_FAILED_STRING = "SUPV_UPDATE_FAILED"; +const char *SUPV_UPDATE_SUCCESSFUL_STRING = "SUPV_UPDATE_SUCCESSFUL"; +const char *TERMINATED_UPDATE_PROCEDURE_STRING = "TERMINATED_UPDATE_PROCEDURE"; +const char *SUPV_EVENT_BUFFER_REQUEST_SUCCESSFUL_STRING = "SUPV_EVENT_BUFFER_REQUEST_SUCCESSFUL"; +const char *SUPV_EVENT_BUFFER_REQUEST_FAILED_STRING = "SUPV_EVENT_BUFFER_REQUEST_FAILED"; +const char *SUPV_EVENT_BUFFER_REQUEST_TERMINATED_STRING = "SUPV_EVENT_BUFFER_REQUEST_TERMINATED"; +const char *SUPV_SENDING_COMMAND_FAILED_STRING = "SUPV_SENDING_COMMAND_FAILED"; +const char *SUPV_HELPER_REQUESTING_REPLY_FAILED_STRING = "SUPV_HELPER_REQUESTING_REPLY_FAILED"; +const char *SUPV_HELPER_READING_REPLY_FAILED_STRING = "SUPV_HELPER_READING_REPLY_FAILED"; +const char *SUPV_MISSING_ACK_STRING = "SUPV_MISSING_ACK"; +const char *SUPV_MISSING_EXE_STRING = "SUPV_MISSING_EXE"; +const char *SUPV_ACK_FAILURE_REPORT_STRING = "SUPV_ACK_FAILURE_REPORT"; +const char *SUPV_EXE_FAILURE_REPORT_STRING = "SUPV_EXE_FAILURE_REPORT"; +const char *SUPV_ACK_INVALID_APID_STRING = "SUPV_ACK_INVALID_APID"; +const char *SUPV_EXE_INVALID_APID_STRING = "SUPV_EXE_INVALID_APID"; const char *translateEvents(Event event) { switch ((event & 0xFFFF)) { @@ -354,224 +354,224 @@ const char *translateEvents(Event event) { return TEST_STRING; case (10600): return CHANGE_OF_SETUP_PARAMETER_STRING; - case (10800): + case (11300): return SWITCH_CMD_SENT_STRING; - case (10801): - return SWITCH_HAS_CHANGED_STRING; - case (10802): - return SWITCHING_Q7S_DENIED_STRING; - case (10900): - return GPIO_PULL_HIGH_FAILED_STRING; - case (10901): - return GPIO_PULL_LOW_FAILED_STRING; - case (10902): - return SWITCH_ALREADY_ON_STRING; - case (10903): - return SWITCH_ALREADY_OFF_STRING; - case (10904): - return MAIN_SWITCH_TIMEOUT_STRING; - case (11000): - return MAIN_SWITCH_ON_TIMEOUT_STRING; - case (11001): - return MAIN_SWITCH_OFF_TIMEOUT_STRING; - case (11002): - return DEPLOYMENT_FAILED_STRING; - case (11003): - return DEPL_SA1_GPIO_SWTICH_ON_FAILED_STRING; - case (11004): - return DEPL_SA2_GPIO_SWTICH_ON_FAILED_STRING; - case (11101): - return MEMORY_READ_RPT_CRC_FAILURE_STRING; - case (11102): - return ACK_FAILURE_STRING; - case (11103): - return EXE_FAILURE_STRING; - case (11104): - return MPSOC_HANDLER_CRC_FAILURE_STRING; - case (11105): - return MPSOC_HANDLER_SEQ_CNT_MISMATCH_STRING; - case (11106): - return MPSOC_SHUTDOWN_FAILED_STRING; - case (11201): - return SELF_TEST_I2C_FAILURE_STRING; - case (11202): - return SELF_TEST_SPI_FAILURE_STRING; - case (11203): - return SELF_TEST_ADC_FAILURE_STRING; - case (11204): - return SELF_TEST_PWM_FAILURE_STRING; - case (11205): - return SELF_TEST_TC_FAILURE_STRING; - case (11206): - return SELF_TEST_MTM_RANGE_FAILURE_STRING; - case (11207): - return SELF_TEST_COIL_CURRENT_FAILURE_STRING; - case (11208): - return INVALID_ERROR_BYTE_STRING; case (11301): - return ERROR_STATE_STRING; + return SWITCH_HAS_CHANGED_STRING; + case (11302): + return SWITCHING_Q7S_DENIED_STRING; + case (11400): + return GPIO_PULL_HIGH_FAILED_STRING; case (11401): - return BOOTING_FIRMWARE_FAILED_STRING; + return GPIO_PULL_LOW_FAILED_STRING; case (11402): - return BOOTING_BOOTLOADER_FAILED_STRING; + return SWITCH_ALREADY_ON_STRING; + case (11403): + return SWITCH_ALREADY_OFF_STRING; + case (11404): + return MAIN_SWITCH_TIMEOUT_STRING; + case (11500): + return MAIN_SWITCH_ON_TIMEOUT_STRING; case (11501): - return SUPV_MEMORY_READ_RPT_CRC_FAILURE_STRING; + return MAIN_SWITCH_OFF_TIMEOUT_STRING; case (11502): - return SUPV_ACK_FAILURE_STRING; + return DEPLOYMENT_FAILED_STRING; case (11503): - return SUPV_EXE_FAILURE_STRING; + return DEPL_SA1_GPIO_SWTICH_ON_FAILED_STRING; case (11504): - return SUPV_CRC_FAILURE_EVENT_STRING; - case (11505): - return SUPV_HELPER_EXECUTING_STRING; - case (11600): - return SANITIZATION_FAILED_STRING; + return DEPL_SA2_GPIO_SWTICH_ON_FAILED_STRING; case (11601): - return MOUNTED_SD_CARD_STRING; - case (11700): - return SUPV_UPDATE_FAILED_STRING; + return MEMORY_READ_RPT_CRC_FAILURE_STRING; + case (11602): + return ACK_FAILURE_STRING; + case (11603): + return EXE_FAILURE_STRING; + case (11604): + return MPSOC_HANDLER_CRC_FAILURE_STRING; + case (11605): + return MPSOC_HANDLER_SEQ_CNT_MISMATCH_STRING; + case (11606): + return MPSOC_SHUTDOWN_FAILED_STRING; case (11701): - return SUPV_UPDATE_SUCCESSFUL_STRING; + return SELF_TEST_I2C_FAILURE_STRING; case (11702): - return TERMINATED_UPDATE_PROCEDURE_STRING; + return SELF_TEST_SPI_FAILURE_STRING; case (11703): - return SUPV_EVENT_BUFFER_REQUEST_SUCCESSFUL_STRING; + return SELF_TEST_ADC_FAILURE_STRING; case (11704): - return SUPV_EVENT_BUFFER_REQUEST_FAILED_STRING; + return SELF_TEST_PWM_FAILURE_STRING; case (11705): - return SUPV_EVENT_BUFFER_REQUEST_TERMINATED_STRING; + return SELF_TEST_TC_FAILURE_STRING; case (11706): - return SUPV_SENDING_COMMAND_FAILED_STRING; + return SELF_TEST_MTM_RANGE_FAILURE_STRING; case (11707): - return SUPV_HELPER_REQUESTING_REPLY_FAILED_STRING; + return SELF_TEST_COIL_CURRENT_FAILURE_STRING; case (11708): - return SUPV_HELPER_READING_REPLY_FAILED_STRING; - case (11709): - return SUPV_MISSING_ACK_STRING; - case (11710): - return SUPV_MISSING_EXE_STRING; - case (11711): - return SUPV_ACK_FAILURE_REPORT_STRING; - case (11712): - return SUPV_EXE_FAILURE_REPORT_STRING; - case (11713): - return SUPV_ACK_INVALID_APID_STRING; - case (11714): - return SUPV_EXE_INVALID_APID_STRING; - case (11800): - return SEND_MRAM_DUMP_FAILED_STRING; + return INVALID_ERROR_BYTE_STRING; case (11801): - return MRAM_DUMP_FAILED_STRING; - case (11802): - return MRAM_DUMP_FINISHED_STRING; + return ERROR_STATE_STRING; case (11901): - return INVALID_TC_FRAME_STRING; + return BOOTING_FIRMWARE_FAILED_STRING; case (11902): - return INVALID_FAR_STRING; - case (11903): - return CARRIER_LOCK_STRING; - case (11904): - return BIT_LOCK_PDEC_STRING; - case (12000): - return IMAGE_UPLOAD_FAILED_STRING; + return BOOTING_BOOTLOADER_FAILED_STRING; case (12001): - return IMAGE_DOWNLOAD_FAILED_STRING; + return SUPV_MEMORY_READ_RPT_CRC_FAILURE_STRING; case (12002): - return IMAGE_UPLOAD_SUCCESSFUL_STRING; + return SUPV_ACK_FAILURE_STRING; case (12003): - return IMAGE_DOWNLOAD_SUCCESSFUL_STRING; + return SUPV_EXE_FAILURE_STRING; case (12004): - return FLASH_WRITE_SUCCESSFUL_STRING; + return SUPV_CRC_FAILURE_EVENT_STRING; case (12005): - return FLASH_READ_SUCCESSFUL_STRING; - case (12006): - return FLASH_READ_FAILED_STRING; - case (12007): - return FIRMWARE_UPDATE_SUCCESSFUL_STRING; - case (12008): - return FIRMWARE_UPDATE_FAILED_STRING; - case (12009): - return STR_HELPER_READING_REPLY_FAILED_STRING; - case (12010): - return STR_HELPER_COM_ERROR_STRING; - case (12011): - return STR_HELPER_NO_REPLY_STRING; - case (12012): - return STR_HELPER_DEC_ERROR_STRING; - case (12013): - return POSITION_MISMATCH_STRING; - case (12014): - return STR_HELPER_FILE_NOT_EXISTS_STRING; - case (12015): - return STR_HELPER_SENDING_PACKET_FAILED_STRING; - case (12016): - return STR_HELPER_REQUESTING_MSG_FAILED_STRING; + return SUPV_HELPER_EXECUTING_STRING; case (12100): - return MPSOC_FLASH_WRITE_FAILED_STRING; + return SANITIZATION_FAILED_STRING; case (12101): - return MPSOC_FLASH_WRITE_SUCCESSFUL_STRING; - case (12102): - return MPSOC_SENDING_COMMAND_FAILED_STRING; - case (12103): - return MPSOC_HELPER_REQUESTING_REPLY_FAILED_STRING; - case (12104): - return MPSOC_HELPER_READING_REPLY_FAILED_STRING; - case (12105): - return MPSOC_MISSING_ACK_STRING; - case (12106): - return MPSOC_MISSING_EXE_STRING; - case (12107): - return MPSOC_ACK_FAILURE_REPORT_STRING; - case (12108): - return MPSOC_EXE_FAILURE_REPORT_STRING; - case (12109): - return MPSOC_ACK_INVALID_APID_STRING; - case (12110): - return MPSOC_EXE_INVALID_APID_STRING; - case (12111): - return MPSOC_HELPER_SEQ_CNT_MISMATCH_STRING; - case (12200): - return TRANSITION_BACK_TO_OFF_STRING; - case (12201): - return NEG_V_OUT_OF_BOUNDS_STRING; - case (12202): - return U_DRO_OUT_OF_BOUNDS_STRING; - case (12203): - return I_DRO_OUT_OF_BOUNDS_STRING; - case (12204): - return U_X8_OUT_OF_BOUNDS_STRING; - case (12205): - return I_X8_OUT_OF_BOUNDS_STRING; - case (12206): - return U_TX_OUT_OF_BOUNDS_STRING; - case (12207): - return I_TX_OUT_OF_BOUNDS_STRING; - case (12208): - return U_MPA_OUT_OF_BOUNDS_STRING; - case (12209): - return I_MPA_OUT_OF_BOUNDS_STRING; - case (12210): - return U_HPA_OUT_OF_BOUNDS_STRING; - case (12211): - return I_HPA_OUT_OF_BOUNDS_STRING; + return MOUNTED_SD_CARD_STRING; case (12300): - return TRANSITION_OTHER_SIDE_FAILED_STRING; + return SEND_MRAM_DUMP_FAILED_STRING; case (12301): - return NOT_ENOUGH_DEVICES_DUAL_MODE_STRING; + return MRAM_DUMP_FAILED_STRING; case (12302): - return POWER_STATE_MACHINE_TIMEOUT_STRING; - case (12303): - return SIDE_SWITCH_TRANSITION_NOT_ALLOWED_STRING; + return MRAM_DUMP_FINISHED_STRING; + case (12401): + return INVALID_TC_FRAME_STRING; + case (12402): + return INVALID_FAR_STRING; + case (12403): + return CARRIER_LOCK_STRING; + case (12404): + return BIT_LOCK_PDEC_STRING; case (12500): + return IMAGE_UPLOAD_FAILED_STRING; + case (12501): + return IMAGE_DOWNLOAD_FAILED_STRING; + case (12502): + return IMAGE_UPLOAD_SUCCESSFUL_STRING; + case (12503): + return IMAGE_DOWNLOAD_SUCCESSFUL_STRING; + case (12504): + return FLASH_WRITE_SUCCESSFUL_STRING; + case (12505): + return FLASH_READ_SUCCESSFUL_STRING; + case (12506): + return FLASH_READ_FAILED_STRING; + case (12507): + return FIRMWARE_UPDATE_SUCCESSFUL_STRING; + case (12508): + return FIRMWARE_UPDATE_FAILED_STRING; + case (12509): + return STR_HELPER_READING_REPLY_FAILED_STRING; + case (12510): + return STR_HELPER_COM_ERROR_STRING; + case (12511): + return STR_HELPER_NO_REPLY_STRING; + case (12512): + return STR_HELPER_DEC_ERROR_STRING; + case (12513): + return POSITION_MISMATCH_STRING; + case (12514): + return STR_HELPER_FILE_NOT_EXISTS_STRING; + case (12515): + return STR_HELPER_SENDING_PACKET_FAILED_STRING; + case (12516): + return STR_HELPER_REQUESTING_MSG_FAILED_STRING; + case (12600): + return MPSOC_FLASH_WRITE_FAILED_STRING; + case (12601): + return MPSOC_FLASH_WRITE_SUCCESSFUL_STRING; + case (12602): + return MPSOC_SENDING_COMMAND_FAILED_STRING; + case (12603): + return MPSOC_HELPER_REQUESTING_REPLY_FAILED_STRING; + case (12604): + return MPSOC_HELPER_READING_REPLY_FAILED_STRING; + case (12605): + return MPSOC_MISSING_ACK_STRING; + case (12606): + return MPSOC_MISSING_EXE_STRING; + case (12607): + return MPSOC_ACK_FAILURE_REPORT_STRING; + case (12608): + return MPSOC_EXE_FAILURE_REPORT_STRING; + case (12609): + return MPSOC_ACK_INVALID_APID_STRING; + case (12610): + return MPSOC_EXE_INVALID_APID_STRING; + case (12611): + return MPSOC_HELPER_SEQ_CNT_MISMATCH_STRING; + case (12700): + return TRANSITION_BACK_TO_OFF_STRING; + case (12701): + return NEG_V_OUT_OF_BOUNDS_STRING; + case (12702): + return U_DRO_OUT_OF_BOUNDS_STRING; + case (12703): + return I_DRO_OUT_OF_BOUNDS_STRING; + case (12704): + return U_X8_OUT_OF_BOUNDS_STRING; + case (12705): + return I_X8_OUT_OF_BOUNDS_STRING; + case (12706): + return U_TX_OUT_OF_BOUNDS_STRING; + case (12707): + return I_TX_OUT_OF_BOUNDS_STRING; + case (12708): + return U_MPA_OUT_OF_BOUNDS_STRING; + case (12709): + return I_MPA_OUT_OF_BOUNDS_STRING; + case (12710): + return U_HPA_OUT_OF_BOUNDS_STRING; + case (12711): + return I_HPA_OUT_OF_BOUNDS_STRING; + case (12800): + return TRANSITION_OTHER_SIDE_FAILED_STRING; + case (12801): + return NOT_ENOUGH_DEVICES_DUAL_MODE_STRING; + case (12802): + return POWER_STATE_MACHINE_TIMEOUT_STRING; + case (12803): + return SIDE_SWITCH_TRANSITION_NOT_ALLOWED_STRING; + case (13000): return CHILDREN_LOST_MODE_STRING; + case (13100): + return GPS_FIX_CHANGE_STRING; + case (13200): + return P60_BOOT_COUNT_STRING; + case (13201): + return BATT_MODE_STRING; + case (13202): + return BATT_MODE_CHANGED_STRING; case (13600): - return ALLOC_FAILURE_STRING; + return SUPV_UPDATE_FAILED_STRING; case (13601): - return REBOOT_SW_STRING; + return SUPV_UPDATE_SUCCESSFUL_STRING; case (13602): - return REBOOT_MECHANISM_TRIGGERED_STRING; + return TERMINATED_UPDATE_PROCEDURE_STRING; case (13603): - return REBOOT_HW_STRING; + return SUPV_EVENT_BUFFER_REQUEST_SUCCESSFUL_STRING; + case (13604): + return SUPV_EVENT_BUFFER_REQUEST_FAILED_STRING; + case (13605): + return SUPV_EVENT_BUFFER_REQUEST_TERMINATED_STRING; + case (13606): + return SUPV_SENDING_COMMAND_FAILED_STRING; + case (13607): + return SUPV_HELPER_REQUESTING_REPLY_FAILED_STRING; + case (13608): + return SUPV_HELPER_READING_REPLY_FAILED_STRING; + case (13609): + return SUPV_MISSING_ACK_STRING; + case (13610): + return SUPV_MISSING_EXE_STRING; + case (13611): + return SUPV_ACK_FAILURE_REPORT_STRING; + case (13612): + return SUPV_EXE_FAILURE_REPORT_STRING; + case (13613): + return SUPV_ACK_INVALID_APID_STRING; + case (13614): + return SUPV_EXE_INVALID_APID_STRING; default: return "UNKNOWN_EVENT"; } diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index a67bae74..bfb20d25 100644 --- a/linux/fsfwconfig/objects/translateObjects.cpp +++ b/linux/fsfwconfig/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 116 translations. - * Generated on: 2022-04-14 15:49:10 + * Generated on: 2022-04-16 17:47:17 */ #include "translateObjects.h" diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp index 5e683a89..634ccc43 100644 --- a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp @@ -177,14 +177,7 @@ ReturnValue_t pst::pstSpi(FixedTimeslotTaskIF *thisSequence) { bool addSus9 = true; bool addSus10 = true; bool addSus11 = true; - /** - * The sun sensor will be shutdown as soon as the chip select is pulled high. Thus all - * requests to a sun sensor must be performed consecutively. Another reason for calling multiple - * device handler cycles is that the ADC conversions take some time. Thus first the ADC - * conversions are initiated and in a next step the results can be read from the internal FIFO. - * One sun sensor communication sequence also blocks the SPI bus. So other devices can not be - * inserted between the device handler cycles of one SUS. - */ + if (addSus0) { /* Write setup */ thisSequence->addSlot(objects::SUS_0, length * 0, DeviceHandlerIF::PERFORM_OPERATION); diff --git a/linux/utility/utility.cpp b/linux/utility/utility.cpp index cd0d47ef..fb58109b 100644 --- a/linux/utility/utility.cpp +++ b/linux/utility/utility.cpp @@ -1,3 +1,4 @@ + #include "utility.h" #include @@ -5,6 +6,7 @@ #include "FSFWConfig.h" #include "OBSWConfig.h" #include "fsfw/serviceinterface/ServiceInterface.h" +#include "fsfw/timemanager/Clock.h" void utility::handleSystemError(int retcode, std::string function) { #if OBSW_VERBOSE_LEVEL >= 1 @@ -12,3 +14,14 @@ void utility::handleSystemError(int retcode, std::string function) { << strerror(retcode) << std::endl; #endif } + +bool utility::timeSanityCheck() { + timeval currentTime = {}; + Clock::getUptime(¤tTime); + Clock::TimeOfDay_t currTimeOfDay = {}; + Clock::convertTimevalToTimeOfDay(¤tTime, &currTimeOfDay); + if (currTimeOfDay.year == 2000) { + return false; + } + return true; +} diff --git a/linux/utility/utility.h b/linux/utility/utility.h index 8f7df04f..b4c4fe8b 100644 --- a/linux/utility/utility.h +++ b/linux/utility/utility.h @@ -9,6 +9,8 @@ namespace utility { void handleSystemError(int retcode, std::string function); -} +bool timeSanityCheck(); + +} // namespace utility #endif /* LINUX_UTILITY_UTILITY_H_ */ diff --git a/misc/eclipse/.cproject b/misc/eclipse/.cproject index aa59f2da..6e4535c1 100644 --- a/misc/eclipse/.cproject +++ b/misc/eclipse/.cproject @@ -756,6 +756,7 @@ + @@ -818,8 +819,8 @@