diff --git a/CHANGELOG.md b/CHANGELOG.md index 3626825b..5ffdcbc8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,10 +10,22 @@ list yields a list of all related PRs for each release. # [unreleased] -# [v1.12.0] +# [v1.13.0] + +- Added first version of ACS Controller with gathers MGM data in a set + +# [v1.12.1] 05.07.2022 + +- Disable periodic TCS controller HK generation by default + +# [v1.12.0] 04.07.2022 ## Added +- Dummy components to run OBSW without relying on external hardware + PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/266 +- Basic Thermal Controller + PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/266 - PUS11 TC scheduler PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/259 - Regular reboot command @@ -37,6 +49,8 @@ list yields a list of all related PRs for each release. - `q7s-cp.py` bugfix PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/256 +- Generator scripts output now produce platform-independent artifacts + PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/267 ### Heater @@ -48,6 +62,8 @@ list yields a list of all related PRs for each release. ## Changed +- CCSDS handler improvements + PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/268 - Build unittest as default side product of hosted builds PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/244 - Let CI/CD build host build and run unittest side product in same step diff --git a/CMakeLists.txt b/CMakeLists.txt index 18b14092..4808d14c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -219,6 +219,8 @@ if(TGT_BSP) set(EIVE_ADD_LINUX_FILES TRUE) set(ADD_CSP_LIB TRUE) set(FSFW_HAL_ADD_LINUX ON) + set(FSFW_HAL_LINUX_ADD_LIBGPIOD ON) + set(FSFW_HAL_LINUX_ADD_PERIPHERAL_DRIVERS ON) endif() endif() diff --git a/bsp_hosted/ObjectFactory.cpp b/bsp_hosted/ObjectFactory.cpp index 3538700c..8129790c 100644 --- a/bsp_hosted/ObjectFactory.cpp +++ b/bsp_hosted/ObjectFactory.cpp @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/bsp_q7s/boardconfig/busConf.h b/bsp_q7s/boardconfig/busConf.h index fffa4a2a..2402938f 100644 --- a/bsp_q7s/boardconfig/busConf.h +++ b/bsp_q7s/boardconfig/busConf.h @@ -17,9 +17,9 @@ static constexpr char UART_SYRLINKS_DEV[] = "/dev/ul-syrlinks"; static constexpr char UART_STAR_TRACKER_DEV[] = "/dev/ul-str"; static constexpr char UIO_PDEC_REGISTERS[] = "/dev/uio0"; +static constexpr char UIO_PTME[] = "/dev/uio1"; static constexpr char UIO_PDEC_CONFIG_MEMORY[] = "/dev/uio2"; static constexpr char UIO_PDEC_RAM[] = "/dev/uio3"; -static constexpr char UIO_PTME[] = "/dev/uio1"; static constexpr int MAP_ID_PTME_CONFIG = 3; namespace uiomapids { diff --git a/bsp_q7s/core/InitMission.cpp b/bsp_q7s/core/InitMission.cpp index f2090666..80f5fc9e 100644 --- a/bsp_q7s/core/InitMission.cpp +++ b/bsp_q7s/core/InitMission.cpp @@ -133,6 +133,11 @@ void initmission::initTasks() { } #endif /* OBSW_ADD_ACS_HANDLERS */ + acsTask->addComponent(objects::ACS_CONTROLLER); + if (result != HasReturnvaluesIF::RETURN_OK) { + initmission::printAddObjectError("ACS_CTRL", objects::ACS_CONTROLLER); + } + PeriodicTaskIF* sysTask = factory->createPeriodicTask( "SYS_TASK", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.4, missedDeadlineFunc); static_cast(sysTask); diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 35be632c..43b1da31 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -89,8 +89,8 @@ #include "mission/devices/devicedefinitions/payloadPcduDefinitions.h" #include "mission/system/AcsBoardAssembly.h" #include "mission/tmtc/CCSDSHandler.h" +#include "mission/tmtc/TmFunnel.h" #include "mission/tmtc/VirtualChannel.h" -#include "mission/utility/TmFunnel.h" ResetArgs RESET_ARGS_GNSS; @@ -726,9 +726,7 @@ void ObjectFactory::createCcsdsComponents(LinuxLibgpioIF* gpioComIF) { consumer.str("PAPB VC 3"); gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_EMPTY_SIGNAL_VC3, consumer.str()); gpioCookiePtmeIp->addGpio(gpioIds::VC3_PAPB_EMPTY, gpio); - gpioChecker(gpioComIF->addGpios(gpioCookiePtmeIp), "PTME PAPB VCs"); - // Creating virtual channel interfaces VcInterfaceIF* vc0 = new PapbVcInterface(gpioComIF, gpioIds::VC0_PAPB_BUSY, gpioIds::VC0_PAPB_EMPTY, q7s::UIO_PTME, @@ -742,14 +740,12 @@ void ObjectFactory::createCcsdsComponents(LinuxLibgpioIF* gpioComIF) { VcInterfaceIF* vc3 = new PapbVcInterface(gpioComIF, gpioIds::VC3_PAPB_BUSY, gpioIds::VC3_PAPB_EMPTY, q7s::UIO_PTME, q7s::uiomapids::PTME_VC3); - // Creating ptme object and adding virtual channel interfaces Ptme* ptme = new Ptme(objects::PTME); ptme->addVcInterface(ccsds::VC0, vc0); ptme->addVcInterface(ccsds::VC1, vc1); ptme->addVcInterface(ccsds::VC2, vc2); ptme->addVcInterface(ccsds::VC3, vc3); - AxiPtmeConfig* axiPtmeConfig = new AxiPtmeConfig(objects::AXI_PTME_CONFIG, q7s::UIO_PTME, q7s::uiomapids::PTME_CONFIG); PtmeConfig* ptmeConfig = new PtmeConfig(objects::PTME_CONFIG, axiPtmeConfig); @@ -762,7 +758,6 @@ void ObjectFactory::createCcsdsComponents(LinuxLibgpioIF* gpioComIF) { CCSDSHandler* ccsdsHandler = new CCSDSHandler( objects::CCSDS_HANDLER, objects::PTME, objects::CCSDS_PACKET_DISTRIBUTOR, ptmeConfig, gpioComIF, gpioIds::RS485_EN_TX_CLOCK, gpioIds::RS485_EN_TX_DATA, TRANSMITTER_TIMEOUT); - VirtualChannel* vc = nullptr; vc = new VirtualChannel(ccsds::VC0, common::VC0_QUEUE_SIZE, objects::CCSDS_HANDLER); ccsdsHandler->addVirtualChannel(ccsds::VC0, vc); @@ -772,7 +767,6 @@ void ObjectFactory::createCcsdsComponents(LinuxLibgpioIF* gpioComIF) { ccsdsHandler->addVirtualChannel(ccsds::VC2, vc); vc = new VirtualChannel(ccsds::VC3, common::VC3_QUEUE_SIZE, objects::CCSDS_HANDLER); ccsdsHandler->addVirtualChannel(ccsds::VC3, vc); - GpioCookie* gpioCookiePdec = new GpioCookie; consumer.str(""); consumer << "0x" << std::hex << objects::PDEC_HANDLER; @@ -780,12 +774,9 @@ void ObjectFactory::createCcsdsComponents(LinuxLibgpioIF* gpioComIF) { gpio = new GpiodRegularByLineName(q7s::gpioNames::PDEC_RESET, consumer.str(), Direction::OUT, Levels::LOW); gpioCookiePdec->addGpio(gpioIds::PDEC_RESET, gpio); - gpioChecker(gpioComIF->addGpios(gpioCookiePdec), "PDEC"); - new PdecHandler(objects::PDEC_HANDLER, objects::CCSDS_HANDLER, gpioComIF, gpioIds::PDEC_RESET, q7s::UIO_PDEC_CONFIG_MEMORY, q7s::UIO_PDEC_RAM, q7s::UIO_PDEC_REGISTERS); - GpioCookie* gpioRS485Chip = new GpioCookie; gpio = new GpiodRegularByLineName(q7s::gpioNames::RS485_EN_TX_CLOCK, "RS485 Transceiver", Direction::OUT, Levels::LOW); @@ -793,7 +784,6 @@ void ObjectFactory::createCcsdsComponents(LinuxLibgpioIF* gpioComIF) { gpio = new GpiodRegularByLineName(q7s::gpioNames::RS485_EN_TX_DATA, "RS485 Transceiver", Direction::OUT, Levels::LOW); gpioRS485Chip->addGpio(gpioIds::RS485_EN_TX_DATA, gpio); - // Default configuration enables RX channels (RXEN = LOW) gpio = new GpiodRegularByLineName(q7s::gpioNames::RS485_EN_RX_CLOCK, "RS485 Transceiver", Direction::OUT, Levels::LOW); @@ -801,7 +791,6 @@ void ObjectFactory::createCcsdsComponents(LinuxLibgpioIF* gpioComIF) { gpio = new GpiodRegularByLineName(q7s::gpioNames::RS485_EN_RX_DATA, "RS485 Transceiver", Direction::OUT, Levels::LOW); gpioRS485Chip->addGpio(gpioIds::RS485_EN_RX_DATA, gpio); - gpioChecker(gpioComIF->addGpios(gpioRS485Chip), "RS485 Transceiver"); } diff --git a/bsp_q7s/fmObjectFactory.cpp b/bsp_q7s/fmObjectFactory.cpp index 56c0a62a..acce5dfb 100644 --- a/bsp_q7s/fmObjectFactory.cpp +++ b/bsp_q7s/fmObjectFactory.cpp @@ -63,4 +63,5 @@ void ObjectFactory::produce(void* args) { createMiscComponents(); createThermalController(); + createAcsController(); } diff --git a/bsp_te0720_1cfa/InitMission.cpp b/bsp_te0720_1cfa/InitMission.cpp index f50864b8..dd6a3aa0 100644 --- a/bsp_te0720_1cfa/InitMission.cpp +++ b/bsp_te0720_1cfa/InitMission.cpp @@ -107,6 +107,25 @@ void initmission::initTasks() { } #endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */ +#if OBSW_USE_CCSDS_IP_CORE == 1 + PeriodicTaskIF* ccsdsHandlerTask = factory->createPeriodicTask( + "CCSDS_HANDLER", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc); + result = ccsdsHandlerTask->addComponent(objects::CCSDS_HANDLER); + if (result != HasReturnvaluesIF::RETURN_OK) { + initmission::printAddObjectError("CCSDS Handler", objects::CCSDS_HANDLER); + } + + // Minimal distance between two received TCs amounts to 0.6 seconds + // If a command has not been read before the next one arrives, the old command will be + // overwritten by the PDEC. + PeriodicTaskIF* pdecHandlerTask = factory->createPeriodicTask( + "PDEC_HANDLER", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.0, missedDeadlineFunc); + result = pdecHandlerTask->addComponent(objects::PDEC_HANDLER); + if (result != HasReturnvaluesIF::RETURN_OK) { + initmission::printAddObjectError("PDEC Handler", objects::PDEC_HANDLER); + } +#endif /* OBSW_USE_CCSDS_IP_CORE == 1 */ + auto taskStarter = [](std::vector& taskVector, std::string name) { for (const auto& task : taskVector) { if (task != nullptr) { @@ -121,6 +140,10 @@ void initmission::initTasks() { tmtcDistributor->startTask(); tmtcBridgeTask->startTask(); tmtcPollingTask->startTask(); +#if OBSW_USE_CCSDS_IP_CORE == 1 + pdecHandlerTask->startTask(); + ccsdsHandlerTask->startTask(); +#endif /* #if OBSW_USE_CCSDS_IP_CORE == 1 */ #if OBSW_ADD_PLOC_SUPERVISOR == 1 supvHelperTask->startTask(); #endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */ diff --git a/bsp_te0720_1cfa/InitMission.h b/bsp_te0720_1cfa/InitMission.h index c3ba58ec..a939987f 100644 --- a/bsp_te0720_1cfa/InitMission.h +++ b/bsp_te0720_1cfa/InitMission.h @@ -3,7 +3,7 @@ #include -#include "fsfw/tasks/Typedef.h" +#include "fsfw/tasks/definitions.h" class PeriodicTaskIF; class TaskFactory; diff --git a/bsp_te0720_1cfa/OBSWConfig.h.in b/bsp_te0720_1cfa/OBSWConfig.h.in index 14867682..2f887daa 100644 --- a/bsp_te0720_1cfa/OBSWConfig.h.in +++ b/bsp_te0720_1cfa/OBSWConfig.h.in @@ -37,7 +37,6 @@ #define OBSW_ENABLE_SYRLINKS_TRANSMIT_TIMEOUT 0 #define OBSW_SYRLINKS_SIMULATED 1 #define OBSW_STAR_TRACKER_GROUND_CONFIG 1 -#define OBSW_ENABLE_PERIODIC_HK 0 #define OBSW_PRINT_CORE_HK 0 #define OBSW_INITIALIZE_SWITCHES 0 diff --git a/bsp_te0720_1cfa/ObjectFactory.cpp b/bsp_te0720_1cfa/ObjectFactory.cpp index 9fe7f3b0..fe699e50 100644 --- a/bsp_te0720_1cfa/ObjectFactory.cpp +++ b/bsp_te0720_1cfa/ObjectFactory.cpp @@ -1,10 +1,9 @@ #include "ObjectFactory.h" -#include - #include "OBSWConfig.h" #include "busConf.h" #include "devConf.h" +#include "ccsdsConfig.h" #include "devices/addresses.h" #include "devices/gpioIds.h" #include "fsfw/datapoollocal/LocalDataPoolManager.h" @@ -15,14 +14,23 @@ #include "fsfw_hal/linux/i2c/I2cCookie.h" #include "fsfw_hal/linux/uart/UartComIF.h" #include "fsfw_hal/linux/uart/UartCookie.h" +#include "fsfw_hal/common/gpio/GpioCookie.h" +#include "linux/ObjectFactory.h" #include "linux/devices/ploc/PlocMPSoCHandler.h" #include "linux/devices/ploc/PlocMPSoCHelper.h" #include "linux/devices/ploc/PlocMemoryDumper.h" #include "linux/devices/ploc/PlocSupervisorHandler.h" #include "linux/devices/ploc/PlocSupvHelper.h" +#include "linux/obc/AxiPtmeConfig.h" +#include "linux/obc/PapbVcInterface.h" +#include "linux/obc/PdecHandler.h" +#include "linux/obc/Ptme.h" +#include "linux/obc/PtmeConfig.h" #include "mission/core/GenericFactory.h" #include "mission/devices/Tmp1075Handler.h" -#include "mission/utility/TmFunnel.h" +#include "mission/tmtc/TmFunnel.h" +#include "mission/tmtc/CCSDSHandler.h" +#include "mission/tmtc/VirtualChannel.h" #include "objects/systemObjectList.h" #include "test/gpio/DummyGpioIF.h" #include "tmtc/apid.h" @@ -35,7 +43,11 @@ void Factory::setStaticFrameworkObjectIds() { CommandingServiceBase::defaultPacketSource = objects::PUS_PACKET_DISTRIBUTOR; CommandingServiceBase::defaultPacketDestination = objects::TM_FUNNEL; +#if OBSW_TM_TO_PTME == 1 + TmFunnel::downlinkDestination = objects::CCSDS_HANDLER; +#else TmFunnel::downlinkDestination = objects::TMTC_BRIDGE; +#endif TmFunnel::storageDestination = objects::NO_OBJECT; VerificationReporter::messageReceiver = objects::PUS_SERVICE_1_VERIFICATION; @@ -46,6 +58,7 @@ void ObjectFactory::produce(void* args) { Factory::setStaticFrameworkObjectIds(); ObjectFactory::produceGenericObjects(); + LinuxLibgpioIF* gpioComIF = new LinuxLibgpioIF(objects::GPIO_IF);; new UartComIF(objects::UART_COM_IF); #if OBSW_ADD_PLOC_MPSOC == 1 @@ -71,9 +84,10 @@ void ObjectFactory::produce(void* args) { supervisorCookie, Gpio(gpioIds::ENABLE_SUPV_UART, supvGpioIF), pcdu::PDU1_CH6_PLOC_12V, supvHelper); - new PlocMemoryDumper(objects::PLOC_MEMORY_DUMPER); #endif + new PlocMemoryDumper(objects::PLOC_MEMORY_DUMPER); + #if OBSW_TEST_LIBGPIOD == 1 #if OBSW_TEST_GPIO_OPEN_BYLABEL == 1 /* Configure MIO0 as input */ @@ -104,21 +118,6 @@ void ObjectFactory::produce(void* args) { new SusHandler(objects::SUS_0, objects::SPI_COM_IF, spiCookieSus, gpioComIF, gpioIds::CS_SUS_0); #endif -#if OBSW_TEST_CCSDS_BRIDGE == 1 - GpioCookie* gpioCookieCcsdsIp = new GpioCookie; - GpiodRegular* papbBusyN = - new GpiodRegular(std::string("gpiochip0"), 0, std::string("PAPBBusy_VC0")); - gpioCookieCcsdsIp->addGpio(gpioIds::PAPB_BUSY_N, papbBusyN); - GpiodRegular* papbEmpty = - new GpiodRegular(std::string("gpiochip0"), 1, std::string("PAPBEmpty_VC0")); - gpioCookieCcsdsIp->addGpio(gpioIds::PAPB_EMPTY, papbEmpty); - gpioComIF->addGpios(gpioCookieCcsdsIp); - - new CCSDSIPCoreBridge(objects::CCSDS_IP_CORE_BRIDGE, objects::CCSDS_PACKET_DISTRIBUTOR, - objects::TM_STORE, objects::TC_STORE, gpioComIF, std::string("/dev/uio0"), - gpioIds::PAPB_BUSY_N, gpioIds::PAPB_EMPTY); -#endif - #if OBSW_TEST_RAD_SENSOR == 1 GpioCookie* gpioCookieRadSensor = new GpioCookie; GpiodRegular* chipSelectRadSensor = new GpiodRegular( @@ -155,4 +154,6 @@ void ObjectFactory::produce(void* args) { /* Temperature sensors */ new Tmp1075Handler(objects::TMP1075_HANDLER_1, objects::I2C_COM_IF, i2cCookieTmp1075tcs1); new Tmp1075Handler(objects::TMP1075_HANDLER_2, objects::I2C_COM_IF, i2cCookieTmp1075tcs2); + + static_cast(gpioComIF); } diff --git a/bsp_te0720_1cfa/ObjectFactory.h b/bsp_te0720_1cfa/ObjectFactory.h index b24dd321..828f5d36 100644 --- a/bsp_te0720_1cfa/ObjectFactory.h +++ b/bsp_te0720_1cfa/ObjectFactory.h @@ -1,7 +1,11 @@ #ifndef BSP_LINUX_OBJECTFACTORY_H_ #define BSP_LINUX_OBJECTFACTORY_H_ +#include +#include + namespace ObjectFactory { +static const uint32_t TRANSMITTER_TIMEOUT = 86400000; // 1 day void produce(void* args); }; // namespace ObjectFactory diff --git a/bsp_te0720_1cfa/boardconfig/busConf.h b/bsp_te0720_1cfa/boardconfig/busConf.h index 893014c1..7b51ab3e 100644 --- a/bsp_te0720_1cfa/boardconfig/busConf.h +++ b/bsp_te0720_1cfa/boardconfig/busConf.h @@ -3,9 +3,37 @@ namespace te0720_1cfa { static constexpr char MPSOC_UART[] = "/dev/ttyPS1"; -namespace baudrate { +static constexpr char UIO_PDEC_REGISTERS[] = "/dev/uio0"; +static constexpr char UIO_PTME[] = "/dev/uio1"; +static constexpr char UIO_PDEC_CONFIG_MEMORY[] = "/dev/uio2"; +static constexpr char UIO_PDEC_RAM[] = "/dev/uio3"; +static constexpr int MAP_ID_PTME_CONFIG = 3; + +namespace uiomapids { +static const int PTME_VC0 = 0; +static const int PTME_VC1 = 1; +static const int PTME_VC2 = 2; +static const int PTME_VC3 = 3; +static const int PTME_CONFIG = 4; +} // namespace uiomapids + +namespace gpioNames { + static constexpr char PAPB_BUSY_SIGNAL_VC0[] = "papb_busy_signal_vc0"; + static constexpr char PAPB_EMPTY_SIGNAL_VC0[] = "papb_empty_signal_vc0"; + static constexpr char PAPB_BUSY_SIGNAL_VC1[] = "papb_busy_signal_vc1"; + static constexpr char PAPB_EMPTY_SIGNAL_VC1[] = "papb_empty_signal_vc1"; + static constexpr char PAPB_BUSY_SIGNAL_VC2[] = "papb_busy_signal_vc2"; + static constexpr char PAPB_EMPTY_SIGNAL_VC2[] = "papb_empty_signal_vc2"; + static constexpr char PAPB_BUSY_SIGNAL_VC3[] = "papb_busy_signal_vc3"; + static constexpr char PAPB_EMPTY_SIGNAL_VC3[] = "papb_empty_signal_vc3"; + static constexpr char RS485_EN_TX_CLOCK[] = "tx_clock_enable_ltc2872"; + static constexpr char RS485_EN_TX_DATA[] = "tx_data_enable_ltc2872"; + static constexpr char RS485_EN_RX_CLOCK[] = "rx_clock_enable_ltc2872"; + static constexpr char RS485_EN_RX_DATA[] = "rx_data_enable_ltc2872"; + static constexpr char PDEC_RESET[] = "pdec_reset"; } + } #endif /* BSP_EGSE_BOARDCONFIG_BUSCONF_H_ */ diff --git a/common/config/OBSWVersion.h b/common/config/OBSWVersion.h index 1e5dd04b..36233c3b 100644 --- a/common/config/OBSWVersion.h +++ b/common/config/OBSWVersion.h @@ -4,7 +4,7 @@ const char* const SW_NAME = "eive"; #define SW_VERSION 1 -#define SW_SUBVERSION 10 +#define SW_SUBVERSION 12 #define SW_REVISION 1 #endif /* COMMON_CONFIG_OBSWVERSION_H_ */ diff --git a/common/config/commonObjects.h b/common/config/commonObjects.h index 4a4594f4..e0efbce7 100644 --- a/common/config/commonObjects.h +++ b/common/config/commonObjects.h @@ -18,7 +18,7 @@ enum commonObjects : uint32_t { /* 0x43 ('C') for Controllers */ THERMAL_CONTROLLER = 0x43400001, - ACS_CONTROLLER = 0x43100002, + ACS_CONTROLLER = 0x43000002, CORE_CONTROLLER = 0x43000003, /* 0x44 ('D') for device handlers */ diff --git a/fsfw b/fsfw index cfdbe0f6..31f59f91 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit cfdbe0f6cb762f58f0db3f9c118c50c954f0b984 +Subproject commit 31f59f915cd368ef4f49a3ed071420123e07eb72 diff --git a/generators/bsp_q7s_events.csv b/generators/bsp_q7s_events.csv index 3f7b74f9..c08a6675 100644 --- a/generators/bsp_q7s_events.csv +++ b/generators/bsp_q7s_events.csv @@ -78,7 +78,7 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 8901;0x22c5;CLOCK_SET_FAILURE;LOW;;fsfw/src/fsfw/pus/Service9TimeManagement.h 9100;0x238c;TC_DELETION_FAILED;MEDIUM;Deletion of a TC from the map failed. P1: First 32 bit of request ID, P2. Last 32 bit of Request ID;fsfw/src/fsfw/pus/Service11TelecommandScheduling.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 +10600;0x2968;CHANGE_OF_SETUP_PARAMETER;LOW;;fsfw/src/fsfw_hal/devicehandlers/MgmLIS3MDLHandler.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 switch 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 @@ -128,6 +128,8 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 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 +12405;0x3075;LOST_CARRIER_LOCK_PDEC;INFO;Lost carrier lock;linux/obc/PdecHandler.h +12406;0x3076;LOST_BIT_LOCK_PDEC;INFO;Lost bit lock;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 diff --git a/generators/bsp_q7s_returnvalues.csv b/generators/bsp_q7s_returnvalues.csv index 147a9ea4..b614f324 100644 --- a/generators/bsp_q7s_returnvalues.csv +++ b/generators/bsp_q7s_returnvalues.csv @@ -1,74 +1,55 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x0000;OK;System-wide code for ok.;0;HasReturnvaluesIF;fsfw/returnvalues/HasReturnvaluesIF.h 0x0001;Failed;Unspecified system-wide code for failed.;1;HasReturnvaluesIF;fsfw/returnvalues/HasReturnvaluesIF.h -0x64a0;CCSDS_CommandNotImplemented;Received action message with unknown action id;160;CCSDS_HANDLER;mission/tmtc/CCSDSHandler.h -0x6100;GOMS_PacketTooLong;;0;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h -0x6101;GOMS_InvalidTableId;;1;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h -0x6102;GOMS_InvalidAddress;;2;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h -0x6103;GOMS_InvalidParamSize;;3;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h -0x6104;GOMS_InvalidPayloadSize;;4;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h -0x6105;GOMS_UnknownReplyId;;5;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h -0x56b0;RWHA_SpiWriteFailure;;176;RW_HANDLER;mission/devices/RwHandler.h -0x56b1;RWHA_SpiReadFailure;Used by the spi send function to tell a failing read call;177;RW_HANDLER;mission/devices/RwHandler.h -0x56b2;RWHA_MissingStartSign;Can be used by the HDLC decoding mechanism to inform about a missing start sign 0x7E;178;RW_HANDLER;mission/devices/RwHandler.h -0x56b3;RWHA_InvalidSubstitute;Can be used by the HDLC decoding mechanism to inform about an invalid substitution combination;179;RW_HANDLER;mission/devices/RwHandler.h -0x56b4;RWHA_MissingEndSign;HDLC decoding mechanism never receives the end sign 0x7E;180;RW_HANDLER;mission/devices/RwHandler.h -0x56b5;RWHA_NoReply;Reaction wheel only responds with empty frames.;181;RW_HANDLER;mission/devices/RwHandler.h -0x56b6;RWHA_NoStartMarker;Expected a start marker as first byte;182;RW_HANDLER;mission/devices/RwHandler.h -0x56a0;RWHA_InvalidSpeed;Action Message with invalid speed was received. Valid speeds must be in the range of [-65000, 1000] or [1000, 65000];160;RW_HANDLER;mission/devices/RwHandler.h -0x56a1;RWHA_InvalidRampTime;Action Message with invalid ramp time was received.;161;RW_HANDLER;mission/devices/RwHandler.h -0x56a2;RWHA_SetSpeedCommandInvalidLength;Received set speed command has invalid length. Should be 6.;162;RW_HANDLER;mission/devices/RwHandler.h -0x56a3;RWHA_ExecutionFailed;Command execution failed;163;RW_HANDLER;mission/devices/RwHandler.h -0x56a4;RWHA_CrcError;Reaction wheel reply has invalid crc;164;RW_HANDLER;mission/devices/RwHandler.h -0x53a1;HEATER_CommandNotSupported;;161;HEATER_HANDLER;mission/devices/HeaterHandler.h -0x53a2;HEATER_InitFailed;;162;HEATER_HANDLER;mission/devices/HeaterHandler.h -0x53a3;HEATER_InvalidSwitchNr;;163;HEATER_HANDLER;mission/devices/HeaterHandler.h -0x53a4;HEATER_MainSwitchSetTimeout;;164;HEATER_HANDLER;mission/devices/HeaterHandler.h -0x53a5;HEATER_CommandAlreadyWaiting;;165;HEATER_HANDLER;mission/devices/HeaterHandler.h -0x5ca0;SUSS_ErrorUnlockMutex;;160;SUS_HANDLER;mission/devices/SusHandler.h -0x5ca1;SUSS_ErrorLockMutex;;161;SUS_HANDLER;mission/devices/SusHandler.h -0x55a0;IMTQ_InvalidCommandCode;;160;IMTQ_HANDLER;mission/devices/IMTQHandler.h -0x55a1;IMTQ_ParameterMissing;;161;IMTQ_HANDLER;mission/devices/IMTQHandler.h -0x55a2;IMTQ_ParameterInvalid;;162;IMTQ_HANDLER;mission/devices/IMTQHandler.h -0x55a3;IMTQ_CcUnavailable;;163;IMTQ_HANDLER;mission/devices/IMTQHandler.h -0x55a4;IMTQ_InternalProcessingError;;164;IMTQ_HANDLER;mission/devices/IMTQHandler.h -0x55a5;IMTQ_RejectedWithoutReason;;165;IMTQ_HANDLER;mission/devices/IMTQHandler.h -0x55a6;IMTQ_CmdErrUnknown;;166;IMTQ_HANDLER;mission/devices/IMTQHandler.h -0x55a7;IMTQ_UnexpectedSelfTestReply;The status reply to a self test command was received but no self test command has been sent. This should normally never happen.;167;IMTQ_HANDLER;mission/devices/IMTQHandler.h -0x54a0;SYRLINKS_CrcFailure;;160;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h -0x54a1;SYRLINKS_UartFraminOrParityErrorAck;;161;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h -0x54a2;SYRLINKS_BadCharacterAck;;162;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h -0x54a3;SYRLINKS_BadParameterValueAck;;163;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h -0x54a4;SYRLINKS_BadEndOfFrameAck;;164;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h -0x54a5;SYRLINKS_UnknownCommandIdAck;;165;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h -0x54a6;SYRLINKS_BadCrcAck;;166;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h -0x54a7;SYRLINKS_ReplyWrongSize;;167;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h -0x54a8;SYRLINKS_MissingStartFrameCharacter;;168;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h -0x6aa0;SADPL_CommandNotSupported;;160;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h -0x6aa1;SADPL_DeploymentAlreadyExecuting;;161;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h -0x6aa2;SADPL_MainSwitchTimeoutFailure;;162;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h -0x6aa3;SADPL_SwitchingDeplSa1Failed;;163;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h -0x6aa4;SADPL_SwitchingDeplSa2Failed;;164;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h -0x67a0;NVMB_KeyNotExists;Specified key does not exist in json file;160;NVM_PARAM_BASE;mission/memory/NVMParameterBase.h -0x4400;HSPI_HalTimeoutRetval;;0;HAL_SPI;fsfw/hal/src/fsfw_hal/stm32h7/spi/spiDefinitions.h -0x4401;HSPI_HalBusyRetval;;1;HAL_SPI;fsfw/hal/src/fsfw_hal/stm32h7/spi/spiDefinitions.h -0x4402;HSPI_HalErrorRetval;;2;HAL_SPI;fsfw/hal/src/fsfw_hal/stm32h7/spi/spiDefinitions.h -0x4501;HURT_UartReadFailure;;1;HAL_UART;fsfw/hal/src/fsfw_hal/linux/uart/UartComIF.h -0x4502;HURT_UartReadSizeMissmatch;;2;HAL_UART;fsfw/hal/src/fsfw_hal/linux/uart/UartComIF.h -0x4503;HURT_UartRxBufferTooSmall;;3;HAL_UART;fsfw/hal/src/fsfw_hal/linux/uart/UartComIF.h -0x4701;HGIO_UnknownGpioId;;1;HAL_GPIO;fsfw/hal/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4702;HGIO_DriveGpioFailure;;2;HAL_GPIO;fsfw/hal/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4703;HGIO_GpioTypeFailure;;3;HAL_GPIO;fsfw/hal/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4704;HGIO_GpioInvalidInstance;;4;HAL_GPIO;fsfw/hal/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4705;HGIO_GpioDuplicateDetected;;5;HAL_GPIO;fsfw/hal/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4706;HGIO_GpioInitFailed;;6;HAL_GPIO;fsfw/hal/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4707;HGIO_GpioGetValueFailed;;7;HAL_GPIO;fsfw/hal/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4300;UXOS_ExecutionFinished;Execution of the current command has finished;0;LINUX_OSAL;fsfw/hal/src/fsfw_hal/linux/CommandExecutor.h -0x4301;UXOS_CommandPending;Command is pending. This will also be returned if the user tries to load another command but a command is still pending;1;LINUX_OSAL;fsfw/hal/src/fsfw_hal/linux/CommandExecutor.h -0x4302;UXOS_BytesRead;Some bytes have been read from the executing process;2;LINUX_OSAL;fsfw/hal/src/fsfw_hal/linux/CommandExecutor.h -0x4303;UXOS_CommandError;Command execution failed;3;LINUX_OSAL;fsfw/hal/src/fsfw_hal/linux/CommandExecutor.h -0x4304;UXOS_NoCommandLoadedOrPending;;4;LINUX_OSAL;fsfw/hal/src/fsfw_hal/linux/CommandExecutor.h -0x4306;UXOS_PcloseCallError;;6;LINUX_OSAL;fsfw/hal/src/fsfw_hal/linux/CommandExecutor.h +0x5fa0;CCSDS_CommandNotImplemented;Received action message with unknown action id;160;CCSDS_HANDLER;mission/tmtc/CCSDSHandler.h +0x5c00;GOMS_PacketTooLong;;0;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h +0x5c01;GOMS_InvalidTableId;;1;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h +0x5c02;GOMS_InvalidAddress;;2;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h +0x5c03;GOMS_InvalidParamSize;;3;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h +0x5c04;GOMS_InvalidPayloadSize;;4;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h +0x5c05;GOMS_UnknownReplyId;;5;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h +0x51b0;RWHA_SpiWriteFailure;;176;RW_HANDLER;mission/devices/RwHandler.h +0x51b1;RWHA_SpiReadFailure;Used by the spi send function to tell a failing read call;177;RW_HANDLER;mission/devices/RwHandler.h +0x51b2;RWHA_MissingStartSign;Can be used by the HDLC decoding mechanism to inform about a missing start sign 0x7E;178;RW_HANDLER;mission/devices/RwHandler.h +0x51b3;RWHA_InvalidSubstitute;Can be used by the HDLC decoding mechanism to inform about an invalid substitution combination;179;RW_HANDLER;mission/devices/RwHandler.h +0x51b4;RWHA_MissingEndSign;HDLC decoding mechanism never receives the end sign 0x7E;180;RW_HANDLER;mission/devices/RwHandler.h +0x51b5;RWHA_NoReply;Reaction wheel only responds with empty frames.;181;RW_HANDLER;mission/devices/RwHandler.h +0x51b6;RWHA_NoStartMarker;Expected a start marker as first byte;182;RW_HANDLER;mission/devices/RwHandler.h +0x51a0;RWHA_InvalidSpeed;Action Message with invalid speed was received. Valid speeds must be in the range of [-65000, 1000] or [1000, 65000];160;RW_HANDLER;mission/devices/RwHandler.h +0x51a1;RWHA_InvalidRampTime;Action Message with invalid ramp time was received.;161;RW_HANDLER;mission/devices/RwHandler.h +0x51a2;RWHA_SetSpeedCommandInvalidLength;Received set speed command has invalid length. Should be 6.;162;RW_HANDLER;mission/devices/RwHandler.h +0x51a3;RWHA_ExecutionFailed;Command execution failed;163;RW_HANDLER;mission/devices/RwHandler.h +0x51a4;RWHA_CrcError;Reaction wheel reply has invalid crc;164;RW_HANDLER;mission/devices/RwHandler.h +0x4ea1;HEATER_CommandNotSupported;;161;HEATER_HANDLER;mission/devices/HeaterHandler.h +0x4ea2;HEATER_InitFailed;;162;HEATER_HANDLER;mission/devices/HeaterHandler.h +0x4ea3;HEATER_InvalidSwitchNr;;163;HEATER_HANDLER;mission/devices/HeaterHandler.h +0x4ea4;HEATER_MainSwitchSetTimeout;;164;HEATER_HANDLER;mission/devices/HeaterHandler.h +0x4ea5;HEATER_CommandAlreadyWaiting;;165;HEATER_HANDLER;mission/devices/HeaterHandler.h +0x57a0;SUSS_ErrorUnlockMutex;;160;SUS_HANDLER;mission/devices/SusHandler.h +0x57a1;SUSS_ErrorLockMutex;;161;SUS_HANDLER;mission/devices/SusHandler.h +0x50a0;IMTQ_InvalidCommandCode;;160;IMTQ_HANDLER;mission/devices/IMTQHandler.h +0x50a1;IMTQ_ParameterMissing;;161;IMTQ_HANDLER;mission/devices/IMTQHandler.h +0x50a2;IMTQ_ParameterInvalid;;162;IMTQ_HANDLER;mission/devices/IMTQHandler.h +0x50a3;IMTQ_CcUnavailable;;163;IMTQ_HANDLER;mission/devices/IMTQHandler.h +0x50a4;IMTQ_InternalProcessingError;;164;IMTQ_HANDLER;mission/devices/IMTQHandler.h +0x50a5;IMTQ_RejectedWithoutReason;;165;IMTQ_HANDLER;mission/devices/IMTQHandler.h +0x50a6;IMTQ_CmdErrUnknown;;166;IMTQ_HANDLER;mission/devices/IMTQHandler.h +0x50a7;IMTQ_UnexpectedSelfTestReply;The status reply to a self test command was received but no self test command has been sent. This should normally never happen.;167;IMTQ_HANDLER;mission/devices/IMTQHandler.h +0x4fa0;SYRLINKS_CrcFailure;;160;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h +0x4fa1;SYRLINKS_UartFraminOrParityErrorAck;;161;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h +0x4fa2;SYRLINKS_BadCharacterAck;;162;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h +0x4fa3;SYRLINKS_BadParameterValueAck;;163;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h +0x4fa4;SYRLINKS_BadEndOfFrameAck;;164;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h +0x4fa5;SYRLINKS_UnknownCommandIdAck;;165;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h +0x4fa6;SYRLINKS_BadCrcAck;;166;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h +0x4fa7;SYRLINKS_ReplyWrongSize;;167;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h +0x4fa8;SYRLINKS_MissingStartFrameCharacter;;168;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h +0x65a0;SADPL_CommandNotSupported;;160;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h +0x65a1;SADPL_DeploymentAlreadyExecuting;;161;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h +0x65a2;SADPL_MainSwitchTimeoutFailure;;162;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h +0x65a3;SADPL_SwitchingDeplSa1Failed;;163;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h +0x65a4;SADPL_SwitchingDeplSa2Failed;;164;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h +0x62a0;NVMB_KeyNotExists;Specified key does not exist in json file;160;NVM_PARAM_BASE;mission/memory/NVMParameterBase.h 0x2b01;CCS_BcIsSetVrCommand;;1;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h 0x2b02;CCS_BcIsUnlockCommand;;2;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h 0x2bb0;CCS_BcIllegalCommand;;176;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h @@ -451,16 +432,35 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x1401;SE_BufferTooShort;;1;SERIALIZE_IF;fsfw/src/fsfw/serialize/SerializeIF.h 0x1402;SE_StreamTooShort;;2;SERIALIZE_IF;fsfw/src/fsfw/serialize/SerializeIF.h 0x1403;SE_TooManyElements;;3;SERIALIZE_IF;fsfw/src/fsfw/serialize/SerializeIF.h -0x68a0;FSHLP_SdNotMounted;SD card specified with path string not mounted;160;FILE_SYSTEM_HELPER;bsp_q7s/memory/FilesystemHelper.h -0x68a1;FSHLP_FileNotExists;Specified file does not exist on filesystem;161;FILE_SYSTEM_HELPER;bsp_q7s/memory/FilesystemHelper.h -0x7300;SDMA_OpOngoing;;0;SD_CARD_MANAGER;bsp_q7s/memory/SdCardManager.h -0x7301;SDMA_AlreadyOn;;1;SD_CARD_MANAGER;bsp_q7s/memory/SdCardManager.h -0x7302;SDMA_AlreadyMounted;;2;SD_CARD_MANAGER;bsp_q7s/memory/SdCardManager.h -0x7303;SDMA_AlreadyOff;;3;SD_CARD_MANAGER;bsp_q7s/memory/SdCardManager.h -0x730a;SDMA_StatusFileNexists;;10;SD_CARD_MANAGER;bsp_q7s/memory/SdCardManager.h -0x730b;SDMA_StatusFileFormatInvalid;;11;SD_CARD_MANAGER;bsp_q7s/memory/SdCardManager.h -0x730c;SDMA_MountError;;12;SD_CARD_MANAGER;bsp_q7s/memory/SdCardManager.h -0x730d;SDMA_UnmountError;;13;SD_CARD_MANAGER;bsp_q7s/memory/SdCardManager.h -0x730e;SDMA_SystemCallError;;14;SD_CARD_MANAGER;bsp_q7s/memory/SdCardManager.h -0x730f;SDMA_PopenCallError;;15;SD_CARD_MANAGER;bsp_q7s/memory/SdCardManager.h -0x7400;SCBU_KeyNotFound;;0;SCRATCH_BUFFER;bsp_q7s/memory/scratchApi.h +0x4400;HSPI_HalTimeoutRetval;;0;HAL_SPI;fsfw/src/fsfw_hal/stm32h7/spi/spiDefinitions.h +0x4401;HSPI_HalBusyRetval;;1;HAL_SPI;fsfw/src/fsfw_hal/stm32h7/spi/spiDefinitions.h +0x4402;HSPI_HalErrorRetval;;2;HAL_SPI;fsfw/src/fsfw_hal/stm32h7/spi/spiDefinitions.h +0x4501;HURT_UartReadFailure;;1;HAL_UART;fsfw/src/fsfw_hal/linux/uart/UartComIF.h +0x4502;HURT_UartReadSizeMissmatch;;2;HAL_UART;fsfw/src/fsfw_hal/linux/uart/UartComIF.h +0x4503;HURT_UartRxBufferTooSmall;;3;HAL_UART;fsfw/src/fsfw_hal/linux/uart/UartComIF.h +0x4701;HGIO_UnknownGpioId;;1;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4702;HGIO_DriveGpioFailure;;2;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4703;HGIO_GpioTypeFailure;;3;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4704;HGIO_GpioInvalidInstance;;4;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4705;HGIO_GpioDuplicateDetected;;5;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4706;HGIO_GpioInitFailed;;6;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4707;HGIO_GpioGetValueFailed;;7;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4300;UXOS_ExecutionFinished;Execution of the current command has finished;0;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h +0x4301;UXOS_CommandPending;Command is pending. This will also be returned if the user tries to load another command but a command is still pending;1;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h +0x4302;UXOS_BytesRead;Some bytes have been read from the executing process;2;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h +0x4303;UXOS_CommandError;Command execution failed;3;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h +0x4304;UXOS_NoCommandLoadedOrPending;;4;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h +0x4306;UXOS_PcloseCallError;;6;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h +0x63a0;FSHLP_SdNotMounted;SD card specified with path string not mounted;160;FILE_SYSTEM_HELPER;bsp_q7s/memory/FilesystemHelper.h +0x63a1;FSHLP_FileNotExists;Specified file does not exist on filesystem;161;FILE_SYSTEM_HELPER;bsp_q7s/memory/FilesystemHelper.h +0x6900;SDMA_OpOngoing;;0;SD_CARD_MANAGER;bsp_q7s/memory/SdCardManager.h +0x6901;SDMA_AlreadyOn;;1;SD_CARD_MANAGER;bsp_q7s/memory/SdCardManager.h +0x6902;SDMA_AlreadyMounted;;2;SD_CARD_MANAGER;bsp_q7s/memory/SdCardManager.h +0x6903;SDMA_AlreadyOff;;3;SD_CARD_MANAGER;bsp_q7s/memory/SdCardManager.h +0x690a;SDMA_StatusFileNexists;;10;SD_CARD_MANAGER;bsp_q7s/memory/SdCardManager.h +0x690b;SDMA_StatusFileFormatInvalid;;11;SD_CARD_MANAGER;bsp_q7s/memory/SdCardManager.h +0x690c;SDMA_MountError;;12;SD_CARD_MANAGER;bsp_q7s/memory/SdCardManager.h +0x690d;SDMA_UnmountError;;13;SD_CARD_MANAGER;bsp_q7s/memory/SdCardManager.h +0x690e;SDMA_SystemCallError;;14;SD_CARD_MANAGER;bsp_q7s/memory/SdCardManager.h +0x690f;SDMA_PopenCallError;;15;SD_CARD_MANAGER;bsp_q7s/memory/SdCardManager.h +0x6a00;SCBU_KeyNotFound;;0;SCRATCH_BUFFER;bsp_q7s/memory/scratchApi.h diff --git a/generators/deps/fsfwgen b/generators/deps/fsfwgen index a5dee6e4..e84be4bb 160000 --- a/generators/deps/fsfwgen +++ b/generators/deps/fsfwgen @@ -1 +1 @@ -Subproject commit a5dee6e41749508a85842a931e6f1d210aee2031 +Subproject commit e84be4bb1710e90e97f8e501565106b9e63ef56b diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index 75e14146..a3b9468d 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 207 translations. + * @brief Auto-generated event translation file. Contains 209 translations. * @details - * Generated on: 2022-06-21 01:20:13 + * Generated on: 2022-08-12 12:30:32 */ #include "translateEvents.h" @@ -134,6 +134,8 @@ const char *INVALID_TC_FRAME_STRING = "INVALID_TC_FRAME"; const char *INVALID_FAR_STRING = "INVALID_FAR"; const char *CARRIER_LOCK_STRING = "CARRIER_LOCK"; const char *BIT_LOCK_PDEC_STRING = "BIT_LOCK_PDEC"; +const char *LOST_CARRIER_LOCK_PDEC_STRING = "LOST_CARRIER_LOCK_PDEC"; +const char *LOST_BIT_LOCK_PDEC_STRING = "LOST_BIT_LOCK_PDEC"; const char *IMAGE_UPLOAD_FAILED_STRING = "IMAGE_UPLOAD_FAILED"; const char *IMAGE_DOWNLOAD_FAILED_STRING = "IMAGE_DOWNLOAD_FAILED"; const char *IMAGE_UPLOAD_SUCCESSFUL_STRING = "IMAGE_UPLOAD_SUCCESSFUL"; @@ -469,6 +471,10 @@ const char *translateEvents(Event event) { return CARRIER_LOCK_STRING; case (12404): return BIT_LOCK_PDEC_STRING; + case (12405): + return LOST_CARRIER_LOCK_PDEC_STRING; + case (12406): + return LOST_BIT_LOCK_PDEC_STRING; case (12500): return IMAGE_UPLOAD_FAILED_STRING; case (12501): diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index 1894dcd0..11b2abf2 100644 --- a/generators/objects/translateObjects.cpp +++ b/generators/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 132 translations. - * Generated on: 2022-06-21 00:51:33 + * Generated on: 2022-08-12 12:30:32 */ #include "translateObjects.h" diff --git a/linux/ObjectFactory.cpp b/linux/ObjectFactory.cpp index e8ba7947..494b0baa 100644 --- a/linux/ObjectFactory.cpp +++ b/linux/ObjectFactory.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -324,6 +325,8 @@ void ObjectFactory::createThermalController() { new ThermalController(objects::THERMAL_CONTROLLER, objects::NO_OBJECT); } +void ObjectFactory::createAcsController() { new AcsController(objects::ACS_CONTROLLER); } + void ObjectFactory::gpioChecker(ReturnValue_t result, std::string output) { if (result != HasReturnvaluesIF::RETURN_OK) { sif::error << "ObjectFactory: Adding GPIOs failed for " << output << std::endl; diff --git a/linux/ObjectFactory.h b/linux/ObjectFactory.h index 966e9f2d..c88a9eb4 100644 --- a/linux/ObjectFactory.h +++ b/linux/ObjectFactory.h @@ -1,6 +1,7 @@ #pragma once #include +#include #include @@ -18,5 +19,6 @@ void createRtdComponents(std::string spiDev, GpioIF* gpioComIF, PowerSwitchIF* p void gpioChecker(ReturnValue_t result, std::string output); void createThermalController(); +void createAcsController(); } // namespace ObjectFactory diff --git a/linux/devices/ploc/PlocMemoryDumper.cpp b/linux/devices/ploc/PlocMemoryDumper.cpp index d4b40710..a6d9ebed 100644 --- a/linux/devices/ploc/PlocMemoryDumper.cpp +++ b/linux/devices/ploc/PlocMemoryDumper.cpp @@ -65,7 +65,7 @@ MessageQueueIF* PlocMemoryDumper::getCommandQueuePtr() { return commandQueue; } void PlocMemoryDumper::readCommandQueue() { CommandMessage message; - ReturnValue_t result; + ReturnValue_t result = RETURN_OK; for (result = commandQueue->receiveMessage(&message); result == HasReturnvaluesIF::RETURN_OK; result = commandQueue->receiveMessage(&message)) { diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index 75e14146..a3b9468d 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 207 translations. + * @brief Auto-generated event translation file. Contains 209 translations. * @details - * Generated on: 2022-06-21 01:20:13 + * Generated on: 2022-08-12 12:30:32 */ #include "translateEvents.h" @@ -134,6 +134,8 @@ const char *INVALID_TC_FRAME_STRING = "INVALID_TC_FRAME"; const char *INVALID_FAR_STRING = "INVALID_FAR"; const char *CARRIER_LOCK_STRING = "CARRIER_LOCK"; const char *BIT_LOCK_PDEC_STRING = "BIT_LOCK_PDEC"; +const char *LOST_CARRIER_LOCK_PDEC_STRING = "LOST_CARRIER_LOCK_PDEC"; +const char *LOST_BIT_LOCK_PDEC_STRING = "LOST_BIT_LOCK_PDEC"; const char *IMAGE_UPLOAD_FAILED_STRING = "IMAGE_UPLOAD_FAILED"; const char *IMAGE_DOWNLOAD_FAILED_STRING = "IMAGE_DOWNLOAD_FAILED"; const char *IMAGE_UPLOAD_SUCCESSFUL_STRING = "IMAGE_UPLOAD_SUCCESSFUL"; @@ -469,6 +471,10 @@ const char *translateEvents(Event event) { return CARRIER_LOCK_STRING; case (12404): return BIT_LOCK_PDEC_STRING; + case (12405): + return LOST_CARRIER_LOCK_PDEC_STRING; + case (12406): + return LOST_BIT_LOCK_PDEC_STRING; case (12500): return IMAGE_UPLOAD_FAILED_STRING; case (12501): diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index 1894dcd0..11b2abf2 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 132 translations. - * Generated on: 2022-06-21 00:51:33 + * Generated on: 2022-08-12 12:30:32 */ #include "translateObjects.h" diff --git a/linux/obc/PdecHandler.cpp b/linux/obc/PdecHandler.cpp index c7d52060..87fe0f48 100644 --- a/linux/obc/PdecHandler.cpp +++ b/linux/obc/PdecHandler.cpp @@ -192,15 +192,20 @@ bool PdecHandler::newTcReceived() { void PdecHandler::checkLocks() { uint32_t clcw = getClcw(); - if (!(clcw & NO_RF_MASK) && (lastClcw & NO_RF_MASK)) { - // Rf available changed from 0 to 1 + if (not(clcw & NO_RF_MASK) && not carrierLock) { triggerEvent(CARRIER_LOCK); + carrierLock = true; + } else if ((clcw & NO_RF_MASK) && carrierLock) { + carrierLock = false; + triggerEvent(LOST_CARRIER_LOCK_PDEC); } - if (!(clcw & NO_BITLOCK_MASK) && (lastClcw & NO_BITLOCK_MASK)) { - // Bit lock changed from 0 to 1 + if (not(clcw & NO_BITLOCK_MASK) && not bitLock) { triggerEvent(BIT_LOCK_PDEC); + bitLock = true; + } else if ((clcw & NO_BITLOCK_MASK) && bitLock) { + bitLock = false; + triggerEvent(LOST_BIT_LOCK_PDEC); } - lastClcw = clcw; } bool PdecHandler::checkFrameAna(uint32_t pdecFar) { diff --git a/linux/obc/PdecHandler.h b/linux/obc/PdecHandler.h index 58a19a1c..8db11464 100644 --- a/linux/obc/PdecHandler.h +++ b/linux/obc/PdecHandler.h @@ -76,6 +76,10 @@ class PdecHandler : public SystemObject, static const Event CARRIER_LOCK = MAKE_EVENT(3, severity::INFO); //! [EXPORT] : [COMMENT] Bit lock detected (data valid) static const Event BIT_LOCK_PDEC = MAKE_EVENT(4, severity::INFO); + //! [EXPORT] : [COMMENT] Lost carrier lock + static const Event LOST_CARRIER_LOCK_PDEC = MAKE_EVENT(5, severity::INFO); + //! [EXPORT] : [COMMENT] Lost bit lock + static const Event LOST_BIT_LOCK_PDEC = MAKE_EVENT(6, severity::INFO); private: static const uint8_t INTERFACE_ID = CLASS_ID::PDEC_HANDLER; @@ -386,6 +390,9 @@ class PdecHandler : public SystemObject, // Used to check carrier and bit lock changes (default set to no rf and no bitlock) uint32_t lastClcw = 0xC000; + + bool carrierLock = false; + bool bitLock = false; }; #endif /* LINUX_OBC_PDECHANDLER_H_ */ diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp new file mode 100644 index 00000000..4aea53a0 --- /dev/null +++ b/mission/controller/AcsController.cpp @@ -0,0 +1,96 @@ +#include +#include "AcsController.h" + +AcsController::AcsController(object_id_t objectId) + : ExtendedControllerBase(objectId, objects::NO_OBJECT), + mgmData(this) {} + +ReturnValue_t AcsController::handleCommandMessage(CommandMessage *message) { + return HasReturnvaluesIF::RETURN_OK; +} + +void AcsController::performControlOperation() { + switch (internalState) { + case InternalState::STARTUP: { + initialCountdown.resetTimer(); + internalState = InternalState::INITIAL_DELAY; + return; + } + case InternalState::INITIAL_DELAY: { + if (initialCountdown.hasTimedOut()) { + internalState = InternalState::READY; + } + return; + } + case InternalState::READY: { + break; + } + default: + break; + } + + { + PoolReadGuard pg(&mgmData); + if (pg.getReadResult() == RETURN_OK) { + copyMgmData(); + } + } +} + +ReturnValue_t AcsController::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, + LocalDataPoolManager &poolManager) { + localDataPoolMap.emplace(acsctrl::PoolIds::MGM_0_LIS3_UT, &mgm0PoolVec); + localDataPoolMap.emplace(acsctrl::PoolIds::MGM_1_RM3100_UT, &mgm1PoolVec); + localDataPoolMap.emplace(acsctrl::PoolIds::MGM_2_LIS3_UT, &mgm2PoolVec); + localDataPoolMap.emplace(acsctrl::PoolIds::MGM_3_RM3100_UT, &mgm3PoolVec); + localDataPoolMap.emplace(acsctrl::PoolIds::MGM_IMTQ_CAL_NT, &imtqMgmPoolVec); + localDataPoolMap.emplace(acsctrl::PoolIds::MGM_IMTQ_CAL_ACT_STATUS, &imtqCalActStatus); + poolManager.subscribeForPeriodicPacket(mgmData.getSid(), false, 5.0, false); + return HasReturnvaluesIF::RETURN_OK; +} + +LocalPoolDataSetBase *AcsController::getDataSetHandle(sid_t sid) { + if (sid == mgmData.getSid()) { + return &mgmData; + } + return nullptr; +} + +ReturnValue_t AcsController::checkModeCommand(Mode_t mode, Submode_t submode, + uint32_t *msToReachTheMode) { + return HasReturnvaluesIF::RETURN_OK; +} + +void AcsController::copyMgmData() { + { + PoolReadGuard pg(&mgm0Lis3Set); + if(pg.getReadResult() == RETURN_OK) { + std::memcpy(mgmData.mgm0Lis3.value, mgm0Lis3Set.fieldStrengths.value, 3 * sizeof(float)); + } + } + { + PoolReadGuard pg(&mgm1Rm3100Set); + if(pg.getReadResult() == RETURN_OK) { + std::memcpy(mgmData.mgm1Rm3100.value, mgm1Rm3100Set.fieldStrengths.value, 3 * sizeof(float)); + } + } + { + PoolReadGuard pg(&mgm2Lis3Set); + if(pg.getReadResult() == RETURN_OK) { + std::memcpy(mgmData.mgm2Lis3.value, mgm2Lis3Set.fieldStrengths.value, 3 * sizeof(float)); + } + } + { + PoolReadGuard pg(&mgm3Rm3100Set); + if(pg.getReadResult() == RETURN_OK) { + std::memcpy(mgmData.mgm3Rm3100.value, mgm3Rm3100Set.fieldStrengths.value, 3 * sizeof(float)); + } + } + { + PoolReadGuard pg(&imtqMgmSet); + if(pg.getReadResult() == RETURN_OK) { + std::memcpy(mgmData.imtqCal.value, imtqMgmSet.mgmXyz.value, 3 * sizeof(int32_t)); + mgmData.actuationCalStatus.value = imtqMgmSet.coilActuationStatus.value; + } + } +} diff --git a/mission/controller/AcsController.h b/mission/controller/AcsController.h new file mode 100644 index 00000000..8dbe38aa --- /dev/null +++ b/mission/controller/AcsController.h @@ -0,0 +1,55 @@ +#ifndef MISSION_CONTROLLER_ACSCONTROLLER_H_ +#define MISSION_CONTROLLER_ACSCONTROLLER_H_ + +#include +#include "controllerdefinitions/AcsCtrlDefinitions.h" +#include +#include "fsfw_hal/devicehandlers/MgmLIS3MDLHandler.h" +#include "fsfw_hal/devicehandlers/MgmRM3100Handler.h" +#include "mission/devices/devicedefinitions/IMTQHandlerDefinitions.h" + +class AcsController : public ExtendedControllerBase { + public: + static constexpr dur_millis_t INIT_DELAY = 500; + + AcsController(object_id_t objectId); + + private: + enum class InternalState { STARTUP, INITIAL_DELAY, READY }; + + InternalState internalState = InternalState::STARTUP; + + ReturnValue_t handleCommandMessage(CommandMessage* message) override; + void performControlOperation() override; + + ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap, + LocalDataPoolManager& poolManager) override; + LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override; + + // Mode abstract functions + ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode, + uint32_t* msToReachTheMode) override; + + // MGMs + acsctrl::MgmData mgmData; + + MGMLIS3MDL::MgmPrimaryDataset mgm0Lis3Set = MGMLIS3MDL::MgmPrimaryDataset(objects::MGM_0_LIS3_HANDLER); + RM3100::Rm3100PrimaryDataset mgm1Rm3100Set = RM3100::Rm3100PrimaryDataset(objects::MGM_1_RM3100_HANDLER); + MGMLIS3MDL::MgmPrimaryDataset mgm2Lis3Set = MGMLIS3MDL::MgmPrimaryDataset(objects::MGM_2_LIS3_HANDLER); + RM3100::Rm3100PrimaryDataset mgm3Rm3100Set = RM3100::Rm3100PrimaryDataset(objects::MGM_3_RM3100_HANDLER); + IMTQ::CalibratedMtmMeasurementSet imtqMgmSet = IMTQ::CalibratedMtmMeasurementSet(objects::IMTQ_HANDLER); + + PoolEntry mgm0PoolVec = PoolEntry(3); + PoolEntry mgm1PoolVec = PoolEntry(3); + PoolEntry mgm2PoolVec = PoolEntry(3); + PoolEntry mgm3PoolVec = PoolEntry(3); + PoolEntry imtqMgmPoolVec = PoolEntry(3); + PoolEntry imtqCalActStatus = PoolEntry(); + void copyMgmData(); + + // Initial delay to make sure all pool variables have been initialized their owners + Countdown initialCountdown = Countdown(INIT_DELAY); + // Sun Sensors +}; + +#endif /* MISSION_CONTROLLER_ACSCONTROLLER_H_ */ diff --git a/mission/controller/CMakeLists.txt b/mission/controller/CMakeLists.txt index 9587a704..84ff7f9e 100644 --- a/mission/controller/CMakeLists.txt +++ b/mission/controller/CMakeLists.txt @@ -1 +1,4 @@ -target_sources(${LIB_EIVE_MISSION} PRIVATE ThermalController.cpp) +if(TGT_BSP MATCHES "arm/q7s" OR TGT_BSP MATCHES "") + target_sources(${LIB_EIVE_MISSION} PRIVATE ThermalController.cpp + AcsController.cpp) +endif() diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index 0991e803..9e0fbd5a 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -200,9 +200,9 @@ ReturnValue_t ThermalController::initializeLocalDataPool(localpool::DataPool& lo localDataPoolMap.emplace(thermalControllerDefinitions::TEMP_ADC_PAYLOAD_PCDU, new PoolEntry({0.0})); - poolManager.subscribeForPeriodicPacket(sensorTemperatures.getSid(), true, 1.0, false); - poolManager.subscribeForPeriodicPacket(susTemperatures.getSid(), true, 1.0, false); - poolManager.subscribeForPeriodicPacket(deviceTemperatures.getSid(), true, 1.0, false); + poolManager.subscribeForPeriodicPacket(sensorTemperatures.getSid(), false, 1.0, false); + poolManager.subscribeForPeriodicPacket(susTemperatures.getSid(), false, 1.0, false); + poolManager.subscribeForPeriodicPacket(deviceTemperatures.getSid(), false, 1.0, false); return RETURN_OK; } diff --git a/mission/controller/controllerdefinitions/AcsCtrlDefinitions.h b/mission/controller/controllerdefinitions/AcsCtrlDefinitions.h new file mode 100644 index 00000000..f2913943 --- /dev/null +++ b/mission/controller/controllerdefinitions/AcsCtrlDefinitions.h @@ -0,0 +1,48 @@ +#ifndef MISSION_CONTROLLER_CONTROLLERDEFINITIONS_ACSCTRLDEFINITIONS_H_ +#define MISSION_CONTROLLER_CONTROLLERDEFINITIONS_ACSCTRLDEFINITIONS_H_ + +#include +#include +#include + +namespace acsctrl { + +enum SetIds : uint32_t { + MGM_SENSOR_DATA +}; + +enum PoolIds : lp_id_t { + MGM_0_LIS3_UT, + MGM_1_RM3100_UT, + MGM_2_LIS3_UT, + MGM_3_RM3100_UT, + MGM_IMTQ_CAL_NT, + MGM_IMTQ_CAL_ACT_STATUS +}; + + +static constexpr uint8_t MGM_SET_ENTRIES = 10; + +/** + * @brief This dataset can be used to store the collected temperatures of all temperature sensors + */ +class MgmData : public StaticLocalDataSet { +public: + MgmData(HasLocalDataPoolIF* hkOwner) : StaticLocalDataSet(hkOwner, MGM_SENSOR_DATA) {} + + // The ACS board measurement are in floating point uT + lp_vec_t mgm0Lis3 = lp_vec_t(sid.objectId, MGM_0_LIS3_UT, this); + lp_vec_t mgm1Rm3100 = lp_vec_t(sid.objectId, MGM_1_RM3100_UT, this); + lp_vec_t mgm2Lis3 = lp_vec_t(sid.objectId, MGM_2_LIS3_UT, this); + lp_vec_t mgm3Rm3100 = lp_vec_t(sid.objectId, MGM_3_RM3100_UT, this); + // The IMTQ measurements are in integer nT + lp_vec_t imtqCal = lp_vec_t(sid.objectId, MGM_IMTQ_CAL_NT, this); + lp_var_t actuationCalStatus = lp_var_t(sid.objectId, + MGM_IMTQ_CAL_ACT_STATUS, this); +private: + +}; + +} + +#endif /* MISSION_CONTROLLER_CONTROLLERDEFINITIONS_ACSCTRLDEFINITIONS_H_ */ diff --git a/mission/core/GenericFactory.cpp b/mission/core/GenericFactory.cpp index b602703f..1be91594 100644 --- a/mission/core/GenericFactory.cpp +++ b/mission/core/GenericFactory.cpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include "OBSWConfig.h" #include "eive/definitions.h" diff --git a/mission/devices/IMTQHandler.cpp b/mission/devices/IMTQHandler.cpp index 994ca84c..ea7a3177 100644 --- a/mission/devices/IMTQHandler.cpp +++ b/mission/devices/IMTQHandler.cpp @@ -331,9 +331,7 @@ ReturnValue_t IMTQHandler::initializeLocalDataPool(localpool::DataPool& localDat localDataPoolMap.emplace(IMTQ::MCU_TEMPERATURE, new PoolEntry({0})); /** Entries of calibrated MTM measurement dataset */ - localDataPoolMap.emplace(IMTQ::MTM_CAL_X, new PoolEntry({0})); - localDataPoolMap.emplace(IMTQ::MTM_CAL_Y, new PoolEntry({0})); - localDataPoolMap.emplace(IMTQ::MTM_CAL_Z, new PoolEntry({0})); + localDataPoolMap.emplace(IMTQ::MGM_CAL_NT, &mgmCalEntry); localDataPoolMap.emplace(IMTQ::ACTUATION_CAL_STATUS, new PoolEntry({0})); /** Entries of raw MTM measurement dataset */ @@ -749,14 +747,15 @@ void IMTQHandler::handleGetCommandedDipoleReply(const uint8_t* packet) { void IMTQHandler::fillCalibratedMtmDataset(const uint8_t* packet) { PoolReadGuard rg(&calMtmMeasurementSet); + calMtmMeasurementSet.setValidity(true, true); int8_t offset = 2; - calMtmMeasurementSet.mtmXnT = *(packet + offset + 3) << 24 | *(packet + offset + 2) << 16 | + calMtmMeasurementSet.mgmXyz[0] = *(packet + offset + 3) << 24 | *(packet + offset + 2) << 16 | *(packet + offset + 1) << 8 | *(packet + offset); offset += 4; - calMtmMeasurementSet.mtmYnT = *(packet + offset + 3) << 24 | *(packet + offset + 2) << 16 | + calMtmMeasurementSet.mgmXyz[1] = *(packet + offset + 3) << 24 | *(packet + offset + 2) << 16 | *(packet + offset + 1) << 8 | *(packet + offset); offset += 4; - calMtmMeasurementSet.mtmZnT = *(packet + offset + 3) << 24 | *(packet + offset + 2) << 16 | + calMtmMeasurementSet.mgmXyz[2] = *(packet + offset + 3) << 24 | *(packet + offset + 2) << 16 | *(packet + offset + 1) << 8 | *(packet + offset); offset += 4; calMtmMeasurementSet.coilActuationStatus = (*(packet + offset + 3) << 24) | @@ -764,11 +763,11 @@ void IMTQHandler::fillCalibratedMtmDataset(const uint8_t* packet) { (*(packet + offset + 1) << 8) | (*(packet + offset)); if (debugMode) { #if OBSW_VERBOSE_LEVEL >= 1 - sif::info << "IMTQ calibrated MTM measurement X: " << calMtmMeasurementSet.mtmXnT << " nT" + sif::info << "IMTQ calibrated MTM measurement X: " << calMtmMeasurementSet.mgmXyz[0] << " nT" << std::endl; - sif::info << "IMTQ calibrated MTM measurement Y: " << calMtmMeasurementSet.mtmYnT << " nT" + sif::info << "IMTQ calibrated MTM measurement Y: " << calMtmMeasurementSet.mgmXyz[1] << " nT" << std::endl; - sif::info << "IMTQ calibrated MTM measurement Z: " << calMtmMeasurementSet.mtmZnT << " nT" + sif::info << "IMTQ calibrated MTM measurement Z: " << calMtmMeasurementSet.mgmXyz[2] << " nT" << std::endl; sif::info << "IMTQ coil actuation status during MTM measurement: " << (unsigned int)calMtmMeasurementSet.coilActuationStatus.value << std::endl; diff --git a/mission/devices/IMTQHandler.h b/mission/devices/IMTQHandler.h index 1cd5d0f4..481d554c 100644 --- a/mission/devices/IMTQHandler.h +++ b/mission/devices/IMTQHandler.h @@ -99,6 +99,8 @@ class IMTQHandler : public DeviceHandlerBase { IMTQ::PosZSelfTestSet posZselfTestDataset; IMTQ::NegZSelfTestSet negZselfTestDataset; + PoolEntry mgmCalEntry = PoolEntry(3); + power::Switch_t switcher = power::NO_SWITCH; uint8_t commandBuffer[IMTQ::MAX_COMMAND_SIZE]; diff --git a/mission/devices/devicedefinitions/IMTQHandlerDefinitions.h b/mission/devices/devicedefinitions/IMTQHandlerDefinitions.h index 382fa106..e6661f84 100644 --- a/mission/devices/devicedefinitions/IMTQHandlerDefinitions.h +++ b/mission/devices/devicedefinitions/IMTQHandlerDefinitions.h @@ -115,9 +115,7 @@ enum IMTQPoolIds : lp_id_t { COIL_Y_TEMPERATURE, COIL_Z_TEMPERATURE, MCU_TEMPERATURE, - MTM_CAL_X, - MTM_CAL_Y, - MTM_CAL_Z, + MGM_CAL_NT, ACTUATION_CAL_STATUS, MTM_RAW_X, MTM_RAW_Y, @@ -408,9 +406,7 @@ class CalibratedMtmMeasurementSet : public StaticLocalDataSet mtmXnT = lp_var_t(sid.objectId, MTM_CAL_X, this); - lp_var_t mtmYnT = lp_var_t(sid.objectId, MTM_CAL_Y, this); - lp_var_t mtmZnT = lp_var_t(sid.objectId, MTM_CAL_Z, this); + lp_vec_t mgmXyz = lp_vec_t(sid.objectId, MGM_CAL_NT); /** 1 if coils were actuating during measurement otherwise 0 */ lp_var_t coilActuationStatus = lp_var_t(sid.objectId, ACTUATION_CAL_STATUS, this); diff --git a/mission/devices/devicedefinitions/SyrlinksDefinitions.h b/mission/devices/devicedefinitions/SyrlinksDefinitions.h index d4291367..447b5cce 100644 --- a/mission/devices/devicedefinitions/SyrlinksDefinitions.h +++ b/mission/devices/devicedefinitions/SyrlinksDefinitions.h @@ -3,6 +3,8 @@ #include +#include "fsfw/devicehandlers/DeviceHandlerBase.h" + namespace syrlinks { static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::SYRLINKS; diff --git a/mission/tmtc/CCSDSHandler.cpp b/mission/tmtc/CCSDSHandler.cpp index 41181e0f..72530ac4 100644 --- a/mission/tmtc/CCSDSHandler.cpp +++ b/mission/tmtc/CCSDSHandler.cpp @@ -9,6 +9,7 @@ #include "fsfw/serialize/SerializeAdapter.h" #include "fsfw/serviceinterface/ServiceInterface.h" #include "fsfw/serviceinterface/serviceInterfaceDefintions.h" +#include "mission/devices/devicedefinitions/SyrlinksDefinitions.h" CCSDSHandler::CCSDSHandler(object_id_t objectId, object_id_t ptmeId, object_id_t tcDestination, PtmeConfig* ptmeConfig, GpioIF* gpioIF, gpioId_t enTxClock, @@ -120,8 +121,16 @@ ReturnValue_t CCSDSHandler::initialize() { return ObjectManagerIF::CHILD_INIT_FAILED; } + if (result != HasReturnvaluesIF::RETURN_OK) { + return ObjectManagerIF::CHILD_INIT_FAILED; + } + #if OBSW_SYRLINKS_SIMULATED == 1 - ptmeConfig->invertTxClock(true); + // Update data on rising edge + ptmeConfig->invertTxClock(false); + transmitterCountdown.setTimeout(transmitterTimeout); + linkState = UP; + forwardLinkstate(); #endif /* OBSW_SYRLINKS_SIMULATED == 1*/ return result; @@ -331,14 +340,10 @@ void CCSDSHandler::enableTransmit() { // Transmitter already enabled return; } - transmitterCountdown.setTimeout(transmitterTimeout); #ifndef TE0720_1CFA gpioIF->pullHigh(enTxClock); gpioIF->pullHigh(enTxData); -#endif /* BOARD_TE0720 == 0 */ - linkState = UP; - // Set link state of all virtual channels to link up - forwardLinkstate(); +#endif } void CCSDSHandler::checkTxTimer() { @@ -351,10 +356,10 @@ void CCSDSHandler::checkTxTimer() { } void CCSDSHandler::disableTransmit() { -#ifdef TE0720_1CFA +#ifndef TE0720_1CFA gpioIF->pullLow(enTxClock); gpioIF->pullLow(enTxData); -#endif /* BOARD_TE0720 == 0 */ +#endif linkState = DOWN; forwardLinkstate(); transmitterCountdown.setTimeout(0); diff --git a/mission/tmtc/CCSDSHandler.h b/mission/tmtc/CCSDSHandler.h index 5959ff98..83d2edc5 100644 --- a/mission/tmtc/CCSDSHandler.h +++ b/mission/tmtc/CCSDSHandler.h @@ -91,6 +91,7 @@ class CCSDSHandler : public SystemObject, private: static const uint8_t INTERFACE_ID = CLASS_ID::CCSDS_HANDLER; + static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::PLOC_MPSOC_HANDLER; static const uint32_t QUEUE_SIZE = common::CCSDS_HANDLER_QUEUE_SIZE; @@ -118,7 +119,6 @@ class CCSDSHandler : public SystemObject, MessageQueueIF* commandQueue = nullptr; MessageQueueIF* eventQueue = nullptr; - ParameterHelper parameterHelper; ActionHelper actionHelper; diff --git a/mission/tmtc/CMakeLists.txt b/mission/tmtc/CMakeLists.txt index 96b02307..0a931d0f 100644 --- a/mission/tmtc/CMakeLists.txt +++ b/mission/tmtc/CMakeLists.txt @@ -1 +1,2 @@ -target_sources(${LIB_EIVE_MISSION} PRIVATE CCSDSHandler.cpp VirtualChannel.cpp) +target_sources(${LIB_EIVE_MISSION} PRIVATE CCSDSHandler.cpp VirtualChannel.cpp + TmFunnel.cpp) diff --git a/mission/utility/TmFunnel.cpp b/mission/tmtc/TmFunnel.cpp similarity index 99% rename from mission/utility/TmFunnel.cpp rename to mission/tmtc/TmFunnel.cpp index c47c7f9d..2eada527 100644 --- a/mission/utility/TmFunnel.cpp +++ b/mission/tmtc/TmFunnel.cpp @@ -2,7 +2,7 @@ #include #include #include -#include +#include #include "OBSWConfig.h" diff --git a/mission/utility/TmFunnel.h b/mission/tmtc/TmFunnel.h similarity index 100% rename from mission/utility/TmFunnel.h rename to mission/tmtc/TmFunnel.h diff --git a/mission/utility/CMakeLists.txt b/mission/utility/CMakeLists.txt index 11aff92d..128356bf 100644 --- a/mission/utility/CMakeLists.txt +++ b/mission/utility/CMakeLists.txt @@ -1,2 +1,2 @@ -target_sources(${LIB_EIVE_MISSION} PRIVATE TmFunnel.cpp Timestamp.cpp - ProgressPrinter.cpp Filenaming.cpp) +target_sources(${LIB_EIVE_MISSION} PRIVATE Timestamp.cpp ProgressPrinter.cpp + Filenaming.cpp) diff --git a/mission/utility/compileTime.h b/mission/utility/compileTime.h index 0d4f45a3..0e367248 100644 --- a/mission/utility/compileTime.h +++ b/mission/utility/compileTime.h @@ -37,39 +37,20 @@ #define CONV_STR2DEC_4(str, i) (CONV_STR2DEC_3(str, i) * 10 + str[i + 3] - '0') // Custom "glue logic" to convert the month name to a usable number -#define GET_MONTH(str, i) \ - (str[i] == 'J' && str[i + 1] == 'a' && str[i + 2] == 'n' \ - ? 1 \ - : str[i] == 'F' && str[i + 1] == 'e' && str[i + 2] == 'b' \ - ? 2 \ - : str[i] == 'M' && str[i + 1] == 'a' && str[i + 2] == 'r' \ - ? 3 \ - : str[i] == 'A' && str[i + 1] == 'p' && str[i + 2] == 'r' \ - ? 4 \ - : str[i] == 'M' && str[i + 1] == 'a' && str[i + 2] == 'y' \ - ? 5 \ - : str[i] == 'J' && str[i + 1] == 'u' && str[i + 2] == 'n' \ - ? 6 \ - : str[i] == 'J' && str[i + 1] == 'u' && str[i + 2] == 'l' \ - ? 7 \ - : str[i] == 'A' && str[i + 1] == 'u' && \ - str[i + 2] == 'g' \ - ? 8 \ - : str[i] == 'S' && str[i + 1] == 'e' && \ - str[i + 2] == 'p' \ - ? 9 \ - : str[i] == 'O' && str[i + 1] == 'c' && \ - str[i + 2] == 't' \ - ? 10 \ - : str[i] == 'N' && \ - str[i + 1] == 'o' && \ - str[i + 2] == 'v' \ - ? 11 \ - : str[i] == 'D' && \ - str[i + 1] == 'e' && \ - str[i + 2] == 'c' \ - ? 12 \ - : 0) +#define GET_MONTH(str, i) \ + (str[i] == 'J' && str[i + 1] == 'a' && str[i + 2] == 'n' ? 1 \ + : str[i] == 'F' && str[i + 1] == 'e' && str[i + 2] == 'b' ? 2 \ + : str[i] == 'M' && str[i + 1] == 'a' && str[i + 2] == 'r' ? 3 \ + : str[i] == 'A' && str[i + 1] == 'p' && str[i + 2] == 'r' ? 4 \ + : str[i] == 'M' && str[i + 1] == 'a' && str[i + 2] == 'y' ? 5 \ + : str[i] == 'J' && str[i + 1] == 'u' && str[i + 2] == 'n' ? 6 \ + : str[i] == 'J' && str[i + 1] == 'u' && str[i + 2] == 'l' ? 7 \ + : str[i] == 'A' && str[i + 1] == 'u' && str[i + 2] == 'g' ? 8 \ + : str[i] == 'S' && str[i + 1] == 'e' && str[i + 2] == 'p' ? 9 \ + : str[i] == 'O' && str[i + 1] == 'c' && str[i + 2] == 't' ? 10 \ + : str[i] == 'N' && str[i + 1] == 'o' && str[i + 2] == 'v' ? 11 \ + : str[i] == 'D' && str[i + 1] == 'e' && str[i + 2] == 'c' ? 12 \ + : 0) // extract the information from the time string given by __TIME__ and __DATE__ #define __TIME_SECONDS__ CONV_STR2DEC_2(__TIME__, 6) diff --git a/scripts/install-obsw-yocto.sh b/scripts/install-obsw-yocto.sh index 059d7244..c7880d2f 100755 --- a/scripts/install-obsw-yocto.sh +++ b/scripts/install-obsw-yocto.sh @@ -2,9 +2,11 @@ # This is a helper script to install the compiles EIVE OBSW files # into the yocto repository to re-generate the mission root filesystem build_dir=cmake-build-release-q7s +em_install="0" if [ ! -z ${1} ]; then if [[ "${1}" == "em" ]]; then echo "-I- Installing EM binaries" + em_install="1" build_dir=cmake-build-release-q7s-em fi fi @@ -17,6 +19,13 @@ q7s_package_path="q7s-package/${q7s_yocto_dir}" obsw_version_filename="obsw_version.txt" yocto_obsw_path="yocto/meta-eive/recipes-core/eive-obsw/files" +variant_specific_path="" +if [ ${em_install} == "1" ]; then + variant_specific_path="${yocto_obsw_path}/em" +else + variant_specific_path="${yocto_obsw_path}/fm" +fi + yocto_watchdog_path="yocto/meta-eive/recipes-support/eive-obsw-watchdog/files" obsw_bin_name="eive-obsw" watchdog_bin_name="eive-watchdog" @@ -27,7 +36,7 @@ if [ ! -z ${EIVE_OBSW_ROOT} ]; then cd ${EIVE_OBSW_ROOT} obsw_root=$(pwd) elif [ -d ${build_dir} ]; then - obsw_root=${build_dir} + obsw_root=$(pwd) : elif [ -d ../${build_dir} ]; then cd .. @@ -66,10 +75,10 @@ fi if [ ! -f ${build_dir}/${obsw_bin_name} ]; then echo "-W- No EIVE OBSW binary found to intall to yocto" else - cp_cmd="cp $(pwd)/${build_dir}/${obsw_bin_name} ${yocto_root}/${yocto_obsw_path}/${obsw_target_name}" + cp_cmd="cp $(pwd)/${build_dir}/${obsw_bin_name} ${yocto_root}/${variant_specific_path}/${obsw_target_name}" echo "-I- Executing: ${cp_cmd}" eval ${cp_cmd} - cp_ver_cmd="cp $(pwd)/${obsw_version_filename} ${yocto_root}/${yocto_obsw_path}" + cp_ver_cmd="cp $(pwd)/${obsw_version_filename} ${yocto_root}/${variant_specific_path}" echo "-I- Executing: ${cp_ver_cmd}" eval ${cp_ver_cmd} echo "-I- Installed EIVE OBSW into yocto repository successfully" diff --git a/scripts/q7s-env-em.sh b/scripts/q7s-env-em.sh index 895648a2..e8be1467 100755 --- a/scripts/q7s-env-em.sh +++ b/scripts/q7s-env-em.sh @@ -4,7 +4,7 @@ # custom cross-compiler and sysroot path setups # Adapt the following two entries to your need -CROSS_COMPILE_BIN_PATH="$HOME/EIVE/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin" +CROSS_COMPILE_BIN_PATH="/opt/q7s-gcc/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin" export ZYNQ_7020_SYSROOT="/opt/xiphos/sdk/ark/sysroots/cortexa9hf-neon-xiphos-linux-gnueabi" export PATH=$PATH:${CROSS_COMPILE_BIN_PATH} diff --git a/scripts/q7s-env.sh b/scripts/q7s-env.sh index c5638323..5cf608a0 100755 --- a/scripts/q7s-env.sh +++ b/scripts/q7s-env.sh @@ -4,7 +4,7 @@ # custom cross-compiler and sysroot path setups # Adapt the following two entries to your need -CROSS_COMPILE_BIN_PATH="$HOME/EIVE/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin" +CROSS_COMPILE_BIN_PATH="/opt/q7s-gcc/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin" export ZYNQ_7020_SYSROOT="/opt/xiphos/sdk/ark/sysroots/cortexa9hf-neon-xiphos-linux-gnueabi" export PATH=$PATH:${CROSS_COMPILE_BIN_PATH} diff --git a/tmtc b/tmtc index eced4538..ca9f85de 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit eced453886859b1dd3daf0943eda2835acdfa71c +Subproject commit ca9f85de1b51e29e3c0cccd527d736083e374f7f