From d25e883e65ad9505a15d7e6f64e3dbc8e662655b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 26 Oct 2022 15:30:04 +0200 Subject: [PATCH 01/10] further reduce EM obj factory --- bsp_q7s/em/emObjectFactory.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bsp_q7s/em/emObjectFactory.cpp b/bsp_q7s/em/emObjectFactory.cpp index 4202cfdd..7b80225c 100644 --- a/bsp_q7s/em/emObjectFactory.cpp +++ b/bsp_q7s/em/emObjectFactory.cpp @@ -44,6 +44,7 @@ void ObjectFactory::produce(void* args) { // createRtdComponents(q7s::SPI_DEFAULT_DEV, gpioComIF, pwrSwitcher, spiMainComIF); // createTmpComponents(); // createSolarArrayDeploymentComponents(); + // createPayloadComponents(gpioComIF); createRadSensorComponent(gpioComIF); #if OBSW_ADD_ACS_BOARD == 1 @@ -51,12 +52,14 @@ void ObjectFactory::produce(void* args) { #endif createHeaterComponents(gpioComIF, pwrSwitcher, healthTable); - createPayloadComponents(gpioComIF); #if OBSW_ADD_MGT == 1 createImtqComponents(pwrSwitcher); #endif + +#if OBSW_ADD_RW == 1 createReactionWheelComponents(gpioComIF, pwrSwitcher); +#endif #if OBSW_ADD_BPX_BATTERY_HANDLER == 1 createBpxBatteryComponent(); @@ -76,7 +79,5 @@ void ObjectFactory::produce(void* args) { createScexComponents(q7s::UART_SCEX_DEV, pwrSwitcher, *SdCardManager::instance(), true, std::nullopt); #endif - - createMiscComponents(); createAcsController(); } From c2845aefafd6560dc5a02fcc9a78c0633aced4a1 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 26 Oct 2022 15:31:04 +0200 Subject: [PATCH 02/10] further reduce EM SW --- bsp_q7s/em/emObjectFactory.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bsp_q7s/em/emObjectFactory.cpp b/bsp_q7s/em/emObjectFactory.cpp index 7b80225c..cc314e06 100644 --- a/bsp_q7s/em/emObjectFactory.cpp +++ b/bsp_q7s/em/emObjectFactory.cpp @@ -45,13 +45,12 @@ void ObjectFactory::produce(void* args) { // createTmpComponents(); // createSolarArrayDeploymentComponents(); // createPayloadComponents(gpioComIF); + // createHeaterComponents(gpioComIF, pwrSwitcher, healthTable); createRadSensorComponent(gpioComIF); #if OBSW_ADD_ACS_BOARD == 1 createAcsBoardComponents(gpioComIF, uartComIF, pwrSwitcher); #endif - createHeaterComponents(gpioComIF, pwrSwitcher, healthTable); - #if OBSW_ADD_MGT == 1 createImtqComponents(pwrSwitcher); From 00059251f0dcd37a13d5f7b331041161bb63a71c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 26 Oct 2022 15:47:23 +0200 Subject: [PATCH 03/10] further clean up em and general code --- CMakeLists.txt | 12 ++++++++++++ bsp_q7s/OBSWConfig.h.in | 6 ++++-- bsp_q7s/boardtest/Q7STestTask.cpp | 6 ++++-- bsp_q7s/boardtest/Q7STestTask.h | 1 + bsp_q7s/core/InitMission.cpp | 10 +++++++++- bsp_q7s/em/emObjectFactory.cpp | 1 + .../pollingSequenceFactory.cpp | 19 ++++--------------- mission/devices/ImtqHandler.cpp | 3 ++- 8 files changed, 37 insertions(+), 21 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 43336bdd..8e0537f5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -101,6 +101,18 @@ set(OBSW_ADD_GPS_CTRL set(OBSW_ADD_TCS_CTRL ${INIT_VAL} CACHE STRING "Add TCS controllers") +set(OBSW_ADD_HEATERS + ${INIT_VAL} + CACHE STRING "Add TCS heaters") +set(OBSW_ADD_PLOC_SUPERVISOR + ${INIT_VAL} + CACHE STRING "Add PLOC supervisor handler") +set(OBSW_ADD_SA_DEPL + ${INIT_VAL} + CACHE STRING "Add SA deployment handler") +set(OBSW_ADD_PLOC_MPSOC + ${INIT_VAL} + CACHE STRING "Add MPSoC handler") set(OBSW_ADD_ACS_CTRL ${INIT_VAL} CACHE STRING "Add ACS controller") diff --git a/bsp_q7s/OBSWConfig.h.in b/bsp_q7s/OBSWConfig.h.in index f3cfa907..bf113173 100644 --- a/bsp_q7s/OBSWConfig.h.in +++ b/bsp_q7s/OBSWConfig.h.in @@ -24,8 +24,8 @@ #define OBSW_ADD_MGT @OBSW_ADD_MGT@ #define OBSW_ADD_BPX_BATTERY_HANDLER @OBSW_ADD_BPX_BATTERY_HANDLER@ #define OBSW_ADD_STAR_TRACKER @OBSW_ADD_STAR_TRACKER@ -#define OBSW_ADD_PLOC_SUPERVISOR 1 -#define OBSW_ADD_PLOC_MPSOC 1 +#define OBSW_ADD_PLOC_SUPERVISOR @OBSW_ADD_PLOC_SUPERVISOR@ +#define OBSW_ADD_PLOC_MPSOC @OBSW_ADD_PLOC_MPSOC@ #define OBSW_ADD_SUN_SENSORS @OBSW_ADD_SUN_SENSORS@ #define OBSW_ADD_SUS_BOARD_ASS @OBSW_ADD_SUS_BOARD_ASS@ #define OBSW_ADD_ACS_BOARD @OBSW_ADD_ACS_BOARD@ @@ -34,7 +34,9 @@ #define OBSW_ADD_TCS_CTRL @OBSW_ADD_TCS_CTRL@ #define OBSW_ADD_RW @OBSW_ADD_RW@ #define OBSW_ADD_RTD_DEVICES @OBSW_ADD_RTD_DEVICES@ +#define OBSW_ADD_SA_DEPL @OBSW_ADD_SA_DEPL@ #define OBSW_ADD_SCEX_DEVICE @OBSW_ADD_SCEX_DEVICE@ +#define OBSW_ADD_HEATERS @OBSW_ADD_HEATERS@ #define OBSW_ADD_TMP_DEVICES @OBSW_ADD_TMP_DEVICES@ #define OBSW_ADD_RAD_SENSORS @OBSW_ADD_RAD_SENSORS@ #define OBSW_ADD_PL_PCDU @OBSW_ADD_PL_PCDU@ diff --git a/bsp_q7s/boardtest/Q7STestTask.cpp b/bsp_q7s/boardtest/Q7STestTask.cpp index a782ff6d..50a34284 100644 --- a/bsp_q7s/boardtest/Q7STestTask.cpp +++ b/bsp_q7s/boardtest/Q7STestTask.cpp @@ -75,8 +75,10 @@ ReturnValue_t Q7STestTask::performOneShotAction() { if (doTestProtHandler) { testProtHandler(); } - FsOpCodes opCode = FsOpCodes::CREATE_EMPTY_FILE_IN_TMP; - testFileSystemHandlerDirect(opCode); + if (DO_TEST_FS_HANDLER) { + FsOpCodes opCode = FsOpCodes::CREATE_EMPTY_FILE_IN_TMP; + testFileSystemHandlerDirect(opCode); + } return TestTask::performOneShotAction(); } diff --git a/bsp_q7s/boardtest/Q7STestTask.h b/bsp_q7s/boardtest/Q7STestTask.h index 9e39e8b3..dcfc3e96 100644 --- a/bsp_q7s/boardtest/Q7STestTask.h +++ b/bsp_q7s/boardtest/Q7STestTask.h @@ -18,6 +18,7 @@ class Q7STestTask : public TestTask { bool doTestScratchApi = false; static constexpr bool DO_TEST_GOMSPACE_API = false; static constexpr bool DO_TEST_GOMSPACE_GET_CONFIG = false; + static constexpr bool DO_TEST_FS_HANDLER = false; bool doTestGpsShm = false; bool doTestGpsSocket = false; bool doTestProtHandler = false; diff --git a/bsp_q7s/core/InitMission.cpp b/bsp_q7s/core/InitMission.cpp index df36df33..f6b9f9f3 100644 --- a/bsp_q7s/core/InitMission.cpp +++ b/bsp_q7s/core/InitMission.cpp @@ -73,6 +73,7 @@ void initmission::initTasks() { if (result != returnvalue::OK) { initmission::printAddObjectError("CORE_CTRL", objects::CORE_CONTROLLER); } +#if OBSW_ADD_SA_DEPL == 1 // Could add this to the core controller but the core controller does so many thing that I would // prefer to have the solar array deployment in a seprate task. PeriodicTaskIF* solarArrayDeplTask = factory->createPeriodicTask( @@ -81,6 +82,7 @@ void initmission::initTasks() { if (result != returnvalue::OK) { initmission::printAddObjectError("SOLAR_ARRAY_DEPL", objects::SOLAR_ARRAY_DEPL_HANDLER); } +#endif /* TMTC Distribution */ PeriodicTaskIF* tmTcDistributor = factory->createPeriodicTask( @@ -234,10 +236,12 @@ void initmission::initTasks() { initmission::printAddObjectError("THERMAL_CONTROLLER", objects::THERMAL_CONTROLLER); } #endif +#if OBSW_ADD_HEATERS == 1 result = tcsSystemTask->addComponent(objects::HEATER_HANDLER); if (result != returnvalue::OK) { initmission::printAddObjectError("HEATER_HANDLER", objects::HEATER_HANDLER); } +#endif #if OBSW_ADD_STAR_TRACKER == 1 PeriodicTaskIF* strHelperTask = factory->createPeriodicTask( @@ -313,7 +317,9 @@ void initmission::initTasks() { #endif /* OBSW_USE_CCSDS_IP_CORE == 1 */ sysCtrlTask->startTask(); +#if OBSW_ADD_SA_DEPL == 1 solarArrayDeplTask->startTask(); +#endif taskStarter(pstTasks, "PST task vector"); taskStarter(pusTasks, "PUS task vector"); @@ -340,7 +346,9 @@ void initmission::initTasks() { tcsPollingTask->startTask(); tcsTask->startTask(); #endif /* OBSW_ADD_RTD_DEVICES == 1 */ - tcsSystemTask->startTask(); + if (not tcsSystemTask->isEmpty()) { + tcsSystemTask->startTask(); + } #if OBSW_ADD_PLOC_SUPERVISOR == 1 supvHelperTask->startTask(); #endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */ diff --git a/bsp_q7s/em/emObjectFactory.cpp b/bsp_q7s/em/emObjectFactory.cpp index cc314e06..055113e9 100644 --- a/bsp_q7s/em/emObjectFactory.cpp +++ b/bsp_q7s/em/emObjectFactory.cpp @@ -35,6 +35,7 @@ void ObjectFactory::produce(void* args) { gpioCallbacks::disableAllDecoder(gpioComIF); PowerSwitchIF* pwrSwitcher = new DummyPowerSwitcher(objects::PCDU_HANDLER, 18, 0); + static_cast(pwrSwitcher); // Regular FM code, does not work for EM if the hardware is not connected // createPcduComponents(gpioComIF, &pwrSwitcher); diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp index 59f07d1f..6aa6f929 100644 --- a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp @@ -460,20 +460,18 @@ ReturnValue_t pst::pstI2c(FixedTimeslotTaskIF *thisSequence) { ReturnValue_t pst::pstUart(FixedTimeslotTaskIF *thisSequence) { // Length of a communication cycle uint32_t length = thisSequence->getPeriodMs(); - bool uartPstEmpty = true; - + static_cast(length); #if OBSW_ADD_PLOC_MPSOC == 1 - uartPstEmpty = false; thisSequence->addSlot(objects::PLOC_MPSOC_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); thisSequence->addSlot(objects::PLOC_MPSOC_HANDLER, length * 0.2, DeviceHandlerIF::SEND_WRITE); thisSequence->addSlot(objects::PLOC_MPSOC_HANDLER, length * 0.4, DeviceHandlerIF::GET_WRITE); thisSequence->addSlot(objects::PLOC_MPSOC_HANDLER, length * 0.6, DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::PLOC_MPSOC_HANDLER, length * 0.8, DeviceHandlerIF::GET_READ); -#endif - thisSequence->addSlot(objects::PLOC_MEMORY_DUMPER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); +#endif + #if OBSW_ADD_PLOC_SUPERVISOR == 1 thisSequence->addSlot(objects::PLOC_SUPERVISOR_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); @@ -485,7 +483,6 @@ ReturnValue_t pst::pstUart(FixedTimeslotTaskIF *thisSequence) { #endif #if OBSW_ADD_SYRLINKS == 1 - uartPstEmpty = false; thisSequence->addSlot(objects::SYRLINKS_HK_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); thisSequence->addSlot(objects::SYRLINKS_HK_HANDLER, length * 0.2, DeviceHandlerIF::SEND_WRITE); @@ -502,15 +499,7 @@ ReturnValue_t pst::pstUart(FixedTimeslotTaskIF *thisSequence) { thisSequence->addSlot(objects::STAR_TRACKER, length * 0.6, DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::STAR_TRACKER, length * 0.8, DeviceHandlerIF::GET_READ); #endif - static_cast(length); - if (uartPstEmpty) { - return returnvalue::OK; - } - if (thisSequence->checkSequence() != returnvalue::OK) { - sif::error << "UART PST initialization failed" << std::endl; - return returnvalue::FAILED; - } - return returnvalue::OK; + return thisSequence->checkSequence(); } ReturnValue_t pst::pstGompaceCan(FixedTimeslotTaskIF *thisSequence) { diff --git a/mission/devices/ImtqHandler.cpp b/mission/devices/ImtqHandler.cpp index d27b6f65..a0e717f8 100644 --- a/mission/devices/ImtqHandler.cpp +++ b/mission/devices/ImtqHandler.cpp @@ -321,7 +321,8 @@ ReturnValue_t ImtqHandler::scanForReply(const uint8_t* start, size_t remainingSi break; case (IMTQ::CC::PAST_AVAILABLE_RESPONSE_BYTES): { sif::warning << "IMTQHandler::scanForReply: Read 0xFF command byte, reading past available " - "bytes. Keep 1 ms delay between I2C send and read" << std::endl; + "bytes. Keep 1 ms delay between I2C send and read" + << std::endl; result = IGNORE_REPLY_DATA; break; } From 3475e167eef6dfdd83dc1b045c686f092fa50919 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 26 Oct 2022 15:57:07 +0200 Subject: [PATCH 04/10] perform SD card check more often for 2-3 cycles --- bsp_q7s/core/CoreController.cpp | 6 ++++++ bsp_q7s/core/CoreController.h | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/bsp_q7s/core/CoreController.cpp b/bsp_q7s/core/CoreController.cpp index 6b3c08a9..b7da3e20 100644 --- a/bsp_q7s/core/CoreController.cpp +++ b/bsp_q7s/core/CoreController.cpp @@ -82,6 +82,12 @@ void CoreController::performControlOperation() { sdStateMachine(); performMountedSdCardOperations(); if (sdCardCheckCd.hasTimedOut()) { + if (shortSdCardCdCounter < 2) { + shortSdCardCdCounter++; + } + if (shortSdCardCdCounter == 2) { + sdCardCheckCd.setTimeout(DEFAULT_SD_CARD_CHECK_TIMEOUT); + } performSdCardCheck(); sdCardCheckCd.resetTimer(); } diff --git a/bsp_q7s/core/CoreController.h b/bsp_q7s/core/CoreController.h index 460c0f8a..c3c830cc 100644 --- a/bsp_q7s/core/CoreController.h +++ b/bsp_q7s/core/CoreController.h @@ -70,6 +70,9 @@ class CoreController : public ExtendedControllerBase { static constexpr char CHIP_1_COPY_0_MOUNT_DIR[] = "/tmp/mntupdate-xdi-qspi1-nom-rootfs"; static constexpr char CHIP_1_COPY_1_MOUNT_DIR[] = "/tmp/mntupdate-xdi-qspi1-gold-rootfs"; + static constexpr dur_millis_t INIT_SD_CARD_CHECK_TIMEOUT = 5000; + static constexpr dur_millis_t DEFAULT_SD_CARD_CHECK_TIMEOUT = 60000; + static constexpr ActionId_t LIST_DIRECTORY_INTO_FILE = 0; static constexpr ActionId_t SWITCH_REBOOT_FILE_HANDLING = 5; static constexpr ActionId_t RESET_REBOOT_COUNTERS = 6; @@ -210,6 +213,8 @@ class CoreController : public ExtendedControllerBase { RebootFile rebootFile = {}; std::string currMntPrefix; bool performOneShotSdCardOpsSwitch = false; + uint8_t shortSdCardCdCounter = 0; + Countdown sdCardCheckCd = Countdown(INIT_SD_CARD_CHECK_TIMEOUT); /** * Index 0: Chip 0 Copy 0 @@ -229,7 +234,7 @@ class CoreController : public ExtendedControllerBase { ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap, LocalDataPoolManager& poolManager) override; - Countdown sdCardCheckCd = Countdown(120000); + LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override; ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode, uint32_t* msToReachTheMode); void performMountedSdCardOperations(); From d7ff74b6bdc30c92264d3c61043ce90ba41b05d6 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 26 Oct 2022 16:11:34 +0200 Subject: [PATCH 05/10] better configurability for PDEC/PTME usage --- CMakeLists.txt | 9 +++++++++ bsp_hosted/fsfwconfig/OBSWConfig.h.in | 2 +- bsp_linux_board/OBSWConfig.h.in | 2 +- bsp_q7s/OBSWConfig.h.in | 11 +++++------ bsp_q7s/core/InitMission.cpp | 10 +++++----- bsp_q7s/em/emObjectFactory.cpp | 4 ++-- bsp_q7s/fmObjectFactory.cpp | 4 ++-- bsp_te0720_1cfa/InitMission.cpp | 8 ++++---- bsp_te0720_1cfa/OBSWConfig.h.in | 2 +- 9 files changed, 30 insertions(+), 22 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8e0537f5..a0287ef2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -98,6 +98,15 @@ set(OBSW_ADD_ACS_BOARD set(OBSW_ADD_GPS_CTRL ${INIT_VAL} CACHE STRING "Add GPS controllers") +set(OBSW_ADD_CCSDS_IP_CORES + ${INIT_VAL} + CACHE STRING "Add CCSDS IP cores") +set(OBSW_TM_TO_PTME + ${INIT_VAL} + CACHE STRING "Send telemetry to PTME IP core") +set(OBSW_TC_FROM_PDEC + ${INIT_VAL} + CACHE STRING "Poll telecommand from PDEC IP core") set(OBSW_ADD_TCS_CTRL ${INIT_VAL} CACHE STRING "Add TCS controllers") diff --git a/bsp_hosted/fsfwconfig/OBSWConfig.h.in b/bsp_hosted/fsfwconfig/OBSWConfig.h.in index 69029c23..b7de30f0 100644 --- a/bsp_hosted/fsfwconfig/OBSWConfig.h.in +++ b/bsp_hosted/fsfwconfig/OBSWConfig.h.in @@ -16,7 +16,7 @@ debugging. */ #define OBSW_VEBOSE_LEVEL 1 -#define OBSW_USE_CCSDS_IP_CORE 0 +#define OBSW_ADD_CCSDS_IP_CORES 0 // 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 diff --git a/bsp_linux_board/OBSWConfig.h.in b/bsp_linux_board/OBSWConfig.h.in index f17c3d48..04b90ed9 100644 --- a/bsp_linux_board/OBSWConfig.h.in +++ b/bsp_linux_board/OBSWConfig.h.in @@ -103,7 +103,7 @@ /*******************************************************************/ #cmakedefine EIVE_BUILD_GPSD_GPS_HANDLER -#define OBSW_USE_CCSDS_IP_CORE 0 +#define OBSW_ADD_CCSDS_IP_CORES 0 // 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 diff --git a/bsp_q7s/OBSWConfig.h.in b/bsp_q7s/OBSWConfig.h.in index bf113173..76173c1b 100644 --- a/bsp_q7s/OBSWConfig.h.in +++ b/bsp_q7s/OBSWConfig.h.in @@ -14,12 +14,6 @@ /** All of the following flags should be enabled for mission code */ /*******************************************************************/ -#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 -#define OBSW_TC_FROM_PDEC 0 - #define OBSW_ADD_GOMSPACE_PCDU @OBSW_ADD_GOMSPACE_PCDU@ #define OBSW_ADD_MGT @OBSW_ADD_MGT@ #define OBSW_ADD_BPX_BATTERY_HANDLER @OBSW_ADD_BPX_BATTERY_HANDLER@ @@ -41,6 +35,11 @@ #define OBSW_ADD_RAD_SENSORS @OBSW_ADD_RAD_SENSORS@ #define OBSW_ADD_PL_PCDU @OBSW_ADD_PL_PCDU@ #define OBSW_ADD_SYRLINKS @OBSW_ADD_SYRLINKS@ +#define OBSW_ADD_CCSDS_IP_CORES @OBSW_ADD_CCSDS_IP_CORES@ +// Set to 1 if all telemetry should be sent to the PTME IP Core +#define OBSW_TM_TO_PTME @OBSW_TM_TO_PTME@ +// Set to 1 if telecommands are received via the PDEC IP Core +#define OBSW_TC_FROM_PDEC @OBSW_TC_FROM_PDEC@ #define OBSW_ENABLE_SYRLINKS_TRANSMIT_TIMEOUT 0 // Configuration parameter which causes the core controller to try to keep at least one SD card diff --git a/bsp_q7s/core/InitMission.cpp b/bsp_q7s/core/InitMission.cpp index f6b9f9f3..ebbb4432 100644 --- a/bsp_q7s/core/InitMission.cpp +++ b/bsp_q7s/core/InitMission.cpp @@ -119,7 +119,7 @@ void initmission::initTasks() { } #endif -#if OBSW_USE_CCSDS_IP_CORE == 1 +#if OBSW_ADD_CCSDS_IP_CORES == 1 PeriodicTaskIF* ccsdsHandlerTask = factory->createPeriodicTask( "CCSDS_HANDLER", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc); result = ccsdsHandlerTask->addComponent(objects::CCSDS_HANDLER); @@ -136,7 +136,7 @@ void initmission::initTasks() { if (result != returnvalue::OK) { initmission::printAddObjectError("PDEC Handler", objects::PDEC_HANDLER); } -#endif /* OBSW_USE_CCSDS_IP_CORE == 1 */ +#endif /* OBSW_ADD_CCSDS_IP_CORE == 1 */ #if OBSW_ADD_CFDP_COMPONENTS == 1 PeriodicTaskIF* cfdpTask = factory->createPeriodicTask( @@ -311,12 +311,12 @@ void initmission::initTasks() { tmtcPollingTask->startTask(); #endif -#if OBSW_USE_CCSDS_IP_CORE == 1 +#if OBSW_ADD_CCSDS_IP_CORES == 1 ccsdsHandlerTask->startTask(); pdecHandlerTask->startTask(); -#endif /* OBSW_USE_CCSDS_IP_CORE == 1 */ +#endif /* OBSW_ADD_CCSDS_IP_CORES == 1 */ - sysCtrlTask->startTask(); + // sysCtrlTask->startTask(); #if OBSW_ADD_SA_DEPL == 1 solarArrayDeplTask->startTask(); #endif diff --git a/bsp_q7s/em/emObjectFactory.cpp b/bsp_q7s/em/emObjectFactory.cpp index 055113e9..5361eacb 100644 --- a/bsp_q7s/em/emObjectFactory.cpp +++ b/bsp_q7s/em/emObjectFactory.cpp @@ -68,9 +68,9 @@ void ObjectFactory::produce(void* args) { #if OBSW_ADD_STAR_TRACKER == 1 createStrComponents(pwrSwitcher); #endif /* OBSW_ADD_STAR_TRACKER == 1 */ -#if OBSW_USE_CCSDS_IP_CORE == 1 +#if OBSW_ADD_CCSDS_IP_CORES == 1 createCcsdsComponents(gpioComIF); -#endif /* OBSW_USE_CCSDS_IP_CORE == 1 */ +#endif /* OBSW_ADD_CCSDS_IP_CORES == 1 */ /* Test Task */ #if OBSW_ADD_TEST_CODE == 1 createTestComponents(gpioComIF); diff --git a/bsp_q7s/fmObjectFactory.cpp b/bsp_q7s/fmObjectFactory.cpp index d28b7248..f38621f7 100644 --- a/bsp_q7s/fmObjectFactory.cpp +++ b/bsp_q7s/fmObjectFactory.cpp @@ -55,9 +55,9 @@ void ObjectFactory::produce(void* args) { #if OBSW_ADD_STAR_TRACKER == 1 createStrComponents(pwrSwitcher); #endif /* OBSW_ADD_STAR_TRACKER == 1 */ -#if OBSW_USE_CCSDS_IP_CORE == 1 +#if OBSW_ADD_CCSDS_IP_CORES == 1 createCcsdsComponents(gpioComIF); -#endif /* OBSW_USE_CCSDS_IP_CORE == 1 */ +#endif /* OBSW_ADD_CCSDS_IP_CORES == 1 */ #if OBSW_ADD_SCEX_DEVICE == 1 createScexComponents(q7s::UART_SCEX_DEV, pwrSwitcher, *SdCardManager::instance(), false, diff --git a/bsp_te0720_1cfa/InitMission.cpp b/bsp_te0720_1cfa/InitMission.cpp index b7c6b683..d303d41b 100644 --- a/bsp_te0720_1cfa/InitMission.cpp +++ b/bsp_te0720_1cfa/InitMission.cpp @@ -107,7 +107,7 @@ void initmission::initTasks() { } #endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */ -#if OBSW_USE_CCSDS_IP_CORE == 1 +#if OBSW_ADD_CCSDS_IP_CORE == 1 PeriodicTaskIF* ccsdsHandlerTask = factory->createPeriodicTask( "CCSDS_HANDLER", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc); result = ccsdsHandlerTask->addComponent(objects::CCSDS_HANDLER); @@ -124,7 +124,7 @@ void initmission::initTasks() { if (result != returnvalue::OK) { initmission::printAddObjectError("PDEC Handler", objects::PDEC_HANDLER); } -#endif /* OBSW_USE_CCSDS_IP_CORE == 1 */ +#endif /* OBSW_ADD_CCSDS_IP_CORE == 1 */ auto taskStarter = [](std::vector& taskVector, std::string name) { for (const auto& task : taskVector) { @@ -140,10 +140,10 @@ void initmission::initTasks() { tmtcDistributor->startTask(); tmtcBridgeTask->startTask(); tmtcPollingTask->startTask(); -#if OBSW_USE_CCSDS_IP_CORE == 1 +#if OBSW_ADD_CCSDS_IP_CORE == 1 pdecHandlerTask->startTask(); ccsdsHandlerTask->startTask(); -#endif /* #if OBSW_USE_CCSDS_IP_CORE == 1 */ +#endif /* #if OBSW_ADD_CCSDS_IP_CORE == 1 */ #if OBSW_ADD_PLOC_SUPERVISOR == 1 supvHelperTask->startTask(); #endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */ diff --git a/bsp_te0720_1cfa/OBSWConfig.h.in b/bsp_te0720_1cfa/OBSWConfig.h.in index 2f887daa..d2efda38 100644 --- a/bsp_te0720_1cfa/OBSWConfig.h.in +++ b/bsp_te0720_1cfa/OBSWConfig.h.in @@ -13,7 +13,7 @@ /** All of the following flags should be enabled for mission code */ /*******************************************************************/ -#define OBSW_USE_CCSDS_IP_CORE 0 +#define OBSW_ADD_CCSDS_IP_CORE 0 // 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 From 5173a0c9cbfa062da0ba2368e84d0fe8e65066ab Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 26 Oct 2022 17:11:57 +0200 Subject: [PATCH 06/10] its the rad sensor --- bsp_q7s/callbacks/rwSpiCallback.cpp | 28 ++++++++++++------------ bsp_q7s/core/ObjectFactory.cpp | 12 +++++----- bsp_q7s/core/ObjectFactory.h | 2 +- bsp_q7s/em/emObjectFactory.cpp | 10 +++++++-- bsp_q7s/fmObjectFactory.cpp | 8 ++++--- fsfw | 2 +- mission/devices/GyroADIS1650XHandler.cpp | 8 +++---- mission/devices/PayloadPcduHandler.cpp | 12 +++++----- 8 files changed, 46 insertions(+), 36 deletions(-) diff --git a/bsp_q7s/callbacks/rwSpiCallback.cpp b/bsp_q7s/callbacks/rwSpiCallback.cpp index ae23d64d..74ede602 100644 --- a/bsp_q7s/callbacks/rwSpiCallback.cpp +++ b/bsp_q7s/callbacks/rwSpiCallback.cpp @@ -41,19 +41,19 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen uint8_t writeSize = 0; gpioId_t gpioId = cookie->getChipSelectPin(); - GpioIF* gpioIF = comIf->getGpioInterface(); + GpioIF& gpioIF = comIf->getGpioInterface(); MutexIF::TimeoutType timeoutType = MutexIF::TimeoutType::WAITING; uint32_t timeoutMs = 0; MutexIF* mutex = comIf->getCsMutex(); cookie->getMutexParams(timeoutType, timeoutMs); - if (mutex == nullptr or gpioIF == nullptr) { + if (mutex == nullptr) { sif::debug << "rwSpiCallback::spiCallback: Mutex or GPIO interface invalid" << std::endl; return returnvalue::FAILED; } int fileDescriptor = 0; const std::string& dev = comIf->getSpiDev(); - result = openSpi(dev, O_RDWR, gpioIF, gpioId, mutex, timeoutType, timeoutMs, fileDescriptor); + result = openSpi(dev, O_RDWR, &gpioIF, gpioId, mutex, timeoutType, timeoutMs, fileDescriptor); if (result != returnvalue::OK) { return result; } @@ -75,7 +75,7 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen if (write(fileDescriptor, writeBuffer, writeSize) != static_cast(writeSize)) { sif::error << "rwSpiCallback::spiCallback: Write failed!" << std::endl; - closeSpi(fileDescriptor, gpioId, gpioIF, mutex); + closeSpi(fileDescriptor, gpioId, &gpioIF, mutex); return RwHandler::SPI_WRITE_FAILURE; } @@ -100,7 +100,7 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen } if (write(fileDescriptor, writeBuffer, writeSize) != static_cast(writeSize)) { sif::error << "rwSpiCallback::spiCallback: Write failed!" << std::endl; - closeSpi(fileDescriptor, gpioId, gpioIF, mutex); + closeSpi(fileDescriptor, gpioId, &gpioIF, mutex); return RwHandler::SPI_WRITE_FAILURE; } idx++; @@ -112,14 +112,14 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen if (write(fileDescriptor, writeBuffer, writeSize) != static_cast(writeSize)) { sif::error << "rwSpiCallback::spiCallback: Write failed!" << std::endl; - closeSpi(fileDescriptor, gpioId, gpioIF, mutex); + closeSpi(fileDescriptor, gpioId, &gpioIF, mutex); return RwHandler::SPI_WRITE_FAILURE; } uint8_t* rxBuf = nullptr; result = comIf->getReadBuffer(cookie->getSpiAddress(), &rxBuf); if (result != returnvalue::OK) { - closeSpi(fileDescriptor, gpioId, gpioIF, mutex); + closeSpi(fileDescriptor, gpioId, &gpioIF, mutex); return result; } @@ -127,9 +127,9 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen // There must be a delay of at least 20 ms after sending the command. // Delay for 70 ms here and release the SPI bus for that duration. - closeSpi(fileDescriptor, gpioId, gpioIF, mutex); + closeSpi(fileDescriptor, gpioId, &gpioIF, mutex); usleep(RwDefinitions::SPI_REPLY_DELAY); - result = openSpi(dev, O_RDWR, gpioIF, gpioId, mutex, timeoutType, timeoutMs, fileDescriptor); + result = openSpi(dev, O_RDWR, &gpioIF, gpioId, mutex, timeoutType, timeoutMs, fileDescriptor); if (result != returnvalue::OK) { return result; } @@ -142,13 +142,13 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen for (int idx = 0; idx < 10; idx++) { if (read(fileDescriptor, &byteRead, 1) != 1) { sif::error << "rwSpiCallback::spiCallback: Read failed" << std::endl; - closeSpi(fileDescriptor, gpioId, gpioIF, mutex); + closeSpi(fileDescriptor, gpioId, &gpioIF, mutex); return RwHandler::SPI_READ_FAILURE; } if (idx == 0) { if (byteRead != FLAG_BYTE) { sif::error << "Invalid data, expected start marker" << std::endl; - closeSpi(fileDescriptor, gpioId, gpioIF, mutex); + closeSpi(fileDescriptor, gpioId, &gpioIF, mutex); return RwHandler::NO_START_MARKER; } } @@ -159,7 +159,7 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen if (idx == 9) { sif::error << "rwSpiCallback::spiCallback: Empty frame timeout" << std::endl; - closeSpi(fileDescriptor, gpioId, gpioIF, mutex); + closeSpi(fileDescriptor, gpioId, &gpioIF, mutex); return RwHandler::NO_REPLY; } } @@ -199,7 +199,7 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen continue; } else { sif::error << "rwSpiCallback::spiCallback: Invalid substitute" << std::endl; - closeSpi(fileDescriptor, gpioId, gpioIF, mutex); + closeSpi(fileDescriptor, gpioId, &gpioIF, mutex); result = RwHandler::INVALID_SUBSTITUTE; break; } @@ -233,7 +233,7 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen cookie->setTransferSize(decodedFrameLen); - closeSpi(fileDescriptor, gpioId, gpioIF, mutex); + closeSpi(fileDescriptor, gpioId, &gpioIF, mutex); return result; } diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 36a9d590..07f3fe9c 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -145,10 +145,8 @@ void ObjectFactory::createCommunicationInterfaces(LinuxLibgpioIF** gpioComIF, Ua new CspComIF(objects::CSP_COM_IF); *i2cComIF = new I2cComIF(objects::I2C_COM_IF); *uartComIF = new UartComIF(objects::UART_COM_IF); - *spiMainComIF = new SpiComIF(objects::SPI_MAIN_COM_IF, q7s::SPI_DEFAULT_DEV, *gpioComIF); - *spiRWComIF = new SpiComIF(objects::SPI_RW_COM_IF, q7s::SPI_RW_DEV, *gpioComIF); - /* Adding gpios for chip select decoding to the gpioComIf */ - q7s::gpioCallbacks::initSpiCsDecoder(*gpioComIF); + *spiMainComIF = new SpiComIF(objects::SPI_MAIN_COM_IF, q7s::SPI_DEFAULT_DEV, **gpioComIF); + *spiRWComIF = new SpiComIF(objects::SPI_RW_COM_IF, q7s::SPI_RW_DEV, **gpioComIF); } void ObjectFactory::createPcduComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchIF** pwrSwitcher) { @@ -193,8 +191,11 @@ void ObjectFactory::createPcduComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchI #endif } -void ObjectFactory::createRadSensorComponent(LinuxLibgpioIF* gpioComIF) { +ReturnValue_t ObjectFactory::createRadSensorComponent(LinuxLibgpioIF* gpioComIF) { using namespace gpio; + if(gpioComIF == nullptr) { + return returnvalue::FAILED; + } GpioCookie* gpioCookieRadSensor = new GpioCookie; std::stringstream consumer; consumer << "0x" << std::hex << objects::RAD_SENSOR; @@ -220,6 +221,7 @@ void ObjectFactory::createRadSensorComponent(LinuxLibgpioIF* gpioComIF) { #if OBSW_DEBUG_RAD_SENSOR == 1 radSensor->enablePeriodicDataPrint(true); #endif + return returnvalue::OK; } void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComIF* uartComIF, diff --git a/bsp_q7s/core/ObjectFactory.h b/bsp_q7s/core/ObjectFactory.h index 88881090..76660f30 100644 --- a/bsp_q7s/core/ObjectFactory.h +++ b/bsp_q7s/core/ObjectFactory.h @@ -26,7 +26,7 @@ void createPcduComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchIF** pwrSwitcher void createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF, PowerSwitchIF* pwrSwitcher); void createTmpComponents(); -void createRadSensorComponent(LinuxLibgpioIF* gpioComIF); +ReturnValue_t createRadSensorComponent(LinuxLibgpioIF* gpioComIF); void createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComIF* uartComIF, PowerSwitchIF* pwrSwitcher); void createHeaterComponents(GpioIF* gpioIF, PowerSwitchIF* pwrSwitcher, HealthTableIF* healthTable); diff --git a/bsp_q7s/em/emObjectFactory.cpp b/bsp_q7s/em/emObjectFactory.cpp index 5361eacb..4fd6df50 100644 --- a/bsp_q7s/em/emObjectFactory.cpp +++ b/bsp_q7s/em/emObjectFactory.cpp @@ -1,3 +1,4 @@ +#include #include #include @@ -24,6 +25,9 @@ void ObjectFactory::produce(void* args) { I2cComIF* i2cComIF = nullptr; SpiComIF* spiRwComIF = nullptr; createCommunicationInterfaces(&gpioComIF, &uartComIF, &spiMainComIF, &i2cComIF, &spiRwComIF); + /* Adding gpios for chip select decoding to the gpioComIf */ + q7s::gpioCallbacks::initSpiCsDecoder(gpioComIF); + gpioCallbacks::disableAllDecoder(gpioComIF); // Hardware is usually not connected to EM, so we need to create dummies which replace lower // level components. @@ -33,7 +37,6 @@ void ObjectFactory::produce(void* args) { new CoreController(objects::CORE_CONTROLLER); - gpioCallbacks::disableAllDecoder(gpioComIF); PowerSwitchIF* pwrSwitcher = new DummyPowerSwitcher(objects::PCDU_HANDLER, 18, 0); static_cast(pwrSwitcher); @@ -47,7 +50,10 @@ void ObjectFactory::produce(void* args) { // createSolarArrayDeploymentComponents(); // createPayloadComponents(gpioComIF); // createHeaterComponents(gpioComIF, pwrSwitcher, healthTable); - createRadSensorComponent(gpioComIF); + + // TODO: Careful! Swichting this on somehow messes with the communication with the ProASIC + // and will cause xsc_boot_copy commands to always boot to 0 0 + // createRadSensorComponent(gpioComIF); #if OBSW_ADD_ACS_BOARD == 1 createAcsBoardComponents(gpioComIF, uartComIF, pwrSwitcher); diff --git a/bsp_q7s/fmObjectFactory.cpp b/bsp_q7s/fmObjectFactory.cpp index f38621f7..885f0def 100644 --- a/bsp_q7s/fmObjectFactory.cpp +++ b/bsp_q7s/fmObjectFactory.cpp @@ -1,3 +1,4 @@ +#include #include #include "OBSWConfig.h" @@ -23,10 +24,11 @@ void ObjectFactory::produce(void* args) { PowerSwitchIF* pwrSwitcher = nullptr; SpiComIF* spiRwComIF = nullptr; createCommunicationInterfaces(&gpioComIF, &uartComIF, &spiMainComIF, &i2cComIF, &spiRwComIF); - createTmpComponents(); - new CoreController(objects::CORE_CONTROLLER); - + /* Adding gpios for chip select decoding to the gpioComIf */ + q7s::gpioCallbacks::initSpiCsDecoder(gpioComIF); gpioCallbacks::disableAllDecoder(gpioComIF); + + new CoreController(objects::CORE_CONTROLLER); createPcduComponents(gpioComIF, &pwrSwitcher); createRadSensorComponent(gpioComIF); createSunSensorComponents(gpioComIF, spiMainComIF, pwrSwitcher, q7s::SPI_DEFAULT_DEV); diff --git a/fsfw b/fsfw index 1f05e6b2..60ff4117 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 1f05e6b297af8a6d310394e959c4d0cf13632831 +Subproject commit 60ff411721909bd6e4c34523a2248d8dca2507b1 diff --git a/mission/devices/GyroADIS1650XHandler.cpp b/mission/devices/GyroADIS1650XHandler.cpp index 5ff84a96..fe8d07c6 100644 --- a/mission/devices/GyroADIS1650XHandler.cpp +++ b/mission/devices/GyroADIS1650XHandler.cpp @@ -422,12 +422,12 @@ ReturnValue_t GyroADIS1650XHandler::spiSendCallback(SpiComIF *comIf, SpiCookie * cookie->setTransferSize(2); gpioId_t gpioId = cookie->getChipSelectPin(); - GpioIF *gpioIF = comIf->getGpioInterface(); + GpioIF& gpioIF = comIf->getGpioInterface(); MutexIF::TimeoutType timeoutType = MutexIF::TimeoutType::WAITING; uint32_t timeoutMs = 0; MutexIF *mutex = comIf->getCsMutex(); cookie->getMutexParams(timeoutType, timeoutMs); - if (mutex == nullptr or gpioIF == nullptr) { + if (mutex == nullptr) { #if OBSW_VERBOSE_LEVEL >= 1 sif::warning << "GyroADIS16507Handler::spiSendCallback: " "Mutex or GPIO interface invalid" @@ -453,7 +453,7 @@ ReturnValue_t GyroADIS1650XHandler::spiSendCallback(SpiComIF *comIf, SpiCookie * while (idx < sendLen) { // Pull SPI CS low. For now, no support for active high given if (gpioId != gpio::NO_GPIO) { - gpioIF->pullLow(gpioId); + gpioIF.pullLow(gpioId); } // Execute transfer @@ -468,7 +468,7 @@ ReturnValue_t GyroADIS1650XHandler::spiSendCallback(SpiComIF *comIf, SpiCookie * #endif /* FSFW_LINUX_SPI_WIRETAPPING == 1 */ if (gpioId != gpio::NO_GPIO) { - gpioIF->pullHigh(gpioId); + gpioIF.pullHigh(gpioId); } idx += 2; diff --git a/mission/devices/PayloadPcduHandler.cpp b/mission/devices/PayloadPcduHandler.cpp index d9e41c7f..725e05df 100644 --- a/mission/devices/PayloadPcduHandler.cpp +++ b/mission/devices/PayloadPcduHandler.cpp @@ -719,11 +719,11 @@ ReturnValue_t PayloadPcduHandler::transferAsTwo(SpiComIF* comIf, SpiCookie* cook cookie->setTransferSize(transferLen); gpioId_t gpioId = cookie->getChipSelectPin(); - GpioIF* gpioIF = comIf->getGpioInterface(); + GpioIF& gpioIF = comIf->getGpioInterface(); MutexIF::TimeoutType timeoutType = MutexIF::TimeoutType::WAITING; uint32_t timeoutMs = 0; MutexIF* mutex = comIf->getCsMutex(); - if (mutex == nullptr or gpioIF == nullptr) { + if (mutex == nullptr) { #if OBSW_VERBOSE_LEVEL >= 1 sif::warning << "GyroADIS16507Handler::spiSendCallback: " "Mutex or GPIO interface invalid" @@ -753,7 +753,7 @@ ReturnValue_t PayloadPcduHandler::transferAsTwo(SpiComIF* comIf, SpiCookie* cook transferStruct->len = transferLen; // Pull SPI CS low. For now, no support for active high given if (gpioId != gpio::NO_GPIO) { - gpioIF->pullLow(gpioId); + gpioIF.pullLow(gpioId); } // Execute transfer @@ -768,14 +768,14 @@ ReturnValue_t PayloadPcduHandler::transferAsTwo(SpiComIF* comIf, SpiCookie* cook #endif /* FSFW_LINUX_SPI_WIRETAPPING == 1 */ if (gpioId != gpio::NO_GPIO) { - gpioIF->pullHigh(gpioId); + gpioIF.pullHigh(gpioId); } transferStruct->tx_buf += transferLen; transferStruct->rx_buf += transferLen; transferStruct->len = plpcdu::TEMP_REPLY_SIZE - 1; if (gpioId != gpio::NO_GPIO) { - gpioIF->pullLow(gpioId); + gpioIF.pullLow(gpioId); } // Execute transfer @@ -790,7 +790,7 @@ ReturnValue_t PayloadPcduHandler::transferAsTwo(SpiComIF* comIf, SpiCookie* cook #endif /* FSFW_LINUX_SPI_WIRETAPPING == 1 */ if (gpioId != gpio::NO_GPIO) { - gpioIF->pullHigh(gpioId); + gpioIF.pullHigh(gpioId); } transferStruct->tx_buf = origTx; From 451581e1aad98eb7ade70e32bb8c028baaf20437 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 26 Oct 2022 17:18:23 +0200 Subject: [PATCH 07/10] enable IP core components for both EM and FM --- CMakeLists.txt | 6 +++--- bsp_q7s/em/emObjectFactory.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a0287ef2..1d283085 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -99,13 +99,13 @@ set(OBSW_ADD_GPS_CTRL ${INIT_VAL} CACHE STRING "Add GPS controllers") set(OBSW_ADD_CCSDS_IP_CORES - ${INIT_VAL} + 1 CACHE STRING "Add CCSDS IP cores") set(OBSW_TM_TO_PTME - ${INIT_VAL} + 1 CACHE STRING "Send telemetry to PTME IP core") set(OBSW_TC_FROM_PDEC - ${INIT_VAL} + 1 CACHE STRING "Poll telecommand from PDEC IP core") set(OBSW_ADD_TCS_CTRL ${INIT_VAL} diff --git a/bsp_q7s/em/emObjectFactory.cpp b/bsp_q7s/em/emObjectFactory.cpp index 4fd6df50..13ae55d6 100644 --- a/bsp_q7s/em/emObjectFactory.cpp +++ b/bsp_q7s/em/emObjectFactory.cpp @@ -51,7 +51,7 @@ void ObjectFactory::produce(void* args) { // createPayloadComponents(gpioComIF); // createHeaterComponents(gpioComIF, pwrSwitcher, healthTable); - // TODO: Careful! Swichting this on somehow messes with the communication with the ProASIC + // TODO: Careful! Switching this on somehow messes with the communication with the ProASIC // and will cause xsc_boot_copy commands to always boot to 0 0 // createRadSensorComponent(gpioComIF); From e86831fb4008c459c86175dcd937abc5e40e1cf2 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 26 Oct 2022 17:21:35 +0200 Subject: [PATCH 08/10] initialize value --- mission/devices/SolarArrayDeploymentHandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mission/devices/SolarArrayDeploymentHandler.cpp b/mission/devices/SolarArrayDeploymentHandler.cpp index 6a29ecd5..5656692d 100644 --- a/mission/devices/SolarArrayDeploymentHandler.cpp +++ b/mission/devices/SolarArrayDeploymentHandler.cpp @@ -151,7 +151,7 @@ bool SolarArrayDeploymentHandler::autonomousDeplForFile(sd::SdCard sdCard, const string line; string word; unsigned int lineNum = 0; - AutonomousDeplState deplState; + AutonomousDeplState deplState = AutonomousDeplState::INIT; bool stateSwitch = false; uint32_t secsSinceBoot = 0; while (std::getline(file, line)) { From 2256ffecbe2020ef4e8e1c06eea390608fd721b1 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 26 Oct 2022 18:32:53 +0200 Subject: [PATCH 09/10] scex speed is now set from cfg --- common/config/devConf.h | 2 +- fsfw | 2 +- linux/devices/ScexUartReader.cpp | 5 +---- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/common/config/devConf.h b/common/config/devConf.h index 68a3e199..88e78e1e 100644 --- a/common/config/devConf.h +++ b/common/config/devConf.h @@ -55,7 +55,7 @@ namespace uart { static constexpr size_t HYPERION_GPS_REPLY_MAX_BUFFER = 1024; static constexpr UartBaudRate SYRLINKS_BAUD = UartBaudRate::RATE_38400; -static constexpr UartBaudRate SCEX_BAUD = UartBaudRate::RATE_57600; +static constexpr UartBaudRate SCEX_BAUD = UartBaudRate::RATE_38400; static constexpr UartBaudRate GNSS_BAUD = UartBaudRate::RATE_9600; static constexpr UartBaudRate PLOC_MPSOC_BAUD = UartBaudRate::RATE_115200; static constexpr UartBaudRate PLOC_SUPV_BAUD = UartBaudRate::RATE_115200; diff --git a/fsfw b/fsfw index 60ff4117..1b7e94d7 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 60ff411721909bd6e4c34523a2248d8dca2507b1 +Subproject commit 1b7e94d718ba8f526dd53324d33d0e577cbfc81b diff --git a/linux/devices/ScexUartReader.cpp b/linux/devices/ScexUartReader.cpp index 24461395..d128fa63 100644 --- a/linux/devices/ScexUartReader.cpp +++ b/linux/devices/ScexUartReader.cpp @@ -118,10 +118,7 @@ ReturnValue_t ScexUartReader::initializeInterface(CookieIF *cookie) { tty.c_cc[VTIME] = 0; tty.c_cc[VMIN] = 0; - // The SCEX experiment has a fixed baud rate. - if (cfsetispeed(&tty, B38400) != 0) { - sif::warning << "ScexUartReader::initializeInterface: Setting baud rate failed" << std::endl; - } + uart::setBaudrate(tty, uartCookie->getBaudrate()); if (tcsetattr(serialPort, TCSANOW, &tty) != 0) { sif::warning << "ScexUartReader::initializeInterface: tcsetattr call failed with error [" << errno << ", " << strerror(errno) << std::endl; From e200e2d0dff18d258178d4fbad0c2f5c3bb39756 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 27 Oct 2022 08:28:43 +0200 Subject: [PATCH 10/10] remove boolean which does not exist anymore --- linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp index 6aa6f929..f0a1c2fb 100644 --- a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp @@ -492,7 +492,6 @@ ReturnValue_t pst::pstUart(FixedTimeslotTaskIF *thisSequence) { #endif #if OBSW_ADD_STAR_TRACKER == 1 - uartPstEmpty = false; thisSequence->addSlot(objects::STAR_TRACKER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); thisSequence->addSlot(objects::STAR_TRACKER, length * 0.2, DeviceHandlerIF::SEND_WRITE); thisSequence->addSlot(objects::STAR_TRACKER, length * 0.4, DeviceHandlerIF::GET_WRITE);