From cec9ef6c5d90ea50a70daac85aba005e9492f498 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 13 Feb 2023 14:19:07 +0100 Subject: [PATCH 1/5] some fixes --- CHANGELOG.md | 7 +++++++ fsfw | 2 +- linux/devices/Max31865RtdLowlevelHandler.cpp | 8 ++++---- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 431606a0..58d85ccd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,13 @@ change warranting a new major release: # [unreleased] +# [v1.27.1] 2023-02-13 + +## Fixed + +- Fix for SPI ComIF: Set transfer size to 0 for failed transfers +- Fix shadowing issue with locks in MAX31865 low level handler + # [v1.27.0] 2023-02-13 eive-tmtc: v2.12.5 diff --git a/fsfw b/fsfw index dac2d210..f0b8457b 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit dac2d210b597adfaf45bd5ae6a4c027599927601 +Subproject commit f0b8457ba2d9a34a42b10314c3cdccfd46ebf168 diff --git a/linux/devices/Max31865RtdLowlevelHandler.cpp b/linux/devices/Max31865RtdLowlevelHandler.cpp index a6fe2061..52a107dc 100644 --- a/linux/devices/Max31865RtdLowlevelHandler.cpp +++ b/linux/devices/Max31865RtdLowlevelHandler.cpp @@ -70,8 +70,8 @@ bool Max31865RtdReader::periodicInitHandling() { return false; } if ((rtd->on or rtd->db.active) and not rtd->db.configured and rtd->cd.hasTimedOut()) { - ManualCsLockWrapper mg(csLock, gpioIF, rtd->spiCookie, csTimeoutType, csTimeoutMs); - if (mg.lockResult != returnvalue::OK or mg.gpioResult != returnvalue::OK) { + ManualCsLockWrapper mg1(csLock, gpioIF, rtd->spiCookie, csTimeoutType, csTimeoutMs); + if (mg1.lockResult != returnvalue::OK or mg1.gpioResult != returnvalue::OK) { sif::error << "Max31865RtdReader::periodicInitHandling: Manual CS lock failed" << std::endl; continue; } @@ -153,8 +153,8 @@ ReturnValue_t Max31865RtdReader::periodicReadHandling() { return returnvalue::FAILED; } if (rtdIsActive(rtd->idx)) { - ManualCsLockWrapper mg(csLock, gpioIF, rtd->spiCookie, csTimeoutType, csTimeoutMs); - if (mg.lockResult != returnvalue::OK or mg.gpioResult != returnvalue::OK) { + ManualCsLockWrapper mg1(csLock, gpioIF, rtd->spiCookie, csTimeoutType, csTimeoutMs); + if (mg1.lockResult != returnvalue::OK or mg1.gpioResult != returnvalue::OK) { sif::error << "Max31865RtdReader::periodicInitHandling: Manual CS lock failed" << std::endl; continue; } From 323140c846c0707612fca3c7560ae59c9bd6512c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 13 Feb 2023 14:19:24 +0100 Subject: [PATCH 2/5] bump revision --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8af127a1..782993be 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,7 @@ cmake_minimum_required(VERSION 3.13) set(OBSW_VERSION_MAJOR 1) set(OBSW_VERSION_MINOR 27) -set(OBSW_VERSION_REVISION 0) +set(OBSW_VERSION_REVISION 1) # set(CMAKE_VERBOSE TRUE) From b4d9ea6c1936cf99cce9ab96dba8220a33725442 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 13 Feb 2023 15:37:42 +0100 Subject: [PATCH 3/5] lets see if this fixes issues --- bsp_q7s/core/scheduling.cpp | 18 +++--------------- .../pollingsequence/pollingSequenceFactory.cpp | 3 ++- .../pollingsequence/pollingSequenceFactory.h | 2 +- 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/bsp_q7s/core/scheduling.cpp b/bsp_q7s/core/scheduling.cpp index cc3108e8..32d64829 100644 --- a/bsp_q7s/core/scheduling.cpp +++ b/bsp_q7s/core/scheduling.cpp @@ -214,21 +214,9 @@ void scheduling::initTasks() { } #endif -#if OBSW_ADD_RTD_DEVICES == 1 - PeriodicTaskIF* tcsPollingTask = factory->createPeriodicTask( - "TCS_POLLING_TASK", 75, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.5, missedDeadlineFunc); - result = tcsPollingTask->addComponent(objects::SPI_RTD_COM_IF); - if (result != returnvalue::OK) { - scheduling::printAddObjectError("SPI_RTD_POLLING", objects::SPI_RTD_COM_IF); - } - - PeriodicTaskIF* tcsTask = factory->createPeriodicTask( - "TCS_TASK", 55, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.8, missedDeadlineFunc); - scheduling::scheduleRtdSensors(tcsTask); -#endif - PeriodicTaskIF* tcsSystemTask = factory->createPeriodicTask( - "TCS_TASK", 45, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.5, missedDeadlineFunc); + "TCS_TASK", 55, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.5, missedDeadlineFunc); + scheduling::scheduleRtdSensors(tcsSystemTask); result = tcsSystemTask->addComponent(objects::TCS_SUBSYSTEM); if (result != returnvalue::OK) { scheduling::printAddObjectError("TCS_SUBSYSTEM", objects::TCS_SUBSYSTEM); @@ -394,7 +382,7 @@ void scheduling::createPstTasks(TaskFactory& factory, TaskDeadlineMissedFunction #endif FixedTimeslotTaskIF* acsPst = factory.createFixedTimeslotTask( "ACS_PST", 85, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, acsPstPeriod, missedDeadlineFunc); - result = pst::pstAcs(acsPst, cfg); + result = pst::pstTcsAndAcs(acsPst, cfg); if (result != returnvalue::OK) { if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) { sif::warning << "scheduling::initTasks: ACS PST is empty" << std::endl; diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp index f9b69e45..63b40df2 100644 --- a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp @@ -184,7 +184,7 @@ ReturnValue_t pst::pstTest(FixedTimeslotTaskIF *thisSequence) { return returnvalue::OK; } -ReturnValue_t pst::pstAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg) { +ReturnValue_t pst::pstTcsAndAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg) { /* Length of a communication cycle */ uint32_t length = thisSequence->getPeriodMs(); bool enableAside = true; @@ -684,5 +684,6 @@ ReturnValue_t pst::pstAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg) { thisSequence->addSlot(objects::RW4, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_READ); } + thisSequence->addSlot(objects::SPI_RTD_COM_IF, length * 0.5, 0); return returnvalue::OK; } diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.h b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.h index 3e5ead52..99fba4ad 100644 --- a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.h +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.h @@ -49,7 +49,7 @@ ReturnValue_t pstGompaceCan(FixedTimeslotTaskIF* thisSequence); ReturnValue_t pstSpiAndSyrlinks(FixedTimeslotTaskIF* thisSequence); -ReturnValue_t pstAcs(FixedTimeslotTaskIF* thisSequence, AcsPstCfg cfg); +ReturnValue_t pstTcsAndAcs(FixedTimeslotTaskIF* thisSequence, AcsPstCfg cfg); ReturnValue_t pstI2c(FixedTimeslotTaskIF* thisSequence); From ebc32d1cc2ebb8a9332cf85f3eddcff3d5e30aea Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 13 Feb 2023 15:42:45 +0100 Subject: [PATCH 4/5] changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 58d85ccd..f94066d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,11 @@ change warranting a new major release: # [unreleased] +## Changed + +- Remove 2 TCS threads. +- Move low level polling into ACS PST, move high level device handlers into TCS system task. + # [v1.27.1] 2023-02-13 ## Fixed From efbb5d69c7c60b5785671cfa132e31ae9607d42e Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 13 Feb 2023 15:44:19 +0100 Subject: [PATCH 5/5] remove removed task start --- bsp_q7s/core/scheduling.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/bsp_q7s/core/scheduling.cpp b/bsp_q7s/core/scheduling.cpp index 32d64829..2aad7a23 100644 --- a/bsp_q7s/core/scheduling.cpp +++ b/bsp_q7s/core/scheduling.cpp @@ -352,10 +352,6 @@ void scheduling::initTasks() { gpsTask->startTask(); #endif acsSysTask->startTask(); -#if OBSW_ADD_RTD_DEVICES == 1 - tcsPollingTask->startTask(); - tcsTask->startTask(); -#endif /* OBSW_ADD_RTD_DEVICES == 1 */ if (not tcsSystemTask->isEmpty()) { tcsSystemTask->startTask(); }