From 847aadc7bfaecf8b7489d3cd291465149dd70a97 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 19 May 2022 14:48:16 +0200 Subject: [PATCH 1/6] update shell script helper to support EM installation --- scripts/install-obsw-yocto.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/install-obsw-yocto.sh b/scripts/install-obsw-yocto.sh index 1dd02016..c27b67aa 100755 --- a/scripts/install-obsw-yocto.sh +++ b/scripts/install-obsw-yocto.sh @@ -1,9 +1,16 @@ #!/bin/bash # 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 +if [ !-z ${1} ]; then + if [ ${1} == "em" ]; then + echo "-I- Installing EM binaries" + build_dir=cmake-build-release-q7s-em + fi +fi init_dir=$(pwd) -build_dir=cmake-build-release-q7s + obsw_root="" q7s_yocto_dir="q7s-yocto" q7s_package_path="q7s-package/${q7s_yocto_dir}" From 377f762ca5d1164672e706ac42fb1505f8687c2b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 19 May 2022 14:54:44 +0200 Subject: [PATCH 2/6] fixed for new SPI HAL API --- bsp_q7s/callbacks/rwSpiCallback.cpp | 3 ++- fsfw | 2 +- mission/devices/GyroADIS1650XHandler.cpp | 3 ++- mission/devices/PayloadPcduHandler.cpp | 3 ++- tmtc | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/bsp_q7s/callbacks/rwSpiCallback.cpp b/bsp_q7s/callbacks/rwSpiCallback.cpp index b65224e5..0d845fb8 100644 --- a/bsp_q7s/callbacks/rwSpiCallback.cpp +++ b/bsp_q7s/callbacks/rwSpiCallback.cpp @@ -44,7 +44,8 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen GpioIF* gpioIF = comIf->getGpioInterface(); MutexIF::TimeoutType timeoutType = MutexIF::TimeoutType::WAITING; uint32_t timeoutMs = 0; - MutexIF* mutex = comIf->getMutex(&timeoutType, &timeoutMs); + cookie->getMutexParams(timeoutType, timeoutMs); + MutexIF* mutex = comIf->getCsMutex(); if (mutex == nullptr or gpioIF == nullptr) { sif::debug << "rwSpiCallback::spiCallback: Mutex or GPIO interface invalid" << std::endl; return HasReturnvaluesIF::RETURN_FAILED; diff --git a/fsfw b/fsfw index e8023886..e758f0be 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit e8023886f60ba3af0a63279da8dbc0d3eb0939a7 +Subproject commit e758f0be2e8864c761877a4dcbdf461df52072f7 diff --git a/mission/devices/GyroADIS1650XHandler.cpp b/mission/devices/GyroADIS1650XHandler.cpp index ed9dd777..b94c96bf 100644 --- a/mission/devices/GyroADIS1650XHandler.cpp +++ b/mission/devices/GyroADIS1650XHandler.cpp @@ -424,7 +424,8 @@ ReturnValue_t GyroADIS1650XHandler::spiSendCallback(SpiComIF *comIf, SpiCookie * GpioIF *gpioIF = comIf->getGpioInterface(); MutexIF::TimeoutType timeoutType = MutexIF::TimeoutType::WAITING; uint32_t timeoutMs = 0; - MutexIF *mutex = comIf->getMutex(&timeoutType, &timeoutMs); + cookie->getMutexParams(timeoutType, timeoutMs); + MutexIF *mutex = comIf->getCsMutex(); if (mutex == nullptr or gpioIF == nullptr) { #if OBSW_VERBOSE_LEVEL >= 1 sif::warning << "GyroADIS16507Handler::spiSendCallback: " diff --git a/mission/devices/PayloadPcduHandler.cpp b/mission/devices/PayloadPcduHandler.cpp index 05e8edec..dd576cae 100644 --- a/mission/devices/PayloadPcduHandler.cpp +++ b/mission/devices/PayloadPcduHandler.cpp @@ -716,7 +716,8 @@ ReturnValue_t PayloadPcduHandler::transferAsTwo(SpiComIF* comIf, SpiCookie* cook GpioIF* gpioIF = comIf->getGpioInterface(); MutexIF::TimeoutType timeoutType = MutexIF::TimeoutType::WAITING; uint32_t timeoutMs = 0; - MutexIF* mutex = comIf->getMutex(&timeoutType, &timeoutMs); + cookie->getMutexParams(timeoutType, timeoutMs); + MutexIF* mutex = comIf->getCsMutex(); if (mutex == nullptr or gpioIF == nullptr) { #if OBSW_VERBOSE_LEVEL >= 1 sif::warning << "GyroADIS16507Handler::spiSendCallback: " diff --git a/tmtc b/tmtc index 0ebf0444..480e0f07 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 0ebf04449668909a8f570891d27e89b93f0105c3 +Subproject commit 480e0f07e03edeb55a3d6e3d629e7601b6bf90a2 From d274f5647d12d326ff56f96a1d106d401c25d5ba Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 19 May 2022 15:28:02 +0200 Subject: [PATCH 3/6] fix EM cofig --- bsp_q7s/core/InitMission.cpp | 1 + bsp_q7s/em/emObjectFactory.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/bsp_q7s/core/InitMission.cpp b/bsp_q7s/core/InitMission.cpp index 68bf42d4..8913789b 100644 --- a/bsp_q7s/core/InitMission.cpp +++ b/bsp_q7s/core/InitMission.cpp @@ -132,6 +132,7 @@ void initmission::initTasks() { PeriodicTaskIF* sysTask = factory->createPeriodicTask( "SYS_TASK", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.4, missedDeadlineFunc); + static_cast(sysTask); #if OBSW_ADD_ACS_HANDLERS == 1 result = sysTask->addComponent(objects::ACS_BOARD_ASS); if (result != HasReturnvaluesIF::RETURN_OK) { diff --git a/bsp_q7s/em/emObjectFactory.cpp b/bsp_q7s/em/emObjectFactory.cpp index 561786e8..d4500e0b 100644 --- a/bsp_q7s/em/emObjectFactory.cpp +++ b/bsp_q7s/em/emObjectFactory.cpp @@ -1,3 +1,4 @@ +#include #include "OBSWConfig.h" #include "bsp_q7s/core/CoreController.h" #include "bsp_q7s/core/ObjectFactory.h" @@ -11,7 +12,8 @@ void ObjectFactory::produce(void* args) { ObjectFactory::setStatics(); - ObjectFactory::produceGenericObjects(); + HealthTableIF* healthTable = nullptr; + ObjectFactory::produceGenericObjects(&healthTable); LinuxLibgpioIF* gpioComIF = nullptr; UartComIF* uartComIF = nullptr; @@ -31,7 +33,7 @@ void ObjectFactory::produce(void* args) { #if OBSW_ADD_ACS_BOARD == 1 createAcsBoardComponents(gpioComIF, uartComIF, pwrSwitcher); #endif - createHeaterComponents(); + createHeaterComponents(gpioComIF, pwrSwitcher, healthTable); createSolarArrayDeploymentComponents(); createPlPcduComponents(gpioComIF, spiMainComIF, pwrSwitcher); #if OBSW_ADD_SYRLINKS == 1 From e73bfc2c64ace1459dd518aacc6d90bcae6cd1f5 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 19 May 2022 16:00:26 +0200 Subject: [PATCH 4/6] dev string for FM/EM --- bsp_q7s/obsw.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bsp_q7s/obsw.cpp b/bsp_q7s/obsw.cpp index 74a1b300..1da60783 100644 --- a/bsp_q7s/obsw.cpp +++ b/bsp_q7s/obsw.cpp @@ -4,6 +4,7 @@ #include #include "OBSWConfig.h" +#include "q7sConfig.h" #include "commonConfig.h" #include "core/InitMission.h" #include "fsfw/tasks/TaskFactory.h" @@ -11,11 +12,15 @@ #include "watchdog/definitions.h" static int OBSW_ALREADY_RUNNING = -2; - +#if OBSW_Q7S_EM == 0 +static const char* DEV_STRING = "Xiphos Q7S FM"; +#else +static const char* DEV_STRING = "Xiphos Q7S EM"; +#endif int obsw::obsw() { using namespace fsfw; std::cout << "-- EIVE OBSW --" << std::endl; - std::cout << "-- Compiled for Linux (Xiphos Q7S) --" << std::endl; + std::cout << "-- Compiled for Linux (" << DEV_STRING << ") --" << std::endl; std::cout << "-- OBSW v" << common::OBSW_VERSION << " | FSFW v" << fsfw::FSFW_VERSION << " --" << std::endl; std::cout << "-- " << __DATE__ << " " << __TIME__ << " --" << std::endl; From eb20dda221608fb9f5420252bfbddc7a12a4a2e3 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 19 May 2022 17:52:46 +0200 Subject: [PATCH 5/6] small fix for yocto script --- scripts/install-obsw-yocto.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install-obsw-yocto.sh b/scripts/install-obsw-yocto.sh index c27b67aa..059d7244 100755 --- a/scripts/install-obsw-yocto.sh +++ b/scripts/install-obsw-yocto.sh @@ -2,8 +2,8 @@ # 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 -if [ !-z ${1} ]; then - if [ ${1} == "em" ]; then +if [ ! -z ${1} ]; then + if [[ "${1}" == "em" ]]; then echo "-I- Installing EM binaries" build_dir=cmake-build-release-q7s-em fi From a63e87f5f4d2c7618a1d2fa99db2f95e99db9d50 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 19 May 2022 18:46:49 +0200 Subject: [PATCH 6/6] subscribe for periodic core ctrl packet --- bsp_q7s/core/CoreController.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/bsp_q7s/core/CoreController.cpp b/bsp_q7s/core/CoreController.cpp index 208999c2..5419e7a9 100644 --- a/bsp_q7s/core/CoreController.cpp +++ b/bsp_q7s/core/CoreController.cpp @@ -87,6 +87,7 @@ ReturnValue_t CoreController::initializeLocalDataPool(localpool::DataPool &local localDataPoolMap.emplace(core::TEMPERATURE, new PoolEntry({0})); localDataPoolMap.emplace(core::PS_VOLTAGE, new PoolEntry({0})); localDataPoolMap.emplace(core::PL_VOLTAGE, new PoolEntry({0})); + poolManager.subscribeForPeriodicPacket(hkSet.getSid(), false, 10.0, false); return HasReturnvaluesIF::RETURN_OK; }