diff --git a/CMakeLists.txt b/CMakeLists.txt index b218d82c..62a98c3d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,6 +20,9 @@ option(EIVE_ADD_JSON_LIB "Add JSON library" ON) option(EIVE_SYSROOT_MAGIC "Perform sysroot magic which might not be necessary" OFF) option(EIVE_CREATE_UNIQUE_OBSW_BIN "Append username to generated binary name" ON) +set(OBSW_ADD_STAR_TRACKER 0) +set(OBSW_DEBUG_STARTRACKER 0) + if(NOT FSFW_OSAL) set(FSFW_OSAL linux CACHE STRING "OS for the FSFW.") endif() @@ -118,6 +121,8 @@ if(TGT_BSP) # Used by configure file set(EGSE ON) set(FSFW_HAL_LINUX_ADD_LIBGPIOD OFF) + set(OBSW_ADD_STAR_TRACKER 1) + set(OBSW_DEBUG_STARTRACKER 1) endif() if(TGT_BSP MATCHES "arm/beagleboneblack") diff --git a/README.md b/README.md index 0effabb8..4d897980 100644 --- a/README.md +++ b/README.md @@ -385,20 +385,7 @@ more recent disitributions anymore. ## Installing toolchain without Vivado You can download the toolchains for Windows and Linux -[from the EIVE cloud](https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files?dir=/EIVE_IRS/Software/tools&fileid=831898). - -If `wget` is available (e.g. MinGW64), you can use the following command to download the -toolchain for Windows - -```sh -wget https://eive-cloud.irs.uni-stuttgart.de/index.php/s/rfoaistRd67yBbH/download/gcc-arm-linux-gnueabi-win.zip -``` - -or the following command for Linux (could be useful for CI/CD) - -```sh -wget https://eive-cloud.irs.uni-stuttgart.de/index.php/s/MRaeA2XnMXpZ5Pp/download/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf.tar.xz -``` +[from the EIVE cloud](https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files/?dir=/EIVE_IRS/Software/tools). ## Installing CMake and MSYS2 on Windows diff --git a/bsp_linux_board/main.cpp b/bsp_linux_board/main.cpp index 0ecb56d9..2f8ac4bc 100644 --- a/bsp_linux_board/main.cpp +++ b/bsp_linux_board/main.cpp @@ -3,8 +3,8 @@ #include "InitMission.h" #include "OBSWConfig.h" #include "OBSWVersion.h" -#include "fsfw/version.h" #include "fsfw/tasks/TaskFactory.h" +#include "fsfw/version.h" #ifdef RASPBERRY_PI static const char* const BOARD_NAME = "Raspberry Pi"; @@ -22,8 +22,7 @@ int main(void) { std::cout << "-- EIVE OBSW --" << std::endl; std::cout << "-- Compiled for Linux board " << BOARD_NAME << " --" << std::endl; std::cout << "-- OBSW " << SW_NAME << " v" << SW_VERSION << "." << SW_SUBVERSION << "." - << SW_REVISION << ", FSFW v" << fsfw::FSFW_VERSION - << "--" << std::endl; + << SW_REVISION << ", FSFW v" << fsfw::FSFW_VERSION << "--" << std::endl; std::cout << "-- " << __DATE__ << " " << __TIME__ << " --" << std::endl; initmission::initMission(); diff --git a/bsp_q7s/core/InitMission.cpp b/bsp_q7s/core/InitMission.cpp index 04bc8d3d..9acf343d 100644 --- a/bsp_q7s/core/InitMission.cpp +++ b/bsp_q7s/core/InitMission.cpp @@ -252,8 +252,10 @@ void initmission::createPstTasks(TaskFactory& factory, "PST_TASK_DEFAULT", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 0.5, missedDeadlineFunc); result = pst::pstSpi(spiPst); if (result != HasReturnvaluesIF::RETURN_OK) { - if (result != FixedTimeslotTaskIF::SLOT_LIST_EMPTY) { - sif::error << "InitMission::initTasks: Creating PST failed!" << std::endl; + if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) { + sif::warning << "InitMission::initTasks: SPI PST is empty" << std::endl; + } else { + sif::error << "InitMission::initTasks: Creating SPI PST failed!" << std::endl; } } else { taskVec.push_back(spiPst); @@ -264,32 +266,49 @@ void initmission::createPstTasks(TaskFactory& factory, "UART_PST", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 0.2, missedDeadlineFunc); result = pst::pstUart(uartPst); if (result != HasReturnvaluesIF::RETURN_OK) { - sif::error << "InitMission::initTasks: Creating PST failed!" << std::endl; + if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) { + sif::warning << "InitMission::initTasks: UART PST is empty" << std::endl; + } else { + sif::error << "InitMission::initTasks: Creating UART PST failed!" << std::endl; + } + } else { + taskVec.push_back(uartPst); } - taskVec.push_back(uartPst); + FixedTimeslotTaskIF* gpioPst = factory.createFixedTimeslotTask( "GPIO_PST", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 0.2, missedDeadlineFunc); result = pst::pstGpio(gpioPst); if (result != HasReturnvaluesIF::RETURN_OK) { - sif::error << "InitMission::initTasks: Creating PST failed!" << std::endl; + if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) { + sif::warning << "InitMission::initTasks: GPIO PST is empty" << std::endl; + } else { + sif::error << "InitMission::initTasks: Creating GPIO PST failed!" << std::endl; + } + } else { + taskVec.push_back(gpioPst); } - taskVec.push_back(gpioPst); - #if OBSW_ADD_I2C_TEST_CODE == 0 FixedTimeslotTaskIF* i2cPst = factory.createFixedTimeslotTask( "I2C_PST", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 0.2, missedDeadlineFunc); result = pst::pstI2c(i2cPst); if (result != HasReturnvaluesIF::RETURN_OK) { - sif::error << "InitMission::initTasks: Creating PST failed!" << std::endl; + if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) { + sif::warning << "InitMission::initTasks: I2C PST is empty" << std::endl; + } else { + sif::error << "InitMission::initTasks: Creating I2C PST failed!" << std::endl; + } + } else { + taskVec.push_back(i2cPst); } - taskVec.push_back(i2cPst); #endif FixedTimeslotTaskIF* gomSpacePstTask = factory.createFixedTimeslotTask( "GS_PST_TASK", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 1.0, missedDeadlineFunc); result = pst::pstGompaceCan(gomSpacePstTask); if (result != HasReturnvaluesIF::RETURN_OK) { - sif::error << "InitMission::initTasks: GomSpace PST initialization failed!" << std::endl; + if (result != FixedTimeslotTaskIF::SLOT_LIST_EMPTY) { + sif::error << "InitMission::initTasks: GomSpace PST initialization failed!" << std::endl; + } } taskVec.push_back(gomSpacePstTask); #else /* BOARD_TE7020 == 0 */ diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 27b5faa1..4133fee6 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -161,8 +161,8 @@ void ObjectFactory::produce(void* args) { auto imtqHandler = new IMTQHandler(objects::IMTQ_HANDLER, objects::I2C_COM_IF, imtqI2cCookie); static_cast(imtqHandler); #if OBSW_DEBUG_IMTQ == 1 - imtqHandler->setToGoToNormal(true); imtqHandler->setStartUpImmediately(); + imtqHandler->setToGoToNormal(true); #else (void)imtqHandler; #endif @@ -921,6 +921,7 @@ void ObjectFactory::createRtdComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchIF rtds[idx]->setParent(objects::TCS_BOARD_ASS); rtdFdir = new RtdFdir(rtdIds[idx]); rtds[idx]->setCustomFdir(rtdFdir); + rtds[idx]->setDeviceIdx(idx + 3); } #if OBSW_TEST_RTD == 1 @@ -1090,9 +1091,15 @@ void ObjectFactory::createCcsdsComponents(LinuxLibgpioIF* gpioComIF) { AxiPtmeConfig* axiPtmeConfig = new AxiPtmeConfig(objects::AXI_PTME_CONFIG, q7s::UIO_PTME, q7s::uiomapids::PTME_CONFIG); PtmeConfig* ptmeConfig = new PtmeConfig(objects::PTME_CONFIG, axiPtmeConfig); +#if OBSW_ENABLE_SYRLINKS_TRANSMIT_TIMEOUT == 1 + // Set to high value when not sending via syrlinks + static const uint32_t TRANSMITTER_TIMEOUT = 86400000; // 1 day +#else + static const uint32_t TRANSMITTER_TIMEOUT = 900000; // 15 minutes +#endif 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); + 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); diff --git a/bsp_q7s/memory/FileSystemHandler.h b/bsp_q7s/memory/FileSystemHandler.h index 6973c3c8..282cddba 100644 --- a/bsp_q7s/memory/FileSystemHandler.h +++ b/bsp_q7s/memory/FileSystemHandler.h @@ -6,6 +6,7 @@ #include "OBSWConfig.h" #include "SdCardManager.h" +#include "eive/definitions.h" #include "fsfw/ipc/MessageQueueIF.h" #include "fsfw/memory/HasFileSystemIF.h" #include "fsfw/objectmanager/SystemObject.h" diff --git a/cmake/scripts/Q7S/q7s-env-win.sh b/cmake/scripts/Q7S/q7s-env-win.sh deleted file mode 100644 index 8c86ba5d..00000000 --- a/cmake/scripts/Q7S/q7s-env-win.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh -# Run with: source q7s-env-win-sh [OPTIONS] -function help () { - echo "source q7s-env-win-sh [options] -t|--toolchain= -s|--sysroot=" -} - -TOOLCHAIN_PATH="/c/Xilinx/Vitis/2019.2/gnu/aarch32/nt/gcc-arm-linux-gnueabi/bin" -SYSROOT="/c/Users/${USER}/eive-software/cortexa9hf-neon-xiphos-linux-gnueabi" - -for i in "$@"; do - case $i in - -t=*|--toolchain=*) - TOOLCHAIN_PATH="${i#*=}" - shift - ;; - -s=*|--sysroot=*) - SYSROOT="${i#*=}" - shift - ;; - -h|--help) - help - shift - ;; - -*|--*) - echo "Unknown option $i" - help - return - ;; - *) - ;; - esac -done - -if [ -d "$TOOLCHAIN_PATH" ]; then - export PATH=$PATH:"/c/Xilinx/Vitis/2019.2/gnu/aarch32/nt/gcc-arm-linux-gnueabi/bin" - export CROSS_COMPILE="arm-linux-gnueabihf" - echo "Set toolchain path to /c/Xilinx/Vitis/2019.2/gnu/aarch32/nt/gcc-arm-linux-gnueabi/bin" -else - echo "Toolchain path $TOOLCHAIN_PATH does not exist" - return -fi - -if [ -d "$SYSROOT" ]; then - export ZYNQ_7020_SYSROOT=$SYSROOT - echo "Set sysroot path to $SYSROOT" -else - echo "Sysroot path $SYSROOT does not exist" - return -fi \ No newline at end of file diff --git a/common/config/eive/definitions.h b/common/config/eive/definitions.h new file mode 100644 index 00000000..db430540 --- /dev/null +++ b/common/config/eive/definitions.h @@ -0,0 +1,25 @@ +#ifndef COMMON_CONFIG_DEFINITIONS_H_ +#define COMMON_CONFIG_DEFINITIONS_H_ + +#include + +namespace config { + +static constexpr uint32_t PL_PCDU_TRANSITION_TIMEOUT_MS = 20 * 60 * 1000; +static constexpr uint32_t LONGEST_MODE_TIMEOUT_SECONDS = PL_PCDU_TRANSITION_TIMEOUT_MS / 1000; + +/* Add mission configuration flags here */ +static constexpr uint32_t OBSW_FILESYSTEM_HANDLER_QUEUE_SIZE = 50; +static constexpr uint32_t PLOC_UPDATER_QUEUE_SIZE = 50; +static constexpr uint32_t STR_IMG_HELPER_QUEUE_SIZE = 50; + +static constexpr uint8_t LIVE_TM = 0; + +/* Limits for filename and path checks */ +static constexpr uint32_t MAX_PATH_SIZE = 100; +static constexpr uint32_t MAX_FILENAME_SIZE = 50; + +} + + +#endif /* COMMON_CONFIG_DEFINITIONS_H_ */ diff --git a/linux/devices/devicedefinitions/PlocMPSoCDefinitions.h b/linux/devices/devicedefinitions/PlocMPSoCDefinitions.h index 111004d5..52e141bf 100644 --- a/linux/devices/devicedefinitions/PlocMPSoCDefinitions.h +++ b/linux/devices/devicedefinitions/PlocMPSoCDefinitions.h @@ -1,9 +1,10 @@ #ifndef MISSION_DEVICES_DEVICEDEFINITIONS_PLOCMPSOCDEFINITIONS_H_ #define MISSION_DEVICES_DEVICEDEFINITIONS_PLOCMPSOCDEFINITIONS_H_ -#include -#include -#include +#include "fsfw/globalfunctions/CRC.h" +#include "fsfw/serialize/SerializeAdapter.h" +#include "fsfw/tmtcpacket/SpacePacket.h" +#include "eive/definitions.h" #include "MPSoCReturnValuesIF.h" #include "OBSWConfig.h" diff --git a/linux/devices/ploc/PlocUpdater.h b/linux/devices/ploc/PlocUpdater.h index 1664442f..7c4b4c07 100644 --- a/linux/devices/ploc/PlocUpdater.h +++ b/linux/devices/ploc/PlocUpdater.h @@ -5,6 +5,8 @@ #include #include "fsfw/action/CommandActionHelper.h" #include "bsp_q7s/memory/SdCardManager.h" +#include "linux/devices/devicedefinitions/PlocSupervisorDefinitions.h" +#include "eive/definitions.h" #include "fsfw/action/ActionHelper.h" #include "fsfw/action/CommandActionHelper.h" #include "fsfw/action/CommandsActionsIF.h" diff --git a/linux/fsfwconfig/OBSWConfig.h.in b/linux/fsfwconfig/OBSWConfig.h.in index dabbcaae..d75a388a 100644 --- a/linux/fsfwconfig/OBSWConfig.h.in +++ b/linux/fsfwconfig/OBSWConfig.h.in @@ -12,11 +12,6 @@ #cmakedefine EGSE #cmakedefine TE0720_1CFA -#ifdef RASPBERRY_PI -#include "rpiConfig.h" -#elif defined(XIPHOS_Q7S) -#include "q7sConfig.h" -#endif #include "commonConfig.h" #include "OBSWVersion.h" @@ -26,6 +21,7 @@ debugging. */ //! Board defines #define BOARD_TE0720 0 +#define Q7S_EM 0 /*******************************************************************/ /** All of the following flags should be enabled for mission code */ @@ -37,7 +33,7 @@ debugging. */ #define Q7S_EM 0 -#define OBSW_USE_CCSDS_IP_CORE 0 +#define OBSW_USE_CCSDS_IP_CORE 1 // Set to 1 if all telemetry should be sent to the PTME IP Core #define OBSW_TM_TO_PTME 0 // Set to 1 if telecommands are received via the PDEC IP Core @@ -46,7 +42,7 @@ debugging. */ #define OBSW_ENABLE_TIMERS 1 #define OBSW_ADD_MGT 1 #define OBSW_ADD_BPX_BATTERY_HANDLER 1 -#define OBSW_ADD_STAR_TRACKER 0 +#define OBSW_ADD_STAR_TRACKER @OBSW_ADD_STAR_TRACKER@ #define OBSW_ADD_PLOC_SUPERVISOR 0 #define OBSW_ADD_PLOC_MPSOC 0 #define OBSW_ADD_SUN_SENSORS 1 @@ -60,7 +56,8 @@ debugging. */ #define OBSW_ADD_SYRLINKS 0 #define OBSW_ENABLE_SYRLINKS_TRANSMIT_TIMEOUT 0 #define OBSW_STAR_TRACKER_GROUND_CONFIG 1 -#define OBSW_ENABLE_PERIODIC_HK 0 + +#endif // XIPHOS_Q7S // This is a really tricky switch.. It initializes the PCDU switches to their default states // at powerup. I think it would be better @@ -68,12 +65,7 @@ debugging. */ // something the operators might want to do by giving the software too much intelligence // at the wrong place. The system component might command all the Switches accordingly anyway #define OBSW_INITIALIZE_SWITCHES 0 - -#endif - -#ifdef EGSE -#define OBSW_ADD_STAR_TRACKER 1 -#endif +#define OBSW_ENABLE_PERIODIC_HK 0 #ifdef TE0720_1CFA @@ -178,16 +170,20 @@ debugging. */ #define OBSW_ADD_PLOC_SUPERVISOR 0 #define OBSW_ADD_PLOC_MPSOC 0 #define OBSW_ADD_SUN_SENSORS 0 +#define OBSW_ADD_MGT 0 #define OBSW_ADD_ACS_BOARD 0 #define OBSW_ADD_GPS_0 0 #define OBSW_ADD_GPS_1 0 #define OBSW_ADD_RW 0 +#define OBSW_ADD_BPX_BATTERY_HANDLER 0 #define OBSW_ADD_RTD_DEVICES 0 +#define OBSW_ADD_PL_PCDU 0 #define OBSW_ADD_TMP_DEVICES 0 #define OBSW_ADD_RAD_SENSORS 0 #define OBSW_ADD_SYRLINKS 0 +#define OBSW_STAR_TRACKER_GROUND_CONFIG 1 -#endif +#endif // RASPBERRY_PI #define TCP_SERVER_WIRETAPPING 0 @@ -196,7 +192,11 @@ debugging. */ /*******************************************************************/ #cmakedefine EIVE_BUILD_GPSD_GPS_HANDLER -#include "OBSWVersion.h" +#ifdef RASPBERRY_PI +#include "rpiConfig.h" +#elif defined(XIPHOS_Q7S) +#include "q7sConfig.h" +#endif #ifdef __cplusplus @@ -204,19 +204,6 @@ debugging. */ #include "events/subsystemIdRanges.h" #include "returnvalues/classIds.h" -namespace config { -#endif - -/* Add mission configuration flags here */ -static constexpr uint32_t OBSW_FILESYSTEM_HANDLER_QUEUE_SIZE = 50; -static constexpr uint32_t PLOC_UPDATER_QUEUE_SIZE = 50; -/* Global config values to check validity of received file path strings and filenames */ -static constexpr uint32_t MAX_PATH_SIZE = 100; -static constexpr uint32_t MAX_FILENAME_SIZE = 50; -static constexpr uint8_t LIVE_TM = 0; - -#ifdef __cplusplus -} #endif #endif /* FSFWCONFIG_OBSWCONFIG_H_ */ diff --git a/misc/eclipse/.cproject b/misc/eclipse/.cproject index 15b0195b..aa59f2da 100644 --- a/misc/eclipse/.cproject +++ b/misc/eclipse/.cproject @@ -589,7 +589,7 @@ - + diff --git a/mission/core/GenericFactory.cpp b/mission/core/GenericFactory.cpp index cc814b7e..f18282bd 100644 --- a/mission/core/GenericFactory.cpp +++ b/mission/core/GenericFactory.cpp @@ -1,6 +1,5 @@ #include "GenericFactory.h" -#include #include #include #include @@ -18,10 +17,12 @@ #include #include #include -#include -#include +#include "OBSWConfig.h" +#include "eive/definitions.h" #include "objects/systemObjectList.h" +#include "tmtc/apid.h" +#include "tmtc/pusIds.h" #if OBSW_ADD_TCPIP_BRIDGE == 1 #if OBSW_USE_TMTC_TCP_BRIDGE == 0 @@ -39,6 +40,10 @@ #include #endif +#ifndef OBSW_TM_TO_PTME +#define OBSW_TM_TO_PTME 0 +#endif + void ObjectFactory::produceGenericObjects() { // Framework objects new EventManager(objects::EVENT_MANAGER); @@ -68,8 +73,12 @@ void ObjectFactory::produceGenericObjects() { new PUSDistributor(apid::EIVE_OBSW, objects::PUS_PACKET_DISTRIBUTOR, objects::CCSDS_PACKET_DISTRIBUTOR); + uint8_t vc = 0; +#if OBSW_TM_TO_PTME == 1 + vc = config::LIVE_TM; +#endif // Every TM packet goes through this funnel - new TmFunnel(objects::TM_FUNNEL, 50); + new TmFunnel(objects::TM_FUNNEL, 50, vc); // PUS service stack new Service1TelecommandVerification(objects::PUS_SERVICE_1_VERIFICATION, apid::EIVE_OBSW, @@ -87,7 +96,7 @@ void ObjectFactory::produceGenericObjects() { new Service20ParameterManagement(objects::PUS_SERVICE_20_PARAMETERS, apid::EIVE_OBSW, pus::PUS_SERVICE_20); new CService200ModeCommanding(objects::PUS_SERVICE_200_MODE_MGMT, apid::EIVE_OBSW, - pus::PUS_SERVICE_200); + pus::PUS_SERVICE_200, 8, config::LONGEST_MODE_TIMEOUT_SECONDS); #if OBSW_ADD_TCPIP_BRIDGE == 1 #if OBSW_USE_TMTC_TCP_BRIDGE == 0 diff --git a/mission/devices/Max31865PT1000Handler.cpp b/mission/devices/Max31865PT1000Handler.cpp index 21631134..9a4d88ce 100644 --- a/mission/devices/Max31865PT1000Handler.cpp +++ b/mission/devices/Max31865PT1000Handler.cpp @@ -403,9 +403,9 @@ ReturnValue_t Max31865PT1000Handler::interpretDeviceReply(DeviceCommandId_t id, #if OBSW_VERBOSE_LEVEL >= 1 if (debugDivider->checkAndIncrement()) { #if FSFW_CPP_OSTREAM_ENABLED == 1 - sif::info << "Max31865: Object ID: " << std::hex << this->getObjectId() - << ": Measured resistance is " << rtdValue << " Ohms." << std::endl; - sif::info << "Approximated temperature is " << approxTemp << " C" << std::endl; + sif::info << "Max31865: ObjID " << std::hex << this->getObjectId() << " | RTD " << std::dec + << static_cast(deviceIdx) << ": R[Ohm] " << rtdValue + << " Ohms | Approx T[C]: " << approxTemp << std::endl; #else sif::printInfo("Max31685: Measured resistance is %f Ohms\n", rtdValue); sif::printInfo("Approximated temperature is %f C\n", approxTemp); @@ -529,3 +529,5 @@ void Max31865PT1000Handler::modeChanged() { internalState = InternalState::NONE; } } + +void Max31865PT1000Handler::setDeviceIdx(uint8_t idx) { deviceIdx = idx; } diff --git a/mission/devices/Max31865PT1000Handler.h b/mission/devices/Max31865PT1000Handler.h index 1be4c323..17657bcf 100644 --- a/mission/devices/Max31865PT1000Handler.h +++ b/mission/devices/Max31865PT1000Handler.h @@ -46,6 +46,8 @@ class Max31865PT1000Handler : public DeviceHandlerBase { static constexpr uint8_t DEFAULT_CONFIG = 0b11000001; void setInstantNormal(bool instantNormal); + void setDeviceIdx(uint8_t idx); + /** * Expected temperature range is -100 C and 100 C. * If there are temperatures beyond this range there must be a fault. @@ -105,6 +107,7 @@ class Max31865PT1000Handler : public DeviceHandlerBase { bool resetFaultBit = false; dur_millis_t startTime = 0; uint8_t faultByte = 0; + uint8_t deviceIdx = 0; std::array commandBuffer{0}; Max31865Definitions::Max31865Set sensorDataset; diff --git a/mission/system/TcsBoardAssembly.h b/mission/system/TcsBoardAssembly.h index cda78317..832f335d 100644 --- a/mission/system/TcsBoardAssembly.h +++ b/mission/system/TcsBoardAssembly.h @@ -14,8 +14,7 @@ struct TcsBoardHelper { class TcsBoardAssembly : public AssemblyBase, public ConfirmsFailuresIF { public: static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::TCS_BOARD_ASS; - static constexpr Event CHILDREN_LOST_MODE = - event::makeEvent(SUBSYSTEM_ID, 0, severity::MEDIUM); + static constexpr Event CHILDREN_LOST_MODE = event::makeEvent(SUBSYSTEM_ID, 0, severity::MEDIUM); TcsBoardAssembly(object_id_t objectId, object_id_t parentId, PowerSwitchIF* pwrSwitcher, power::Switch_t switcher, TcsBoardHelper helper); diff --git a/mission/tmtc/CCSDSHandler.cpp b/mission/tmtc/CCSDSHandler.cpp index d6c2367b..dcffe5f9 100644 --- a/mission/tmtc/CCSDSHandler.cpp +++ b/mission/tmtc/CCSDSHandler.cpp @@ -12,7 +12,7 @@ CCSDSHandler::CCSDSHandler(object_id_t objectId, object_id_t ptmeId, object_id_t tcDestination, PtmeConfig* ptmeConfig, GpioIF* gpioIF, gpioId_t enTxClock, - gpioId_t enTxData) + gpioId_t enTxData, uint32_t transmitterTimeout) : SystemObject(objectId), ptmeId(ptmeId), tcDestination(tcDestination), @@ -21,7 +21,8 @@ CCSDSHandler::CCSDSHandler(object_id_t objectId, object_id_t ptmeId, object_id_t ptmeConfig(ptmeConfig), gpioIF(gpioIF), enTxClock(enTxClock), - enTxData(enTxData) { + enTxData(enTxData), + TRANSMITTER_TIMEOUT(transmitterTimeout) { commandQueue = QueueFactory::instance()->createMessageQueue(QUEUE_SIZE); auto mqArgs = MqArgs(objectId, static_cast(this)); eventQueue = diff --git a/mission/tmtc/CCSDSHandler.h b/mission/tmtc/CCSDSHandler.h index 284cbcba..a916361b 100644 --- a/mission/tmtc/CCSDSHandler.h +++ b/mission/tmtc/CCSDSHandler.h @@ -51,7 +51,8 @@ class CCSDSHandler : public SystemObject, * @param enTxData GPIO ID of RS485 tx data enable */ CCSDSHandler(object_id_t objectId, object_id_t ptmeId, object_id_t tcDestination, - PtmeConfig* ptmeConfig, GpioIF* gpioIF, gpioId_t enTxClock, gpioId_t enTxData); + PtmeConfig* ptmeConfig, GpioIF* gpioIF, gpioId_t enTxClock, gpioId_t enTxData, + uint32_t transmitterTimeout = 900000); ~CCSDSHandler(); @@ -104,14 +105,6 @@ class CCSDSHandler : public SystemObject, //! [EXPORT] : [COMMENT] Received action message with unknown action id static const ReturnValue_t COMMAND_NOT_IMPLEMENTED = MAKE_RETURN_CODE(0xA0); -#if OBSW_ENABLE_SYRLINKS_TRANSMIT_TIMEOUT == 1 - // syrlinks must not be transmitting more than 15 minutes (according to datasheet) - static const uint32_t TRANSMITTER_TIMEOUT = 900000; // 900000 ms = 15 min -#else - // Set to high value when not sending via syrlinks - static const uint32_t TRANSMITTER_TIMEOUT = 86400000; // 1 day -#endif /* OBSW_SYRLINKS_DOWNLINK == 0 */ - static const bool UP = true; static const bool DOWN = false; @@ -140,6 +133,10 @@ class CCSDSHandler : public SystemObject, gpioId_t enTxClock = gpio::NO_GPIO; gpioId_t enTxData = gpio::NO_GPIO; + // syrlinks must not be transmitting more than 15 minutes (according to datasheet) + // Value can be configured via CTOR argument to allow test setups + const uint32_t TRANSMITTER_TIMEOUT = 900000; // 900000 ms = 15 min + // Countdown to disable transmitter after 15 minutes Countdown transmitterCountdown; diff --git a/mission/utility/TmFunnel.cpp b/mission/utility/TmFunnel.cpp index e22eabdf..c47c7f9d 100644 --- a/mission/utility/TmFunnel.cpp +++ b/mission/utility/TmFunnel.cpp @@ -9,8 +9,8 @@ object_id_t TmFunnel::downlinkDestination = objects::NO_OBJECT; object_id_t TmFunnel::storageDestination = objects::NO_OBJECT; -TmFunnel::TmFunnel(object_id_t objectId, uint32_t messageDepth) - : SystemObject(objectId), messageDepth(messageDepth) { +TmFunnel::TmFunnel(object_id_t objectId, uint32_t messageDepth, uint8_t reportReceptionVc) + : SystemObject(objectId), messageDepth(messageDepth), reportReceptionVc(reportReceptionVc) { auto mqArgs = MqArgs(objectId, static_cast(this)); tmQueue = QueueFactory::instance()->createMessageQueue( messageDepth, MessageQueueMessage::MAX_MESSAGE_SIZE, &mqArgs); @@ -97,12 +97,7 @@ ReturnValue_t TmFunnel::initialize() { return ObjectManagerIF::CHILD_INIT_FAILED; } -#if OBSW_TM_TO_PTME == 1 - // Live TM will be sent via the virtual channel 0 - tmQueue->setDefaultDestination(tmTarget->getReportReceptionQueue(config::LIVE_TM)); -#else - tmQueue->setDefaultDestination(tmTarget->getReportReceptionQueue()); -#endif /* OBSW_TM_TO_PTME == 1 */ + tmQueue->setDefaultDestination(tmTarget->getReportReceptionQueue(reportReceptionVc)); // Storage destination is optional. if (storageDestination == objects::NO_OBJECT) { diff --git a/mission/utility/TmFunnel.h b/mission/utility/TmFunnel.h index 013e0ebc..f11dce63 100644 --- a/mission/utility/TmFunnel.h +++ b/mission/utility/TmFunnel.h @@ -23,7 +23,7 @@ class TmFunnel : public AcceptsTelemetryIF, public ExecutableObjectIF, public Sy friend void(Factory::setStaticFrameworkObjectIds)(); public: - TmFunnel(object_id_t objectId, uint32_t messageDepth = 20); + TmFunnel(object_id_t objectId, uint32_t messageDepth = 20, uint8_t reportReceptionVc = 0); virtual ~TmFunnel(); virtual MessageQueueId_t getReportReceptionQueue(uint8_t virtualChannel = 0) override; @@ -35,12 +35,13 @@ class TmFunnel : public AcceptsTelemetryIF, public ExecutableObjectIF, public Sy static object_id_t storageDestination; private: + uint32_t messageDepth = 0; + uint8_t reportReceptionVc = 0; uint16_t sourceSequenceCount = 0; MessageQueueIF* tmQueue = nullptr; MessageQueueIF* storageQueue = nullptr; StorageManagerIF* tmStore = nullptr; - uint32_t messageDepth = 0; ReturnValue_t handlePacket(TmTcMessage* message); }; diff --git a/scripts/egse-port.sh b/scripts/egse-port.sh old mode 100644 new mode 100755