From 0efaa13a9f689931ed9d07b9ddf988a375a5aaa2 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 11 Aug 2021 15:53:27 +0200 Subject: [PATCH 1/9] tmtc update --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index cc6dbd8e..84656b90 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit cc6dbd8ef9d5bd028835f37a24a5617224569862 +Subproject commit 84656b90fc44ab72fb95518410fea3373d1fdf18 From 11c2efa733f5f4358326aaef981e5518e87ecc58 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 11 Aug 2021 16:07:00 +0200 Subject: [PATCH 2/9] bugfix core controller 1. Increaed robustness of CoreController against invalid state struct 2. Bugfix: If PREFSD not set, set SD card 0 properly now --- bsp_q7s/core/CoreController.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bsp_q7s/core/CoreController.cpp b/bsp_q7s/core/CoreController.cpp index b7394cb9..eca0940c 100644 --- a/bsp_q7s/core/CoreController.cpp +++ b/bsp_q7s/core/CoreController.cpp @@ -197,6 +197,10 @@ ReturnValue_t CoreController::sdStateMachine() { result = sdcMan->getSdCardActiveStatus(sdInfo.currentState); determinePreferredSdCard(); updateSdInfoOther(); + if(sdInfo.pref != sd::SdCard::SLOT_0 and sdInfo.pref != sd::SdCard::SLOT_1) { + sif::warning << "Preferred SD card invalid. Setting to card 0.." << std:endl; + sdInfo.pref = sd::SdCard::SLOT_0; + } if(result != HasReturnvaluesIF::RETURN_OK) { sif::warning << "Getting SD card activity status failed" << std::endl; } @@ -833,7 +837,8 @@ void CoreController::determinePreferredSdCard() { if(result == scratch::KEY_NOT_FOUND) { sif::warning << "CoreController::sdCardInit: " "Preferred SD card not set. Setting to 0" << std::endl; - sdcMan->setPreferredSdCard(sdInfo.pref); + sdcMan->setPreferredSdCard(sd::SdCard::SLOT_0); + sdInfo.pref = sd::SdCard::SLOT_0; } else { sif::warning << "CoreController::sdCardInit: Could not get preferred SD card" @@ -852,13 +857,16 @@ void CoreController::updateSdInfoOther() { sdInfo.other = sd::SdCard::SLOT_1; } - else { + else if(sdInfo.pref == sd::SdCard::SLOT_1) { sdInfo.prefChar = "1"; sdInfo.otherChar = "0"; sdInfo.otherState = sdInfo.currentState.first; sdInfo.prefState = sdInfo.currentState.second; sdInfo.other = sd::SdCard::SLOT_0; } + else { + sif::warning << "CoreController::updateSdInfoOther: Invalid SD card passed" << std::endl; + } } bool CoreController::sdInitFinished() const { From 0ae55e07837f461e45ae8edc741fbb89de778008 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 11 Aug 2021 18:13:43 +0200 Subject: [PATCH 3/9] no ARCSEC lib for Raspberry Pi --- CMakeLists.txt | 16 +++++++++++----- bsp_linux_board/InitMission.cpp | 8 ++++++-- bsp_linux_board/ObjectFactory.cpp | 17 +++++++++++------ bsp_linux_board/main.cpp | 1 + linux/fsfwconfig/OBSWConfig.h.in | 2 +- .../pollingsequence/pollingSequenceFactory.cpp | 7 +++++++ 6 files changed, 37 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d057de50..9f1c6d05 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -153,8 +153,6 @@ if(ADD_JSON_LIB) add_subdirectory(${LIB_JSON_PATH}) endif() - - if(NOT EIVE_BUILD_WATCHDOG) if(ADD_LINUX_FILES) add_subdirectory(${LINUX_PATH}) @@ -190,8 +188,13 @@ if((NOT BUILD_Q7S_SIMPLE_MODE) AND (NOT EIVE_BUILD_WATCHDOG)) ${LIB_FSFW_NAME} ${LIB_OS_NAME} ${LIB_LWGPS_NAME} - ${LIB_ARCSEC} ) + + if(TGT_BSP MATCHES "arm/q7s") + target_link_libraries(${TARGET_NAME} PRIVATE + ${LIB_ARCSEC} + ) + endif() endif() if(NOT EIVE_BUILD_WATCHDOG) @@ -214,8 +217,6 @@ if(ADD_JSON_LIB) ) endif() - - target_link_libraries(${TARGET_NAME} PRIVATE ${LIB_CXX_FS} ) @@ -228,6 +229,11 @@ target_include_directories(${TARGET_NAME} PRIVATE ${ARCSEC_LIB_PATH} ) +if(TGT_BSP MATCHES "arm/q7s") + target_include_directories(${TARGET_NAME} PRIVATE + ${ARCSEC_LIB_PATH} + ) +endif() if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") set(WARNING_FLAGS diff --git a/bsp_linux_board/InitMission.cpp b/bsp_linux_board/InitMission.cpp index 68423216..febae2f3 100644 --- a/bsp_linux_board/InitMission.cpp +++ b/bsp_linux_board/InitMission.cpp @@ -134,12 +134,14 @@ void initmission::initTasks() { objects::INTERNAL_ERROR_REPORTER); } + bool startTestPst = true; #if OBSW_ADD_TEST_PST == 1 FixedTimeslotTaskIF* pstTestTask = factory->createFixedTimeslotTask("ACS_PST", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 2.0, missedDeadlineFunc); result = pst::pstTest(pstTestTask); if(result != HasReturnvaluesIF::RETURN_OK) { - sif::warning << "initmission::initTasks: ACS PST initialization failed!" << std::endl; + sif::info << "initmission::initTasks: ACS PST empty or invalid" << std::endl; + startTestPst = false; } #endif /* RPI_TEST_ACS_BOARD == 1 */ @@ -186,7 +188,9 @@ void initmission::initTasks() { #endif /* OBSW_ADD_TEST_CODE == 1 */ #if OBSW_ADD_TEST_PST == 1 - pstTestTask->startTask(); + if(startTestPst) { + pstTestTask->startTask(); + } #endif /* RPI_TEST_ACS_BOARD == 1 */ sif::info << "Tasks started.." << std::endl; } diff --git a/bsp_linux_board/ObjectFactory.cpp b/bsp_linux_board/ObjectFactory.cpp index b24b633f..aefe4919 100644 --- a/bsp_linux_board/ObjectFactory.cpp +++ b/bsp_linux_board/ObjectFactory.cpp @@ -65,6 +65,16 @@ void ObjectFactory::produce(void* args){ GpioIF* gpioIF = new LinuxLibgpioIF(objects::GPIO_IF); GpioCookie* gpioCookie = nullptr; static_cast(gpioCookie); + + new SpiComIF(objects::SPI_COM_IF, gpioIF); + + std::string spiDev; + SpiCookie* spiCookie = nullptr; + static_cast(spiCookie); + +#if OBSW_ADD_TEST_CODE == 1 + new TestTask(objects::TEST_TASK); + #if RPI_ADD_SPI_TEST == 1 new SpiTestClass(objects::SPI_TEST, gpioIF); #endif @@ -89,12 +99,6 @@ void ObjectFactory::produce(void* args){ new LibgpiodTest(objects::LIBGPIOD_TEST, objects::GPIO_IF, gpioCookieLoopback); #endif /* RPI_LOOPBACK_TEST_GPIO == 1 */ - new SpiComIF(objects::SPI_COM_IF, gpioIF); - - std::string spiDev; - SpiCookie* spiCookie = nullptr; - static_cast(spiCookie); - #if RPI_TEST_ACS_BOARD == 1 if(gpioCookie == nullptr) { gpioCookie = new GpioCookie(); @@ -162,4 +166,5 @@ void ObjectFactory::produce(void* args){ gpsHandler->setStartUpImmediately(); #endif +#endif /* OBSW_ADD_TEST_CODE == 1 */ } diff --git a/bsp_linux_board/main.cpp b/bsp_linux_board/main.cpp index 2e9ce8a4..a766f2a0 100644 --- a/bsp_linux_board/main.cpp +++ b/bsp_linux_board/main.cpp @@ -1,4 +1,5 @@ #include "InitMission.h" +#include "OBSWConfig.h" #include "OBSWVersion.h" #include "fsfw/FSFWVersion.h" diff --git a/linux/fsfwconfig/OBSWConfig.h.in b/linux/fsfwconfig/OBSWConfig.h.in index 36d1e638..e2693430 100644 --- a/linux/fsfwconfig/OBSWConfig.h.in +++ b/linux/fsfwconfig/OBSWConfig.h.in @@ -6,7 +6,7 @@ #ifndef FSFWCONFIG_OBSWCONFIG_H_ #define FSFWCONFIG_OBSWCONFIG_H_ -#cmakedefine RASPBERRY_Pi +#cmakedefine RASPBERRY_PI #cmakedefine XIPHOS_Q7S #cmakedefine BEAGLEBONEBLACK diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp index a24c5393..7153ac81 100644 --- a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp @@ -606,7 +606,9 @@ ReturnValue_t pst::pstGompaceCan(FixedTimeslotTaskIF *thisSequence){ ReturnValue_t pst::pstTest(FixedTimeslotTaskIF* thisSequence) { /* Length of a communication cycle */ uint32_t length = thisSequence->getPeriodMs(); + bool notEmpty = false; #if OBSW_ADD_ACS_BOARD == 1 + notEmpty = true; thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0.2, @@ -678,6 +680,7 @@ ReturnValue_t pst::pstTest(FixedTimeslotTaskIF* thisSequence) { #endif #if RPI_TEST_ADIS16507 == 1 + notEmpty = true; thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0.2, DeviceHandlerIF::SEND_WRITE); @@ -687,6 +690,7 @@ ReturnValue_t pst::pstTest(FixedTimeslotTaskIF* thisSequence) { #endif #if RPI_TEST_GPS_HANDLER == 1 + notEmpty = true; thisSequence->addSlot(objects::GPS0_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); thisSequence->addSlot(objects::GPS0_HANDLER, length * 0, DeviceHandlerIF::SEND_READ); @@ -696,6 +700,9 @@ ReturnValue_t pst::pstTest(FixedTimeslotTaskIF* thisSequence) { thisSequence->addSlot(objects::GPS0_HANDLER, length * 0.5, DeviceHandlerIF::GET_READ); #endif static_cast(length); + if(not notEmpty) { + return HasReturnvaluesIF::RETURN_FAILED; + } if (thisSequence->checkSequence() != HasReturnvaluesIF::RETURN_OK) { sif::error << "Test PST initialization failed" << std::endl; return HasReturnvaluesIF::RETURN_FAILED; From 268cd33677ab646bc4de05d8662bc6b7e88fa3bd Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 11 Aug 2021 18:52:33 +0200 Subject: [PATCH 4/9] gps handler tweaks --- bsp_linux_board/ObjectFactory.cpp | 2 +- bsp_linux_board/boardconfig/rpiConfig.h.in | 5 +---- mission/devices/GPSHyperionHandler.cpp | 19 ++++++++++--------- mission/devices/GPSHyperionHandler.h | 7 +++---- 4 files changed, 15 insertions(+), 18 deletions(-) diff --git a/bsp_linux_board/ObjectFactory.cpp b/bsp_linux_board/ObjectFactory.cpp index aefe4919..f4a7320c 100644 --- a/bsp_linux_board/ObjectFactory.cpp +++ b/bsp_linux_board/ObjectFactory.cpp @@ -162,7 +162,7 @@ void ObjectFactory::produce(void* args){ uartCookie->setToFlushInput(true); uartCookie->setReadCycles(6); GPSHyperionHandler* gpsHandler = new GPSHyperionHandler(objects::GPS0_HANDLER, - objects::UART_COM_IF, uartCookie); + objects::UART_COM_IF, uartCookie, true); gpsHandler->setStartUpImmediately(); #endif diff --git a/bsp_linux_board/boardconfig/rpiConfig.h.in b/bsp_linux_board/boardconfig/rpiConfig.h.in index 19629465..5198ddb7 100644 --- a/bsp_linux_board/boardconfig/rpiConfig.h.in +++ b/bsp_linux_board/boardconfig/rpiConfig.h.in @@ -15,10 +15,7 @@ #define RPI_TEST_ACS_BOARD 0 #endif -#define RPI_ADD_UART_TEST 1 -#if RPI_ADD_UART_TEST == 1 -#define RPI_TEST_GPS_DEVICE 0 -#endif +#define RPI_ADD_UART_TEST 0 /* Adapt these values accordingly */ namespace gpio { diff --git a/mission/devices/GPSHyperionHandler.cpp b/mission/devices/GPSHyperionHandler.cpp index 1f68881c..3cc95db6 100644 --- a/mission/devices/GPSHyperionHandler.cpp +++ b/mission/devices/GPSHyperionHandler.cpp @@ -7,8 +7,9 @@ #include "lwgps/lwgps.h" GPSHyperionHandler::GPSHyperionHandler(object_id_t objectId, object_id_t deviceCommunication, - CookieIF *comCookie): - DeviceHandlerBase(objectId, deviceCommunication, comCookie), gpsSet(this) { + CookieIF *comCookie, bool debugHyperionGps): + DeviceHandlerBase(objectId, deviceCommunication, comCookie), gpsSet(this), + debugHyperionGps(debugHyperionGps) { lwgps_init(&gpsData); } @@ -100,13 +101,13 @@ ReturnValue_t GPSHyperionHandler::scanForReply(const uint8_t *start, size_t len, 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); - printf("Latitude: %f degrees\n", gpsData.latitude); - printf("Longitude: %f degrees\n", gpsData.longitude); - printf("Altitude: %f meters\n", gpsData.altitude); -#endif + if(debugHyperionGps) { + 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); + } } *foundLen = len; } diff --git a/mission/devices/GPSHyperionHandler.h b/mission/devices/GPSHyperionHandler.h index 5685ac86..feb99a6a 100644 --- a/mission/devices/GPSHyperionHandler.h +++ b/mission/devices/GPSHyperionHandler.h @@ -1,13 +1,11 @@ #ifndef MISSION_DEVICES_GPSHYPERIONHANDLER_H_ #define MISSION_DEVICES_GPSHYPERIONHANDLER_H_ +#include "fsfw/FSFW.h" #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 @@ -18,7 +16,7 @@ class GPSHyperionHandler: public DeviceHandlerBase { public: GPSHyperionHandler(object_id_t objectId, object_id_t deviceCommunication, - CookieIF* comCookie); + CookieIF* comCookie, bool debugHyperionGps = false); virtual ~GPSHyperionHandler(); protected: @@ -54,6 +52,7 @@ protected: private: lwgps_t gpsData = {}; GpsPrimaryDataset gpsSet; + bool debugHyperionGps = false; }; #endif /* MISSION_DEVICES_GPSHYPERIONHANDLER_H_ */ From cb330bcf2945c7ce8aac72f0a9abd719ce132cba Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 11 Aug 2021 18:59:40 +0200 Subject: [PATCH 5/9] hyperion handler: HK packet subscription --- mission/devices/GPSHyperionHandler.cpp | 31 +++++++++++++------------- mission/devices/GPSHyperionHandler.h | 1 + 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/mission/devices/GPSHyperionHandler.cpp b/mission/devices/GPSHyperionHandler.cpp index 3cc95db6..bd34591a 100644 --- a/mission/devices/GPSHyperionHandler.cpp +++ b/mission/devices/GPSHyperionHandler.cpp @@ -7,9 +7,9 @@ #include "lwgps/lwgps.h" GPSHyperionHandler::GPSHyperionHandler(object_id_t objectId, object_id_t deviceCommunication, - CookieIF *comCookie, bool debugHyperionGps): - DeviceHandlerBase(objectId, deviceCommunication, comCookie), gpsSet(this), - debugHyperionGps(debugHyperionGps) { + CookieIF *comCookie, bool debugHyperionGps): + DeviceHandlerBase(objectId, deviceCommunication, comCookie), gpsSet(this), + debugHyperionGps(debugHyperionGps) { lwgps_init(&gpsData); } @@ -37,21 +37,21 @@ void GPSHyperionHandler::doShutDown() { } ReturnValue_t GPSHyperionHandler::buildTransitionDeviceCommand(DeviceCommandId_t *id) { - return HasReturnvaluesIF::RETURN_OK; + return HasReturnvaluesIF::RETURN_OK; } ReturnValue_t GPSHyperionHandler::buildNormalDeviceCommand(DeviceCommandId_t *id) { - return HasReturnvaluesIF::RETURN_OK; + return HasReturnvaluesIF::RETURN_OK; } ReturnValue_t GPSHyperionHandler::buildCommandFromCommand( - DeviceCommandId_t deviceCommand, const uint8_t *commandData, - size_t commandDataLen) { - return HasReturnvaluesIF::RETURN_OK; + DeviceCommandId_t deviceCommand, const uint8_t *commandData, + size_t commandDataLen) { + return HasReturnvaluesIF::RETURN_OK; } ReturnValue_t GPSHyperionHandler::scanForReply(const uint8_t *start, size_t len, - DeviceCommandId_t *foundId, size_t *foundLen) { + DeviceCommandId_t *foundId, size_t *foundLen) { // Pass data to GPS library if(len > 0) { sif::info << "GPSHandler::scanForReply: Received " << len << " bytes" << std::endl; @@ -111,21 +111,21 @@ ReturnValue_t GPSHyperionHandler::scanForReply(const uint8_t *start, size_t len, } *foundLen = len; } - return HasReturnvaluesIF::RETURN_OK; + return HasReturnvaluesIF::RETURN_OK; } ReturnValue_t GPSHyperionHandler::interpretDeviceReply(DeviceCommandId_t id, - const uint8_t *packet) { - return HasReturnvaluesIF::RETURN_OK; + const uint8_t *packet) { + return HasReturnvaluesIF::RETURN_OK; } uint32_t GPSHyperionHandler::getTransitionDelayMs(Mode_t from, Mode_t to) { - return 5000; + return 5000; } ReturnValue_t GPSHyperionHandler::initializeLocalDataPool( - localpool::DataPool &localDataPoolMap, LocalDataPoolManager &poolManager) { + 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})); @@ -138,7 +138,8 @@ ReturnValue_t GPSHyperionHandler::initializeLocalDataPool( 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; + poolManager.subscribeForPeriodicPacket(gpsSet.getSid(), true, 2.0, false); + return HasReturnvaluesIF::RETURN_OK; } void GPSHyperionHandler::fillCommandAndReplyMap() { diff --git a/mission/devices/GPSHyperionHandler.h b/mission/devices/GPSHyperionHandler.h index feb99a6a..49d8f416 100644 --- a/mission/devices/GPSHyperionHandler.h +++ b/mission/devices/GPSHyperionHandler.h @@ -20,6 +20,7 @@ public: virtual ~GPSHyperionHandler(); protected: + enum class InternalStates { NONE, WAIT_FIRST_MESSAGE, From 1962b30e5f4aa412b8af71c2edc2e786c3cc134e Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 11 Aug 2021 19:27:17 +0200 Subject: [PATCH 6/9] testing HK downlink --- bsp_linux_board/ObjectFactory.cpp | 18 ++++++++++++++---- mission/devices/GPSHyperionHandler.cpp | 2 +- tmtc | 2 +- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/bsp_linux_board/ObjectFactory.cpp b/bsp_linux_board/ObjectFactory.cpp index f4a7320c..fa5c35dd 100644 --- a/bsp_linux_board/ObjectFactory.cpp +++ b/bsp_linux_board/ObjectFactory.cpp @@ -1,6 +1,3 @@ -#include -#include -#include #include "ObjectFactory.h" #include "objects/systemObjectList.h" @@ -17,6 +14,7 @@ #include "mission/core/GenericFactory.h" #include "mission/utility/TmFunnel.h" +#include #include "mission/devices/MGMHandlerLIS3MDL.h" #include "mission/devices/MGMHandlerRM3100.h" #include "mission/devices/GyroADIS16507Handler.h" @@ -28,8 +26,13 @@ #include "fsfw/tasks/TaskFactory.h" /* UDP server includes */ +#if OBSW_USE_TMTC_TCP_BRIDGE == 1 +#include +#include +#else #include "fsfw/osal/common/UdpTmTcBridge.h" #include "fsfw/osal/common/UdpTcPollingTask.h" +#endif #include "fsfw_hal/devicehandlers/GyroL3GD20Handler.h" #include "fsfw_hal/linux/gpio/LinuxLibgpioIF.h" @@ -37,6 +40,8 @@ #include "fsfw_hal/common/gpio/GpioCookie.h" #include "fsfw_hal/linux/spi/SpiCookie.h" #include "fsfw_hal/linux/spi/SpiComIF.h" +#include +#include void Factory::setStaticFrameworkObjectIds() { PusServiceBase::packetSource = objects::PUS_PACKET_DISTRIBUTOR; @@ -59,8 +64,13 @@ void ObjectFactory::produce(void* args){ Factory::setStaticFrameworkObjectIds(); ObjectFactory::produceGenericObjects(); +#if OBSW_USE_TMTC_TCP_BRIDGE == 1 + new TcpTmTcBridge(objects::TMTC_BRIDGE, objects::CCSDS_PACKET_DISTRIBUTOR); + new TcpTmTcServer(objects::TMTC_POLLING_TASK, objects::TMTC_BRIDGE); +#else new UdpTmTcBridge(objects::TMTC_BRIDGE, objects::CCSDS_PACKET_DISTRIBUTOR); new UdpTcPollingTask(objects::TMTC_POLLING_TASK, objects::TMTC_BRIDGE); +#endif GpioIF* gpioIF = new LinuxLibgpioIF(objects::GPIO_IF); GpioCookie* gpioCookie = nullptr; @@ -162,7 +172,7 @@ void ObjectFactory::produce(void* args){ uartCookie->setToFlushInput(true); uartCookie->setReadCycles(6); GPSHyperionHandler* gpsHandler = new GPSHyperionHandler(objects::GPS0_HANDLER, - objects::UART_COM_IF, uartCookie, true); + objects::UART_COM_IF, uartCookie, false); gpsHandler->setStartUpImmediately(); #endif diff --git a/mission/devices/GPSHyperionHandler.cpp b/mission/devices/GPSHyperionHandler.cpp index bd34591a..8f8bd229 100644 --- a/mission/devices/GPSHyperionHandler.cpp +++ b/mission/devices/GPSHyperionHandler.cpp @@ -144,7 +144,7 @@ ReturnValue_t GPSHyperionHandler::initializeLocalDataPool( void GPSHyperionHandler::fillCommandAndReplyMap() { // Reply length does not matter, packets should always arrive periodically - insertInReplyMap(GpsHyperion::GPS_REPLY, 4, nullptr, 0, true); + insertInReplyMap(GpsHyperion::GPS_REPLY, 4, &gpsSet, 0, true); } void GPSHyperionHandler::modeChanged() { diff --git a/tmtc b/tmtc index 84656b90..25f8543a 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 84656b90fc44ab72fb95518410fea3373d1fdf18 +Subproject commit 25f8543a8d5e578d40f589019ed065cc50f5074b From dc8879b1afb90593265f65b1d94de22a23c2c785 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 11 Aug 2021 19:33:26 +0200 Subject: [PATCH 7/9] tmtc update --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index 25f8543a..387a076a 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 25f8543a8d5e578d40f589019ed065cc50f5074b +Subproject commit 387a076a2180c14da8de086d690a2ebb5ad63649 From 95c06d5a09447b53d21e366043b2f93417cb6bf4 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 14 Aug 2021 15:19:32 +0200 Subject: [PATCH 8/9] added make size cfg --- cmake/scripts/Q7S/make-size-cfg.sh | 35 ++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 cmake/scripts/Q7S/make-size-cfg.sh diff --git a/cmake/scripts/Q7S/make-size-cfg.sh b/cmake/scripts/Q7S/make-size-cfg.sh new file mode 100755 index 00000000..f75edb7f --- /dev/null +++ b/cmake/scripts/Q7S/make-size-cfg.sh @@ -0,0 +1,35 @@ +#!/bin/sh +counter=0 +cfg_script_name="cmake-build-cfg.py" +while [ ${counter} -lt 5 ] +do + cd .. + if [ -f ${cfg_script_name} ];then + break + fi + counter=$((counter=counter + 1)) +done + +if [ "${counter}" -ge 5 ];then + echo "${cfg_script_name} not found in upper directories!" + exit 1 +fi + +os_fsfw="linux" +tgt_bsp="arm/q7s" +build_dir="build-Release-Q7S" +build_generator="" +if [ "${OS}" = "Windows_NT" ]; then + build_generator="MinGW Makefiles" + python="py" +# Could be other OS but this works for now. +else + build_generator="Unix Makefiles" + python="python3" +fi + +echo "Running command (without the leading +):" +set -x # Print command +${python} ${cfg_script_name} -o "${os_fsfw}" -g "${build_generator}" -b "size" -t "${tgt_bsp}" \ + -l"${build_dir}" +# set +x From cfbacd4d80a5bd7ab722c9d06ddb0aeabe3590d1 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 14 Aug 2021 15:25:30 +0200 Subject: [PATCH 9/9] generating stripped executable now --- cmake/HardwareOsPostConfig.cmake | 18 +++++------------- cmake/Q7SCrossCompileConfig.cmake | 1 + 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/cmake/HardwareOsPostConfig.cmake b/cmake/HardwareOsPostConfig.cmake index 73a8d8b1..2492b9bb 100644 --- a/cmake/HardwareOsPostConfig.cmake +++ b/cmake/HardwareOsPostConfig.cmake @@ -11,17 +11,6 @@ if(LINK_LWIP) endif() endif() -if(LINK_HAL) - message(STATUS "Linking against ${LIB_HAL_NAME} HAL library") - if(LIB_HAL_NAME) - target_link_libraries(${TARGET_NAME} PUBLIC - ${LIB_HAL_NAME} - ) - else() - message(WARNING "HAL library name not set!") - endif() -endif() - if(LINKER_SCRIPT) target_link_options(${TARGET_NAME} PRIVATE -T${LINKER_SCRIPT} @@ -52,11 +41,14 @@ target_compile_options(${TARGET_NAME} PRIVATE $<$:${ASM_FLAGS}> ) +set(STRIPPED_TARGET_NAME ${TARGET_NAME}-stripped) + add_custom_command( TARGET ${TARGET_NAME} POST_BUILD - COMMAND ${CMAKE_OBJCOPY} -O binary ${TARGET_NAME} ${TARGET_NAME}.bin - COMMENT "Generating binary file ${CMAKE_PROJECT_NAME}.bin.." + COMMAND ${CMAKE_STRIP} --strip-all ${TARGET_NAME} -o ${STRIPPED_TARGET_NAME} + BYPRODUCTS ${STRIPPED_TARGET_NAME} + COMMENT "Generating stripped executable ${STRIPPED_TARGET_NAME}.." ) endfunction() \ No newline at end of file diff --git a/cmake/Q7SCrossCompileConfig.cmake b/cmake/Q7SCrossCompileConfig.cmake index 006b2c96..1d23b16d 100644 --- a/cmake/Q7SCrossCompileConfig.cmake +++ b/cmake/Q7SCrossCompileConfig.cmake @@ -42,6 +42,7 @@ find_program (CMAKE_CXX_COMPILER ${CROSS_COMPILE_CXX} REQUIRED) # Useful utilities, not strictly necessary find_program(CMAKE_SIZE ${CROSS_COMPILE_SIZE}) find_program(CMAKE_OBJCOPY ${CROSS_COMPILE_OBJCOPY}) +find_program(CMAKE_STRIP ${CROSS_COMPILE_STRIP}) set(CMAKE_CROSSCOMPILING TRUE) set(CMAKE_SYSROOT "${SYSROOT_PATH}")