diff --git a/.gitignore b/.gitignore index 2ccfca61..70a3325b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,4 @@ -_obj -_bin -_dep +/build* Debug Debug* @@ -17,6 +15,7 @@ RelWithDebInfo* .cproject __pycache__ +.idea + !misc/eclipse/**/.cproject !misc/eclipse/**/.project -/eive_obsw cmake debug/ diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e4eb527..c799f927 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,6 +20,10 @@ if(NOT OS_FSFW) set(OS_FSFW host CACHE STRING "OS for the FSFW.") endif() +if(TGT_BSP MATCHES "arm/raspberrypi" OR TGT_BSP MATCHES "arm/beagleboneblack") + option(LINUX_CROSS_COMPILE ON) +endif() + # Perform steps like loading toolchain files where applicable. include(${CMAKE_SCRIPT_PATH}/PreProjectConfig.cmake) pre_project_config() @@ -57,7 +61,7 @@ set(ETL_LIB_PATH ${THIRD_PARTY_FOLDER}/etl) set(LWGPS_LIB_PATH ${THIRD_PARTY_FOLDER}/lwgps) set(FSFW_WARNING_SHADOW_LOCAL_GCC OFF) -set(ADD_LINUX_FILES TRUE) +set(ADD_LINUX_FILES False) # Analyse different OS and architecture/target options, determine BSP_PATH, # display information about compiler etc. @@ -65,7 +69,9 @@ include (${CMAKE_SCRIPT_PATH}/HardwareOsPreConfig.cmake) pre_source_hw_os_config() if(TGT_BSP) - if(${TGT_BSP} MATCHES "arm/q7s" OR ${TGT_BSP} MATCHES "arm/raspberrypi") + if(${TGT_BSP} MATCHES "arm/q7s" OR ${TGT_BSP} MATCHES "arm/raspberrypi" + OR ${TGT_BSP} MATCHES "arm/beagleboneblack" + ) set(ROOT_CONFIG_FOLDER TRUE) set(FSFW_CONFIG_PATH "fsfwconfig") set(ADD_LINUX_FILES TRUE) @@ -78,6 +84,10 @@ if(TGT_BSP) set(FSFW_HAL_ADD_RASPBERRY_PI ON) endif() + if(${TGT_BSP} MATCHES "arm/beagleboneblack") + add_definitions(-DBEAGLEBONEBLACK) + endif() + if(${TGT_BSP} MATCHES "arm/q7s") add_definitions(-DXIPHOS_Q7S) endif() @@ -85,6 +95,9 @@ else() # Required by FSFW library set(FSFW_CONFIG_PATH "${BSP_PATH}/fsfwconfig") endif() + +# Set common config path for FSFW +set(FSFW_ADDITIONAL_INC_PATH "${COMMON_PATH}/config") # Set for lwgps library set(LWGPS_CONFIG_PATH "${COMMON_PATH}/config") diff --git a/bsp_hosted/ObjectFactory.cpp b/bsp_hosted/ObjectFactory.cpp index f3d7591d..da07b0b5 100644 --- a/bsp_hosted/ObjectFactory.cpp +++ b/bsp_hosted/ObjectFactory.cpp @@ -33,16 +33,14 @@ void Factory::setStaticFrameworkObjectIds(){ TmFunnel::storageDestination = objects::NO_OBJECT; VerificationReporter::messageReceiver = objects::PUS_SERVICE_1_VERIFICATION; - TmPacketStored::timeStamperId = objects::TIME_STAMPER; + TmPacketBase::timeStamperId = objects::TIME_STAMPER; } void ObjectFactory::produce(){ Factory::setStaticFrameworkObjectIds(); ObjectFactory::produceGenericObjects(); - new UdpTmTcBridge(objects::UDP_BRIDGE, - objects::CCSDS_PACKET_DISTRIBUTOR, - objects::TM_STORE, objects::TC_STORE); + new UdpTmTcBridge(objects::UDP_BRIDGE, objects::CCSDS_PACKET_DISTRIBUTOR); new UdpTcPollingTask(objects::UDP_POLLING_TASK, objects::UDP_BRIDGE); } diff --git a/bsp_hosted/fsfwconfig/FSFWConfig.h b/bsp_hosted/fsfwconfig/FSFWConfig.h index e3def8fe..3174d596 100644 --- a/bsp_hosted/fsfwconfig/FSFWConfig.h +++ b/bsp_hosted/fsfwconfig/FSFWConfig.h @@ -7,18 +7,17 @@ //! Used to determine whether C++ ostreams are used which can increase //! the binary size significantly. If this is disabled, //! the C stdio functions can be used alternatively -#define FSFW_CPP_OSTREAM_ENABLED 1 +#define FSFW_CPP_OSTREAM_ENABLED 1 //! More FSFW related printouts depending on level. Useful for development. -#define FSFW_VERBOSE_LEVEL 1 +#define FSFW_VERBOSE_LEVEL 1 //! Can be used to completely disable printouts, even the C stdio ones. #if FSFW_CPP_OSTREAM_ENABLED == 0 && FSFW_VERBOSE_LEVEL == 0 - #define FSFW_DISABLE_PRINTOUT 0 + #define FSFW_DISABLE_PRINTOUT 0 #endif -//! Can be used to disable the ANSI color sequences for C stdio. -#define FSFW_COLORED_OUTPUT 1 +#define FSFW_USE_PUS_C_TELEMETRY 1 //! Can be used to disable the ANSI color sequences for C stdio. #define FSFW_COLORED_OUTPUT 1 @@ -43,10 +42,17 @@ //! Specify whether a special mode store is used for Subsystem components. #define FSFW_USE_MODESTORE 0 +//! Defines if the real time scheduler for linux should be used. +//! If set to 0, this will also disable priority settings for linux +//! as most systems will not allow to set nice values without privileges +//! For embedded linux system set this to 1. +//! If set to 1 the binary needs "cap_sys_nice=eip" privileges to run +#define FSFW_USE_REALTIME_FOR_LINUX 0 + namespace fsfwconfig { -//! Default timestamp size. The default timestamp will be an eight byte CDC -//! short timestamp. -static constexpr uint8_t FSFW_MISSION_TIMESTAMP_SIZE = 8; + +//! Default timestamp size. The default timestamp will be an seven byte CDC short timestamp. +static constexpr uint8_t FSFW_MISSION_TIMESTAMP_SIZE = 7; //! Configure the allocated pool sizes for the event manager. static constexpr size_t FSFW_EVENTMGMR_MATCHTREE_NODES = 240; @@ -55,11 +61,12 @@ static constexpr size_t FSFW_EVENTMGMR_RANGEMATCHERS = 120; //! Defines the FIFO depth of each commanding service base which //! also determines how many commands a CSB service can handle in one cycle -//! simulataneously. This will increase the required RAM for +//! simultaneously. This will increase the required RAM for //! each CSB service ! static constexpr uint8_t FSFW_CSB_FIFO_DEPTH = 6; static constexpr size_t FSFW_PRINT_BUFFER_SIZE = 124; + } #endif /* CONFIG_FSFWCONFIG_H_ */ diff --git a/bsp_hosted/fsfwconfig/OBSWVersion.h b/bsp_hosted/fsfwconfig/OBSWVersion.h deleted file mode 100644 index 980b6965..00000000 --- a/bsp_hosted/fsfwconfig/OBSWVersion.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef FSFWCONFIG_OBSWVERSION_H_ -#define FSFWCONFIG_OBSWVERSION_H_ - -const char* const SW_NAME = "eive"; - -#define SW_VERSION 1 -#define SW_SUBVERSION 0 -#define SW_SUBSUBVERSION 0 - - - -#endif /* FSFWCONFIG_OBSWVERSION_H_ */ diff --git a/bsp_hosted/fsfwconfig/events/subsystemIdRanges.h b/bsp_hosted/fsfwconfig/events/subsystemIdRanges.h index 51534f60..98776b6a 100644 --- a/bsp_hosted/fsfwconfig/events/subsystemIdRanges.h +++ b/bsp_hosted/fsfwconfig/events/subsystemIdRanges.h @@ -1,7 +1,7 @@ #ifndef CONFIG_EVENTS_SUBSYSTEMIDRANGES_H_ #define CONFIG_EVENTS_SUBSYSTEMIDRANGES_H_ -#include +#include "commonSubsystemId.h" #include /** @@ -10,17 +10,7 @@ */ namespace SUBSYSTEM_ID { enum: uint8_t { - SUBSYSTEM_ID_START = FW_SUBSYSTEM_ID_RANGE, - PUS_SERVICE_2, - PUS_SERVICE_3, - PUS_SERVICE_5, - PUS_SERVICE_6, - PUS_SERVICE_8, - PUS_SERVICE_23, - MGM_LIS3MDL, - MGM_RM3100, - - DUMMY_DEVICE, + SUBSYSTEM_ID_START = COMMON_SUBSYSTEM_ID_END }; } diff --git a/bsp_hosted/fsfwconfig/objects/systemObjectList.h b/bsp_hosted/fsfwconfig/objects/systemObjectList.h index d7a1abd7..21a5f939 100644 --- a/bsp_hosted/fsfwconfig/objects/systemObjectList.h +++ b/bsp_hosted/fsfwconfig/objects/systemObjectList.h @@ -2,15 +2,11 @@ #define HOSTED_CONFIG_OBJECTS_SYSTEMOBJECTLIST_H_ #include +#include // The objects will be instantiated in the ID order namespace objects { enum sourceObjects: uint32_t { - /* First Byte 0x50-0x52 reserved for PUS Services **/ - CCSDS_PACKET_DISTRIBUTOR = 0x50000100, - PUS_PACKET_DISTRIBUTOR = 0x50000200, - UDP_BRIDGE = 0x50000300, - UDP_POLLING_TASK = 0x50000400, PUS_SERVICE_3 = 0x51000300, PUS_SERVICE_5 = 0x51000400, @@ -27,21 +23,6 @@ namespace objects { DUMMY_INTERFACE = 0xCAFECAFE, DUMMY_HANDLER = 0x4400AFFE, - /* 0x44 ('D') for device handlers */ - P60DOCK_HANDLER = 0x44000001, - PDU1_HANDLER = 0x44000002, - PDU2_HANDLER = 0x44000003, - ACU_HANDLER = 0x44000004, - TMP1075_HANDLER_1 = 0x44000005, - TMP1075_HANDLER_2 = 0x44000006, - MGM_0_LIS3_HANDLER = 0x4400007, - MGM_1_RM3100_HANDLER = 0x44000008, - MGM_2_LIS3_HANDLER = 0x44000009, - MGM_3_RM3100_HANDLER = 0x44000010, - GYRO_0_ADIS_HANDLER = 0x44000011, - GYRO_1_L3G_HANDLER = 0x44000012, - GYRO_2_L3G_HANDLER = 0x44000013, - /* 0x49 ('I') for Communication Interfaces **/ ARDUINO_COM_IF = 0x49000001 }; diff --git a/bsp_hosted/fsfwconfig/returnvalues/classIds.h b/bsp_hosted/fsfwconfig/returnvalues/classIds.h index 21371c15..cc159fec 100644 --- a/bsp_hosted/fsfwconfig/returnvalues/classIds.h +++ b/bsp_hosted/fsfwconfig/returnvalues/classIds.h @@ -1,6 +1,7 @@ #ifndef CONFIG_RETURNVALUES_CLASSIDS_H_ #define CONFIG_RETURNVALUES_CLASSIDS_H_ +#include "commonClassIds.h" #include /** @@ -10,9 +11,7 @@ */ namespace CLASS_ID { enum { - MISSION_CLASS_ID_START = FW_CLASS_ID_COUNT, - MGM_LIS3MDL, - MGM_RM3100 + CLASS_ID_START = COMMON_CLASS_ID_END, }; } diff --git a/bsp_rpi/CMakeLists.txt b/bsp_linux_board/CMakeLists.txt similarity index 83% rename from bsp_rpi/CMakeLists.txt rename to bsp_linux_board/CMakeLists.txt index da35633d..5963d48c 100644 --- a/bsp_rpi/CMakeLists.txt +++ b/bsp_linux_board/CMakeLists.txt @@ -6,9 +6,3 @@ target_sources(${TARGET_NAME} PUBLIC add_subdirectory(boardconfig) add_subdirectory(boardtest) -add_subdirectory(gpio) - - - - - diff --git a/bsp_rpi/InitMission.cpp b/bsp_linux_board/InitMission.cpp similarity index 100% rename from bsp_rpi/InitMission.cpp rename to bsp_linux_board/InitMission.cpp diff --git a/bsp_rpi/InitMission.h b/bsp_linux_board/InitMission.h similarity index 100% rename from bsp_rpi/InitMission.h rename to bsp_linux_board/InitMission.h diff --git a/bsp_rpi/ObjectFactory.cpp b/bsp_linux_board/ObjectFactory.cpp similarity index 98% rename from bsp_rpi/ObjectFactory.cpp rename to bsp_linux_board/ObjectFactory.cpp index 960abfe6..0518ac87 100644 --- a/bsp_rpi/ObjectFactory.cpp +++ b/bsp_linux_board/ObjectFactory.cpp @@ -47,7 +47,7 @@ void Factory::setStaticFrameworkObjectIds() { LocalDataPoolManager::defaultHkDestination = objects::NO_OBJECT; VerificationReporter::messageReceiver = objects::PUS_SERVICE_1_VERIFICATION; - TmPacketStored::timeStamperId = objects::TIME_STAMPER; + TmPacketBase::timeStamperId = objects::TIME_STAMPER; } diff --git a/bsp_rpi/ObjectFactory.h b/bsp_linux_board/ObjectFactory.h similarity index 100% rename from bsp_rpi/ObjectFactory.h rename to bsp_linux_board/ObjectFactory.h diff --git a/bsp_rpi/boardconfig/CMakeLists.txt b/bsp_linux_board/boardconfig/CMakeLists.txt similarity index 100% rename from bsp_rpi/boardconfig/CMakeLists.txt rename to bsp_linux_board/boardconfig/CMakeLists.txt diff --git a/bsp_rpi/boardconfig/etl_profile.h b/bsp_linux_board/boardconfig/etl_profile.h similarity index 100% rename from bsp_rpi/boardconfig/etl_profile.h rename to bsp_linux_board/boardconfig/etl_profile.h diff --git a/bsp_rpi/boardconfig/gcov.h b/bsp_linux_board/boardconfig/gcov.h similarity index 100% rename from bsp_rpi/boardconfig/gcov.h rename to bsp_linux_board/boardconfig/gcov.h diff --git a/bsp_rpi/boardconfig/print.c b/bsp_linux_board/boardconfig/print.c similarity index 100% rename from bsp_rpi/boardconfig/print.c rename to bsp_linux_board/boardconfig/print.c diff --git a/bsp_rpi/boardconfig/print.h b/bsp_linux_board/boardconfig/print.h similarity index 100% rename from bsp_rpi/boardconfig/print.h rename to bsp_linux_board/boardconfig/print.h diff --git a/bsp_rpi/boardconfig/rpi_config.h b/bsp_linux_board/boardconfig/rpi_config.h similarity index 100% rename from bsp_rpi/boardconfig/rpi_config.h rename to bsp_linux_board/boardconfig/rpi_config.h diff --git a/bsp_rpi/boardtest/CMakeLists.txt b/bsp_linux_board/boardtest/CMakeLists.txt similarity index 100% rename from bsp_rpi/boardtest/CMakeLists.txt rename to bsp_linux_board/boardtest/CMakeLists.txt diff --git a/bsp_rpi/main.cpp b/bsp_linux_board/main.cpp similarity index 66% rename from bsp_rpi/main.cpp rename to bsp_linux_board/main.cpp index 8eea768c..67801c4b 100644 --- a/bsp_rpi/main.cpp +++ b/bsp_linux_board/main.cpp @@ -5,6 +5,14 @@ #include +#ifdef RASPBERRY_PI +static const char* const BOARD_NAME = "Raspberry Pi"; +#elif defined(BEAGLEBONEBLACK) +static const char* const BOARD_NAME = "Beaglebone Black"; +#else +static const char* const BOARD_NAME = "Unknown Board"; +#endif + /** * @brief This is the main program and entry point for the Raspberry Pi. * @return @@ -12,7 +20,7 @@ int main(void) { std::cout << "-- EIVE OBSW --" << std::endl; - std::cout << "-- Compiled for Linux (Raspberry Pi) --" << std::endl; + std::cout << "-- Compiled for Linux board " << BOARD_NAME << " --" << std::endl; std::cout << "-- Software version " << SW_NAME << " v" << SW_VERSION << "." << SW_SUBVERSION << "." << SW_SUBSUBVERSION << " -- " << std::endl; std::cout << "-- " << __DATE__ << " " << __TIME__ << " --" << std::endl; diff --git a/bsp_q7s/CMakeLists.txt b/bsp_q7s/CMakeLists.txt index e567628e..f741a46b 100644 --- a/bsp_q7s/CMakeLists.txt +++ b/bsp_q7s/CMakeLists.txt @@ -6,7 +6,6 @@ target_sources(${TARGET_NAME} PUBLIC add_subdirectory(boardconfig) add_subdirectory(comIF) -add_subdirectory(devices) add_subdirectory(boardtest) add_subdirectory(gpio) diff --git a/bsp_q7s/ObjectFactory.cpp b/bsp_q7s/ObjectFactory.cpp index 297f8167..22418bc5 100644 --- a/bsp_q7s/ObjectFactory.cpp +++ b/bsp_q7s/ObjectFactory.cpp @@ -1,16 +1,18 @@ #include "ObjectFactory.h" -#include -#include -#include -#include -#include -#include -#include +#include "OBSWConfig.h" +#include "tmtc/apid.h" +#include "devices/addresses.h" +#include "devices/gpioIds.h" +#include "tmtc/pusIds.h" +#include "devices/powerSwitcherList.h" +#include "devices/spi.h" -#include -#include #include +#include +#include +#include + #include #include #include @@ -26,7 +28,7 @@ #include #include #include -#include + #include #include @@ -42,6 +44,7 @@ #include #include + #include #include #include @@ -554,8 +557,7 @@ void ObjectFactory::produce(){ #endif /* TE0720 == 0 */ - new UdpTmTcBridge(objects::UDP_BRIDGE, objects::CCSDS_PACKET_DISTRIBUTOR, objects::TM_STORE, - objects::TC_STORE); + new UdpTmTcBridge(objects::UDP_BRIDGE, objects::CCSDS_PACKET_DISTRIBUTOR); new UdpTcPollingTask(objects::UDP_POLLING_TASK, objects::UDP_BRIDGE); #if TE0720 == 1 && TEST_LIBGPIOD == 1 diff --git a/bsp_rpi/gpio/CMakeLists.txt b/bsp_rpi/gpio/CMakeLists.txt deleted file mode 100644 index b816684d..00000000 --- a/bsp_rpi/gpio/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -target_sources(${TARGET_NAME} PUBLIC -) - - - - - - diff --git a/cmake/BBBCrossCompileConfig.cmake b/cmake/BBBCrossCompileConfig.cmake new file mode 100644 index 00000000..b32897f5 --- /dev/null +++ b/cmake/BBBCrossCompileConfig.cmake @@ -0,0 +1,98 @@ +# BBB_ROOTFS should point to the local directory which contains all the +# libraries and includes from the target raspi. +# The following command can be used to do this, replace and the +# local accordingly: +# rsync -vR --progress -rl --delete-after --safe-links pi@:/{lib,usr,opt/vc/lib} +# RASPBIAN_ROOTFS needs to be passed to the CMake command or defined in the +# application CMakeLists.txt before loading the toolchain file. + +# CROSS_COMPILE also needs to be set accordingly or passed to the CMake command + +if(NOT DEFINED ENV{BBB_ROOTFS}) + message(FATAL_ERROR + "Define the BBB_ROOTFS variable to point to the Beagle Bone Black rootfs." + ) +else() + set(SYSROOT_PATH "$ENV{BBB_ROOTFS}") + message(STATUS "Beagle Bone Black sysroot: ${SYSROOT_PATH}") +endif() + +if(NOT DEFINED ENV{CROSS_COMPILE}) + set(CROSS_COMPILE "arm-linux-gnueabihf") + message(STATUS + "No CROSS_COMPILE environmental variable set, using default ARM linux " + "cross compiler name ${CROSS_COMPILE}" + ) +else() + set(CROSS_COMPILE "$ENV{CROSS_COMPILE}") + message(STATUS + "Using environmental variable CROSS_COMPILE as cross-compiler: " + "$ENV{CROSS_COMPILE}" + ) +endif() + +message(STATUS "Using sysroot path: ${SYSROOT_PATH}") + +set(CROSS_COMPILE_CC "${CROSS_COMPILE}-gcc") +set(CROSS_COMPILE_CXX "${CROSS_COMPILE}-g++") +set(CROSS_COMPILE_LD "${CROSS_COMPILE}-ld") +set(CROSS_COMPILE_AR "${CROSS_COMPILE}-ar") +set(CROSS_COMPILE_RANLIB "${CROSS_COMPILE}-ranlib") +set(CROSS_COMPILE_STRIP "${CROSS_COMPILE}-strip") +set(CROSS_COMPILE_NM "${CROSS_COMPILE}-nm") +set(CROSS_COMPILE_OBJCOPY "${CROSS_COMPILE}-objcopy") +set(CROSS_COMPILE_SIZE "${CROSS_COMPILE}-size") + +# At the very least, cross compile gcc and g++ have to be set! +find_program (CROSS_COMPILE_CC_FOUND ${CROSS_COMPILE_CC} REQUIRED) +find_program (CROSS_COMPILE_CXX_FOUND ${CROSS_COMPILE_CXX} REQUIRED) + +set(CMAKE_CROSSCOMPILING TRUE) +set(CMAKE_SYSROOT "${SYSROOT_PATH}") + +# Define name of the target system +set(CMAKE_SYSTEM_NAME "Linux") +set(CMAKE_SYSTEM_PROCESSOR "arm") + +# Define the compiler +set(CMAKE_C_COMPILER ${CROSS_COMPILE_CC}) +set(CMAKE_CXX_COMPILER ${CROSS_COMPILE_CXX}) + +# List of library dirs where LD has to look. Pass them directly through gcc. +# LD_LIBRARY_PATH is not evaluated by arm-*-ld +set(LIB_DIRS + "${SYSROOT_PATH}/lib/${CROSS_COMPILE}" + "${SYSROOT_PATH}/usr/local/lib" + "${SYSROOT_PATH}/usr/lib/${CROSS_COMPILE}" + "${SYSROOT_PATH}/usr/lib" +) +# You can additionally check the linker paths if you add the +# flags ' -Xlinker --verbose' +set(COMMON_FLAGS "-I${SYSROOT_PATH}/usr/include") +foreach(LIB ${LIB_DIRS}) + set(COMMON_FLAGS "${COMMON_FLAGS} -L${LIB} -Wl,-rpath-link,${LIB}") +endforeach() + +set(CMAKE_PREFIX_PATH + "${CMAKE_PREFIX_PATH}" + "${SYSROOT_PATH}/usr/lib/${CROSS_COMPILE}" +) + +set(CMAKE_C_FLAGS + "-march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard ${COMMON_FLAGS}" + CACHE STRING "Flags for Beagle Bone Black" +) +set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS}" + CACHE STRING "Flags for Beagle Bone Black" +) + +set(CMAKE_FIND_ROOT_PATH + "${CMAKE_INSTALL_PREFIX};${CMAKE_PREFIX_PATH};${CMAKE_SYSROOT}" +) + +# search for programs in the build host directories +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +# for libraries and headers in the target directories +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) diff --git a/cmake/HardwareOsPreConfig.cmake b/cmake/HardwareOsPreConfig.cmake index ab5c16fd..38248fce 100644 --- a/cmake/HardwareOsPreConfig.cmake +++ b/cmake/HardwareOsPreConfig.cmake @@ -53,8 +53,8 @@ endif() if(TGT_BSP) - if (${TGT_BSP} MATCHES "arm/raspberrypi") - set(BSP_PATH "bsp_rpi") + if (${TGT_BSP} MATCHES "arm/raspberrypi" OR ${TGT_BSP} MATCHES "arm/beagleboneblack") + set(BSP_PATH "bsp_linux_board") elseif(${TGT_BSP} MATCHES "arm/q7s") set(BSP_PATH "bsp_q7s") else() diff --git a/cmake/PreProjectConfig.cmake b/cmake/PreProjectConfig.cmake index f54da048..8a013d83 100644 --- a/cmake/PreProjectConfig.cmake +++ b/cmake/PreProjectConfig.cmake @@ -11,7 +11,6 @@ endif() # Disable compiler checks for cross-compiling. if(${OS_FSFW} STREQUAL linux AND TGT_BSP) - if(${TGT_BSP} MATCHES "arm/q7s") set(CMAKE_TOOLCHAIN_FILE "${CMAKE_SCRIPT_PATH}/Q7SCrossCompileConfig.cmake" @@ -38,7 +37,7 @@ if(${OS_FSFW} STREQUAL linux AND TGT_BSP) else() message(STATUS "Setting RASPBERRY_VERSION to ${RASPBERRY_VERSION}") set(RASPBERRY_VERSION ${RASPBERRY_VERSION} CACHE STRING "Raspberry Pi version") - set(ENV{RASPBERRY_VERSION} ${RASPBERRY_VERSION}) + set(ENV{RASPBERRY_VERSION} ${RASPBERRY_VERSION}) endif() else() message(STATUS @@ -51,7 +50,14 @@ if(${OS_FSFW} STREQUAL linux AND TGT_BSP) "${CMAKE_SCRIPT_PATH}/RPiCrossCompileConfig.cmake" PARENT_SCOPE ) - else() + elseif(${TGT_BSP} MATCHES "arm/beagleboneblack") + if(LINUX_CROSS_COMPILE) + set(CMAKE_TOOLCHAIN_FILE + "${CMAKE_SCRIPT_PATH}/BBBCrossCompileConfig.cmake" + PARENT_SCOPE + ) + endif() + else() message(WARNING "Target BSP (TGT_BSP) ${TGT_BSP} unknown!") endif() endif() diff --git a/cmake/scripts/.idea/inspectionProfiles/profiles_settings.xml b/cmake/scripts/.idea/inspectionProfiles/profiles_settings.xml deleted file mode 100644 index 105ce2da..00000000 --- a/cmake/scripts/.idea/inspectionProfiles/profiles_settings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/cmake/scripts/.idea/misc.xml b/cmake/scripts/.idea/misc.xml deleted file mode 100644 index d56657ad..00000000 --- a/cmake/scripts/.idea/misc.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/cmake/scripts/.idea/modules.xml b/cmake/scripts/.idea/modules.xml deleted file mode 100644 index bb83e262..00000000 --- a/cmake/scripts/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/cmake/scripts/.idea/scripts.iml b/cmake/scripts/.idea/scripts.iml deleted file mode 100644 index d0876a78..00000000 --- a/cmake/scripts/.idea/scripts.iml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/cmake/scripts/.idea/vcs.xml b/cmake/scripts/.idea/vcs.xml deleted file mode 100644 index c2365ab1..00000000 --- a/cmake/scripts/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/cmake/scripts/.idea/workspace.xml b/cmake/scripts/.idea/workspace.xml deleted file mode 100644 index 70a189f3..00000000 --- a/cmake/scripts/.idea/workspace.xml +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1609084345199 - - - - - - - - - - - - \ No newline at end of file diff --git a/cmake/scripts/BeagleBoneBlack/create_cmake_debug_cfg.sh b/cmake/scripts/BeagleBoneBlack/create_cmake_debug_cfg.sh new file mode 100644 index 00000000..cfa71d02 --- /dev/null +++ b/cmake/scripts/BeagleBoneBlack/create_cmake_debug_cfg.sh @@ -0,0 +1,30 @@ +#!/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/beagleboneblack" +build_generator="" +builddir="build-Debug-BBB" +defines="LINUX_CROSS_COMPILE=OFF" +if [ "${OS}" = "Windows_NT" ]; then + build_generator="MinGW Makefiles" +# Could be other OS but this works for now. +else + build_generator="Unix Makefiles" +fi + +python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" \ + -l "${builddir}" -d "${defines}" diff --git a/cmake/scripts/BeagleBoneBlack/crosscompile/bbb_path_helper.sh b/cmake/scripts/BeagleBoneBlack/crosscompile/bbb_path_helper.sh new file mode 100644 index 00000000..340713e1 --- /dev/null +++ b/cmake/scripts/BeagleBoneBlack/crosscompile/bbb_path_helper.sh @@ -0,0 +1,3 @@ +export PATH=$PATH:"$HOME/beaglebone//bin" +export CROSS_COMPILE="arm-linux-gnueabihf" +export BBB_ROOTFS="${HOME}/raspberrypi/rootfs" diff --git a/cmake/scripts/BeagleBoneBlack/crosscompile/create_cmake_debug_cfg.sh b/cmake/scripts/BeagleBoneBlack/crosscompile/create_cmake_debug_cfg.sh new file mode 100644 index 00000000..b413d07f --- /dev/null +++ b/cmake/scripts/BeagleBoneBlack/crosscompile/create_cmake_debug_cfg.sh @@ -0,0 +1,30 @@ +#!/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/beagleboneblack" +build_generator="" +builddir="build-Debug-BBB" +defines="LINUX_CROSS_COMPILE=ON" +if [ "${OS}" = "Windows_NT" ]; then + build_generator="MinGW Makefiles" +# Could be other OS but this works for now. +else + build_generator="Unix Makefiles" +fi + +python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" \ + -l "${builddir}" -d "${defines}" diff --git a/cmake/scripts/BeagleBoneBlack/crosscompile/create_cmake_release_cfg.sh b/cmake/scripts/BeagleBoneBlack/crosscompile/create_cmake_release_cfg.sh new file mode 100644 index 00000000..81e3322d --- /dev/null +++ b/cmake/scripts/BeagleBoneBlack/crosscompile/create_cmake_release_cfg.sh @@ -0,0 +1,30 @@ +#!/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/beagleboneblack" +build_generator="" +builddir="build-Release-BBB" +defines="LINUX_CROSS_COMPILE=ON" +if [ "${OS}" = "Windows_NT" ]; then + build_generator="MinGW Makefiles" +# Could be other OS but this works for now. +else + build_generator="Unix Makefiles" +fi + +python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" \ + -l "${builddir}" -d "${defines}" diff --git a/cmake/scripts/BeagleBoneBlack/crosscompile/create_cmake_relwithdeb_cfg.sh b/cmake/scripts/BeagleBoneBlack/crosscompile/create_cmake_relwithdeb_cfg.sh new file mode 100644 index 00000000..81e3322d --- /dev/null +++ b/cmake/scripts/BeagleBoneBlack/crosscompile/create_cmake_relwithdeb_cfg.sh @@ -0,0 +1,30 @@ +#!/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/beagleboneblack" +build_generator="" +builddir="build-Release-BBB" +defines="LINUX_CROSS_COMPILE=ON" +if [ "${OS}" = "Windows_NT" ]; then + build_generator="MinGW Makefiles" +# Could be other OS but this works for now. +else + build_generator="Unix Makefiles" +fi + +python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" \ + -l "${builddir}" -d "${defines}" diff --git a/cmake/scripts/Linux/create_cmake_debug_cfg.sh b/cmake/scripts/Linux/create_cmake_debug_cfg.sh index 1f75c12a..172f890d 100755 --- a/cmake/scripts/Linux/create_cmake_debug_cfg.sh +++ b/cmake/scripts/Linux/create_cmake_debug_cfg.sh @@ -16,7 +16,7 @@ fi build_generator="Unix Makefiles" os_fsfw="linux" -builddir="Debug-Linux" +builddir="build-Debug-Linux" echo "Running command (without the leading +):" set -x # Print command diff --git a/cmake/scripts/Linux/create_cmake_release_cfg.sh b/cmake/scripts/Linux/create_cmake_release_cfg.sh index ffd85ae7..019a951d 100755 --- a/cmake/scripts/Linux/create_cmake_release_cfg.sh +++ b/cmake/scripts/Linux/create_cmake_release_cfg.sh @@ -16,7 +16,7 @@ fi build_generator="Unix Makefiles" os_fsfw="linux" -builddir="Release-Linux" +builddir="build-Release-Linux" echo "Running command (without the leading +):" set -x # Print command diff --git a/cmake/scripts/Linux/create_cmake_relwithdeb_cfg.sh b/cmake/scripts/Linux/create_cmake_relwithdeb_cfg.sh deleted file mode 100755 index 31376322..00000000 --- a/cmake/scripts/Linux/create_cmake_relwithdeb_cfg.sh +++ /dev/null @@ -1,25 +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 "create_cmake_cfg.sh not found in upper directories!" - exit 1 -fi - -build_generator="Unix Makefiles" -os_fsfw="linux" -builddir="RelWithDeb-Linux" - -echo "Running command (without the leading +):" -set -x # Print command -python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "debug" -l "${builddir}" -# Use this if commands are added which should not be printed -# set +x diff --git a/cmake/scripts/Linux/create_cmake_size_cfg.sh b/cmake/scripts/Linux/create_cmake_size_cfg.sh deleted file mode 100755 index d4500d6d..00000000 --- a/cmake/scripts/Linux/create_cmake_size_cfg.sh +++ /dev/null @@ -1,20 +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 "create_cmake_cfg.sh not found in upper directories!" - exit 1 -fi - -build_generator="Unix Makefiles" -os_fsfw="linux" - -python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "size" diff --git a/cmake/scripts/Q7S/create_cmake_debug_cfg.sh b/cmake/scripts/Q7S/create_cmake_debug_cfg.sh index 7f6753ac..4875c59a 100755 --- a/cmake/scripts/Q7S/create_cmake_debug_cfg.sh +++ b/cmake/scripts/Q7S/create_cmake_debug_cfg.sh @@ -16,6 +16,7 @@ fi os_fsfw="linux" tgt_bsp="arm/q7s" +build_dir="build-Debug-Q7S" build_generator="" if [ "${OS}" = "Windows_NT" ]; then build_generator="MinGW Makefiles" @@ -24,4 +25,5 @@ else build_generator="Unix Makefiles" fi -python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" +python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" \ + -l"${build_dir}" diff --git a/cmake/scripts/Q7S/create_cmake_release_cfg.sh b/cmake/scripts/Q7S/create_cmake_release_cfg.sh index 6048a1c6..0e2c543c 100755 --- a/cmake/scripts/Q7S/create_cmake_release_cfg.sh +++ b/cmake/scripts/Q7S/create_cmake_release_cfg.sh @@ -16,6 +16,7 @@ fi os_fsfw="linux" tgt_bsp="arm/q7s" +build_dir="build-Release-Q7S" build_generator="" if [ "${OS}" = "Windows_NT" ]; then build_generator="MinGW Makefiles" @@ -24,4 +25,5 @@ else build_generator="Unix Makefiles" fi -python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "release" -t "${tgt_bsp}" +python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "release" -t "${tgt_bsp}" \ + -l"${build_dir}" diff --git a/cmake/scripts/Q7S/create_cmake_relwithdeb_cfg.sh b/cmake/scripts/Q7S/create_cmake_relwithdeb_cfg.sh index 346067cd..121f2d7e 100755 --- a/cmake/scripts/Q7S/create_cmake_relwithdeb_cfg.sh +++ b/cmake/scripts/Q7S/create_cmake_relwithdeb_cfg.sh @@ -16,6 +16,7 @@ fi os_fsfw="linux" tgt_bsp="arm/q7s" +build_dir="build-Release-Q7S" build_generator="" if [ "${OS}" = "Windows_NT" ]; then build_generator="MinGW Makefiles" @@ -24,4 +25,5 @@ else build_generator="Unix Makefiles" fi -python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "reldeb" -t "${tgt_bsp}" +python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "reldeb" -t "${tgt_bsp}" \ + -l"${build_dir}" diff --git a/cmake/scripts/cmake_build_config.py b/cmake/scripts/cmake_build_config.py index 32b560f6..67f175d9 100644 --- a/cmake/scripts/cmake_build_config.py +++ b/cmake/scripts/cmake_build_config.py @@ -18,18 +18,26 @@ def main(): print("-- Python CMake build configurator utility --") print("Parsing command line arguments..") - parser = argparse.ArgumentParser(description="Processing arguments for CMake build configuration.") + parser = argparse.ArgumentParser( + description="Processing arguments for CMake build configuration." + ) parser.add_argument("-o", "--osal", type=str, choices=["freertos", "linux", "rtems", "host"], help="FSFW OSAL. Valid arguments: host, linux, rtems, freertos") - parser.add_argument("-b", "--buildtype", type=str, choices=["debug", "release", "size", "reldeb"], - help="CMake build type. Valid arguments: debug, release, size, reldeb (Release with Debug " - "Information)", default="debug") + parser.add_argument( + "-b", "--buildtype", type=str, choices=["debug", "release", "size", "reldeb"], + help="CMake build type. Valid arguments: debug, release, size, reldeb (Release with Debug " + "Information)", default="debug" + ) parser.add_argument("-l", "--builddir", type=str, help="Specify build directory.") parser.add_argument("-g", "--generator", type=str, help="CMake Generator") - parser.add_argument("-d", "--defines", - help="Additional custom defines passed to CMake (supply without -D prefix!)", - nargs="*", type=str) - parser.add_argument("-t", "--target-bsp", type=str, help="Target BSP, combination of architecture and machine") + parser.add_argument( + "-d", "--defines", + help="Additional custom defines passed to CMake (supply without -D prefix!)", + nargs="*", type=str + ) + parser.add_argument( + "-t", "--target-bsp", type=str, help="Target BSP, combination of architecture and machine" + ) args = parser.parse_args() @@ -64,6 +72,12 @@ def main(): else: cmake_target_cfg_cmd = "" + define_string = "" + if args.defines is not None: + define_list = args.defines[0].split() + for define in define_list: + define_string += f"-D{define} " + build_folder = cmake_build_type if args.builddir is not None: build_folder = args.builddir @@ -85,7 +99,8 @@ def main(): os.chdir(build_folder) cmake_command = f"cmake {generator_cmake_arg} -DOS_FSFW=\"{osal}\" " \ - f"-DCMAKE_BUILD_TYPE=\"{cmake_build_type}\" {cmake_target_cfg_cmd} {source_location}" + f"-DCMAKE_BUILD_TYPE=\"{cmake_build_type}\" {cmake_target_cfg_cmd} " \ + f"{define_string} {source_location}" # Remove redundant spaces cmake_command = ' '.join(cmake_command.split()) print("Running CMake command: ") diff --git a/common/config/OBSWVersion.h b/common/config/OBSWVersion.h index 548363f2..7ac812e6 100644 --- a/common/config/OBSWVersion.h +++ b/common/config/OBSWVersion.h @@ -4,7 +4,7 @@ const char* const SW_NAME = "eive"; #define SW_VERSION 1 -#define SW_SUBVERSION 1 +#define SW_SUBVERSION 2 #define SW_SUBSUBVERSION 0 #endif /* COMMON_CONFIG_OBSWVERSION_H_ */ diff --git a/common/config/commonClassIds.h b/common/config/commonClassIds.h new file mode 100644 index 00000000..c42dda0f --- /dev/null +++ b/common/config/commonClassIds.h @@ -0,0 +1,23 @@ +#ifndef COMMON_CONFIG_COMMONCLASSIDS_H_ +#define COMMON_CONFIG_COMMONCLASSIDS_H_ + +#include +#include + +namespace CLASS_ID { +enum commonClassIds: uint8_t { + MISSION_CLASS_ID_START = FW_CLASS_ID_COUNT, + MGM_LIS3MDL, + MGM_RM3100, + PCDU_HANDLER, + HEATER_HANDLER, + SYRLINKS_HANDLER, + IMTQ_HANDLER, + PLOC_HANDLER, + SUS_HANDLER, + COMMON_CLASS_ID_END +}; + +} + +#endif /* COMMON_CONFIG_COMMONCLASSIDS_H_ */ diff --git a/common/config/commonObjects.h b/common/config/commonObjects.h new file mode 100644 index 00000000..fd7e5a92 --- /dev/null +++ b/common/config/commonObjects.h @@ -0,0 +1,49 @@ +#ifndef COMMON_CONFIG_COMMONOBJECTS_H_ +#define COMMON_CONFIG_COMMONOBJECTS_H_ + +#include + +namespace objects { +enum commonObjects: uint32_t { + /* First Byte 0x50-0x52 reserved for PUS Services **/ + CCSDS_PACKET_DISTRIBUTOR = 0x50000100, + PUS_PACKET_DISTRIBUTOR = 0x50000200, + UDP_BRIDGE = 0x50000300, + UDP_POLLING_TASK = 0x50000400, + + /* 0x44 ('D') for device handlers */ + P60DOCK_HANDLER = 0x44000001, + PDU1_HANDLER = 0x44000002, + PDU2_HANDLER = 0x44000003, + ACU_HANDLER = 0x44000004, + TMP1075_HANDLER_1 = 0x44000005, + TMP1075_HANDLER_2 = 0x44000006, + MGM_0_LIS3_HANDLER = 0x44000007, + MGM_1_RM3100_HANDLER = 0x44000008, + MGM_2_LIS3_HANDLER = 0x44000009, + MGM_3_RM3100_HANDLER = 0x44000010, + GYRO_0_ADIS_HANDLER = 0x44000011, + GYRO_1_L3G_HANDLER = 0x44000012, + GYRO_2_L3G_HANDLER = 0x44000013, + + IMTQ_HANDLER = 0x44000014, + PLOC_HANDLER = 0x44000015, + + SUS_1 = 0x44000016, + SUS_2 = 0x44000017, + SUS_3 = 0x44000018, + SUS_4 = 0x44000019, + SUS_5 = 0x4400001A, + SUS_6 = 0x4400001B, + SUS_7 = 0x4400001C, + SUS_8 = 0x4400001D, + SUS_9 = 0x4400001E, + SUS_10 = 0x4400001F, + SUS_11 = 0x44000021, + SUS_12 = 0x44000022, + SUS_13 = 0x44000023, +}; +} + + +#endif /* COMMON_CONFIG_COMMONOBJECTS_H_ */ diff --git a/common/config/commonSubsystemId.h b/common/config/commonSubsystemId.h new file mode 100644 index 00000000..b19fea3a --- /dev/null +++ b/common/config/commonSubsystemId.h @@ -0,0 +1,26 @@ +#ifndef COMMON_CONFIG_COMMONSUBSYSTEMID_H_ +#define COMMON_CONFIG_COMMONSUBSYSTEMID_H_ + +#include + +namespace SUBSYSTEM_ID { +enum: uint8_t { + COMMON_SUBSYSTEM_ID_START = FW_SUBSYSTEM_ID_RANGE, + PUS_SERVICE_2, + PUS_SERVICE_3, + PUS_SERVICE_5, + PUS_SERVICE_6, + PUS_SERVICE_8, + PUS_SERVICE_23, + MGM_LIS3MDL, + MGM_RM3100, + PCDU_HANDLER, + HEATER_HANDLER, + SA_DEPL_HANDLER, + PLOC_HANDLER, + COMMON_SUBSYSTEM_ID_END +}; +} + + +#endif /* COMMON_CONFIG_COMMONSUBSYSTEMID_H_ */ diff --git a/etl b/etl deleted file mode 160000 index ae06e641..00000000 --- a/etl +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ae06e6417702b770c49289c9e7162cb3f4a5a217 diff --git a/fsfw b/fsfw index e7d24563..ac027e3f 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit e7d245635047439ca4b5a46d05bf58437a5aa33a +Subproject commit ac027e3ff22b609fe63096275a135babc8f76253 diff --git a/fsfwconfig/events/subsystemIdRanges.h b/fsfwconfig/events/subsystemIdRanges.h index b33ee807..f6f6b161 100644 --- a/fsfwconfig/events/subsystemIdRanges.h +++ b/fsfwconfig/events/subsystemIdRanges.h @@ -1,6 +1,7 @@ #ifndef FSFWCONFIG_EVENTS_SUBSYSTEMIDRANGES_H_ #define FSFWCONFIG_EVENTS_SUBSYSTEMIDRANGES_H_ +#include "commonSubsystemId.h" #include #include @@ -10,19 +11,7 @@ */ namespace SUBSYSTEM_ID { enum: uint8_t { - SUBSYSTE_ID_START = FW_SUBSYSTEM_ID_RANGE, - PUS_SERVICE_2, - PUS_SERVICE_3, - PUS_SERVICE_5, - PUS_SERVICE_6, - PUS_SERVICE_8, - PUS_SERVICE_23, - MGM_LIS3MDL, - MGM_RM3100, - PCDU_HANDLER, - HEATER_HANDLER, - SA_DEPL_HANDLER, - PLOC_HANDLER + SUBSYSTEM_ID_START = COMMON_SUBSYSTEM_ID_END }; } diff --git a/fsfwconfig/objects/systemObjectList.h b/fsfwconfig/objects/systemObjectList.h index 746e83cf..95730e09 100644 --- a/fsfwconfig/objects/systemObjectList.h +++ b/fsfwconfig/objects/systemObjectList.h @@ -3,6 +3,7 @@ #include #include +#include // The objects will be instantiated in the ID order namespace objects { @@ -11,12 +12,6 @@ namespace objects { FW_ADDRESS_START = PUS_SERVICE_1_VERIFICATION, FW_ADDRESS_END = TIME_STAMPER, - /* First Byte 0x50-0x52 reserved for PUS Services **/ - CCSDS_PACKET_DISTRIBUTOR = 0x50000100, - PUS_PACKET_DISTRIBUTOR = 0x50000200, - UDP_BRIDGE = 0x50000300, - UDP_POLLING_TASK = 0x50000400, - PUS_SERVICE_3 = 0x51000300, PUS_SERVICE_5 = 0x51000400, PUS_SERVICE_6 = 0x51000500, @@ -36,39 +31,6 @@ namespace objects { /* 0x47 ('G') for Gpio Interfaces */ GPIO_IF = 0x47000001, - /* 0x44 ('D') for device handlers */ - P60DOCK_HANDLER = 0x44000001, - PDU1_HANDLER = 0x44000002, - PDU2_HANDLER = 0x44000003, - ACU_HANDLER = 0x44000004, - TMP1075_HANDLER_1 = 0x44000005, - TMP1075_HANDLER_2 = 0x44000006, - MGM_0_LIS3_HANDLER = 0x44000007, - MGM_1_RM3100_HANDLER = 0x44000008, - MGM_2_LIS3_HANDLER = 0x44000009, - MGM_3_RM3100_HANDLER = 0x44000010, - GYRO_0_ADIS_HANDLER = 0x44000011, - GYRO_1_L3G_HANDLER = 0x44000012, - GYRO_2_L3G_HANDLER = 0x44000013, - - IMTQ_HANDLER = 0x44000014, - PLOC_HANDLER = 0x44000015, - - - SUS_1 = 0x44000016, - SUS_2 = 0x44000017, - SUS_3 = 0x44000018, - SUS_4 = 0x44000019, - SUS_5 = 0x4400001A, - SUS_6 = 0x4400001B, - SUS_7 = 0x4400001C, - SUS_8 = 0x4400001D, - SUS_9 = 0x4400001E, - SUS_10 = 0x4400001F, - SUS_11 = 0x44000021, - SUS_12 = 0x44000022, - SUS_13 = 0x44000023, - /* Custom device handler */ PCDU_HANDLER = 0x44001000, SOLAR_ARRAY_DEPL_HANDLER = 0x44001001, diff --git a/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp b/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp index 1199ae2c..578b0c44 100644 --- a/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp +++ b/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp @@ -1,12 +1,12 @@ #include "pollingSequenceFactory.h" -#include +#include "linux/devices/SusHandler.h" +#include "OBSWConfig.h" + #include #include #include #include #include -#include -#include ReturnValue_t pst::pollingSequenceInitDefault(FixedTimeslotTaskIF *thisSequence) diff --git a/fsfwconfig/returnvalues/classIds.h b/fsfwconfig/returnvalues/classIds.h index 50bb3cea..5b39df62 100644 --- a/fsfwconfig/returnvalues/classIds.h +++ b/fsfwconfig/returnvalues/classIds.h @@ -2,6 +2,7 @@ #define FSFWCONFIG_RETURNVALUES_CLASSIDS_H_ #include +#include /** * Source IDs starts at 73 for now @@ -10,18 +11,10 @@ */ namespace CLASS_ID { enum { - MISSION_CLASS_ID_START = FW_CLASS_ID_COUNT, - MGM_LIS3MDL, - MGM_RM3100, + CLASS_ID_START = COMMON_CLASS_ID_END, LINUX_LIBGPIO_IF, LINUX_SPI_COM_IF, - PCDU_HANDLER, - HEATER_HANDLER, SA_DEPL_HANDLER, - SYRLINKS_HANDLER, - IMTQ_HANDLER, - PLOC_HANDLER, - SUS_HANDLER }; } diff --git a/linux/CMakeLists.txt b/linux/CMakeLists.txt index 7e6d1f35..1e00391b 100644 --- a/linux/CMakeLists.txt +++ b/linux/CMakeLists.txt @@ -2,3 +2,4 @@ add_subdirectory(csp) add_subdirectory(uart) add_subdirectory(utility) add_subdirectory(boardtest) +add_subdirectory(devices) diff --git a/linux/boardtest/SpiTestClass.h b/linux/boardtest/SpiTestClass.h index f93eb9c2..dd112a0e 100644 --- a/linux/boardtest/SpiTestClass.h +++ b/linux/boardtest/SpiTestClass.h @@ -55,6 +55,15 @@ private: uint8_t gyro2L3gd20ChipSelect = 3; uint8_t mgm2Lis3mdlChipSelect = 0; uint8_t mgm3Rm3100ChipSelect = 23; +#else + uint8_t mgm0Lis3mdlChipSelect = 0; + uint8_t mgm1Rm3100ChipSelect = 0; + uint8_t gyro0AdisResetLine = 0; + uint8_t gyro0AdisChipSelect = 0; + uint8_t gyro1L3gd20ChipSelect = 0; + uint8_t gyro2L3gd20ChipSelect = 0; + uint8_t mgm2Lis3mdlChipSelect = 0; + uint8_t mgm3Rm3100ChipSelect = 0; #endif static constexpr uint8_t STM_READ_MASK = 0b1000'0000; diff --git a/bsp_q7s/devices/CMakeLists.txt b/linux/devices/CMakeLists.txt similarity index 85% rename from bsp_q7s/devices/CMakeLists.txt rename to linux/devices/CMakeLists.txt index 9e6fb793..3871a6a6 100644 --- a/bsp_q7s/devices/CMakeLists.txt +++ b/linux/devices/CMakeLists.txt @@ -1,4 +1,5 @@ target_sources(${TARGET_NAME} PRIVATE HeaterHandler.cpp SolarArrayDeploymentHandler.cpp + SusHandler.cpp ) diff --git a/bsp_q7s/devices/HeaterHandler.cpp b/linux/devices/HeaterHandler.cpp similarity index 99% rename from bsp_q7s/devices/HeaterHandler.cpp rename to linux/devices/HeaterHandler.cpp index 6c5af7be..6f38eb52 100644 --- a/bsp_q7s/devices/HeaterHandler.cpp +++ b/linux/devices/HeaterHandler.cpp @@ -1,7 +1,8 @@ #include "HeaterHandler.h" -#include +#include "devices/gpioIds.h" +#include "devices/powerSwitcherList.h" + #include -#include #include HeaterHandler::HeaterHandler(object_id_t setObjectId_, object_id_t gpioDriverId_, diff --git a/bsp_q7s/devices/HeaterHandler.h b/linux/devices/HeaterHandler.h similarity index 100% rename from bsp_q7s/devices/HeaterHandler.h rename to linux/devices/HeaterHandler.h diff --git a/bsp_q7s/devices/SolarArrayDeploymentHandler.cpp b/linux/devices/SolarArrayDeploymentHandler.cpp similarity index 100% rename from bsp_q7s/devices/SolarArrayDeploymentHandler.cpp rename to linux/devices/SolarArrayDeploymentHandler.cpp diff --git a/bsp_q7s/devices/SolarArrayDeploymentHandler.h b/linux/devices/SolarArrayDeploymentHandler.h similarity index 100% rename from bsp_q7s/devices/SolarArrayDeploymentHandler.h rename to linux/devices/SolarArrayDeploymentHandler.h diff --git a/mission/devices/SusHandler.cpp b/linux/devices/SusHandler.cpp similarity index 99% rename from mission/devices/SusHandler.cpp rename to linux/devices/SusHandler.cpp index 59560707..c31160c4 100644 --- a/mission/devices/SusHandler.cpp +++ b/linux/devices/SusHandler.cpp @@ -1,6 +1,7 @@ +#include "SusHandler.h" +#include "OBSWConfig.h" + #include -#include -#include #include SusHandler::SusHandler(object_id_t objectId, object_id_t comIF, CookieIF * comCookie, diff --git a/mission/devices/SusHandler.h b/linux/devices/SusHandler.h similarity index 100% rename from mission/devices/SusHandler.h rename to linux/devices/SusHandler.h diff --git a/misc/eclipse/.cproject b/misc/eclipse/.cproject index 6caf4a08..1b85c534 100644 --- a/misc/eclipse/.cproject +++ b/misc/eclipse/.cproject @@ -19,7 +19,7 @@ - + @@ -121,7 +121,7 @@ - +