diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f4f5337..10bdcb1c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,9 @@ list yields a list of all related PRs for each release. ## Fixed - PLOC SUPV: Minor adaptions and important bugfix for UART manager +- Allow cloning and building the hosted OBSW version without proprietary libraries, + which also avoids the need to have a Gitea account. + PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/337 ## Added diff --git a/CMakeLists.txt b/CMakeLists.txt index d87c2695..093580d3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -141,7 +141,7 @@ set(OBSW_ADD_TMP_DEVICES ${INIT_VAL} CACHE STRING "Add TMP devices") set(OBSW_ADD_GOMSPACE_PCDU - 1 + ${INIT_VAL} CACHE STRING "Add GomSpace PCDU modules") set(OBSW_ADD_RW ${INIT_VAL} @@ -402,15 +402,14 @@ endif() add_subdirectory(thirdparty) if(EIVE_ADD_LINUX_FILES) - add_subdirectory(${LIB_ARCSEC_PATH}) + if(TGT_BSP MATCHES "arm/q7s") + add_subdirectory(${LIB_GOMSPACE_PATH}) + add_subdirectory(${LIB_ARCSEC_PATH}) + endif() add_subdirectory(${LINUX_PATH}) endif() add_subdirectory(${BSP_PATH}) -if(UNIX) - add_subdirectory(${LIB_GOMSPACE_PATH}) -endif() - add_subdirectory(${COMMON_PATH}) add_subdirectory(${DUMMY_PATH}) @@ -489,7 +488,8 @@ target_link_libraries(${LIB_DUMMIES} PUBLIC ${LIB_FSFW_NAME} ${LIB_JSON_NAME}) target_link_libraries(${OBSW_NAME} PRIVATE ${LIB_EIVE_MISSION} ${LIB_DUMMIES}) if(TGT_BSP MATCHES "arm/q7s") - target_link_libraries(${LIB_EIVE_MISSION} PUBLIC ${LIB_GPS} ${LIB_ARCSEC}) + target_link_libraries(${LIB_EIVE_MISSION} PUBLIC ${LIB_GPS} ${LIB_ARCSEC} + ${LIB_GOMSPACE_CLIENTS}) endif() target_link_libraries(${UNITTEST_NAME} PRIVATE Catch2 ${LIB_EIVE_MISSION} @@ -499,10 +499,6 @@ if(TGT_BSP MATCHES "arm/egse") target_link_libraries(${OBSW_NAME} PRIVATE ${LIB_ARCSEC}) endif() -if(UNIX) - target_link_libraries(${OBSW_NAME} PRIVATE ${LIB_GOMSPACE_CLIENTS}) -endif() - if(EIVE_ADD_ETL_LIB) target_link_libraries(${LIB_EIVE_MISSION} PUBLIC ${LIB_ETL_TARGET}) endif() diff --git a/README.md b/README.md index 403189d6..19197bfa 100644 --- a/README.md +++ b/README.md @@ -290,7 +290,7 @@ helper scripts as well. 4. Run build command by double clicking the created target or by right clicking the project folder and selecting Build Project. -# Useful and Common Commands (Host) +# Useful and Common Commands ## Build generation @@ -319,14 +319,9 @@ cmake -DTGT_BSP=arm/q7s -DCMAKE_BUILD_TYPE=Release .. cmake --build . -j ``` -### Q7S Watchdog - -The watchdog will be built along side the primary OBSW binary. - -### Hosted +### Hosted OBSW You can also use the FSFW OSAL `host` to build on Windows or for generic OSes. -Note: Currently this is not supported. ```sh mkdir cmake-build-debug && cd cmake-build-debug @@ -334,6 +329,21 @@ cmake -DFSFW_OSAL=host -DCMAKE_BUILD_TYPE=Debug .. cmake --build . -j ``` +You can also use the `linux` OSAL: + +```sh +mkdir cmake-build-debug && cd cmake-build-debug +cmake -DFSFW_OSAL=linux -DCMAKE_BUILD_TYPE=Debug .. +cmake --build . -j +``` + +Please note that some additional Linux setup might be necessary. +You can find more information in the [Linux section of the FSFW example](https://egit.irs.uni-stuttgart.de/fsfw/fsfw-example-linux-mcu/src/branch/mueller/master/doc/README-linux.md#raising-message-queue-size-limit) + +### Q7S Watchdog + +The watchdog will be built along side the primary OBSW binary. + ### Unittests To build the unittests, the corresponding target must be specified in the build command. diff --git a/bsp_hosted/Dockerfile b/bsp_hosted/Dockerfile index c55ccc67..4d897426 100644 --- a/bsp_hosted/Dockerfile +++ b/bsp_hosted/Dockerfile @@ -14,7 +14,7 @@ RUN set -ex; \ rm -rf build-hosted; \ mkdir build-hosted; \ cd build-hosted; \ - cmake -DCMAKE_BUILD_TYPE=Release -DOS_FSFW=linux ..; + cmake -DCMAKE_BUILD_TYPE=Release -DOSAL_FSFW=host ..; ENTRYPOINT ["cmake", "--build", "build-hosted"] CMD ["-j"] diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 4976c4b2..70e16002 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -123,11 +123,12 @@ void Factory::setStaticFrameworkObjectIds() { void ObjectFactory::setStatics() { Factory::setStaticFrameworkObjectIds(); } void ObjectFactory::createTmpComponents() { - std::array, 5> tmpDevIds = {{ + std::vector> tmpDevIds = {{ {objects::TMP1075_HANDLER_TCS_0, addresses::TMP1075_TCS_0}, {objects::TMP1075_HANDLER_TCS_1, addresses::TMP1075_TCS_1}, {objects::TMP1075_HANDLER_PLPCDU_0, addresses::TMP1075_PLPCDU_0}, - {objects::TMP1075_HANDLER_PLPCDU_1, addresses::TMP1075_PLPCDU_1}, + // damaged + // {objects::TMP1075_HANDLER_PLPCDU_1, addresses::TMP1075_PLPCDU_1}, {objects::TMP1075_HANDLER_IF_BOARD, addresses::TMP1075_IF_BOARD}, }}; std::vector tmpDevCookies; diff --git a/clone-submodules-no-privlibs.sh b/clone-submodules-no-privlibs.sh new file mode 100755 index 00000000..ae08a9ce --- /dev/null +++ b/clone-submodules-no-privlibs.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +git submodule update --init fsfw thirdparty/rapidcsv thirdparty/lwgps thirdparty/json diff --git a/cmake/scripts/host/host-make-debug.sh b/cmake/scripts/host/host-make-debug.sh index 412bf68f..cb7a3fb5 100755 --- a/cmake/scripts/host/host-make-debug.sh +++ b/cmake/scripts/host/host-make-debug.sh @@ -1,12 +1,14 @@ #!/bin/bash cfg_script_name="cmake-build-cfg.py" init_dir=$(pwd) +root_dir="" if [ -z "${EIVE_OBSW_ROOT}" ]; then counter=0 while [ ${counter} -lt 5 ] do cd .. if [ -f ${cfg_script_name} ];then + root_dir=$(realpath "../..") break fi counter=$((counter=counter + 1)) @@ -18,6 +20,7 @@ if [ -z "${EIVE_OBSW_ROOT}" ]; then fi else cfg_script_name="${EIVE_OBSW_ROOT}/cmake/scripts/${cfg_script_name}" + root_dir=${EIVE_OBSW_ROOT} fi build_generator="make" @@ -34,4 +37,5 @@ echo "Running command (without the leading +):" set -x # Print command ${python} ${cfg_script_name} -o "${os_fsfw}" -g "${build_generator}" -b "debug" -l "${builddir}" # Use this if commands are added which should not be printed -# set +x +set +x +cd ${root_dir}/${builddir} diff --git a/cmake/scripts/host/host-make-release.sh b/cmake/scripts/host/host-make-release.sh index d564c8aa..5aee7618 100755 --- a/cmake/scripts/host/host-make-release.sh +++ b/cmake/scripts/host/host-make-release.sh @@ -7,6 +7,7 @@ if [ -z "${EIVE_OBSW_ROOT}" ]; then do cd .. if [ -f ${cfg_script_name} ];then + root_dir=$(realpath "../..") break fi counter=$((counter=counter + 1)) @@ -20,7 +21,7 @@ else cfg_script_name="${EIVE_OBSW_ROOT}/cmake/scripts/${cfg_script_name}" fi -build_generator="Unix Makefiles" +build_generator="make" os_fsfw="host" builddir="cmake-build-release" if [ "${OS}" = "Windows_NT" ]; then @@ -34,4 +35,5 @@ echo "Running command (without the leading +):" set -x # Print command ${python} ${cfg_script_name} -o "${os_fsfw}" -g "${build_generator}" -b "release" -l "${builddir}" # Use this if commands are added which should not be printed -# set +x +set +x +cd ${root_dir}/${builddir} diff --git a/linux/CMakeLists.txt b/linux/CMakeLists.txt index 7f6ea0bc..b500c823 100644 --- a/linux/CMakeLists.txt +++ b/linux/CMakeLists.txt @@ -1,4 +1,3 @@ -add_subdirectory(csp) add_subdirectory(utility) add_subdirectory(callbacks) add_subdirectory(boardtest) @@ -9,4 +8,9 @@ if(EIVE_ADD_LINUX_FSFWCONFIG) add_subdirectory(fsfwconfig) endif() +# Dependency on proprietary library +if(TGT_BSP MATCHES "arm/q7s") + add_subdirectory(csp) +endif() + target_sources(${OBSW_NAME} PUBLIC ObjectFactory.cpp scheduling.cpp) diff --git a/linux/devices/CMakeLists.txt b/linux/devices/CMakeLists.txt index de0ea1da..a6a909d0 100644 --- a/linux/devices/CMakeLists.txt +++ b/linux/devices/CMakeLists.txt @@ -7,4 +7,8 @@ target_sources( ScexDleParser.cpp ScexHelper.cpp) add_subdirectory(ploc) -add_subdirectory(startracker) + +# Dependency on proprietary library +if(TGT_BSP MATCHES "arm/q7s") + add_subdirectory(startracker) +endif() diff --git a/linux/devices/ploc/PlocMPSoCHandler.cpp b/linux/devices/ploc/PlocMPSoCHandler.cpp index 2ac58335..b1914111 100644 --- a/linux/devices/ploc/PlocMPSoCHandler.cpp +++ b/linux/devices/ploc/PlocMPSoCHandler.cpp @@ -347,6 +347,8 @@ ReturnValue_t PlocMPSoCHandler::scanForReply(const uint8_t* start, size_t remain triggerEvent(MPSOC_HANDLER_SEQUENCE_COUNT_MISMATCH, sequenceCount, recvSeqCnt); sequenceCount = recvSeqCnt; } + // This sequence count ping pong does not make any sense but it is how the MPSoC expects it. + sequenceCount++; return result; } diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp index f10043b5..5dd87e0b 100644 --- a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp @@ -455,6 +455,8 @@ ReturnValue_t pst::pstI2c(FixedTimeslotTaskIF *thisSequence) { thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_0, length * 0.4, DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_0, length * 0.4, DeviceHandlerIF::GET_READ); + // damaged + /* thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_1, length * 0.4, DeviceHandlerIF::PERFORM_OPERATION); thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_1, length * 0.4, @@ -464,6 +466,7 @@ ReturnValue_t pst::pstI2c(FixedTimeslotTaskIF *thisSequence) { thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_1, length * 0.4, DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_1, length * 0.4, DeviceHandlerIF::GET_READ); + */ thisSequence->addSlot(objects::TMP1075_HANDLER_IF_BOARD, length * 0.4, DeviceHandlerIF::PERFORM_OPERATION); thisSequence->addSlot(objects::TMP1075_HANDLER_IF_BOARD, length * 0.4, diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index 45f26f8b..f0356f66 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -41,7 +41,8 @@ ThermalController::ThermalController(object_id_t objectId) tmp1075SetTcs0(objects::TMP1075_HANDLER_TCS_0), tmp1075SetTcs1(objects::TMP1075_HANDLER_TCS_1), tmp1075SetPlPcdu0(objects::TMP1075_HANDLER_PLPCDU_0), - tmp1075SetPlPcdu1(objects::TMP1075_HANDLER_PLPCDU_1), + // damaged + // tmp1075SetPlPcdu1(objects::TMP1075_HANDLER_PLPCDU_1), tmp1075SetIfBoard(objects::TMP1075_HANDLER_IF_BOARD), susSet0(objects::SUS_0_N_LOC_XFYFZM_PT_XF), susSet1(objects::SUS_1_N_LOC_XBYFZM_PT_XB), @@ -449,6 +450,8 @@ void ThermalController::copySensors() { } } } + // damaged + /* { PoolReadGuard pg(&tmp1075SetPlPcdu1, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT); if (pg.getReadResult() == returnvalue::OK) { @@ -459,6 +462,7 @@ void ThermalController::copySensors() { } } } + */ { PoolReadGuard pg(&tmp1075SetIfBoard, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT); if (pg.getReadResult() == returnvalue::OK) { diff --git a/mission/controller/ThermalController.h b/mission/controller/ThermalController.h index 5071d811..5f4569c3 100644 --- a/mission/controller/ThermalController.h +++ b/mission/controller/ThermalController.h @@ -55,10 +55,12 @@ class ThermalController : public ExtendedControllerBase { MAX31865::Max31865Set max31865Set13; MAX31865::Max31865Set max31865Set14; MAX31865::Max31865Set max31865Set15; + TMP1075::Tmp1075Dataset tmp1075SetTcs0; TMP1075::Tmp1075Dataset tmp1075SetTcs1; TMP1075::Tmp1075Dataset tmp1075SetPlPcdu0; - TMP1075::Tmp1075Dataset tmp1075SetPlPcdu1; + // damaged + // TMP1075::Tmp1075Dataset tmp1075SetPlPcdu1; TMP1075::Tmp1075Dataset tmp1075SetIfBoard; // SUS diff --git a/mission/devices/PayloadPcduHandler.cpp b/mission/devices/PayloadPcduHandler.cpp index 6d4888f1..c5956b6b 100644 --- a/mission/devices/PayloadPcduHandler.cpp +++ b/mission/devices/PayloadPcduHandler.cpp @@ -84,6 +84,16 @@ void PayloadPcduHandler::doTransition(Mode_t modeFrom, Submode_t subModeFrom) { if (getMode() == _MODE_TO_NORMAL) { stateMachineToNormal(modeFrom, subModeFrom); return; + } else if (getMode() == _MODE_TO_ON and modeFrom == MODE_NORMAL) { + gpioIF->pullLow(gpioIds::PLPCDU_ENB_HPA); + gpioIF->pullLow(gpioIds::PLPCDU_ENB_MPA); + gpioIF->pullLow(gpioIds::PLPCDU_ENB_TX); + gpioIF->pullLow(gpioIds::PLPCDU_ENB_X8); + gpioIF->pullLow(gpioIds::PLPCDU_ENB_DRO); + gpioIF->pullLow(gpioIds::PLPCDU_ENB_TX); + gpioIF->pullLow(gpioIds::PLPCDU_ENB_VBAT0); + gpioIF->pullLow(gpioIds::PLPCDU_ENB_VBAT1); + state = States::POWER_CHANNELS_ON; } DeviceHandlerBase::doTransition(modeFrom, subModeFrom); } @@ -159,6 +169,10 @@ ReturnValue_t PayloadPcduHandler::stateMachineToNormal(Mode_t modeFrom, Submode_ } }; + // sif::debug << "DIFF MASK: " << (int)diffMask << std::endl; + + // No handling for the SSRs: If those are pulled low, the ADC is off + // and normal mode does not really make sense anyway switchHandler(DRO_ON, gpioIds::PLPCDU_ENB_DRO, "DRO"); switchHandler(X8_ON, gpioIds::PLPCDU_ENB_X8, "X8"); switchHandler(TX_ON, gpioIds::PLPCDU_ENB_TX, "TX");