From a56b80ec5554d3ed21403dd6e43f5d9d9fd17c07 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 4 Feb 2022 17:05:40 +0100 Subject: [PATCH 01/14] tmtc update --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index 84c27308..e7d73596 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 84c2730836e6821ff089d7567018fe4ffded62db +Subproject commit e7d735966af6a9e5d70dbf5771a65ed98c2052e1 From c42b3f56c397f2635c76aedd415b47b6b4355a75 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 4 Feb 2022 17:48:05 +0100 Subject: [PATCH 02/14] applied clang-format --- bsp_q7s/core/InitMission.cpp | 18 +- bsp_q7s/core/ObjectFactory.cpp | 4 + linux/boardtest/UartTestClass.cpp | 87 ++- linux/boardtest/UartTestClass.h | 8 +- linux/fsfwconfig/OBSWConfig.h.in | 6 +- linux/fsfwconfig/events/translateEvents.cpp | 568 +++++++++--------- linux/fsfwconfig/events/translateEvents.h | 2 +- .../devicedefinitions/SCEXDefinitions.h | 13 + 8 files changed, 408 insertions(+), 298 deletions(-) create mode 100644 mission/devices/devicedefinitions/SCEXDefinitions.h diff --git a/bsp_q7s/core/InitMission.cpp b/bsp_q7s/core/InitMission.cpp index 429d57f4..c4e3805d 100644 --- a/bsp_q7s/core/InitMission.cpp +++ b/bsp_q7s/core/InitMission.cpp @@ -350,18 +350,17 @@ void initmission::createPusTasks(TaskFactory& factory, void initmission::createTestTasks(TaskFactory& factory, TaskDeadlineMissedFunction missedDeadlineFunc, std::vector& taskVec) { -#if OBSW_ADD_TEST_TASK == 1 || OBSW_ADD_SPI_TEST_CODE == 1 || OBSW_ADD_I2C_TEST_CODE == 1 || \ - (BOARD_TE0720 == 1 && OBSW_TEST_LIBGPIOD == 1) +#if OBSW_ADD_TEST_TASK == 1 && OBSW_ADD_TEST_CODE == 1 ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; -#endif + static_cast(result); // supress warning in case it is not used + PeriodicTaskIF* testTask = factory.createPeriodicTask( "TEST_TASK", 60, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1, missedDeadlineFunc); -#if OBSW_ADD_TEST_TASK == 1 + result = testTask->addComponent(objects::TEST_TASK); if (result != HasReturnvaluesIF::RETURN_OK) { initmission::printAddObjectError("TEST_TASK", objects::TEST_TASK); } -#endif /* OBSW_ADD_TEST_TASK == 1 */ #if OBSW_ADD_SPI_TEST_CODE == 1 result = testTask->addComponent(objects::SPI_TEST); @@ -375,6 +374,13 @@ void initmission::createTestTasks(TaskFactory& factory, initmission::printAddObjectError("I2C_TEST", objects::I2C_TEST); } #endif +#if OBSW_ADD_UART_TEST_CODE == 1 + result = testTask->addComponent(objects::UART_TEST); + if (result != HasReturnvaluesIF::RETURN_OK) { + initmission::printAddObjectError("UART_TEST", objects::UART_TEST); + } +#endif + #if BOARD_TE0720 == 1 && OBSW_TEST_LIBGPIOD == 1 result = testTask->addComponent(objects::LIBGPIOD_TEST); if (result != HasReturnvaluesIF::RETURN_OK) { @@ -382,4 +388,6 @@ void initmission::createTestTasks(TaskFactory& factory, } #endif /* BOARD_TE0720 == 1 && OBSW_TEST_LIBGPIOD == 1 */ taskVec.push_back(testTask); + +#endif // OBSW_ADD_TEST_TASK == 1 && OBSW_ADD_TEST_CODE == 1 } diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index b427b9b9..8b2c4366 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -1,6 +1,7 @@ #include "ObjectFactory.h" #include +#include #include @@ -1135,4 +1136,7 @@ void ObjectFactory::createTestComponents(LinuxLibgpioIF* gpioComIF) { #if OBSW_ADD_I2C_TEST_CODE == 1 new I2cTestClass(objects::I2C_TEST, q7s::I2C_DEFAULT_DEV); #endif +#if OBSW_ADD_UART_TEST_CODE == 1 + new UartTestClass(objects::UART_TEST); +#endif } diff --git a/linux/boardtest/UartTestClass.cpp b/linux/boardtest/UartTestClass.cpp index e6033c09..8cdf3ce7 100644 --- a/linux/boardtest/UartTestClass.cpp +++ b/linux/boardtest/UartTestClass.cpp @@ -9,18 +9,21 @@ #include // Contains file controls like O_RDWR #include // write(), read(), close() -#include "fsfw/serviceinterface/ServiceInterface.h" -#include "lwgps/lwgps.h" +#include "fsfw/globalfunctions/CRC.h" +#include "fsfw/globalfunctions/arrayprinter.h" +#include "fsfw/serviceinterface.h" +#include "mission/devices/devicedefinitions/SCEXDefinitions.h" #define GPS_REPLY_WIRETAPPING 0 -UartTestClass::UartTestClass(object_id_t objectId) : TestTask(objectId) {} +UartTestClass::UartTestClass(object_id_t objectId) : TestTask(objectId) { mode = TestModes::SCEX; } ReturnValue_t UartTestClass::initialize() { if (mode == TestModes::GPS) { gpsInit(); + } else if (mode == TestModes::SCEX) { + scexInit(); } - return HasReturnvaluesIF::RETURN_OK; } @@ -29,6 +32,8 @@ ReturnValue_t UartTestClass::performOneShotAction() { return HasReturnvaluesIF:: ReturnValue_t UartTestClass::performPeriodicAction() { if (mode == TestModes::GPS) { gpsPeriodic(); + } else if (mode == TestModes::SCEX) { + scexPeriodic(); } return HasReturnvaluesIF::RETURN_OK; } @@ -118,3 +123,77 @@ void UartTestClass::gpsPeriodic() { } while (bytesRead > 0); #endif } + +void UartTestClass::scexInit() { +#if defined(RASPBERRY_PI) + std::string devname = "/dev/ttyUSB1"; +#else + std::string devname = "/dev/ul-scex"; +#endif + /* Get file descriptor */ + serialPort = open(devname.c_str(), O_RDWR); + if (serialPort < 0) { + sif::warning << "open call failed with error [" << errno << ", " << strerror(errno) + << std::endl; + return; + } + // Setting up UART parameters + tty.c_cflag &= ~PARENB; // Clear parity bit + tty.c_cflag &= ~CSTOPB; // Clear stop field, only one stop bit used in communication + tty.c_cflag &= ~CSIZE; // Clear all the size bits + tty.c_cflag |= CS8; // 8 bits per byte + tty.c_cflag &= ~CRTSCTS; // Disable RTS/CTS hardware flow control + tty.c_cflag |= CREAD | CLOCAL; // Turn on READ & ignore ctrl lines (CLOCAL = 1) + + // Use non-canonical mode and clear echo flag + tty.c_lflag &= ~(ICANON | ECHO); + + // Non-blocking mode + tty.c_cc[VTIME] = 1; // In units of 0.1 seconds + tty.c_cc[VMIN] = 1; + + if (tcsetattr(serialPort, TCSANOW, &tty) != 0) { + sif::warning << "tcsetattr call failed with error [" << errno << ", " << strerror(errno) + << std::endl; + } + // Flush received and unread data + tcflush(serialPort, TCIFLUSH); +} + +void UartTestClass::scexPeriodic() { + // Send ping command + cmdBuf[0] = scex::CMD_PING; + // These two fields are the packet counter and the total packet count. Those are 1 and 1 for each + // telecommand so far + cmdBuf[1] = 1; + cmdBuf[2] = 1; + uint16_t userDataLen = 0; + cmdBuf[3] = (userDataLen >> 8) & 0xff; + cmdBuf[4] = userDataLen & 0xff; + uint16_t crc = CRC::crc16ccitt(cmdBuf.data(), 5); + cmdBuf[5] = (crc >> 8) & 0xff; + cmdBuf[6] = crc & 0xff; + size_t bytesWritten = write(serialPort, cmdBuf.data(), 7); + if (bytesWritten != 7) { + sif::warning << "Sending ping command to solar experiment failed" << std::endl; + } + + // Read back reply immediately + int bytesRead = 0; + do { + bytesRead = read(serialPort, reinterpret_cast(recBuf.data()), + static_cast(recBuf.size())); + if (bytesRead < 0) { + sif::warning << "UartTestClass::performPeriodicAction: read call failed with error [" << errno + << ", " << strerror(errno) << "]" << std::endl; + break; + } else if (bytesRead >= static_cast(recBuf.size())) { + sif::debug << "UartTestClass::performPeriodicAction: " + "recv buffer might not be large enough" + << std::endl; + } else if (bytesRead > 0) { + sif::info << "Received " << bytesRead << " from the Solar Cell Experiment:" << std::endl; + arrayprinter::print(recBuf.data(), bytesRead); + } + } while (bytesRead > 0); +} diff --git a/linux/boardtest/UartTestClass.h b/linux/boardtest/UartTestClass.h index fb0e2501..33194598 100644 --- a/linux/boardtest/UartTestClass.h +++ b/linux/boardtest/UartTestClass.h @@ -20,16 +20,20 @@ class UartTestClass : public TestTask { enum TestModes { GPS, // Solar Cell Experiment - SCE + SCEX }; void gpsInit(); void gpsPeriodic(); + + void scexInit(); + void scexPeriodic(); TestModes mode = TestModes::GPS; lwgps_t gpsData = {}; struct termios tty = {}; int serialPort = 0; - std::array recBuf; + std::array cmdBuf = {}; + std::array recBuf = {}; uint8_t recvCnt = 0; }; diff --git a/linux/fsfwconfig/OBSWConfig.h.in b/linux/fsfwconfig/OBSWConfig.h.in index 6c4e4773..fd5ae534 100644 --- a/linux/fsfwconfig/OBSWConfig.h.in +++ b/linux/fsfwconfig/OBSWConfig.h.in @@ -68,12 +68,14 @@ debugging. */ #define OBSW_SYRLINKS_SIMULATED 1 #define OBSW_ADD_TEST_CODE 0 +#define OBSW_ADD_TEST_TASK 0 +#define OBSW_ADD_TEST_PST 0 // If this is enabled, all other SPI code should be disabled #define OBSW_ADD_SPI_TEST_CODE 0 // If this is enabled, all other I2C code should be disabled #define OBSW_ADD_I2C_TEST_CODE 0 -#define OBSW_ADD_TEST_PST 0 -#define OBSW_ADD_TEST_TASK 0 +#define OBSW_ADD_UART_TEST_CODE 0 + #define OBSW_TEST_LIBGPIOD 0 #define OBSW_TEST_RADIATION_SENSOR_HANDLER 0 #define OBSW_TEST_SUS_HANDLER 0 diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index 9e6a5f61..922892c8 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -146,290 +146,290 @@ const char *STR_HELPER_FILE_NOT_EXISTS_STRING = "STR_HELPER_FILE_NOT_EXISTS"; const char *STR_HELPER_SENDING_PACKET_FAILED_STRING = "STR_HELPER_SENDING_PACKET_FAILED"; const char *STR_HELPER_REQUESTING_MSG_FAILED_STRING = "STR_HELPER_REQUESTING_MSG_FAILED"; -const char * translateEvents(Event event) { - switch( (event & 0xffff) ) { - case(2200): - return STORE_SEND_WRITE_FAILED_STRING; - case(2201): - return STORE_WRITE_FAILED_STRING; - case(2202): - return STORE_SEND_READ_FAILED_STRING; - case(2203): - return STORE_READ_FAILED_STRING; - case(2204): - return UNEXPECTED_MSG_STRING; - case(2205): - return STORING_FAILED_STRING; - case(2206): - return TM_DUMP_FAILED_STRING; - case(2207): - return STORE_INIT_FAILED_STRING; - case(2208): - return STORE_INIT_EMPTY_STRING; - case(2209): - return STORE_CONTENT_CORRUPTED_STRING; - case(2210): - return STORE_INITIALIZE_STRING; - case(2211): - return INIT_DONE_STRING; - case(2212): - return DUMP_FINISHED_STRING; - case(2213): - return DELETION_FINISHED_STRING; - case(2214): - return DELETION_FAILED_STRING; - case(2215): - return AUTO_CATALOGS_SENDING_FAILED_STRING; - case(2600): - return GET_DATA_FAILED_STRING; - case(2601): - return STORE_DATA_FAILED_STRING; - case(2800): - return DEVICE_BUILDING_COMMAND_FAILED_STRING; - case(2801): - return DEVICE_SENDING_COMMAND_FAILED_STRING; - case(2802): - return DEVICE_REQUESTING_REPLY_FAILED_STRING; - case(2803): - return DEVICE_READING_REPLY_FAILED_STRING; - case(2804): - return DEVICE_INTERPRETING_REPLY_FAILED_STRING; - case(2805): - return DEVICE_MISSED_REPLY_STRING; - case(2806): - return DEVICE_UNKNOWN_REPLY_STRING; - case(2807): - return DEVICE_UNREQUESTED_REPLY_STRING; - case(2808): - return INVALID_DEVICE_COMMAND_STRING; - case(2809): - return MONITORING_LIMIT_EXCEEDED_STRING; - case(2810): - return MONITORING_AMBIGUOUS_STRING; - case(2811): - return DEVICE_WANTS_HARD_REBOOT_STRING; - case(4201): - return FUSE_CURRENT_HIGH_STRING; - case(4202): - return FUSE_WENT_OFF_STRING; - case(4204): - return POWER_ABOVE_HIGH_LIMIT_STRING; - case(4205): - return POWER_BELOW_LOW_LIMIT_STRING; - case(4300): - return SWITCH_WENT_OFF_STRING; - case(5000): - return HEATER_ON_STRING; - case(5001): - return HEATER_OFF_STRING; - case(5002): - return HEATER_TIMEOUT_STRING; - case(5003): - return HEATER_STAYED_ON_STRING; - case(5004): - return HEATER_STAYED_OFF_STRING; - case(5200): - return TEMP_SENSOR_HIGH_STRING; - case(5201): - return TEMP_SENSOR_LOW_STRING; - case(5202): - return TEMP_SENSOR_GRADIENT_STRING; - case(5901): - return COMPONENT_TEMP_LOW_STRING; - case(5902): - return COMPONENT_TEMP_HIGH_STRING; - case(5903): - return COMPONENT_TEMP_OOL_LOW_STRING; - case(5904): - return COMPONENT_TEMP_OOL_HIGH_STRING; - case(5905): - return TEMP_NOT_IN_OP_RANGE_STRING; - case(7101): - return FDIR_CHANGED_STATE_STRING; - case(7102): - return FDIR_STARTS_RECOVERY_STRING; - case(7103): - return FDIR_TURNS_OFF_DEVICE_STRING; - case(7201): - return MONITOR_CHANGED_STATE_STRING; - case(7202): - return VALUE_BELOW_LOW_LIMIT_STRING; - case(7203): - return VALUE_ABOVE_HIGH_LIMIT_STRING; - case(7204): - return VALUE_OUT_OF_RANGE_STRING; - case(7400): - return CHANGING_MODE_STRING; - case(7401): - return MODE_INFO_STRING; - case(7402): - return FALLBACK_FAILED_STRING; - case(7403): - return MODE_TRANSITION_FAILED_STRING; - case(7404): - return CANT_KEEP_MODE_STRING; - case(7405): - return OBJECT_IN_INVALID_MODE_STRING; - case(7406): - return FORCING_MODE_STRING; - case(7407): - return MODE_CMD_REJECTED_STRING; - case(7506): - return HEALTH_INFO_STRING; - case(7507): - return CHILD_CHANGED_HEALTH_STRING; - case(7508): - return CHILD_PROBLEMS_STRING; - case(7509): - return OVERWRITING_HEALTH_STRING; - case(7510): - return TRYING_RECOVERY_STRING; - case(7511): - return RECOVERY_STEP_STRING; - case(7512): - return RECOVERY_DONE_STRING; - case(7900): - return RF_AVAILABLE_STRING; - case(7901): - return RF_LOST_STRING; - case(7902): - return BIT_LOCK_STRING; - case(7903): - return BIT_LOCK_LOST_STRING; - case(7905): - return FRAME_PROCESSING_FAILED_STRING; - case(8900): - return CLOCK_SET_STRING; - case(8901): - return CLOCK_SET_FAILURE_STRING; - case(9700): - return TEST_STRING; - case(10600): - return CHANGE_OF_SETUP_PARAMETER_STRING; - case(10900): - return GPIO_PULL_HIGH_FAILED_STRING; - case(10901): - return GPIO_PULL_LOW_FAILED_STRING; - case(10902): - return SWITCH_ALREADY_ON_STRING; - case(10903): - return SWITCH_ALREADY_OFF_STRING; - case(10904): - return MAIN_SWITCH_TIMEOUT_STRING; - case(11000): - return MAIN_SWITCH_ON_TIMEOUT_STRING; - case(11001): - return MAIN_SWITCH_OFF_TIMEOUT_STRING; - case(11002): - return DEPLOYMENT_FAILED_STRING; - case(11003): - return DEPL_SA1_GPIO_SWTICH_ON_FAILED_STRING; - case(11004): - return DEPL_SA2_GPIO_SWTICH_ON_FAILED_STRING; - case(11101): - return MEMORY_READ_RPT_CRC_FAILURE_STRING; - case(11102): - return ACK_FAILURE_STRING; - case(11103): - return EXE_FAILURE_STRING; - case(11104): - return CRC_FAILURE_EVENT_STRING; - case(11201): - return SELF_TEST_I2C_FAILURE_STRING; - case(11202): - return SELF_TEST_SPI_FAILURE_STRING; - case(11203): - return SELF_TEST_ADC_FAILURE_STRING; - case(11204): - return SELF_TEST_PWM_FAILURE_STRING; - case(11205): - return SELF_TEST_TC_FAILURE_STRING; - case(11206): - return SELF_TEST_MTM_RANGE_FAILURE_STRING; - case(11207): - return SELF_TEST_COIL_CURRENT_FAILURE_STRING; - case(11208): - return INVALID_ERROR_BYTE_STRING; - case(11301): - return ERROR_STATE_STRING; - case(11501): - return SUPV_MEMORY_READ_RPT_CRC_FAILURE_STRING; - case(11502): - return SUPV_ACK_FAILURE_STRING; - case(11503): - return SUPV_EXE_FAILURE_STRING; - case(11504): - return SUPV_CRC_FAILURE_EVENT_STRING; - case(11600): - return SANITIZATION_FAILED_STRING; - case(11700): - return UPDATE_FILE_NOT_EXISTS_STRING; - case(11701): - return ACTION_COMMANDING_FAILED_STRING; - case(11702): - return UPDATE_AVAILABLE_FAILED_STRING; - case(11703): - return UPDATE_TRANSFER_FAILED_STRING; - case(11704): - return UPDATE_VERIFY_FAILED_STRING; - case(11705): - return UPDATE_FINISHED_STRING; - case(11800): - return SEND_MRAM_DUMP_FAILED_STRING; - case(11801): - return MRAM_DUMP_FAILED_STRING; - case(11802): - return MRAM_DUMP_FINISHED_STRING; - case(11901): - return INVALID_TC_FRAME_STRING; - case(11902): - return INVALID_FAR_STRING; - case(11903): - return CARRIER_LOCK_STRING; - case(11904): - return BIT_LOCK_PDEC_STRING; - case(12000): - return IMAGE_UPLOAD_FAILED_STRING; - case(12001): - return IMAGE_DOWNLOAD_FAILED_STRING; - case(12002): - return IMAGE_UPLOAD_SUCCESSFUL_STRING; - case(12003): - return IMAGE_DOWNLOAD_SUCCESSFUL_STRING; - case(12004): - return FLASH_WRITE_SUCCESSFUL_STRING; - case(12005): - return FLASH_READ_SUCCESSFUL_STRING; - case(12006): - return FLASH_WRITE_FAILED_STRING; - case(12007): - return FLASH_READ_FAILED_STRING; - case(12008): - return FPGA_DOWNLOAD_SUCCESSFUL_STRING; - case(12009): - return FPGA_DOWNLOAD_FAILED_STRING; - case(12010): - return FPGA_UPLOAD_SUCCESSFUL_STRING; - case(12011): - return FPGA_UPLOAD_FAILED_STRING; - case(12012): - return STR_HELPER_READING_REPLY_FAILED_STRING; - case(12013): - return STR_HELPER_COM_ERROR_STRING; - case(12014): - return STR_HELPER_NO_REPLY_STRING; - case(12015): - return STR_HELPER_DEC_ERROR_STRING; - case(12016): - return POSITION_MISMATCH_STRING; - case(12017): - return STR_HELPER_FILE_NOT_EXISTS_STRING; - case(12018): - return STR_HELPER_SENDING_PACKET_FAILED_STRING; - case(12019): - return STR_HELPER_REQUESTING_MSG_FAILED_STRING; - default: - return "UNKNOWN_EVENT"; +const char *translateEvents(Event event) { + switch ((event & 0xffff)) { + case (2200): + return STORE_SEND_WRITE_FAILED_STRING; + case (2201): + return STORE_WRITE_FAILED_STRING; + case (2202): + return STORE_SEND_READ_FAILED_STRING; + case (2203): + return STORE_READ_FAILED_STRING; + case (2204): + return UNEXPECTED_MSG_STRING; + case (2205): + return STORING_FAILED_STRING; + case (2206): + return TM_DUMP_FAILED_STRING; + case (2207): + return STORE_INIT_FAILED_STRING; + case (2208): + return STORE_INIT_EMPTY_STRING; + case (2209): + return STORE_CONTENT_CORRUPTED_STRING; + case (2210): + return STORE_INITIALIZE_STRING; + case (2211): + return INIT_DONE_STRING; + case (2212): + return DUMP_FINISHED_STRING; + case (2213): + return DELETION_FINISHED_STRING; + case (2214): + return DELETION_FAILED_STRING; + case (2215): + return AUTO_CATALOGS_SENDING_FAILED_STRING; + case (2600): + return GET_DATA_FAILED_STRING; + case (2601): + return STORE_DATA_FAILED_STRING; + case (2800): + return DEVICE_BUILDING_COMMAND_FAILED_STRING; + case (2801): + return DEVICE_SENDING_COMMAND_FAILED_STRING; + case (2802): + return DEVICE_REQUESTING_REPLY_FAILED_STRING; + case (2803): + return DEVICE_READING_REPLY_FAILED_STRING; + case (2804): + return DEVICE_INTERPRETING_REPLY_FAILED_STRING; + case (2805): + return DEVICE_MISSED_REPLY_STRING; + case (2806): + return DEVICE_UNKNOWN_REPLY_STRING; + case (2807): + return DEVICE_UNREQUESTED_REPLY_STRING; + case (2808): + return INVALID_DEVICE_COMMAND_STRING; + case (2809): + return MONITORING_LIMIT_EXCEEDED_STRING; + case (2810): + return MONITORING_AMBIGUOUS_STRING; + case (2811): + return DEVICE_WANTS_HARD_REBOOT_STRING; + case (4201): + return FUSE_CURRENT_HIGH_STRING; + case (4202): + return FUSE_WENT_OFF_STRING; + case (4204): + return POWER_ABOVE_HIGH_LIMIT_STRING; + case (4205): + return POWER_BELOW_LOW_LIMIT_STRING; + case (4300): + return SWITCH_WENT_OFF_STRING; + case (5000): + return HEATER_ON_STRING; + case (5001): + return HEATER_OFF_STRING; + case (5002): + return HEATER_TIMEOUT_STRING; + case (5003): + return HEATER_STAYED_ON_STRING; + case (5004): + return HEATER_STAYED_OFF_STRING; + case (5200): + return TEMP_SENSOR_HIGH_STRING; + case (5201): + return TEMP_SENSOR_LOW_STRING; + case (5202): + return TEMP_SENSOR_GRADIENT_STRING; + case (5901): + return COMPONENT_TEMP_LOW_STRING; + case (5902): + return COMPONENT_TEMP_HIGH_STRING; + case (5903): + return COMPONENT_TEMP_OOL_LOW_STRING; + case (5904): + return COMPONENT_TEMP_OOL_HIGH_STRING; + case (5905): + return TEMP_NOT_IN_OP_RANGE_STRING; + case (7101): + return FDIR_CHANGED_STATE_STRING; + case (7102): + return FDIR_STARTS_RECOVERY_STRING; + case (7103): + return FDIR_TURNS_OFF_DEVICE_STRING; + case (7201): + return MONITOR_CHANGED_STATE_STRING; + case (7202): + return VALUE_BELOW_LOW_LIMIT_STRING; + case (7203): + return VALUE_ABOVE_HIGH_LIMIT_STRING; + case (7204): + return VALUE_OUT_OF_RANGE_STRING; + case (7400): + return CHANGING_MODE_STRING; + case (7401): + return MODE_INFO_STRING; + case (7402): + return FALLBACK_FAILED_STRING; + case (7403): + return MODE_TRANSITION_FAILED_STRING; + case (7404): + return CANT_KEEP_MODE_STRING; + case (7405): + return OBJECT_IN_INVALID_MODE_STRING; + case (7406): + return FORCING_MODE_STRING; + case (7407): + return MODE_CMD_REJECTED_STRING; + case (7506): + return HEALTH_INFO_STRING; + case (7507): + return CHILD_CHANGED_HEALTH_STRING; + case (7508): + return CHILD_PROBLEMS_STRING; + case (7509): + return OVERWRITING_HEALTH_STRING; + case (7510): + return TRYING_RECOVERY_STRING; + case (7511): + return RECOVERY_STEP_STRING; + case (7512): + return RECOVERY_DONE_STRING; + case (7900): + return RF_AVAILABLE_STRING; + case (7901): + return RF_LOST_STRING; + case (7902): + return BIT_LOCK_STRING; + case (7903): + return BIT_LOCK_LOST_STRING; + case (7905): + return FRAME_PROCESSING_FAILED_STRING; + case (8900): + return CLOCK_SET_STRING; + case (8901): + return CLOCK_SET_FAILURE_STRING; + case (9700): + return TEST_STRING; + case (10600): + return CHANGE_OF_SETUP_PARAMETER_STRING; + case (10900): + return GPIO_PULL_HIGH_FAILED_STRING; + case (10901): + return GPIO_PULL_LOW_FAILED_STRING; + case (10902): + return SWITCH_ALREADY_ON_STRING; + case (10903): + return SWITCH_ALREADY_OFF_STRING; + case (10904): + return MAIN_SWITCH_TIMEOUT_STRING; + case (11000): + return MAIN_SWITCH_ON_TIMEOUT_STRING; + case (11001): + return MAIN_SWITCH_OFF_TIMEOUT_STRING; + case (11002): + return DEPLOYMENT_FAILED_STRING; + case (11003): + return DEPL_SA1_GPIO_SWTICH_ON_FAILED_STRING; + case (11004): + return DEPL_SA2_GPIO_SWTICH_ON_FAILED_STRING; + case (11101): + return MEMORY_READ_RPT_CRC_FAILURE_STRING; + case (11102): + return ACK_FAILURE_STRING; + case (11103): + return EXE_FAILURE_STRING; + case (11104): + return CRC_FAILURE_EVENT_STRING; + case (11201): + return SELF_TEST_I2C_FAILURE_STRING; + case (11202): + return SELF_TEST_SPI_FAILURE_STRING; + case (11203): + return SELF_TEST_ADC_FAILURE_STRING; + case (11204): + return SELF_TEST_PWM_FAILURE_STRING; + case (11205): + return SELF_TEST_TC_FAILURE_STRING; + case (11206): + return SELF_TEST_MTM_RANGE_FAILURE_STRING; + case (11207): + return SELF_TEST_COIL_CURRENT_FAILURE_STRING; + case (11208): + return INVALID_ERROR_BYTE_STRING; + case (11301): + return ERROR_STATE_STRING; + case (11501): + return SUPV_MEMORY_READ_RPT_CRC_FAILURE_STRING; + case (11502): + return SUPV_ACK_FAILURE_STRING; + case (11503): + return SUPV_EXE_FAILURE_STRING; + case (11504): + return SUPV_CRC_FAILURE_EVENT_STRING; + case (11600): + return SANITIZATION_FAILED_STRING; + case (11700): + return UPDATE_FILE_NOT_EXISTS_STRING; + case (11701): + return ACTION_COMMANDING_FAILED_STRING; + case (11702): + return UPDATE_AVAILABLE_FAILED_STRING; + case (11703): + return UPDATE_TRANSFER_FAILED_STRING; + case (11704): + return UPDATE_VERIFY_FAILED_STRING; + case (11705): + return UPDATE_FINISHED_STRING; + case (11800): + return SEND_MRAM_DUMP_FAILED_STRING; + case (11801): + return MRAM_DUMP_FAILED_STRING; + case (11802): + return MRAM_DUMP_FINISHED_STRING; + case (11901): + return INVALID_TC_FRAME_STRING; + case (11902): + return INVALID_FAR_STRING; + case (11903): + return CARRIER_LOCK_STRING; + case (11904): + return BIT_LOCK_PDEC_STRING; + case (12000): + return IMAGE_UPLOAD_FAILED_STRING; + case (12001): + return IMAGE_DOWNLOAD_FAILED_STRING; + case (12002): + return IMAGE_UPLOAD_SUCCESSFUL_STRING; + case (12003): + return IMAGE_DOWNLOAD_SUCCESSFUL_STRING; + case (12004): + return FLASH_WRITE_SUCCESSFUL_STRING; + case (12005): + return FLASH_READ_SUCCESSFUL_STRING; + case (12006): + return FLASH_WRITE_FAILED_STRING; + case (12007): + return FLASH_READ_FAILED_STRING; + case (12008): + return FPGA_DOWNLOAD_SUCCESSFUL_STRING; + case (12009): + return FPGA_DOWNLOAD_FAILED_STRING; + case (12010): + return FPGA_UPLOAD_SUCCESSFUL_STRING; + case (12011): + return FPGA_UPLOAD_FAILED_STRING; + case (12012): + return STR_HELPER_READING_REPLY_FAILED_STRING; + case (12013): + return STR_HELPER_COM_ERROR_STRING; + case (12014): + return STR_HELPER_NO_REPLY_STRING; + case (12015): + return STR_HELPER_DEC_ERROR_STRING; + case (12016): + return POSITION_MISMATCH_STRING; + case (12017): + return STR_HELPER_FILE_NOT_EXISTS_STRING; + case (12018): + return STR_HELPER_SENDING_PACKET_FAILED_STRING; + case (12019): + return STR_HELPER_REQUESTING_MSG_FAILED_STRING; + default: + return "UNKNOWN_EVENT"; } return 0; } diff --git a/linux/fsfwconfig/events/translateEvents.h b/linux/fsfwconfig/events/translateEvents.h index bdabb21b..1b8a8831 100644 --- a/linux/fsfwconfig/events/translateEvents.h +++ b/linux/fsfwconfig/events/translateEvents.h @@ -3,6 +3,6 @@ #include "fsfw/events/Event.h" -const char * translateEvents(Event event); +const char* translateEvents(Event event); #endif /* FSFWCONFIG_EVENTS_TRANSLATEEVENTS_H_ */ diff --git a/mission/devices/devicedefinitions/SCEXDefinitions.h b/mission/devices/devicedefinitions/SCEXDefinitions.h new file mode 100644 index 00000000..8becabc8 --- /dev/null +++ b/mission/devices/devicedefinitions/SCEXDefinitions.h @@ -0,0 +1,13 @@ +#ifndef MISSION_DEVICES_DEVICEDEFINITIONS_SCEXDEFINITIONS_H_ +#define MISSION_DEVICES_DEVICEDEFINITIONS_SCEXDEFINITIONS_H_ + +#include + +// Definitions for the Solar Cell Experiment +namespace scex { + +static constexpr uint8_t CMD_PING = 0x4e; + +} + +#endif /* MISSION_DEVICES_DEVICEDEFINITIONS_SCEXDEFINITIONS_H_ */ From 826cb13c3e7031e506a01c253b729120754682cb Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 7 Feb 2022 11:56:53 +0100 Subject: [PATCH 03/14] update config.h.in --- linux/fsfwconfig/OBSWConfig.h.in | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/linux/fsfwconfig/OBSWConfig.h.in b/linux/fsfwconfig/OBSWConfig.h.in index 6c4e4773..14956ba3 100644 --- a/linux/fsfwconfig/OBSWConfig.h.in +++ b/linux/fsfwconfig/OBSWConfig.h.in @@ -68,12 +68,14 @@ debugging. */ #define OBSW_SYRLINKS_SIMULATED 1 #define OBSW_ADD_TEST_CODE 0 +#define OBSW_ADD_TEST_PST 0 +#define OBSW_ADD_TEST_TASK 0 // If this is enabled, all other SPI code should be disabled #define OBSW_ADD_SPI_TEST_CODE 0 // If this is enabled, all other I2C code should be disabled #define OBSW_ADD_I2C_TEST_CODE 0 -#define OBSW_ADD_TEST_PST 0 -#define OBSW_ADD_TEST_TASK 0 +#define OBSW_ADD_UART_TEST_CODE 0 + #define OBSW_TEST_LIBGPIOD 0 #define OBSW_TEST_RADIATION_SENSOR_HANDLER 0 #define OBSW_TEST_SUS_HANDLER 0 From 632b8c73556bfe59215f44861deb18973d53694a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 7 Feb 2022 13:29:06 +0100 Subject: [PATCH 04/14] submodule updates --- thirdparty/arcsec_star_tracker | 2 +- tmtc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/thirdparty/arcsec_star_tracker b/thirdparty/arcsec_star_tracker index 2d10c6b8..5d5e46b0 160000 --- a/thirdparty/arcsec_star_tracker +++ b/thirdparty/arcsec_star_tracker @@ -1 +1 @@ -Subproject commit 2d10c6b85ea4cab4f4baf1918c51d54eee4202c2 +Subproject commit 5d5e46b09bbd5208176c68d94c798493e705a2ee diff --git a/tmtc b/tmtc index e7d73596..6a783112 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit e7d735966af6a9e5d70dbf5771a65ed98c2052e1 +Subproject commit 6a78311239bdf78040e43ef217035fcaa2ab9f3b From 90da51ed5a0a19ab339194fa605ce6cb9dfd4fa9 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 8 Feb 2022 14:59:33 +0100 Subject: [PATCH 05/14] q7s-cp can now copy to flatsat as well --- scripts/q7s-cp.py | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/scripts/q7s-cp.py b/scripts/q7s-cp.py index 0478001a..e3b1f37c 100755 --- a/scripts/q7s-cp.py +++ b/scripts/q7s-cp.py @@ -49,6 +49,13 @@ def handle_args(): action="store_true", help="Copy from Q7S to host instead. Always copies to current directory.", ) + parser.add_argument( + "-f", + "--flatsat", + default=False, + action="store_true", + help="Copy to flatsat instead" + ) # Positional argument(s) parser.add_argument( "source", help="Source files to copy or target files to copy back to host" @@ -61,18 +68,21 @@ def build_cmd(args): cmd = "scp " if args.recursive: cmd += "-r " - target = args.target - if args.invert and target == "": - target = "." - elif target == "": - target = f"/tmp" - if args.invert: - cmd += f"-P {args.port} root@localhost:{args.source} {target}" + if args.flatsat: + cmd += f"{args.source} eive@flatsat.eive.absatvirt.lw:{target}" else: - cmd += f"-P {args.port} {args.source} root@localhost:{target}" - if args.target: - cmd += args.target - return cmd + target = args.target + if args.invert and target == "": + target = "." + elif target == "": + target = f"/tmp" + if args.invert: + cmd += f"-P {args.port} root@localhost:{args.source} {target}" + else: + cmd += f"-P {args.port} {args.source} root@localhost:{target}" + if args.target: + cmd += args.target + return cmd if __name__ == "__main__": From 00eeeade3f716651510f2123b7bbd6648d43a47f Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 8 Feb 2022 15:09:46 +0100 Subject: [PATCH 06/14] some fixes for updates q7s-cp script --- scripts/q7s-cp.py | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/scripts/q7s-cp.py b/scripts/q7s-cp.py index e3b1f37c..4666dfa1 100755 --- a/scripts/q7s-cp.py +++ b/scripts/q7s-cp.py @@ -68,21 +68,29 @@ def build_cmd(args): cmd = "scp " if args.recursive: cmd += "-r " + address = "" + port_args = "" + target = args.target if args.flatsat: - cmd += f"{args.source} eive@flatsat.eive.absatvirt.lw:{target}" + address = "eive@flatsat.eive.absatvirt.lw" else: - target = args.target - if args.invert and target == "": + address = "root@localhost" + port_args=f"-P {args.port}" + if args.invert: + if target == "": target = "." - elif target == "": - target = f"/tmp" - if args.invert: - cmd += f"-P {args.port} root@localhost:{args.source} {target}" else: - cmd += f"-P {args.port} {args.source} root@localhost:{target}" - if args.target: - cmd += args.target - return cmd + target = args.target + else: + if target == "": + target = f"/tmp" + else: + target = args.target + if args.invert: + cmd += f"{port_args} {address}:{args.source} {target}" + else: + cmd += f"{port_args} {args.source} {address}:{target}" + return cmd if __name__ == "__main__": From fb6b5b9e464a80881846445ffee0d29ad496bfab Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 8 Feb 2022 15:58:17 +0100 Subject: [PATCH 07/14] bugfixes for test code --- linux/boardtest/UartTestClass.cpp | 40 +++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/linux/boardtest/UartTestClass.cpp b/linux/boardtest/UartTestClass.cpp index 8cdf3ce7..d39bcfdf 100644 --- a/linux/boardtest/UartTestClass.cpp +++ b/linux/boardtest/UartTestClass.cpp @@ -1,3 +1,4 @@ +#include #include "UartTestClass.h" #if defined(RASPBERRY_PI) #include "rpiConfig.h" @@ -12,6 +13,7 @@ #include "fsfw/globalfunctions/CRC.h" #include "fsfw/globalfunctions/arrayprinter.h" #include "fsfw/serviceinterface.h" +#include "fsfw/globalfunctions/DleEncoder.h" #include "mission/devices/devicedefinitions/SCEXDefinitions.h" #define GPS_REPLY_WIRETAPPING 0 @@ -161,20 +163,38 @@ void UartTestClass::scexInit() { } void UartTestClass::scexPeriodic() { + auto dleEncoder = DleEncoder(); + std::array tmpCmdBuf = {}; // Send ping command - cmdBuf[0] = scex::CMD_PING; + tmpCmdBuf[0] = scex::CMD_PING; // These two fields are the packet counter and the total packet count. Those are 1 and 1 for each // telecommand so far - cmdBuf[1] = 1; - cmdBuf[2] = 1; + tmpCmdBuf[1] = 1; + tmpCmdBuf[2] = 1; uint16_t userDataLen = 0; - cmdBuf[3] = (userDataLen >> 8) & 0xff; - cmdBuf[4] = userDataLen & 0xff; - uint16_t crc = CRC::crc16ccitt(cmdBuf.data(), 5); - cmdBuf[5] = (crc >> 8) & 0xff; - cmdBuf[6] = crc & 0xff; - size_t bytesWritten = write(serialPort, cmdBuf.data(), 7); - if (bytesWritten != 7) { + tmpCmdBuf[3] = (userDataLen >> 8) & 0xff; + tmpCmdBuf[4] = userDataLen & 0xff; + uint16_t crc = CRC::crc16ccitt(tmpCmdBuf.data(), 5); + tmpCmdBuf[5] = (crc >> 8) & 0xff; + tmpCmdBuf[6] = crc & 0xff; + + size_t encodedLen = 0; + ReturnValue_t result = dleEncoder.encode(tmpCmdBuf.data(), 7, cmdBuf.data(), + cmdBuf.size(), &encodedLen, true); + if(result != HasReturnvaluesIF::RETURN_OK) { + sif::warning << "UartTestClass::scexInit: Encoding failed" << std::endl; + return; + } + arrayprinter::print(cmdBuf.data(), 9); + size_t bytesWritten = write(serialPort, cmdBuf.data(), encodedLen); + + if (bytesWritten != encodedLen) { + sif::warning << "Sending ping command to solar experiment failed" << std::endl; + } + + TaskFactory::delayTask(20); + bytesWritten = write(serialPort, cmdBuf.data(), encodedLen); + if (bytesWritten != encodedLen) { sif::warning << "Sending ping command to solar experiment failed" << std::endl; } From 0108a913e6341200a06fb446d7b3dd5bb3d60cf6 Mon Sep 17 00:00:00 2001 From: IRS Cleanroom Laptop Date: Tue, 8 Feb 2022 17:23:02 +0100 Subject: [PATCH 08/14] ping test working --- linux/boardtest/UartTestClass.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/linux/boardtest/UartTestClass.cpp b/linux/boardtest/UartTestClass.cpp index d39bcfdf..796e5719 100644 --- a/linux/boardtest/UartTestClass.cpp +++ b/linux/boardtest/UartTestClass.cpp @@ -150,9 +150,10 @@ void UartTestClass::scexInit() { // Use non-canonical mode and clear echo flag tty.c_lflag &= ~(ICANON | ECHO); - // Non-blocking mode + // Non-blocking mode, read until either line is 0.1 second idle or maximum of 255 bytes are + // received in one go tty.c_cc[VTIME] = 1; // In units of 0.1 seconds - tty.c_cc[VMIN] = 1; + tty.c_cc[VMIN] = 255; // Read up to 255 bytes if (tcsetattr(serialPort, TCSANOW, &tty) != 0) { sif::warning << "tcsetattr call failed with error [" << errno << ", " << strerror(errno) From 7005314d4b66850d98ac03a11588641a39d3d831 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 9 Feb 2022 12:07:29 +0100 Subject: [PATCH 09/14] apply clang-format --- linux/boardtest/UartTestClass.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/linux/boardtest/UartTestClass.cpp b/linux/boardtest/UartTestClass.cpp index 796e5719..b8e7da10 100644 --- a/linux/boardtest/UartTestClass.cpp +++ b/linux/boardtest/UartTestClass.cpp @@ -1,5 +1,6 @@ -#include #include "UartTestClass.h" + +#include #if defined(RASPBERRY_PI) #include "rpiConfig.h" #elif defined(XIPHOS_Q7S) @@ -11,9 +12,9 @@ #include // write(), read(), close() #include "fsfw/globalfunctions/CRC.h" +#include "fsfw/globalfunctions/DleEncoder.h" #include "fsfw/globalfunctions/arrayprinter.h" #include "fsfw/serviceinterface.h" -#include "fsfw/globalfunctions/DleEncoder.h" #include "mission/devices/devicedefinitions/SCEXDefinitions.h" #define GPS_REPLY_WIRETAPPING 0 @@ -152,8 +153,8 @@ void UartTestClass::scexInit() { // Non-blocking mode, read until either line is 0.1 second idle or maximum of 255 bytes are // received in one go - tty.c_cc[VTIME] = 1; // In units of 0.1 seconds - tty.c_cc[VMIN] = 255; // Read up to 255 bytes + tty.c_cc[VTIME] = 1; // In units of 0.1 seconds + tty.c_cc[VMIN] = 255; // Read up to 255 bytes if (tcsetattr(serialPort, TCSANOW, &tty) != 0) { sif::warning << "tcsetattr call failed with error [" << errno << ", " << strerror(errno) @@ -180,11 +181,11 @@ void UartTestClass::scexPeriodic() { tmpCmdBuf[6] = crc & 0xff; size_t encodedLen = 0; - ReturnValue_t result = dleEncoder.encode(tmpCmdBuf.data(), 7, cmdBuf.data(), - cmdBuf.size(), &encodedLen, true); - if(result != HasReturnvaluesIF::RETURN_OK) { - sif::warning << "UartTestClass::scexInit: Encoding failed" << std::endl; - return; + ReturnValue_t result = + dleEncoder.encode(tmpCmdBuf.data(), 7, cmdBuf.data(), cmdBuf.size(), &encodedLen, true); + if (result != HasReturnvaluesIF::RETURN_OK) { + sif::warning << "UartTestClass::scexInit: Encoding failed" << std::endl; + return; } arrayprinter::print(cmdBuf.data(), 9); size_t bytesWritten = write(serialPort, cmdBuf.data(), encodedLen); From 4d154b7cee4afead4e4212279c1c6df73aaf1390 Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Wed, 9 Feb 2022 21:38:56 +0100 Subject: [PATCH 10/14] reworked cmake, unfortunately a big one due to interdependence - /mission is a library now, in preparation of unittests (which bring their own main) - eive-simple is now only available in bsp=arm/q7s (but is still not compiling) - watchdog and simple are their own executables, not configurations any more - moved some q7s specific code into /bsp-q7s to flatten if-hierarchy in main CMakeLists.txt - compiler and linker options are not globally applied to all targets - linux is the default fsfw osal now, as current code does not compile on hosted --- .gitignore | 3 + CMakeLists.txt | 212 ++++++++++----------- bsp_hosted/CMakeLists.txt | 2 +- bsp_hosted/boardconfig/CMakeLists.txt | 4 +- bsp_hosted/fsfwconfig/CMakeLists.txt | 8 +- bsp_q7s/CMakeLists.txt | 36 ++-- bsp_q7s/boardconfig/CMakeLists.txt | 9 +- bsp_q7s/boardconfig/q7sConfig.h.in | 2 - bsp_q7s/boardtest/CMakeLists.txt | 10 +- bsp_q7s/callbacks/CMakeLists.txt | 2 +- bsp_q7s/comIF/CMakeLists.txt | 2 +- bsp_q7s/core/CMakeLists.txt | 6 +- bsp_q7s/devices/CMakeLists.txt | 2 +- bsp_q7s/devices/startracker/CMakeLists.txt | 2 +- bsp_q7s/gpio/CMakeLists.txt | 2 +- bsp_q7s/memory/CMakeLists.txt | 2 +- bsp_q7s/simple/CMakeLists.txt | 2 +- bsp_q7s/simple/simple.cpp | 4 +- cmake/HardwareOsPostConfig.cmake | 16 +- cmake/PreProjectConfig.cmake | 2 + common/config/CMakeLists.txt | 4 +- linux/boardtest/CMakeLists.txt | 2 +- linux/csp/CMakeLists.txt | 2 +- linux/devices/CMakeLists.txt | 2 +- linux/fsfwconfig/CMakeLists.txt | 8 +- linux/obc/CMakeLists.txt | 2 +- linux/utility/CMakeLists.txt | 2 +- mission/CMakeLists.txt | 2 + mission/core/CMakeLists.txt | 2 +- mission/devices/CMakeLists.txt | 2 +- mission/memory/CMakeLists.txt | 2 +- mission/tmtc/CMakeLists.txt | 2 +- mission/utility/CMakeLists.txt | 2 +- test/testtasks/CMakeLists.txt | 4 +- watchdog/CMakeLists.txt | 2 +- watchdog/Watchdog.h | 3 +- 36 files changed, 200 insertions(+), 171 deletions(-) diff --git a/.gitignore b/.gitignore index c51106ea..2f7acd11 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,9 @@ !misc/eclipse/**/.cproject !misc/eclipse/**/.project +#vscode +.vscode + # Python __pycache__ .idea diff --git a/CMakeLists.txt b/CMakeLists.txt index 17796924..a3dd1d7c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,18 +13,13 @@ cmake_minimum_required(VERSION 3.13) set(CMAKE_SCRIPT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") -if(TGT_BSP MATCHES "arm/q7s") - option(EIVE_BUILD_WATCHDOG "Compile the OBSW watchdog insted" OFF) - option(BUILD_Q7S_SIMPLE_MODE OFF "Simple mode with a minimal main function") -endif() - option(EIVE_BUILD_UNITTESTS "Build Catch2 unittests" OFF) option(EIVE_ADD_ETL_LIB "Add ETL library" ON) option(EIVE_ADD_JSON_LIB "Add JSON library" ON) option(EIVE_SYSROOT_MAGIC "Perform sysroot magic which might not be necessary" OFF) if(NOT FSFW_OSAL) - set(FSFW_OSAL host CACHE STRING "OS for the FSFW.") + set(FSFW_OSAL linux CACHE STRING "OS for the FSFW.") endif() if(TGT_BSP MATCHES "arm/raspberrypi" OR TGT_BSP MATCHES "arm/beagleboneblack") @@ -35,18 +30,8 @@ endif() include(${CMAKE_SCRIPT_PATH}/PreProjectConfig.cmake) pre_project_config() -if(EIVE_BUILD_WATCHDOG) - set(PROJECT_NAME_TO_SET eive-watchdog) -elseif(EIVE_BUILD_UNITTESTS) - set(PROJECT_NAME_TO_SET eive-unittest) -elseif(TGT_BSP MATCHES "arm/q7s") - set(PROJECT_NAME_TO_SET eive-obsw-$ENV{USERNAME}) -else() - set(PROJECT_NAME_TO_SET eive-obsw) -endif() - # Project Name -project(${PROJECT_NAME_TO_SET} ASM C CXX) +project(eive-obsw ASM C CXX) ################################################################################ # Pre-Sources preparation @@ -57,8 +42,11 @@ set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED True) # Set names and variables -set(TARGET_NAME ${CMAKE_PROJECT_NAME}) +set(OBSW_NAME ${CMAKE_PROJECT_NAME}) +set(WATCHDOG_NAME eive-watchdog) +set(SIMPLE_OBSW_NAME eive-simple) set(LIB_FSFW_NAME fsfw) +set(LIB_EIVE_MISSION eive-mission) set(LIB_ETL_NAME etl) set(LIB_CSP_NAME libcsp) set(LIB_LWGPS_NAME lwgps) @@ -71,7 +59,6 @@ set(LIB_JSON_NAME nlohmann_json::nlohmann_json) # Set path names set(FSFW_PATH fsfw) -set(MISSION_PATH mission) set(TEST_PATH test/testtasks) set(UNITTEST_PATH unittest) set(LINUX_PATH linux) @@ -80,6 +67,7 @@ set(WATCHDOG_PATH watchdog) set(COMMON_CONFIG_PATH ${COMMON_PATH}/config) set(UNITTEST_CFG_PATH ${UNITTEST_PATH}/testcfg) +set(LIB_EIVE_MISSION_PATH mission) set(LIB_CSP_PATH ${THIRD_PARTY_FOLDER}/libcsp) set(LIB_ETL_PATH ${THIRD_PARTY_FOLDER}/etl) set(LIB_CATCH2_PATH ${THIRD_PARTY_FOLDER}/Catch2) @@ -140,18 +128,17 @@ if(EIVE_BUILD_UNITTESTS) endif() # Configuration files -if(NOT EIVE_BUILD_WATCHDOG) - configure_file(${COMMON_CONFIG_PATH}/commonConfig.h.in commonConfig.h) - configure_file(${FSFW_CONFIG_PATH}/FSFWConfig.h.in FSFWConfig.h) - configure_file(${FSFW_CONFIG_PATH}/OBSWConfig.h.in OBSWConfig.h) - if(TGT_BSP MATCHES "arm/q7s") - configure_file(${BSP_PATH}/boardconfig/q7sConfig.h.in q7sConfig.h) - elseif(TGT_BSP MATCHES "arm/raspberrypi") - configure_file(${BSP_PATH}/boardconfig/rpiConfig.h.in rpiConfig.h) - endif() +configure_file(${COMMON_CONFIG_PATH}/commonConfig.h.in commonConfig.h) +configure_file(${FSFW_CONFIG_PATH}/FSFWConfig.h.in FSFWConfig.h) +configure_file(${FSFW_CONFIG_PATH}/OBSWConfig.h.in OBSWConfig.h) +if(TGT_BSP MATCHES "arm/q7s") + configure_file(${BSP_PATH}/boardconfig/q7sConfig.h.in q7sConfig.h) +elseif(TGT_BSP MATCHES "arm/raspberrypi") + configure_file(${BSP_PATH}/boardconfig/rpiConfig.h.in rpiConfig.h) endif() + configure_file(${WATCHDOG_PATH}/watchdogConf.h.in watchdogConf.h) # Set common config path for FSFW @@ -164,8 +151,48 @@ set(FSFW_ADDITIONAL_INC_PATHS # Executable and Sources ################################################################################ +#global compiler options need to be set before adding executables +if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + add_compile_options( + "-Wall" + "-Wextra" + "-Wimplicit-fallthrough=1" + "-Wno-unused-parameter" + "-Wno-psabi" + ) + message(STATUS "goes here") + # Remove unused sections. + add_compile_options( + "-ffunction-sections" + "-fdata-sections" + ) + + # Removed unused sections. + add_link_options( + "-Wl,--gc-sections" + ) + +elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + set(COMPILER_FLAGS "/permissive-") +endif() + + +add_library(${LIB_EIVE_MISSION}) + + # Add executable -add_executable(${TARGET_NAME}) +add_executable(${OBSW_NAME}) + +#watchdog +add_executable(${WATCHDOG_NAME} EXCLUDE_FROM_ALL) +add_subdirectory(${WATCHDOG_PATH}) +target_link_libraries(${WATCHDOG_NAME} PUBLIC + ${LIB_CXX_FS} +) + +target_include_directories(${WATCHDOG_NAME} PUBLIC + ${CMAKE_BINARY_DIR} +) if(EIVE_ADD_ETL_LIB) add_subdirectory(${LIB_ETL_PATH}) @@ -175,75 +202,74 @@ if(EIVE_ADD_JSON_LIB) add_subdirectory(${LIB_JSON_PATH}) endif() -if(NOT EIVE_BUILD_WATCHDOG) - if(NOT EIVE_BUILD_UNITTESTS) - if(EIVE_ADD_LINUX_FILES) - add_subdirectory(${LIB_ARCSEC_PATH}) - add_subdirectory(${LINUX_PATH}) - endif() - add_subdirectory(${BSP_PATH}) - if(ADD_CSP_LIB) - add_subdirectory(${LIB_CSP_PATH}) - endif() + +if(NOT EIVE_BUILD_UNITTESTS) + if(EIVE_ADD_LINUX_FILES) + add_subdirectory(${LIB_ARCSEC_PATH}) + add_subdirectory(${LINUX_PATH}) + endif() + add_subdirectory(${BSP_PATH}) + if(ADD_CSP_LIB) + add_subdirectory(${LIB_CSP_PATH}) endif() - add_subdirectory(${COMMON_PATH}) endif() -if((NOT BUILD_Q7S_SIMPLE_MODE) AND (NOT EIVE_BUILD_WATCHDOG)) - add_subdirectory(${LIB_LWGPS_PATH}) - add_subdirectory(${FSFW_PATH}) - add_subdirectory(${MISSION_PATH}) - add_subdirectory(${TEST_PATH}) -endif() +add_subdirectory(${COMMON_PATH}) + + + +add_subdirectory(${LIB_LWGPS_PATH}) +add_subdirectory(${FSFW_PATH}) +add_subdirectory(${LIB_EIVE_MISSION_PATH}) +add_subdirectory(${TEST_PATH}) + if(EIVE_BUILD_UNITTESTS) # add_subdirectory(${LIB_CATCH2_PATH}) add_subdirectory(${UNITTEST_PATH}) endif() -if(EIVE_BUILD_WATCHDOG) - add_subdirectory(${WATCHDOG_PATH}) -endif() - ################################################################################ # Post-Sources preparation ################################################################################ -set_property(CACHE FSFW_OSAL PROPERTY STRINGS host linux) -if((NOT BUILD_Q7S_SIMPLE_MODE) AND (NOT EIVE_BUILD_WATCHDOG)) - # Add libraries for all sources. - target_link_libraries(${TARGET_NAME} PRIVATE - ${LIB_FSFW_NAME} - ${LIB_OS_NAME} - ${LIB_LWGPS_NAME} + +# Add libraries +target_link_libraries(${LIB_EIVE_MISSION} PUBLIC + ${LIB_FSFW_NAME} + ${LIB_LWGPS_NAME} + ${LIB_OS_NAME} +) + +target_link_libraries(${OBSW_NAME} PRIVATE + ${LIB_EIVE_MISSION} +) + +if(TGT_BSP MATCHES "arm/q7s") + target_link_libraries(${LIB_EIVE_MISSION} PUBLIC + ${LIB_ARCSEC} + ${LIB_GPS} ) - - if(TGT_BSP MATCHES "arm/q7s") - target_link_libraries(${TARGET_NAME} PRIVATE - ${LIB_ARCSEC} - ${LIB_GPS} - ) - endif() endif() -if(NOT EIVE_BUILD_WATCHDOG) - if(ADD_CSP_LIB) - target_link_libraries(${TARGET_NAME} PRIVATE - ${LIB_CSP_NAME} - ) - endif() + +if(ADD_CSP_LIB) + target_link_libraries(${OBSW_NAME} PRIVATE + ${LIB_CSP_NAME} + ) endif() + if(EIVE_ADD_ETL_LIB) - target_link_libraries(${TARGET_NAME} PRIVATE + target_link_libraries(${LIB_EIVE_MISSION} PUBLIC ${LIB_ETL_NAME} ) endif() if(EIVE_ADD_JSON_LIB) - target_link_libraries(${TARGET_NAME} PRIVATE + target_link_libraries(${LIB_EIVE_MISSION} PUBLIC ${LIB_JSON_NAME} ) endif() @@ -254,57 +280,29 @@ if(EIVE_BUILD_UNITTESTS) ) endif() -target_link_libraries(${TARGET_NAME} PRIVATE +target_link_libraries(${LIB_EIVE_MISSION} PUBLIC ${LIB_CXX_FS} ) # Add include paths for all sources. -target_include_directories(${TARGET_NAME} PRIVATE +target_include_directories(${LIB_EIVE_MISSION} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${FSFW_CONFIG_PATH} ${CMAKE_CURRENT_BINARY_DIR} ${LIB_ARCSEC_PATH} -) +) if(TGT_BSP MATCHES "arm/q7s") - target_include_directories(${TARGET_NAME} PRIVATE + target_include_directories(${LIB_EIVE_MISSION} PUBLIC ${ARCSEC_LIB_PATH} ) endif() -if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - set(WARNING_FLAGS - -Wall - -Wextra - -Wimplicit-fallthrough=1 - -Wno-unused-parameter - -Wno-psabi - ) - - # Remove unused sections. - target_compile_options(${TARGET_NAME} PRIVATE - "-ffunction-sections" - "-fdata-sections" - ) - - # Removed unused sections. - target_link_options(${TARGET_NAME} PRIVATE - "-Wl,--gc-sections" - ) - -elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") - set(COMPILER_FLAGS "/permissive-") -endif() - if(CMAKE_VERBOSE) message(STATUS "Warning flags: ${WARNING_FLAGS}") endif() - -# Compile options for all sources. -target_compile_options(${TARGET_NAME} PRIVATE - ${WARNING_FLAGS} -) + if(${CMAKE_CROSSCOMPILING}) include (${CMAKE_SCRIPT_PATH}/HardwareOsPostConfig.cmake) @@ -336,9 +334,9 @@ string(CONCAT POST_BUILD_COMMENT ) add_custom_command( - TARGET ${TARGET_NAME} + TARGET ${OBSW_NAME} POST_BUILD - COMMAND ${CMAKE_SIZE} ${TARGET_NAME}${FILE_SUFFIX} + COMMAND ${CMAKE_SIZE} ${OBSW_NAME}${FILE_SUFFIX} COMMENT ${POST_BUILD_COMMENT} ) diff --git a/bsp_hosted/CMakeLists.txt b/bsp_hosted/CMakeLists.txt index b8a09a88..7787cf7e 100644 --- a/bsp_hosted/CMakeLists.txt +++ b/bsp_hosted/CMakeLists.txt @@ -1,4 +1,4 @@ -target_sources(${TARGET_NAME} PUBLIC +target_sources(${OBSW_NAME} PUBLIC InitMission.cpp main.cpp ObjectFactory.cpp diff --git a/bsp_hosted/boardconfig/CMakeLists.txt b/bsp_hosted/boardconfig/CMakeLists.txt index c32b326d..81c8c93d 100644 --- a/bsp_hosted/boardconfig/CMakeLists.txt +++ b/bsp_hosted/boardconfig/CMakeLists.txt @@ -1,8 +1,8 @@ -target_sources(${TARGET_NAME} PRIVATE +target_sources(${OBSW_NAME} PRIVATE print.c ) -target_include_directories(${TARGET_NAME} PUBLIC +target_include_directories(${OBSW_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ) diff --git a/bsp_hosted/fsfwconfig/CMakeLists.txt b/bsp_hosted/fsfwconfig/CMakeLists.txt index fc961da8..04a8907e 100644 --- a/bsp_hosted/fsfwconfig/CMakeLists.txt +++ b/bsp_hosted/fsfwconfig/CMakeLists.txt @@ -1,21 +1,21 @@ -target_sources(${TARGET_NAME} PRIVATE +target_sources(${OBSW_NAME} PRIVATE ipc/MissionMessageTypes.cpp ) -target_include_directories(${TARGET_NAME} PUBLIC +target_include_directories(${OBSW_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ) # If a special translation file for object IDs exists, compile it. if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/objects/translateObjects.cpp") - target_sources(${TARGET_NAME} PRIVATE + target_sources(${OBSW_NAME} PRIVATE objects/translateObjects.cpp ) endif() # If a special translation file for events exists, compile it. if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/objects/translateObjects.cpp") - target_sources(${TARGET_NAME} PRIVATE + target_sources(${OBSW_NAME} PRIVATE events/translateEvents.cpp ) endif() diff --git a/bsp_q7s/CMakeLists.txt b/bsp_q7s/CMakeLists.txt index b2c24d5f..c4f85bd2 100644 --- a/bsp_q7s/CMakeLists.txt +++ b/bsp_q7s/CMakeLists.txt @@ -1,17 +1,29 @@ -target_sources(${TARGET_NAME} PUBLIC +#simple mode +add_executable(${SIMPLE_OBSW_NAME} EXCLUDE_FROM_ALL) +target_compile_definitions(${SIMPLE_OBSW_NAME} PRIVATE "Q7S_SIMPLE_MODE") +target_sources(${SIMPLE_OBSW_NAME} PUBLIC + main.cpp +) +#I think this is unintentional? (produces linker errors for stuff in /linux) +target_link_libraries(${SIMPLE_OBSW_NAME} PUBLIC + ${LIB_FSFW_NAME} +) +target_compile_definitions(${SIMPLE_OBSW_NAME} PRIVATE "Q7S_SIMPLE_MODE") +add_subdirectory(simple) + + +target_sources(${OBSW_NAME} PUBLIC main.cpp ) add_subdirectory(boardtest) -if(Q7S_SIMPLE_MODE) - add_subdirectory(simple) -else() - add_subdirectory(boardconfig) - add_subdirectory(comIF) - add_subdirectory(gpio) - add_subdirectory(core) - add_subdirectory(memory) - add_subdirectory(callbacks) - add_subdirectory(devices) -endif() + +add_subdirectory(boardconfig) +add_subdirectory(comIF) +add_subdirectory(gpio) +add_subdirectory(core) +add_subdirectory(memory) +add_subdirectory(callbacks) +add_subdirectory(devices) + diff --git a/bsp_q7s/boardconfig/CMakeLists.txt b/bsp_q7s/boardconfig/CMakeLists.txt index 67fbaf88..feefbe5a 100644 --- a/bsp_q7s/boardconfig/CMakeLists.txt +++ b/bsp_q7s/boardconfig/CMakeLists.txt @@ -1,7 +1,12 @@ -target_sources(${TARGET_NAME} PRIVATE +target_sources(${OBSW_NAME} PRIVATE print.c ) -target_include_directories(${TARGET_NAME} PUBLIC +target_sources(${SIMPLE_OBSW_NAME} PRIVATE + print.c +) + + +target_include_directories(${OBSW_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ) diff --git a/bsp_q7s/boardconfig/q7sConfig.h.in b/bsp_q7s/boardconfig/q7sConfig.h.in index 43283ea1..33649000 100644 --- a/bsp_q7s/boardconfig/q7sConfig.h.in +++ b/bsp_q7s/boardconfig/q7sConfig.h.in @@ -3,8 +3,6 @@ #include -#cmakedefine01 Q7S_SIMPLE_MODE - /*******************************************************************/ /** All of the following flags should be enabled for mission code */ /*******************************************************************/ diff --git a/bsp_q7s/boardtest/CMakeLists.txt b/bsp_q7s/boardtest/CMakeLists.txt index 1cda38ca..29c9f1e1 100644 --- a/bsp_q7s/boardtest/CMakeLists.txt +++ b/bsp_q7s/boardtest/CMakeLists.txt @@ -1,8 +1,10 @@ -target_sources(${TARGET_NAME} PRIVATE +target_sources(${OBSW_NAME} PRIVATE FileSystemTest.cpp Q7STestTask.cpp ) - - - +if(EIVE_BUILD_Q7S_SIMPLE_MODE) + target_sources(${SIMPLE_OBSW_NAME} PRIVATE + FileSystemTest.cpp + ) +endif() \ No newline at end of file diff --git a/bsp_q7s/callbacks/CMakeLists.txt b/bsp_q7s/callbacks/CMakeLists.txt index a85bf6fb..30268007 100644 --- a/bsp_q7s/callbacks/CMakeLists.txt +++ b/bsp_q7s/callbacks/CMakeLists.txt @@ -1,4 +1,4 @@ -target_sources(${TARGET_NAME} PRIVATE +target_sources(${OBSW_NAME} PRIVATE rwSpiCallback.cpp gnssCallback.cpp pcduSwitchCb.cpp diff --git a/bsp_q7s/comIF/CMakeLists.txt b/bsp_q7s/comIF/CMakeLists.txt index 0599b73f..fe4910f2 100644 --- a/bsp_q7s/comIF/CMakeLists.txt +++ b/bsp_q7s/comIF/CMakeLists.txt @@ -1,4 +1,4 @@ -target_sources(${TARGET_NAME} PRIVATE +target_sources(${OBSW_NAME} PRIVATE ) diff --git a/bsp_q7s/core/CMakeLists.txt b/bsp_q7s/core/CMakeLists.txt index fc397f2f..8731b7a3 100644 --- a/bsp_q7s/core/CMakeLists.txt +++ b/bsp_q7s/core/CMakeLists.txt @@ -1,6 +1,10 @@ -target_sources(${TARGET_NAME} PRIVATE +target_sources(${OBSW_NAME} PRIVATE CoreController.cpp obsw.cpp InitMission.cpp ObjectFactory.cpp ) + +target_sources(${SIMPLE_OBSW_NAME} PRIVATE + InitMission.cpp +) diff --git a/bsp_q7s/devices/CMakeLists.txt b/bsp_q7s/devices/CMakeLists.txt index 70705e83..eed234f5 100644 --- a/bsp_q7s/devices/CMakeLists.txt +++ b/bsp_q7s/devices/CMakeLists.txt @@ -1,4 +1,4 @@ -target_sources(${TARGET_NAME} PRIVATE +target_sources(${OBSW_NAME} PRIVATE PlocSupervisorHandler.cpp PlocUpdater.cpp PlocMemoryDumper.cpp diff --git a/bsp_q7s/devices/startracker/CMakeLists.txt b/bsp_q7s/devices/startracker/CMakeLists.txt index 28704219..be2bf861 100644 --- a/bsp_q7s/devices/startracker/CMakeLists.txt +++ b/bsp_q7s/devices/startracker/CMakeLists.txt @@ -1,4 +1,4 @@ -target_sources(${TARGET_NAME} PRIVATE +target_sources(${OBSW_NAME} PRIVATE StarTrackerHandler.cpp StarTrackerJsonCommands.cpp ArcsecDatalinkLayer.cpp diff --git a/bsp_q7s/gpio/CMakeLists.txt b/bsp_q7s/gpio/CMakeLists.txt index dd657546..89bb24bb 100644 --- a/bsp_q7s/gpio/CMakeLists.txt +++ b/bsp_q7s/gpio/CMakeLists.txt @@ -1,3 +1,3 @@ -target_sources(${TARGET_NAME} PRIVATE +target_sources(${OBSW_NAME} PRIVATE gpioCallbacks.cpp ) diff --git a/bsp_q7s/memory/CMakeLists.txt b/bsp_q7s/memory/CMakeLists.txt index 6c7d0a94..0658242a 100644 --- a/bsp_q7s/memory/CMakeLists.txt +++ b/bsp_q7s/memory/CMakeLists.txt @@ -1,4 +1,4 @@ -target_sources(${TARGET_NAME} PRIVATE +target_sources(${OBSW_NAME} PRIVATE FileSystemHandler.cpp SdCardManager.cpp scratchApi.cpp diff --git a/bsp_q7s/simple/CMakeLists.txt b/bsp_q7s/simple/CMakeLists.txt index 399a1dd3..77cbd076 100644 --- a/bsp_q7s/simple/CMakeLists.txt +++ b/bsp_q7s/simple/CMakeLists.txt @@ -1,3 +1,3 @@ -target_sources(${TARGET_NAME} PRIVATE +target_sources(${SIMPLE_OBSW_NAME} PRIVATE simple.cpp ) diff --git a/bsp_q7s/simple/simple.cpp b/bsp_q7s/simple/simple.cpp index b300e456..a86fd459 100644 --- a/bsp_q7s/simple/simple.cpp +++ b/bsp_q7s/simple/simple.cpp @@ -1,5 +1,7 @@ #include "simple.h" +#include "iostream" + #include "q7sConfig.h" #if Q7S_SIMPLE_ADD_FILE_SYSTEM_TEST == 1 @@ -7,7 +9,7 @@ #endif int simple::simple() { - cout << "-- Q7S Simple Application --" << endl; + std::cout << "-- Q7S Simple Application --" << std::endl; #if Q7S_SIMPLE_ADD_FILE_SYSTEM_TEST == 1 { FileSystemTest fileSystemTest; } #endif diff --git a/cmake/HardwareOsPostConfig.cmake b/cmake/HardwareOsPostConfig.cmake index 2492b9bb..3000366b 100644 --- a/cmake/HardwareOsPostConfig.cmake +++ b/cmake/HardwareOsPostConfig.cmake @@ -3,7 +3,7 @@ function(post_source_hw_os_config) if(LINK_LWIP) message(STATUS "Linking against ${LIB_LWIP_NAME} lwIP library") if(LIB_LWIP_NAME) - target_link_libraries(${TARGET_NAME} PUBLIC + target_link_libraries(${OBSW_NAME} PUBLIC ${LIB_LWIP_NAME} ) else() @@ -12,7 +12,7 @@ if(LINK_LWIP) endif() if(LINKER_SCRIPT) - target_link_options(${TARGET_NAME} PRIVATE + add_link_options( -T${LINKER_SCRIPT} ) endif() @@ -35,20 +35,20 @@ if(CMAKE_VERBOSE) endif() # Generator expression. Can be used to set different C, CXX and ASM flags. -target_compile_options(${TARGET_NAME} PRIVATE +add_compile_options( $<$:${C_DEFS} ${C_FLAGS}> $<$:${CXX_DEFS} ${CXX_FLAGS}> $<$:${ASM_FLAGS}> ) -set(STRIPPED_TARGET_NAME ${TARGET_NAME}-stripped) +set(STRIPPED_OBSW_NAME ${OBSW_NAME}-stripped) add_custom_command( - TARGET ${TARGET_NAME} + TARGET ${OBSW_NAME} POST_BUILD - COMMAND ${CMAKE_STRIP} --strip-all ${TARGET_NAME} -o ${STRIPPED_TARGET_NAME} - BYPRODUCTS ${STRIPPED_TARGET_NAME} - COMMENT "Generating stripped executable ${STRIPPED_TARGET_NAME}.." + COMMAND ${CMAKE_STRIP} --strip-all ${OBSW_NAME} -o ${STRIPPED_OBSW_NAME} + BYPRODUCTS ${STRIPPED_OBSW_NAME} + COMMENT "Generating stripped executable ${STRIPPED_OBSW_NAME}.." ) endfunction() \ No newline at end of file diff --git a/cmake/PreProjectConfig.cmake b/cmake/PreProjectConfig.cmake index 9f1790bb..fa64c7d8 100644 --- a/cmake/PreProjectConfig.cmake +++ b/cmake/PreProjectConfig.cmake @@ -9,6 +9,7 @@ if(DEFINED TGT_BSP) endif() endif() + # Disable compiler checks for cross-compiling. if(FSFW_OSAL MATCHES linux AND TGT_BSP) if(TGT_BSP MATCHES "arm/q7s") @@ -16,6 +17,7 @@ if(FSFW_OSAL MATCHES linux AND TGT_BSP) "${CMAKE_SCRIPT_PATH}/Q7SCrossCompileConfig.cmake" PARENT_SCOPE ) + elseif(TGT_BSP MATCHES "arm/raspberrypi") if(NOT DEFINED ENV{LINUX_ROOTFS}) if(NOT DEFINED LINUX_ROOTFS) diff --git a/common/config/CMakeLists.txt b/common/config/CMakeLists.txt index 5c4b4942..00848561 100644 --- a/common/config/CMakeLists.txt +++ b/common/config/CMakeLists.txt @@ -1,7 +1,7 @@ -target_include_directories(${TARGET_NAME} PRIVATE +target_include_directories(${OBSW_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ) -target_sources(${TARGET_NAME} PRIVATE +target_sources(${OBSW_NAME} PRIVATE commonConfig.cpp ) \ No newline at end of file diff --git a/linux/boardtest/CMakeLists.txt b/linux/boardtest/CMakeLists.txt index 0fa4e322..1fa4b290 100644 --- a/linux/boardtest/CMakeLists.txt +++ b/linux/boardtest/CMakeLists.txt @@ -1,4 +1,4 @@ -target_sources(${TARGET_NAME} PRIVATE +target_sources(${OBSW_NAME} PRIVATE LibgpiodTest.cpp I2cTestClass.cpp SpiTestClass.cpp diff --git a/linux/csp/CMakeLists.txt b/linux/csp/CMakeLists.txt index b5b2768e..f1ebb028 100644 --- a/linux/csp/CMakeLists.txt +++ b/linux/csp/CMakeLists.txt @@ -1,4 +1,4 @@ -target_sources(${TARGET_NAME} PUBLIC +target_sources(${OBSW_NAME} PUBLIC CspComIF.cpp CspCookie.cpp ) diff --git a/linux/devices/CMakeLists.txt b/linux/devices/CMakeLists.txt index b02c8e57..8d3272a1 100644 --- a/linux/devices/CMakeLists.txt +++ b/linux/devices/CMakeLists.txt @@ -1,4 +1,4 @@ -target_sources(${TARGET_NAME} PRIVATE +target_sources(${OBSW_NAME} PRIVATE SolarArrayDeploymentHandler.cpp SusHandler.cpp ) diff --git a/linux/fsfwconfig/CMakeLists.txt b/linux/fsfwconfig/CMakeLists.txt index 277b89db..ea8375fa 100644 --- a/linux/fsfwconfig/CMakeLists.txt +++ b/linux/fsfwconfig/CMakeLists.txt @@ -1,22 +1,22 @@ -target_sources(${TARGET_NAME} PRIVATE +target_sources(${OBSW_NAME} PRIVATE ipc/MissionMessageTypes.cpp pollingsequence/pollingSequenceFactory.cpp ) -target_include_directories(${TARGET_NAME} PUBLIC +target_include_directories(${OBSW_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ) # If a special translation file for object IDs exists, compile it. if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/objects/translateObjects.cpp") - target_sources(${TARGET_NAME} PRIVATE + target_sources(${OBSW_NAME} PRIVATE objects/translateObjects.cpp ) endif() # If a special translation file for events exists, compile it. if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/objects/translateObjects.cpp") - target_sources(${TARGET_NAME} PRIVATE + target_sources(${OBSW_NAME} PRIVATE events/translateEvents.cpp ) endif() diff --git a/linux/obc/CMakeLists.txt b/linux/obc/CMakeLists.txt index d59a1a5f..e295603e 100644 --- a/linux/obc/CMakeLists.txt +++ b/linux/obc/CMakeLists.txt @@ -1,4 +1,4 @@ -target_sources(${TARGET_NAME} PUBLIC +target_sources(${OBSW_NAME} PUBLIC PapbVcInterface.cpp Ptme.cpp PdecHandler.cpp diff --git a/linux/utility/CMakeLists.txt b/linux/utility/CMakeLists.txt index a3387531..56937cea 100644 --- a/linux/utility/CMakeLists.txt +++ b/linux/utility/CMakeLists.txt @@ -1,4 +1,4 @@ -target_sources(${TARGET_NAME} PUBLIC +target_sources(${OBSW_NAME} PUBLIC utility.cpp ) diff --git a/mission/CMakeLists.txt b/mission/CMakeLists.txt index 876201a8..b0fc4d00 100644 --- a/mission/CMakeLists.txt +++ b/mission/CMakeLists.txt @@ -3,3 +3,5 @@ add_subdirectory(devices) add_subdirectory(utility) add_subdirectory(memory) add_subdirectory(tmtc) + + diff --git a/mission/core/CMakeLists.txt b/mission/core/CMakeLists.txt index 5d088e48..1fdc146e 100644 --- a/mission/core/CMakeLists.txt +++ b/mission/core/CMakeLists.txt @@ -1,4 +1,4 @@ -target_sources(${TARGET_NAME} PUBLIC +target_sources(${LIB_EIVE_MISSION} PRIVATE GenericFactory.cpp ) diff --git a/mission/devices/CMakeLists.txt b/mission/devices/CMakeLists.txt index 9491a3aa..111d2188 100644 --- a/mission/devices/CMakeLists.txt +++ b/mission/devices/CMakeLists.txt @@ -1,4 +1,4 @@ -target_sources(${TARGET_NAME} PUBLIC +target_sources(${LIB_EIVE_MISSION} PRIVATE GPSHyperionLinuxController.cpp GomspaceDeviceHandler.cpp Tmp1075Handler.cpp diff --git a/mission/memory/CMakeLists.txt b/mission/memory/CMakeLists.txt index ccaef754..cd0938f2 100644 --- a/mission/memory/CMakeLists.txt +++ b/mission/memory/CMakeLists.txt @@ -1,4 +1,4 @@ -target_sources(${TARGET_NAME} PUBLIC +target_sources(${LIB_EIVE_MISSION} PRIVATE NVMParameterBase.cpp ) diff --git a/mission/tmtc/CMakeLists.txt b/mission/tmtc/CMakeLists.txt index 7da87b6c..1d3baae7 100644 --- a/mission/tmtc/CMakeLists.txt +++ b/mission/tmtc/CMakeLists.txt @@ -1,4 +1,4 @@ -target_sources(${TARGET_NAME} PUBLIC +target_sources(${LIB_EIVE_MISSION} PRIVATE CCSDSHandler.cpp VirtualChannel.cpp ) diff --git a/mission/utility/CMakeLists.txt b/mission/utility/CMakeLists.txt index 50532596..a6d4e57d 100644 --- a/mission/utility/CMakeLists.txt +++ b/mission/utility/CMakeLists.txt @@ -1,4 +1,4 @@ -target_sources(${TARGET_NAME} PUBLIC +target_sources(${LIB_EIVE_MISSION} PRIVATE TmFunnel.cpp Timestamp.cpp ) diff --git a/test/testtasks/CMakeLists.txt b/test/testtasks/CMakeLists.txt index 8d8a17c1..628e3c52 100644 --- a/test/testtasks/CMakeLists.txt +++ b/test/testtasks/CMakeLists.txt @@ -1,7 +1,7 @@ -target_sources(${TARGET_NAME} PUBLIC +target_sources(${OBSW_NAME} PUBLIC TestTask.cpp ) -target_include_directories(${TARGET_NAME} PUBLIC +target_include_directories(${OBSW_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ) \ No newline at end of file diff --git a/watchdog/CMakeLists.txt b/watchdog/CMakeLists.txt index 0179053c..a01bf853 100644 --- a/watchdog/CMakeLists.txt +++ b/watchdog/CMakeLists.txt @@ -1,4 +1,4 @@ -target_sources(${TARGET_NAME} PRIVATE +target_sources(${WATCHDOG_NAME} PRIVATE main.cpp Watchdog.cpp ) diff --git a/watchdog/Watchdog.h b/watchdog/Watchdog.h index fb7ac65b..5745c033 100644 --- a/watchdog/Watchdog.h +++ b/watchdog/Watchdog.h @@ -2,7 +2,8 @@ #define WATCHDOG_WATCHDOG_H_ #include - +#include +#include class WatchdogTask { public: From 00042af77c99fc9dd7a6bc880e02b25a86658527 Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Thu, 10 Feb 2022 15:27:03 +0100 Subject: [PATCH 11/14] updated README to cmake changes --- README.md | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 7d27b092..54af1c93 100644 --- a/README.md +++ b/README.md @@ -105,7 +105,7 @@ When using Windows, run theses steps in MSYS2. ```sh mkdir build-Debug-Q7S && cd build-Debug-Q7S - cmake -DTGT_BSP="arm/q7s" -DCMAKE_BUILD_TYPE=Debug -DOS_FSFW=linux .. + cmake -DTGT_BSP="arm/q7s" -DCMAKE_BUILD_TYPE=Debug .. cmake --build . -j ``` @@ -120,8 +120,7 @@ When using Windows, run theses steps in MSYS2. This will invoke a Python script which in turn invokes CMake with the correct arguments to configure CMake for Q7S cross-compilation. - You can build the hosted variant of the OBSW by replacing `-DOS_FSFW=linux` with - `-DOS_FSFW=host`. There are also different values for `-DTGT_BSP` to build for the Raspberry Pi + There are also different values for `-DTGT_BSP` to build for the Raspberry Pi or the Beagle Bone Black: `arm/raspberrypi` and `arm/beagleboneblack`. 5. Build the software with @@ -160,38 +159,45 @@ automatically. ### Q7S OBSW +The EIVE OBSW is the default target if no target is specified. + ```sh mkdir build-Debug-Q7S && cd build-Debug-Q7S -cmake -DTGT_BSP=arm/q7s -DFSFW_OSAL=linux -DCMAKE_BUILD_TYPE=Debug .. +cmake -DTGT_BSP=arm/q7s -DCMAKE_BUILD_TYPE=Debug .. cmake --build . -j ``` ### Q7S Watchdog +To build the EIVE watchdog, the corresponding target must be specified in the build command. +The configure steps do not need to be repeated if the folder has already been configured. + ```sh mkdir build-Debug-Q7S && cd build-Debug-Q7S -cmake -DTGT_BSP=arm/q7s -DFSFW_OSAL=linux -DEIVE_BUILD_WATCHDOG=ON -DCMAKE_BUILD_TYPE=Debug .. -cmake --build . -j +cmake -DTGT_BSP=arm/q7s -DCMAKE_BUILD_TYPE=Debug .. +cmake --build . --target eive-watchdog -j ``` ### Hosted -You can also replace `linux` by `host` for this command to build on Windows or for generic OSes +You can also use the FSFW OSAL `host` to build on Windows or for generic OSes. +Note: Currently this is not supported. ```sh mkdir build-Debug-Host && cd build-Debug-Host -cmake -DFSFW_OSAL=linux -DCMAKE_BUILD_TYPE=Debug .. +cmake -DFSFW_OSAL=host -DCMAKE_BUILD_TYPE=Debug .. cmake --build . -j ``` ### Unittests -You can also replace `linux` by `host` for this command to build on Windows +To build the unittests, the corresponding target must be specified in the build command. +The configure steps do not need to be repeated if the folder has already been configured. ```sh mkdir build-Debug-Unittest && cd build-Debug-Unittest -cmake -DFSFW_OSAL=linux -DEIVE_BUILD_UNITTESTS=ON .. -cmake --build . -j +cmake .. +cmake --build . --target eive-unittests -j ``` ## Connect to EIVE flatsat @@ -1163,4 +1169,4 @@ in the same way. 5. Navigate to Preferences → C/C++ → CppStyle 6. Insert the path to the clang-format executable 7. Under C/C++ → Code Style → Formatter, change the formatter to CppStyle (clang-format) -8. Code can now be formatted with the clang tool by using the key combination Ctrl + Shift + f \ No newline at end of file +8. Code can now be formatted with the clang tool by using the key combination Ctrl + Shift + f From e59a98f11c5fd8253dae81edf22a5072436069fe Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Thu, 10 Feb 2022 15:28:12 +0100 Subject: [PATCH 12/14] removed q7s/watchdog and q7s/simple configurations scripts, as there is no special configuration needed any more --- .../Q7S/simple/make-simple-debug-cfg.sh | 36 ------------------ .../Q7S/simple/ninja-simple-debug-cfg.sh | 35 ------------------ cmake/scripts/Q7S/watchdog/make-debug-cfg.sh | 37 ------------------- .../scripts/Q7S/watchdog/make-release-cfg.sh | 36 ------------------ cmake/scripts/Q7S/watchdog/ninja-debug-cfg.sh | 35 ------------------ .../scripts/Q7S/watchdog/ninja-release-cfg.sh | 35 ------------------ 6 files changed, 214 deletions(-) delete mode 100755 cmake/scripts/Q7S/simple/make-simple-debug-cfg.sh delete mode 100755 cmake/scripts/Q7S/simple/ninja-simple-debug-cfg.sh delete mode 100755 cmake/scripts/Q7S/watchdog/make-debug-cfg.sh delete mode 100755 cmake/scripts/Q7S/watchdog/make-release-cfg.sh delete mode 100755 cmake/scripts/Q7S/watchdog/ninja-debug-cfg.sh delete mode 100755 cmake/scripts/Q7S/watchdog/ninja-release-cfg.sh diff --git a/cmake/scripts/Q7S/simple/make-simple-debug-cfg.sh b/cmake/scripts/Q7S/simple/make-simple-debug-cfg.sh deleted file mode 100755 index 93f4a087..00000000 --- a/cmake/scripts/Q7S/simple/make-simple-debug-cfg.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/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-Simple-Q7S" -build_generator="" -definitions="BUILD_Q7S_SIMPLE_MODE=On" -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 "debug" -t "${tgt_bsp}" \ - -l "${build_dir}" -d "${definitions}" -# set +x diff --git a/cmake/scripts/Q7S/simple/ninja-simple-debug-cfg.sh b/cmake/scripts/Q7S/simple/ninja-simple-debug-cfg.sh deleted file mode 100755 index c1805eff..00000000 --- a/cmake/scripts/Q7S/simple/ninja-simple-debug-cfg.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/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-Simple-Q7S" -build_generator="Ninja" -definitions="BUILD_Q7S_SIMPLE_MODE=On" -if [ "${OS}" = "Windows_NT" ]; then - python="py" -# Could be other OS but this works for now. -else - python="python3" -fi - -echo "Running command (without the leading +):" -set -x # Print command -${python} ${cfg_script_name} -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" \ - -l "${build_dir}" -d "${definitions}" -# set +x - diff --git a/cmake/scripts/Q7S/watchdog/make-debug-cfg.sh b/cmake/scripts/Q7S/watchdog/make-debug-cfg.sh deleted file mode 100755 index 0f829fea..00000000 --- a/cmake/scripts/Q7S/watchdog/make-debug-cfg.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/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-Debug-Watchdog" -build_generator="" -definitions="EIVE_BUILD_WATCHDOG=ON" -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 "debug" -t "${tgt_bsp}" \ - -d "${definitions}" -l"${build_dir}" -# set +x - diff --git a/cmake/scripts/Q7S/watchdog/make-release-cfg.sh b/cmake/scripts/Q7S/watchdog/make-release-cfg.sh deleted file mode 100755 index c8df73d5..00000000 --- a/cmake/scripts/Q7S/watchdog/make-release-cfg.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/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-Release-Watchdog" -build_generator="" -definitions="EIVE_BUILD_WATCHDOG=ON" -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} cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "release" -t "${tgt_bsp}" \ - -d "${definitions} -l"${build_dir}" -# set +x - diff --git a/cmake/scripts/Q7S/watchdog/ninja-debug-cfg.sh b/cmake/scripts/Q7S/watchdog/ninja-debug-cfg.sh deleted file mode 100755 index ed23bb6a..00000000 --- a/cmake/scripts/Q7S/watchdog/ninja-debug-cfg.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/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-Debug-Watchdog" -build_generator="Ninja" -definitions="EIVE_BUILD_WATCHDOG=ON" -if [ "${OS}" = "Windows_NT" ]; then - python="py" -# Could be other OS but this works for now. -else - python="python3" -fi - -echo "Running command (without the leading +):" -set -x # Print command -${python} ${cfg_script_name} -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" \ - -d "${definitions}" -l "${build_dir}" -# set +x - diff --git a/cmake/scripts/Q7S/watchdog/ninja-release-cfg.sh b/cmake/scripts/Q7S/watchdog/ninja-release-cfg.sh deleted file mode 100755 index d8f5e18e..00000000 --- a/cmake/scripts/Q7S/watchdog/ninja-release-cfg.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/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-Watchdog" -build_generator="Ninja" -definitions="EIVE_BUILD_WATCHDOG=ON" -if [ "${OS}" = "Windows_NT" ]; then - python="py" -# Could be other OS but this works for now. -else - python="python3" -fi - -echo "Running command (without the leading +):" -set -x # Print command -${python} ${cfg_script_name} -o "${os_fsfw}" -g "${build_generator}" -b "release" -t "${tgt_bsp}" \ - -d "${definitions}" -l"${build_dir}" -# set +x - From 208f417d17425b32c6e504da35ae6b3daa949b3f Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 15 Feb 2022 17:03:34 +0100 Subject: [PATCH 13/14] minor gps fixes --- mission/devices/GPSHyperionLinuxController.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mission/devices/GPSHyperionLinuxController.cpp b/mission/devices/GPSHyperionLinuxController.cpp index 0955e1c7..c47414a8 100644 --- a/mission/devices/GPSHyperionLinuxController.cpp +++ b/mission/devices/GPSHyperionLinuxController.cpp @@ -67,7 +67,9 @@ ReturnValue_t GPSHyperionLinuxController::initializeLocalDataPool( localDataPoolMap.emplace(GpsHyperion::SATS_IN_USE, new PoolEntry()); localDataPoolMap.emplace(GpsHyperion::SATS_IN_VIEW, new PoolEntry()); localDataPoolMap.emplace(GpsHyperion::FIX_MODE, new PoolEntry()); +#if OBSW_ENABLE_PERIODIC_HK == 1 poolManager.subscribeForPeriodicPacket(gpsSet.getSid(), true, 2.0, false); +#endif return HasReturnvaluesIF::RETURN_OK; } @@ -160,7 +162,6 @@ void GPSHyperionLinuxController::readGpsDataFromGpsd() { gpsSet.hours = timeOfDay.hour; gpsSet.minutes = timeOfDay.minute; gpsSet.seconds = timeOfDay.second; - debugHyperionGps = true; if (debugHyperionGps) { sif::info << "-- Hyperion GPS Data --" << std::endl; time_t timeRaw = gps->fix.time.tv_sec; From b722b15b26d79069a8c5c0d544b8a5e53f261a07 Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Wed, 16 Feb 2022 15:06:02 +0100 Subject: [PATCH 14/14] changed target name for egse bsp --- bsp_egse/CMakeLists.txt | 2 +- bsp_egse/boardconfig/CMakeLists.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bsp_egse/CMakeLists.txt b/bsp_egse/CMakeLists.txt index a8bf5c4f..cb02f937 100644 --- a/bsp_egse/CMakeLists.txt +++ b/bsp_egse/CMakeLists.txt @@ -1,4 +1,4 @@ -target_sources(${TARGET_NAME} PUBLIC +target_sources(${OBSW_NAME} PUBLIC InitMission.cpp main.cpp ObjectFactory.cpp diff --git a/bsp_egse/boardconfig/CMakeLists.txt b/bsp_egse/boardconfig/CMakeLists.txt index 67fbaf88..f9136e3e 100644 --- a/bsp_egse/boardconfig/CMakeLists.txt +++ b/bsp_egse/boardconfig/CMakeLists.txt @@ -1,7 +1,7 @@ -target_sources(${TARGET_NAME} PRIVATE +target_sources(${OBSW_NAME} PRIVATE print.c ) -target_include_directories(${TARGET_NAME} PUBLIC +target_include_directories(${OBSW_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} )