From fdd76fb600aa2d088bd11185d848fc9835895761 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 24 Jun 2021 11:16:08 +0200 Subject: [PATCH 01/17] fsfw update, rm3100 update --- fsfw | 2 +- mission/devices/MGMHandlerRM3100.cpp | 10 +++++----- mission/devices/MGMHandlerRM3100.h | 11 +++++------ 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/fsfw b/fsfw index 5f9a6bb1..c0c4a319 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 5f9a6bb155eb59981e7ff851b7efaa1ae25e42b4 +Subproject commit c0c4a3190f1e54d4b5982656f5cc52218928d6ca diff --git a/mission/devices/MGMHandlerRM3100.cpp b/mission/devices/MGMHandlerRM3100.cpp index 4fd654d3..0f7fc729 100644 --- a/mission/devices/MGMHandlerRM3100.cpp +++ b/mission/devices/MGMHandlerRM3100.cpp @@ -1,10 +1,10 @@ -#include #include "MGMHandlerRM3100.h" -#include -#include -#include -#include +#include "fsfw/datapool/PoolReadGuard.h" +#include "fsfw/globalfunctions/bitutility.h" +#include "fsfw/devicehandlers/DeviceHandlerMessage.h" +#include "fsfw/objectmanager/SystemObjectIF.h" +#include "fsfw/returnvalues/HasReturnvaluesIF.h" MGMHandlerRM3100::MGMHandlerRM3100(object_id_t objectId, diff --git a/mission/devices/MGMHandlerRM3100.h b/mission/devices/MGMHandlerRM3100.h index 95175b47..48173e65 100644 --- a/mission/devices/MGMHandlerRM3100.h +++ b/mission/devices/MGMHandlerRM3100.h @@ -1,13 +1,12 @@ #ifndef MISSION_DEVICES_MGMRM3100HANDLER_H_ #define MISSION_DEVICES_MGMRM3100HANDLER_H_ +#include "OBSWConfig.h" #include "devicedefinitions/MGMHandlerRM3100Definitions.h" -#include - -#include +#include "fsfw/devicehandlers/DeviceHandlerBase.h" #if OBSW_VERBOSE_LEVEL >= 1 -#include +#include "fsfw/globalfunctions/PeriodicOperationDivider.h" #endif /** @@ -21,11 +20,11 @@ class MGMHandlerRM3100: public DeviceHandlerBase { public: static const uint8_t INTERFACE_ID = CLASS_ID::MGM_RM3100; - //! P1: TMRC value which was set, P2: 0 + //! [EXPORT] : [COMMENT] P1: TMRC value which was set, P2: 0 static constexpr Event tmrcSet = event::makeEvent(SUBSYSTEM_ID::MGM_RM3100, 0x00, severity::INFO); - //! P1: First two bytes new Cycle Count X + //! [EXPORT] : [COMMENT] Cycle counter set. P1: First two bytes new Cycle Count X //! P1: Second two bytes new Cycle Count Y //! P2: New cycle count Z static constexpr Event cycleCountersSet = event::makeEvent( From a076c7d5938518d963718b5f70f2b4623c80f1d3 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 24 Jun 2021 11:17:36 +0200 Subject: [PATCH 02/17] fsfw update --- fsfw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsfw b/fsfw index c0c4a319..38f2f69c 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit c0c4a3190f1e54d4b5982656f5cc52218928d6ca +Subproject commit 38f2f69c784c74cd87a10dce6c968325cf1cb472 From 2a01de731fa51fd0d2c811b0223790c7b60d5994 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 24 Jun 2021 11:23:49 +0200 Subject: [PATCH 03/17] added ninja scripts --- ...e_cmake_debug_cfg.sh => make_debug_cfg.sh} | 0 ...e_relwithdeb_cfg.sh => make_reldeb_cfg.sh} | 0 ...ake_release_cfg.sh => make_release_cfg.sh} | 0 cmake/scripts/Q7S/ninja_debug_cfg.sh | 23 +++++++++++++++++++ ...e_cmake_debug_cfg.sh => make_debug_cfg.sh} | 0 ...e_relwithdeb_cfg.sh => make_reldeb_cfg.sh} | 0 ...ake_release_cfg.sh => make_release_cfg.sh} | 0 ...e_cmake_size_cfg.sh => ninja_debug_cfg.sh} | 12 ++++------ 8 files changed, 27 insertions(+), 8 deletions(-) rename cmake/scripts/Q7S/{create_cmake_debug_cfg.sh => make_debug_cfg.sh} (100%) rename cmake/scripts/Q7S/{create_cmake_relwithdeb_cfg.sh => make_reldeb_cfg.sh} (100%) rename cmake/scripts/Q7S/{create_cmake_release_cfg.sh => make_release_cfg.sh} (100%) create mode 100755 cmake/scripts/Q7S/ninja_debug_cfg.sh rename cmake/scripts/RPi/{create_cmake_debug_cfg.sh => make_debug_cfg.sh} (100%) rename cmake/scripts/RPi/{create_cmake_relwithdeb_cfg.sh => make_reldeb_cfg.sh} (100%) rename cmake/scripts/RPi/{create_cmake_release_cfg.sh => make_release_cfg.sh} (100%) rename cmake/scripts/RPi/{create_cmake_size_cfg.sh => ninja_debug_cfg.sh} (63%) diff --git a/cmake/scripts/Q7S/create_cmake_debug_cfg.sh b/cmake/scripts/Q7S/make_debug_cfg.sh similarity index 100% rename from cmake/scripts/Q7S/create_cmake_debug_cfg.sh rename to cmake/scripts/Q7S/make_debug_cfg.sh diff --git a/cmake/scripts/Q7S/create_cmake_relwithdeb_cfg.sh b/cmake/scripts/Q7S/make_reldeb_cfg.sh similarity index 100% rename from cmake/scripts/Q7S/create_cmake_relwithdeb_cfg.sh rename to cmake/scripts/Q7S/make_reldeb_cfg.sh diff --git a/cmake/scripts/Q7S/create_cmake_release_cfg.sh b/cmake/scripts/Q7S/make_release_cfg.sh similarity index 100% rename from cmake/scripts/Q7S/create_cmake_release_cfg.sh rename to cmake/scripts/Q7S/make_release_cfg.sh diff --git a/cmake/scripts/Q7S/ninja_debug_cfg.sh b/cmake/scripts/Q7S/ninja_debug_cfg.sh new file mode 100755 index 00000000..3a8ac631 --- /dev/null +++ b/cmake/scripts/Q7S/ninja_debug_cfg.sh @@ -0,0 +1,23 @@ +#!/bin/sh +counter=0 +while [ ${counter} -lt 5 ] +do + cd .. + if [ -f "cmake_build_config.py" ];then + break + fi + counter=$((counter=counter + 1)) +done + +if [ "${counter}" -ge 5 ];then + echo "cmake_build_config.py not found in upper directories!" + exit 1 +fi + +os_fsfw="linux" +tgt_bsp="arm/q7s" +build_dir="build-Debug-Q7S" +build_generator="Ninja" + +python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" \ + -l"${build_dir}" diff --git a/cmake/scripts/RPi/create_cmake_debug_cfg.sh b/cmake/scripts/RPi/make_debug_cfg.sh similarity index 100% rename from cmake/scripts/RPi/create_cmake_debug_cfg.sh rename to cmake/scripts/RPi/make_debug_cfg.sh diff --git a/cmake/scripts/RPi/create_cmake_relwithdeb_cfg.sh b/cmake/scripts/RPi/make_reldeb_cfg.sh similarity index 100% rename from cmake/scripts/RPi/create_cmake_relwithdeb_cfg.sh rename to cmake/scripts/RPi/make_reldeb_cfg.sh diff --git a/cmake/scripts/RPi/create_cmake_release_cfg.sh b/cmake/scripts/RPi/make_release_cfg.sh similarity index 100% rename from cmake/scripts/RPi/create_cmake_release_cfg.sh rename to cmake/scripts/RPi/make_release_cfg.sh diff --git a/cmake/scripts/RPi/create_cmake_size_cfg.sh b/cmake/scripts/RPi/ninja_debug_cfg.sh similarity index 63% rename from cmake/scripts/RPi/create_cmake_size_cfg.sh rename to cmake/scripts/RPi/ninja_debug_cfg.sh index f7bad84e..c05ae446 100755 --- a/cmake/scripts/RPi/create_cmake_size_cfg.sh +++ b/cmake/scripts/RPi/ninja_debug_cfg.sh @@ -16,12 +16,8 @@ fi os_fsfw="linux" tgt_bsp="arm/raspberrypi" -build_generator="" -if [ "${OS}" = "Windows_NT" ]; then - build_generator="MinGW Makefiles" -# Could be other OS but this works for now. -else - build_generator="Unix Makefiles" -fi +build_generator="Ninja" +build_dir="build-Debug-RPi" -python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "size" -t "${tgt_bsp}" +python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" \ + -l"${build_dir}" From a30483b37ea9b9bdc179a7d334a3ed5fdf7634a0 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 24 Jun 2021 11:24:19 +0200 Subject: [PATCH 04/17] small README fix --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a03d7272..53c1cfad 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ wget https://eive-cloud.irs.uni-stuttgart.de/index.php/s/2Fp2ag6NGnbtAsK/downloa 3. Run the following commands in MinGW64 ```sh - pacman -Syuuu + pacman -Syu ``` It is recommended to install the full base development toolchain From 1e3b91789c9aa5148e8a176580a630ca50cf833e Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 24 Jun 2021 11:42:40 +0200 Subject: [PATCH 05/17] continued gps handler --- bsp_linux_board/ObjectFactory.cpp | 4 +- mission/devices/CMakeLists.txt | 3 +- ...{GPSHandler.cpp => GPSHyperionHandler.cpp} | 52 +++++++++++++------ .../{GPSHandler.h => GPSHyperionHandler.h} | 20 ++++--- .../devicedefinitions/GPSDefinitions.h | 24 ++++++++- 5 files changed, 74 insertions(+), 29 deletions(-) rename mission/devices/{GPSHandler.cpp => GPSHyperionHandler.cpp} (55%) rename mission/devices/{GPSHandler.h => GPSHyperionHandler.h} (72%) diff --git a/bsp_linux_board/ObjectFactory.cpp b/bsp_linux_board/ObjectFactory.cpp index f4ae00bf..c5e12868 100644 --- a/bsp_linux_board/ObjectFactory.cpp +++ b/bsp_linux_board/ObjectFactory.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include "ObjectFactory.h" #include "objects/systemObjectList.h" @@ -157,7 +157,7 @@ void ObjectFactory::produce(void* args){ UartModes::CANONICAL, 9600, 1024); uartCookie->setToFlushInput(true); uartCookie->setReadCycles(6); - GPSHandler* gpsHandler = new GPSHandler(objects::GPS0_HANDLER, + GPSHyperionHandler* gpsHandler = new GPSHyperionHandler(objects::GPS0_HANDLER, objects::UART_COM_IF, uartCookie); gpsHandler->setStartUpImmediately(); #endif diff --git a/mission/devices/CMakeLists.txt b/mission/devices/CMakeLists.txt index 735e595b..8eb96538 100644 --- a/mission/devices/CMakeLists.txt +++ b/mission/devices/CMakeLists.txt @@ -1,6 +1,5 @@ target_sources(${TARGET_NAME} PUBLIC - GPSHandler.cpp - # GyroL3GD20Handler.cpp + GPSHyperionHandler.cpp MGMHandlerLIS3MDL.cpp MGMHandlerRM3100.cpp GomspaceDeviceHandler.cpp diff --git a/mission/devices/GPSHandler.cpp b/mission/devices/GPSHyperionHandler.cpp similarity index 55% rename from mission/devices/GPSHandler.cpp rename to mission/devices/GPSHyperionHandler.cpp index 3fdb6ab1..248b7193 100644 --- a/mission/devices/GPSHandler.cpp +++ b/mission/devices/GPSHyperionHandler.cpp @@ -1,17 +1,19 @@ -#include "GPSHandler.h" +#include "GPSHyperionHandler.h" #include "devicedefinitions/GPSDefinitions.h" +#include "fsfw/datapool/PoolReadGuard.h" + #include "lwgps/lwgps.h" -GPSHandler::GPSHandler(object_id_t objectId, object_id_t deviceCommunication, +GPSHyperionHandler::GPSHyperionHandler(object_id_t objectId, object_id_t deviceCommunication, CookieIF *comCookie): - DeviceHandlerBase(objectId, deviceCommunication, comCookie) { + DeviceHandlerBase(objectId, deviceCommunication, comCookie), gpsSet(this) { lwgps_init(&gpsData); } -GPSHandler::~GPSHandler() {} +GPSHyperionHandler::~GPSHyperionHandler() {} -void GPSHandler::doStartUp() { +void GPSHyperionHandler::doStartUp() { if(internalState == InternalStates::NONE) { commandExecuted = false; internalState = InternalStates::WAIT_FIRST_MESSAGE; @@ -26,27 +28,27 @@ void GPSHandler::doStartUp() { } } -void GPSHandler::doShutDown() { +void GPSHyperionHandler::doShutDown() { internalState = InternalStates::NONE; commandExecuted = false; setMode(MODE_OFF); } -ReturnValue_t GPSHandler::buildTransitionDeviceCommand(DeviceCommandId_t *id) { +ReturnValue_t GPSHyperionHandler::buildTransitionDeviceCommand(DeviceCommandId_t *id) { return HasReturnvaluesIF::RETURN_OK; } -ReturnValue_t GPSHandler::buildNormalDeviceCommand(DeviceCommandId_t *id) { +ReturnValue_t GPSHyperionHandler::buildNormalDeviceCommand(DeviceCommandId_t *id) { return HasReturnvaluesIF::RETURN_OK; } -ReturnValue_t GPSHandler::buildCommandFromCommand( +ReturnValue_t GPSHyperionHandler::buildCommandFromCommand( DeviceCommandId_t deviceCommand, const uint8_t *commandData, size_t commandDataLen) { return HasReturnvaluesIF::RETURN_OK; } -ReturnValue_t GPSHandler::scanForReply(const uint8_t *start, size_t len, +ReturnValue_t GPSHyperionHandler::scanForReply(const uint8_t *start, size_t len, DeviceCommandId_t *foundId, size_t *foundLen) { // Pass data to GPS library if(len > 0) { @@ -61,12 +63,30 @@ ReturnValue_t GPSHandler::scanForReply(const uint8_t *start, size_t len, << std::endl; } else { - sif::info << "GPS Data" << std::endl; + // The data from the device will generally be read all at once. Therefore, we + // can set all field here + PoolReadGuard pg(&gpsSet); + if(pg.getReadResult() != HasReturnvaluesIF::RETURN_OK) { +#if FSFW_VERBOSE_LEVEL >= 1 + sif::warning << "GPSHyperionHandler::scanForReply: Reading dataset failed" + << std::endl; +#endif + } // Print messages + if(gpsData.is_valid) { + // Set all entries valid now, set invalid on case basis if values are sanitized + gpsSet.setValidity(true, true); + } + gpsSet.latitude.value = gpsData.latitude; + gpsSet.longitude.value = gpsData.latitude; + gpsSet.fixMode.value = gpsData.fix_mode; +#if FSFW_HAL_DEBUG_HYPERION_GPS == 1 + sif::info << "GPS Data" << std::endl; printf("Valid status: %d\n", gpsData.is_valid); printf("Latitude: %f degrees\n", gpsData.latitude); printf("Longitude: %f degrees\n", gpsData.longitude); printf("Altitude: %f meters\n", gpsData.altitude); +#endif } *foundLen = len; } @@ -74,25 +94,25 @@ ReturnValue_t GPSHandler::scanForReply(const uint8_t *start, size_t len, } -ReturnValue_t GPSHandler::interpretDeviceReply(DeviceCommandId_t id, +ReturnValue_t GPSHyperionHandler::interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) { return HasReturnvaluesIF::RETURN_OK; } -uint32_t GPSHandler::getTransitionDelayMs(Mode_t from, Mode_t to) { +uint32_t GPSHyperionHandler::getTransitionDelayMs(Mode_t from, Mode_t to) { return 5000; } -ReturnValue_t GPSHandler::initializeLocalDataPool( +ReturnValue_t GPSHyperionHandler::initializeLocalDataPool( localpool::DataPool &localDataPoolMap, LocalDataPoolManager &poolManager) { return HasReturnvaluesIF::RETURN_OK; } -void GPSHandler::fillCommandAndReplyMap() { +void GPSHyperionHandler::fillCommandAndReplyMap() { // Reply length does not matter, packets should always arrive periodically insertInReplyMap(GpsHyperion::GPS_REPLY, 4, nullptr, 0, true); } -void GPSHandler::modeChanged() { +void GPSHyperionHandler::modeChanged() { internalState = InternalStates::NONE; } diff --git a/mission/devices/GPSHandler.h b/mission/devices/GPSHyperionHandler.h similarity index 72% rename from mission/devices/GPSHandler.h rename to mission/devices/GPSHyperionHandler.h index 298871e4..5685ac86 100644 --- a/mission/devices/GPSHandler.h +++ b/mission/devices/GPSHyperionHandler.h @@ -1,20 +1,25 @@ -#ifndef MISSION_DEVICES_GPSHANDLER_H_ -#define MISSION_DEVICES_GPSHANDLER_H_ +#ifndef MISSION_DEVICES_GPSHYPERIONHANDLER_H_ +#define MISSION_DEVICES_GPSHYPERIONHANDLER_H_ -#include +#include "fsfw/devicehandlers/DeviceHandlerBase.h" +#include "devicedefinitions/GPSDefinitions.h" #include "lwgps/lwgps.h" +#ifndef FSFW_HAL_DEBUG_HYPERION_GPS +#define FSFW_HAL_DEBUG_HYPERION_GPS 0 +#endif + /** * @brief Device handler for the Hyperion HT-GPS200 device * @details * Flight manual: * https://egit.irs.uni-stuttgart.de/redmine/projects/eive-flight-manual/wiki/Hyperion_HT-GPS200 */ -class GPSHandler: public DeviceHandlerBase { +class GPSHyperionHandler: public DeviceHandlerBase { public: - GPSHandler(object_id_t objectId, object_id_t deviceCommunication, + GPSHyperionHandler(object_id_t objectId, object_id_t deviceCommunication, CookieIF* comCookie); - virtual ~GPSHandler(); + virtual ~GPSHyperionHandler(); protected: enum class InternalStates { @@ -48,6 +53,7 @@ protected: private: lwgps_t gpsData = {}; + GpsPrimaryDataset gpsSet; }; -#endif /* MISSION_DEVICES_GPSHANDLER_H_ */ +#endif /* MISSION_DEVICES_GPSHYPERIONHANDLER_H_ */ diff --git a/mission/devices/devicedefinitions/GPSDefinitions.h b/mission/devices/devicedefinitions/GPSDefinitions.h index cb3cfd1a..72433f66 100644 --- a/mission/devices/devicedefinitions/GPSDefinitions.h +++ b/mission/devices/devicedefinitions/GPSDefinitions.h @@ -1,21 +1,41 @@ #ifndef MISSION_DEVICES_DEVICEDEFINITIONS_GPSDEFINITIONS_H_ #define MISSION_DEVICES_DEVICEDEFINITIONS_GPSDEFINITIONS_H_ -#include +#include "fsfw/devicehandlers/DeviceHandlerIF.h" +#include "fsfw/datapoollocal/StaticLocalDataSet.h" namespace GpsHyperion { static constexpr DeviceCommandId_t GPS_REPLY = 0; -enum GpsPoolIds: lp_id_t { +static constexpr uint32_t DATASET_ID = 0; +enum GpsPoolIds: lp_id_t { + LATITUDE = 0, + LONGITUDE = 1, + ALTITUDE = 2, + FIX_MODE = 3, }; } class GpsPrimaryDataset: public StaticLocalDataSet<5> { public: + GpsPrimaryDataset(object_id_t gpsId): + StaticLocalDataSet(sid_t(gpsId, GpsHyperion::DATASET_ID)) { + setAllVariablesReadOnly(); + } + + lp_var_t latitude = lp_var_t(sid.objectId, + GpsHyperion::LATITUDE, this); + lp_var_t longitude = lp_var_t(sid.objectId, + GpsHyperion::LONGITUDE, this); + lp_var_t altitude = lp_var_t(sid.objectId, GpsHyperion::ALTITUDE, this); + lp_var_t fixMode = lp_var_t(sid.objectId, GpsHyperion::FIX_MODE, this); private: + friend class GPSHyperionHandler; + GpsPrimaryDataset(HasLocalDataPoolIF* hkOwner): + StaticLocalDataSet(hkOwner, GpsHyperion::DATASET_ID) {} }; #endif /* MISSION_DEVICES_DEVICEDEFINITIONS_GPSDEFINITIONS_H_ */ From 0d12a925693d64fe1afde09f137001ac771341ab Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 24 Jun 2021 13:55:51 +0200 Subject: [PATCH 06/17] gps contd --- mission/devices/GPSHyperionHandler.cpp | 32 +++++++++++++++++++ .../devicedefinitions/GPSDefinitions.h | 26 ++++++++++++++- 2 files changed, 57 insertions(+), 1 deletion(-) diff --git a/mission/devices/GPSHyperionHandler.cpp b/mission/devices/GPSHyperionHandler.cpp index 248b7193..1f68881c 100644 --- a/mission/devices/GPSHyperionHandler.cpp +++ b/mission/devices/GPSHyperionHandler.cpp @@ -2,6 +2,7 @@ #include "devicedefinitions/GPSDefinitions.h" #include "fsfw/datapool/PoolReadGuard.h" +#include "fsfw/timemanager/Clock.h" #include "lwgps/lwgps.h" @@ -77,9 +78,28 @@ ReturnValue_t GPSHyperionHandler::scanForReply(const uint8_t *start, size_t len, // Set all entries valid now, set invalid on case basis if values are sanitized gpsSet.setValidity(true, true); } + // Negative latitude -> South direction gpsSet.latitude.value = gpsData.latitude; + // Negative longitude -> West direction gpsSet.longitude.value = gpsData.latitude; gpsSet.fixMode.value = gpsData.fix_mode; + gpsSet.satInUse.value = gpsData.sats_in_use; + Clock::TimeOfDay_t timeStruct = {}; + timeStruct.day = gpsData.date; + timeStruct.hour = gpsData.hours; + timeStruct.minute = gpsData.minutes; + timeStruct.month = gpsData.month; + timeStruct.second = gpsData.seconds; + // Convert two-digit year to full year (AD) + timeStruct.year = gpsData.year + 2000; + timeval timeval = {}; + Clock::convertTimeOfDayToTimeval(&timeStruct, &timeval); + gpsSet.year = timeStruct.year; + gpsSet.month = gpsData.month; + gpsSet.day = gpsData.date; + gpsSet.hours = gpsData.hours; + gpsSet.minutes = gpsData.minutes; + gpsSet.seconds = gpsData.seconds; #if FSFW_HAL_DEBUG_HYPERION_GPS == 1 sif::info << "GPS Data" << std::endl; printf("Valid status: %d\n", gpsData.is_valid); @@ -105,6 +125,18 @@ uint32_t GPSHyperionHandler::getTransitionDelayMs(Mode_t from, Mode_t to) { ReturnValue_t GPSHyperionHandler::initializeLocalDataPool( localpool::DataPool &localDataPoolMap, LocalDataPoolManager &poolManager) { + localDataPoolMap.emplace(GpsHyperion::ALTITUDE, new PoolEntry({0.0})); + localDataPoolMap.emplace(GpsHyperion::LONGITUDE, new PoolEntry({0.0})); + localDataPoolMap.emplace(GpsHyperion::LATITUDE, new PoolEntry({0.0})); + localDataPoolMap.emplace(GpsHyperion::YEAR, new PoolEntry()); + localDataPoolMap.emplace(GpsHyperion::MONTH, new PoolEntry()); + localDataPoolMap.emplace(GpsHyperion::DAY, new PoolEntry()); + localDataPoolMap.emplace(GpsHyperion::HOURS, new PoolEntry()); + localDataPoolMap.emplace(GpsHyperion::MINUTES, new PoolEntry()); + localDataPoolMap.emplace(GpsHyperion::SECONDS, new PoolEntry()); + localDataPoolMap.emplace(GpsHyperion::UNIX_SECONDS, new PoolEntry()); + localDataPoolMap.emplace(GpsHyperion::SATS_IN_USE, new PoolEntry()); + localDataPoolMap.emplace(GpsHyperion::FIX_MODE, new PoolEntry()); return HasReturnvaluesIF::RETURN_OK; } diff --git a/mission/devices/devicedefinitions/GPSDefinitions.h b/mission/devices/devicedefinitions/GPSDefinitions.h index 72433f66..8f147651 100644 --- a/mission/devices/devicedefinitions/GPSDefinitions.h +++ b/mission/devices/devicedefinitions/GPSDefinitions.h @@ -15,11 +15,26 @@ enum GpsPoolIds: lp_id_t { LONGITUDE = 1, ALTITUDE = 2, FIX_MODE = 3, + SATS_IN_USE = 4, + UNIX_SECONDS = 5, + YEAR = 6, + MONTH = 7, + DAY = 8, + HOURS = 9, + MINUTES = 10, + SECONDS = 11 +}; + +enum GpsFixModes: uint8_t { + INVALID = 0, + NO_FIX = 1, + FIX_2D = 2, + FIX_3D = 3 }; } -class GpsPrimaryDataset: public StaticLocalDataSet<5> { +class GpsPrimaryDataset: public StaticLocalDataSet<18> { public: GpsPrimaryDataset(object_id_t gpsId): StaticLocalDataSet(sid_t(gpsId, GpsHyperion::DATASET_ID)) { @@ -32,6 +47,15 @@ public: GpsHyperion::LONGITUDE, this); lp_var_t altitude = lp_var_t(sid.objectId, GpsHyperion::ALTITUDE, this); lp_var_t fixMode = lp_var_t(sid.objectId, GpsHyperion::FIX_MODE, this); + lp_var_t satInUse = lp_var_t(sid.objectId, GpsHyperion::SATS_IN_USE, this); + lp_var_t year = lp_var_t(sid.objectId, GpsHyperion::YEAR, this); + lp_var_t month = lp_var_t(sid.objectId, GpsHyperion::MONTH, this); + lp_var_t day = lp_var_t(sid.objectId, GpsHyperion::DAY, this); + lp_var_t hours = lp_var_t(sid.objectId, GpsHyperion::HOURS, this); + lp_var_t minutes = lp_var_t(sid.objectId, GpsHyperion::MINUTES, this); + lp_var_t seconds = lp_var_t(sid.objectId, GpsHyperion::SECONDS, this); + lp_var_t unixSeconds = lp_var_t(sid.objectId, + GpsHyperion::UNIX_SECONDS, this); private: friend class GPSHyperionHandler; GpsPrimaryDataset(HasLocalDataPoolIF* hkOwner): From 136c859c90f9aa878776c8ba9584f1659a8de524 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 24 Jun 2021 14:17:24 +0200 Subject: [PATCH 07/17] lis3 minor form changes --- mission/devices/MGMHandlerLIS3MDL.cpp | 6 ++++-- mission/devices/MGMHandlerLIS3MDL.h | 8 ++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/mission/devices/MGMHandlerLIS3MDL.cpp b/mission/devices/MGMHandlerLIS3MDL.cpp index 15f6e325..63bf607c 100644 --- a/mission/devices/MGMHandlerLIS3MDL.cpp +++ b/mission/devices/MGMHandlerLIS3MDL.cpp @@ -1,7 +1,9 @@ -#include #include "MGMHandlerLIS3MDL.h" -#include +#include "fsfw/datapool/PoolReadGuard.h" +#if OBSW_VERBOSE_LEVEL >= 1 +#include "fsfw/globalfunctions/PeriodicOperationDivider.h" +#endif MGMHandlerLIS3MDL::MGMHandlerLIS3MDL(object_id_t objectId, object_id_t deviceCommunication, CookieIF* comCookie): diff --git a/mission/devices/MGMHandlerLIS3MDL.h b/mission/devices/MGMHandlerLIS3MDL.h index 3cc08a6b..bb64e63a 100644 --- a/mission/devices/MGMHandlerLIS3MDL.h +++ b/mission/devices/MGMHandlerLIS3MDL.h @@ -1,13 +1,13 @@ #ifndef MISSION_DEVICES_MGMLIS3MDLHANDLER_H_ #define MISSION_DEVICES_MGMLIS3MDLHANDLER_H_ +#include "OBSWConfig.h" #include "devicedefinitions/MGMHandlerLIS3Definitions.h" +#include "events/subsystemIdRanges.h" -#include -#include +#include "fsfw/devicehandlers/DeviceHandlerBase.h" -#include -#include +class PeriodicOperationDivider; /** * @brief Device handler object for the LIS3MDL 3-axis magnetometer From bc087e2a7a1506e049277f09b0218d3cf5c0b4db Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 24 Jun 2021 14:19:25 +0200 Subject: [PATCH 08/17] removed unused code --- mission/devices/MGMHandlerLIS3MDL.cpp | 7 ++----- mission/devices/MGMHandlerLIS3MDL.h | 3 --- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/mission/devices/MGMHandlerLIS3MDL.cpp b/mission/devices/MGMHandlerLIS3MDL.cpp index 63bf607c..85cb3407 100644 --- a/mission/devices/MGMHandlerLIS3MDL.cpp +++ b/mission/devices/MGMHandlerLIS3MDL.cpp @@ -302,9 +302,9 @@ ReturnValue_t MGMHandlerLIS3MDL::interpretDeviceReply(DeviceCommandId_t id, sif::printInfo("X: %f " "\xC2\xB5" "T\n", mgmX); sif::printInfo("Y: %f " "\xC2\xB5" "T\n", mgmY); sif::printInfo("Z: %f " "\xC2\xB5" "T\n", mgmZ); -#endif +#endif /* FSFW_CPP_OSTREAM_ENABLED == 0 */ } -#endif +#endif /* OBSW_VERBOSE_LEVEL >= 1 */ PoolReadGuard readHelper(&dataset); if(readHelper.getReadResult() == HasReturnvaluesIF::RETURN_OK) { dataset.fieldStrengthX = mgmX; @@ -484,6 +484,3 @@ ReturnValue_t MGMHandlerLIS3MDL::initializeLocalDataPool( new PoolEntry({0.0})); return HasReturnvaluesIF::RETURN_OK; } - -void MGMHandlerLIS3MDL::performOperationHook() { -} diff --git a/mission/devices/MGMHandlerLIS3MDL.h b/mission/devices/MGMHandlerLIS3MDL.h index bb64e63a..5d8364ee 100644 --- a/mission/devices/MGMHandlerLIS3MDL.h +++ b/mission/devices/MGMHandlerLIS3MDL.h @@ -162,9 +162,6 @@ private: #if OBSW_VERBOSE_LEVEL >= 1 PeriodicOperationDivider* debugDivider; #endif - - void performOperationHook() override; - }; #endif /* MISSION_DEVICES_MGMLIS3MDLHANDLER_H_ */ From ed0aafa5437c036ec059476e9e8f25f0143debad Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 24 Jun 2021 16:17:38 +0200 Subject: [PATCH 09/17] updated object IDs --- common/config/commonObjects.h | 48 ++++---- linux/fsfwconfig/objects/systemObjectList.h | 128 +++++++++++--------- 2 files changed, 97 insertions(+), 79 deletions(-) diff --git a/common/config/commonObjects.h b/common/config/commonObjects.h index 1651f6a0..b153065e 100644 --- a/common/config/commonObjects.h +++ b/common/config/commonObjects.h @@ -6,34 +6,34 @@ namespace objects { enum commonObjects: uint32_t { /* First Byte 0x50-0x52 reserved for PUS Services **/ - CCSDS_PACKET_DISTRIBUTOR = 0x50000100, - PUS_PACKET_DISTRIBUTOR = 0x50000200, - UDP_BRIDGE = 0x50000300, - UDP_POLLING_TASK = 0x50000400, + CCSDS_PACKET_DISTRIBUTOR = 0x50000100, + PUS_PACKET_DISTRIBUTOR = 0x50000200, + UDP_BRIDGE = 0x50000300, + UDP_POLLING_TASK = 0x50000400, /* 0x43 ('C') for Controllers */ - THERMAL_CONTROLLER = 0x43001000, - ATTITUDE_CONTROLLER = 0x43002000, - ACS_CONTROLLER = 0x43003000, - CORE_CONTROLLER = 0x43004000, + THERMAL_CONTROLLER = 0x43400001, + ACS_CONTROLLER = 0x43100002, + CORE_CONTROLLER = 0x43000003, - /* 0x44 ('D') for device handlers */ - P60DOCK_HANDLER = 0x44000001, - PDU1_HANDLER = 0x44000002, - PDU2_HANDLER = 0x44000003, - ACU_HANDLER = 0x44000004, - TMP1075_HANDLER_1 = 0x44000005, - TMP1075_HANDLER_2 = 0x44000006, - MGM_0_LIS3_HANDLER = 0x44000007, - MGM_1_RM3100_HANDLER = 0x44000008, - MGM_2_LIS3_HANDLER = 0x44000009, - MGM_3_RM3100_HANDLER = 0x44000010, - GYRO_0_ADIS_HANDLER = 0x44000011, - GYRO_1_L3G_HANDLER = 0x44000012, - GYRO_2_L3G_HANDLER = 0x44000013, + /* 0x44 ('D') for device handlers */ + P60DOCK_HANDLER = 0x44200001, + PDU1_HANDLER = 0x44200002, + PDU2_HANDLER = 0x44200003, + ACU_HANDLER = 0x44200004, + TMP1075_HANDLER_1 = 0x44400005, + TMP1075_HANDLER_2 = 0x44400006, + MGM_0_LIS3_HANDLER = 0x44100007, + MGM_1_RM3100_HANDLER = 0x44100008, + MGM_2_LIS3_HANDLER = 0x44100009, + MGM_3_RM3100_HANDLER = 0x44100010, + GYRO_0_ADIS_HANDLER = 0x44100011, + GYRO_1_L3G_HANDLER = 0x44100012, + GYRO_2_ADIS_HANDLER = 0x44100013, + GYRO_3_L3G_HANDLER = 0x44100014, - IMTQ_HANDLER = 0x44000014, - PLOC_HANDLER = 0x44000015, + IMTQ_HANDLER = 0x44100014, + PLOC_HANDLER = 0x44300015, SUS_1 = 0x44000016, SUS_2 = 0x44000017, diff --git a/linux/fsfwconfig/objects/systemObjectList.h b/linux/fsfwconfig/objects/systemObjectList.h index 5d5cdee1..a1c644da 100644 --- a/linux/fsfwconfig/objects/systemObjectList.h +++ b/linux/fsfwconfig/objects/systemObjectList.h @@ -6,67 +6,85 @@ #include // The objects will be instantiated in the ID order +// For naming scheme see flight manual +/* +https://egit.irs.uni-stuttgart.de/redmine/projects/eive-flight-manual/wiki/EIVE_Project_IDs + +Second byte first four bits is the subsystem: +OBDH 0x0 +ACS 0x1 +EPS 0x2 +PL 0x3 +TCS 0x4 +COM 0x5 + +Second byte last four bits is the bus: +None 0x0 +GPIO 0x1 +SPI 0x2 +UART 0x3 +I2C 0x4 +CAN 0x5 + +Third byte is an assembly counter if there are multiple redundant devices. +Fourth byte is a unique counter. + + */ namespace objects { - enum sourceObjects: uint32_t { - /* 0x53 reserved for FSFW */ - FW_ADDRESS_START = PUS_SERVICE_1_VERIFICATION, - FW_ADDRESS_END = TIME_STAMPER, +enum sourceObjects: uint32_t { + /* 0x53 reserved for FSFW */ + FW_ADDRESS_START = PUS_SERVICE_1_VERIFICATION, + FW_ADDRESS_END = TIME_STAMPER, + PUS_SERVICE_6 = 0x51000500, - CCSDS_IP_CORE_BRIDGE = 0x50000500, + CCSDS_IP_CORE_BRIDGE = 0x73500000, + TM_FUNNEL = 0x73000100, - PUS_SERVICE_6 = 0x51000500, + /* 0x49 ('I') for Communication Interfaces **/ + ARDUINO_COM_IF = 0x49000000, + CSP_COM_IF = 0x49050001, + I2C_COM_IF = 0x49040002, + UART_COM_IF = 0x49030003, + SPI_COM_IF = 0x49020004, + GPIO_IF = 0x49010005, - TM_FUNNEL = 0x52000002, + /* Custom device handler */ + PCDU_HANDLER = 0x44200032, + SOLAR_ARRAY_DEPL_HANDLER = 0x44410033, + SYRLINKS_HK_HANDLER = 0x44530034, + HEATER_HANDLER = 0x44410035, + /** + * Not yet specified which pt1000 will measure which device/location in the satellite. + * Therefore object ids are named according to the IC naming of the RTDs in the schematic. + */ + RTD_IC3 = 0x44420036, + RTD_IC4 = 0x44420037, + RTD_IC5 = 0x44420038, + RTD_IC6 = 0x44420039, + RTD_IC7 = 0x44420040, + RTD_IC8 = 0x44420041, + RTD_IC9 = 0x44420042, + RTD_IC10 = 0x44420043, + RTD_IC11 = 0x44420044, + RTD_IC12 = 0x44420045, + RTD_IC13 = 0x44420046, + RTD_IC14 = 0x44420047, + RTD_IC15 = 0x44420048, + RTD_IC16 = 0x44420049, + RTD_IC17 = 0x44420050, + RTD_IC18 = 0x44420051, - /* 0x49 ('I') for Communication Interfaces **/ - ARDUINO_COM_IF = 0x49000001, - CSP_COM_IF = 0x49000002, - I2C_COM_IF = 0x49000003, - UART_COM_IF = 0x49000004, - SPI_COM_IF = 0x49000005, + RAD_SENSOR = 0x44300052, - /* 0x47 ('G') for Gpio Interfaces */ - GPIO_IF = 0x47000001, - - /* Custom device handler */ - PCDU_HANDLER = 0x44001000, - SOLAR_ARRAY_DEPL_HANDLER = 0x44001001, - SYRLINKS_HK_HANDLER = 0x44001002, - - /* 0x54 ('T') for thermal objects */ - HEATER_HANDLER = 0x54000003, - /** - * Not yet specified which pt1000 will measure which device/location in the satellite. - * Therefore object ids are named according to the IC naming of the RTDs in the schematic. - */ - RTD_IC3 = 0x54000004, - RTD_IC4 = 0x54000005, - RTD_IC5 = 0x54000006, - RTD_IC6 = 0x54000007, - RTD_IC7 = 0x54000008, - RTD_IC8 = 0x54000009, - RTD_IC9 = 0x5400000A, - RTD_IC10 = 0x5400000B, - RTD_IC11 = 0x5400000C, - RTD_IC12 = 0x5400000D, - RTD_IC13 = 0x5400000E, - RTD_IC14 = 0x5400000F, - RTD_IC15 = 0x5400001F, - RTD_IC16 = 0x5400002F, - RTD_IC17 = 0x5400003F, - RTD_IC18 = 0x5400004F, - - RAD_SENSOR = 0x54000050, - - /* 0x54 ('T') for test handlers */ - TEST_TASK = 0x54694269, - LIBGPIOD_TEST = 0x54123456, - SPI_TEST = 0x54000010, - UART_TEST = 0x54000020, - DUMMY_INTERFACE = 0x5400CAFE, - DUMMY_HANDLER = 0x5400AFFE, - P60DOCK_TEST_TASK = 0x00005060 - }; + /* 0x54 ('T') for test handlers */ + TEST_TASK = 0x54694269, + LIBGPIOD_TEST = 0x54123456, + SPI_TEST = 0x54000010, + UART_TEST = 0x54000020, + DUMMY_INTERFACE = 0x5400CAFE, + DUMMY_HANDLER = 0x5400AFFE, + P60DOCK_TEST_TASK = 0x00005060 +}; } #endif /* BSP_CONFIG_OBJECTS_SYSTEMOBJECTLIST_H_ */ From ff8fd518baa095598a20963a46ed1797eb251751 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 24 Jun 2021 16:35:04 +0200 Subject: [PATCH 10/17] tmtc update --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index 5be05c2a..f4e5bc19 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 5be05c2a929dfc908b8de61250e4db890b010fa5 +Subproject commit f4e5bc19568fc9786a3e5ac0a9164dbfe1dcbbe3 From fe65099b584e10da9d076a642d4f6d2b46ba18d0 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 24 Jun 2021 16:36:42 +0200 Subject: [PATCH 11/17] added bus descriptors --- common/config/commonObjects.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/common/config/commonObjects.h b/common/config/commonObjects.h index b153065e..a813fc11 100644 --- a/common/config/commonObjects.h +++ b/common/config/commonObjects.h @@ -23,17 +23,17 @@ enum commonObjects: uint32_t { ACU_HANDLER = 0x44200004, TMP1075_HANDLER_1 = 0x44400005, TMP1075_HANDLER_2 = 0x44400006, - MGM_0_LIS3_HANDLER = 0x44100007, - MGM_1_RM3100_HANDLER = 0x44100008, - MGM_2_LIS3_HANDLER = 0x44100009, - MGM_3_RM3100_HANDLER = 0x44100010, - GYRO_0_ADIS_HANDLER = 0x44100011, - GYRO_1_L3G_HANDLER = 0x44100012, - GYRO_2_ADIS_HANDLER = 0x44100013, - GYRO_3_L3G_HANDLER = 0x44100014, + MGM_0_LIS3_HANDLER = 0x44120007, + MGM_1_RM3100_HANDLER = 0x44120008, + MGM_2_LIS3_HANDLER = 0x44120009, + MGM_3_RM3100_HANDLER = 0x44120010, + GYRO_0_ADIS_HANDLER = 0x44120011, + GYRO_1_L3G_HANDLER = 0x44120012, + GYRO_2_ADIS_HANDLER = 0x44120013, + GYRO_3_L3G_HANDLER = 0x44120014, - IMTQ_HANDLER = 0x44100014, - PLOC_HANDLER = 0x44300015, + IMTQ_HANDLER = 0x44140014, + PLOC_HANDLER = 0x44330015, SUS_1 = 0x44000016, SUS_2 = 0x44000017, From 32c23ae2de81e88379ed031d50bf59d7545c7147 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 24 Jun 2021 16:39:46 +0200 Subject: [PATCH 12/17] update dev handler IDs --- common/config/commonObjects.h | 50 ++++++++++----------- linux/fsfwconfig/objects/systemObjectList.h | 42 ++++++++--------- 2 files changed, 46 insertions(+), 46 deletions(-) diff --git a/common/config/commonObjects.h b/common/config/commonObjects.h index a813fc11..24d7cc27 100644 --- a/common/config/commonObjects.h +++ b/common/config/commonObjects.h @@ -17,20 +17,20 @@ enum commonObjects: uint32_t { CORE_CONTROLLER = 0x43000003, /* 0x44 ('D') for device handlers */ - P60DOCK_HANDLER = 0x44200001, - PDU1_HANDLER = 0x44200002, - PDU2_HANDLER = 0x44200003, - ACU_HANDLER = 0x44200004, - TMP1075_HANDLER_1 = 0x44400005, - TMP1075_HANDLER_2 = 0x44400006, - MGM_0_LIS3_HANDLER = 0x44120007, - MGM_1_RM3100_HANDLER = 0x44120008, - MGM_2_LIS3_HANDLER = 0x44120009, - MGM_3_RM3100_HANDLER = 0x44120010, - GYRO_0_ADIS_HANDLER = 0x44120011, - GYRO_1_L3G_HANDLER = 0x44120012, - GYRO_2_ADIS_HANDLER = 0x44120013, - GYRO_3_L3G_HANDLER = 0x44120014, + P60DOCK_HANDLER = 0x44200000, + PDU1_HANDLER = 0x44200001, + PDU2_HANDLER = 0x44200002, + ACU_HANDLER = 0x44200003, + TMP1075_HANDLER_1 = 0x44400004, + TMP1075_HANDLER_2 = 0x44400005, + MGM_0_LIS3_HANDLER = 0x44120006, + MGM_1_RM3100_HANDLER = 0x44120007, + MGM_2_LIS3_HANDLER = 0x44120008, + MGM_3_RM3100_HANDLER = 0x44120009, + GYRO_0_ADIS_HANDLER = 0x44120010, + GYRO_1_L3G_HANDLER = 0x44120011, + GYRO_2_ADIS_HANDLER = 0x44120012, + GYRO_3_L3G_HANDLER = 0x44120013, IMTQ_HANDLER = 0x44140014, PLOC_HANDLER = 0x44330015, @@ -39,18 +39,18 @@ enum commonObjects: uint32_t { SUS_2 = 0x44000017, SUS_3 = 0x44000018, SUS_4 = 0x44000019, - SUS_5 = 0x4400001A, - SUS_6 = 0x4400001B, - SUS_7 = 0x4400001C, - SUS_8 = 0x4400001D, - SUS_9 = 0x4400001E, - SUS_10 = 0x4400001F, - SUS_11 = 0x44000021, - SUS_12 = 0x44000022, - SUS_13 = 0x44000023, + SUS_5 = 0x44000020, + SUS_6 = 0x44000021, + SUS_7 = 0x44000022, + SUS_8 = 0x44000023, + SUS_9 = 0x44000024, + SUS_10 = 0x44000025, + SUS_11 = 0x44000026, + SUS_12 = 0x44000027, + SUS_13 = 0x44000028, - GPS0_HANDLER = 0x44001000, - GPS1_HANDLER = 0x44002000 + GPS0_HANDLER = 0x44130029, + GPS1_HANDLER = 0x44130130 }; } diff --git a/linux/fsfwconfig/objects/systemObjectList.h b/linux/fsfwconfig/objects/systemObjectList.h index a1c644da..05fbc997 100644 --- a/linux/fsfwconfig/objects/systemObjectList.h +++ b/linux/fsfwconfig/objects/systemObjectList.h @@ -49,32 +49,32 @@ enum sourceObjects: uint32_t { GPIO_IF = 0x49010005, /* Custom device handler */ - PCDU_HANDLER = 0x44200032, - SOLAR_ARRAY_DEPL_HANDLER = 0x44410033, - SYRLINKS_HK_HANDLER = 0x44530034, - HEATER_HANDLER = 0x44410035, + PCDU_HANDLER = 0x44200050, + SOLAR_ARRAY_DEPL_HANDLER = 0x44410051, + SYRLINKS_HK_HANDLER = 0x44530052, + HEATER_HANDLER = 0x44410053, /** * Not yet specified which pt1000 will measure which device/location in the satellite. * Therefore object ids are named according to the IC naming of the RTDs in the schematic. */ - RTD_IC3 = 0x44420036, - RTD_IC4 = 0x44420037, - RTD_IC5 = 0x44420038, - RTD_IC6 = 0x44420039, - RTD_IC7 = 0x44420040, - RTD_IC8 = 0x44420041, - RTD_IC9 = 0x44420042, - RTD_IC10 = 0x44420043, - RTD_IC11 = 0x44420044, - RTD_IC12 = 0x44420045, - RTD_IC13 = 0x44420046, - RTD_IC14 = 0x44420047, - RTD_IC15 = 0x44420048, - RTD_IC16 = 0x44420049, - RTD_IC17 = 0x44420050, - RTD_IC18 = 0x44420051, + RTD_IC3 = 0x44420054, + RTD_IC4 = 0x44420056, + RTD_IC5 = 0x44420057, + RTD_IC6 = 0x44420058, + RTD_IC7 = 0x44420059, + RTD_IC8 = 0x44420060, + RTD_IC9 = 0x44420061, + RTD_IC10 = 0x44420062, + RTD_IC11 = 0x44420063, + RTD_IC12 = 0x44420064, + RTD_IC13 = 0x44420065, + RTD_IC14 = 0x44420066, + RTD_IC15 = 0x44420067, + RTD_IC16 = 0x44420068, + RTD_IC17 = 0x44420069, + RTD_IC18 = 0x44420070, - RAD_SENSOR = 0x44300052, + RAD_SENSOR = 0x44300071, /* 0x54 ('T') for test handlers */ TEST_TASK = 0x54694269, From cd395aa9c444d10846bc1ef5b263a7e09278e7d8 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 24 Jun 2021 16:43:15 +0200 Subject: [PATCH 13/17] updated object IDs again --- common/config/commonObjects.h | 12 ++++++------ tmtc | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/common/config/commonObjects.h b/common/config/commonObjects.h index 24d7cc27..a8d8fc4f 100644 --- a/common/config/commonObjects.h +++ b/common/config/commonObjects.h @@ -17,12 +17,12 @@ enum commonObjects: uint32_t { CORE_CONTROLLER = 0x43000003, /* 0x44 ('D') for device handlers */ - P60DOCK_HANDLER = 0x44200000, - PDU1_HANDLER = 0x44200001, - PDU2_HANDLER = 0x44200002, - ACU_HANDLER = 0x44200003, - TMP1075_HANDLER_1 = 0x44400004, - TMP1075_HANDLER_2 = 0x44400005, + P60DOCK_HANDLER = 0x44250000, + PDU1_HANDLER = 0x44250001, + PDU2_HANDLER = 0x44250002, + ACU_HANDLER = 0x44250003, + TMP1075_HANDLER_1 = 0x44420004, + TMP1075_HANDLER_2 = 0x44420005, MGM_0_LIS3_HANDLER = 0x44120006, MGM_1_RM3100_HANDLER = 0x44120007, MGM_2_LIS3_HANDLER = 0x44120008, diff --git a/tmtc b/tmtc index f4e5bc19..8a66b2a7 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit f4e5bc19568fc9786a3e5ac0a9164dbfe1dcbbe3 +Subproject commit 8a66b2a721882acf342d1e25c9967db3651a919f From a167b53096098ce63c23a623bacd33a3586c0560 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 24 Jun 2021 16:49:36 +0200 Subject: [PATCH 14/17] moved some object ids --- common/config/commonObjects.h | 51 +++++++++++++++------ linux/fsfwconfig/objects/systemObjectList.h | 31 ++----------- tmtc | 2 +- 3 files changed, 42 insertions(+), 42 deletions(-) diff --git a/common/config/commonObjects.h b/common/config/commonObjects.h index a8d8fc4f..205c025f 100644 --- a/common/config/commonObjects.h +++ b/common/config/commonObjects.h @@ -35,22 +35,43 @@ enum commonObjects: uint32_t { IMTQ_HANDLER = 0x44140014, PLOC_HANDLER = 0x44330015, - SUS_1 = 0x44000016, - SUS_2 = 0x44000017, - SUS_3 = 0x44000018, - SUS_4 = 0x44000019, - SUS_5 = 0x44000020, - SUS_6 = 0x44000021, - SUS_7 = 0x44000022, - SUS_8 = 0x44000023, - SUS_9 = 0x44000024, - SUS_10 = 0x44000025, - SUS_11 = 0x44000026, - SUS_12 = 0x44000027, - SUS_13 = 0x44000028, + /** + * Not yet specified which pt1000 will measure which device/location in the satellite. + * Therefore object ids are named according to the IC naming of the RTDs in the schematic. + */ + RTD_IC3 = 0x44420016, + RTD_IC4 = 0x44420017, + RTD_IC5 = 0x44420018, + RTD_IC6 = 0x44420019, + RTD_IC7 = 0x44420020, + RTD_IC8 = 0x44420021, + RTD_IC9 = 0x44420022, + RTD_IC10 = 0x44420023, + RTD_IC11 = 0x44420024, + RTD_IC12 = 0x44420025, + RTD_IC13 = 0x44420026, + RTD_IC14 = 0x44420027, + RTD_IC15 = 0x44420028, + RTD_IC16 = 0x44420029, + RTD_IC17 = 0x44420030, + RTD_IC18 = 0x44420031, - GPS0_HANDLER = 0x44130029, - GPS1_HANDLER = 0x44130130 + SUS_1 = 0x44120032, + SUS_2 = 0x44120033, + SUS_3 = 0x44120034, + SUS_4 = 0x44120035, + SUS_5 = 0x44120036, + SUS_6 = 0x44120037, + SUS_7 = 0x44120038, + SUS_8 = 0x44120039, + SUS_9 = 0x44120040, + SUS_10 = 0x44120041, + SUS_11 = 0x44120042, + SUS_12 = 0x44120043, + SUS_13 = 0x44120044, + + GPS0_HANDLER = 0x44130045, + GPS1_HANDLER = 0x44130146 }; } diff --git a/linux/fsfwconfig/objects/systemObjectList.h b/linux/fsfwconfig/objects/systemObjectList.h index 05fbc997..eb5333c2 100644 --- a/linux/fsfwconfig/objects/systemObjectList.h +++ b/linux/fsfwconfig/objects/systemObjectList.h @@ -49,32 +49,11 @@ enum sourceObjects: uint32_t { GPIO_IF = 0x49010005, /* Custom device handler */ - PCDU_HANDLER = 0x44200050, - SOLAR_ARRAY_DEPL_HANDLER = 0x44410051, - SYRLINKS_HK_HANDLER = 0x44530052, - HEATER_HANDLER = 0x44410053, - /** - * Not yet specified which pt1000 will measure which device/location in the satellite. - * Therefore object ids are named according to the IC naming of the RTDs in the schematic. - */ - RTD_IC3 = 0x44420054, - RTD_IC4 = 0x44420056, - RTD_IC5 = 0x44420057, - RTD_IC6 = 0x44420058, - RTD_IC7 = 0x44420059, - RTD_IC8 = 0x44420060, - RTD_IC9 = 0x44420061, - RTD_IC10 = 0x44420062, - RTD_IC11 = 0x44420063, - RTD_IC12 = 0x44420064, - RTD_IC13 = 0x44420065, - RTD_IC14 = 0x44420066, - RTD_IC15 = 0x44420067, - RTD_IC16 = 0x44420068, - RTD_IC17 = 0x44420069, - RTD_IC18 = 0x44420070, - - RAD_SENSOR = 0x44300071, + PCDU_HANDLER = 0x442000A1, + SOLAR_ARRAY_DEPL_HANDLER = 0x444100A2, + SYRLINKS_HK_HANDLER = 0x445300A3, + HEATER_HANDLER = 0x444100A4, + RAD_SENSOR = 0x443200A5, /* 0x54 ('T') for test handlers */ TEST_TASK = 0x54694269, diff --git a/tmtc b/tmtc index 8a66b2a7..2a986248 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 8a66b2a721882acf342d1e25c9967db3651a919f +Subproject commit 2a9862489d57e2ccbf8b9ca5017f5e89395acddf From d0dd39986c4292ba1bea6fd84400291ce43eae1b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 24 Jun 2021 16:50:36 +0200 Subject: [PATCH 15/17] logical addresses fix --- linux/fsfwconfig/devices/addresses.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/linux/fsfwconfig/devices/addresses.h b/linux/fsfwconfig/devices/addresses.h index 0deb8490..99fa00ac 100644 --- a/linux/fsfwconfig/devices/addresses.h +++ b/linux/fsfwconfig/devices/addresses.h @@ -17,7 +17,8 @@ namespace addresses { GYRO_0_ADIS = objects::GYRO_0_ADIS_HANDLER, GYRO_1_L3G = objects::GYRO_1_L3G_HANDLER, - GYRO_2_L3G = objects::GYRO_2_L3G_HANDLER, + GYRO_2_ADIS = objects::GYRO_2_ADIS_HANDLER, + GYRO_3_L3G = objects::GYRO_3_L3G_HANDLER, RAD_SENSOR = objects::RAD_SENSOR, From 675cd29df38505e60fb55df8c855b9ee77ac3e23 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 24 Jun 2021 17:52:09 +0200 Subject: [PATCH 16/17] added assembly index --- common/config/commonObjects.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/common/config/commonObjects.h b/common/config/commonObjects.h index 205c025f..93369350 100644 --- a/common/config/commonObjects.h +++ b/common/config/commonObjects.h @@ -24,13 +24,13 @@ enum commonObjects: uint32_t { TMP1075_HANDLER_1 = 0x44420004, TMP1075_HANDLER_2 = 0x44420005, MGM_0_LIS3_HANDLER = 0x44120006, - MGM_1_RM3100_HANDLER = 0x44120007, - MGM_2_LIS3_HANDLER = 0x44120008, - MGM_3_RM3100_HANDLER = 0x44120009, + MGM_1_RM3100_HANDLER = 0x44120107, + MGM_2_LIS3_HANDLER = 0x44120208, + MGM_3_RM3100_HANDLER = 0x44120309, GYRO_0_ADIS_HANDLER = 0x44120010, - GYRO_1_L3G_HANDLER = 0x44120011, - GYRO_2_ADIS_HANDLER = 0x44120012, - GYRO_3_L3G_HANDLER = 0x44120013, + GYRO_1_L3G_HANDLER = 0x44120111, + GYRO_2_ADIS_HANDLER = 0x44120212, + GYRO_3_L3G_HANDLER = 0x44120313, IMTQ_HANDLER = 0x44140014, PLOC_HANDLER = 0x44330015, From 06e719327639e27c72c599e3c6dda613bd5a2d91 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 24 Jun 2021 18:05:41 +0200 Subject: [PATCH 17/17] set id is now 0 --- mission/devices/devicedefinitions/MGMHandlerLIS3Definitions.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mission/devices/devicedefinitions/MGMHandlerLIS3Definitions.h b/mission/devices/devicedefinitions/MGMHandlerLIS3Definitions.h index f58d6f03..c15b60ef 100644 --- a/mission/devices/devicedefinitions/MGMHandlerLIS3Definitions.h +++ b/mission/devices/devicedefinitions/MGMHandlerLIS3Definitions.h @@ -20,8 +20,8 @@ static constexpr size_t MAX_BUFFER_SIZE = 16; static constexpr uint8_t GAUSS_TO_MICROTESLA_FACTOR = 100; -static const DeviceCommandId_t SETUP_MGM = 0x00; -static const DeviceCommandId_t READ_CONFIG_AND_DATA = 0x01; +static const DeviceCommandId_t READ_CONFIG_AND_DATA = 0x00; +static const DeviceCommandId_t SETUP_MGM = 0x01; static const DeviceCommandId_t READ_TEMPERATURE = 0x02; static const DeviceCommandId_t IDENTIFY_DEVICE = 0x03; static const DeviceCommandId_t TEMP_SENSOR_ENABLE = 0x04;