Merged from development, added unit test for config file handler, removed obsolete stuff from handler
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
This commit is contained in:
commit
c4b8fa5444
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,4 +1,5 @@
|
||||
/build*
|
||||
/cmake-build*
|
||||
|
||||
# Eclipse
|
||||
.settings
|
||||
|
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -16,3 +16,6 @@
|
||||
[submodule "thirdparty/json"]
|
||||
path = thirdparty/json
|
||||
url = https://github.com/nlohmann/json.git
|
||||
[submodule "thirdparty/rapidcsv"]
|
||||
path = thirdparty/rapidcsv
|
||||
url = https://github.com/d99kris/rapidcsv.git
|
||||
|
94
CHANGELOG.md
94
CHANGELOG.md
@ -3,30 +3,112 @@ Change Log
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
The format is based on [Keep a Changelog](http://keepachangelog.com/).
|
||||
|
||||
The [milestone](https://egit.irs.uni-stuttgart.de/eive/eive-obsw/milestones)
|
||||
list yields a list of all related PRs for each release.
|
||||
|
||||
# [unreleased]
|
||||
|
||||
# [v1.11.0]
|
||||
# [v1.12.0]
|
||||
|
||||
## Added
|
||||
|
||||
- PUS11 TC scheduler
|
||||
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/259
|
||||
- Regular reboot command
|
||||
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/242
|
||||
- Commands for individual RTD devices
|
||||
PR: https://egit.irs.uni-stuttgart.de/eive/eive-tmtc/pulls/84
|
||||
- `RwAssembly` added to system components. Assembly works in principle,
|
||||
issues making 4 consecutives RWs communicate at once..
|
||||
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/224
|
||||
- Adds a yocto helper script which is able to install the release build binaries
|
||||
(OBSW and Watchdog) into the `q7s-yocto` repository as long as the `q7s-package`
|
||||
or `q7s-yocto` repo was cloned in the same directory the EIVE OBSW repo.
|
||||
This makes updating the root filesystem a lot easier. It also creates and installs a
|
||||
version file.
|
||||
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/248
|
||||
- Create the generic image by default for the Q7S build. The unique binary with the
|
||||
username appended at the end is created as a side-product now
|
||||
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/248
|
||||
|
||||
## Fixed
|
||||
|
||||
- `q7s-cp.py` bugfix
|
||||
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/256
|
||||
|
||||
### Heater
|
||||
|
||||
- Adds `HealthIF` to heaters. Heaters are own system object with queues now which allows to set them faulty.
|
||||
- SW will attempt to shut down heaters which are on but marked faulty
|
||||
- Some simplifications for `HeaterHandler`, use `std::vector` instead of `std::unordered_map` for primary container. Using the heater indexes 0 to 7 allows to use natural array indexing
|
||||
- Some additional input sanity checks in `executeAction`
|
||||
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/236
|
||||
|
||||
## Changed
|
||||
|
||||
- Build unittest as default side product of hosted builds
|
||||
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/244
|
||||
- Let CI/CD build host build and run unittest side product in same step
|
||||
- Catch2 pre-installed in CI/CD docker container, Xiphos SDK installed in CI/CD docker
|
||||
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/247
|
||||
- Sun Sensors have names denoting their location and poiting in the satellite now
|
||||
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/245
|
||||
- Better RTD names denoting their purpose (and location consequently)
|
||||
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/246
|
||||
|
||||
# [v1.11.0]
|
||||
|
||||
## Fixed
|
||||
|
||||
- Host build working again
|
||||
|
||||
## Added
|
||||
|
||||
- Custom Syrlinks FDIR which disabled most of the default FDIR functionality
|
||||
|
||||
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/232
|
||||
- Custom Gomspace FDIR which disabled most of the default FDIR functionality
|
||||
- Custom Syrlinks FDIR which disabled most of the default FDIR functionality
|
||||
|
||||
## Changed
|
||||
|
||||
- PCDU handler only called once in PST, but can handle multiple messages now
|
||||
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/221
|
||||
Bugfix: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/235
|
||||
- Update rootfs base of Linux, all related OBSW changes
|
||||
- Use gpsd version 3.17 now. Includes API changes
|
||||
- Add `/usr/local/bin` to PATH. All shell scripts are there now
|
||||
- Rename GPS device to `/dev/gps0`
|
||||
- Add Syrlinks and TMP devices to Software by default
|
||||
- Update GPS Linux Hyperion Handler to use socket interface. Still allows switching
|
||||
back to SHM interface, but the SHM interface is a possible cause of SW crashes
|
||||
- Updated code for changed FSFW HAL GPIO API: `readGpio` prototype has changed
|
||||
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/240 and
|
||||
https://egit.irs.uni-stuttgart.de/eive/fsfw/pulls/76
|
||||
|
||||
### GPS
|
||||
|
||||
PRs: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/239
|
||||
|
||||
- Rename GPS device to `/dev/gps0`
|
||||
- Use gpsd version 3.17 now. Includes API changes
|
||||
|
||||
### EM and FM splitup & Build Workflow improvements
|
||||
|
||||
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/238
|
||||
|
||||
- Split up `bsp_q7s` in separate EM and FM build with module loading set to different
|
||||
default values. The EM object factory is unique which allows building a parallel setup
|
||||
with dummy components
|
||||
- All major BSPs have an own `OBSWConfig.h.in` file which simplifies the file significantly
|
||||
- Renamed Q7S primary build folders:
|
||||
- `cmake-build-debug-q7s` for primary development build
|
||||
- `cmake-build-release-q7s` for primary release build
|
||||
- `cmake-build-debug-q7s-em` for primary development build of the EM software
|
||||
- `cmake-build-release-q7s-em` for primary release build of the EM software
|
||||
- Refactored Q7S helper script handling. It is now intended and preferred to copy the environment
|
||||
script to the same folder level as the `eive-obsw` and source it. This will also
|
||||
add the path containing the shell helper scripts to `PATH`
|
||||
- The actual helper shell scripts were renamed as well to `q7s-<buildSystem>-<buildType>.sh`
|
||||
|
||||
# [v1.10.1]
|
||||
|
||||
|
298
CMakeLists.txt
298
CMakeLists.txt
@ -1,12 +1,12 @@
|
||||
################################################################################
|
||||
# ##############################################################################
|
||||
# CMake support for the EIVE OBSW
|
||||
#
|
||||
# Author: R. Mueller
|
||||
################################################################################
|
||||
# ##############################################################################
|
||||
|
||||
################################################################################
|
||||
# ##############################################################################
|
||||
# Pre-Project preparation
|
||||
################################################################################
|
||||
# ##############################################################################
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
|
||||
set(OBSW_VERSION_MAJOR_IF_GIT_FAILS 0)
|
||||
@ -15,25 +15,36 @@ set(OBSW_VERSION_REVISION_IF_GIT_FAILS 0)
|
||||
|
||||
# set(CMAKE_VERBOSE TRUE)
|
||||
|
||||
option(EIVE_HARDCODED_TOOLCHAIN_FILE "\
|
||||
option(
|
||||
EIVE_HARDCODED_TOOLCHAIN_FILE
|
||||
"\
|
||||
For Linux Board Target BSPs, a default toolchain file will be set. Should be set to OFF \
|
||||
if a different toolchain file is set externally" ON
|
||||
)
|
||||
if a different toolchain file is set externally"
|
||||
ON)
|
||||
|
||||
if(NOT FSFW_OSAL)
|
||||
set(FSFW_OSAL linux CACHE STRING "OS for the FSFW.")
|
||||
set(FSFW_OSAL
|
||||
linux
|
||||
CACHE STRING "OS for the FSFW.")
|
||||
endif()
|
||||
|
||||
if(TGT_BSP)
|
||||
if(TGT_BSP MATCHES "arm/raspberrypi" OR TGT_BSP MATCHES "arm/beagleboneblack")
|
||||
if(TGT_BSP MATCHES "arm/q7s"
|
||||
OR TGT_BSP MATCHES "arm/raspberrypi"
|
||||
OR TGT_BSP MATCHES "arm/beagleboneblack")
|
||||
option(LINUX_CROSS_COMPILE ON)
|
||||
endif()
|
||||
if(TGT_BSP MATCHES "arm/raspberrypi" OR TGT_BSP MATCHES "arm/beagleboneblack")
|
||||
option(EIVE_BUILD_GPSD_GPS_HANDLER "Build GPSD dependent GPS Handler" OFF)
|
||||
elseif(TGT_BSP MATCHES "arm/q7s")
|
||||
option(EIVE_Q7S_EM "Build configuration for the EM" OFF)
|
||||
option(EIVE_BUILD_GPSD_GPS_HANDLER "Build GPSD dependent GPS Handler" ON)
|
||||
endif()
|
||||
option(EIVE_CREATE_UNIQUE_OBSW_BIN "Append username to generated binary name" ON)
|
||||
option(EIVE_CREATE_UNIQUE_OBSW_BIN "Append username to generated binary name"
|
||||
ON)
|
||||
else()
|
||||
option(EIVE_CREATE_UNIQUE_OBSW_BIN "Append username to generated binary name" OFF)
|
||||
option(EIVE_CREATE_UNIQUE_OBSW_BIN "Append username to generated binary name"
|
||||
OFF)
|
||||
endif()
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||
@ -53,20 +64,77 @@ include(EiveHelpers)
|
||||
option(EIVE_ADD_ETL_LIB "Add ETL library" ON)
|
||||
option(EIVE_ADD_JSON_LIB "Add JSON library" ON)
|
||||
|
||||
set(OBSW_ADD_STAR_TRACKER 0)
|
||||
set(OBSW_DEBUG_STARTRACKER 0)
|
||||
set(OBSW_MAX_SCHEDULED_TCS 500)
|
||||
|
||||
################################################################################
|
||||
if(EIVE_Q7S_EM)
|
||||
set(OBSW_Q7S_EM
|
||||
1
|
||||
CACHE STRING "Q7S EM configuration")
|
||||
set(INIT_VAL 0)
|
||||
else()
|
||||
set(OBSW_Q7S_EM
|
||||
0
|
||||
CACHE STRING "Q7S EM configuration")
|
||||
set(INIT_VAL 1)
|
||||
endif()
|
||||
set(OBSW_ADD_MGT
|
||||
${INIT_VAL}
|
||||
CACHE STRING "Add MGT module")
|
||||
set(OBSW_ADD_BPX_BATTERY_HANDLER
|
||||
${INIT_VAL}
|
||||
CACHE STRING "Add MGT module")
|
||||
set(OBSW_ADD_STAR_TRACKER
|
||||
${INIT_VAL}
|
||||
CACHE STRING "Add Startracker module")
|
||||
set(OBSW_ADD_SUN_SENSORS
|
||||
${INIT_VAL}
|
||||
CACHE STRING "Add sun sensor module")
|
||||
set(OBSW_ADD_SUS_BOARD_ASS
|
||||
${INIT_VAL}
|
||||
CACHE STRING "Add sun sensor board assembly")
|
||||
set(OBSW_ADD_ACS_BOARD
|
||||
${INIT_VAL}
|
||||
CACHE STRING "Add ACS board module")
|
||||
set(OBSW_ADD_ACS_HANDLERS
|
||||
${INIT_VAL}
|
||||
CACHE STRING "Add ACS handlers")
|
||||
set(OBSW_ADD_RTD_DEVICES
|
||||
${INIT_VAL}
|
||||
CACHE STRING "Add RTD devices")
|
||||
set(OBSW_ADD_RAD_SENSORS
|
||||
${INIT_VAL}
|
||||
CACHE STRING "Add Rad Sensor module")
|
||||
set(OBSW_ADD_PL_PCDU
|
||||
${INIT_VAL}
|
||||
CACHE STRING "Add Payload PCDU modukle")
|
||||
set(OBSW_ADD_SYRLINKS
|
||||
${INIT_VAL}
|
||||
CACHE STRING "Add Syrlinks module")
|
||||
set(OBSW_ADD_TMP_DEVICES
|
||||
${INIT_VAL}
|
||||
CACHE STRING "Add TMP devices")
|
||||
set(OBSW_ADD_GOMSPACE_PCDU
|
||||
${INIT_VAL}
|
||||
CACHE STRING "Add GomSpace PCDU modules")
|
||||
set(OBSW_ADD_RW
|
||||
${INIT_VAL}
|
||||
CACHE STRING "Add RW modules")
|
||||
|
||||
# ##############################################################################
|
||||
# Pre-Sources preparation
|
||||
################################################################################
|
||||
# ##############################################################################
|
||||
|
||||
# Version handling
|
||||
set(GIT_VER_HANDLING_OK FALSE)
|
||||
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
|
||||
determine_version_with_git("--exclude" "docker_*")
|
||||
set(GIT_INFO ${GIT_INFO} CACHE STRING "Version information retrieved with git describe")
|
||||
set(GIT_INFO
|
||||
${GIT_INFO}
|
||||
CACHE STRING "Version information retrieved with git describe")
|
||||
if(GIT_INFO)
|
||||
set(GIT_INFO ${GIT_INFO} CACHE STRING "Version information retrieved with git describe")
|
||||
set(GIT_INFO
|
||||
${GIT_INFO}
|
||||
CACHE STRING "Version information retrieved with git describe")
|
||||
list(GET GIT_INFO 1 OBSW_VERSION_MAJOR)
|
||||
list(GET GIT_INFO 2 OBSW_VERSION_MINOR)
|
||||
list(GET GIT_INFO 3 OBSW_VERSION_REVISION)
|
||||
@ -98,7 +166,7 @@ set(SIMPLE_OBSW_NAME eive-simple)
|
||||
set(UNITTEST_NAME eive-unittest)
|
||||
set(LIB_FSFW_NAME fsfw)
|
||||
set(LIB_EIVE_MISSION eive-mission)
|
||||
set(LIB_ETL_NAME etl)
|
||||
set(LIB_ETL_TARGET etl::etl)
|
||||
set(LIB_CSP_NAME libcsp)
|
||||
set(LIB_LWGPS_NAME lwgps)
|
||||
set(LIB_ARCSEC wire)
|
||||
@ -135,12 +203,14 @@ pre_source_hw_os_config()
|
||||
|
||||
if(TGT_BSP)
|
||||
set(LIBGPS_VERSION_MAJOR 3)
|
||||
# I assume a newer version than 3.17 will be installed on other Linux board than the Q7S
|
||||
# I assume a newer version than 3.17 will be installed on other Linux board
|
||||
# than the Q7S
|
||||
set(LIBGPS_VERSION_MINOR 20)
|
||||
if(TGT_BSP MATCHES "arm/q7s" OR TGT_BSP MATCHES "arm/raspberrypi"
|
||||
OR TGT_BSP MATCHES "arm/beagleboneblack" OR TGT_BSP MATCHES "arm/egse"
|
||||
OR TGT_BSP MATCHES "arm/te0720-1cfa"
|
||||
)
|
||||
if(TGT_BSP MATCHES "arm/q7s"
|
||||
OR TGT_BSP MATCHES "arm/raspberrypi"
|
||||
OR TGT_BSP MATCHES "arm/beagleboneblack"
|
||||
OR TGT_BSP MATCHES "arm/egse"
|
||||
OR TGT_BSP MATCHES "arm/te0720-1cfa")
|
||||
find_library(${LIB_GPS} gps)
|
||||
set(FSFW_CONFIG_PATH "linux/fsfwconfig")
|
||||
if(NOT BUILD_Q7S_SIMPLE_MODE)
|
||||
@ -150,7 +220,7 @@ if(TGT_BSP)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(TGT_BSP MATCHES "arm/raspberrypi" )
|
||||
if(TGT_BSP MATCHES "arm/raspberrypi")
|
||||
# Used by configure file
|
||||
set(RASPBERRY_PI ON)
|
||||
set(FSFW_HAL_ADD_RASPBERRY_PI ON)
|
||||
@ -184,11 +254,10 @@ else()
|
||||
set(FSFW_CONFIG_PATH "${BSP_PATH}/fsfwconfig")
|
||||
endif()
|
||||
|
||||
|
||||
# Configuration files
|
||||
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)
|
||||
configure_file(${BSP_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" OR TGT_BSP MATCHES "arm/egse")
|
||||
@ -198,16 +267,14 @@ endif()
|
||||
configure_file(${WATCHDOG_PATH}/watchdogConf.h.in watchdogConf.h)
|
||||
|
||||
# Set common config path for FSFW
|
||||
set(FSFW_ADDITIONAL_INC_PATHS
|
||||
"${COMMON_PATH}/config"
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
set(FSFW_ADDITIONAL_INC_PATHS "${COMMON_PATH}/config"
|
||||
${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
################################################################################
|
||||
# ##############################################################################
|
||||
# Executable and Sources
|
||||
################################################################################
|
||||
# ##############################################################################
|
||||
|
||||
#global compiler options need to be set before adding executables
|
||||
# global compiler options need to be set before adding executables
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
add_compile_options(
|
||||
"-Wall"
|
||||
@ -230,20 +297,15 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
"-Wcast-qual" # Warn if the constness is cast away
|
||||
"-Wstringop-overflow=4"
|
||||
# -Wstack-protector # Emits a few false positives for low level access
|
||||
# -Wconversion # Creates many false positives
|
||||
# -Warith-conversion # Use with Wconversion to find more implicit conversions
|
||||
# -fanalyzer # Should be used to look through problems
|
||||
# -Wconversion # Creates many false positives -Warith-conversion # Use with
|
||||
# Wconversion to find more implicit conversions -fanalyzer # Should be used
|
||||
# to look through problems
|
||||
)
|
||||
# Remove unused sections.
|
||||
add_compile_options(
|
||||
"-ffunction-sections"
|
||||
"-fdata-sections"
|
||||
)
|
||||
add_compile_options("-ffunction-sections" "-fdata-sections")
|
||||
|
||||
# Removed unused sections.
|
||||
add_link_options(
|
||||
"-Wl,--gc-sections"
|
||||
)
|
||||
add_link_options("-Wl,--gc-sections")
|
||||
|
||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
set(COMPILER_FLAGS "/permissive-")
|
||||
@ -253,11 +315,8 @@ add_library(${LIB_EIVE_MISSION})
|
||||
|
||||
# Add main executable
|
||||
add_executable(${OBSW_NAME})
|
||||
if(EIVE_CREATE_UNIQUE_OBSW_BIN)
|
||||
set(OBSW_BIN_NAME ${CMAKE_PROJECT_NAME}-$ENV{USERNAME})
|
||||
else()
|
||||
set(OBSW_BIN_NAME ${CMAKE_PROJECT_NAME})
|
||||
endif()
|
||||
set(OBSW_BIN_NAME ${CMAKE_PROJECT_NAME})
|
||||
|
||||
set_target_properties(${OBSW_NAME} PROPERTIES OUTPUT_NAME ${OBSW_BIN_NAME})
|
||||
|
||||
# Watchdog
|
||||
@ -268,23 +327,26 @@ else()
|
||||
endif()
|
||||
|
||||
add_subdirectory(${WATCHDOG_PATH})
|
||||
target_link_libraries(${WATCHDOG_NAME} PUBLIC
|
||||
${LIB_CXX_FS}
|
||||
)
|
||||
target_include_directories(${WATCHDOG_NAME} PUBLIC
|
||||
${CMAKE_BINARY_DIR}
|
||||
)
|
||||
target_link_libraries(${WATCHDOG_NAME} PUBLIC ${LIB_CXX_FS})
|
||||
target_include_directories(${WATCHDOG_NAME} PUBLIC ${CMAKE_BINARY_DIR})
|
||||
|
||||
# unittests
|
||||
add_executable(${UNITTEST_NAME} EXCLUDE_FROM_ALL)
|
||||
if(NOT TGT_BSP)
|
||||
add_executable(${UNITTEST_NAME})
|
||||
else()
|
||||
add_executable(${UNITTEST_NAME} EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
|
||||
if(EIVE_ADD_ETL_LIB)
|
||||
|
||||
endif()
|
||||
|
||||
if(EIVE_ADD_JSON_LIB)
|
||||
add_subdirectory(${LIB_JSON_PATH})
|
||||
endif()
|
||||
|
||||
add_subdirectory(thirdparty/rapidcsv)
|
||||
|
||||
if(EIVE_ADD_LINUX_FILES)
|
||||
add_subdirectory(${LIB_ARCSEC_PATH})
|
||||
add_subdirectory(${LINUX_PATH})
|
||||
@ -303,117 +365,113 @@ add_subdirectory(${TEST_PATH})
|
||||
|
||||
add_subdirectory(${UNITTEST_PATH})
|
||||
|
||||
# This should have already been downloaded by the FSFW
|
||||
# Still include it to be safe
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(
|
||||
# This should have already been downloaded by the FSFW Still include it to be
|
||||
# safe
|
||||
find_package(etl ${FSFW_ETL_LIB_MAJOR_VERSION} CONFIG QUIET)
|
||||
# Not installed, so use FetchContent to download and provide etl
|
||||
if(NOT etl_FOUND)
|
||||
message(
|
||||
STATUS
|
||||
"No ETL installation was found with find_package. Installing and providing "
|
||||
"etl with FindPackage")
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(
|
||||
etl
|
||||
GIT_REPOSITORY https://github.com/ETLCPP/etl
|
||||
GIT_TAG ${FSFW_ETL_LIB_VERSION}
|
||||
)
|
||||
FetchContent_MakeAvailable(etl)
|
||||
GIT_TAG ${FSFW_ETL_LIB_VERSION})
|
||||
list(APPEND FSFW_FETCH_CONTENT_TARGETS etl)
|
||||
endif()
|
||||
|
||||
# Use same Catch2 version as framework
|
||||
if (NOT(TGT_BSP MATCHES "arm/te0720-1cfa") AND NOT(TGT_BSP MATCHES "arm/q7s"))
|
||||
if(NOT (TGT_BSP MATCHES "arm/te0720-1cfa")
|
||||
AND NOT (TGT_BSP MATCHES "arm/q7s")
|
||||
AND NOT (TGT_BSP MATCHES "arm/raspberrypi"))
|
||||
# Check whether the user has already installed Catch2 first
|
||||
find_package(Catch2 ${FSFW_CATCH2_LIB_MAJOR_VERSION} CONFIG QUIET)
|
||||
# Not installed, so use FetchContent to download and provide Catch2
|
||||
if(NOT Catch2_FOUND)
|
||||
message(STATUS "${MSG_PREFIX} Catch2 installation not found. Downloading Catch2 library with FetchContent")
|
||||
message(
|
||||
STATUS
|
||||
"${MSG_PREFIX} Catch2 installation not found. Downloading Catch2 library with FetchContent"
|
||||
)
|
||||
include(FetchContent)
|
||||
|
||||
FetchContent_Declare(
|
||||
Catch2
|
||||
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
|
||||
GIT_TAG ${FSFW_CATCH2_LIB_VERSION}
|
||||
)
|
||||
GIT_TAG ${FSFW_CATCH2_LIB_VERSION})
|
||||
|
||||
FetchContent_MakeAvailable(Catch2)
|
||||
#fixes regression -preview4, to be confirmed in later releases
|
||||
list(APPEND FSFW_FETCH_CONTENT_TARGETS Catch2)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# The documentation for FetchContent recommends declaring all the dependencies
|
||||
# before making them available. We make all declared dependency available here
|
||||
# after their declaration
|
||||
if(FSFW_FETCH_CONTENT_TARGETS)
|
||||
FetchContent_MakeAvailable(${FSFW_FETCH_CONTENT_TARGETS})
|
||||
if(TARGET etl)
|
||||
add_library(${LIB_ETL_TARGET} ALIAS etl)
|
||||
endif()
|
||||
if(TARGET Catch2)
|
||||
# Fixes regression -preview4, to be confirmed in later releases Related
|
||||
# GitHub issue: https://github.com/catchorg/Catch2/issues/2417
|
||||
set_target_properties(Catch2 PROPERTIES DEBUG_POSTFIX "")
|
||||
set_target_properties(Catch2 PROPERTIES EXCLUDE_FROM_ALL "true")
|
||||
set_target_properties(Catch2WithMain PROPERTIES EXCLUDE_FROM_ALL "true")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
################################################################################
|
||||
# ##############################################################################
|
||||
# Post-Sources preparation
|
||||
################################################################################
|
||||
# ##############################################################################
|
||||
|
||||
# Add libraries
|
||||
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC
|
||||
${LIB_FSFW_NAME}
|
||||
${LIB_LWGPS_NAME}
|
||||
${LIB_OS_NAME}
|
||||
)
|
||||
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}
|
||||
)
|
||||
target_link_libraries(${OBSW_NAME} PRIVATE ${LIB_EIVE_MISSION})
|
||||
|
||||
if(TGT_BSP MATCHES "arm/q7s")
|
||||
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC
|
||||
${LIB_GPS}
|
||||
${LIB_ARCSEC}
|
||||
)
|
||||
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC ${LIB_GPS} ${LIB_ARCSEC})
|
||||
endif()
|
||||
|
||||
target_link_libraries(${UNITTEST_NAME} PRIVATE
|
||||
Catch2
|
||||
${LIB_EIVE_MISSION}
|
||||
)
|
||||
target_link_libraries(${UNITTEST_NAME} PRIVATE Catch2 ${LIB_EIVE_MISSION}
|
||||
rapidcsv)
|
||||
|
||||
if(TGT_BSP MATCHES "arm/egse")
|
||||
target_link_libraries(${OBSW_NAME} PRIVATE
|
||||
${LIB_ARCSEC}
|
||||
)
|
||||
target_link_libraries(${OBSW_NAME} PRIVATE ${LIB_ARCSEC})
|
||||
endif()
|
||||
|
||||
if(ADD_CSP_LIB)
|
||||
target_link_libraries(${OBSW_NAME} PRIVATE
|
||||
${LIB_CSP_NAME}
|
||||
)
|
||||
target_link_libraries(${OBSW_NAME} PRIVATE ${LIB_CSP_NAME})
|
||||
endif()
|
||||
|
||||
|
||||
if(EIVE_ADD_ETL_LIB)
|
||||
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC
|
||||
etl
|
||||
)
|
||||
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC ${LIB_ETL_TARGET})
|
||||
endif()
|
||||
|
||||
if(EIVE_ADD_JSON_LIB)
|
||||
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC
|
||||
${LIB_JSON_NAME}
|
||||
)
|
||||
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC ${LIB_JSON_NAME})
|
||||
endif()
|
||||
|
||||
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC
|
||||
${LIB_CXX_FS}
|
||||
)
|
||||
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC ${LIB_CXX_FS})
|
||||
|
||||
# Add include paths for all sources.
|
||||
target_include_directories(${LIB_EIVE_MISSION} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${FSFW_CONFIG_PATH}
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${LIB_ARCSEC_PATH}
|
||||
)
|
||||
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" OR TGT_BSP MATCHES "arm/egse")
|
||||
target_include_directories(${LIB_EIVE_MISSION} PUBLIC
|
||||
${ARCSEC_LIB_PATH}
|
||||
)
|
||||
target_include_directories(${LIB_EIVE_MISSION} PUBLIC ${ARCSEC_LIB_PATH})
|
||||
endif()
|
||||
|
||||
if(CMAKE_VERBOSE)
|
||||
message(STATUS "Warning flags: ${WARNING_FLAGS}")
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
if(CMAKE_CROSSCOMPILING)
|
||||
include (HardwareOsPostConfig)
|
||||
include(HardwareOsPostConfig)
|
||||
post_source_hw_os_config()
|
||||
endif()
|
||||
|
||||
@ -436,19 +494,15 @@ endif()
|
||||
|
||||
install(TARGETS ${OBSW_NAME} RUNTIME DESTINATION bin)
|
||||
|
||||
string(CONCAT POST_BUILD_COMMENT
|
||||
"Build directory: ${CMAKE_BINARY_DIR}\n"
|
||||
string(CONCAT POST_BUILD_COMMENT "Build directory: ${CMAKE_BINARY_DIR}\n"
|
||||
"Target OSAL: ${FSFW_OSAL}\n"
|
||||
"Target Build Type: ${CMAKE_BUILD_TYPE}\n"
|
||||
"${TARGET_STRING}"
|
||||
)
|
||||
"Target Build Type: ${CMAKE_BUILD_TYPE}\n" "${TARGET_STRING}")
|
||||
|
||||
add_custom_command(
|
||||
TARGET ${OBSW_NAME}
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_SIZE} ${OBSW_BIN_NAME}${FILE_SUFFIX}
|
||||
COMMENT ${POST_BUILD_COMMENT}
|
||||
)
|
||||
COMMENT ${POST_BUILD_COMMENT})
|
||||
|
||||
include (BuildType)
|
||||
include(BuildType)
|
||||
set_build_type()
|
||||
|
172
README.md
172
README.md
@ -70,8 +70,9 @@ prerequisites.
|
||||
## Building the OBSW and flashing it on the Q7S
|
||||
|
||||
1. ARM cross-compiler installed, either as part of [Vivado 2018.2 installation](#vivado) or
|
||||
as a [separate download](#arm-toolchain)
|
||||
2. [Q7S sysroot](#sysroot) on local development machine
|
||||
as a [separate download](#arm-toolchain). The Xiphos SDK also installs a cross-compiler,
|
||||
but its version is currently too old to compile the OBSW (7.3.0).
|
||||
2. [Q7S sysroot](#sysroot) on local development machine. It is installed by the Xiphos SDK
|
||||
3. Recommended: Eclipse or [Vivado 2018.2 SDK](#vivado) for OBSW development
|
||||
3. [TCF agent](https://wiki.eclipse.org/TCF) running on Q7S
|
||||
|
||||
@ -88,7 +89,7 @@ When using Windows, run theses steps in MSYS2.
|
||||
1. Clone the repository with
|
||||
|
||||
```sh
|
||||
git clone https://egit.irs.uni-stuttgart.de/eive/eive_obsw.git
|
||||
git clone https://egit.irs.uni-stuttgart.de/eive/eive-obsw.git
|
||||
```
|
||||
|
||||
2. Update all the submodules
|
||||
@ -107,31 +108,97 @@ When using Windows, run theses steps in MSYS2.
|
||||
Add `-G "MinGW Makefiles` in MinGW64 on Windows.
|
||||
|
||||
```sh
|
||||
mkdir build-Debug-Q7S && cd build-Debug-Q7S
|
||||
mkdir cmake-build-debug-q7s && cd cmake-build-debug-q7s
|
||||
cmake -DTGT_BSP="arm/q7s" -DCMAKE_BUILD_TYPE=Debug ..
|
||||
cmake --build . -j
|
||||
```
|
||||
|
||||
You can also use provided shell scripts to perform these commands
|
||||
|
||||
You can also use provided shell scripts to perform these commands.
|
||||
```sh
|
||||
cd cmake/scripts/Q7S
|
||||
./make_debug_cfg.sh
|
||||
cd ../../..
|
||||
cp scripts/q7s-env.sh ..
|
||||
cp scripts/q7s-env-em.sh ..
|
||||
```
|
||||
|
||||
This will invoke a Python script which in turn invokes CMake with the correct
|
||||
arguments to configure CMake for Q7S cross-compilation.
|
||||
Adapt these scripts for your needs by editing the `CROSS_COMPILE_BIN_PATH`
|
||||
and `ZYNQ_7020_SYSROOT`. After that, you can run the following commands to set up
|
||||
the FM build
|
||||
|
||||
```sh
|
||||
cd ..
|
||||
./q7s-env.sh
|
||||
q7s-make-debug.sh
|
||||
```
|
||||
|
||||
You can build the EM setup by running
|
||||
|
||||
```sh
|
||||
export EIVE_Q7S_EM=1
|
||||
```
|
||||
|
||||
or by running the `q7s-env-em.sh` script instead before setting up the build
|
||||
configuration.
|
||||
|
||||
The shell scripts will invoke a Python script which in turn invokes CMake with the correct
|
||||
arguments to configure CMake for Q7S cross-compilation. You can look into the command
|
||||
output to see which commands were run exactly.
|
||||
|
||||
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
|
||||
|
||||
```sh
|
||||
cd build-Debug-Q7S
|
||||
cd cmake-build-debug-q7s
|
||||
cmake --build . -j
|
||||
```
|
||||
|
||||
## Build for the Q7S target root filesystem with `yocto`
|
||||
|
||||
The EIVE root filesystem will contain the EIVE OBSW and the Watchdog component.
|
||||
It is currently generated with `yocto`, but the tool can not compile the primary
|
||||
OBSW due to toolchain version incompatibility. Therefore, the OBSW components
|
||||
are currently compiled using the toolchain specified in this README (e.g. installed by Vivado).
|
||||
|
||||
However, it is still possible to install the two components using yocto. A few helper files were
|
||||
provided to make this process easier. The following steps can be used to install the OBSW
|
||||
components and a version file to the yocto sources for the generation of the complete EIVE root
|
||||
file system image. The steps here are shown for Ubuntu, you can use the according Windows
|
||||
helper scripts as well.
|
||||
|
||||
1. Copy the `q7s-env.sh` script to the same layer as the `eive-obsw`.
|
||||
|
||||
```sh
|
||||
cp scripts/q7s-env.sh ..
|
||||
cd ..
|
||||
./q7s-env.sh
|
||||
q7s-make-release.sh
|
||||
```
|
||||
|
||||
2. Compile the OBSW components in release mode
|
||||
|
||||
```sh
|
||||
cd cmake-build-release-q7s
|
||||
cmake --build . -j
|
||||
```
|
||||
|
||||
3. Make sure the [`q7s-yocto`](https://egit.irs.uni-stuttgart.de/eive/q7s-yocto)
|
||||
repository or the [`q7s-package`](https://egit.irs.uni-stuttgart.de/eive/q7s-package.git)
|
||||
repository and its `q7s-yocto` submodule were cloned in the same directory layer as
|
||||
the `eive-obsw`.
|
||||
|
||||
4. Run the install script to install the files into `q7s-yocto`.
|
||||
|
||||
```sh
|
||||
install-obsw-yocto.sh
|
||||
```
|
||||
|
||||
5. Navigate into the `q7s-yocto` repo and review the changes. You can then add and push those
|
||||
changes.
|
||||
|
||||
6. You can now rebuild the root filesystem with the updated OBSW using `yocto`. This probably needs
|
||||
to be done on another machine or in a VM. The [`q7s-yocto`](https://egit.irs.uni-stuttgart.de/eive/q7s-yocto)
|
||||
repository contains details on how to best do this.
|
||||
|
||||
## Building in Xilinx SDK 2018.2
|
||||
|
||||
1. Open Xilinx SDK 2018.2
|
||||
@ -167,7 +234,7 @@ The EIVE OBSW is the default target if no target is specified.
|
||||
**Debug**
|
||||
|
||||
```sh
|
||||
mkdir build-Debug-Q7S && cd build-Debug-Q7S
|
||||
mkdir cmake-build-debug-q7s && cd cmake-build-debug-q7s
|
||||
cmake -DTGT_BSP=arm/q7s -DCMAKE_BUILD_TYPE=Debug ..
|
||||
cmake --build . -j
|
||||
```
|
||||
@ -175,7 +242,7 @@ cmake --build . -j
|
||||
**Release**
|
||||
|
||||
```sh
|
||||
mkdir build-Release-Q7S && cd build-Release-Q7S
|
||||
mkdir cmake-build-release-q7s && cd cmake-build-release-q7s
|
||||
cmake -DTGT_BSP=arm/q7s -DCMAKE_BUILD_TYPE=Release ..
|
||||
cmake --build . -j
|
||||
```
|
||||
@ -190,7 +257,7 @@ 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
|
||||
mkdir cmake-build-debug && cd cmake-build-debug
|
||||
cmake -DFSFW_OSAL=host -DCMAKE_BUILD_TYPE=Debug ..
|
||||
cmake --build . -j
|
||||
```
|
||||
@ -201,7 +268,7 @@ To build the unittests, the corresponding target must be specified in the build
|
||||
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
|
||||
mkdir cmake-build-debug && cd cmake-build-debug
|
||||
cmake ..
|
||||
cmake --build . --target eive-unittests -j
|
||||
```
|
||||
@ -307,7 +374,7 @@ If you are comiling for the Raspberry Pi, you have to set the `LINUX_ROOTFS` env
|
||||
variable instead. You can find a base root filesystem for the Raspberry Pi
|
||||
[here](https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files/?dir=/EIVE_IRS/Software/rootfs).
|
||||
|
||||
## <a id="vivado"></a> Installing Vivado the the Xilinx development tools
|
||||
## <a id="vivado"></a> Installing Vivado and the Xilinx development tools
|
||||
|
||||
It's also possible to perform debugging with a normal Eclipse installation by installing
|
||||
the TCF plugin and downloading the cross-compiler as specified in the section below. However,
|
||||
@ -323,9 +390,9 @@ installed Vivado with the SDK core tools.
|
||||
|
||||
<img src="https://egit.irs.uni-stuttgart.de/eive/eive-obsw/raw/branch/develop/doc/img/vivado-edition.png" width="50%"> <br>
|
||||
|
||||
<img src="https://egit.irs.uni-stuttgart.de/eive/eive-obsw/raw/branch/mueller/master/doc/img/vivado-hl-design.png" width="50%"> <br>
|
||||
<img src="https://egit.irs.uni-stuttgart.de/eive/eive-obsw/raw/branch/develop/doc/img/vivado-hl-design.png" width="50%"> <br>
|
||||
|
||||
<img src="https://egit.irs.uni-stuttgart.de/eive/eive-obsw/raw/branch/mueller/master/doc/img/xilinx-install.PNG" width="50%"> <br>
|
||||
<img src="https://egit.irs.uni-stuttgart.de/eive/eive-obsw/raw/branch/develop/doc/img/xilinx-install.PNG" width="50%"> <br>
|
||||
|
||||
* For supported OS refer to https://www.xilinx.com/support/documentation/sw_manuals/xilinx2018_2/ug973-vivado-release-notes-install-license.pdf .
|
||||
Installation was tested on Windows and Ubuntu 21.04.
|
||||
@ -642,35 +709,7 @@ Thus the replies are received with a larger delay compared to a direct TCP conne
|
||||
3. Make sure the netmask of the ehternet interface of the workstation matches the netmask of the Q7S
|
||||
* When IP address is set to 192.168.133.10 and the netmask is 255.255.255.0, an example IP address for the workstation
|
||||
is 192.168.133.2
|
||||
|
||||
4. Run tcf-agent on Q7S
|
||||
|
||||
* Tcf-agent is not yet integrated in the rootfs of the Q7S. Therefore build tcf-agent manually
|
||||
|
||||
```sh
|
||||
git clone git://git.eclipse.org/gitroot/tcf/org.eclipse.tcf.agent.git
|
||||
cd org.eclipse.tcf.agent/agent
|
||||
make CC=arm-linux-gnueabihf-gcc LD=arm-linux-gnueabihf-ld MACHINE=arm NO_SSL=1 NO_UUID=1
|
||||
```
|
||||
|
||||
* Transfer executable agent from org.eclipse.tcf.agent/agent/obj/GNU/Linux/arm/Debug to /tmp of Q7S
|
||||
|
||||
```sh
|
||||
cd obj/GNU/Linux/arm/Debug
|
||||
scp agent root@192.168.133.10:/tmp
|
||||
```
|
||||
|
||||
* On Q7S
|
||||
```sh
|
||||
cd /tmp
|
||||
chmod +x agent
|
||||
```
|
||||
|
||||
* Run agent
|
||||
```sh
|
||||
./agent
|
||||
```
|
||||
|
||||
4. Make sure th `tcf-agent` is running by checking `systemctl status tcf-agent`
|
||||
5. In Xilinx SDK 2018.2 right click on project → Debug As → Debug Configurations
|
||||
6. Right click Xilinx C/C++ applicaton (System Debugger) → New →
|
||||
7. Set Debug Type to Linux Application Debug and Connectin to Linux Agent
|
||||
@ -680,8 +719,8 @@ Thus the replies are received with a larger delay compared to a direct TCP conne
|
||||
11. Test connection (This ensures the TCF Agent is running on the Q7S)
|
||||
12. Select Application tab
|
||||
* Project Name: eive_obsw
|
||||
* Local File Path: Path to eiveobsw-linux.elf (in `_bin\linux\devel`)
|
||||
* Remote File Path: `/tmp/eive_obsw.elf`
|
||||
* Local File Path: Path to OBSW application image with debug symbols (non-stripped)
|
||||
* Remote File Path: `/tmp/<OBSW NAME>`
|
||||
|
||||
# <a id="file-transfer"></a> Transfering Files to the Q7S
|
||||
|
||||
@ -707,7 +746,8 @@ From a windows machine files can be copied with putty tools (note: use IPv4 addr
|
||||
pscp -scp -P 22 eive@192.168.199.227:</directory-to-example-file/>/example-file </windows-machine-path/>
|
||||
````
|
||||
|
||||
More detailed information about the used q7s commands can be found in the Q7S user manual.
|
||||
A helper script named `q7s-cp.py` can be used together with the `q7s-port.sh`
|
||||
script to make this process easier.
|
||||
|
||||
# <a id="q7s"></a> Q7S OBC
|
||||
|
||||
@ -1087,16 +1127,28 @@ Eclipse indexer.
|
||||
|
||||
The [TCF agent](https://wiki.eclipse.org/TCF) can be used to perform remote debugging on the Q7S.
|
||||
|
||||
1. Install the TCF agent plugin in Eclipse from
|
||||
1. Copy the `.cproject` file and the `.project` file inside the `misc/eclipse` folder into the
|
||||
repo root
|
||||
|
||||
```sh
|
||||
cd eive-obsw
|
||||
cp misc/eclipse/.cproject .
|
||||
cp misc/eclipse/.project .
|
||||
```
|
||||
|
||||
2. Open the repo in Eclipse as a folder.
|
||||
|
||||
3. Install the TCF agent plugin in Eclipse from
|
||||
the [releases](https://www.eclipse.org/tcf/downloads.php). Go to
|
||||
Help → Install New Software and use the download page, for
|
||||
example https://download.eclipse.org/tools/tcf/releases/1.7/1.7.0/ to search for the plugin and install it. You can find the newest version [here](https://www.eclipse.org/tcf/downloads.php)
|
||||
example https://download.eclipse.org/tools/tcf/releases/1.7/1.7.0/ to search for the plugin and
|
||||
install it. You can find the newest version [here](https://www.eclipse.org/tcf/downloads.php)
|
||||
|
||||
2. Go to Window → Perspective → Open Perspective and open the **Target Explorer Perspective**.
|
||||
4. Go to Window → Perspective → Open Perspective and open the **Target Explorer Perspective**.
|
||||
Here, the Q7S should show up if the local port forwarding was set up as explained previously.
|
||||
Please note that you have to connect to `localhost` and port `1534` with port forwaring set up.
|
||||
|
||||
3. A launch configuration was provided, but it might be necessary to adapt it for your own needs.
|
||||
5. A launch configuration was provided, but it might be necessary to adapt it for your own needs.
|
||||
Alternatively:
|
||||
|
||||
- Create a new **TCF Remote Application** by pressing the cogs button at the top or going to
|
||||
@ -1185,7 +1237,7 @@ in the same way.
|
||||
|
||||
* the formatting is based on the clang-format tools
|
||||
|
||||
## Setting up eclipse auto-fromatter with clang-format
|
||||
## Setting up auto-formatter with clang-format in Xilinx SDK
|
||||
|
||||
1. Help → Install New Software → Add
|
||||
2. In location insert the link http://www.cppstyle.com/luna
|
||||
@ -1195,3 +1247,11 @@ in the same way.
|
||||
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
|
||||
|
||||
## Setting up auto-fromatter with clang-format in eclipse
|
||||
1. Help → Eclipse market place → Search for "Cppstyle" and install
|
||||
2. On windows download the clang-formatting tools from https://llvm.org/builds/. On linux clang-format can be installed with the package manager.
|
||||
3. Navigate to Preferences → C/C++ → CppStyle
|
||||
4. Insert the path to the clang-format executable
|
||||
5. Under C/C++ → Code Style → Formatter, change the formatter to CppStyle (clang-format)
|
||||
6. Code can now be formatted with the clang tool by using the key combination Ctrl + Shift + f
|
||||
|
@ -4,17 +4,24 @@ RUN apt-get update
|
||||
RUN apt-get --yes upgrade
|
||||
#tzdata is a dependency, won't install otherwise
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
RUN apt-get --yes install cmake libgpiod-dev xz-utils nano curl git gcc g++ lcov valgrind libgps-dev
|
||||
RUN apt-get --yes install cmake libgpiod-dev xz-utils nano curl git gcc g++ lcov valgrind libgps-dev python3
|
||||
|
||||
# Q7S root filesystem, required for cross-compilation.
|
||||
RUN mkdir -p /usr/rootfs; \
|
||||
curl https://buggy.irs.uni-stuttgart.de/eive/tools/eive-compile-rootfs-v0.1.0-7-gae69838.tar.xz \
|
||||
| tar -xJ -C /usr/rootfs
|
||||
ARG XIPHOS_SDK_NAME=sdk-xiphos-eive-v0.2.0
|
||||
# Install Xiphos ARK SDK, which also installs Q7S root filesystem, required for cross-compilation.
|
||||
RUN curl https://buggy.irs.uni-stuttgart.de/eive/tools/${XIPHOS_SDK_NAME}.tar | tar -x && \
|
||||
cd ${XIPHOS_SDK_NAME} && \
|
||||
./ark-glibc-x86_64-eive-image-cortexa9hf-neon-toolchain-nodistro.0.sh -y
|
||||
|
||||
# Cross compiler
|
||||
RUN mkdir -p /usr/tools; \
|
||||
curl https://buggy.irs.uni-stuttgart.de/eive/tools/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf.tar.gz \
|
||||
| tar -xz -C /usr/tools
|
||||
|
||||
ENV ZYNQ_7020_SYSROOT="/usr/rootfs/eive-compile-rootfs"
|
||||
RUN git clone https://github.com/catchorg/Catch2.git && \
|
||||
cd Catch2 && \
|
||||
git checkout v3.0.0-preview5 && \
|
||||
cmake -Bbuild -H. -DBUILD_TESTING=OFF && \
|
||||
cmake --build build/ --target install
|
||||
|
||||
ENV ZYNQ_7020_SYSROOT="/opt/xiphos/sdk/ark/sysroots/cortexa9hf-neon-xiphos-linux-gnueabi"
|
||||
ENV PATH=$PATH:"/usr/tools/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin"
|
||||
|
6
automation/Jenkinsfile
vendored
6
automation/Jenkinsfile
vendored
@ -5,7 +5,7 @@ pipeline {
|
||||
}
|
||||
agent {
|
||||
docker {
|
||||
image 'eive-obsw-ci:d4'
|
||||
image 'eive-obsw-ci:d5'
|
||||
args '--sysctl fs.mqueue.msg_max=100'
|
||||
}
|
||||
}
|
||||
@ -24,11 +24,11 @@ pipeline {
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Unittests') {
|
||||
stage('Build Host and Tests') {
|
||||
steps {
|
||||
dir(BUILDDIR_LINUX) {
|
||||
sh 'cmake ..'
|
||||
sh 'cmake --build . -t eive-unittest -j4'
|
||||
sh 'cmake --build . -j4'
|
||||
sh './eive-unittest'
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,3 @@
|
||||
target_sources(${OBSW_NAME} PUBLIC
|
||||
InitMission.cpp
|
||||
main.cpp
|
||||
ObjectFactory.cpp
|
||||
)
|
||||
target_sources(${OBSW_NAME} PUBLIC InitMission.cpp main.cpp ObjectFactory.cpp)
|
||||
|
||||
add_subdirectory(boardconfig)
|
||||
|
@ -1,7 +1,3 @@
|
||||
target_sources(${OBSW_NAME} PRIVATE
|
||||
print.c
|
||||
)
|
||||
target_sources(${OBSW_NAME} PRIVATE print.c)
|
||||
|
||||
target_include_directories(${OBSW_NAME} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
target_include_directories(${OBSW_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
@ -1,9 +1,5 @@
|
||||
target_sources(${OBSW_NAME} PUBLIC
|
||||
InitMission.cpp
|
||||
main.cpp
|
||||
ObjectFactory.cpp
|
||||
GlobalConfigHandler.cpp
|
||||
)
|
||||
target_sources(${OBSW_NAME} PUBLIC InitMission.cpp main.cpp ObjectFactory.cpp)
|
||||
|
||||
|
||||
add_subdirectory(fsfwconfig)
|
||||
add_subdirectory(boardconfig)
|
||||
|
@ -131,6 +131,7 @@ void initmission::initTasks() {
|
||||
|
||||
PeriodicTaskIF* testTask = factory->createPeriodicTask(
|
||||
"TEST_TASK", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc);
|
||||
static_cast<void>(testTask);
|
||||
#if OBSW_ADD_TEST_CODE == 1
|
||||
result = testTask->addComponent(objects::TEST_TASK);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
|
122
bsp_hosted/OBSWConfig.h.in
Normal file
122
bsp_hosted/OBSWConfig.h.in
Normal file
@ -0,0 +1,122 @@
|
||||
/**
|
||||
* @brief This file can be used to add preprocessor define for conditional
|
||||
* code inclusion exclusion or various other project constants and
|
||||
* properties in one place.
|
||||
*/
|
||||
#ifndef FSFWCONFIG_OBSWCONFIG_H_
|
||||
#define FSFWCONFIG_OBSWCONFIG_H_
|
||||
|
||||
#include "commonConfig.h"
|
||||
#include "OBSWVersion.h"
|
||||
|
||||
/*******************************************************************/
|
||||
/** All of the following flags should be enabled for mission code */
|
||||
/*******************************************************************/
|
||||
|
||||
#define OBSW_ENABLE_TIMERS 1
|
||||
#define OBSW_ADD_STAR_TRACKER 0
|
||||
#define OBSW_ADD_PLOC_SUPERVISOR 0
|
||||
#define OBSW_ADD_PLOC_MPSOC 0
|
||||
#define OBSW_ADD_SUN_SENSORS 0
|
||||
#define OBSW_ADD_MGT 0
|
||||
#define OBSW_ADD_ACS_BOARD 0
|
||||
#define OBSW_ADD_ACS_HANDLERS 0
|
||||
#define OBSW_ADD_GPS_0 0
|
||||
#define OBSW_ADD_GPS_1 0
|
||||
#define OBSW_ADD_RW 0
|
||||
#define OBSW_ADD_BPX_BATTERY_HANDLER 0
|
||||
#define OBSW_ADD_RTD_DEVICES 0
|
||||
#define OBSW_ADD_PL_PCDU 0
|
||||
#define OBSW_ADD_TMP_DEVICES 0
|
||||
#define OBSW_ADD_RAD_SENSORS 0
|
||||
#define OBSW_ADD_SYRLINKS 0
|
||||
#define OBSW_STAR_TRACKER_GROUND_CONFIG 1
|
||||
|
||||
// This is a really tricky switch.. It initializes the PCDU switches to their default states
|
||||
// at powerup. I think it would be better
|
||||
// to leave it off for now. It makes testing a lot more difficult and it might mess with
|
||||
// something the operators might want to do by giving the software too much intelligence
|
||||
// at the wrong place. The system component might command all the Switches accordingly anyway
|
||||
#define OBSW_INITIALIZE_SWITCHES 0
|
||||
#define OBSW_ENABLE_PERIODIC_HK 0
|
||||
|
||||
/*******************************************************************/
|
||||
/** All of the following flags should be disabled for mission code */
|
||||
/*******************************************************************/
|
||||
|
||||
// Can be used to switch device to NORMAL mode immediately
|
||||
#define OBSW_SWITCH_TO_NORMAL_MODE_AFTER_STARTUP 1
|
||||
#define OBSW_PRINT_MISSED_DEADLINES 1
|
||||
|
||||
#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_UART_TEST_CODE 0
|
||||
|
||||
#define OBSW_TEST_ACS 0
|
||||
#define OBSW_DEBUG_ACS 0
|
||||
#define OBSW_TEST_SUS 0
|
||||
#define OBSW_DEBUG_SUS 0
|
||||
#define OBSW_TEST_RTD 0
|
||||
#define OBSW_DEBUG_RTD 0
|
||||
#define OBSW_TEST_RAD_SENSOR 0
|
||||
#define OBSW_DEBUG_RAD_SENSOR 0
|
||||
#define OBSW_TEST_PL_PCDU 0
|
||||
#define OBSW_DEBUG_PL_PCDU 0
|
||||
#define OBSW_TEST_BPX_BATT 0
|
||||
#define OBSW_DEBUG_BPX_BATT 0
|
||||
#define OBSW_TEST_IMTQ 0
|
||||
#define OBSW_DEBUG_IMTQ 0
|
||||
#define OBSW_TEST_RW 0
|
||||
#define OBSW_DEBUG_RW 0
|
||||
|
||||
#define OBSW_TEST_LIBGPIOD 0
|
||||
#define OBSW_TEST_PLOC_HANDLER 0
|
||||
#define OBSW_TEST_CCSDS_BRIDGE 0
|
||||
#define OBSW_TEST_CCSDS_PTME 0
|
||||
#define OBSW_TEST_TE7020_HEATER 0
|
||||
#define OBSW_TEST_GPIO_OPEN_BY_LABEL 0
|
||||
#define OBSW_TEST_GPIO_OPEN_BY_LINE_NAME 0
|
||||
#define OBSW_DEBUG_P60DOCK 0
|
||||
|
||||
#define OBSW_PRINT_CORE_HK 0
|
||||
#define OBSW_DEBUG_PDU1 0
|
||||
#define OBSW_DEBUG_PDU2 0
|
||||
#define OBSW_DEBUG_GPS 0
|
||||
#define OBSW_DEBUG_ACU 0
|
||||
#define OBSW_DEBUG_SYRLINKS 0
|
||||
|
||||
#define OBSW_DEBUG_PDEC_HANDLER 0
|
||||
#define OBSW_DEBUG_PLOC_SUPERVISOR 0
|
||||
#define OBSW_DEBUG_PLOC_MPSOC 0
|
||||
#define OBSW_DEBUG_STARTRACKER 0
|
||||
#define OBSW_TCP_SERVER_WIRETAPPING 0
|
||||
|
||||
/*******************************************************************/
|
||||
/** CMake Defines */
|
||||
/*******************************************************************/
|
||||
#cmakedefine EIVE_BUILD_GPSD_GPS_HANDLER
|
||||
|
||||
#cmakedefine LIBGPS_VERSION_MAJOR @LIBGPS_VERSION_MAJOR@
|
||||
#cmakedefine LIBGPS_VERSION_MINOR @LIBGPS_VERSION_MINOR@
|
||||
|
||||
#ifdef RASPBERRY_PI
|
||||
#include "rpiConfig.h"
|
||||
#elif defined(XIPHOS_Q7S)
|
||||
#include "q7sConfig.h"
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "objects/systemObjectList.h"
|
||||
#include "events/subsystemIdRanges.h"
|
||||
#include "returnvalues/classIds.h"
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* FSFWCONFIG_OBSWCONFIG_H_ */
|
@ -9,6 +9,7 @@
|
||||
#include <tmtc/pusIds.h>
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
#include "fsfw_tests/integration/task/TestTask.h"
|
||||
|
||||
#if OBSW_USE_TMTC_TCP_BRIDGE == 0
|
||||
#include "fsfw/osal/common/UdpTcPollingTask.h"
|
||||
@ -24,7 +25,7 @@
|
||||
#include <test/testtasks/TestTask.h>
|
||||
#endif
|
||||
|
||||
#include "GlobalConfigHandler.h"
|
||||
#include <mission/utility/GlobalConfigHandler.h>
|
||||
|
||||
void Factory::setStaticFrameworkObjectIds() {
|
||||
PusServiceBase::packetSource = objects::PUS_PACKET_DISTRIBUTOR;
|
||||
|
@ -1,10 +1,3 @@
|
||||
target_sources(${OBSW_NAME} PRIVATE
|
||||
print.c
|
||||
)
|
||||
|
||||
target_include_directories(${OBSW_NAME} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
|
||||
target_sources(${OBSW_NAME} PRIVATE print.c)
|
||||
|
||||
target_include_directories(${OBSW_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
@ -1,11 +0,0 @@
|
||||
# add main and others
|
||||
CXXSRC += $(wildcard $(CURRENTPATH)/*.cpp)
|
||||
CSRC += $(wildcard $(CURRENTPATH)/*.c)
|
||||
|
||||
CSRC += $(wildcard $(CURRENTPATH)/boardconfig/*.c)
|
||||
|
||||
CXXSRC += $(wildcard $(CURRENTPATH)/comIF/*.cpp)
|
||||
CSRC += $(wildcard $(CURRENTPATH)/comIF/*.c)
|
||||
|
||||
INCLUDES += $(CURRENTPATH)/boardconfig
|
||||
INCLUDES += $(CURRENTPATH)/fsfwconfig
|
@ -1,8 +1 @@
|
||||
target_sources(${TARGET_NAME} PUBLIC
|
||||
ArduinoComIF.cpp
|
||||
ArduinoCookie.cpp
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
target_sources(${TARGET_NAME} PUBLIC ArduinoComIF.cpp ArduinoCookie.cpp)
|
||||
|
@ -1,27 +1,15 @@
|
||||
target_sources(${OBSW_NAME} PRIVATE
|
||||
ipc/MissionMessageTypes.cpp
|
||||
)
|
||||
target_sources(${OBSW_NAME} PRIVATE ipc/MissionMessageTypes.cpp)
|
||||
|
||||
target_include_directories(${OBSW_NAME} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
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(${OBSW_NAME} PRIVATE
|
||||
objects/translateObjects.cpp
|
||||
)
|
||||
target_sources(${UNITTEST_NAME} PRIVATE
|
||||
objects/translateObjects.cpp
|
||||
)
|
||||
target_sources(${OBSW_NAME} PRIVATE objects/translateObjects.cpp)
|
||||
target_sources(${UNITTEST_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(${OBSW_NAME} PRIVATE
|
||||
events/translateEvents.cpp
|
||||
)
|
||||
target_sources(${UNITTEST_NAME} PRIVATE
|
||||
events/translateEvents.cpp
|
||||
)
|
||||
target_sources(${OBSW_NAME} PRIVATE events/translateEvents.cpp)
|
||||
target_sources(${UNITTEST_NAME} PRIVATE events/translateEvents.cpp)
|
||||
endif()
|
||||
|
@ -1,18 +0,0 @@
|
||||
#ifndef FSFWCONFIG_TMTC_APID_H_
|
||||
#define FSFWCONFIG_TMTC_APID_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
* Application Process Definition: entity, uniquely identified by an
|
||||
* application process ID (APID), capable of generating telemetry source
|
||||
* packets and receiving telecommand packets
|
||||
*
|
||||
* SOURCE APID: 0x73 / 115 / s
|
||||
* APID is a 11 bit number
|
||||
*/
|
||||
namespace apid {
|
||||
static const uint16_t EIVE_OBSW = 0x65;
|
||||
}
|
||||
|
||||
#endif /* FSFWCONFIG_TMTC_APID_H_ */
|
@ -1,23 +0,0 @@
|
||||
#ifndef CONFIG_TMTC_PUSIDS_HPP_
|
||||
#define CONFIG_TMTC_PUSIDS_HPP_
|
||||
|
||||
namespace pus {
|
||||
enum Ids {
|
||||
PUS_SERVICE_1 = 1,
|
||||
PUS_SERVICE_2 = 2,
|
||||
PUS_SERVICE_3 = 3,
|
||||
PUS_SERVICE_3_PSB = 3,
|
||||
PUS_SERVICE_5 = 5,
|
||||
PUS_SERVICE_6 = 6,
|
||||
PUS_SERVICE_8 = 8,
|
||||
PUS_SERVICE_9 = 9,
|
||||
PUS_SERVICE_17 = 17,
|
||||
PUS_SERVICE_19 = 19,
|
||||
PUS_SERVICE_20 = 20,
|
||||
PUS_SERVICE_23 = 23,
|
||||
PUS_SERVICE_200 = 200,
|
||||
PUS_SERVICE_201 = 201,
|
||||
};
|
||||
};
|
||||
|
||||
#endif /* CONFIG_TMTC_PUSIDS_HPP_ */
|
@ -20,7 +20,7 @@ int main(void) {
|
||||
std::cout << "-- EIVE OBSW --" << std::endl;
|
||||
std::cout << "-- Compiled for " << COMPILE_PRINTOUT << " --" << std::endl;
|
||||
std::cout << "-- OBSW "
|
||||
<< " v" << common::OBSW_VERSION << " | FSFW v" << fsfw::FSFW_VERSION << " --"
|
||||
<< "v" << common::OBSW_VERSION << " | FSFW v" << fsfw::FSFW_VERSION << " --"
|
||||
<< std::endl;
|
||||
std::cout << "-- " << __DATE__ << " " << __TIME__ << " --" << std::endl;
|
||||
std::cout << "-- " <<" BSP HOSTED"<< " --" << std::endl;
|
||||
|
@ -1,9 +1,5 @@
|
||||
target_sources(${OBSW_NAME} PUBLIC
|
||||
InitMission.cpp
|
||||
main.cpp
|
||||
gpioInit.cpp
|
||||
ObjectFactory.cpp
|
||||
)
|
||||
target_sources(${OBSW_NAME} PUBLIC InitMission.cpp main.cpp gpioInit.cpp
|
||||
ObjectFactory.cpp)
|
||||
|
||||
add_subdirectory(boardconfig)
|
||||
add_subdirectory(boardtest)
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "fsfw/tasks/Typedef.h"
|
||||
#include "fsfw/tasks/definitions.h"
|
||||
|
||||
class PeriodicTaskIF;
|
||||
class TaskFactory;
|
||||
|
122
bsp_linux_board/OBSWConfig.h.in
Normal file
122
bsp_linux_board/OBSWConfig.h.in
Normal file
@ -0,0 +1,122 @@
|
||||
/**
|
||||
* @brief This file can be used to add preprocessor define for conditional
|
||||
* code inclusion exclusion or various other project constants and
|
||||
* properties in one place.
|
||||
*/
|
||||
#ifndef FSFWCONFIG_OBSWCONFIG_H_
|
||||
#define FSFWCONFIG_OBSWCONFIG_H_
|
||||
|
||||
#include "commonConfig.h"
|
||||
#include "OBSWVersion.h"
|
||||
|
||||
/*******************************************************************/
|
||||
/** All of the following flags should be enabled for mission code */
|
||||
/*******************************************************************/
|
||||
|
||||
#define OBSW_ENABLE_TIMERS 1
|
||||
#define OBSW_ADD_STAR_TRACKER 0
|
||||
#define OBSW_ADD_PLOC_SUPERVISOR 0
|
||||
#define OBSW_ADD_PLOC_MPSOC 0
|
||||
#define OBSW_ADD_SUN_SENSORS 0
|
||||
#define OBSW_ADD_MGT 0
|
||||
#define OBSW_ADD_ACS_BOARD 0
|
||||
#define OBSW_ADD_ACS_HANDLERS 0
|
||||
#define OBSW_ADD_GPS_0 0
|
||||
#define OBSW_ADD_GPS_1 0
|
||||
#define OBSW_ADD_RW 0
|
||||
#define OBSW_ADD_BPX_BATTERY_HANDLER 0
|
||||
#define OBSW_ADD_RTD_DEVICES 0
|
||||
#define OBSW_ADD_PL_PCDU 0
|
||||
#define OBSW_ADD_TMP_DEVICES 0
|
||||
#define OBSW_ADD_RAD_SENSORS 0
|
||||
#define OBSW_ADD_SYRLINKS 0
|
||||
#define OBSW_STAR_TRACKER_GROUND_CONFIG 1
|
||||
|
||||
// This is a really tricky switch.. It initializes the PCDU switches to their default states
|
||||
// at powerup. I think it would be better
|
||||
// to leave it off for now. It makes testing a lot more difficult and it might mess with
|
||||
// something the operators might want to do by giving the software too much intelligence
|
||||
// at the wrong place. The system component might command all the Switches accordingly anyway
|
||||
#define OBSW_INITIALIZE_SWITCHES 0
|
||||
#define OBSW_ENABLE_PERIODIC_HK 0
|
||||
|
||||
/*******************************************************************/
|
||||
/** All of the following flags should be disabled for mission code */
|
||||
/*******************************************************************/
|
||||
|
||||
// Can be used to switch device to NORMAL mode immediately
|
||||
#define OBSW_SWITCH_TO_NORMAL_MODE_AFTER_STARTUP 1
|
||||
#define OBSW_PRINT_MISSED_DEADLINES 1
|
||||
|
||||
#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_UART_TEST_CODE 0
|
||||
|
||||
#define OBSW_TEST_ACS 0
|
||||
#define OBSW_DEBUG_ACS 0
|
||||
#define OBSW_TEST_SUS 0
|
||||
#define OBSW_DEBUG_SUS 0
|
||||
#define OBSW_TEST_RTD 0
|
||||
#define OBSW_DEBUG_RTD 0
|
||||
#define OBSW_TEST_RAD_SENSOR 0
|
||||
#define OBSW_DEBUG_RAD_SENSOR 0
|
||||
#define OBSW_TEST_PL_PCDU 0
|
||||
#define OBSW_DEBUG_PL_PCDU 0
|
||||
#define OBSW_TEST_BPX_BATT 0
|
||||
#define OBSW_DEBUG_BPX_BATT 0
|
||||
#define OBSW_TEST_IMTQ 0
|
||||
#define OBSW_DEBUG_IMTQ 0
|
||||
#define OBSW_TEST_RW 0
|
||||
#define OBSW_DEBUG_RW 0
|
||||
|
||||
#define OBSW_TEST_LIBGPIOD 0
|
||||
#define OBSW_TEST_PLOC_HANDLER 0
|
||||
#define OBSW_TEST_CCSDS_BRIDGE 0
|
||||
#define OBSW_TEST_CCSDS_PTME 0
|
||||
#define OBSW_TEST_TE7020_HEATER 0
|
||||
#define OBSW_TEST_GPIO_OPEN_BY_LABEL 0
|
||||
#define OBSW_TEST_GPIO_OPEN_BY_LINE_NAME 0
|
||||
#define OBSW_DEBUG_P60DOCK 0
|
||||
|
||||
#define OBSW_PRINT_CORE_HK 0
|
||||
#define OBSW_DEBUG_PDU1 0
|
||||
#define OBSW_DEBUG_PDU2 0
|
||||
#define OBSW_DEBUG_GPS 0
|
||||
#define OBSW_DEBUG_ACU 0
|
||||
#define OBSW_DEBUG_SYRLINKS 0
|
||||
|
||||
#define OBSW_DEBUG_PDEC_HANDLER 0
|
||||
#define OBSW_DEBUG_PLOC_SUPERVISOR 0
|
||||
#define OBSW_DEBUG_PLOC_MPSOC 0
|
||||
#define OBSW_DEBUG_STARTRACKER 0
|
||||
#define OBSW_TCP_SERVER_WIRETAPPING 0
|
||||
|
||||
/*******************************************************************/
|
||||
/** CMake Defines */
|
||||
/*******************************************************************/
|
||||
#cmakedefine EIVE_BUILD_GPSD_GPS_HANDLER
|
||||
|
||||
#cmakedefine LIBGPS_VERSION_MAJOR @LIBGPS_VERSION_MAJOR@
|
||||
#cmakedefine LIBGPS_VERSION_MINOR @LIBGPS_VERSION_MINOR@
|
||||
|
||||
#ifdef RASPBERRY_PI
|
||||
#include "rpiConfig.h"
|
||||
#elif defined(XIPHOS_Q7S)
|
||||
#include "q7sConfig.h"
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "objects/systemObjectList.h"
|
||||
#include "events/subsystemIdRanges.h"
|
||||
#include "returnvalues/classIds.h"
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* FSFWCONFIG_OBSWCONFIG_H_ */
|
@ -67,7 +67,7 @@ void ObjectFactory::produce(void* args) {
|
||||
GpioCookie* gpioCookie = nullptr;
|
||||
static_cast<void>(gpioCookie);
|
||||
|
||||
SpiComIF* spiComIF = new SpiComIF(objects::SPI_COM_IF, gpioIF);
|
||||
SpiComIF* spiComIF = new SpiComIF(objects::SPI_MAIN_COM_IF, spi::DEV, gpioIF);
|
||||
static_cast<void>(spiComIF);
|
||||
auto pwrSwitcher = new DummyPowerSwitcher(objects::PCDU_HANDLER, 18, 0);
|
||||
static_cast<void>(pwrSwitcher);
|
||||
@ -116,75 +116,74 @@ void ObjectFactory::createRpiAcsBoard(GpioIF* gpioIF, std::string spiDev) {
|
||||
gpio::Direction::OUT, gpio::Levels::HIGH);
|
||||
gpioIF->addGpios(gpioCookie);
|
||||
SpiCookie* spiCookie =
|
||||
new SpiCookie(addresses::MGM_0_LIS3, gpioIds::MGM_0_LIS3_CS, spiDev,
|
||||
MGMLIS3MDL::MAX_BUFFER_SIZE, spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED);
|
||||
new SpiCookie(addresses::MGM_0_LIS3, gpioIds::MGM_0_LIS3_CS, MGMLIS3MDL::MAX_BUFFER_SIZE,
|
||||
spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED);
|
||||
auto mgmLis3Handler =
|
||||
new MgmLIS3MDLHandler(objects::MGM_0_LIS3_HANDLER, objects::SPI_COM_IF, spiCookie, 0);
|
||||
new MgmLIS3MDLHandler(objects::MGM_0_LIS3_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, 0);
|
||||
mgmLis3Handler->setStartUpImmediately();
|
||||
#if FSFW_HAL_LIS3MDL_MGM_DEBUG == 1
|
||||
#if OBSW_TEST_ACS == 1
|
||||
mgmLis3Handler->setToGoToNormalMode(true);
|
||||
#endif
|
||||
|
||||
spiCookie =
|
||||
new SpiCookie(addresses::MGM_1_RM3100, gpioIds::MGM_1_RM3100_CS, spiDev,
|
||||
RM3100::MAX_BUFFER_SIZE, spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED);
|
||||
new SpiCookie(addresses::MGM_1_RM3100, gpioIds::MGM_1_RM3100_CS, RM3100::MAX_BUFFER_SIZE,
|
||||
spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED);
|
||||
auto mgmRm3100Handler =
|
||||
new MgmRM3100Handler(objects::MGM_1_RM3100_HANDLER, objects::SPI_COM_IF, spiCookie, 0);
|
||||
new MgmRM3100Handler(objects::MGM_1_RM3100_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, 0);
|
||||
mgmRm3100Handler->setStartUpImmediately();
|
||||
#if FSFW_HAL_RM3100_MGM_DEBUG == 1
|
||||
#if OBSW_TEST_ACS == 1
|
||||
mgmRm3100Handler->setToGoToNormalMode(true);
|
||||
#endif
|
||||
|
||||
spiCookie =
|
||||
new SpiCookie(addresses::MGM_2_LIS3, gpioIds::MGM_2_LIS3_CS, spiDev,
|
||||
MGMLIS3MDL::MAX_BUFFER_SIZE, spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED);
|
||||
new SpiCookie(addresses::MGM_2_LIS3, gpioIds::MGM_2_LIS3_CS, MGMLIS3MDL::MAX_BUFFER_SIZE,
|
||||
spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED);
|
||||
mgmLis3Handler =
|
||||
new MgmLIS3MDLHandler(objects::MGM_2_LIS3_HANDLER, objects::SPI_COM_IF, spiCookie, 0);
|
||||
new MgmLIS3MDLHandler(objects::MGM_2_LIS3_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, 0);
|
||||
mgmLis3Handler->setStartUpImmediately();
|
||||
#if FSFW_HAL_LIS3MDL_MGM_DEBUG == 1
|
||||
#if OBSW_TEST_ACS == 1
|
||||
mgmLis3Handler->setToGoToNormalMode(true);
|
||||
#endif
|
||||
|
||||
spiCookie =
|
||||
new SpiCookie(addresses::MGM_3_RM3100, gpioIds::MGM_3_RM3100_CS, spiDev,
|
||||
RM3100::MAX_BUFFER_SIZE, spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED);
|
||||
new SpiCookie(addresses::MGM_3_RM3100, gpioIds::MGM_3_RM3100_CS, RM3100::MAX_BUFFER_SIZE,
|
||||
spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED);
|
||||
mgmRm3100Handler =
|
||||
new MgmRM3100Handler(objects::MGM_3_RM3100_HANDLER, objects::SPI_COM_IF, spiCookie, 0);
|
||||
new MgmRM3100Handler(objects::MGM_3_RM3100_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, 0);
|
||||
mgmRm3100Handler->setStartUpImmediately();
|
||||
#if FSFW_HAL_RM3100_MGM_DEBUG == 1
|
||||
#if OBSW_TEST_ACS == 1
|
||||
mgmRm3100Handler->setToGoToNormalMode(true);
|
||||
#endif
|
||||
|
||||
spiCookie =
|
||||
new SpiCookie(addresses::GYRO_0_ADIS, gpioIds::GYRO_0_ADIS_CS, spiDev,
|
||||
ADIS1650X::MAXIMUM_REPLY_SIZE, spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED);
|
||||
auto adisHandler = new GyroADIS1650XHandler(objects::GYRO_0_ADIS_HANDLER, objects::SPI_COM_IF,
|
||||
spiCookie, ADIS1650X::Type::ADIS16505);
|
||||
new SpiCookie(addresses::GYRO_0_ADIS, gpioIds::GYRO_0_ADIS_CS, ADIS1650X::MAXIMUM_REPLY_SIZE,
|
||||
spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED);
|
||||
auto adisHandler =
|
||||
new GyroADIS1650XHandler(objects::GYRO_0_ADIS_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie,
|
||||
ADIS1650X::Type::ADIS16505);
|
||||
adisHandler->setStartUpImmediately();
|
||||
spiCookie =
|
||||
new SpiCookie(addresses::GYRO_1_L3G, gpioIds::GYRO_1_L3G_CS, spiDev, L3GD20H::MAX_BUFFER_SIZE,
|
||||
spiCookie = new SpiCookie(addresses::GYRO_1_L3G, gpioIds::GYRO_1_L3G_CS, L3GD20H::MAX_BUFFER_SIZE,
|
||||
spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED);
|
||||
auto gyroL3gHandler =
|
||||
new GyroHandlerL3GD20H(objects::GYRO_1_L3G_HANDLER, objects::SPI_COM_IF, spiCookie, 0);
|
||||
new GyroHandlerL3GD20H(objects::GYRO_1_L3G_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, 0);
|
||||
gyroL3gHandler->setStartUpImmediately();
|
||||
#if FSFW_HAL_L3GD20_GYRO_DEBUG == 1
|
||||
#if OBSW_TEST_ACS == 1
|
||||
gyroL3gHandler->setToGoToNormalMode(true);
|
||||
#endif
|
||||
|
||||
spiCookie =
|
||||
new SpiCookie(addresses::GYRO_2_ADIS, gpioIds::GYRO_2_ADIS_CS, spiDev,
|
||||
ADIS1650X::MAXIMUM_REPLY_SIZE, spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED);
|
||||
adisHandler = new GyroADIS1650XHandler(objects::GYRO_2_ADIS_HANDLER, objects::SPI_COM_IF,
|
||||
new SpiCookie(addresses::GYRO_2_ADIS, gpioIds::GYRO_2_ADIS_CS, ADIS1650X::MAXIMUM_REPLY_SIZE,
|
||||
spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED);
|
||||
adisHandler = new GyroADIS1650XHandler(objects::GYRO_2_ADIS_HANDLER, objects::SPI_MAIN_COM_IF,
|
||||
spiCookie, ADIS1650X::Type::ADIS16505);
|
||||
adisHandler->setStartUpImmediately();
|
||||
|
||||
spiCookie =
|
||||
new SpiCookie(addresses::GYRO_3_L3G, gpioIds::GYRO_3_L3G_CS, spiDev, L3GD20H::MAX_BUFFER_SIZE,
|
||||
spiCookie = new SpiCookie(addresses::GYRO_3_L3G, gpioIds::GYRO_3_L3G_CS, L3GD20H::MAX_BUFFER_SIZE,
|
||||
spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED);
|
||||
gyroL3gHandler =
|
||||
new GyroHandlerL3GD20H(objects::GYRO_3_L3G_HANDLER, objects::SPI_COM_IF, spiCookie, 0);
|
||||
new GyroHandlerL3GD20H(objects::GYRO_3_L3G_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, 0);
|
||||
gyroL3gHandler->setStartUpImmediately();
|
||||
#if FSFW_HAL_L3GD20_GYRO_DEBUG == 1
|
||||
#if OBSW_TEST_ACS == 1
|
||||
gyroL3gHandler->setToGoToNormalMode(true);
|
||||
#endif
|
||||
}
|
||||
|
@ -1,7 +1,3 @@
|
||||
target_sources(${OBSW_NAME} PRIVATE
|
||||
print.c
|
||||
)
|
||||
target_sources(${OBSW_NAME} PRIVATE print.c)
|
||||
|
||||
target_include_directories(${OBSW_NAME} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
target_include_directories(${OBSW_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
@ -1,6 +1 @@
|
||||
target_sources(${OBSW_NAME} PRIVATE
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
target_sources(${OBSW_NAME} PRIVATE)
|
||||
|
@ -1,25 +1,26 @@
|
||||
#simple mode
|
||||
# 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_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
|
||||
)
|
||||
target_sources(${OBSW_NAME} PUBLIC main.cpp obsw.cpp)
|
||||
|
||||
add_subdirectory(boardtest)
|
||||
|
||||
add_subdirectory(boardconfig)
|
||||
add_subdirectory(comIF)
|
||||
add_subdirectory(core)
|
||||
|
||||
if(EIVE_Q7S_EM)
|
||||
add_subdirectory(em)
|
||||
else()
|
||||
target_sources(${OBSW_NAME} PUBLIC fmObjectFactory.cpp)
|
||||
endif()
|
||||
|
||||
add_subdirectory(memory)
|
||||
add_subdirectory(callbacks)
|
||||
add_subdirectory(xadc)
|
||||
|
127
bsp_q7s/OBSWConfig.h.in
Normal file
127
bsp_q7s/OBSWConfig.h.in
Normal file
@ -0,0 +1,127 @@
|
||||
/**
|
||||
* @brief This file can be used to add preprocessor define for conditional
|
||||
* code inclusion exclusion or various other project constants and
|
||||
* properties in one place.
|
||||
*/
|
||||
#ifndef FSFWCONFIG_OBSWCONFIG_H_
|
||||
#define FSFWCONFIG_OBSWCONFIG_H_
|
||||
|
||||
#include "commonConfig.h"
|
||||
#include "q7sConfig.h"
|
||||
#include "OBSWVersion.h"
|
||||
|
||||
/*******************************************************************/
|
||||
/** All of the following flags should be enabled for mission code */
|
||||
/*******************************************************************/
|
||||
|
||||
#define OBSW_USE_CCSDS_IP_CORE 1
|
||||
// Set to 1 if all telemetry should be sent to the PTME IP Core
|
||||
#define OBSW_TM_TO_PTME 0
|
||||
// Set to 1 if telecommands are received via the PDEC IP Core
|
||||
#define OBSW_TC_FROM_PDEC 0
|
||||
|
||||
#define OBSW_ENABLE_TIMERS 1
|
||||
#define OBSW_ADD_GOMSPACE_PCDU @OBSW_ADD_GOMSPACE_PCDU@
|
||||
#define OBSW_ADD_MGT @OBSW_ADD_MGT@
|
||||
#define OBSW_ADD_BPX_BATTERY_HANDLER @OBSW_ADD_BPX_BATTERY_HANDLER@
|
||||
#define OBSW_ADD_STAR_TRACKER @OBSW_ADD_STAR_TRACKER@
|
||||
#define OBSW_ADD_PLOC_SUPERVISOR 1
|
||||
#define OBSW_ADD_PLOC_MPSOC 1
|
||||
#define OBSW_ADD_SUN_SENSORS @OBSW_ADD_SUN_SENSORS@
|
||||
#define OBSW_ADD_SUS_BOARD_ASS @OBSW_ADD_SUS_BOARD_ASS@
|
||||
#define OBSW_ADD_ACS_BOARD @OBSW_ADD_ACS_BOARD@
|
||||
#define OBSW_ADD_ACS_HANDLERS @OBSW_ADD_ACS_HANDLERS@
|
||||
#define OBSW_ADD_RW @OBSW_ADD_RW@
|
||||
#define OBSW_ADD_RTD_DEVICES @OBSW_ADD_RTD_DEVICES@
|
||||
#define OBSW_ADD_TMP_DEVICES @OBSW_ADD_TMP_DEVICES@
|
||||
#define OBSW_ADD_RAD_SENSORS @OBSW_ADD_RAD_SENSORS@
|
||||
#define OBSW_ADD_PL_PCDU @OBSW_ADD_PL_PCDU@
|
||||
#define OBSW_ADD_SYRLINKS @OBSW_ADD_SYRLINKS@
|
||||
#define OBSW_ENABLE_SYRLINKS_TRANSMIT_TIMEOUT 0
|
||||
#define OBSW_MPSOC_JTAG_BOOT 0
|
||||
|
||||
// This is a really tricky switch.. It initializes the PCDU switches to their default states
|
||||
// at powerup. I think it would be better
|
||||
// to leave it off for now. It makes testing a lot more difficult and it might mess with
|
||||
// something the operators might want to do by giving the software too much intelligence
|
||||
// at the wrong place. The system component might command all the Switches accordingly anyway
|
||||
#define OBSW_INITIALIZE_SWITCHES 0
|
||||
#define OBSW_ENABLE_PERIODIC_HK 0
|
||||
|
||||
/*******************************************************************/
|
||||
/** All of the following flags should be disabled for mission code */
|
||||
/*******************************************************************/
|
||||
|
||||
// Can be used to switch device to NORMAL mode immediately
|
||||
#define OBSW_SWITCH_TO_NORMAL_MODE_AFTER_STARTUP 1
|
||||
#define OBSW_PRINT_MISSED_DEADLINES 1
|
||||
|
||||
#define OBSW_STAR_TRACKER_GROUND_CONFIG 1
|
||||
#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_UART_TEST_CODE 0
|
||||
|
||||
#define OBSW_TEST_ACS 0
|
||||
#define OBSW_DEBUG_ACS 0
|
||||
#define OBSW_TEST_SUS 0
|
||||
#define OBSW_DEBUG_SUS 0
|
||||
#define OBSW_TEST_RTD 0
|
||||
#define OBSW_DEBUG_RTD 0
|
||||
#define OBSW_TEST_RAD_SENSOR 0
|
||||
#define OBSW_DEBUG_RAD_SENSOR 0
|
||||
#define OBSW_TEST_PL_PCDU 0
|
||||
#define OBSW_DEBUG_PL_PCDU 0
|
||||
#define OBSW_TEST_BPX_BATT 0
|
||||
#define OBSW_DEBUG_BPX_BATT 0
|
||||
#define OBSW_TEST_IMTQ 0
|
||||
#define OBSW_DEBUG_IMTQ 0
|
||||
#define OBSW_TEST_RW 0
|
||||
#define OBSW_DEBUG_RW 0
|
||||
|
||||
#define OBSW_TEST_LIBGPIOD 0
|
||||
#define OBSW_TEST_PLOC_HANDLER 0
|
||||
#define OBSW_TEST_CCSDS_BRIDGE 0
|
||||
#define OBSW_TEST_CCSDS_PTME 0
|
||||
#define OBSW_TEST_TE7020_HEATER 0
|
||||
#define OBSW_TEST_GPIO_OPEN_BY_LABEL 0
|
||||
#define OBSW_TEST_GPIO_OPEN_BY_LINE_NAME 0
|
||||
#define OBSW_DEBUG_P60DOCK 0
|
||||
|
||||
#define OBSW_PRINT_CORE_HK 0
|
||||
#define OBSW_DEBUG_PDU1 0
|
||||
#define OBSW_DEBUG_PDU2 0
|
||||
#define OBSW_DEBUG_GPS 0
|
||||
#define OBSW_DEBUG_ACU 0
|
||||
#define OBSW_DEBUG_SYRLINKS 0
|
||||
|
||||
#define OBSW_DEBUG_PDEC_HANDLER 0
|
||||
#define OBSW_DEBUG_PLOC_SUPERVISOR 0
|
||||
#define OBSW_DEBUG_PLOC_MPSOC 0
|
||||
#define OBSW_DEBUG_STARTRACKER 0
|
||||
|
||||
#define OBSW_TCP_SERVER_WIRETAPPING 0
|
||||
|
||||
/*******************************************************************/
|
||||
/** CMake Defines */
|
||||
/*******************************************************************/
|
||||
#cmakedefine EIVE_BUILD_GPSD_GPS_HANDLER
|
||||
|
||||
#cmakedefine LIBGPS_VERSION_MAJOR @LIBGPS_VERSION_MAJOR@
|
||||
#cmakedefine LIBGPS_VERSION_MINOR @LIBGPS_VERSION_MINOR@
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "objects/systemObjectList.h"
|
||||
#include "events/subsystemIdRanges.h"
|
||||
#include "returnvalues/classIds.h"
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* FSFWCONFIG_OBSWCONFIG_H_ */
|
@ -1,12 +1,5 @@
|
||||
target_sources(${OBSW_NAME} PRIVATE
|
||||
print.c
|
||||
)
|
||||
target_sources(${OBSW_NAME} PRIVATE print.c)
|
||||
|
||||
target_sources(${SIMPLE_OBSW_NAME} PRIVATE
|
||||
print.c
|
||||
)
|
||||
target_sources(${SIMPLE_OBSW_NAME} PRIVATE print.c)
|
||||
|
||||
|
||||
target_include_directories(${OBSW_NAME} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
target_include_directories(${OBSW_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
@ -4,6 +4,8 @@
|
||||
namespace q7s {
|
||||
|
||||
static constexpr char SPI_DEFAULT_DEV[] = "/dev/spi-main";
|
||||
static constexpr uint32_t SPI_MAIN_BUS_LOCK_TIMEOUT = 50;
|
||||
|
||||
static constexpr char SPI_RW_DEV[] = "/dev/spi-rw";
|
||||
|
||||
static constexpr char I2C_DEFAULT_DEV[] = "/dev/i2c-eive";
|
||||
|
@ -34,5 +34,6 @@ SOFTWARE.
|
||||
|
||||
#define ETL_CPP11_SUPPORTED 1
|
||||
#define ETL_NO_NULLPTR_SUPPORT 0
|
||||
#define ETL_HAS_ERROR_ON_STRING_TRUNCATION 1
|
||||
|
||||
#endif
|
||||
|
@ -3,6 +3,8 @@
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#define OBSW_Q7S_EM @OBSW_Q7S_EM@
|
||||
|
||||
/*******************************************************************/
|
||||
/** All of the following flags should be enabled for mission code */
|
||||
/*******************************************************************/
|
||||
|
@ -1,10 +1,5 @@
|
||||
target_sources(${OBSW_NAME} PRIVATE
|
||||
FileSystemTest.cpp
|
||||
Q7STestTask.cpp
|
||||
)
|
||||
target_sources(${OBSW_NAME} PRIVATE FileSystemTest.cpp Q7STestTask.cpp)
|
||||
|
||||
if(EIVE_BUILD_Q7S_SIMPLE_MODE)
|
||||
target_sources(${SIMPLE_OBSW_NAME} PRIVATE
|
||||
FileSystemTest.cpp
|
||||
)
|
||||
target_sources(${SIMPLE_OBSW_NAME} PRIVATE FileSystemTest.cpp)
|
||||
endif()
|
@ -23,8 +23,9 @@
|
||||
Q7STestTask::Q7STestTask(object_id_t objectId) : TestTask(objectId) {
|
||||
doTestSdCard = false;
|
||||
doTestScratchApi = false;
|
||||
doTestGps = false;
|
||||
doTestXadc = true;
|
||||
doTestGpsShm = false;
|
||||
doTestGpsSocket = false;
|
||||
doTestXadc = false;
|
||||
}
|
||||
|
||||
ReturnValue_t Q7STestTask::performOneShotAction() {
|
||||
@ -36,15 +37,20 @@ ReturnValue_t Q7STestTask::performOneShotAction() {
|
||||
}
|
||||
// testJsonLibDirect();
|
||||
// testDummyParams();
|
||||
// testProtHandler();
|
||||
if (doTestProtHandler) {
|
||||
testProtHandler();
|
||||
}
|
||||
FsOpCodes opCode = FsOpCodes::APPEND_TO_FILE;
|
||||
testFileSystemHandlerDirect(opCode);
|
||||
return TestTask::performOneShotAction();
|
||||
}
|
||||
|
||||
ReturnValue_t Q7STestTask::performPeriodicAction() {
|
||||
if (doTestGps) {
|
||||
testGpsDaemon();
|
||||
if (doTestGpsShm) {
|
||||
testGpsDaemonShm();
|
||||
}
|
||||
if (doTestGpsSocket) {
|
||||
testGpsDaemonSocket();
|
||||
}
|
||||
if (doTestXadc) {
|
||||
xadcTest();
|
||||
@ -238,8 +244,8 @@ void Q7STestTask::testProtHandler() {
|
||||
}
|
||||
}
|
||||
|
||||
void Q7STestTask::testGpsDaemon() {
|
||||
gpsmm gpsmm(GPSD_SHARED_MEMORY, 0);
|
||||
void Q7STestTask::testGpsDaemonShm() {
|
||||
gpsmm gpsmm(GPSD_SHARED_MEMORY, "");
|
||||
gps_data_t* gps;
|
||||
gps = gpsmm.read();
|
||||
if (gps == nullptr) {
|
||||
@ -266,6 +272,68 @@ void Q7STestTask::testGpsDaemon() {
|
||||
sif::info << "Speed(m/s): " << gps->fix.speed << std::endl;
|
||||
}
|
||||
|
||||
void Q7STestTask::testGpsDaemonSocket() {
|
||||
if (gpsmmShmPtr == nullptr) {
|
||||
gpsmmShmPtr = new gpsmm("localhost", DEFAULT_GPSD_PORT);
|
||||
}
|
||||
// The data from the device will generally be read all at once. Therefore, we
|
||||
// can set all field here
|
||||
if (not gpsmmShmPtr->is_open()) {
|
||||
if (gpsNotOpenSwitch) {
|
||||
// Opening failed
|
||||
#if FSFW_VERBOSE_LEVEL >= 1
|
||||
sif::warning << "Q7STestTask::testGpsDaemonSocket: Opening GPSMM failed | "
|
||||
<< "Error " << errno << " | " << gps_errstr(errno) << std::endl;
|
||||
#endif
|
||||
|
||||
gpsNotOpenSwitch = false;
|
||||
}
|
||||
return;
|
||||
}
|
||||
// Stopwatch watch;
|
||||
gps_data_t* gps = nullptr;
|
||||
gpsmmShmPtr->stream(WATCH_ENABLE | WATCH_JSON);
|
||||
if (not gpsmmShmPtr->waiting(50000000)) {
|
||||
return;
|
||||
}
|
||||
gps = gpsmmShmPtr->read();
|
||||
if (gps == nullptr) {
|
||||
if (gpsReadFailedSwitch) {
|
||||
gpsReadFailedSwitch = false;
|
||||
sif::warning << "Q7STestTask::testGpsDaemonSocket: Reading GPS data failed" << std::endl;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (MODE_SET != (MODE_SET & gps->set)) {
|
||||
if (noModeSetCntr >= 0) {
|
||||
noModeSetCntr++;
|
||||
}
|
||||
if (noModeSetCntr == 10) {
|
||||
// TODO: Trigger event here
|
||||
sif::warning << "Q7STestTask::testGpsDaemonSocket: No mode could be "
|
||||
"read for 10 consecutive reads"
|
||||
<< std::endl;
|
||||
noModeSetCntr = -1;
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
noModeSetCntr = 0;
|
||||
}
|
||||
sif::info << "-- Q7STestTask: GPS socket read test --" << std::endl;
|
||||
#if LIBGPS_VERSION_MINOR <= 17
|
||||
time_t timeRaw = gps->fix.time;
|
||||
#else
|
||||
time_t timeRaw = gps->fix.time.tv_sec;
|
||||
#endif
|
||||
std::tm* time = gmtime(&timeRaw);
|
||||
sif::info << "Time: " << std::put_time(time, "%c %Z") << std::endl;
|
||||
sif::info << "Visible satellites: " << gps->satellites_visible << std::endl;
|
||||
sif::info << "Satellites used: " << gps->satellites_used << std::endl;
|
||||
sif::info << "Fix (0:Not Seen|1:No Fix|2:2D|3:3D): " << gps->fix.mode << std::endl;
|
||||
sif::info << "Latitude: " << gps->fix.latitude << std::endl;
|
||||
sif::info << "Longitude: " << gps->fix.longitude << std::endl;
|
||||
}
|
||||
|
||||
void Q7STestTask::testFileSystemHandlerDirect(FsOpCodes opCode) {
|
||||
auto fsHandler = ObjectManager::instance()->get<FileSystemHandler>(objects::FILE_SYSTEM_HANDLER);
|
||||
if (fsHandler == nullptr) {
|
||||
|
@ -1,6 +1,8 @@
|
||||
#ifndef BSP_Q7S_BOARDTEST_Q7STESTTASK_H_
|
||||
#define BSP_Q7S_BOARDTEST_Q7STESTTASK_H_
|
||||
|
||||
#include <libgpsmm.h>
|
||||
|
||||
#include "test/testtasks/TestTask.h"
|
||||
|
||||
class CoreController;
|
||||
@ -14,14 +16,22 @@ class Q7STestTask : public TestTask {
|
||||
private:
|
||||
bool doTestSdCard = false;
|
||||
bool doTestScratchApi = false;
|
||||
bool doTestGps = false;
|
||||
bool doTestGpsShm = false;
|
||||
bool doTestGpsSocket = false;
|
||||
bool doTestProtHandler = false;
|
||||
bool doTestXadc = false;
|
||||
|
||||
bool gpsNotOpenSwitch = false;
|
||||
bool gpsReadFailedSwitch = false;
|
||||
int32_t noModeSetCntr = 0;
|
||||
gpsmm* gpsmmShmPtr = nullptr;
|
||||
|
||||
CoreController* coreController = nullptr;
|
||||
ReturnValue_t performOneShotAction() override;
|
||||
ReturnValue_t performPeriodicAction() override;
|
||||
|
||||
void testGpsDaemon();
|
||||
void testGpsDaemonShm();
|
||||
void testGpsDaemonSocket();
|
||||
|
||||
void testSdCard();
|
||||
void fileTests();
|
||||
|
@ -1,6 +1,2 @@
|
||||
target_sources(${OBSW_NAME} PRIVATE
|
||||
rwSpiCallback.cpp
|
||||
gnssCallback.cpp
|
||||
pcduSwitchCb.cpp
|
||||
q7sGpioCallbacks.cpp
|
||||
)
|
||||
target_sources(${OBSW_NAME} PRIVATE rwSpiCallback.cpp gnssCallback.cpp
|
||||
pcduSwitchCb.cpp q7sGpioCallbacks.cpp)
|
||||
|
@ -1,9 +1,14 @@
|
||||
#include "gnssCallback.h"
|
||||
|
||||
#include "devices/gpioIds.h"
|
||||
#include "fsfw/action/HasActionsIF.h"
|
||||
#include "fsfw/tasks/TaskFactory.h"
|
||||
|
||||
ReturnValue_t gps::triggerGpioResetPin(void* args) {
|
||||
ReturnValue_t gps::triggerGpioResetPin(const uint8_t* actionData, size_t len, void* args) {
|
||||
// At least one byte which denotes which GPS to reset is required
|
||||
if (len < 1 or actionData == nullptr) {
|
||||
return HasActionsIF::INVALID_PARAMETERS;
|
||||
}
|
||||
ResetArgs* resetArgs = reinterpret_cast<ResetArgs*>(args);
|
||||
if (args == nullptr) {
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
@ -12,11 +17,10 @@ ReturnValue_t gps::triggerGpioResetPin(void* args) {
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
gpioId_t gpioId;
|
||||
if (resetArgs->gnss1) {
|
||||
gpioId = gpioIds::GNSS_1_NRESET;
|
||||
|
||||
} else {
|
||||
if (actionData[0] == 0) {
|
||||
gpioId = gpioIds::GNSS_0_NRESET;
|
||||
} else {
|
||||
gpioId = gpioIds::GNSS_1_NRESET;
|
||||
}
|
||||
resetArgs->gpioComIF->pullLow(gpioId);
|
||||
TaskFactory::delayTask(resetArgs->waitPeriodMs);
|
||||
|
@ -5,14 +5,13 @@
|
||||
#include "fsfw_hal/linux/gpio/LinuxLibgpioIF.h"
|
||||
|
||||
struct ResetArgs {
|
||||
bool gnss1 = false;
|
||||
LinuxLibgpioIF* gpioComIF = nullptr;
|
||||
uint32_t waitPeriodMs = 100;
|
||||
};
|
||||
|
||||
namespace gps {
|
||||
|
||||
ReturnValue_t triggerGpioResetPin(void* args);
|
||||
ReturnValue_t triggerGpioResetPin(const uint8_t* actionData, size_t len, void* args);
|
||||
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,7 @@ void q7s::gpioCallbacks::initSpiCsDecoder(GpioIF* gpioComIF) {
|
||||
|
||||
result = gpioComIF->addGpios(spiMuxGpios);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::error << "initSpiCsDecoder: Failed to add mux bit gpios to gpioComIF" << std::endl;
|
||||
sif::error << "initSpiCsDecoder: Failed to add SPI MUX bit GPIOs" << std::endl;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
#include "rwSpiCallback.h"
|
||||
|
||||
#include <fsfw/timemanager/Stopwatch.h>
|
||||
|
||||
#include "devices/gpioIds.h"
|
||||
#include "fsfw/serviceinterface/ServiceInterface.h"
|
||||
#include "fsfw_hal/linux/UnixFileGuard.h"
|
||||
@ -8,8 +10,25 @@
|
||||
|
||||
namespace rwSpiCallback {
|
||||
|
||||
namespace {
|
||||
static bool MODE_SET = false;
|
||||
|
||||
ReturnValue_t openSpi(const std::string& devname, int flags, GpioIF* gpioIF, gpioId_t gpioId,
|
||||
MutexIF* mutex, MutexIF::TimeoutType timeoutType, uint32_t timeoutMs,
|
||||
int& fd);
|
||||
/**
|
||||
* @brief This function closes a spi session. Pulls the chip select to high an releases the
|
||||
* mutex.
|
||||
* @param gpioId Gpio ID of chip select
|
||||
* @param gpioIF Pointer to gpio interface to drive the chip select
|
||||
* @param mutex The spi mutex
|
||||
*/
|
||||
void closeSpi(int fd, gpioId_t gpioId, GpioIF* gpioIF, MutexIF* mutex);
|
||||
} // namespace
|
||||
|
||||
ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sendData,
|
||||
size_t sendLen, void* args) {
|
||||
// Stopwatch watch;
|
||||
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
||||
|
||||
RwHandler* handler = reinterpret_cast<RwHandler*>(args);
|
||||
@ -18,51 +37,45 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
|
||||
uint8_t writeBuffer[2];
|
||||
uint8_t writeBuffer[2] = {};
|
||||
uint8_t writeSize = 0;
|
||||
|
||||
gpioId_t gpioId = cookie->getChipSelectPin();
|
||||
GpioIF* gpioIF = comIf->getGpioInterface();
|
||||
MutexIF::TimeoutType timeoutType = MutexIF::TimeoutType::WAITING;
|
||||
uint32_t timeoutMs = 0;
|
||||
MutexIF* mutex = comIf->getMutex(&timeoutType, &timeoutMs);
|
||||
MutexIF* mutex = comIf->getCsMutex();
|
||||
cookie->getMutexParams(timeoutType, timeoutMs);
|
||||
if (mutex == nullptr or gpioIF == nullptr) {
|
||||
sif::debug << "rwSpiCallback::spiCallback: Mutex or GPIO interface invalid" << std::endl;
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
|
||||
int fileDescriptor = 0;
|
||||
std::string device = cookie->getSpiDevice();
|
||||
UnixFileGuard fileHelper(device, &fileDescriptor, O_RDWR, "rwSpiCallback::spiCallback");
|
||||
if (fileHelper.getOpenResult() != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::error << "rwSpiCallback::spiCallback: Failed to open device file" << std::endl;
|
||||
return SpiComIF::OPENING_FILE_FAILED;
|
||||
}
|
||||
spi::SpiModes spiMode = spi::SpiModes::MODE_0;
|
||||
uint32_t spiSpeed = 0;
|
||||
cookie->getSpiParameters(spiMode, spiSpeed, nullptr);
|
||||
comIf->setSpiSpeedAndMode(fileDescriptor, spiMode, spiSpeed);
|
||||
|
||||
result = mutex->lockMutex(timeoutType, timeoutMs);
|
||||
const std::string& dev = comIf->getSpiDev();
|
||||
result = openSpi(dev, O_RDWR, gpioIF, gpioId, mutex, timeoutType, timeoutMs, fileDescriptor);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::debug << "rwSpiCallback::spiCallback: Failed to lock mutex" << std::endl;
|
||||
return result;
|
||||
}
|
||||
|
||||
/** Sending frame start sign */
|
||||
writeBuffer[0] = 0x7E;
|
||||
writeSize = 1;
|
||||
spi::SpiModes spiMode = spi::SpiModes::MODE_0;
|
||||
uint32_t spiSpeed = 0;
|
||||
cookie->getSpiParameters(spiMode, spiSpeed, nullptr);
|
||||
// We are in protected section, so we can use the static variable here without issues.
|
||||
// We don't need to set the speed because a SPI core is used, but the mode has to be set once
|
||||
// correctly for all RWs
|
||||
if (not MODE_SET) {
|
||||
comIf->setSpiSpeedAndMode(fileDescriptor, spiMode, spiSpeed);
|
||||
MODE_SET = true;
|
||||
}
|
||||
|
||||
// Pull SPI CS low. For now, no support for active high given
|
||||
if (gpioId != gpio::NO_GPIO) {
|
||||
if (gpioIF->pullLow(gpioId) != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::error << "rwSpiCallback::spiCallback: Failed to pull chip select low" << std::endl;
|
||||
}
|
||||
}
|
||||
/** Sending frame start sign */
|
||||
writeBuffer[0] = FLAG_BYTE;
|
||||
writeSize = 1;
|
||||
|
||||
if (write(fileDescriptor, writeBuffer, writeSize) != static_cast<ssize_t>(writeSize)) {
|
||||
sif::error << "rwSpiCallback::spiCallback: Write failed!" << std::endl;
|
||||
closeSpi(gpioId, gpioIF, mutex);
|
||||
closeSpi(fileDescriptor, gpioId, gpioIF, mutex);
|
||||
return RwHandler::SPI_WRITE_FAILURE;
|
||||
}
|
||||
|
||||
@ -87,33 +100,39 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen
|
||||
}
|
||||
if (write(fileDescriptor, writeBuffer, writeSize) != static_cast<ssize_t>(writeSize)) {
|
||||
sif::error << "rwSpiCallback::spiCallback: Write failed!" << std::endl;
|
||||
closeSpi(gpioId, gpioIF, mutex);
|
||||
closeSpi(fileDescriptor, gpioId, gpioIF, mutex);
|
||||
return RwHandler::SPI_WRITE_FAILURE;
|
||||
}
|
||||
idx++;
|
||||
}
|
||||
|
||||
/** Sending frame end sign */
|
||||
writeBuffer[0] = 0x7E;
|
||||
writeBuffer[0] = FLAG_BYTE;
|
||||
writeSize = 1;
|
||||
|
||||
if (write(fileDescriptor, writeBuffer, writeSize) != static_cast<ssize_t>(writeSize)) {
|
||||
sif::error << "rwSpiCallback::spiCallback: Write failed!" << std::endl;
|
||||
closeSpi(gpioId, gpioIF, mutex);
|
||||
closeSpi(fileDescriptor, gpioId, gpioIF, mutex);
|
||||
return RwHandler::SPI_WRITE_FAILURE;
|
||||
}
|
||||
|
||||
uint8_t* rxBuf = nullptr;
|
||||
result = comIf->getReadBuffer(cookie->getSpiAddress(), &rxBuf);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
closeSpi(gpioId, gpioIF, mutex);
|
||||
closeSpi(fileDescriptor, gpioId, gpioIF, mutex);
|
||||
return result;
|
||||
}
|
||||
|
||||
size_t replyBufferSize = cookie->getMaxBufferSize();
|
||||
|
||||
/** There must be a delay of at least 20 ms after sending the command */
|
||||
// There must be a delay of at least 20 ms after sending the command.
|
||||
// Delay for 70 ms here and release the SPI bus for that duration.
|
||||
closeSpi(fileDescriptor, gpioId, gpioIF, mutex);
|
||||
usleep(RwDefinitions::SPI_REPLY_DELAY);
|
||||
result = openSpi(dev, O_RDWR, gpioIF, gpioId, mutex, timeoutType, timeoutMs, fileDescriptor);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* The reaction wheel responds with empty frames while preparing the reply data.
|
||||
@ -123,13 +142,13 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen
|
||||
for (int idx = 0; idx < 10; idx++) {
|
||||
if (read(fileDescriptor, &byteRead, 1) != 1) {
|
||||
sif::error << "rwSpiCallback::spiCallback: Read failed" << std::endl;
|
||||
closeSpi(gpioId, gpioIF, mutex);
|
||||
closeSpi(fileDescriptor, gpioId, gpioIF, mutex);
|
||||
return RwHandler::SPI_READ_FAILURE;
|
||||
}
|
||||
if (idx == 0) {
|
||||
if (byteRead != FLAG_BYTE) {
|
||||
sif::error << "Invalid data, expected start marker" << std::endl;
|
||||
closeSpi(gpioId, gpioIF, mutex);
|
||||
closeSpi(fileDescriptor, gpioId, gpioIF, mutex);
|
||||
return RwHandler::NO_START_MARKER;
|
||||
}
|
||||
}
|
||||
@ -140,7 +159,7 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen
|
||||
|
||||
if (idx == 9) {
|
||||
sif::error << "rwSpiCallback::spiCallback: Empty frame timeout" << std::endl;
|
||||
closeSpi(gpioId, gpioIF, mutex);
|
||||
closeSpi(fileDescriptor, gpioId, gpioIF, mutex);
|
||||
return RwHandler::NO_REPLY;
|
||||
}
|
||||
}
|
||||
@ -180,7 +199,7 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen
|
||||
continue;
|
||||
} else {
|
||||
sif::error << "rwSpiCallback::spiCallback: Invalid substitute" << std::endl;
|
||||
closeSpi(gpioId, gpioIF, mutex);
|
||||
closeSpi(fileDescriptor, gpioId, gpioIF, mutex);
|
||||
result = RwHandler::INVALID_SUBSTITUTE;
|
||||
break;
|
||||
}
|
||||
@ -201,8 +220,9 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen
|
||||
result = RwHandler::SPI_READ_FAILURE;
|
||||
break;
|
||||
}
|
||||
if (byteRead != 0x7E) {
|
||||
sif::error << "rwSpiCallback::spiCallback: Missing end sign 0x7E" << std::endl;
|
||||
if (byteRead != FLAG_BYTE) {
|
||||
sif::error << "rwSpiCallback::spiCallback: Missing end sign " << static_cast<int>(FLAG_BYTE)
|
||||
<< std::endl;
|
||||
decodedFrameLen--;
|
||||
result = RwHandler::MISSING_END_SIGN;
|
||||
break;
|
||||
@ -213,12 +233,40 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen
|
||||
|
||||
cookie->setTransferSize(decodedFrameLen);
|
||||
|
||||
closeSpi(gpioId, gpioIF, mutex);
|
||||
closeSpi(fileDescriptor, gpioId, gpioIF, mutex);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void closeSpi(gpioId_t gpioId, GpioIF* gpioIF, MutexIF* mutex) {
|
||||
namespace {
|
||||
|
||||
ReturnValue_t openSpi(const std::string& devname, int flags, GpioIF* gpioIF, gpioId_t gpioId,
|
||||
MutexIF* mutex, MutexIF::TimeoutType timeoutType, uint32_t timeoutMs,
|
||||
int& fd) {
|
||||
ReturnValue_t result = mutex->lockMutex(timeoutType, timeoutMs);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::debug << "rwSpiCallback::spiCallback: Failed to lock mutex" << std::endl;
|
||||
return result;
|
||||
}
|
||||
|
||||
fd = open(devname.c_str(), flags);
|
||||
if (fd < 0) {
|
||||
sif::error << "rwSpiCallback::spiCallback: Failed to open device file" << std::endl;
|
||||
return SpiComIF::OPENING_FILE_FAILED;
|
||||
}
|
||||
|
||||
// Pull SPI CS low. For now, no support for active high given
|
||||
if (gpioId != gpio::NO_GPIO) {
|
||||
result = gpioIF->pullLow(gpioId);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::error << "rwSpiCallback::spiCallback: Failed to pull chip select low" << std::endl;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
void closeSpi(int fd, gpioId_t gpioId, GpioIF* gpioIF, MutexIF* mutex) {
|
||||
close(fd);
|
||||
if (gpioId != gpio::NO_GPIO) {
|
||||
if (gpioIF->pullHigh(gpioId) != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::error << "closeSpi: Failed to pull chip select high" << std::endl;
|
||||
@ -229,4 +277,7 @@ void closeSpi(gpioId_t gpioId, GpioIF* gpioIF, MutexIF* mutex) {
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
} // namespace rwSpiCallback
|
||||
|
@ -33,14 +33,5 @@ static constexpr uint8_t FLAG_BYTE = 0x7E;
|
||||
ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sendData,
|
||||
size_t sendLen, void* args);
|
||||
|
||||
/**
|
||||
* @brief This function closes a spi session. Pulls the chip select to high an releases the
|
||||
* mutex.
|
||||
* @param gpioId Gpio ID of chip select
|
||||
* @param gpioIF Pointer to gpio interface to drive the chip select
|
||||
* @param mutex The spi mutex
|
||||
*/
|
||||
void closeSpi(gpioId_t gpioId, GpioIF* gpioIF, MutexIF* mutex);
|
||||
|
||||
} // namespace rwSpiCallback
|
||||
#endif /* BSP_Q7S_RW_SPI_CALLBACK_H_ */
|
||||
|
@ -1,6 +1 @@
|
||||
target_sources(${OBSW_NAME} PRIVATE
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
target_sources(${OBSW_NAME} PRIVATE)
|
||||
|
@ -1,10 +1,4 @@
|
||||
target_sources(${OBSW_NAME} PRIVATE
|
||||
CoreController.cpp
|
||||
obsw.cpp
|
||||
InitMission.cpp
|
||||
ObjectFactory.cpp
|
||||
)
|
||||
target_sources(${OBSW_NAME} PRIVATE CoreController.cpp InitMission.cpp
|
||||
ObjectFactory.cpp)
|
||||
|
||||
target_sources(${SIMPLE_OBSW_NAME} PRIVATE
|
||||
InitMission.cpp
|
||||
)
|
||||
target_sources(${SIMPLE_OBSW_NAME} PRIVATE InitMission.cpp)
|
||||
|
@ -56,6 +56,7 @@ CoreController::CoreController(object_id_t objectId)
|
||||
} catch (const std::filesystem::filesystem_error &e) {
|
||||
sif::error << "CoreController::CoreController: Failed with exception " << e.what() << std::endl;
|
||||
}
|
||||
sdCardCheckCd.timeOut();
|
||||
eventQueue = QueueFactory::instance()->createMessageQueue(5, EventMessage::MAX_MESSAGE_SIZE);
|
||||
}
|
||||
|
||||
@ -77,6 +78,10 @@ void CoreController::performControlOperation() {
|
||||
performWatchdogControlOperation();
|
||||
sdStateMachine();
|
||||
performMountedSdCardOperations();
|
||||
if (sdCardCheckCd.hasTimedOut()) {
|
||||
performSdCardCheck();
|
||||
sdCardCheckCd.resetTimer();
|
||||
}
|
||||
readHkData();
|
||||
opDivider5.checkAndIncrement();
|
||||
opDivider10.checkAndIncrement();
|
||||
@ -87,6 +92,7 @@ ReturnValue_t CoreController::initializeLocalDataPool(localpool::DataPool &local
|
||||
localDataPoolMap.emplace(core::TEMPERATURE, new PoolEntry<float>({0}));
|
||||
localDataPoolMap.emplace(core::PS_VOLTAGE, new PoolEntry<float>({0}));
|
||||
localDataPoolMap.emplace(core::PL_VOLTAGE, new PoolEntry<float>({0}));
|
||||
poolManager.subscribeForPeriodicPacket(hkSet.getSid(), false, 10.0, false);
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
@ -133,6 +139,9 @@ ReturnValue_t CoreController::initialize() {
|
||||
|
||||
ReturnValue_t CoreController::initializeAfterTaskCreation() {
|
||||
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
||||
sdInfo.pref = sdcMan->getPreferredSdCard();
|
||||
sdcMan->setActiveSdCard(sdInfo.pref);
|
||||
currMntPrefix = sdcMan->getCurrentMountPrefix();
|
||||
if (BLOCKING_SD_INIT) {
|
||||
ReturnValue_t result = initSdCardBlocking();
|
||||
if (result != HasReturnvaluesIF::RETURN_OK and result != SdCardManager::ALREADY_MOUNTED) {
|
||||
@ -164,7 +173,7 @@ ReturnValue_t CoreController::executeAction(ActionId_t actionId, MessageQueueId_
|
||||
if (size < 1) {
|
||||
return HasActionsIF::INVALID_PARAMETERS;
|
||||
}
|
||||
std::string path = sdcMan->getCurrentMountPrefix(sdInfo.pref) + REBOOT_FILE;
|
||||
std::string path = sdcMan->getCurrentMountPrefix() + REBOOT_FILE;
|
||||
// Disable the reboot file mechanism
|
||||
parseRebootFile(path, rebootFile);
|
||||
if (data[0] == 0) {
|
||||
@ -204,15 +213,20 @@ ReturnValue_t CoreController::executeAction(ActionId_t actionId, MessageQueueId_
|
||||
if (size < 1) {
|
||||
return HasActionsIF::INVALID_PARAMETERS;
|
||||
}
|
||||
std::string path = sdcMan->getCurrentMountPrefix(sdInfo.pref) + REBOOT_FILE;
|
||||
std::string path = sdcMan->getCurrentMountPrefix() + REBOOT_FILE;
|
||||
// Disable the reboot file mechanism
|
||||
parseRebootFile(path, rebootFile);
|
||||
rebootFile.maxCount = data[0];
|
||||
rewriteRebootFile(rebootFile);
|
||||
return HasActionsIF::EXECUTION_FINISHED;
|
||||
}
|
||||
case (XSC_REBOOT_OBC): {
|
||||
// Warning: This function will never return, because it reboots the system
|
||||
return actionXscReboot(data, size);
|
||||
}
|
||||
case (REBOOT_OBC): {
|
||||
return actionPerformReboot(data, size);
|
||||
// Warning: This function will never return, because it reboots the system
|
||||
return actionReboot(data, size);
|
||||
}
|
||||
default: {
|
||||
return HasActionsIF::INVALID_ACTION_ID;
|
||||
@ -236,13 +250,12 @@ ReturnValue_t CoreController::initSdCardBlocking() {
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
#else
|
||||
|
||||
result = sdcMan->getSdCardActiveStatus(sdInfo.currentState);
|
||||
result = sdcMan->getSdCardsStatus(sdInfo.currentState);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::warning << "Getting SD card activity status failed" << std::endl;
|
||||
}
|
||||
|
||||
#if Q7S_SD_CARD_CONFIG == Q7S_SD_COLD_REDUNDANT
|
||||
determinePreferredSdCard();
|
||||
updateSdInfoOther();
|
||||
sif::info << "Cold redundant SD card configuration, preferred SD card: "
|
||||
<< static_cast<int>(sdInfo.pref) << std::endl;
|
||||
@ -323,8 +336,8 @@ ReturnValue_t CoreController::sdStateMachine() {
|
||||
|
||||
if (sdInfo.state == SdStates::SET_STATE_SELF) {
|
||||
if (not sdInfo.commandExecuted) {
|
||||
result = sdcMan->getSdCardActiveStatus(sdInfo.currentState);
|
||||
determinePreferredSdCard();
|
||||
result = sdcMan->getSdCardsStatus(sdInfo.currentState);
|
||||
sdInfo.pref = sdcMan->getPreferredSdCard();
|
||||
updateSdInfoOther();
|
||||
if (sdInfo.pref != sd::SdCard::SLOT_0 and sdInfo.pref != sd::SdCard::SLOT_1) {
|
||||
sif::warning << "Preferred SD card invalid. Setting to card 0.." << std::endl;
|
||||
@ -467,7 +480,7 @@ ReturnValue_t CoreController::sdStateMachine() {
|
||||
sdInfo.state = SdStates::IDLE;
|
||||
sdInfo.cycleCount = 0;
|
||||
sdcMan->setBlocking(false);
|
||||
sdcMan->getSdCardActiveStatus(sdInfo.currentState);
|
||||
sdcMan->getSdCardsStatus(sdInfo.currentState);
|
||||
if (not sdInfo.initFinished) {
|
||||
updateSdInfoOther();
|
||||
sdInfo.initFinished = true;
|
||||
@ -844,25 +857,18 @@ void CoreController::initPrint() {
|
||||
#endif
|
||||
}
|
||||
|
||||
ReturnValue_t CoreController::actionPerformReboot(const uint8_t *data, size_t size) {
|
||||
ReturnValue_t CoreController::actionXscReboot(const uint8_t *data, size_t size) {
|
||||
if (size < 1) {
|
||||
return HasActionsIF::INVALID_PARAMETERS;
|
||||
}
|
||||
bool rebootSameBootCopy = data[0];
|
||||
bool protOpPerformed;
|
||||
bool protOpPerformed = false;
|
||||
SdCardManager::instance()->setBlocking(true);
|
||||
if (rebootSameBootCopy) {
|
||||
#if OBSW_VERBOSE_LEVEL >= 1
|
||||
sif::info << "CoreController::actionPerformReboot: Rebooting on current image" << std::endl;
|
||||
#endif
|
||||
// Attempt graceful shutdown by unmounting and switching off SD cards
|
||||
SdCardManager::instance()->switchOffSdCard(sd::SdCard::SLOT_0);
|
||||
SdCardManager::instance()->switchOffSdCard(sd::SdCard::SLOT_1);
|
||||
// If any boot copies are unprotected
|
||||
ReturnValue_t retval = setBootCopyProtection(xsc::Chip::SELF_CHIP, xsc::Copy::SELF_COPY, true,
|
||||
protOpPerformed, false);
|
||||
if (retval == HasReturnvaluesIF::RETURN_OK and protOpPerformed) {
|
||||
sif::info << "Running slot was writeprotected before reboot" << std::endl;
|
||||
}
|
||||
gracefulShutdownTasks(xsc::Chip::SELF_CHIP, xsc::Copy::SELF_COPY, protOpPerformed);
|
||||
int result = std::system("xsc_boot_copy -r");
|
||||
if (result != 0) {
|
||||
utility::handleSystemError(result, "CoreController::executeAction");
|
||||
@ -884,12 +890,8 @@ ReturnValue_t CoreController::actionPerformReboot(const uint8_t *data, size_t si
|
||||
auto tgtChip = static_cast<xsc::Chip>(data[1]);
|
||||
auto tgtCopy = static_cast<xsc::Copy>(data[2]);
|
||||
|
||||
ReturnValue_t retval =
|
||||
setBootCopyProtection(static_cast<xsc::Chip>(data[1]), static_cast<xsc::Copy>(data[2]), true,
|
||||
protOpPerformed, false);
|
||||
if (retval == HasReturnvaluesIF::RETURN_OK and protOpPerformed) {
|
||||
sif::info << "Target slot was writeprotected before reboot" << std::endl;
|
||||
}
|
||||
// This function can not really fail
|
||||
gracefulShutdownTasks(tgtChip, tgtCopy, protOpPerformed);
|
||||
|
||||
switch (tgtChip) {
|
||||
case (xsc::Chip::CHIP_0): {
|
||||
@ -930,27 +932,32 @@ ReturnValue_t CoreController::actionPerformReboot(const uint8_t *data, size_t si
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
|
||||
CoreController::~CoreController() {}
|
||||
|
||||
void CoreController::determinePreferredSdCard() {
|
||||
if (sdInfo.pref == sd::SdCard::NONE) {
|
||||
ReturnValue_t result = sdcMan->getPreferredSdCard(sdInfo.pref);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result == scratch::KEY_NOT_FOUND) {
|
||||
sif::warning << "CoreController::sdCardInit: "
|
||||
"Preferred SD card not set. Setting to 0"
|
||||
<< std::endl;
|
||||
sdcMan->setPreferredSdCard(sd::SdCard::SLOT_0);
|
||||
sdInfo.pref = sd::SdCard::SLOT_0;
|
||||
} else {
|
||||
sif::warning << "CoreController::sdCardInit: Could not get preferred SD card"
|
||||
"information from the scratch buffer"
|
||||
<< std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
ReturnValue_t CoreController::actionReboot(const uint8_t *data, size_t size) {
|
||||
bool protOpPerformed = false;
|
||||
gracefulShutdownTasks(xsc::Chip::CHIP_0, xsc::Copy::COPY_0, protOpPerformed);
|
||||
std::system("reboot");
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
ReturnValue_t CoreController::gracefulShutdownTasks(xsc::Chip chip, xsc::Copy copy,
|
||||
bool &protOpPerformed) {
|
||||
sdcMan->setBlocking(true);
|
||||
// Attempt graceful shutdown by unmounting and switching off SD cards
|
||||
sdcMan->switchOffSdCard(sd::SdCard::SLOT_0);
|
||||
sdcMan->switchOffSdCard(sd::SdCard::SLOT_1);
|
||||
// If any boot copies are unprotected
|
||||
ReturnValue_t result = setBootCopyProtection(xsc::Chip::SELF_CHIP, xsc::Copy::SELF_COPY, true,
|
||||
protOpPerformed, false);
|
||||
if (result == HasReturnvaluesIF::RETURN_OK and protOpPerformed) {
|
||||
// TODO: Would be nice to notify operator. But we can't use the filesystem anymore
|
||||
// and a reboot is imminent. Use scratch buffer?
|
||||
sif::info << "Running slot was writeprotected before reboot" << std::endl;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
CoreController::~CoreController() {}
|
||||
|
||||
void CoreController::updateSdInfoOther() {
|
||||
if (sdInfo.pref == sd::SdCard::SLOT_0) {
|
||||
sdInfo.prefChar = "0";
|
||||
@ -1234,24 +1241,73 @@ void CoreController::performWatchdogControlOperation() {
|
||||
}
|
||||
|
||||
void CoreController::performMountedSdCardOperations() {
|
||||
currMntPrefix = sdcMan->getCurrentMountPrefix();
|
||||
if (doPerformMountedSdCardOps) {
|
||||
bool sdCardMounted = false;
|
||||
sdCardMounted = sdcMan->isSdCardMounted(sdInfo.pref);
|
||||
if (sdCardMounted) {
|
||||
std::string path = currMntPrefix + "/" + CONF_FOLDER;
|
||||
if (not std::filesystem::exists(path)) {
|
||||
std::filesystem::create_directory(path);
|
||||
auto mountedSdCardOp = [&](bool &mntSwitch, sd::SdCard sdCard, std::string mntPoint) {
|
||||
if (mntSwitch) {
|
||||
bool sdCardMounted = sdcMan->isSdCardMounted(sdCard);
|
||||
if (sdCardMounted and not performOneShotSdCardOpsSwitch) {
|
||||
std::ostringstream path;
|
||||
path << mntPoint << "/" << CONF_FOLDER;
|
||||
if (not std::filesystem::exists(path.str())) {
|
||||
std::filesystem::create_directory(path.str());
|
||||
}
|
||||
initVersionFile();
|
||||
initClockFromTimeFile();
|
||||
performRebootFileHandling(false);
|
||||
doPerformMountedSdCardOps = false;
|
||||
performOneShotSdCardOpsSwitch = true;
|
||||
}
|
||||
mntSwitch = false;
|
||||
}
|
||||
};
|
||||
if (sdInfo.pref == sd::SdCard::SLOT_1) {
|
||||
mountedSdCardOp(sdInfo.mountSwitch.second, sd::SdCard::SLOT_1, SdCardManager::SD_1_MOUNT_POINT);
|
||||
mountedSdCardOp(sdInfo.mountSwitch.first, sd::SdCard::SLOT_0, SdCardManager::SD_0_MOUNT_POINT);
|
||||
} else {
|
||||
mountedSdCardOp(sdInfo.mountSwitch.first, sd::SdCard::SLOT_0, SdCardManager::SD_0_MOUNT_POINT);
|
||||
mountedSdCardOp(sdInfo.mountSwitch.second, sd::SdCard::SLOT_1, SdCardManager::SD_1_MOUNT_POINT);
|
||||
}
|
||||
timeFileHandler();
|
||||
}
|
||||
|
||||
ReturnValue_t CoreController::performSdCardCheck() {
|
||||
bool mountedReadOnly = false;
|
||||
SdCardManager::SdStatePair active;
|
||||
sdcMan->getSdCardsStatus(active);
|
||||
auto sdCardCheck = [&](sd::SdCard sdCard) {
|
||||
ReturnValue_t result = sdcMan->isSdCardMountedReadOnly(sdCard, mountedReadOnly);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::error << "CoreController::performSdCardCheck: Could not check "
|
||||
"read-only mount state"
|
||||
<< std::endl;
|
||||
mountedReadOnly = true;
|
||||
}
|
||||
if (mountedReadOnly) {
|
||||
int linuxErrno = 0;
|
||||
result = sdcMan->performFsck(sdCard, true, linuxErrno);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::error << "CoreController::performSdCardCheck: fsck command on SD Card "
|
||||
<< static_cast<uint8_t>(sdCard) << " failed with code " << linuxErrno << " | "
|
||||
<< strerror(linuxErrno);
|
||||
}
|
||||
result = sdcMan->remountReadWrite(sdCard);
|
||||
if (result == HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::warning << "CoreController::performSdCardCheck: Remounted SD Card "
|
||||
<< static_cast<uint8_t>(sdCard) << " read-write";
|
||||
} else {
|
||||
sif::error << "CoreController::performSdCardCheck: Remounting SD Card "
|
||||
<< static_cast<uint8_t>(sdCard) << " read-write failed";
|
||||
}
|
||||
}
|
||||
};
|
||||
if (active.first == sd::SdState::MOUNTED) {
|
||||
sdCardCheck(sd::SdCard::SLOT_0);
|
||||
}
|
||||
if (active.second == sd::SdState::MOUNTED) {
|
||||
sdCardCheck(sd::SdCard::SLOT_1);
|
||||
}
|
||||
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
void CoreController::performRebootFileHandling(bool recreateFile) {
|
||||
using namespace std;
|
||||
std::string path = currMntPrefix + REBOOT_FILE;
|
||||
@ -1677,7 +1733,7 @@ void CoreController::rewriteRebootFile(RebootFile file) {
|
||||
}
|
||||
|
||||
void CoreController::setRebootMechanismLock(bool lock, xsc::Chip tgtChip, xsc::Copy tgtCopy) {
|
||||
std::string path = sdcMan->getCurrentMountPrefix(sdInfo.pref) + REBOOT_FILE;
|
||||
std::string path = currMntPrefix + REBOOT_FILE;
|
||||
// Disable the reboot file mechanism
|
||||
parseRebootFile(path, rebootFile);
|
||||
if (tgtChip == xsc::CHIP_0) {
|
||||
|
@ -67,13 +67,16 @@ class CoreController : public ExtendedControllerBase {
|
||||
static constexpr ActionId_t SWITCH_IMG_LOCK = 7;
|
||||
static constexpr ActionId_t SET_MAX_REBOOT_CNT = 8;
|
||||
|
||||
static constexpr ActionId_t REBOOT_OBC = 32;
|
||||
//! Reboot using the xsc_boot_copy command
|
||||
static constexpr ActionId_t XSC_REBOOT_OBC = 32;
|
||||
static constexpr ActionId_t MOUNT_OTHER_COPY = 33;
|
||||
//! Reboot using the reboot command
|
||||
static constexpr ActionId_t REBOOT_OBC = 34;
|
||||
|
||||
static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::CORE;
|
||||
|
||||
static constexpr Event ALLOC_FAILURE = event::makeEvent(SUBSYSTEM_ID, 0, severity::MEDIUM);
|
||||
//! [EXPORT] : [COMMENT] Software reboot occured. Can also be a systemd reboot.
|
||||
//! [EXPORT] : [COMMENT] Software reboot occurred. Can also be a systemd reboot.
|
||||
//! P1: Current Chip, P2: Current Copy
|
||||
static constexpr Event REBOOT_SW = event::makeEvent(SUBSYSTEM_ID, 1, severity::MEDIUM);
|
||||
//! [EXPORT] : [COMMENT] The reboot mechanism was triggered.
|
||||
@ -159,11 +162,12 @@ class CoreController : public ExtendedControllerBase {
|
||||
|
||||
struct SdInfo {
|
||||
sd::SdCard pref = sd::SdCard::NONE;
|
||||
sd::SdState prefState = sd::SdState::OFF;
|
||||
sd::SdCard other = sd::SdCard::NONE;
|
||||
sd::SdState prefState = sd::SdState::OFF;
|
||||
sd::SdState otherState = sd::SdState::OFF;
|
||||
std::string prefChar = "0";
|
||||
std::string otherChar = "1";
|
||||
std::pair<bool, bool> mountSwitch = {true, true};
|
||||
SdStates state = SdStates::START;
|
||||
// Used to track whether a command was executed
|
||||
bool commandExecuted = true;
|
||||
@ -179,7 +183,7 @@ class CoreController : public ExtendedControllerBase {
|
||||
} sdInfo;
|
||||
RebootFile rebootFile = {};
|
||||
std::string currMntPrefix;
|
||||
bool doPerformMountedSdCardOps = true;
|
||||
bool performOneShotSdCardOpsSwitch = true;
|
||||
|
||||
/**
|
||||
* Index 0: Chip 0 Copy 0
|
||||
@ -195,12 +199,14 @@ class CoreController : public ExtendedControllerBase {
|
||||
|
||||
ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
|
||||
LocalDataPoolManager& poolManager) override;
|
||||
Countdown sdCardCheckCd = Countdown(120000);
|
||||
LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override;
|
||||
ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode, uint32_t* msToReachTheMode);
|
||||
void performMountedSdCardOperations();
|
||||
ReturnValue_t initVersionFile();
|
||||
|
||||
ReturnValue_t initClockFromTimeFile();
|
||||
ReturnValue_t performSdCardCheck();
|
||||
ReturnValue_t timeFileHandler();
|
||||
ReturnValue_t initBootCopy();
|
||||
ReturnValue_t initWatchdogFifo();
|
||||
@ -214,14 +220,16 @@ class CoreController : public ExtendedControllerBase {
|
||||
ReturnValue_t sdColdRedundantBlockingInit();
|
||||
|
||||
void currentStateSetter(sd::SdCard sdCard, sd::SdState newState);
|
||||
void determinePreferredSdCard();
|
||||
void executeNextExternalSdCommand();
|
||||
void checkExternalSdCommandStatus();
|
||||
void performRebootFileHandling(bool recreateFile);
|
||||
|
||||
ReturnValue_t actionListDirectoryIntoFile(ActionId_t actionId, MessageQueueId_t commandedBy,
|
||||
const uint8_t* data, size_t size);
|
||||
ReturnValue_t actionPerformReboot(const uint8_t* data, size_t size);
|
||||
ReturnValue_t actionXscReboot(const uint8_t* data, size_t size);
|
||||
ReturnValue_t actionReboot(const uint8_t* data, size_t size);
|
||||
|
||||
ReturnValue_t gracefulShutdownTasks(xsc::Chip chip, xsc::Copy copy, bool& protOpPerformed);
|
||||
|
||||
void performWatchdogControlOperation();
|
||||
|
||||
|
@ -1,10 +1,12 @@
|
||||
#include "InitMission.h"
|
||||
#include "bsp_q7s/core/InitMission.h"
|
||||
|
||||
#include <fsfw/devicehandlers/DeviceCommunicationIF.h>
|
||||
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
#include "ObjectFactory.h"
|
||||
#include "bsp_q7s/core/ObjectFactory.h"
|
||||
#include "fsfw/objectmanager/ObjectManager.h"
|
||||
#include "fsfw/objectmanager/ObjectManagerIF.h"
|
||||
#include "fsfw/platform.h"
|
||||
@ -13,6 +15,7 @@
|
||||
#include "fsfw/tasks/FixedTimeslotTaskIF.h"
|
||||
#include "fsfw/tasks/PeriodicTaskIF.h"
|
||||
#include "fsfw/tasks/TaskFactory.h"
|
||||
#include "mission/devices/devicedefinitions/Max31865Definitions.h"
|
||||
#include "mission/utility/InitMission.h"
|
||||
#include "pollingsequence/pollingSequenceFactory.h"
|
||||
|
||||
@ -33,8 +36,16 @@ ObjectManagerIF* objectManager = nullptr;
|
||||
|
||||
void initmission::initMission() {
|
||||
sif::info << "Building global objects.." << std::endl;
|
||||
try {
|
||||
/* Instantiate global object manager and also create all objects */
|
||||
ObjectManager::instance()->setObjectFactoryFunction(ObjectFactory::produce, nullptr);
|
||||
} catch (const std::invalid_argument& e) {
|
||||
sif::error << "initmission::initMission: Object Construction failed with an "
|
||||
"invalid argument: "
|
||||
<< e.what();
|
||||
std::exit(1);
|
||||
}
|
||||
|
||||
sif::info << "Initializing all objects.." << std::endl;
|
||||
ObjectManager::instance()->initialize();
|
||||
|
||||
@ -115,30 +126,71 @@ void initmission::initTasks() {
|
||||
|
||||
#if OBSW_ADD_ACS_HANDLERS == 1
|
||||
PeriodicTaskIF* acsTask = factory->createPeriodicTask(
|
||||
"ACS_CTRL", 45, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.4, missedDeadlineFunc);
|
||||
"ACS_TASK", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.4, missedDeadlineFunc);
|
||||
result = acsTask->addComponent(objects::GPS_CONTROLLER);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
initmission::printAddObjectError("GPS_CTRL", objects::GPS_CONTROLLER);
|
||||
}
|
||||
|
||||
#endif /* OBSW_ADD_ACS_HANDLERS */
|
||||
|
||||
PeriodicTaskIF* sysTask = factory->createPeriodicTask(
|
||||
"SYS_TASK", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.4, missedDeadlineFunc);
|
||||
static_cast<void>(sysTask);
|
||||
#if OBSW_ADD_ACS_HANDLERS == 1
|
||||
result = sysTask->addComponent(objects::ACS_BOARD_ASS);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
initmission::printAddObjectError("ACS_BOARD_ASS", objects::ACS_BOARD_ASS);
|
||||
}
|
||||
#endif /* OBSW_ADD_ACS_HANDLERS */
|
||||
#if OBSW_ADD_RW == 1
|
||||
result = sysTask->addComponent(objects::RW_ASS);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
initmission::printAddObjectError("RW_ASS", objects::RW_ASS);
|
||||
}
|
||||
#endif
|
||||
#if OBSW_ADD_SUS_BOARD_ASS == 1
|
||||
result = sysTask->addComponent(objects::SUS_BOARD_ASS);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
initmission::printAddObjectError("SUS_BOARD_ASS", objects::SUS_BOARD_ASS);
|
||||
}
|
||||
#endif
|
||||
result = sysTask->addComponent(objects::TCS_BOARD_ASS);
|
||||
|
||||
#if OBSW_ADD_RTD_DEVICES == 1
|
||||
PeriodicTaskIF* tcsPollingTask = factory->createPeriodicTask(
|
||||
"TCS_POLLING_TASK", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.5, missedDeadlineFunc);
|
||||
result = tcsPollingTask->addComponent(objects::SPI_RTD_COM_IF);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
initmission::printAddObjectError("TCS_BOARD_ASS", objects::TCS_BOARD_ASS);
|
||||
initmission::printAddObjectError("SPI_RTD_POLLING", objects::SPI_RTD_COM_IF);
|
||||
}
|
||||
PeriodicTaskIF* tcsTask = factory->createPeriodicTask(
|
||||
"TCS_TASK", 45, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.8, missedDeadlineFunc);
|
||||
std::array<object_id_t, EiveMax31855::NUM_RTDS> rtdIds = {
|
||||
objects::RTD_0_IC3_PLOC_HEATSPREADER,
|
||||
objects::RTD_1_IC4_PLOC_MISSIONBOARD,
|
||||
objects::RTD_2_IC5_4K_CAMERA,
|
||||
objects::RTD_3_IC6_DAC_HEATSPREADER,
|
||||
objects::RTD_4_IC7_STARTRACKER,
|
||||
objects::RTD_5_IC8_RW1_MX_MY,
|
||||
objects::RTD_6_IC9_DRO,
|
||||
objects::RTD_7_IC10_SCEX,
|
||||
objects::RTD_8_IC11_X8,
|
||||
objects::RTD_9_IC12_HPA,
|
||||
objects::RTD_10_IC13_PL_TX,
|
||||
objects::RTD_11_IC14_MPA,
|
||||
objects::RTD_12_IC15_ACU,
|
||||
objects::RTD_13_IC16_PLPCDU_HEATSPREADER,
|
||||
objects::RTD_14_IC17_TCS_BOARD,
|
||||
objects::RTD_15_IC18_IMTQ,
|
||||
};
|
||||
tcsTask->addComponent(objects::TCS_BOARD_ASS);
|
||||
for (const auto& rtd : rtdIds) {
|
||||
tcsTask->addComponent(rtd, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
tcsTask->addComponent(rtd, DeviceHandlerIF::SEND_WRITE);
|
||||
tcsTask->addComponent(rtd, DeviceHandlerIF::GET_WRITE);
|
||||
tcsTask->addComponent(rtd, DeviceHandlerIF::SEND_READ);
|
||||
tcsTask->addComponent(rtd, DeviceHandlerIF::GET_READ);
|
||||
}
|
||||
#endif /* OBSW_ADD_RTD_DEVICES */
|
||||
|
||||
// FS task, task interval does not matter because it runs in permanent loop, priority low
|
||||
// because it is a non-essential background task
|
||||
@ -167,6 +219,15 @@ void initmission::initTasks() {
|
||||
}
|
||||
#endif /* OBSW_ADD_PLOC_MPSOC */
|
||||
|
||||
#if OBSW_ADD_PLOC_SUPERVISOR == 1
|
||||
PeriodicTaskIF* supvHelperTask = factory->createPeriodicTask(
|
||||
"PLOC_SUPV_HELPER", 10, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.0, missedDeadlineFunc);
|
||||
result = supvHelperTask->addComponent(objects::PLOC_SUPERVISOR_HELPER);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
initmission::printAddObjectError("PLOC_SUPV_HELPER", objects::PLOC_SUPERVISOR_HELPER);
|
||||
}
|
||||
#endif /* OBSW_ADD_PLOC_SUPERVISOR */
|
||||
|
||||
#if OBSW_TEST_CCSDS_BRIDGE == 1
|
||||
PeriodicTaskIF* ptmeTestTask = factory->createPeriodicTask(
|
||||
"PTME_TEST", 80, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc);
|
||||
@ -228,9 +289,15 @@ void initmission::initTasks() {
|
||||
|
||||
#if OBSW_ADD_ACS_HANDLERS == 1
|
||||
acsTask->startTask();
|
||||
#endif
|
||||
#endif /* OBSW_ADD_ACS_HANDLERS == 1 */
|
||||
sysTask->startTask();
|
||||
|
||||
#if OBSW_ADD_RTD_DEVICES == 1
|
||||
tcsPollingTask->startTask();
|
||||
tcsTask->startTask();
|
||||
#endif /* OBSW_ADD_RTD_DEVICES == 1 */
|
||||
#if OBSW_ADD_PLOC_SUPERVISOR == 1
|
||||
supvHelperTask->startTask();
|
||||
#endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */
|
||||
sif::info << "Tasks started.." << std::endl;
|
||||
}
|
||||
|
||||
@ -241,7 +308,7 @@ void initmission::createPstTasks(TaskFactory& factory,
|
||||
/* Polling Sequence Table Default */
|
||||
#if OBSW_ADD_SPI_TEST_CODE == 0
|
||||
FixedTimeslotTaskIF* spiPst = factory.createFixedTimeslotTask(
|
||||
"PST_TASK_DEFAULT", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 0.5, missedDeadlineFunc);
|
||||
"MAIN_SPI", 75, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 0.5, missedDeadlineFunc);
|
||||
result = pst::pstSpi(spiPst);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) {
|
||||
@ -254,8 +321,23 @@ void initmission::createPstTasks(TaskFactory& factory,
|
||||
}
|
||||
#endif
|
||||
|
||||
#if OBSW_ADD_RW == 1
|
||||
FixedTimeslotTaskIF* rwPstTask = factory.createFixedTimeslotTask(
|
||||
"RW_SPI", 65, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 1.0, missedDeadlineFunc);
|
||||
result = pst::pstSpiRw(rwPstTask);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) {
|
||||
sif::warning << "InitMission::initTasks: SPI PST is empty" << std::endl;
|
||||
} else {
|
||||
sif::error << "InitMission::initTasks: Creating SPI PST failed!" << std::endl;
|
||||
}
|
||||
} else {
|
||||
taskVec.push_back(rwPstTask);
|
||||
}
|
||||
#endif
|
||||
|
||||
FixedTimeslotTaskIF* uartPst = factory.createFixedTimeslotTask(
|
||||
"UART_PST", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 0.2, missedDeadlineFunc);
|
||||
"UART_PST", 65, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 0.2, missedDeadlineFunc);
|
||||
result = pst::pstUart(uartPst);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) {
|
||||
@ -268,7 +350,7 @@ void initmission::createPstTasks(TaskFactory& factory,
|
||||
}
|
||||
|
||||
FixedTimeslotTaskIF* gpioPst = factory.createFixedTimeslotTask(
|
||||
"GPIO_PST", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 0.2, missedDeadlineFunc);
|
||||
"GPIO_PST", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.2, missedDeadlineFunc);
|
||||
result = pst::pstGpio(gpioPst);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) {
|
||||
@ -281,7 +363,7 @@ void initmission::createPstTasks(TaskFactory& factory,
|
||||
}
|
||||
#if OBSW_ADD_I2C_TEST_CODE == 0
|
||||
FixedTimeslotTaskIF* i2cPst = factory.createFixedTimeslotTask(
|
||||
"I2C_PST", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 0.2, missedDeadlineFunc);
|
||||
"I2C_PST", 65, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 0.2, missedDeadlineFunc);
|
||||
result = pst::pstI2c(i2cPst);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) {
|
||||
@ -294,6 +376,7 @@ void initmission::createPstTasks(TaskFactory& factory,
|
||||
}
|
||||
#endif
|
||||
|
||||
#if OBSW_ADD_GOMSPACE_PCDU == 1
|
||||
FixedTimeslotTaskIF* gomSpacePstTask = factory.createFixedTimeslotTask(
|
||||
"GS_PST_TASK", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 1.0, missedDeadlineFunc);
|
||||
result = pst::pstGompaceCan(gomSpacePstTask);
|
||||
@ -303,6 +386,7 @@ void initmission::createPstTasks(TaskFactory& factory,
|
||||
}
|
||||
}
|
||||
taskVec.push_back(gomSpacePstTask);
|
||||
#endif
|
||||
}
|
||||
|
||||
void initmission::createPusTasks(TaskFactory& factory,
|
||||
@ -344,21 +428,30 @@ void initmission::createPusTasks(TaskFactory& factory,
|
||||
|
||||
PeriodicTaskIF* pusMedPrio = factory.createPeriodicTask(
|
||||
"PUS_MED_PRIO", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.8, missedDeadlineFunc);
|
||||
|
||||
result = pusMedPrio->addComponent(objects::PUS_SERVICE_3_HOUSEKEEPING);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
initmission::printAddObjectError("PUS_3", objects::PUS_SERVICE_3_HOUSEKEEPING);
|
||||
}
|
||||
result = pusMedPrio->addComponent(objects::PUS_SERVICE_8_FUNCTION_MGMT);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
initmission::printAddObjectError("PUS_8", objects::PUS_SERVICE_8_FUNCTION_MGMT);
|
||||
}
|
||||
result = pusMedPrio->addComponent(objects::PUS_SERVICE_3_HOUSEKEEPING);
|
||||
result = pusMedPrio->addComponent(objects::PUS_SERVICE_11_TC_SCHEDULER);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::error << "Object add component failed" << std::endl;
|
||||
initmission::printAddObjectError("PUS_11", objects::PUS_SERVICE_11_TC_SCHEDULER);
|
||||
}
|
||||
result = pusMedPrio->addComponent(objects::PUS_SERVICE_20_PARAMETERS);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
initmission::printAddObjectError("PUS_20", objects::PUS_SERVICE_20_PARAMETERS);
|
||||
}
|
||||
result = pusMedPrio->addComponent(objects::PUS_SERVICE_200_MODE_MGMT);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
initmission::printAddObjectError("PUS_200", objects::PUS_SERVICE_200_MODE_MGMT);
|
||||
}
|
||||
result = pusMedPrio->addComponent(objects::PUS_SERVICE_20_PARAMETERS);
|
||||
result = pusMedPrio->addComponent(objects::PUS_SERVICE_201_HEALTH);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
initmission::printAddObjectError("PUS_20", objects::PUS_SERVICE_20_PARAMETERS);
|
||||
initmission::printAddObjectError("PUS_201", objects::PUS_SERVICE_201_HEALTH);
|
||||
}
|
||||
taskVec.push_back(pusMedPrio);
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "fsfw/tasks/Typedef.h"
|
||||
#include "fsfw/tasks/definitions.h"
|
||||
|
||||
class PeriodicTaskIF;
|
||||
class TaskFactory;
|
||||
|
@ -1,8 +1,5 @@
|
||||
#include "ObjectFactory.h"
|
||||
|
||||
#include <mission/system/fdir/GomspacePowerFdir.h>
|
||||
#include <mission/system/fdir/SyrlinksFdir.h>
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
#include "bsp_q7s/boardtest/Q7STestTask.h"
|
||||
#include "bsp_q7s/callbacks/gnssCallback.h"
|
||||
@ -32,7 +29,6 @@
|
||||
#include "linux/devices/ploc/PlocMPSoCHelper.h"
|
||||
#include "linux/devices/ploc/PlocMemoryDumper.h"
|
||||
#include "linux/devices/ploc/PlocSupervisorHandler.h"
|
||||
#include "linux/devices/ploc/PlocUpdater.h"
|
||||
#include "linux/devices/startracker/StarTrackerHandler.h"
|
||||
#include "linux/devices/startracker/StrHelper.h"
|
||||
#include "linux/obc/AxiPtmeConfig.h"
|
||||
@ -40,18 +36,17 @@
|
||||
#include "linux/obc/PdecHandler.h"
|
||||
#include "linux/obc/Ptme.h"
|
||||
#include "linux/obc/PtmeConfig.h"
|
||||
#include "mission/system/SusAssembly.h"
|
||||
#include "mission/system/TcsBoardAssembly.h"
|
||||
#include "mission/system/RwAssembly.h"
|
||||
#include "mission/system/fdir/AcsBoardFdir.h"
|
||||
#include "mission/system/fdir/GomspacePowerFdir.h"
|
||||
#include "mission/system/fdir/RtdFdir.h"
|
||||
#include "mission/system/fdir/SusFdir.h"
|
||||
#include "mission/system/fdir/SyrlinksFdir.h"
|
||||
#include "tmtc/apid.h"
|
||||
#include "tmtc/pusIds.h"
|
||||
|
||||
#if OBSW_TEST_LIBGPIOD == 1
|
||||
#include "linux/boardtest/LibgpiodTest.h"
|
||||
#endif
|
||||
|
||||
#include <sstream>
|
||||
|
||||
#include "fsfw/datapoollocal/LocalDataPoolManager.h"
|
||||
@ -85,14 +80,12 @@
|
||||
#include "mission/devices/RadiationSensorHandler.h"
|
||||
#include "mission/devices/RwHandler.h"
|
||||
#include "mission/devices/SolarArrayDeploymentHandler.h"
|
||||
#include "mission/devices/SusHandler.h"
|
||||
#include "mission/devices/SyrlinksHkHandler.h"
|
||||
#include "mission/devices/Tmp1075Handler.h"
|
||||
#include "mission/devices/devicedefinitions/GomspaceDefinitions.h"
|
||||
#include "mission/devices/devicedefinitions/Max31865Definitions.h"
|
||||
#include "mission/devices/devicedefinitions/RadSensorDefinitions.h"
|
||||
#include "mission/devices/devicedefinitions/RwDefinitions.h"
|
||||
#include "mission/devices/devicedefinitions/SusDefinitions.h"
|
||||
#include "mission/devices/devicedefinitions/SyrlinksDefinitions.h"
|
||||
#include "mission/devices/devicedefinitions/payloadPcduDefinitions.h"
|
||||
#include "mission/system/AcsBoardAssembly.h"
|
||||
@ -100,10 +93,7 @@
|
||||
#include "mission/tmtc/VirtualChannel.h"
|
||||
#include "mission/utility/TmFunnel.h"
|
||||
|
||||
ResetArgs resetArgsGnss0;
|
||||
ResetArgs resetArgsGnss1;
|
||||
|
||||
void ObjectFactory::setStatics() { Factory::setStaticFrameworkObjectIds(); }
|
||||
ResetArgs RESET_ARGS_GNSS;
|
||||
|
||||
void Factory::setStaticFrameworkObjectIds() {
|
||||
PusServiceBase::packetSource = objects::PUS_PACKET_DISTRIBUTOR;
|
||||
@ -112,10 +102,13 @@ void Factory::setStaticFrameworkObjectIds() {
|
||||
CommandingServiceBase::defaultPacketSource = objects::PUS_PACKET_DISTRIBUTOR;
|
||||
CommandingServiceBase::defaultPacketDestination = objects::TM_FUNNEL;
|
||||
|
||||
#if OBSW_Q7S_EM == 1
|
||||
DeviceHandlerBase::powerSwitcherId = objects::NO_OBJECT;
|
||||
#else
|
||||
DeviceHandlerBase::powerSwitcherId = objects::PCDU_HANDLER;
|
||||
// DeviceHandlerBase::powerSwitcherId = objects::NO_OBJECT;
|
||||
#endif /* OBSW_Q7S_EM == 1 */
|
||||
|
||||
#if OBSW_TM_TO_PTME == 1
|
||||
#if OBSW_TM_TO_PTME == 1
|
||||
TmFunnel::downlinkDestination = objects::CCSDS_HANDLER;
|
||||
#else
|
||||
TmFunnel::downlinkDestination = objects::TMTC_BRIDGE;
|
||||
@ -129,92 +122,7 @@ void Factory::setStaticFrameworkObjectIds() {
|
||||
TmPacketBase::timeStamperId = objects::TIME_STAMPER;
|
||||
}
|
||||
|
||||
void ObjectFactory::produce(void* args) {
|
||||
ObjectFactory::setStatics();
|
||||
ObjectFactory::produceGenericObjects();
|
||||
|
||||
LinuxLibgpioIF* gpioComIF = nullptr;
|
||||
UartComIF* uartComIF = nullptr;
|
||||
SpiComIF* spiComIF = nullptr;
|
||||
I2cComIF* i2cComIF = nullptr;
|
||||
PowerSwitchIF* pwrSwitcher = nullptr;
|
||||
createCommunicationInterfaces(&gpioComIF, &uartComIF, &spiComIF, &i2cComIF);
|
||||
createTmpComponents();
|
||||
new CoreController(objects::CORE_CONTROLLER);
|
||||
|
||||
gpioCallbacks::disableAllDecoder(gpioComIF);
|
||||
createPcduComponents(gpioComIF, &pwrSwitcher);
|
||||
createRadSensorComponent(gpioComIF);
|
||||
createSunSensorComponents(gpioComIF, spiComIF, pwrSwitcher, q7s::SPI_DEFAULT_DEV);
|
||||
|
||||
#if OBSW_ADD_ACS_BOARD == 1
|
||||
createAcsBoardComponents(gpioComIF, uartComIF, pwrSwitcher);
|
||||
#endif
|
||||
|
||||
createHeaterComponents();
|
||||
createSolarArrayDeploymentComponents();
|
||||
createPlPcduComponents(gpioComIF, spiComIF, pwrSwitcher);
|
||||
#if OBSW_ADD_SYRLINKS == 1
|
||||
createSyrlinksComponents(pwrSwitcher);
|
||||
#endif /* OBSW_ADD_SYRLINKS == 1 */
|
||||
createRtdComponents(q7s::SPI_DEFAULT_DEV, gpioComIF, pwrSwitcher);
|
||||
createPayloadComponents(gpioComIF);
|
||||
|
||||
#if OBSW_ADD_MGT == 1
|
||||
I2cCookie* imtqI2cCookie =
|
||||
new I2cCookie(addresses::IMTQ, IMTQ::MAX_REPLY_SIZE, q7s::I2C_DEFAULT_DEV);
|
||||
auto imtqHandler = new IMTQHandler(objects::IMTQ_HANDLER, objects::I2C_COM_IF, imtqI2cCookie,
|
||||
pcdu::Switches::PDU1_CH3_MGT_5V);
|
||||
imtqHandler->setPowerSwitcher(pwrSwitcher);
|
||||
static_cast<void>(imtqHandler);
|
||||
#if OBSW_TEST_IMTQ == 1
|
||||
imtqHandler->setStartUpImmediately();
|
||||
imtqHandler->setToGoToNormal(true);
|
||||
#endif
|
||||
#if OBSW_DEBUG_IMTQ == 1
|
||||
imtqHandler->setDebugMode(true);
|
||||
#endif
|
||||
#endif
|
||||
createReactionWheelComponents(gpioComIF);
|
||||
|
||||
#if OBSW_ADD_BPX_BATTERY_HANDLER == 1
|
||||
I2cCookie* bpxI2cCookie = new I2cCookie(addresses::BPX_BATTERY, 100, q7s::I2C_DEFAULT_DEV);
|
||||
BpxBatteryHandler* bpxHandler =
|
||||
new BpxBatteryHandler(objects::BPX_BATT_HANDLER, objects::I2C_COM_IF, bpxI2cCookie);
|
||||
bpxHandler->setStartUpImmediately();
|
||||
bpxHandler->setToGoToNormalMode(true);
|
||||
#if OBSW_DEBUG_BPX_BATT == 1
|
||||
bpxHandler->setDebugMode(true);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
new FileSystemHandler(objects::FILE_SYSTEM_HANDLER);
|
||||
|
||||
#if OBSW_ADD_STAR_TRACKER == 1
|
||||
UartCookie* starTrackerCookie =
|
||||
new UartCookie(objects::STAR_TRACKER, q7s::UART_STAR_TRACKER_DEV, uart::STAR_TRACKER_BAUD,
|
||||
startracker::MAX_FRAME_SIZE * 2 + 2, UartModes::NON_CANONICAL);
|
||||
starTrackerCookie->setNoFixedSizeReply();
|
||||
StrHelper* strHelper = new StrHelper(objects::STR_HELPER);
|
||||
auto starTracker =
|
||||
new StarTrackerHandler(objects::STAR_TRACKER, objects::UART_COM_IF, starTrackerCookie,
|
||||
strHelper, pcdu::PDU1_CH2_STAR_TRACKER_5V);
|
||||
starTracker->setPowerSwitcher(pwrSwitcher);
|
||||
|
||||
#endif /* OBSW_ADD_STAR_TRACKER == 1 */
|
||||
|
||||
#if OBSW_USE_CCSDS_IP_CORE == 1
|
||||
createCcsdsComponents(gpioComIF);
|
||||
#endif /* OBSW_USE_CCSDS_IP_CORE == 1 */
|
||||
|
||||
/* Test Task */
|
||||
#if OBSW_ADD_TEST_CODE == 1
|
||||
createTestComponents(gpioComIF);
|
||||
#endif /* OBSW_ADD_TEST_CODE == 1 */
|
||||
|
||||
new PlocUpdater(objects::PLOC_UPDATER);
|
||||
new PlocMemoryDumper(objects::PLOC_MEMORY_DUMPER);
|
||||
}
|
||||
void ObjectFactory::setStatics() { Factory::setStaticFrameworkObjectIds(); }
|
||||
|
||||
void ObjectFactory::createTmpComponents() {
|
||||
I2cCookie* i2cCookieTmp1075tcs1 =
|
||||
@ -232,8 +140,10 @@ void ObjectFactory::createTmpComponents() {
|
||||
}
|
||||
|
||||
void ObjectFactory::createCommunicationInterfaces(LinuxLibgpioIF** gpioComIF, UartComIF** uartComIF,
|
||||
SpiComIF** spiComIF, I2cComIF** i2cComIF) {
|
||||
if (gpioComIF == nullptr or uartComIF == nullptr or spiComIF == nullptr) {
|
||||
SpiComIF** spiMainComIF, I2cComIF** i2cComIF,
|
||||
SpiComIF** spiRWComIF) {
|
||||
if (gpioComIF == nullptr or uartComIF == nullptr or spiMainComIF == nullptr or
|
||||
spiRWComIF == nullptr) {
|
||||
sif::error << "ObjectFactory::createCommunicationInterfaces: Invalid passed ComIF pointer"
|
||||
<< std::endl;
|
||||
}
|
||||
@ -243,8 +153,8 @@ void ObjectFactory::createCommunicationInterfaces(LinuxLibgpioIF** gpioComIF, Ua
|
||||
new CspComIF(objects::CSP_COM_IF);
|
||||
*i2cComIF = new I2cComIF(objects::I2C_COM_IF);
|
||||
*uartComIF = new UartComIF(objects::UART_COM_IF);
|
||||
*spiComIF = new SpiComIF(objects::SPI_COM_IF, *gpioComIF);
|
||||
|
||||
*spiMainComIF = new SpiComIF(objects::SPI_MAIN_COM_IF, q7s::SPI_DEFAULT_DEV, *gpioComIF);
|
||||
*spiRWComIF = new SpiComIF(objects::SPI_RW_COM_IF, q7s::SPI_RW_DEV, *gpioComIF);
|
||||
/* Adding gpios for chip select decoding to the gpioComIf */
|
||||
q7s::gpioCallbacks::initSpiCsDecoder(*gpioComIF);
|
||||
}
|
||||
@ -302,12 +212,13 @@ void ObjectFactory::createRadSensorComponent(LinuxLibgpioIF* gpioComIF) {
|
||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::ENABLE_RADFET, consumer.str(), Direction::OUT,
|
||||
Levels::LOW);
|
||||
gpioCookieRadSensor->addGpio(gpioIds::ENABLE_RADFET, gpio);
|
||||
gpioComIF->addGpios(gpioCookieRadSensor);
|
||||
gpioChecker(gpioComIF->addGpios(gpioCookieRadSensor), "RAD sensor");
|
||||
|
||||
SpiCookie* spiCookieRadSensor = new SpiCookie(
|
||||
addresses::RAD_SENSOR, gpioIds::CS_RAD_SENSOR, std::string(q7s::SPI_DEFAULT_DEV),
|
||||
RAD_SENSOR::READ_SIZE, spi::DEFAULT_MAX_1227_MODE, spi::DEFAULT_MAX_1227_SPEED);
|
||||
auto radSensor = new RadiationSensorHandler(objects::RAD_SENSOR, objects::SPI_COM_IF,
|
||||
SpiCookie* spiCookieRadSensor =
|
||||
new SpiCookie(addresses::RAD_SENSOR, gpioIds::CS_RAD_SENSOR, RAD_SENSOR::READ_SIZE,
|
||||
spi::DEFAULT_MAX_1227_MODE, spi::DEFAULT_MAX_1227_SPEED);
|
||||
spiCookieRadSensor->setMutexParams(MutexIF::TimeoutType::WAITING, spi::RAD_SENSOR_CS_TIMEOUT);
|
||||
auto radSensor = new RadiationSensorHandler(objects::RAD_SENSOR, objects::SPI_MAIN_COM_IF,
|
||||
spiCookieRadSensor, gpioComIF);
|
||||
static_cast<void>(radSensor);
|
||||
// The radiation sensor ADC is powered by the 5V stack connector which should always be on
|
||||
@ -418,16 +329,16 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
|
||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::GNSS_SELECT, consumer.str(), Direction::OUT,
|
||||
Levels::LOW);
|
||||
gpioCookieAcsBoard->addGpio(gpioIds::GNSS_SELECT, gpio);
|
||||
gpioComIF->addGpios(gpioCookieAcsBoard);
|
||||
gpioChecker(gpioComIF->addGpios(gpioCookieAcsBoard), "ACS Board");
|
||||
AcsBoardFdir* fdir = nullptr;
|
||||
static_cast<void>(fdir);
|
||||
|
||||
#if OBSW_ADD_ACS_HANDLERS == 1
|
||||
std::string spiDev = q7s::SPI_DEFAULT_DEV;
|
||||
SpiCookie* spiCookie =
|
||||
new SpiCookie(addresses::MGM_0_LIS3, gpioIds::MGM_0_LIS3_CS, spiDev,
|
||||
MGMLIS3MDL::MAX_BUFFER_SIZE, spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED);
|
||||
auto mgmLis3Handler = new MgmLIS3MDLHandler(objects::MGM_0_LIS3_HANDLER, objects::SPI_COM_IF,
|
||||
new SpiCookie(addresses::MGM_0_LIS3, gpioIds::MGM_0_LIS3_CS, MGMLIS3MDL::MAX_BUFFER_SIZE,
|
||||
spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED);
|
||||
auto mgmLis3Handler = new MgmLIS3MDLHandler(objects::MGM_0_LIS3_HANDLER, objects::SPI_MAIN_COM_IF,
|
||||
spiCookie, spi::LIS3_TRANSITION_DELAY);
|
||||
fdir = new AcsBoardFdir(objects::MGM_0_LIS3_HANDLER);
|
||||
mgmLis3Handler->setCustomFdir(fdir);
|
||||
@ -439,12 +350,12 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
|
||||
#if OBSW_DEBUG_ACS == 1
|
||||
mgmLis3Handler->enablePeriodicPrintouts(true, 10);
|
||||
#endif
|
||||
|
||||
spiCookie =
|
||||
new SpiCookie(addresses::MGM_1_RM3100, gpioIds::MGM_1_RM3100_CS, spiDev,
|
||||
RM3100::MAX_BUFFER_SIZE, spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED);
|
||||
auto mgmRm3100Handler = new MgmRM3100Handler(objects::MGM_1_RM3100_HANDLER, objects::SPI_COM_IF,
|
||||
spiCookie, spi::RM3100_TRANSITION_DELAY);
|
||||
new SpiCookie(addresses::MGM_1_RM3100, gpioIds::MGM_1_RM3100_CS, RM3100::MAX_BUFFER_SIZE,
|
||||
spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED);
|
||||
auto mgmRm3100Handler =
|
||||
new MgmRM3100Handler(objects::MGM_1_RM3100_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie,
|
||||
spi::RM3100_TRANSITION_DELAY);
|
||||
fdir = new AcsBoardFdir(objects::MGM_1_RM3100_HANDLER);
|
||||
mgmRm3100Handler->setCustomFdir(fdir);
|
||||
mgmRm3100Handler->setParent(objects::ACS_BOARD_ASS);
|
||||
@ -456,11 +367,10 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
|
||||
#if OBSW_DEBUG_ACS == 1
|
||||
mgmRm3100Handler->enablePeriodicPrintouts(true, 10);
|
||||
#endif
|
||||
|
||||
spiCookie =
|
||||
new SpiCookie(addresses::MGM_2_LIS3, gpioIds::MGM_2_LIS3_CS, spiDev,
|
||||
MGMLIS3MDL::MAX_BUFFER_SIZE, spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED);
|
||||
mgmLis3Handler = new MgmLIS3MDLHandler(objects::MGM_2_LIS3_HANDLER, objects::SPI_COM_IF,
|
||||
new SpiCookie(addresses::MGM_2_LIS3, gpioIds::MGM_2_LIS3_CS, MGMLIS3MDL::MAX_BUFFER_SIZE,
|
||||
spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED);
|
||||
mgmLis3Handler = new MgmLIS3MDLHandler(objects::MGM_2_LIS3_HANDLER, objects::SPI_MAIN_COM_IF,
|
||||
spiCookie, spi::LIS3_TRANSITION_DELAY);
|
||||
fdir = new AcsBoardFdir(objects::MGM_2_LIS3_HANDLER);
|
||||
mgmLis3Handler->setCustomFdir(fdir);
|
||||
@ -474,9 +384,9 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
|
||||
mgmLis3Handler->enablePeriodicPrintouts(true, 10);
|
||||
#endif
|
||||
spiCookie =
|
||||
new SpiCookie(addresses::MGM_3_RM3100, gpioIds::MGM_3_RM3100_CS, spiDev,
|
||||
RM3100::MAX_BUFFER_SIZE, spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED);
|
||||
mgmRm3100Handler = new MgmRM3100Handler(objects::MGM_3_RM3100_HANDLER, objects::SPI_COM_IF,
|
||||
new SpiCookie(addresses::MGM_3_RM3100, gpioIds::MGM_3_RM3100_CS, RM3100::MAX_BUFFER_SIZE,
|
||||
spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED);
|
||||
mgmRm3100Handler = new MgmRM3100Handler(objects::MGM_3_RM3100_HANDLER, objects::SPI_MAIN_COM_IF,
|
||||
spiCookie, spi::RM3100_TRANSITION_DELAY);
|
||||
fdir = new AcsBoardFdir(objects::MGM_3_RM3100_HANDLER);
|
||||
mgmRm3100Handler->setCustomFdir(fdir);
|
||||
@ -488,14 +398,14 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
|
||||
#if OBSW_DEBUG_ACS == 1
|
||||
mgmRm3100Handler->enablePeriodicPrintouts(true, 10);
|
||||
#endif
|
||||
|
||||
// Commented until ACS board V2 in in clean room again
|
||||
// Gyro 0 Side A
|
||||
spiCookie = new SpiCookie(addresses::GYRO_0_ADIS, gpioIds::GYRO_0_ADIS_CS, spiDev,
|
||||
ADIS1650X::MAXIMUM_REPLY_SIZE, spi::DEFAULT_ADIS16507_MODE,
|
||||
spi::DEFAULT_ADIS16507_SPEED);
|
||||
auto adisHandler = new GyroADIS1650XHandler(objects::GYRO_0_ADIS_HANDLER, objects::SPI_COM_IF,
|
||||
spiCookie, ADIS1650X::Type::ADIS16505);
|
||||
spiCookie =
|
||||
new SpiCookie(addresses::GYRO_0_ADIS, gpioIds::GYRO_0_ADIS_CS, ADIS1650X::MAXIMUM_REPLY_SIZE,
|
||||
spi::DEFAULT_ADIS16507_MODE, spi::DEFAULT_ADIS16507_SPEED);
|
||||
auto adisHandler =
|
||||
new GyroADIS1650XHandler(objects::GYRO_0_ADIS_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie,
|
||||
ADIS1650X::Type::ADIS16505);
|
||||
fdir = new AcsBoardFdir(objects::GYRO_0_ADIS_HANDLER);
|
||||
adisHandler->setCustomFdir(fdir);
|
||||
adisHandler->setParent(objects::ACS_BOARD_ASS);
|
||||
@ -507,13 +417,11 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
|
||||
#if OBSW_DEBUG_ACS == 1
|
||||
adisHandler->enablePeriodicPrintouts(true, 10);
|
||||
#endif
|
||||
|
||||
// Gyro 1 Side A
|
||||
spiCookie =
|
||||
new SpiCookie(addresses::GYRO_1_L3G, gpioIds::GYRO_1_L3G_CS, spiDev, L3GD20H::MAX_BUFFER_SIZE,
|
||||
spiCookie = new SpiCookie(addresses::GYRO_1_L3G, gpioIds::GYRO_1_L3G_CS, L3GD20H::MAX_BUFFER_SIZE,
|
||||
spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED);
|
||||
auto gyroL3gHandler = new GyroHandlerL3GD20H(objects::GYRO_1_L3G_HANDLER, objects::SPI_COM_IF,
|
||||
spiCookie, spi::L3G_TRANSITION_DELAY);
|
||||
auto gyroL3gHandler = new GyroHandlerL3GD20H(
|
||||
objects::GYRO_1_L3G_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, spi::L3G_TRANSITION_DELAY);
|
||||
fdir = new AcsBoardFdir(objects::GYRO_1_L3G_HANDLER);
|
||||
gyroL3gHandler->setCustomFdir(fdir);
|
||||
gyroL3gHandler->setParent(objects::ACS_BOARD_ASS);
|
||||
@ -525,12 +433,11 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
|
||||
#if OBSW_DEBUG_ACS == 1
|
||||
gyroL3gHandler->enablePeriodicPrintouts(true, 10);
|
||||
#endif
|
||||
|
||||
// Gyro 2 Side B
|
||||
spiCookie = new SpiCookie(addresses::GYRO_2_ADIS, gpioIds::GYRO_2_ADIS_CS, spiDev,
|
||||
ADIS1650X::MAXIMUM_REPLY_SIZE, spi::DEFAULT_ADIS16507_MODE,
|
||||
spi::DEFAULT_ADIS16507_SPEED);
|
||||
adisHandler = new GyroADIS1650XHandler(objects::GYRO_2_ADIS_HANDLER, objects::SPI_COM_IF,
|
||||
spiCookie =
|
||||
new SpiCookie(addresses::GYRO_2_ADIS, gpioIds::GYRO_2_ADIS_CS, ADIS1650X::MAXIMUM_REPLY_SIZE,
|
||||
spi::DEFAULT_ADIS16507_MODE, spi::DEFAULT_ADIS16507_SPEED);
|
||||
adisHandler = new GyroADIS1650XHandler(objects::GYRO_2_ADIS_HANDLER, objects::SPI_MAIN_COM_IF,
|
||||
spiCookie, ADIS1650X::Type::ADIS16505);
|
||||
fdir = new AcsBoardFdir(objects::GYRO_2_ADIS_HANDLER);
|
||||
adisHandler->setCustomFdir(fdir);
|
||||
@ -540,10 +447,9 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
|
||||
adisHandler->setToGoToNormalModeImmediately();
|
||||
#endif
|
||||
// Gyro 3 Side B
|
||||
spiCookie =
|
||||
new SpiCookie(addresses::GYRO_3_L3G, gpioIds::GYRO_3_L3G_CS, spiDev, L3GD20H::MAX_BUFFER_SIZE,
|
||||
spiCookie = new SpiCookie(addresses::GYRO_3_L3G, gpioIds::GYRO_3_L3G_CS, L3GD20H::MAX_BUFFER_SIZE,
|
||||
spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED);
|
||||
gyroL3gHandler = new GyroHandlerL3GD20H(objects::GYRO_3_L3G_HANDLER, objects::SPI_COM_IF,
|
||||
gyroL3gHandler = new GyroHandlerL3GD20H(objects::GYRO_3_L3G_HANDLER, objects::SPI_MAIN_COM_IF,
|
||||
spiCookie, spi::L3G_TRANSITION_DELAY);
|
||||
fdir = new AcsBoardFdir(objects::GYRO_3_L3G_HANDLER);
|
||||
gyroL3gHandler->setCustomFdir(fdir);
|
||||
@ -555,20 +461,15 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
|
||||
#if OBSW_DEBUG_ACS == 1
|
||||
gyroL3gHandler->enablePeriodicPrintouts(true, 10);
|
||||
#endif
|
||||
|
||||
bool debugGps = false;
|
||||
#if OBSW_DEBUG_GPS == 1
|
||||
debugGps = true;
|
||||
#endif
|
||||
resetArgsGnss1.gnss1 = true;
|
||||
resetArgsGnss1.gpioComIF = gpioComIF;
|
||||
resetArgsGnss1.waitPeriodMs = 100;
|
||||
resetArgsGnss0.gnss1 = false;
|
||||
resetArgsGnss0.gpioComIF = gpioComIF;
|
||||
resetArgsGnss0.waitPeriodMs = 100;
|
||||
auto gpsHandler0 =
|
||||
RESET_ARGS_GNSS.gpioComIF = gpioComIF;
|
||||
RESET_ARGS_GNSS.waitPeriodMs = 100;
|
||||
auto gpsCtrl =
|
||||
new GPSHyperionLinuxController(objects::GPS_CONTROLLER, objects::NO_OBJECT, debugGps);
|
||||
gpsHandler0->setResetPinTriggerFunction(gps::triggerGpioResetPin, &resetArgsGnss0);
|
||||
gpsCtrl->setResetPinTriggerFunction(gps::triggerGpioResetPin, &RESET_ARGS_GNSS);
|
||||
|
||||
AcsBoardHelper acsBoardHelper = AcsBoardHelper(
|
||||
objects::MGM_0_LIS3_HANDLER, objects::MGM_1_RM3100_HANDLER, objects::MGM_2_LIS3_HANDLER,
|
||||
@ -580,7 +481,8 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
|
||||
#endif /* OBSW_ADD_ACS_HANDLERS == 1 */
|
||||
}
|
||||
|
||||
void ObjectFactory::createHeaterComponents() {
|
||||
void ObjectFactory::createHeaterComponents(GpioIF* gpioIF, PowerSwitchIF* pwrSwitcher,
|
||||
HealthTableIF* healthTable) {
|
||||
using namespace gpio;
|
||||
GpioCookie* heaterGpiosCookie = new GpioCookie;
|
||||
GpiodRegularByLineName* gpio = nullptr;
|
||||
@ -621,8 +523,21 @@ void ObjectFactory::createHeaterComponents() {
|
||||
Levels::LOW);
|
||||
heaterGpiosCookie->addGpio(gpioIds::HEATER_7, gpio);
|
||||
|
||||
new HeaterHandler(objects::HEATER_HANDLER, objects::GPIO_IF, heaterGpiosCookie,
|
||||
objects::PCDU_HANDLER, pcdu::Switches::PDU2_CH3_TCS_BOARD_HEATER_IN_8V);
|
||||
gpioIF->addGpios(heaterGpiosCookie);
|
||||
|
||||
HeaterHelper helper({{
|
||||
{new HealthDevice(objects::HEATER_0_PLOC_PROC_BRD, MessageQueueIF::NO_QUEUE),
|
||||
gpioIds::HEATER_0},
|
||||
{new HealthDevice(objects::HEATER_1_PCDU_BRD, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_1},
|
||||
{new HealthDevice(objects::HEATER_2_ACS_BRD, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_2},
|
||||
{new HealthDevice(objects::HEATER_3_OBC_BRD, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_3},
|
||||
{new HealthDevice(objects::HEATER_4_CAMERA, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_4},
|
||||
{new HealthDevice(objects::HEATER_5_STR, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_5},
|
||||
{new HealthDevice(objects::HEATER_6_DRO, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_6},
|
||||
{new HealthDevice(objects::HEATER_7_HPA, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_7},
|
||||
}});
|
||||
new HeaterHandler(objects::HEATER_HANDLER, gpioIF, helper, pwrSwitcher,
|
||||
pcdu::Switches::PDU2_CH3_TCS_BOARD_HEATER_IN_8V);
|
||||
}
|
||||
|
||||
void ObjectFactory::createSolarArrayDeploymentComponents() {
|
||||
@ -671,7 +586,7 @@ void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF) {
|
||||
consumer.str(), Direction::OUT, Levels::HIGH);
|
||||
auto mpsocGpioCookie = new GpioCookie;
|
||||
mpsocGpioCookie->addGpio(gpioIds::ENABLE_MPSOC_UART, gpioConfigMPSoC);
|
||||
gpioComIF->addGpios(mpsocGpioCookie);
|
||||
gpioChecker(gpioComIF->addGpios(mpsocGpioCookie), "PLOC MPSoC");
|
||||
auto mpsocCookie =
|
||||
new UartCookie(objects::PLOC_MPSOC_HANDLER, q7s::UART_PLOC_MPSOC_DEV, uart::PLOC_MPSOC_BAUD,
|
||||
mpsoc::MAX_REPLY_SIZE, UartModes::NON_CANONICAL);
|
||||
@ -681,26 +596,27 @@ void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF) {
|
||||
plocMpsocHelper, Gpio(gpioIds::ENABLE_MPSOC_UART, gpioComIF),
|
||||
objects::PLOC_SUPERVISOR_HANDLER);
|
||||
#endif /* OBSW_ADD_PLOC_MPSOC == 1 */
|
||||
|
||||
#if OBSW_ADD_PLOC_SUPERVISOR == 1
|
||||
consumer << "0x" << std::hex << objects::PLOC_SUPERVISOR_HANDLER;
|
||||
auto gpioConfigSupv = new GpiodRegularByLineName(q7s::gpioNames::ENABLE_SUPV_UART, consumer.str(),
|
||||
Direction::OUT, Levels::HIGH);
|
||||
Direction::OUT, Levels::LOW);
|
||||
auto supvGpioCookie = new GpioCookie;
|
||||
supvGpioCookie->addGpio(gpioIds::ENABLE_SUPV_UART, gpioConfigSupv);
|
||||
gpioComIF->addGpios(supvGpioCookie);
|
||||
auto supervisorCookie = new UartCookie(objects::PLOC_SUPERVISOR_HANDLER,
|
||||
q7s::UART_PLOC_SUPERVSIOR_DEV, uart::PLOC_SUPERVISOR_BAUD,
|
||||
supv::MAX_PACKET_SIZE * 20, UartModes::NON_CANONICAL);
|
||||
auto supervisorCookie =
|
||||
new UartCookie(objects::PLOC_SUPERVISOR_HANDLER, q7s::UART_PLOC_SUPERVSIOR_DEV,
|
||||
uart::PLOC_SUPV_BAUD, supv::MAX_PACKET_SIZE * 20, UartModes::NON_CANONICAL);
|
||||
supervisorCookie->setNoFixedSizeReply();
|
||||
auto supvHelper = new PlocSupvHelper(objects::PLOC_SUPERVISOR_HELPER);
|
||||
new PlocSupervisorHandler(objects::PLOC_SUPERVISOR_HANDLER, objects::UART_COM_IF,
|
||||
supervisorCookie, Gpio(gpioIds::ENABLE_SUPV_UART, gpioComIF),
|
||||
pcdu::PDU1_CH6_PLOC_12V);
|
||||
pcdu::PDU1_CH6_PLOC_12V, supvHelper);
|
||||
#endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */
|
||||
static_cast<void>(consumer);
|
||||
}
|
||||
|
||||
void ObjectFactory::createReactionWheelComponents(LinuxLibgpioIF* gpioComIF) {
|
||||
void ObjectFactory::createReactionWheelComponents(LinuxLibgpioIF* gpioComIF,
|
||||
PowerSwitchIF* pwrSwitcher) {
|
||||
using namespace gpio;
|
||||
GpioCookie* gpioCookieRw = new GpioCookie;
|
||||
GpioCallback* csRw1 =
|
||||
@ -742,54 +658,38 @@ void ObjectFactory::createReactionWheelComponents(LinuxLibgpioIF* gpioComIF) {
|
||||
Levels::LOW);
|
||||
gpioCookieRw->addGpio(gpioIds::EN_RW4, gpio);
|
||||
|
||||
gpioComIF->addGpios(gpioCookieRw);
|
||||
gpioChecker(gpioComIF->addGpios(gpioCookieRw), "RWs");
|
||||
|
||||
#if OBSW_ADD_RW == 1
|
||||
auto rw1SpiCookie =
|
||||
new SpiCookie(addresses::RW1, gpioIds::CS_RW1, q7s::SPI_RW_DEV, RwDefinitions::MAX_REPLY_SIZE,
|
||||
spi::RW_MODE, spi::RW_SPEED, &rwSpiCallback::spiCallback, nullptr);
|
||||
auto rw2SpiCookie =
|
||||
new SpiCookie(addresses::RW2, gpioIds::CS_RW2, q7s::SPI_RW_DEV, RwDefinitions::MAX_REPLY_SIZE,
|
||||
spi::RW_MODE, spi::RW_SPEED, &rwSpiCallback::spiCallback, nullptr);
|
||||
auto rw3SpiCookie =
|
||||
new SpiCookie(addresses::RW3, gpioIds::CS_RW3, q7s::SPI_RW_DEV, RwDefinitions::MAX_REPLY_SIZE,
|
||||
spi::RW_MODE, spi::RW_SPEED, &rwSpiCallback::spiCallback, nullptr);
|
||||
auto rw4SpiCookie =
|
||||
new SpiCookie(addresses::RW4, gpioIds::CS_RW4, q7s::SPI_RW_DEV, RwDefinitions::MAX_REPLY_SIZE,
|
||||
spi::RW_MODE, spi::RW_SPEED, &rwSpiCallback::spiCallback, nullptr);
|
||||
|
||||
auto rwHandler1 =
|
||||
new RwHandler(objects::RW1, objects::SPI_COM_IF, rw1SpiCookie, gpioComIF, gpioIds::EN_RW1);
|
||||
rw1SpiCookie->setCallbackArgs(rwHandler1);
|
||||
#if OBSW_DEBUG_RW == 1
|
||||
rwHandler1->setStartUpImmediately();
|
||||
rwHandler1->setDebugMode(true);
|
||||
std::array<std::pair<address_t, gpioId_t>, 4> rwCookieParams = {
|
||||
{{addresses::RW1, gpioIds::CS_RW1},
|
||||
{addresses::RW2, gpioIds::CS_RW2},
|
||||
{addresses::RW3, gpioIds::CS_RW3},
|
||||
{addresses::RW4, gpioIds::CS_RW4}}};
|
||||
std::array<SpiCookie*, 4> rwCookies = {};
|
||||
std::array<object_id_t, 4> rwIds = {objects::RW1, objects::RW2, objects::RW3, objects::RW4};
|
||||
std::array<gpioId_t, 4> rwGpioIds = {gpioIds::EN_RW1, gpioIds::EN_RW2, gpioIds::EN_RW3,
|
||||
gpioIds::EN_RW4};
|
||||
std::array<RwHandler*, 4> rws = {};
|
||||
for (uint8_t idx = 0; idx < rwCookies.size(); idx++) {
|
||||
rwCookies[idx] = new SpiCookie(rwCookieParams[idx].first, rwCookieParams[idx].second,
|
||||
RwDefinitions::MAX_REPLY_SIZE, spi::RW_MODE, spi::RW_SPEED,
|
||||
&rwSpiCallback::spiCallback, nullptr);
|
||||
rws[idx] = new RwHandler(rwIds[idx], objects::SPI_RW_COM_IF, rwCookies[idx], gpioComIF,
|
||||
rwGpioIds[idx]);
|
||||
rwCookies[idx]->setCallbackArgs(rws[idx]);
|
||||
#if OBSW_TEST_RW == 1
|
||||
rws[idx]->setStartUpImmediately();
|
||||
#endif
|
||||
|
||||
auto rwHandler2 =
|
||||
new RwHandler(objects::RW2, objects::SPI_COM_IF, rw2SpiCookie, gpioComIF, gpioIds::EN_RW2);
|
||||
rw2SpiCookie->setCallbackArgs(rwHandler2);
|
||||
#if OBSW_DEBUG_RW == 1
|
||||
rwHandler2->setStartUpImmediately();
|
||||
rwHandler2->setDebugMode(true);
|
||||
#endif
|
||||
|
||||
auto rwHandler3 =
|
||||
new RwHandler(objects::RW3, objects::SPI_COM_IF, rw3SpiCookie, gpioComIF, gpioIds::EN_RW3);
|
||||
rw3SpiCookie->setCallbackArgs(rwHandler3);
|
||||
#if OBSW_DEBUG_RW == 1
|
||||
rwHandler3->setStartUpImmediately();
|
||||
rwHandler3->setDebugMode(true);
|
||||
#endif
|
||||
|
||||
auto rwHandler4 =
|
||||
new RwHandler(objects::RW4, objects::SPI_COM_IF, rw4SpiCookie, gpioComIF, gpioIds::EN_RW4);
|
||||
rw4SpiCookie->setCallbackArgs(rwHandler4);
|
||||
#if OBSW_DEBUG_RW == 1
|
||||
rwHandler4->setStartUpImmediately();
|
||||
rwHandler4->setDebugMode(true);
|
||||
rws[idx]->setDebugMode(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
RwHelper rwHelper(rwIds);
|
||||
auto* rwAss = new RwAssembly(objects::RW_ASS, objects::NO_OBJECT, pwrSwitcher,
|
||||
pcdu::Switches::PDU2_CH2_RW_5V, rwHelper);
|
||||
static_cast<void>(rwAss);
|
||||
#endif /* OBSW_ADD_RW == 1 */
|
||||
}
|
||||
|
||||
@ -828,7 +728,7 @@ void ObjectFactory::createCcsdsComponents(LinuxLibgpioIF* gpioComIF) {
|
||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_EMPTY_SIGNAL_VC3, consumer.str());
|
||||
gpioCookiePtmeIp->addGpio(gpioIds::VC3_PAPB_EMPTY, gpio);
|
||||
|
||||
gpioComIF->addGpios(gpioCookiePtmeIp);
|
||||
gpioChecker(gpioComIF->addGpios(gpioCookiePtmeIp), "PTME PAPB VCs");
|
||||
|
||||
// Creating virtual channel interfaces
|
||||
VcInterfaceIF* vc0 =
|
||||
@ -882,7 +782,7 @@ void ObjectFactory::createCcsdsComponents(LinuxLibgpioIF* gpioComIF) {
|
||||
Levels::LOW);
|
||||
gpioCookiePdec->addGpio(gpioIds::PDEC_RESET, gpio);
|
||||
|
||||
gpioComIF->addGpios(gpioCookiePdec);
|
||||
gpioChecker(gpioComIF->addGpios(gpioCookiePdec), "PDEC");
|
||||
|
||||
new PdecHandler(objects::PDEC_HANDLER, objects::CCSDS_HANDLER, gpioComIF, gpioIds::PDEC_RESET,
|
||||
q7s::UIO_PDEC_CONFIG_MEMORY, q7s::UIO_PDEC_RAM, q7s::UIO_PDEC_REGISTERS);
|
||||
@ -903,7 +803,7 @@ void ObjectFactory::createCcsdsComponents(LinuxLibgpioIF* gpioComIF) {
|
||||
Direction::OUT, Levels::LOW);
|
||||
gpioRS485Chip->addGpio(gpioIds::RS485_EN_RX_DATA, gpio);
|
||||
|
||||
gpioComIF->addGpios(gpioRS485Chip);
|
||||
gpioChecker(gpioComIF->addGpios(gpioRS485Chip), "RS485 Transceiver");
|
||||
}
|
||||
|
||||
void ObjectFactory::createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF,
|
||||
@ -948,14 +848,14 @@ void ObjectFactory::createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF*
|
||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::PL_PCDU_ADC_CS, consumer, Direction::OUT,
|
||||
gpio::Levels::HIGH);
|
||||
plPcduGpios->addGpio(gpioIds::PLPCDU_ADC_CS, gpio);
|
||||
gpioComIF->addGpios(plPcduGpios);
|
||||
SpiCookie* spiCookie = new SpiCookie(addresses::PLPCDU_ADC, gpioIds::PLPCDU_ADC_CS,
|
||||
q7s::SPI_DEFAULT_DEV, plpcdu::MAX_ADC_REPLY_SIZE,
|
||||
gpioChecker(gpioComIF->addGpios(plPcduGpios), "PL PCDU");
|
||||
SpiCookie* spiCookie =
|
||||
new SpiCookie(addresses::PLPCDU_ADC, gpioIds::PLPCDU_ADC_CS, plpcdu::MAX_ADC_REPLY_SIZE,
|
||||
spi::DEFAULT_MAX_1227_MODE, spi::PL_PCDU_MAX_1227_SPEED);
|
||||
// Create device handler components
|
||||
auto plPcduHandler = new PayloadPcduHandler(
|
||||
objects::PLPCDU_HANDLER, objects::SPI_COM_IF, spiCookie, gpioComIF, SdCardManager::instance(),
|
||||
pwrSwitcher, pcdu::Switches::PDU2_CH1_PL_PCDU_BATT_0_14V8,
|
||||
objects::PLPCDU_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, gpioComIF,
|
||||
SdCardManager::instance(), pwrSwitcher, pcdu::Switches::PDU2_CH1_PL_PCDU_BATT_0_14V8,
|
||||
pcdu::Switches::PDU2_CH6_PL_PCDU_BATT_1_14V8, false);
|
||||
spiCookie->setCallbackMode(PayloadPcduHandler::extConvAsTwoCallback, plPcduHandler);
|
||||
// plPcduHandler->enablePeriodicPrintout(true, 5);
|
||||
@ -982,6 +882,50 @@ void ObjectFactory::createTestComponents(LinuxLibgpioIF* gpioComIF) {
|
||||
#endif
|
||||
}
|
||||
|
||||
void ObjectFactory::createStrComponents(PowerSwitchIF* pwrSwitcher) {
|
||||
UartCookie* starTrackerCookie =
|
||||
new UartCookie(objects::STAR_TRACKER, q7s::UART_STAR_TRACKER_DEV, uart::STAR_TRACKER_BAUD,
|
||||
startracker::MAX_FRAME_SIZE * 2 + 2, UartModes::NON_CANONICAL);
|
||||
starTrackerCookie->setNoFixedSizeReply();
|
||||
StrHelper* strHelper = new StrHelper(objects::STR_HELPER);
|
||||
auto starTracker =
|
||||
new StarTrackerHandler(objects::STAR_TRACKER, objects::UART_COM_IF, starTrackerCookie,
|
||||
strHelper, pcdu::PDU1_CH2_STAR_TRACKER_5V);
|
||||
starTracker->setPowerSwitcher(pwrSwitcher);
|
||||
}
|
||||
|
||||
void ObjectFactory::createImtqComponents(PowerSwitchIF* pwrSwitcher) {
|
||||
I2cCookie* imtqI2cCookie =
|
||||
new I2cCookie(addresses::IMTQ, IMTQ::MAX_REPLY_SIZE, q7s::I2C_DEFAULT_DEV);
|
||||
auto imtqHandler = new IMTQHandler(objects::IMTQ_HANDLER, objects::I2C_COM_IF, imtqI2cCookie,
|
||||
pcdu::Switches::PDU1_CH3_MGT_5V);
|
||||
imtqHandler->setPowerSwitcher(pwrSwitcher);
|
||||
static_cast<void>(imtqHandler);
|
||||
#if OBSW_TEST_IMTQ == 1
|
||||
imtqHandler->setStartUpImmediately();
|
||||
imtqHandler->setToGoToNormal(true);
|
||||
#endif
|
||||
#if OBSW_DEBUG_IMTQ == 1
|
||||
imtqHandler->setDebugMode(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
void ObjectFactory::createBpxBatteryComponent() {
|
||||
I2cCookie* bpxI2cCookie = new I2cCookie(addresses::BPX_BATTERY, 100, q7s::I2C_DEFAULT_DEV);
|
||||
BpxBatteryHandler* bpxHandler =
|
||||
new BpxBatteryHandler(objects::BPX_BATT_HANDLER, objects::I2C_COM_IF, bpxI2cCookie);
|
||||
bpxHandler->setStartUpImmediately();
|
||||
bpxHandler->setToGoToNormalMode(true);
|
||||
#if OBSW_DEBUG_BPX_BATT == 1
|
||||
bpxHandler->setDebugMode(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
void ObjectFactory::createMiscComponents() {
|
||||
new FileSystemHandler(objects::FILE_SYSTEM_HANDLER);
|
||||
new PlocMemoryDumper(objects::PLOC_MEMORY_DUMPER);
|
||||
}
|
||||
|
||||
void ObjectFactory::testAcsBrdAss(AcsBoardAssembly* acsAss) {
|
||||
CommandMessage msg;
|
||||
ModeMessage::setModeMessage(&msg, ModeMessage::CMD_MODE_COMMAND, DeviceHandlerIF::MODE_NORMAL,
|
||||
|
@ -1,12 +1,18 @@
|
||||
#ifndef BSP_Q7S_OBJECTFACTORY_H_
|
||||
#define BSP_Q7S_OBJECTFACTORY_H_
|
||||
|
||||
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
class LinuxLibgpioIF;
|
||||
class UartComIF;
|
||||
class SpiComIF;
|
||||
class I2cComIF;
|
||||
class PowerSwitchIF;
|
||||
class HealthTableIF;
|
||||
class AcsBoardAssembly;
|
||||
class GpioIF;
|
||||
|
||||
namespace ObjectFactory {
|
||||
|
||||
@ -14,7 +20,8 @@ void setStatics();
|
||||
void produce(void* args);
|
||||
|
||||
void createCommunicationInterfaces(LinuxLibgpioIF** gpioComIF, UartComIF** uartComIF,
|
||||
SpiComIF** spiComIF, I2cComIF** i2cComIF);
|
||||
SpiComIF** spiMainComIF, I2cComIF** i2cComIF,
|
||||
SpiComIF** spiRwComIF);
|
||||
void createPcduComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchIF** pwrSwitcher);
|
||||
void createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF,
|
||||
PowerSwitchIF* pwrSwitcher);
|
||||
@ -22,12 +29,17 @@ void createTmpComponents();
|
||||
void createRadSensorComponent(LinuxLibgpioIF* gpioComIF);
|
||||
void createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComIF* uartComIF,
|
||||
PowerSwitchIF* pwrSwitcher);
|
||||
void createHeaterComponents();
|
||||
void createHeaterComponents(GpioIF* gpioIF, PowerSwitchIF* pwrSwitcher, HealthTableIF* healthTable);
|
||||
void createImtqComponents(PowerSwitchIF* pwrSwitcher);
|
||||
void createBpxBatteryComponent();
|
||||
void createStrComponents(PowerSwitchIF* pwrSwitcher);
|
||||
void createSolarArrayDeploymentComponents();
|
||||
void createSyrlinksComponents(PowerSwitchIF* pwrSwitcher);
|
||||
void createPayloadComponents(LinuxLibgpioIF* gpioComIF);
|
||||
void createReactionWheelComponents(LinuxLibgpioIF* gpioComIF);
|
||||
void createReactionWheelComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchIF* pwrSwitcher);
|
||||
void createCcsdsComponents(LinuxLibgpioIF* gpioComIF);
|
||||
void createMiscComponents();
|
||||
|
||||
void createTestComponents(LinuxLibgpioIF* gpioComIF);
|
||||
|
||||
void testAcsBrdAss(AcsBoardAssembly* assAss);
|
||||
|
@ -1,5 +0,0 @@
|
||||
#include "ParameterHandler.h"
|
||||
|
||||
ParameterHandler::ParameterHandler(std::string mountPrefix) : mountPrefix(mountPrefix) {}
|
||||
|
||||
void ParameterHandler::setMountPrefix(std::string prefix) { mountPrefix = prefix; }
|
@ -1,20 +0,0 @@
|
||||
#ifndef BSP_Q7S_CORE_PARAMETERHANDLER_H_
|
||||
#define BSP_Q7S_CORE_PARAMETERHANDLER_H_
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
#include <string>
|
||||
|
||||
class ParameterHandler {
|
||||
public:
|
||||
ParameterHandler(std::string mountPrefix);
|
||||
|
||||
void setMountPrefix(std::string prefix);
|
||||
|
||||
void setUpDummyParameter();
|
||||
|
||||
private:
|
||||
std::string mountPrefix;
|
||||
DummyParameter dummyParam;
|
||||
};
|
||||
|
||||
#endif /* BSP_Q7S_CORE_PARAMETERHANDLER_H_ */
|
1
bsp_q7s/em/CMakeLists.txt
Normal file
1
bsp_q7s/em/CMakeLists.txt
Normal file
@ -0,0 +1 @@
|
||||
target_sources(${OBSW_NAME} PRIVATE emObjectFactory.cpp)
|
71
bsp_q7s/em/emObjectFactory.cpp
Normal file
71
bsp_q7s/em/emObjectFactory.cpp
Normal file
@ -0,0 +1,71 @@
|
||||
#include <fsfw/health/HealthTableIF.h>
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
#include "bsp_q7s/core/CoreController.h"
|
||||
#include "bsp_q7s/core/ObjectFactory.h"
|
||||
#include "busConf.h"
|
||||
#include "commonObjects.h"
|
||||
#include "devConf.h"
|
||||
#include "fsfw_hal/linux/gpio/LinuxLibgpioIF.h"
|
||||
#include "linux/ObjectFactory.h"
|
||||
#include "linux/callbacks/gpioCallbacks.h"
|
||||
#include "mission/core/GenericFactory.h"
|
||||
|
||||
void ObjectFactory::produce(void* args) {
|
||||
ObjectFactory::setStatics();
|
||||
HealthTableIF* healthTable = nullptr;
|
||||
ObjectFactory::produceGenericObjects(&healthTable);
|
||||
|
||||
LinuxLibgpioIF* gpioComIF = nullptr;
|
||||
UartComIF* uartComIF = nullptr;
|
||||
SpiComIF* spiMainComIF = nullptr;
|
||||
I2cComIF* i2cComIF = nullptr;
|
||||
PowerSwitchIF* pwrSwitcher = nullptr;
|
||||
SpiComIF* spiRwComIF = nullptr;
|
||||
createCommunicationInterfaces(&gpioComIF, &uartComIF, &spiMainComIF, &i2cComIF, &spiRwComIF);
|
||||
createTmpComponents();
|
||||
new CoreController(objects::CORE_CONTROLLER);
|
||||
|
||||
gpioCallbacks::disableAllDecoder(gpioComIF);
|
||||
createPcduComponents(gpioComIF, &pwrSwitcher);
|
||||
createRadSensorComponent(gpioComIF);
|
||||
createSunSensorComponents(gpioComIF, spiMainComIF, pwrSwitcher, q7s::SPI_DEFAULT_DEV);
|
||||
|
||||
#if OBSW_ADD_ACS_BOARD == 1
|
||||
createAcsBoardComponents(gpioComIF, uartComIF, pwrSwitcher);
|
||||
#endif
|
||||
createHeaterComponents(gpioComIF, pwrSwitcher, healthTable);
|
||||
createSolarArrayDeploymentComponents();
|
||||
createPlPcduComponents(gpioComIF, spiMainComIF, pwrSwitcher);
|
||||
#if OBSW_ADD_SYRLINKS == 1
|
||||
#if OBSW_Q7S_EM == 1
|
||||
createSyrlinksComponents(nullptr);
|
||||
#else
|
||||
createSyrlinksComponents(pwrSwitcher);
|
||||
#endif /* OBSW_Q7S_EM == 1 */
|
||||
#endif /* OBSW_ADD_SYRLINKS == 1 */
|
||||
createRtdComponents(q7s::SPI_DEFAULT_DEV, gpioComIF, pwrSwitcher, spiMainComIF);
|
||||
createPayloadComponents(gpioComIF);
|
||||
|
||||
#if OBSW_ADD_MGT == 1
|
||||
createImtqComponents(pwrSwitcher);
|
||||
#endif
|
||||
createReactionWheelComponents(gpioComIF, pwrSwitcher);
|
||||
|
||||
#if OBSW_ADD_BPX_BATTERY_HANDLER == 1
|
||||
createBpxBatteryComponent();
|
||||
#endif
|
||||
|
||||
#if OBSW_ADD_STAR_TRACKER == 1
|
||||
createStrComponents(pwrSwitcher);
|
||||
#endif /* OBSW_ADD_STAR_TRACKER == 1 */
|
||||
#if OBSW_USE_CCSDS_IP_CORE == 1
|
||||
createCcsdsComponents(gpioComIF);
|
||||
#endif /* OBSW_USE_CCSDS_IP_CORE == 1 */
|
||||
/* Test Task */
|
||||
#if OBSW_ADD_TEST_CODE == 1
|
||||
createTestComponents(gpioComIF);
|
||||
#endif /* OBSW_ADD_TEST_CODE == 1 */
|
||||
|
||||
createMiscComponents();
|
||||
}
|
65
bsp_q7s/fmObjectFactory.cpp
Normal file
65
bsp_q7s/fmObjectFactory.cpp
Normal file
@ -0,0 +1,65 @@
|
||||
#include "OBSWConfig.h"
|
||||
#include "bsp_q7s/core/CoreController.h"
|
||||
#include "bsp_q7s/core/ObjectFactory.h"
|
||||
#include "busConf.h"
|
||||
#include "commonObjects.h"
|
||||
#include "devConf.h"
|
||||
#include "fsfw_hal/linux/gpio/LinuxLibgpioIF.h"
|
||||
#include "linux/ObjectFactory.h"
|
||||
#include "linux/callbacks/gpioCallbacks.h"
|
||||
#include "mission/core/GenericFactory.h"
|
||||
|
||||
void ObjectFactory::produce(void* args) {
|
||||
ObjectFactory::setStatics();
|
||||
HealthTableIF* healthTable = nullptr;
|
||||
ObjectFactory::produceGenericObjects(&healthTable);
|
||||
|
||||
LinuxLibgpioIF* gpioComIF = nullptr;
|
||||
UartComIF* uartComIF = nullptr;
|
||||
SpiComIF* spiMainComIF = nullptr;
|
||||
I2cComIF* i2cComIF = nullptr;
|
||||
PowerSwitchIF* pwrSwitcher = nullptr;
|
||||
SpiComIF* spiRwComIF = nullptr;
|
||||
createCommunicationInterfaces(&gpioComIF, &uartComIF, &spiMainComIF, &i2cComIF, &spiRwComIF);
|
||||
createTmpComponents();
|
||||
new CoreController(objects::CORE_CONTROLLER);
|
||||
|
||||
gpioCallbacks::disableAllDecoder(gpioComIF);
|
||||
createPcduComponents(gpioComIF, &pwrSwitcher);
|
||||
createRadSensorComponent(gpioComIF);
|
||||
createSunSensorComponents(gpioComIF, spiMainComIF, pwrSwitcher, q7s::SPI_DEFAULT_DEV);
|
||||
|
||||
#if OBSW_ADD_ACS_BOARD == 1
|
||||
createAcsBoardComponents(gpioComIF, uartComIF, pwrSwitcher);
|
||||
#endif
|
||||
createHeaterComponents(gpioComIF, pwrSwitcher, healthTable);
|
||||
createSolarArrayDeploymentComponents();
|
||||
createPlPcduComponents(gpioComIF, spiMainComIF, pwrSwitcher);
|
||||
#if OBSW_ADD_SYRLINKS == 1
|
||||
createSyrlinksComponents(pwrSwitcher);
|
||||
#endif /* OBSW_ADD_SYRLINKS == 1 */
|
||||
createRtdComponents(q7s::SPI_DEFAULT_DEV, gpioComIF, pwrSwitcher, spiMainComIF);
|
||||
createPayloadComponents(gpioComIF);
|
||||
|
||||
#if OBSW_ADD_MGT == 1
|
||||
createImtqComponents(pwrSwitcher);
|
||||
#endif
|
||||
createReactionWheelComponents(gpioComIF, pwrSwitcher);
|
||||
|
||||
#if OBSW_ADD_BPX_BATTERY_HANDLER == 1
|
||||
createBpxBatteryComponent();
|
||||
#endif
|
||||
|
||||
#if OBSW_ADD_STAR_TRACKER == 1
|
||||
createStrComponents(pwrSwitcher);
|
||||
#endif /* OBSW_ADD_STAR_TRACKER == 1 */
|
||||
#if OBSW_USE_CCSDS_IP_CORE == 1
|
||||
createCcsdsComponents(gpioComIF);
|
||||
#endif /* OBSW_USE_CCSDS_IP_CORE == 1 */
|
||||
/* Test Task */
|
||||
#if OBSW_ADD_TEST_CODE == 1
|
||||
createTestComponents(gpioComIF);
|
||||
#endif /* OBSW_ADD_TEST_CODE == 1 */
|
||||
|
||||
createMiscComponents();
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
#include "q7sConfig.h"
|
||||
|
||||
#if Q7S_SIMPLE_MODE == 0
|
||||
#include "core/obsw.h"
|
||||
#include "obsw.h"
|
||||
#else
|
||||
#include "simple/simple.h"
|
||||
#endif
|
||||
|
@ -1,6 +1,2 @@
|
||||
target_sources(${OBSW_NAME} PRIVATE
|
||||
FileSystemHandler.cpp
|
||||
SdCardManager.cpp
|
||||
scratchApi.cpp
|
||||
FilesystemHelper.cpp
|
||||
)
|
||||
target_sources(${OBSW_NAME} PRIVATE FileSystemHandler.cpp SdCardManager.cpp
|
||||
scratchApi.cpp FilesystemHelper.cpp)
|
||||
|
@ -70,9 +70,8 @@ void FileSystemHandler::fileSystemHandlerLoop() {
|
||||
|
||||
void FileSystemHandler::fileSystemCheckup() {
|
||||
SdCardManager::SdStatePair statusPair;
|
||||
sdcMan->getSdCardActiveStatus(statusPair);
|
||||
sd::SdCard preferredSdCard;
|
||||
sdcMan->getPreferredSdCard(preferredSdCard);
|
||||
sdcMan->getSdCardsStatus(statusPair);
|
||||
sd::SdCard preferredSdCard = sdcMan->getPreferredSdCard();
|
||||
if ((preferredSdCard == sd::SdCard::SLOT_0) and (statusPair.first == sd::SdState::MOUNTED)) {
|
||||
currentMountPrefix = SdCardManager::SD_0_MOUNT_POINT;
|
||||
} else if ((preferredSdCard == sd::SdCard::SLOT_1) and
|
||||
@ -109,11 +108,7 @@ ReturnValue_t FileSystemHandler::initialize() {
|
||||
<< std::endl;
|
||||
}
|
||||
sdcMan = SdCardManager::instance();
|
||||
sd::SdCard preferredSdCard;
|
||||
ReturnValue_t result = sdcMan->getPreferredSdCard(preferredSdCard);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
sd::SdCard preferredSdCard = sdcMan->getPreferredSdCard();
|
||||
if (preferredSdCard == sd::SdCard::SLOT_0) {
|
||||
currentMountPrefix = SdCardManager::SD_0_MOUNT_POINT;
|
||||
} else if (preferredSdCard == sd::SdCard::SLOT_1) {
|
||||
|
@ -8,8 +8,6 @@
|
||||
|
||||
FilesystemHelper::FilesystemHelper() {}
|
||||
|
||||
FilesystemHelper::~FilesystemHelper() {}
|
||||
|
||||
ReturnValue_t FilesystemHelper::checkPath(std::string path) {
|
||||
SdCardManager* sdcMan = SdCardManager::instance();
|
||||
if (sdcMan == nullptr) {
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
|
||||
|
||||
/**
|
||||
* @brief This class implements often used functions concerning the file system management.
|
||||
* @brief This class implements often used functions related to the file system management.
|
||||
*
|
||||
* @author J. Meier
|
||||
*/
|
||||
@ -20,11 +20,8 @@ class FilesystemHelper : public HasReturnvaluesIF {
|
||||
//! [EXPORT] : [COMMENT] Specified file does not exist on filesystem
|
||||
static const ReturnValue_t FILE_NOT_EXISTS = MAKE_RETURN_CODE(0xA1);
|
||||
|
||||
FilesystemHelper();
|
||||
virtual ~FilesystemHelper();
|
||||
|
||||
/**
|
||||
* @brief In case the path points to a directory on the sd card the function checks if the
|
||||
* @brief In case the path points to a directory on the sd card, the function checks if the
|
||||
* appropriate SD card is mounted.
|
||||
*
|
||||
* @param path Path to check
|
||||
@ -39,11 +36,14 @@ class FilesystemHelper : public HasReturnvaluesIF {
|
||||
/**
|
||||
* @brief Checks if the file exists on the filesystem.
|
||||
*
|
||||
* param file File to check
|
||||
* @param file File to check
|
||||
*
|
||||
* @return RETURN_OK if fiel exists, otherwise return error code.
|
||||
* @return RETURN_OK if file exists, otherwise return error code.
|
||||
*/
|
||||
static ReturnValue_t fileExists(std::string file);
|
||||
|
||||
private:
|
||||
FilesystemHelper();
|
||||
};
|
||||
|
||||
#endif /* BSP_Q7S_MEMORY_FILESYSTEMHELPER_H_ */
|
||||
|
@ -16,23 +16,51 @@
|
||||
#include "linux/utility/utility.h"
|
||||
#include "scratchApi.h"
|
||||
|
||||
SdCardManager* SdCardManager::factoryInstance = nullptr;
|
||||
SdCardManager* SdCardManager::INSTANCE = nullptr;
|
||||
|
||||
SdCardManager::SdCardManager() : SystemObject(objects::SDC_MANAGER), cmdExecutor(256) {
|
||||
mutex = MutexFactory::instance()->createMutex();
|
||||
ReturnValue_t result = mutex->lockMutex();
|
||||
if (result != RETURN_OK) {
|
||||
sif::error << "SdCardManager::SdCardManager: Mutex lock failed" << std::endl;
|
||||
}
|
||||
uint8_t prefSdRaw = 0;
|
||||
result = scratch::readNumber(scratch::PREFERED_SDC_KEY, prefSdRaw);
|
||||
result = mutex->unlockMutex();
|
||||
if (result != RETURN_OK) {
|
||||
sif::error << "SdCardManager::SdCardManager: Mutex unlock failed" << std::endl;
|
||||
}
|
||||
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result == scratch::KEY_NOT_FOUND) {
|
||||
sif::warning << "CoreController::sdCardInit: "
|
||||
"Preferred SD card not set. Setting to 0"
|
||||
<< std::endl;
|
||||
setPreferredSdCard(sd::SdCard::SLOT_0);
|
||||
sdInfo.pref = sd::SdCard::SLOT_0;
|
||||
} else {
|
||||
// Should not happen.
|
||||
// TODO: Maybe trigger event?
|
||||
sif::error << "SdCardManager::SdCardManager: Reading preferred SD card from scratch"
|
||||
"buffer failed"
|
||||
<< std::endl;
|
||||
sdInfo.pref = sd::SdCard::SLOT_0;
|
||||
}
|
||||
}
|
||||
sdInfo.pref = static_cast<sd::SdCard>(prefSdRaw);
|
||||
}
|
||||
|
||||
SdCardManager::~SdCardManager() {}
|
||||
|
||||
void SdCardManager::create() {
|
||||
if (factoryInstance == nullptr) {
|
||||
factoryInstance = new SdCardManager();
|
||||
if (INSTANCE == nullptr) {
|
||||
INSTANCE = new SdCardManager();
|
||||
}
|
||||
}
|
||||
|
||||
SdCardManager* SdCardManager::instance() {
|
||||
SdCardManager::create();
|
||||
return SdCardManager::factoryInstance;
|
||||
return SdCardManager::INSTANCE;
|
||||
}
|
||||
|
||||
ReturnValue_t SdCardManager::switchOnSdCard(sd::SdCard sdCard, bool doMountSdCard,
|
||||
@ -51,7 +79,7 @@ ReturnValue_t SdCardManager::switchOnSdCard(sd::SdCard sdCard, bool doMountSdCar
|
||||
if (statusPair == nullptr) {
|
||||
sdStatusPtr = std::make_unique<SdStatePair>();
|
||||
statusPair = sdStatusPtr.get();
|
||||
result = getSdCardActiveStatus(*statusPair);
|
||||
result = getSdCardsStatus(*statusPair);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
@ -98,7 +126,7 @@ ReturnValue_t SdCardManager::switchOnSdCard(sd::SdCard sdCard, bool doMountSdCar
|
||||
ReturnValue_t SdCardManager::switchOffSdCard(sd::SdCard sdCard, bool doUnmountSdCard,
|
||||
SdStatePair* statusPair) {
|
||||
std::pair<sd::SdState, sd::SdState> active;
|
||||
ReturnValue_t result = getSdCardActiveStatus(active);
|
||||
ReturnValue_t result = getSdCardsStatus(active);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
@ -165,7 +193,7 @@ ReturnValue_t SdCardManager::setSdCardState(sd::SdCard sdCard, bool on) {
|
||||
return result;
|
||||
}
|
||||
|
||||
ReturnValue_t SdCardManager::getSdCardActiveStatus(SdStatePair& active) {
|
||||
ReturnValue_t SdCardManager::getSdCardsStatus(SdStatePair& active) {
|
||||
using namespace std;
|
||||
MutexGuard mg(mutex);
|
||||
if (not filesystem::exists(SD_STATE_FILE)) {
|
||||
@ -273,14 +301,14 @@ ReturnValue_t SdCardManager::sanitizeState(SdStatePair* statusPair, sd::SdCard p
|
||||
resetNonBlockingState = true;
|
||||
}
|
||||
if (prefSdCard == sd::SdCard::NONE) {
|
||||
result = getPreferredSdCard(prefSdCard);
|
||||
result = getPreferredSdCard();
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
}
|
||||
}
|
||||
if (statusPair == nullptr) {
|
||||
sdStatusPtr = std::make_unique<SdStatePair>();
|
||||
statusPair = sdStatusPtr.get();
|
||||
getSdCardActiveStatus(*statusPair);
|
||||
getSdCardsStatus(*statusPair);
|
||||
}
|
||||
|
||||
if (statusPair->first == sd::SdState::ON) {
|
||||
@ -351,20 +379,21 @@ void SdCardManager::processSdStatusLine(std::pair<sd::SdState, sd::SdState>& act
|
||||
idx++;
|
||||
}
|
||||
|
||||
ReturnValue_t SdCardManager::getPreferredSdCard(sd::SdCard& sdCard) const {
|
||||
uint8_t prefSdCard = 0;
|
||||
ReturnValue_t result = scratch::readNumber(scratch::PREFERED_SDC_KEY, prefSdCard);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return result;
|
||||
sd::SdCard SdCardManager::getPreferredSdCard() const {
|
||||
MutexGuard mg(mutex);
|
||||
auto res = mg.getLockResult();
|
||||
if (res != RETURN_OK) {
|
||||
sif::error << "SdCardManager::getPreferredSdCard: Lock error" << std::endl;
|
||||
}
|
||||
sdCard = static_cast<sd::SdCard>(prefSdCard);
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return sdInfo.pref;
|
||||
}
|
||||
|
||||
ReturnValue_t SdCardManager::setPreferredSdCard(sd::SdCard sdCard) {
|
||||
MutexGuard mg(mutex);
|
||||
if (sdCard == sd::SdCard::BOTH) {
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
sdInfo.pref = sdCard;
|
||||
return scratch::writeNumber(scratch::PREFERED_SDC_KEY, static_cast<uint8_t>(sdCard));
|
||||
}
|
||||
|
||||
@ -383,14 +412,9 @@ ReturnValue_t SdCardManager::updateSdCardStateFile() {
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string SdCardManager::getCurrentMountPrefix(sd::SdCard prefSdCard) {
|
||||
if (prefSdCard == sd::SdCard::NONE) {
|
||||
ReturnValue_t result = getPreferredSdCard(prefSdCard);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return SD_0_MOUNT_POINT;
|
||||
}
|
||||
}
|
||||
if (prefSdCard == sd::SdCard::SLOT_0) {
|
||||
std::string SdCardManager::getCurrentMountPrefix() const {
|
||||
MutexGuard mg(mutex);
|
||||
if (sdInfo.active == sd::SdCard::SLOT_0) {
|
||||
return SD_0_MOUNT_POINT;
|
||||
} else {
|
||||
return SD_1_MOUNT_POINT;
|
||||
@ -443,7 +467,7 @@ void SdCardManager::setPrintCommandOutput(bool print) { this->printCmdOutput = p
|
||||
|
||||
bool SdCardManager::isSdCardMounted(sd::SdCard sdCard) {
|
||||
SdCardManager::SdStatePair active;
|
||||
ReturnValue_t result = this->getSdCardActiveStatus(active);
|
||||
ReturnValue_t result = this->getSdCardsStatus(active);
|
||||
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::debug << "SdCardManager::isSdCardMounted: Failed to get SD card active state";
|
||||
@ -466,3 +490,68 @@ bool SdCardManager::isSdCardMounted(sd::SdCard sdCard) {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
ReturnValue_t SdCardManager::isSdCardMountedReadOnly(sd::SdCard sdcard, bool& readOnly) {
|
||||
std::ostringstream command;
|
||||
if (sdcard == sd::SdCard::SLOT_0) {
|
||||
command << "grep -q '" << SD_0_MOUNT_POINT << " vfat ro,' /proc/mounts";
|
||||
} else {
|
||||
command << "grep -q '" << SD_1_MOUNT_POINT << " vfat ro,' /proc/mounts";
|
||||
}
|
||||
ReturnValue_t result = cmdExecutor.load(command.str(), true, false);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
result = cmdExecutor.execute();
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
int exitStatus = cmdExecutor.getLastError();
|
||||
if (exitStatus == 1) {
|
||||
readOnly = false;
|
||||
return RETURN_OK;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
auto& readVec = cmdExecutor.getReadVector();
|
||||
size_t readLen = strnlen(readVec.data(), readVec.size());
|
||||
if (readLen == 0) {
|
||||
readOnly = false;
|
||||
}
|
||||
readOnly = true;
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
ReturnValue_t SdCardManager::remountReadWrite(sd::SdCard sdcard) {
|
||||
std::ostringstream command;
|
||||
if (sdcard == sd::SdCard::SLOT_0) {
|
||||
command << "mount -o remount,rw " << SD_0_DEV_NAME << " " << SD_0_MOUNT_POINT;
|
||||
} else {
|
||||
command << "mount -o remount,rw " << SD_1_DEV_NAME << " " << SD_1_MOUNT_POINT;
|
||||
}
|
||||
ReturnValue_t result = cmdExecutor.load(command.str(), true, false);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
return cmdExecutor.execute();
|
||||
}
|
||||
|
||||
ReturnValue_t SdCardManager::performFsck(sd::SdCard sdcard, bool printOutput, int& linuxError) {
|
||||
std::ostringstream command;
|
||||
if (sdcard == sd::SdCard::SLOT_0) {
|
||||
command << "fsck -y " << SD_0_DEV_NAME;
|
||||
} else {
|
||||
command << "fsck -y " << SD_1_DEV_NAME;
|
||||
}
|
||||
ReturnValue_t result = cmdExecutor.load(command.str(), true, printOutput);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
result = cmdExecutor.execute();
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
linuxError = cmdExecutor.getLastError();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void SdCardManager::setActiveSdCard(sd::SdCard sdCard) { sdInfo.active = sdCard; }
|
||||
|
||||
sd::SdCard SdCardManager::getActiveSdCard() const { return sdInfo.active; }
|
||||
|
@ -24,7 +24,7 @@ class MutexIF;
|
||||
* @brief Manages handling of SD cards like switching them on or off or getting the current
|
||||
* state
|
||||
*/
|
||||
class SdCardManager : public SystemObject, public SdCardMountedIF {
|
||||
class SdCardManager : public SystemObject, public HasReturnvaluesIF, public SdCardMountedIF {
|
||||
friend class SdCardAccess;
|
||||
|
||||
public:
|
||||
@ -36,6 +36,12 @@ class SdCardManager : public SystemObject, public SdCardMountedIF {
|
||||
|
||||
using SdStatePair = std::pair<sd::SdState, sd::SdState>;
|
||||
|
||||
struct SdInfo {
|
||||
sd::SdCard pref = sd::SdCard::NONE;
|
||||
sd::SdCard other = sd::SdCard::NONE;
|
||||
sd::SdCard active = sd::SdCard::NONE;
|
||||
} sdInfo;
|
||||
|
||||
static constexpr uint8_t INTERFACE_ID = CLASS_ID::SD_CARD_MANAGER;
|
||||
|
||||
static constexpr ReturnValue_t OP_ONGOING = HasReturnvaluesIF::makeReturnCode(INTERFACE_ID, 0);
|
||||
@ -91,7 +97,7 @@ class SdCardManager : public SystemObject, public SdCardMountedIF {
|
||||
* @param sdCard
|
||||
* @return
|
||||
*/
|
||||
ReturnValue_t getPreferredSdCard(sd::SdCard& sdCard) const override;
|
||||
sd::SdCard getPreferredSdCard() const override;
|
||||
|
||||
/**
|
||||
* Switch on the specified SD card.
|
||||
@ -138,7 +144,7 @@ class SdCardManager : public SystemObject, public SdCardMountedIF {
|
||||
* should call #updateSdCardStateFile again in that case
|
||||
* - STATUS_FILE_NEXISTS if the status file does not exist
|
||||
*/
|
||||
ReturnValue_t getSdCardActiveStatus(SdStatePair& active);
|
||||
ReturnValue_t getSdCardsStatus(SdStatePair& active);
|
||||
|
||||
/**
|
||||
* Mount the specified SD card. This is necessary to use it.
|
||||
@ -146,6 +152,20 @@ class SdCardManager : public SystemObject, public SdCardMountedIF {
|
||||
* @return
|
||||
*/
|
||||
ReturnValue_t mountSdCard(sd::SdCard sdCard);
|
||||
|
||||
/**
|
||||
* Set the currently active SD card. This does not necessarily mean that the SD card is on or
|
||||
* mounted
|
||||
* @param sdCard
|
||||
*/
|
||||
void setActiveSdCard(sd::SdCard sdCard) override;
|
||||
/**
|
||||
* Get the currently active SD card. This does not necessarily mean that the SD card is on or
|
||||
* mounted
|
||||
* @return
|
||||
*/
|
||||
sd::SdCard getActiveSdCard() const override;
|
||||
|
||||
/**
|
||||
* Unmount the specified SD card. This is recommended before switching it off. The SD card
|
||||
* can't be used after it has been unmounted.
|
||||
@ -173,7 +193,7 @@ class SdCardManager : public SystemObject, public SdCardMountedIF {
|
||||
* @param prefSdCardPtr
|
||||
* @return
|
||||
*/
|
||||
std::string getCurrentMountPrefix(sd::SdCard prefSdCardPtr = sd::SdCard::NONE) override;
|
||||
std::string getCurrentMountPrefix() const override;
|
||||
|
||||
OpStatus checkCurrentOp(Operations& currentOp);
|
||||
|
||||
@ -194,6 +214,12 @@ class SdCardManager : public SystemObject, public SdCardMountedIF {
|
||||
*/
|
||||
bool isSdCardMounted(sd::SdCard sdCard) override;
|
||||
|
||||
ReturnValue_t isSdCardMountedReadOnly(sd::SdCard sdcard, bool& readOnly);
|
||||
|
||||
ReturnValue_t remountReadWrite(sd::SdCard sdcard);
|
||||
|
||||
ReturnValue_t performFsck(sd::SdCard sdcard, bool printOutput, int& linuxError);
|
||||
|
||||
private:
|
||||
CommandExecutor cmdExecutor;
|
||||
Operations currentOp = Operations::IDLE;
|
||||
@ -210,7 +236,7 @@ class SdCardManager : public SystemObject, public SdCardMountedIF {
|
||||
|
||||
std::string currentPrefix;
|
||||
|
||||
static SdCardManager* factoryInstance;
|
||||
static SdCardManager* INSTANCE;
|
||||
};
|
||||
|
||||
#endif /* BSP_Q7S_MEMORY_SDCARDACCESSMANAGER_H_ */
|
||||
|
@ -76,12 +76,12 @@ ReturnValue_t readToFile(std::string name, std::ifstream& file, std::string& fil
|
||||
int result = std::system(oss.str().c_str());
|
||||
if (result != 0) {
|
||||
if (WEXITSTATUS(result) == 1) {
|
||||
sif::warning << "scratch::readNumber: Key " << name << " does not exist" << std::endl;
|
||||
sif::warning << "scratch::readToFile: Key " << name << " does not exist" << std::endl;
|
||||
// Could not find value
|
||||
std::remove(filename.c_str());
|
||||
return KEY_NOT_FOUND;
|
||||
} else {
|
||||
utility::handleSystemError(result, "scratch::readNumber");
|
||||
utility::handleSystemError(result, "scratch::readToFile");
|
||||
std::remove(filename.c_str());
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
|
@ -3,19 +3,24 @@
|
||||
#include <filesystem>
|
||||
#include <iostream>
|
||||
|
||||
#include "InitMission.h"
|
||||
#include "OBSWConfig.h"
|
||||
#include "commonConfig.h"
|
||||
#include "core/InitMission.h"
|
||||
#include "fsfw/tasks/TaskFactory.h"
|
||||
#include "fsfw/version.h"
|
||||
#include "q7sConfig.h"
|
||||
#include "watchdog/definitions.h"
|
||||
|
||||
static int OBSW_ALREADY_RUNNING = -2;
|
||||
|
||||
#if OBSW_Q7S_EM == 0
|
||||
static const char* DEV_STRING = "Xiphos Q7S FM";
|
||||
#else
|
||||
static const char* DEV_STRING = "Xiphos Q7S EM";
|
||||
#endif
|
||||
int obsw::obsw() {
|
||||
using namespace fsfw;
|
||||
std::cout << "-- EIVE OBSW --" << std::endl;
|
||||
std::cout << "-- Compiled for Linux (Xiphos Q7S) --" << std::endl;
|
||||
std::cout << "-- Compiled for Linux (" << DEV_STRING << ") --" << std::endl;
|
||||
std::cout << "-- OBSW v" << common::OBSW_VERSION << " | FSFW v" << fsfw::FSFW_VERSION << " --"
|
||||
<< std::endl;
|
||||
std::cout << "-- " << __DATE__ << " " << __TIME__ << " --" << std::endl;
|
@ -1,3 +1 @@
|
||||
target_sources(${SIMPLE_OBSW_NAME} PRIVATE
|
||||
simple.cpp
|
||||
)
|
||||
target_sources(${SIMPLE_OBSW_NAME} PRIVATE simple.cpp)
|
||||
|
@ -1,3 +1 @@
|
||||
target_sources(${OBSW_NAME} PRIVATE
|
||||
Xadc.cpp
|
||||
)
|
||||
target_sources(${OBSW_NAME} PRIVATE Xadc.cpp)
|
||||
|
@ -89,13 +89,23 @@ void initmission::initTasks() {
|
||||
}
|
||||
pstTasks.push_back(pst);
|
||||
|
||||
#if OBSW_ADD_PLOC_MPSOC == 1
|
||||
PeriodicTaskIF* mpsocHelperTask = factory->createPeriodicTask(
|
||||
"PLOC_MPSOC_HELPER", 20, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc);
|
||||
result = mpsocHelperTask->addComponent(objects::PLOC_MPSOC_HELPER);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
initmission::printAddObjectError("PLOC_MPSOC_HELPER", objects::PLOC_MPSOC_HELPER);
|
||||
}
|
||||
pstTasks.push_back(mpsocHelperTask);
|
||||
#endif /* OBSW_ADD_PLOC_MPSOC == 1*/
|
||||
|
||||
#if OBSW_ADD_PLOC_SUPERVISOR == 1
|
||||
PeriodicTaskIF* supvHelperTask = factory->createPeriodicTask(
|
||||
"PLOC_SUPV_HELPER", 20, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc);
|
||||
result = supvHelperTask->addComponent(objects::PLOC_SUPERVISOR_HELPER);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
initmission::printAddObjectError("PLOC_SUPV_HELPER", objects::PLOC_SUPERVISOR_HELPER);
|
||||
}
|
||||
#endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */
|
||||
|
||||
auto taskStarter = [](std::vector<PeriodicTaskIF*>& taskVector, std::string name) {
|
||||
for (const auto& task : taskVector) {
|
||||
@ -111,6 +121,12 @@ void initmission::initTasks() {
|
||||
tmtcDistributor->startTask();
|
||||
tmtcBridgeTask->startTask();
|
||||
tmtcPollingTask->startTask();
|
||||
#if OBSW_ADD_PLOC_SUPERVISOR == 1
|
||||
supvHelperTask->startTask();
|
||||
#endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */
|
||||
#if OBSW_ADD_PLOC_MPSOC == 1
|
||||
mpsocHelperTask->startTask();
|
||||
#endif /* OBSW_ADD_PLOC_MPSOC == 1 */
|
||||
|
||||
taskStarter(pstTasks, "PST Tasks");
|
||||
taskStarter(pusTasks, "PUS Tasks");
|
||||
|
@ -6,69 +6,19 @@
|
||||
#ifndef FSFWCONFIG_OBSWCONFIG_H_
|
||||
#define FSFWCONFIG_OBSWCONFIG_H_
|
||||
|
||||
#cmakedefine RASPBERRY_PI
|
||||
#cmakedefine XIPHOS_Q7S
|
||||
#cmakedefine BEAGLEBONEBLACK
|
||||
#cmakedefine EGSE
|
||||
#cmakedefine TE0720_1CFA
|
||||
|
||||
#include "commonConfig.h"
|
||||
#include "OBSWVersion.h"
|
||||
|
||||
#define Q7S_EM 0
|
||||
|
||||
/*******************************************************************/
|
||||
/** All of the following flags should be enabled for mission code */
|
||||
/*******************************************************************/
|
||||
|
||||
//! Timers can mess up the code when debugging
|
||||
//! All of this should be enabled for mission code!
|
||||
#if defined XIPHOS_Q7S
|
||||
|
||||
#define Q7S_EM 0
|
||||
|
||||
#define OBSW_USE_CCSDS_IP_CORE 1
|
||||
// Set to 1 if all telemetry should be sent to the PTME IP Core
|
||||
#define OBSW_TM_TO_PTME 0
|
||||
// Set to 1 if telecommands are received via the PDEC IP Core
|
||||
#define OBSW_TC_FROM_PDEC 0
|
||||
|
||||
#define OBSW_ENABLE_TIMERS 1
|
||||
#define OBSW_ADD_MGT 1
|
||||
#define OBSW_ADD_BPX_BATTERY_HANDLER 1
|
||||
#define OBSW_ADD_STAR_TRACKER @OBSW_ADD_STAR_TRACKER@
|
||||
#define OBSW_ADD_PLOC_SUPERVISOR 0
|
||||
#define OBSW_ADD_PLOC_MPSOC 0
|
||||
#define OBSW_ADD_SUN_SENSORS 1
|
||||
#define OBSW_ADD_SUS_BOARD_ASS 1
|
||||
#define OBSW_ADD_ACS_BOARD 1
|
||||
#define OBSW_ADD_ACS_HANDLERS 1
|
||||
#define OBSW_ADD_RW 0
|
||||
#define OBSW_ADD_RTD_DEVICES 1
|
||||
#define OBSW_ADD_TMP_DEVICES 1
|
||||
#define OBSW_ADD_RAD_SENSORS 1
|
||||
#define OBSW_ADD_PL_PCDU 1
|
||||
#define OBSW_ADD_SYRLINKS 1
|
||||
#define OBSW_ENABLE_SYRLINKS_TRANSMIT_TIMEOUT 0
|
||||
#define OBSW_STAR_TRACKER_GROUND_CONFIG 1
|
||||
|
||||
#endif // XIPHOS_Q7S
|
||||
|
||||
// This is a really tricky switch.. It initializes the PCDU switches to their default states
|
||||
// at powerup. I think it would be better
|
||||
// to leave it off for now. It makes testing a lot more difficult and it might mess with
|
||||
// something the operators might want to do by giving the software too much intelligence
|
||||
// at the wrong place. The system component might command all the Switches accordingly anyway
|
||||
#define OBSW_INITIALIZE_SWITCHES 0
|
||||
#define OBSW_ENABLE_PERIODIC_HK 0
|
||||
|
||||
#ifdef TE0720_1CFA
|
||||
|
||||
#define OBSW_USE_CCSDS_IP_CORE 0
|
||||
// Set to 1 if all telemetry should be sent to the PTME IP Core
|
||||
#define OBSW_TM_TO_PTME 0
|
||||
// Set to 1 if telecommands are received via the PDEC IP Core
|
||||
#define OBSW_TC_FROM_PDEC 0
|
||||
|
||||
#define OBSW_ENABLE_TIMERS 1
|
||||
#define OBSW_ADD_MGT 0
|
||||
#define OBSW_ADD_BPX_BATTERY_HANDLER 0
|
||||
@ -91,7 +41,13 @@
|
||||
#define OBSW_PRINT_CORE_HK 0
|
||||
#define OBSW_INITIALIZE_SWITCHES 0
|
||||
|
||||
#endif
|
||||
// This is a really tricky switch.. It initializes the PCDU switches to their default states
|
||||
// at powerup. I think it would be better
|
||||
// to leave it off for now. It makes testing a lot more difficult and it might mess with
|
||||
// something the operators might want to do by giving the software too much intelligence
|
||||
// at the wrong place. The system component might command all the Switches accordingly anyway
|
||||
#define OBSW_INITIALIZE_SWITCHES 0
|
||||
#define OBSW_ENABLE_PERIODIC_HK 0
|
||||
|
||||
/*******************************************************************/
|
||||
/** All of the following flags should be disabled for mission code */
|
||||
@ -146,43 +102,10 @@
|
||||
|
||||
#define OBSW_DEBUG_PDEC_HANDLER 0
|
||||
|
||||
#ifdef TE0720_1CFA
|
||||
#define OBSW_DEBUG_PLOC_SUPERVISOR 1
|
||||
#define OBSW_DEBUG_PLOC_MPSOC 1
|
||||
#else
|
||||
#define OBSW_DEBUG_PLOC_SUPERVISOR 0
|
||||
#define OBSW_DEBUG_PLOC_MPSOC 0
|
||||
#endif
|
||||
|
||||
#ifdef EGSE
|
||||
#define OBSW_DEBUG_STARTRACKER 1
|
||||
#else
|
||||
#define OBSW_DEBUG_STARTRACKER 0
|
||||
#endif
|
||||
|
||||
#ifdef RASPBERRY_PI
|
||||
|
||||
#define OBSW_ENABLE_TIMERS 1
|
||||
#define OBSW_ADD_STAR_TRACKER 0
|
||||
#define OBSW_ADD_PLOC_SUPERVISOR 0
|
||||
#define OBSW_ADD_PLOC_MPSOC 0
|
||||
#define OBSW_ADD_SUN_SENSORS 0
|
||||
#define OBSW_ADD_MGT 0
|
||||
#define OBSW_ADD_ACS_BOARD 0
|
||||
#define OBSW_ADD_ACS_HANDLERS 0
|
||||
#define OBSW_ADD_GPS_0 0
|
||||
#define OBSW_ADD_GPS_1 0
|
||||
#define OBSW_ADD_RW 0
|
||||
#define OBSW_ADD_BPX_BATTERY_HANDLER 0
|
||||
#define OBSW_ADD_RTD_DEVICES 0
|
||||
#define OBSW_ADD_PL_PCDU 0
|
||||
#define OBSW_ADD_TMP_DEVICES 0
|
||||
#define OBSW_ADD_RAD_SENSORS 0
|
||||
#define OBSW_ADD_SYRLINKS 0
|
||||
#define OBSW_STAR_TRACKER_GROUND_CONFIG 1
|
||||
|
||||
#endif // RASPBERRY_PI
|
||||
|
||||
#define OBSW_TCP_SERVER_WIRETAPPING 0
|
||||
|
||||
/*******************************************************************/
|
||||
@ -193,12 +116,6 @@
|
||||
#cmakedefine LIBGPS_VERSION_MAJOR @LIBGPS_VERSION_MAJOR@
|
||||
#cmakedefine LIBGPS_VERSION_MINOR @LIBGPS_VERSION_MINOR@
|
||||
|
||||
#ifdef RASPBERRY_PI
|
||||
#include "rpiConfig.h"
|
||||
#elif defined(XIPHOS_Q7S)
|
||||
#include "q7sConfig.h"
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "objects/systemObjectList.h"
|
@ -1,27 +1,30 @@
|
||||
#include "ObjectFactory.h"
|
||||
|
||||
#include <devConf.h>
|
||||
#include "fsfw_hal/linux/uart/UartComIF.h"
|
||||
#include "fsfw_hal/linux/i2c/I2cComIF.h"
|
||||
#include "fsfw_hal/linux/uart/UartCookie.h"
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
#include "busConf.h"
|
||||
#include "devConf.h"
|
||||
#include "devices/addresses.h"
|
||||
#include "devices/gpioIds.h"
|
||||
#include "fsfw/datapoollocal/LocalDataPoolManager.h"
|
||||
#include "fsfw/tmtcpacket/pus/tm.h"
|
||||
#include "fsfw/tmtcservices/CommandingServiceBase.h"
|
||||
#include "fsfw/tmtcservices/PusServiceBase.h"
|
||||
#include "fsfw_hal/linux/i2c/I2cComIF.h"
|
||||
#include "fsfw_hal/linux/i2c/I2cCookie.h"
|
||||
#include "fsfw_hal/linux/uart/UartComIF.h"
|
||||
#include "fsfw_hal/linux/uart/UartCookie.h"
|
||||
#include "linux/devices/ploc/PlocMPSoCHandler.h"
|
||||
#include "linux/devices/ploc/PlocMPSoCHelper.h"
|
||||
#include "mission/devices/Tmp1075Handler.h"
|
||||
#include "linux/devices/ploc/PlocMemoryDumper.h"
|
||||
#include "linux/devices/ploc/PlocSupervisorHandler.h"
|
||||
#include "linux/devices/ploc/PlocSupvHelper.h"
|
||||
#include "mission/core/GenericFactory.h"
|
||||
#include "mission/devices/Tmp1075Handler.h"
|
||||
#include "mission/utility/TmFunnel.h"
|
||||
#include "test/gpio/DummyGpioIF.h"
|
||||
#include "objects/systemObjectList.h"
|
||||
#include "devices/addresses.h"
|
||||
#include "devices/gpioIds.h"
|
||||
#include "test/gpio/DummyGpioIF.h"
|
||||
#include "tmtc/apid.h"
|
||||
#include "tmtc/pusIds.h"
|
||||
|
||||
@ -43,12 +46,13 @@ void ObjectFactory::produce(void* args) {
|
||||
Factory::setStaticFrameworkObjectIds();
|
||||
ObjectFactory::produceGenericObjects();
|
||||
|
||||
new UartComIF(objects::UART_COM_IF);
|
||||
|
||||
#if OBSW_ADD_PLOC_MPSOC == 1
|
||||
UartCookie* mpsocUartCookie = new UartCookie(objects::PLOC_MPSOC_HANDLER, te0720_1cfa::MPSOC_UART,
|
||||
uart::PLOC_MPSOC_BAUD, mpsoc::MAX_REPLY_SIZE);
|
||||
mpsocUartCookie->setNoFixedSizeReply();
|
||||
PlocMPSoCHelper* plocMpsocHelper = new PlocMPSoCHelper(objects::PLOC_MPSOC_HELPER);
|
||||
new UartComIF(objects::UART_COM_IF);
|
||||
auto dummyGpioIF = new DummyGpioIF();
|
||||
PlocMPSoCHandler* plocMPSoCHandler = new PlocMPSoCHandler(
|
||||
objects::PLOC_MPSOC_HANDLER, objects::UART_COM_IF, mpsocUartCookie, plocMpsocHelper,
|
||||
@ -56,6 +60,20 @@ void ObjectFactory::produce(void* args) {
|
||||
plocMPSoCHandler->setStartUpImmediately();
|
||||
#endif /* OBSW_ADD_PLOC_MPSOC == 1 */
|
||||
|
||||
#if OBSW_ADD_PLOC_SUPERVISOR == 1
|
||||
UartCookie* supervisorCookie =
|
||||
new UartCookie(objects::PLOC_SUPERVISOR_HANDLER, std::string("/dev/ttyPS1"),
|
||||
uart::PLOC_SUPV_BAUD, supv::MAX_PACKET_SIZE * 20);
|
||||
supervisorCookie->setNoFixedSizeReply();
|
||||
auto supvGpioIF = new DummyGpioIF();
|
||||
auto supvHelper = new PlocSupvHelper(objects::PLOC_SUPERVISOR_HELPER);
|
||||
new PlocSupervisorHandler(objects::PLOC_SUPERVISOR_HANDLER, objects::UART_COM_IF,
|
||||
supervisorCookie, Gpio(gpioIds::ENABLE_SUPV_UART, supvGpioIF),
|
||||
pcdu::PDU1_CH6_PLOC_12V, supvHelper);
|
||||
|
||||
new PlocMemoryDumper(objects::PLOC_MEMORY_DUMPER);
|
||||
#endif
|
||||
|
||||
#if OBSW_TEST_LIBGPIOD == 1
|
||||
#if OBSW_TEST_GPIO_OPEN_BYLABEL == 1
|
||||
/* Configure MIO0 as input */
|
||||
@ -124,28 +142,17 @@ void ObjectFactory::produce(void* args) {
|
||||
GpioCookie* gpioCookie = new GpioCookie;
|
||||
gpioCookie->addGpio(gpioIds::HEATER_0, heaterGpio);
|
||||
new HeaterHandler(objects::HEATER_HANDLER, objects::GPIO_IF, gpioCookie, objects::PCDU_HANDLER,
|
||||
pcduSwitches::TCS_BOARD_8V_HEATER_IN);
|
||||
pcdu::TCS_BOARD_8V_HEATER_IN);
|
||||
#endif
|
||||
|
||||
#if OBSW_ADD_PLOC_SUPERVISOR == 1
|
||||
/* Configuration for MIO0 on TE0720-03-1CFA */
|
||||
UartCookie* plocSupervisorCookie =
|
||||
new UartCookie(objects::PLOC_SUPERVISOR_HANDLER, std::string("/dev/ttyPS1"),
|
||||
UartModes::NON_CANONICAL, 115200, PLOC_SPV::MAX_PACKET_SIZE * 20);
|
||||
plocSupervisorCookie->setNoFixedSizeReply();
|
||||
PlocSupervisorHandler* plocSupervisor = new PlocSupervisorHandler(
|
||||
objects::PLOC_SUPERVISOR_HANDLER, objects::UART_COM_IF, plocSupervisorCookie);
|
||||
plocSupervisor->setStartUpImmediately();
|
||||
#endif
|
||||
new I2cComIF(objects::I2C_COM_IF);
|
||||
|
||||
new I2cComIF(objects::I2C_COM_IF);
|
||||
|
||||
I2cCookie* i2cCookieTmp1075tcs1 =
|
||||
I2cCookie* i2cCookieTmp1075tcs1 =
|
||||
new I2cCookie(addresses::TMP1075_TCS_1, TMP1075::MAX_REPLY_LENGTH, std::string("/dev/i2c-0"));
|
||||
I2cCookie* i2cCookieTmp1075tcs2 =
|
||||
I2cCookie* i2cCookieTmp1075tcs2 =
|
||||
new I2cCookie(addresses::TMP1075_TCS_2, TMP1075::MAX_REPLY_LENGTH, std::string("/dev/i2c-0"));
|
||||
|
||||
/* Temperature sensors */
|
||||
new Tmp1075Handler(objects::TMP1075_HANDLER_1, objects::I2C_COM_IF, i2cCookieTmp1075tcs1);
|
||||
new Tmp1075Handler(objects::TMP1075_HANDLER_2, objects::I2C_COM_IF, i2cCookieTmp1075tcs2);
|
||||
/* Temperature sensors */
|
||||
new Tmp1075Handler(objects::TMP1075_HANDLER_1, objects::I2C_COM_IF, i2cCookieTmp1075tcs1);
|
||||
new Tmp1075Handler(objects::TMP1075_HANDLER_2, objects::I2C_COM_IF, i2cCookieTmp1075tcs2);
|
||||
}
|
||||
|
@ -33,6 +33,10 @@ add_compile_options(
|
||||
set(STRIPPED_OBSW_NAME ${OBSW_BIN_NAME}-stripped)
|
||||
set(STRIPPED_WATCHDOG_NAME eive-watchdog-stripped)
|
||||
|
||||
if(EIVE_CREATE_UNIQUE_OBSW_BIN)
|
||||
set(UNIQUE_OBSW_BIN_NAME ${OBSW_BIN_NAME}-$ENV{USERNAME})
|
||||
endif()
|
||||
|
||||
add_custom_command(
|
||||
TARGET ${OBSW_NAME}
|
||||
POST_BUILD
|
||||
@ -41,6 +45,16 @@ add_custom_command(
|
||||
COMMENT "Generating stripped executable ${STRIPPED_OBSW_NAME}.."
|
||||
)
|
||||
|
||||
if(UNIQUE_OBSW_BIN_NAME)
|
||||
add_custom_command(
|
||||
TARGET ${OBSW_NAME}
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${OBSW_BIN_NAME}
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${UNIQUE_OBSW_BIN_NAME}
|
||||
COMMENT "Generating unique EIVE OBSW binary ${UNIQUE_OBSW_BIN_NAME}")
|
||||
endif()
|
||||
|
||||
add_custom_command(
|
||||
TARGET ${WATCHDOG_NAME}
|
||||
POST_BUILD
|
||||
|
@ -1,3 +1,6 @@
|
||||
function(obsw_module_config)
|
||||
endfunction()
|
||||
|
||||
function(pre_source_hw_os_config)
|
||||
|
||||
# FreeRTOS
|
||||
|
@ -1,32 +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
|
||||
|
||||
build_generator="make"
|
||||
os_fsfw="host"
|
||||
builddir="build-Debug-Host"
|
||||
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" -l "${builddir}"
|
||||
# Use this if commands are added which should not be printed
|
||||
# set +x
|
@ -1,32 +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
|
||||
|
||||
build_generator="make"
|
||||
os_fsfw="host"
|
||||
builddir="build-Release-Host"
|
||||
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" -l "${builddir}"
|
||||
# Use this if commands are added which should not be printed
|
||||
# set +x
|
@ -1,32 +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
|
||||
|
||||
build_generator="ninja"
|
||||
os_fsfw="host"
|
||||
builddir="build-Debug-Host"
|
||||
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" -l "${builddir}"
|
||||
# Use this if commands are added which should not be printed
|
||||
# set +x
|
@ -1,32 +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
|
||||
|
||||
build_generator="make"
|
||||
os_fsfw="linux"
|
||||
builddir="build-Debug-Host"
|
||||
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" -l "${builddir}"
|
||||
# Use this if commands are added which should not be printed
|
||||
# set +x
|
@ -1,32 +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
|
||||
|
||||
build_generator="Unix Makefiles"
|
||||
os_fsfw="linux"
|
||||
builddir="build-Release-Host"
|
||||
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" -l "${builddir}"
|
||||
# Use this if commands are added which should not be printed
|
||||
# set +x
|
@ -1,33 +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
|
||||
|
||||
build_generator="ninja"
|
||||
os_fsfw="linux"
|
||||
builddir="build-Debug-Host"
|
||||
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" -l "${builddir}"
|
||||
# Use this if commands are added which should not be printed
|
||||
# set +x
|
||||
|
@ -1,34 +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-Q7S"
|
||||
build_generator="make"
|
||||
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}"
|
||||
# set +x
|
||||
|
@ -1,33 +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-Q7S"
|
||||
build_generator="make"
|
||||
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}" \
|
||||
-l"${build_dir}"
|
||||
# set +x
|
@ -1,34 +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-Q7S"
|
||||
build_generator="ninja"
|
||||
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}"
|
||||
# set +x
|
||||
|
@ -1,34 +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-Q7S"
|
||||
build_generator="ninja"
|
||||
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}" \
|
||||
-l"${build_dir}"
|
||||
# set +x
|
||||
|
@ -1,7 +0,0 @@
|
||||
#!/bin/bash -i
|
||||
export PATH=$PATH:"$HOME/EIVE/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin"
|
||||
export CROSS_COMPILE="arm-linux-gnueabihf"
|
||||
|
||||
export ZYNQ_7020_SYSROOT="/opt/xiphos/sdk/ark/sysroots/cortexa9hf-neon-xiphos-linux-gnueabi"
|
||||
export CONSOLE_PREFIX="[Q7S ENV]"
|
||||
/bin/bash
|
37
cmake/scripts/host/host-make-debug.sh
Executable file
37
cmake/scripts/host/host-make-debug.sh
Executable file
@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
cfg_script_name="cmake-build-cfg.py"
|
||||
init_dir=$(pwd)
|
||||
if [ -z "${EIVE_OBSW_ROOT}" ]; then
|
||||
counter=0
|
||||
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
|
||||
else
|
||||
cfg_script_name="${EIVE_OBSW_ROOT}/cmake/scripts/${cfg_script_name}"
|
||||
fi
|
||||
|
||||
build_generator="make"
|
||||
os_fsfw="host"
|
||||
builddir="cmake-build-debug"
|
||||
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" -l "${builddir}"
|
||||
# Use this if commands are added which should not be printed
|
||||
# set +x
|
37
cmake/scripts/host/host-make-release.sh
Executable file
37
cmake/scripts/host/host-make-release.sh
Executable file
@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
cfg_script_name="cmake-build-cfg.py"
|
||||
init_dir=$(pwd)
|
||||
if [ -z "${EIVE_OBSW_ROOT}" ]; then
|
||||
counter=0
|
||||
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
|
||||
else
|
||||
cfg_script_name="${EIVE_OBSW_ROOT}/cmake/scripts/${cfg_script_name}"
|
||||
fi
|
||||
|
||||
build_generator="Unix Makefiles"
|
||||
os_fsfw="host"
|
||||
builddir="cmake-build-release"
|
||||
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" -l "${builddir}"
|
||||
# Use this if commands are added which should not be printed
|
||||
# set +x
|
38
cmake/scripts/host/host-ninja-debug.sh
Executable file
38
cmake/scripts/host/host-ninja-debug.sh
Executable file
@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
cfg_script_name="cmake-build-cfg.py"
|
||||
init_dir=$(pwd)
|
||||
if [ -z "${EIVE_OBSW_ROOT}" ]; then
|
||||
counter=0
|
||||
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
|
||||
else
|
||||
cfg_script_name="${EIVE_OBSW_ROOT}/cmake/scripts/${cfg_script_name}"
|
||||
fi
|
||||
|
||||
build_generator="ninja"
|
||||
os_fsfw="host"
|
||||
builddir="cmake-build-debug"
|
||||
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" -l "${builddir}"
|
||||
# Use this if commands are added which should not be printed
|
||||
# set +x
|
||||
|
37
cmake/scripts/linux/host-make-debug.sh
Executable file
37
cmake/scripts/linux/host-make-debug.sh
Executable file
@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
cfg_script_name="cmake-build-cfg.py"
|
||||
init_dir=$(pwd)
|
||||
if [ -z "${EIVE_OBSW_ROOT}" ]; then
|
||||
counter=0
|
||||
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
|
||||
else
|
||||
cfg_script_name="${EIVE_OBSW_ROOT}/cmake/scripts/${cfg_script_name}"
|
||||
fi
|
||||
|
||||
build_generator="make"
|
||||
os_fsfw="linux"
|
||||
builddir="cmake-build-debug"
|
||||
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" -l "${builddir}"
|
||||
# Use this if commands are added which should not be printed
|
||||
# set +x
|
37
cmake/scripts/linux/host-make-release.sh
Executable file
37
cmake/scripts/linux/host-make-release.sh
Executable file
@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
cfg_script_name="cmake-build-cfg.py"
|
||||
init_dir=$(pwd)
|
||||
if [ -z "${EIVE_OBSW_ROOT}" ]; then
|
||||
counter=0
|
||||
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
|
||||
else
|
||||
cfg_script_name="${EIVE_OBSW_ROOT}/cmake/scripts/${cfg_script_name}"
|
||||
fi
|
||||
|
||||
build_generator="Unix Makefiles"
|
||||
os_fsfw="linux"
|
||||
builddir="cmake-build-release"
|
||||
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" -l "${builddir}"
|
||||
# Use this if commands are added which should not be printed
|
||||
# set +x
|
38
cmake/scripts/linux/host-ninja-debug.sh
Executable file
38
cmake/scripts/linux/host-ninja-debug.sh
Executable file
@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
cfg_script_name="cmake-build-cfg.py"
|
||||
init_dir=$(pwd)
|
||||
if [ -z "${EIVE_OBSW_ROOT}" ]; then
|
||||
counter=0
|
||||
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
|
||||
else
|
||||
cfg_script_name="${EIVE_OBSW_ROOT}/cmake/scripts/${cfg_script_name}"
|
||||
fi
|
||||
|
||||
build_generator="ninja"
|
||||
os_fsfw="linux"
|
||||
builddir="cmake-build-debug"
|
||||
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" -l "${builddir}"
|
||||
# Use this if commands are added which should not be printed
|
||||
# set +x
|
||||
|
48
cmake/scripts/q7s/q7s-make-debug.sh
Executable file
48
cmake/scripts/q7s/q7s-make-debug.sh
Executable file
@ -0,0 +1,48 @@
|
||||
#!/bin/bash
|
||||
cfg_script_name="cmake-build-cfg.py"
|
||||
init_dir=$(pwd)
|
||||
if [ -z "${EIVE_OBSW_ROOT}" ]; then
|
||||
counter=0
|
||||
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
|
||||
else
|
||||
cfg_script_name="${EIVE_OBSW_ROOT}/cmake/scripts/${cfg_script_name}"
|
||||
fi
|
||||
|
||||
if [ ! -z "${EIVE_Q7S_EM}" ]; then
|
||||
build_defs="EIVE_Q7S_EM=ON"
|
||||
fi
|
||||
|
||||
os_fsfw="linux"
|
||||
tgt_bsp="arm/q7s"
|
||||
build_dir="cmake-build-debug-q7s"
|
||||
if [ ! -z "${EIVE_Q7S_EM}" ]; then
|
||||
build_dir="${build_dir}-em"
|
||||
fi
|
||||
|
||||
build_generator="make"
|
||||
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 "${build_defs}"
|
||||
set +x
|
||||
|
||||
cd ${init_dir}
|
48
cmake/scripts/q7s/q7s-make-release.sh
Executable file
48
cmake/scripts/q7s/q7s-make-release.sh
Executable file
@ -0,0 +1,48 @@
|
||||
#!/bin/bash
|
||||
cfg_script_name="cmake-build-cfg.py"
|
||||
init_dir=$(pwd)
|
||||
if [[ -z ${EIVE_OBSW_ROOT} ]]; then
|
||||
counter=0
|
||||
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
|
||||
else
|
||||
cfg_script_name="${EIVE_OBSW_ROOT}/cmake/scripts/${cfg_script_name}"
|
||||
fi
|
||||
|
||||
if [ ! -z "${EIVE_Q7S_EM}" ]; then
|
||||
build_defs="EIVE_Q7S_EM=ON"
|
||||
fi
|
||||
|
||||
os_fsfw="linux"
|
||||
tgt_bsp="arm/q7s"
|
||||
build_dir="cmake-build-release-q7s"
|
||||
if [ ! -z "${EIVE_Q7S_EM}" ]; then
|
||||
build_dir="${build_dir}-em"
|
||||
fi
|
||||
build_generator="make"
|
||||
|
||||
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}" \
|
||||
-l"${build_dir}" -d "${build_defs}"
|
||||
set +x
|
||||
|
||||
cd ${init_dir}
|
48
cmake/scripts/q7s/q7s-ninja-debug.sh
Executable file
48
cmake/scripts/q7s/q7s-ninja-debug.sh
Executable file
@ -0,0 +1,48 @@
|
||||
#!/bin/bash
|
||||
cfg_script_name="cmake-build-cfg.py"
|
||||
init_dir=$(pwd)
|
||||
if [[ -z ${EIVE_OBSW_ROOT} ]]; then
|
||||
counter=0
|
||||
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
|
||||
else
|
||||
cfg_script_name="${EIVE_OBSW_ROOT}/cmake/scripts/${cfg_script_name}"
|
||||
fi
|
||||
|
||||
if [ ! -z "${EIVE_Q7S_EM}" ]; then
|
||||
build_defs="EIVE_Q7S_EM=ON"
|
||||
fi
|
||||
|
||||
os_fsfw="linux"
|
||||
tgt_bsp="arm/q7s"
|
||||
build_dir="cmake-build-debug-q7s"
|
||||
if [ ! -z "${EIVE_Q7S_EM}" ]; then
|
||||
build_dir="${build_dir}-em"
|
||||
fi
|
||||
|
||||
build_generator="ninja"
|
||||
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 "${build_defs}"
|
||||
set +x
|
||||
|
||||
cd ${init_dir}
|
48
cmake/scripts/q7s/q7s-ninja-release.sh
Executable file
48
cmake/scripts/q7s/q7s-ninja-release.sh
Executable file
@ -0,0 +1,48 @@
|
||||
#!/bin/bash
|
||||
cfg_script_name="cmake-build-cfg.py"
|
||||
init_dir=$(pwd)
|
||||
if [[ -z ${EIVE_OBSW_ROOT} ]]; then
|
||||
counter=0
|
||||
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
|
||||
else
|
||||
cfg_script_name="${EIVE_OBSW_ROOT}/cmake/scripts/${cfg_script_name}"
|
||||
fi
|
||||
|
||||
if [ ! -z "${EIVE_Q7S_EM}" ]; then
|
||||
build_defs="EIVE_Q7S_EM=ON"
|
||||
fi
|
||||
|
||||
os_fsfw="linux"
|
||||
tgt_bsp="arm/q7s"
|
||||
build_dir="cmake-build-release-q7s"
|
||||
if [ ! -z "${EIVE_Q7S_EM}" ]; then
|
||||
build_dir="${build_dir}-em"
|
||||
fi
|
||||
|
||||
build_generator="ninja"
|
||||
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}" \
|
||||
-l"${build_dir}" -d "${build_defs}"
|
||||
set +x
|
||||
|
||||
cd ${init_dir}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user