Merge branch 'mueller/acs-ss-init' into mueller/pl-ss
Some checks failed
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit
Some checks failed
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit
This commit is contained in:
commit
581423a40e
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -19,3 +19,6 @@
|
|||||||
[submodule "thirdparty/json"]
|
[submodule "thirdparty/json"]
|
||||||
path = thirdparty/json
|
path = thirdparty/json
|
||||||
url = https://github.com/nlohmann/json.git
|
url = https://github.com/nlohmann/json.git
|
||||||
|
[submodule "thirdparty/rapidcsv"]
|
||||||
|
path = thirdparty/rapidcsv
|
||||||
|
url = https://github.com/d99kris/rapidcsv.git
|
||||||
|
43
CHANGELOG.md
43
CHANGELOG.md
@ -10,6 +10,48 @@ list yields a list of all related PRs for each release.
|
|||||||
|
|
||||||
# [unreleased]
|
# [unreleased]
|
||||||
|
|
||||||
|
# [v1.12.0]
|
||||||
|
|
||||||
|
## Added
|
||||||
|
|
||||||
|
- ACS Subsystem. PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/231
|
||||||
|
- 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
|
||||||
|
|
||||||
|
### 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]
|
# [v1.11.0]
|
||||||
|
|
||||||
## Fixed
|
## Fixed
|
||||||
@ -18,7 +60,6 @@ list yields a list of all related PRs for each release.
|
|||||||
|
|
||||||
## Added
|
## Added
|
||||||
|
|
||||||
- ACS Subsystem. PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/231
|
|
||||||
- Custom Syrlinks FDIR which disabled most of the default FDIR functionality
|
- Custom Syrlinks FDIR which disabled most of the default FDIR functionality
|
||||||
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/232
|
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/232
|
||||||
- Custom Gomspace FDIR which disabled most of the default FDIR functionality
|
- Custom Gomspace FDIR which disabled most of the default FDIR functionality
|
||||||
|
264
CMakeLists.txt
264
CMakeLists.txt
@ -1,12 +1,12 @@
|
|||||||
################################################################################
|
# ##############################################################################
|
||||||
# CMake support for the EIVE OBSW
|
# CMake support for the EIVE OBSW
|
||||||
#
|
#
|
||||||
# Author: R. Mueller
|
# Author: R. Mueller
|
||||||
################################################################################
|
# ##############################################################################
|
||||||
|
|
||||||
################################################################################
|
# ##############################################################################
|
||||||
# Pre-Project preparation
|
# Pre-Project preparation
|
||||||
################################################################################
|
# ##############################################################################
|
||||||
cmake_minimum_required(VERSION 3.13)
|
cmake_minimum_required(VERSION 3.13)
|
||||||
|
|
||||||
set(OBSW_VERSION_MAJOR_IF_GIT_FAILS 0)
|
set(OBSW_VERSION_MAJOR_IF_GIT_FAILS 0)
|
||||||
@ -15,17 +15,23 @@ set(OBSW_VERSION_REVISION_IF_GIT_FAILS 0)
|
|||||||
|
|
||||||
# set(CMAKE_VERBOSE TRUE)
|
# 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 \
|
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)
|
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()
|
endif()
|
||||||
|
|
||||||
if(TGT_BSP)
|
if(TGT_BSP)
|
||||||
if(TGT_BSP MATCHES "arm/q7s" OR 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)
|
option(LINUX_CROSS_COMPILE ON)
|
||||||
endif()
|
endif()
|
||||||
if(TGT_BSP MATCHES "arm/raspberrypi" OR TGT_BSP MATCHES "arm/beagleboneblack")
|
if(TGT_BSP MATCHES "arm/raspberrypi" OR TGT_BSP MATCHES "arm/beagleboneblack")
|
||||||
@ -34,9 +40,11 @@ if(TGT_BSP)
|
|||||||
option(EIVE_Q7S_EM "Build configuration for the EM" OFF)
|
option(EIVE_Q7S_EM "Build configuration for the EM" OFF)
|
||||||
option(EIVE_BUILD_GPSD_GPS_HANDLER "Build GPSD dependent GPS Handler" ON)
|
option(EIVE_BUILD_GPSD_GPS_HANDLER "Build GPSD dependent GPS Handler" ON)
|
||||||
endif()
|
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()
|
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()
|
endif()
|
||||||
|
|
||||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||||
@ -57,38 +65,74 @@ option(EIVE_ADD_ETL_LIB "Add ETL library" ON)
|
|||||||
option(EIVE_ADD_JSON_LIB "Add JSON library" ON)
|
option(EIVE_ADD_JSON_LIB "Add JSON library" ON)
|
||||||
|
|
||||||
if(EIVE_Q7S_EM)
|
if(EIVE_Q7S_EM)
|
||||||
set(OBSW_Q7S_EM 1 CACHE STRING "Q7S EM configuration")
|
set(OBSW_Q7S_EM
|
||||||
|
1
|
||||||
|
CACHE STRING "Q7S EM configuration")
|
||||||
set(INIT_VAL 0)
|
set(INIT_VAL 0)
|
||||||
else()
|
else()
|
||||||
set(OBSW_Q7S_EM 0 CACHE STRING "Q7S EM configuration")
|
set(OBSW_Q7S_EM
|
||||||
|
0
|
||||||
|
CACHE STRING "Q7S EM configuration")
|
||||||
set(INIT_VAL 1)
|
set(INIT_VAL 1)
|
||||||
endif()
|
endif()
|
||||||
set(OBSW_ADD_MGT ${INIT_VAL} CACHE STRING "Add MGT module" )
|
set(OBSW_ADD_MGT
|
||||||
set(OBSW_ADD_BPX_BATTERY_HANDLER ${INIT_VAL} CACHE STRING "Add MGT module")
|
${INIT_VAL}
|
||||||
set(OBSW_ADD_STAR_TRACKER ${INIT_VAL} CACHE STRING "Add Startracker module")
|
CACHE STRING "Add MGT module")
|
||||||
set(OBSW_ADD_SUN_SENSORS ${INIT_VAL} CACHE STRING "Add sun sensor module")
|
set(OBSW_ADD_BPX_BATTERY_HANDLER
|
||||||
set(OBSW_ADD_SUS_BOARD_ASS ${INIT_VAL} CACHE STRING "Add sun sensor board assembly")
|
${INIT_VAL}
|
||||||
set(OBSW_ADD_ACS_BOARD ${INIT_VAL} CACHE STRING "Add ACS board module")
|
CACHE STRING "Add MGT module")
|
||||||
set(OBSW_ADD_ACS_HANDLERS ${INIT_VAL} CACHE STRING "Add ACS handlers")
|
set(OBSW_ADD_STAR_TRACKER
|
||||||
set(OBSW_ADD_RTD_DEVICES ${INIT_VAL} CACHE STRING "Add RTD devices")
|
${INIT_VAL}
|
||||||
set(OBSW_ADD_RAD_SENSORS ${INIT_VAL} CACHE STRING "Add Rad Sensor module")
|
CACHE STRING "Add Startracker module")
|
||||||
set(OBSW_ADD_PL_PCDU ${INIT_VAL} CACHE STRING "Add Payload PCDU modukle")
|
set(OBSW_ADD_SUN_SENSORS
|
||||||
set(OBSW_ADD_SYRLINKS ${INIT_VAL} CACHE STRING "Add Syrlinks module")
|
${INIT_VAL}
|
||||||
set(OBSW_ADD_TMP_DEVICES ${INIT_VAL} CACHE STRING "Add TMP devices")
|
CACHE STRING "Add sun sensor module")
|
||||||
set(OBSW_ADD_GOMSPACE_PCDU ${INIT_VAL} CACHE STRING "Add GomSpace PCDU modules")
|
set(OBSW_ADD_SUS_BOARD_ASS
|
||||||
set(OBSW_ADD_RW ${INIT_VAL} CACHE STRING "Add RW modules")
|
${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
|
# Pre-Sources preparation
|
||||||
################################################################################
|
# ##############################################################################
|
||||||
|
|
||||||
# Version handling
|
# Version handling
|
||||||
set(GIT_VER_HANDLING_OK FALSE)
|
set(GIT_VER_HANDLING_OK FALSE)
|
||||||
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
|
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
|
||||||
determine_version_with_git("--exclude" "docker_*")
|
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)
|
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 1 OBSW_VERSION_MAJOR)
|
||||||
list(GET GIT_INFO 2 OBSW_VERSION_MINOR)
|
list(GET GIT_INFO 2 OBSW_VERSION_MINOR)
|
||||||
list(GET GIT_INFO 3 OBSW_VERSION_REVISION)
|
list(GET GIT_INFO 3 OBSW_VERSION_REVISION)
|
||||||
@ -157,12 +201,14 @@ pre_source_hw_os_config()
|
|||||||
|
|
||||||
if(TGT_BSP)
|
if(TGT_BSP)
|
||||||
set(LIBGPS_VERSION_MAJOR 3)
|
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)
|
set(LIBGPS_VERSION_MINOR 20)
|
||||||
if(TGT_BSP MATCHES "arm/q7s" OR TGT_BSP MATCHES "arm/raspberrypi"
|
if(TGT_BSP MATCHES "arm/q7s"
|
||||||
OR TGT_BSP MATCHES "arm/beagleboneblack" OR TGT_BSP MATCHES "arm/egse"
|
OR TGT_BSP MATCHES "arm/raspberrypi"
|
||||||
OR TGT_BSP MATCHES "arm/te0720-1cfa"
|
OR TGT_BSP MATCHES "arm/beagleboneblack"
|
||||||
)
|
OR TGT_BSP MATCHES "arm/egse"
|
||||||
|
OR TGT_BSP MATCHES "arm/te0720-1cfa")
|
||||||
find_library(${LIB_GPS} gps)
|
find_library(${LIB_GPS} gps)
|
||||||
set(FSFW_CONFIG_PATH "linux/fsfwconfig")
|
set(FSFW_CONFIG_PATH "linux/fsfwconfig")
|
||||||
if(NOT BUILD_Q7S_SIMPLE_MODE)
|
if(NOT BUILD_Q7S_SIMPLE_MODE)
|
||||||
@ -206,7 +252,6 @@ else()
|
|||||||
set(FSFW_CONFIG_PATH "${BSP_PATH}/fsfwconfig")
|
set(FSFW_CONFIG_PATH "${BSP_PATH}/fsfwconfig")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
# Configuration files
|
# Configuration files
|
||||||
configure_file(${COMMON_CONFIG_PATH}/commonConfig.h.in commonConfig.h)
|
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}/FSFWConfig.h.in FSFWConfig.h)
|
||||||
@ -220,14 +265,12 @@ endif()
|
|||||||
configure_file(${WATCHDOG_PATH}/watchdogConf.h.in watchdogConf.h)
|
configure_file(${WATCHDOG_PATH}/watchdogConf.h.in watchdogConf.h)
|
||||||
|
|
||||||
# Set common config path for FSFW
|
# Set common config path for FSFW
|
||||||
set(FSFW_ADDITIONAL_INC_PATHS
|
set(FSFW_ADDITIONAL_INC_PATHS "${COMMON_PATH}/config"
|
||||||
"${COMMON_PATH}/config"
|
${CMAKE_CURRENT_BINARY_DIR})
|
||||||
${CMAKE_CURRENT_BINARY_DIR}
|
|
||||||
)
|
|
||||||
|
|
||||||
################################################################################
|
# ##############################################################################
|
||||||
# Executable and Sources
|
# 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")
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||||
@ -252,20 +295,15 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
|||||||
"-Wcast-qual" # Warn if the constness is cast away
|
"-Wcast-qual" # Warn if the constness is cast away
|
||||||
"-Wstringop-overflow=4"
|
"-Wstringop-overflow=4"
|
||||||
# -Wstack-protector # Emits a few false positives for low level access
|
# -Wstack-protector # Emits a few false positives for low level access
|
||||||
# -Wconversion # Creates many false positives
|
# -Wconversion # Creates many false positives -Warith-conversion # Use with
|
||||||
# -Warith-conversion # Use with Wconversion to find more implicit conversions
|
# Wconversion to find more implicit conversions -fanalyzer # Should be used
|
||||||
# -fanalyzer # Should be used to look through problems
|
# to look through problems
|
||||||
)
|
)
|
||||||
# Remove unused sections.
|
# Remove unused sections.
|
||||||
add_compile_options(
|
add_compile_options("-ffunction-sections" "-fdata-sections")
|
||||||
"-ffunction-sections"
|
|
||||||
"-fdata-sections"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Removed unused sections.
|
# Removed unused sections.
|
||||||
add_link_options(
|
add_link_options("-Wl,--gc-sections")
|
||||||
"-Wl,--gc-sections"
|
|
||||||
)
|
|
||||||
|
|
||||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||||
set(COMPILER_FLAGS "/permissive-")
|
set(COMPILER_FLAGS "/permissive-")
|
||||||
@ -275,11 +313,8 @@ add_library(${LIB_EIVE_MISSION})
|
|||||||
|
|
||||||
# Add main executable
|
# Add main executable
|
||||||
add_executable(${OBSW_NAME})
|
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})
|
set(OBSW_BIN_NAME ${CMAKE_PROJECT_NAME})
|
||||||
endif()
|
|
||||||
set_target_properties(${OBSW_NAME} PROPERTIES OUTPUT_NAME ${OBSW_BIN_NAME})
|
set_target_properties(${OBSW_NAME} PROPERTIES OUTPUT_NAME ${OBSW_BIN_NAME})
|
||||||
|
|
||||||
# Watchdog
|
# Watchdog
|
||||||
@ -290,23 +325,26 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_subdirectory(${WATCHDOG_PATH})
|
add_subdirectory(${WATCHDOG_PATH})
|
||||||
target_link_libraries(${WATCHDOG_NAME} PUBLIC
|
target_link_libraries(${WATCHDOG_NAME} PUBLIC ${LIB_CXX_FS})
|
||||||
${LIB_CXX_FS}
|
target_include_directories(${WATCHDOG_NAME} PUBLIC ${CMAKE_BINARY_DIR})
|
||||||
)
|
|
||||||
target_include_directories(${WATCHDOG_NAME} PUBLIC
|
|
||||||
${CMAKE_BINARY_DIR}
|
|
||||||
)
|
|
||||||
|
|
||||||
# unittests
|
# unittests
|
||||||
|
if(NOT TGT_BSP)
|
||||||
|
add_executable(${UNITTEST_NAME})
|
||||||
|
else()
|
||||||
add_executable(${UNITTEST_NAME} EXCLUDE_FROM_ALL)
|
add_executable(${UNITTEST_NAME} EXCLUDE_FROM_ALL)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(EIVE_ADD_ETL_LIB)
|
if(EIVE_ADD_ETL_LIB)
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(EIVE_ADD_JSON_LIB)
|
if(EIVE_ADD_JSON_LIB)
|
||||||
add_subdirectory(${LIB_JSON_PATH})
|
add_subdirectory(${LIB_JSON_PATH})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
add_subdirectory(thirdparty/rapidcsv)
|
||||||
|
|
||||||
if(EIVE_ADD_LINUX_FILES)
|
if(EIVE_ADD_LINUX_FILES)
|
||||||
add_subdirectory(${LIB_ARCSEC_PATH})
|
add_subdirectory(${LIB_ARCSEC_PATH})
|
||||||
add_subdirectory(${LINUX_PATH})
|
add_subdirectory(${LINUX_PATH})
|
||||||
@ -325,39 +363,41 @@ add_subdirectory(${TEST_PATH})
|
|||||||
|
|
||||||
add_subdirectory(${UNITTEST_PATH})
|
add_subdirectory(${UNITTEST_PATH})
|
||||||
|
|
||||||
# This should have already been downloaded by the FSFW
|
# This should have already been downloaded by the FSFW Still include it to be
|
||||||
# Still include it to be safe
|
# safe
|
||||||
find_package(etl ${FSFW_ETL_LIB_MAJOR_VERSION} CONFIG QUIET)
|
find_package(etl ${FSFW_ETL_LIB_MAJOR_VERSION} CONFIG QUIET)
|
||||||
# Not installed, so use FetchContent to download and provide etl
|
# Not installed, so use FetchContent to download and provide etl
|
||||||
if(NOT etl_FOUND)
|
if(NOT etl_FOUND)
|
||||||
message(STATUS
|
message(
|
||||||
|
STATUS
|
||||||
"No ETL installation was found with find_package. Installing and providing "
|
"No ETL installation was found with find_package. Installing and providing "
|
||||||
"etl with FindPackage"
|
"etl with FindPackage")
|
||||||
)
|
|
||||||
include(FetchContent)
|
include(FetchContent)
|
||||||
FetchContent_Declare(
|
FetchContent_Declare(
|
||||||
etl
|
etl
|
||||||
GIT_REPOSITORY https://github.com/ETLCPP/etl
|
GIT_REPOSITORY https://github.com/ETLCPP/etl
|
||||||
GIT_TAG ${FSFW_ETL_LIB_VERSION}
|
GIT_TAG ${FSFW_ETL_LIB_VERSION})
|
||||||
)
|
|
||||||
list(APPEND FSFW_FETCH_CONTENT_TARGETS etl)
|
list(APPEND FSFW_FETCH_CONTENT_TARGETS etl)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Use same Catch2 version as framework
|
# 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"))
|
AND NOT (TGT_BSP MATCHES "arm/raspberrypi"))
|
||||||
# Check whether the user has already installed Catch2 first
|
# Check whether the user has already installed Catch2 first
|
||||||
find_package(Catch2 ${FSFW_CATCH2_LIB_MAJOR_VERSION} CONFIG QUIET)
|
find_package(Catch2 ${FSFW_CATCH2_LIB_MAJOR_VERSION} CONFIG QUIET)
|
||||||
# Not installed, so use FetchContent to download and provide Catch2
|
# Not installed, so use FetchContent to download and provide Catch2
|
||||||
if(NOT Catch2_FOUND)
|
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)
|
include(FetchContent)
|
||||||
|
|
||||||
FetchContent_Declare(
|
FetchContent_Declare(
|
||||||
Catch2
|
Catch2
|
||||||
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
|
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
|
||||||
GIT_TAG ${FSFW_CATCH2_LIB_VERSION}
|
GIT_TAG ${FSFW_CATCH2_LIB_VERSION})
|
||||||
)
|
|
||||||
|
|
||||||
list(APPEND FSFW_FETCH_CONTENT_TARGETS Catch2)
|
list(APPEND FSFW_FETCH_CONTENT_TARGETS Catch2)
|
||||||
endif()
|
endif()
|
||||||
@ -372,90 +412,62 @@ if(FSFW_FETCH_CONTENT_TARGETS)
|
|||||||
add_library(${LIB_ETL_TARGET} ALIAS etl)
|
add_library(${LIB_ETL_TARGET} ALIAS etl)
|
||||||
endif()
|
endif()
|
||||||
if(TARGET Catch2)
|
if(TARGET Catch2)
|
||||||
# Fixes regression -preview4, to be confirmed in later releases
|
# Fixes regression -preview4, to be confirmed in later releases Related
|
||||||
# Related GitHub issue: https://github.com/catchorg/Catch2/issues/2417
|
# GitHub issue: https://github.com/catchorg/Catch2/issues/2417
|
||||||
set_target_properties(Catch2 PROPERTIES DEBUG_POSTFIX "")
|
set_target_properties(Catch2 PROPERTIES DEBUG_POSTFIX "")
|
||||||
set_target_properties(Catch2 PROPERTIES EXCLUDE_FROM_ALL "true")
|
set_target_properties(Catch2 PROPERTIES EXCLUDE_FROM_ALL "true")
|
||||||
set_target_properties(Catch2WithMain PROPERTIES EXCLUDE_FROM_ALL "true")
|
set_target_properties(Catch2WithMain PROPERTIES EXCLUDE_FROM_ALL "true")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
################################################################################
|
# ##############################################################################
|
||||||
# Post-Sources preparation
|
# Post-Sources preparation
|
||||||
################################################################################
|
# ##############################################################################
|
||||||
|
|
||||||
# Add libraries
|
# Add libraries
|
||||||
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC
|
target_link_libraries(${LIB_EIVE_MISSION}
|
||||||
${LIB_FSFW_NAME}
|
PUBLIC ${LIB_FSFW_NAME} ${LIB_LWGPS_NAME} ${LIB_OS_NAME})
|
||||||
${LIB_LWGPS_NAME}
|
|
||||||
${LIB_OS_NAME}
|
|
||||||
)
|
|
||||||
|
|
||||||
target_link_libraries(${OBSW_NAME} PRIVATE
|
target_link_libraries(${OBSW_NAME} PRIVATE ${LIB_EIVE_MISSION})
|
||||||
${LIB_EIVE_MISSION}
|
|
||||||
)
|
|
||||||
|
|
||||||
if(TGT_BSP MATCHES "arm/q7s")
|
if(TGT_BSP MATCHES "arm/q7s")
|
||||||
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC
|
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC ${LIB_GPS} ${LIB_ARCSEC})
|
||||||
${LIB_GPS}
|
|
||||||
${LIB_ARCSEC}
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(${UNITTEST_NAME} PRIVATE
|
target_link_libraries(${UNITTEST_NAME} PRIVATE Catch2 ${LIB_EIVE_MISSION}
|
||||||
Catch2
|
rapidcsv)
|
||||||
${LIB_EIVE_MISSION}
|
|
||||||
)
|
|
||||||
|
|
||||||
if(TGT_BSP MATCHES "arm/egse")
|
if(TGT_BSP MATCHES "arm/egse")
|
||||||
target_link_libraries(${OBSW_NAME} PRIVATE
|
target_link_libraries(${OBSW_NAME} PRIVATE ${LIB_ARCSEC})
|
||||||
${LIB_ARCSEC}
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ADD_CSP_LIB)
|
if(ADD_CSP_LIB)
|
||||||
target_link_libraries(${OBSW_NAME} PRIVATE
|
target_link_libraries(${OBSW_NAME} PRIVATE ${LIB_CSP_NAME})
|
||||||
${LIB_CSP_NAME}
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
if(EIVE_ADD_ETL_LIB)
|
if(EIVE_ADD_ETL_LIB)
|
||||||
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC
|
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC ${LIB_ETL_TARGET})
|
||||||
${LIB_ETL_TARGET}
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(EIVE_ADD_JSON_LIB)
|
if(EIVE_ADD_JSON_LIB)
|
||||||
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC
|
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC ${LIB_JSON_NAME})
|
||||||
${LIB_JSON_NAME}
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC
|
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC ${LIB_CXX_FS})
|
||||||
${LIB_CXX_FS}
|
|
||||||
)
|
|
||||||
|
|
||||||
# Add include paths for all sources.
|
# Add include paths for all sources.
|
||||||
target_include_directories(${LIB_EIVE_MISSION} PUBLIC
|
target_include_directories(
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
${LIB_EIVE_MISSION} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${FSFW_CONFIG_PATH}
|
||||||
${FSFW_CONFIG_PATH}
|
${CMAKE_CURRENT_BINARY_DIR} ${LIB_ARCSEC_PATH})
|
||||||
${CMAKE_CURRENT_BINARY_DIR}
|
|
||||||
${LIB_ARCSEC_PATH}
|
|
||||||
)
|
|
||||||
|
|
||||||
if(TGT_BSP MATCHES "arm/q7s" OR TGT_BSP MATCHES "arm/egse")
|
if(TGT_BSP MATCHES "arm/q7s" OR TGT_BSP MATCHES "arm/egse")
|
||||||
target_include_directories(${LIB_EIVE_MISSION} PUBLIC
|
target_include_directories(${LIB_EIVE_MISSION} PUBLIC ${ARCSEC_LIB_PATH})
|
||||||
${ARCSEC_LIB_PATH}
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CMAKE_VERBOSE)
|
if(CMAKE_VERBOSE)
|
||||||
message(STATUS "Warning flags: ${WARNING_FLAGS}")
|
message(STATUS "Warning flags: ${WARNING_FLAGS}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(CMAKE_CROSSCOMPILING)
|
if(CMAKE_CROSSCOMPILING)
|
||||||
include(HardwareOsPostConfig)
|
include(HardwareOsPostConfig)
|
||||||
post_source_hw_os_config()
|
post_source_hw_os_config()
|
||||||
@ -480,19 +492,15 @@ endif()
|
|||||||
|
|
||||||
install(TARGETS ${OBSW_NAME} RUNTIME DESTINATION bin)
|
install(TARGETS ${OBSW_NAME} RUNTIME DESTINATION bin)
|
||||||
|
|
||||||
string(CONCAT POST_BUILD_COMMENT
|
string(CONCAT POST_BUILD_COMMENT "Build directory: ${CMAKE_BINARY_DIR}\n"
|
||||||
"Build directory: ${CMAKE_BINARY_DIR}\n"
|
|
||||||
"Target OSAL: ${FSFW_OSAL}\n"
|
"Target OSAL: ${FSFW_OSAL}\n"
|
||||||
"Target Build Type: ${CMAKE_BUILD_TYPE}\n"
|
"Target Build Type: ${CMAKE_BUILD_TYPE}\n" "${TARGET_STRING}")
|
||||||
"${TARGET_STRING}"
|
|
||||||
)
|
|
||||||
|
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
TARGET ${OBSW_NAME}
|
TARGET ${OBSW_NAME}
|
||||||
POST_BUILD
|
POST_BUILD
|
||||||
COMMAND ${CMAKE_SIZE} ${OBSW_BIN_NAME}${FILE_SUFFIX}
|
COMMAND ${CMAKE_SIZE} ${OBSW_BIN_NAME}${FILE_SUFFIX}
|
||||||
COMMENT ${POST_BUILD_COMMENT}
|
COMMENT ${POST_BUILD_COMMENT})
|
||||||
)
|
|
||||||
|
|
||||||
include(BuildType)
|
include(BuildType)
|
||||||
set_build_type()
|
set_build_type()
|
||||||
|
127
README.md
127
README.md
@ -70,8 +70,9 @@ prerequisites.
|
|||||||
## Building the OBSW and flashing it on the Q7S
|
## Building the OBSW and flashing it on the Q7S
|
||||||
|
|
||||||
1. ARM cross-compiler installed, either as part of [Vivado 2018.2 installation](#vivado) or
|
1. ARM cross-compiler installed, either as part of [Vivado 2018.2 installation](#vivado) or
|
||||||
as a [separate download](#arm-toolchain)
|
as a [separate download](#arm-toolchain). The Xiphos SDK also installs a cross-compiler,
|
||||||
2. [Q7S sysroot](#sysroot) on local development machine
|
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. Recommended: Eclipse or [Vivado 2018.2 SDK](#vivado) for OBSW development
|
||||||
3. [TCF agent](https://wiki.eclipse.org/TCF) running on Q7S
|
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
|
1. Clone the repository with
|
||||||
|
|
||||||
```sh
|
```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
|
2. Update all the submodules
|
||||||
@ -151,6 +152,53 @@ When using Windows, run theses steps in MSYS2.
|
|||||||
cmake --build . -j
|
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
|
## Building in Xilinx SDK 2018.2
|
||||||
|
|
||||||
1. Open Xilinx SDK 2018.2
|
1. Open Xilinx SDK 2018.2
|
||||||
@ -326,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
|
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).
|
[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
|
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,
|
the TCF plugin and downloading the cross-compiler as specified in the section below. However,
|
||||||
@ -342,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/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 .
|
* 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.
|
Installation was tested on Windows and Ubuntu 21.04.
|
||||||
@ -661,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
|
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
|
* 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
|
is 192.168.133.2
|
||||||
|
4. Make sure th `tcf-agent` is running by checking `systemctl status tcf-agent`
|
||||||
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
|
|
||||||
```
|
|
||||||
|
|
||||||
5. In Xilinx SDK 2018.2 right click on project → Debug As → Debug Configurations
|
5. In Xilinx SDK 2018.2 right click on project → Debug As → Debug Configurations
|
||||||
6. Right click Xilinx C/C++ applicaton (System Debugger) → New →
|
6. Right click Xilinx C/C++ applicaton (System Debugger) → New →
|
||||||
7. Set Debug Type to Linux Application Debug and Connectin to Linux Agent
|
7. Set Debug Type to Linux Application Debug and Connectin to Linux Agent
|
||||||
@ -699,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)
|
11. Test connection (This ensures the TCF Agent is running on the Q7S)
|
||||||
12. Select Application tab
|
12. Select Application tab
|
||||||
* Project Name: eive_obsw
|
* Project Name: eive_obsw
|
||||||
* Local File Path: Path to eiveobsw-linux.elf (in `_bin\linux\devel`)
|
* Local File Path: Path to OBSW application image with debug symbols (non-stripped)
|
||||||
* Remote File Path: `/tmp/eive_obsw.elf`
|
* Remote File Path: `/tmp/<OBSW NAME>`
|
||||||
|
|
||||||
# <a id="file-transfer"></a> Transfering Files to the Q7S
|
# <a id="file-transfer"></a> Transfering Files to the Q7S
|
||||||
|
|
||||||
@ -726,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/>
|
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
|
# <a id="q7s"></a> Q7S OBC
|
||||||
|
|
||||||
@ -1106,16 +1127,28 @@ Eclipse indexer.
|
|||||||
|
|
||||||
The [TCF agent](https://wiki.eclipse.org/TCF) can be used to perform remote debugging on the Q7S.
|
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
|
the [releases](https://www.eclipse.org/tcf/downloads.php). Go to
|
||||||
Help → Install New Software and use the download page, for
|
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.
|
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.
|
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:
|
Alternatively:
|
||||||
|
|
||||||
- Create a new **TCF Remote Application** by pressing the cogs button at the top or going to
|
- Create a new **TCF Remote Application** by pressing the cogs button at the top or going to
|
||||||
@ -1204,7 +1237,7 @@ in the same way.
|
|||||||
|
|
||||||
* the formatting is based on the clang-format tools
|
* 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
|
1. Help → Install New Software → Add
|
||||||
2. In location insert the link http://www.cppstyle.com/luna
|
2. In location insert the link http://www.cppstyle.com/luna
|
||||||
@ -1214,3 +1247,11 @@ in the same way.
|
|||||||
6. Insert the path to the clang-format executable
|
6. Insert the path to the clang-format executable
|
||||||
7. Under C/C++ → Code Style → Formatter, change the formatter to CppStyle (clang-format)
|
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
|
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
|
RUN apt-get --yes upgrade
|
||||||
#tzdata is a dependency, won't install otherwise
|
#tzdata is a dependency, won't install otherwise
|
||||||
ARG DEBIAN_FRONTEND=noninteractive
|
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.
|
ARG XIPHOS_SDK_NAME=sdk-xiphos-eive-v0.2.0
|
||||||
RUN mkdir -p /usr/rootfs; \
|
# Install Xiphos ARK SDK, which also installs Q7S root filesystem, required for cross-compilation.
|
||||||
curl https://buggy.irs.uni-stuttgart.de/eive/tools/eive-compile-rootfs-v0.1.0-7-gae69838.tar.xz \
|
RUN curl https://buggy.irs.uni-stuttgart.de/eive/tools/${XIPHOS_SDK_NAME}.tar | tar -x && \
|
||||||
| tar -xJ -C /usr/rootfs
|
cd ${XIPHOS_SDK_NAME} && \
|
||||||
|
./ark-glibc-x86_64-eive-image-cortexa9hf-neon-toolchain-nodistro.0.sh -y
|
||||||
|
|
||||||
# Cross compiler
|
# Cross compiler
|
||||||
RUN mkdir -p /usr/tools; \
|
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 \
|
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
|
| 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"
|
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 {
|
agent {
|
||||||
docker {
|
docker {
|
||||||
image 'eive-obsw-ci:d4'
|
image 'eive-obsw-ci:d5'
|
||||||
args '--sysctl fs.mqueue.msg_max=100'
|
args '--sysctl fs.mqueue.msg_max=100'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -24,11 +24,11 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Unittests') {
|
stage('Build Host and Tests') {
|
||||||
steps {
|
steps {
|
||||||
dir(BUILDDIR_LINUX) {
|
dir(BUILDDIR_LINUX) {
|
||||||
sh 'cmake ..'
|
sh 'cmake ..'
|
||||||
sh 'cmake --build . -t eive-unittest -j4'
|
sh 'cmake --build . -j4'
|
||||||
sh './eive-unittest'
|
sh './eive-unittest'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,3 @@
|
|||||||
target_sources(${OBSW_NAME} PUBLIC
|
target_sources(${OBSW_NAME} PUBLIC InitMission.cpp main.cpp ObjectFactory.cpp)
|
||||||
InitMission.cpp
|
|
||||||
main.cpp
|
|
||||||
ObjectFactory.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
add_subdirectory(boardconfig)
|
add_subdirectory(boardconfig)
|
||||||
|
@ -1,7 +1,3 @@
|
|||||||
target_sources(${OBSW_NAME} PRIVATE
|
target_sources(${OBSW_NAME} PRIVATE print.c)
|
||||||
print.c
|
|
||||||
)
|
|
||||||
|
|
||||||
target_include_directories(${OBSW_NAME} PUBLIC
|
target_include_directories(${OBSW_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
|
||||||
)
|
|
||||||
|
@ -1,8 +1,4 @@
|
|||||||
target_sources(${OBSW_NAME} PUBLIC
|
target_sources(${OBSW_NAME} PUBLIC InitMission.cpp main.cpp ObjectFactory.cpp)
|
||||||
InitMission.cpp
|
|
||||||
main.cpp
|
|
||||||
ObjectFactory.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
add_subdirectory(fsfwconfig)
|
add_subdirectory(fsfwconfig)
|
||||||
add_subdirectory(boardconfig)
|
add_subdirectory(boardconfig)
|
||||||
|
@ -131,6 +131,7 @@ void initmission::initTasks() {
|
|||||||
|
|
||||||
PeriodicTaskIF* testTask = factory->createPeriodicTask(
|
PeriodicTaskIF* testTask = factory->createPeriodicTask(
|
||||||
"TEST_TASK", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc);
|
"TEST_TASK", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc);
|
||||||
|
static_cast<void>(testTask);
|
||||||
#if OBSW_ADD_TEST_CODE == 1
|
#if OBSW_ADD_TEST_CODE == 1
|
||||||
result = testTask->addComponent(objects::TEST_TASK);
|
result = testTask->addComponent(objects::TEST_TASK);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
@ -7,9 +7,9 @@
|
|||||||
#include <objects/systemObjectList.h>
|
#include <objects/systemObjectList.h>
|
||||||
#include <tmtc/apid.h>
|
#include <tmtc/apid.h>
|
||||||
#include <tmtc/pusIds.h>
|
#include <tmtc/pusIds.h>
|
||||||
#include "fsfw_tests/integration/task/TestTask.h"
|
|
||||||
|
|
||||||
#include "OBSWConfig.h"
|
#include "OBSWConfig.h"
|
||||||
|
#include "fsfw_tests/integration/task/TestTask.h"
|
||||||
|
|
||||||
#if OBSW_USE_TMTC_TCP_BRIDGE == 0
|
#if OBSW_USE_TMTC_TCP_BRIDGE == 0
|
||||||
#include "fsfw/osal/common/UdpTcPollingTask.h"
|
#include "fsfw/osal/common/UdpTcPollingTask.h"
|
||||||
|
@ -1,10 +1,3 @@
|
|||||||
target_sources(${OBSW_NAME} PRIVATE
|
target_sources(${OBSW_NAME} PRIVATE print.c)
|
||||||
print.c
|
|
||||||
)
|
|
||||||
|
|
||||||
target_include_directories(${OBSW_NAME} PUBLIC
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
target_include_directories(${OBSW_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
@ -1,8 +1 @@
|
|||||||
target_sources(${TARGET_NAME} PUBLIC
|
target_sources(${TARGET_NAME} PUBLIC ArduinoComIF.cpp ArduinoCookie.cpp)
|
||||||
ArduinoComIF.cpp
|
|
||||||
ArduinoCookie.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,27 +1,15 @@
|
|||||||
target_sources(${OBSW_NAME} PRIVATE
|
target_sources(${OBSW_NAME} PRIVATE ipc/MissionMessageTypes.cpp)
|
||||||
ipc/MissionMessageTypes.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
target_include_directories(${OBSW_NAME} PUBLIC
|
target_include_directories(${OBSW_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
|
||||||
)
|
|
||||||
|
|
||||||
# If a special translation file for object IDs exists, compile it.
|
# If a special translation file for object IDs exists, compile it.
|
||||||
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/objects/translateObjects.cpp")
|
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/objects/translateObjects.cpp")
|
||||||
target_sources(${OBSW_NAME} PRIVATE
|
target_sources(${OBSW_NAME} PRIVATE objects/translateObjects.cpp)
|
||||||
objects/translateObjects.cpp
|
target_sources(${UNITTEST_NAME} PRIVATE objects/translateObjects.cpp)
|
||||||
)
|
|
||||||
target_sources(${UNITTEST_NAME} PRIVATE
|
|
||||||
objects/translateObjects.cpp
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# If a special translation file for events exists, compile it.
|
# If a special translation file for events exists, compile it.
|
||||||
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/objects/translateObjects.cpp")
|
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/objects/translateObjects.cpp")
|
||||||
target_sources(${OBSW_NAME} PRIVATE
|
target_sources(${OBSW_NAME} PRIVATE events/translateEvents.cpp)
|
||||||
events/translateEvents.cpp
|
target_sources(${UNITTEST_NAME} PRIVATE events/translateEvents.cpp)
|
||||||
)
|
|
||||||
target_sources(${UNITTEST_NAME} PRIVATE
|
|
||||||
events/translateEvents.cpp
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
@ -1,9 +1,5 @@
|
|||||||
target_sources(${OBSW_NAME} PUBLIC
|
target_sources(${OBSW_NAME} PUBLIC InitMission.cpp main.cpp gpioInit.cpp
|
||||||
InitMission.cpp
|
ObjectFactory.cpp)
|
||||||
main.cpp
|
|
||||||
gpioInit.cpp
|
|
||||||
ObjectFactory.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
add_subdirectory(boardconfig)
|
add_subdirectory(boardconfig)
|
||||||
add_subdirectory(boardtest)
|
add_subdirectory(boardtest)
|
||||||
|
@ -1,7 +1,3 @@
|
|||||||
target_sources(${OBSW_NAME} PRIVATE
|
target_sources(${OBSW_NAME} PRIVATE print.c)
|
||||||
print.c
|
|
||||||
)
|
|
||||||
|
|
||||||
target_include_directories(${OBSW_NAME} PUBLIC
|
target_include_directories(${OBSW_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
|
||||||
)
|
|
||||||
|
@ -1,6 +1 @@
|
|||||||
target_sources(${OBSW_NAME} PRIVATE
|
target_sources(${OBSW_NAME} PRIVATE)
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,20 +1,13 @@
|
|||||||
# simple mode
|
# simple mode
|
||||||
add_executable(${SIMPLE_OBSW_NAME} EXCLUDE_FROM_ALL)
|
add_executable(${SIMPLE_OBSW_NAME} EXCLUDE_FROM_ALL)
|
||||||
target_compile_definitions(${SIMPLE_OBSW_NAME} PRIVATE "Q7S_SIMPLE_MODE")
|
target_compile_definitions(${SIMPLE_OBSW_NAME} PRIVATE "Q7S_SIMPLE_MODE")
|
||||||
target_sources(${SIMPLE_OBSW_NAME} PUBLIC
|
target_sources(${SIMPLE_OBSW_NAME} PUBLIC main.cpp)
|
||||||
main.cpp
|
|
||||||
)
|
|
||||||
# I think this is unintentional? (produces linker errors for stuff in /linux)
|
# I think this is unintentional? (produces linker errors for stuff in /linux)
|
||||||
target_link_libraries(${SIMPLE_OBSW_NAME} PUBLIC
|
target_link_libraries(${SIMPLE_OBSW_NAME} PUBLIC ${LIB_FSFW_NAME})
|
||||||
${LIB_FSFW_NAME}
|
|
||||||
)
|
|
||||||
target_compile_definitions(${SIMPLE_OBSW_NAME} PRIVATE "Q7S_SIMPLE_MODE")
|
target_compile_definitions(${SIMPLE_OBSW_NAME} PRIVATE "Q7S_SIMPLE_MODE")
|
||||||
add_subdirectory(simple)
|
add_subdirectory(simple)
|
||||||
|
|
||||||
target_sources(${OBSW_NAME} PUBLIC
|
target_sources(${OBSW_NAME} PUBLIC main.cpp obsw.cpp)
|
||||||
main.cpp
|
|
||||||
obsw.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
add_subdirectory(boardtest)
|
add_subdirectory(boardtest)
|
||||||
|
|
||||||
@ -25,7 +18,7 @@ add_subdirectory(core)
|
|||||||
if(EIVE_Q7S_EM)
|
if(EIVE_Q7S_EM)
|
||||||
add_subdirectory(em)
|
add_subdirectory(em)
|
||||||
else()
|
else()
|
||||||
add_subdirectory(fm)
|
target_sources(${OBSW_NAME} PUBLIC fmObjectFactory.cpp)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_subdirectory(memory)
|
add_subdirectory(memory)
|
||||||
|
@ -25,8 +25,8 @@
|
|||||||
#define OBSW_ADD_MGT @OBSW_ADD_MGT@
|
#define OBSW_ADD_MGT @OBSW_ADD_MGT@
|
||||||
#define OBSW_ADD_BPX_BATTERY_HANDLER @OBSW_ADD_BPX_BATTERY_HANDLER@
|
#define OBSW_ADD_BPX_BATTERY_HANDLER @OBSW_ADD_BPX_BATTERY_HANDLER@
|
||||||
#define OBSW_ADD_STAR_TRACKER @OBSW_ADD_STAR_TRACKER@
|
#define OBSW_ADD_STAR_TRACKER @OBSW_ADD_STAR_TRACKER@
|
||||||
#define OBSW_ADD_PLOC_SUPERVISOR 0
|
#define OBSW_ADD_PLOC_SUPERVISOR 1
|
||||||
#define OBSW_ADD_PLOC_MPSOC 0
|
#define OBSW_ADD_PLOC_MPSOC 1
|
||||||
#define OBSW_ADD_SUN_SENSORS @OBSW_ADD_SUN_SENSORS@
|
#define OBSW_ADD_SUN_SENSORS @OBSW_ADD_SUN_SENSORS@
|
||||||
#define OBSW_ADD_SUS_BOARD_ASS @OBSW_ADD_SUS_BOARD_ASS@
|
#define OBSW_ADD_SUS_BOARD_ASS @OBSW_ADD_SUS_BOARD_ASS@
|
||||||
#define OBSW_ADD_ACS_BOARD @OBSW_ADD_ACS_BOARD@
|
#define OBSW_ADD_ACS_BOARD @OBSW_ADD_ACS_BOARD@
|
||||||
@ -38,6 +38,7 @@
|
|||||||
#define OBSW_ADD_PL_PCDU @OBSW_ADD_PL_PCDU@
|
#define OBSW_ADD_PL_PCDU @OBSW_ADD_PL_PCDU@
|
||||||
#define OBSW_ADD_SYRLINKS @OBSW_ADD_SYRLINKS@
|
#define OBSW_ADD_SYRLINKS @OBSW_ADD_SYRLINKS@
|
||||||
#define OBSW_ENABLE_SYRLINKS_TRANSMIT_TIMEOUT 0
|
#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
|
// This is a really tricky switch.. It initializes the PCDU switches to their default states
|
||||||
// at powerup. I think it would be better
|
// at powerup. I think it would be better
|
||||||
|
@ -1,12 +1,5 @@
|
|||||||
target_sources(${OBSW_NAME} PRIVATE
|
target_sources(${OBSW_NAME} PRIVATE print.c)
|
||||||
print.c
|
|
||||||
)
|
|
||||||
|
|
||||||
target_sources(${SIMPLE_OBSW_NAME} PRIVATE
|
target_sources(${SIMPLE_OBSW_NAME} PRIVATE print.c)
|
||||||
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 {
|
namespace q7s {
|
||||||
|
|
||||||
static constexpr char SPI_DEFAULT_DEV[] = "/dev/spi-main";
|
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 SPI_RW_DEV[] = "/dev/spi-rw";
|
||||||
|
|
||||||
static constexpr char I2C_DEFAULT_DEV[] = "/dev/i2c-eive";
|
static constexpr char I2C_DEFAULT_DEV[] = "/dev/i2c-eive";
|
||||||
|
@ -34,5 +34,6 @@ SOFTWARE.
|
|||||||
|
|
||||||
#define ETL_CPP11_SUPPORTED 1
|
#define ETL_CPP11_SUPPORTED 1
|
||||||
#define ETL_NO_NULLPTR_SUPPORT 0
|
#define ETL_NO_NULLPTR_SUPPORT 0
|
||||||
|
#define ETL_HAS_ERROR_ON_STRING_TRUNCATION 1
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,10 +1,5 @@
|
|||||||
target_sources(${OBSW_NAME} PRIVATE
|
target_sources(${OBSW_NAME} PRIVATE FileSystemTest.cpp Q7STestTask.cpp)
|
||||||
FileSystemTest.cpp
|
|
||||||
Q7STestTask.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
if(EIVE_BUILD_Q7S_SIMPLE_MODE)
|
if(EIVE_BUILD_Q7S_SIMPLE_MODE)
|
||||||
target_sources(${SIMPLE_OBSW_NAME} PRIVATE
|
target_sources(${SIMPLE_OBSW_NAME} PRIVATE FileSystemTest.cpp)
|
||||||
FileSystemTest.cpp
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
@ -300,8 +300,7 @@ void Q7STestTask::testGpsDaemonSocket() {
|
|||||||
if (gps == nullptr) {
|
if (gps == nullptr) {
|
||||||
if (gpsReadFailedSwitch) {
|
if (gpsReadFailedSwitch) {
|
||||||
gpsReadFailedSwitch = false;
|
gpsReadFailedSwitch = false;
|
||||||
sif::warning << "Q7STestTask::testGpsDaemonSocket: Reading GPS data failed"
|
sif::warning << "Q7STestTask::testGpsDaemonSocket: Reading GPS data failed" << std::endl;
|
||||||
<< std::endl;
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#define BSP_Q7S_BOARDTEST_Q7STESTTASK_H_
|
#define BSP_Q7S_BOARDTEST_Q7STESTTASK_H_
|
||||||
|
|
||||||
#include <libgpsmm.h>
|
#include <libgpsmm.h>
|
||||||
|
|
||||||
#include "test/testtasks/TestTask.h"
|
#include "test/testtasks/TestTask.h"
|
||||||
|
|
||||||
class CoreController;
|
class CoreController;
|
||||||
|
@ -1,6 +1,2 @@
|
|||||||
target_sources(${OBSW_NAME} PRIVATE
|
target_sources(${OBSW_NAME} PRIVATE rwSpiCallback.cpp gnssCallback.cpp
|
||||||
rwSpiCallback.cpp
|
pcduSwitchCb.cpp q7sGpioCallbacks.cpp)
|
||||||
gnssCallback.cpp
|
|
||||||
pcduSwitchCb.cpp
|
|
||||||
q7sGpioCallbacks.cpp
|
|
||||||
)
|
|
||||||
|
@ -48,7 +48,7 @@ void q7s::gpioCallbacks::initSpiCsDecoder(GpioIF* gpioComIF) {
|
|||||||
|
|
||||||
result = gpioComIF->addGpios(spiMuxGpios);
|
result = gpioComIF->addGpios(spiMuxGpios);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
#include "rwSpiCallback.h"
|
#include "rwSpiCallback.h"
|
||||||
|
|
||||||
|
#include <fsfw/timemanager/Stopwatch.h>
|
||||||
|
|
||||||
#include "devices/gpioIds.h"
|
#include "devices/gpioIds.h"
|
||||||
#include "fsfw/serviceinterface/ServiceInterface.h"
|
#include "fsfw/serviceinterface/ServiceInterface.h"
|
||||||
#include "fsfw_hal/linux/UnixFileGuard.h"
|
#include "fsfw_hal/linux/UnixFileGuard.h"
|
||||||
@ -8,8 +10,25 @@
|
|||||||
|
|
||||||
namespace rwSpiCallback {
|
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,
|
ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sendData,
|
||||||
size_t sendLen, void* args) {
|
size_t sendLen, void* args) {
|
||||||
|
// Stopwatch watch;
|
||||||
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
||||||
|
|
||||||
RwHandler* handler = reinterpret_cast<RwHandler*>(args);
|
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;
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t writeBuffer[2];
|
uint8_t writeBuffer[2] = {};
|
||||||
uint8_t writeSize = 0;
|
uint8_t writeSize = 0;
|
||||||
|
|
||||||
gpioId_t gpioId = cookie->getChipSelectPin();
|
gpioId_t gpioId = cookie->getChipSelectPin();
|
||||||
GpioIF* gpioIF = comIf->getGpioInterface();
|
GpioIF* gpioIF = comIf->getGpioInterface();
|
||||||
MutexIF::TimeoutType timeoutType = MutexIF::TimeoutType::WAITING;
|
MutexIF::TimeoutType timeoutType = MutexIF::TimeoutType::WAITING;
|
||||||
uint32_t timeoutMs = 0;
|
uint32_t timeoutMs = 0;
|
||||||
MutexIF* mutex = comIf->getMutex(&timeoutType, &timeoutMs);
|
MutexIF* mutex = comIf->getCsMutex();
|
||||||
|
cookie->getMutexParams(timeoutType, timeoutMs);
|
||||||
if (mutex == nullptr or gpioIF == nullptr) {
|
if (mutex == nullptr or gpioIF == nullptr) {
|
||||||
sif::debug << "rwSpiCallback::spiCallback: Mutex or GPIO interface invalid" << std::endl;
|
sif::debug << "rwSpiCallback::spiCallback: Mutex or GPIO interface invalid" << std::endl;
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
int fileDescriptor = 0;
|
int fileDescriptor = 0;
|
||||||
std::string device = cookie->getSpiDevice();
|
const std::string& dev = comIf->getSpiDev();
|
||||||
UnixFileGuard fileHelper(device, &fileDescriptor, O_RDWR, "rwSpiCallback::spiCallback");
|
result = openSpi(dev, O_RDWR, gpioIF, gpioId, mutex, timeoutType, timeoutMs, fileDescriptor);
|
||||||
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);
|
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
sif::debug << "rwSpiCallback::spiCallback: Failed to lock mutex" << std::endl;
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sending frame start sign */
|
spi::SpiModes spiMode = spi::SpiModes::MODE_0;
|
||||||
writeBuffer[0] = 0x7E;
|
uint32_t spiSpeed = 0;
|
||||||
writeSize = 1;
|
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
|
/** Sending frame start sign */
|
||||||
if (gpioId != gpio::NO_GPIO) {
|
writeBuffer[0] = FLAG_BYTE;
|
||||||
if (gpioIF->pullLow(gpioId) != HasReturnvaluesIF::RETURN_OK) {
|
writeSize = 1;
|
||||||
sif::error << "rwSpiCallback::spiCallback: Failed to pull chip select low" << std::endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (write(fileDescriptor, writeBuffer, writeSize) != static_cast<ssize_t>(writeSize)) {
|
if (write(fileDescriptor, writeBuffer, writeSize) != static_cast<ssize_t>(writeSize)) {
|
||||||
sif::error << "rwSpiCallback::spiCallback: Write failed!" << std::endl;
|
sif::error << "rwSpiCallback::spiCallback: Write failed!" << std::endl;
|
||||||
closeSpi(gpioId, gpioIF, mutex);
|
closeSpi(fileDescriptor, gpioId, gpioIF, mutex);
|
||||||
return RwHandler::SPI_WRITE_FAILURE;
|
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)) {
|
if (write(fileDescriptor, writeBuffer, writeSize) != static_cast<ssize_t>(writeSize)) {
|
||||||
sif::error << "rwSpiCallback::spiCallback: Write failed!" << std::endl;
|
sif::error << "rwSpiCallback::spiCallback: Write failed!" << std::endl;
|
||||||
closeSpi(gpioId, gpioIF, mutex);
|
closeSpi(fileDescriptor, gpioId, gpioIF, mutex);
|
||||||
return RwHandler::SPI_WRITE_FAILURE;
|
return RwHandler::SPI_WRITE_FAILURE;
|
||||||
}
|
}
|
||||||
idx++;
|
idx++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sending frame end sign */
|
/** Sending frame end sign */
|
||||||
writeBuffer[0] = 0x7E;
|
writeBuffer[0] = FLAG_BYTE;
|
||||||
writeSize = 1;
|
writeSize = 1;
|
||||||
|
|
||||||
if (write(fileDescriptor, writeBuffer, writeSize) != static_cast<ssize_t>(writeSize)) {
|
if (write(fileDescriptor, writeBuffer, writeSize) != static_cast<ssize_t>(writeSize)) {
|
||||||
sif::error << "rwSpiCallback::spiCallback: Write failed!" << std::endl;
|
sif::error << "rwSpiCallback::spiCallback: Write failed!" << std::endl;
|
||||||
closeSpi(gpioId, gpioIF, mutex);
|
closeSpi(fileDescriptor, gpioId, gpioIF, mutex);
|
||||||
return RwHandler::SPI_WRITE_FAILURE;
|
return RwHandler::SPI_WRITE_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t* rxBuf = nullptr;
|
uint8_t* rxBuf = nullptr;
|
||||||
result = comIf->getReadBuffer(cookie->getSpiAddress(), &rxBuf);
|
result = comIf->getReadBuffer(cookie->getSpiAddress(), &rxBuf);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
closeSpi(gpioId, gpioIF, mutex);
|
closeSpi(fileDescriptor, gpioId, gpioIF, mutex);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t replyBufferSize = cookie->getMaxBufferSize();
|
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);
|
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.
|
* 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++) {
|
for (int idx = 0; idx < 10; idx++) {
|
||||||
if (read(fileDescriptor, &byteRead, 1) != 1) {
|
if (read(fileDescriptor, &byteRead, 1) != 1) {
|
||||||
sif::error << "rwSpiCallback::spiCallback: Read failed" << std::endl;
|
sif::error << "rwSpiCallback::spiCallback: Read failed" << std::endl;
|
||||||
closeSpi(gpioId, gpioIF, mutex);
|
closeSpi(fileDescriptor, gpioId, gpioIF, mutex);
|
||||||
return RwHandler::SPI_READ_FAILURE;
|
return RwHandler::SPI_READ_FAILURE;
|
||||||
}
|
}
|
||||||
if (idx == 0) {
|
if (idx == 0) {
|
||||||
if (byteRead != FLAG_BYTE) {
|
if (byteRead != FLAG_BYTE) {
|
||||||
sif::error << "Invalid data, expected start marker" << std::endl;
|
sif::error << "Invalid data, expected start marker" << std::endl;
|
||||||
closeSpi(gpioId, gpioIF, mutex);
|
closeSpi(fileDescriptor, gpioId, gpioIF, mutex);
|
||||||
return RwHandler::NO_START_MARKER;
|
return RwHandler::NO_START_MARKER;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -140,7 +159,7 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen
|
|||||||
|
|
||||||
if (idx == 9) {
|
if (idx == 9) {
|
||||||
sif::error << "rwSpiCallback::spiCallback: Empty frame timeout" << std::endl;
|
sif::error << "rwSpiCallback::spiCallback: Empty frame timeout" << std::endl;
|
||||||
closeSpi(gpioId, gpioIF, mutex);
|
closeSpi(fileDescriptor, gpioId, gpioIF, mutex);
|
||||||
return RwHandler::NO_REPLY;
|
return RwHandler::NO_REPLY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -180,7 +199,7 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen
|
|||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
sif::error << "rwSpiCallback::spiCallback: Invalid substitute" << std::endl;
|
sif::error << "rwSpiCallback::spiCallback: Invalid substitute" << std::endl;
|
||||||
closeSpi(gpioId, gpioIF, mutex);
|
closeSpi(fileDescriptor, gpioId, gpioIF, mutex);
|
||||||
result = RwHandler::INVALID_SUBSTITUTE;
|
result = RwHandler::INVALID_SUBSTITUTE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -201,8 +220,9 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen
|
|||||||
result = RwHandler::SPI_READ_FAILURE;
|
result = RwHandler::SPI_READ_FAILURE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (byteRead != 0x7E) {
|
if (byteRead != FLAG_BYTE) {
|
||||||
sif::error << "rwSpiCallback::spiCallback: Missing end sign 0x7E" << std::endl;
|
sif::error << "rwSpiCallback::spiCallback: Missing end sign " << static_cast<int>(FLAG_BYTE)
|
||||||
|
<< std::endl;
|
||||||
decodedFrameLen--;
|
decodedFrameLen--;
|
||||||
result = RwHandler::MISSING_END_SIGN;
|
result = RwHandler::MISSING_END_SIGN;
|
||||||
break;
|
break;
|
||||||
@ -213,12 +233,40 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen
|
|||||||
|
|
||||||
cookie->setTransferSize(decodedFrameLen);
|
cookie->setTransferSize(decodedFrameLen);
|
||||||
|
|
||||||
closeSpi(gpioId, gpioIF, mutex);
|
closeSpi(fileDescriptor, gpioId, gpioIF, mutex);
|
||||||
|
|
||||||
return result;
|
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 (gpioId != gpio::NO_GPIO) {
|
||||||
if (gpioIF->pullHigh(gpioId) != HasReturnvaluesIF::RETURN_OK) {
|
if (gpioIF->pullHigh(gpioId) != HasReturnvaluesIF::RETURN_OK) {
|
||||||
sif::error << "closeSpi: Failed to pull chip select high" << std::endl;
|
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
|
} // namespace rwSpiCallback
|
||||||
|
@ -33,14 +33,5 @@ static constexpr uint8_t FLAG_BYTE = 0x7E;
|
|||||||
ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sendData,
|
ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sendData,
|
||||||
size_t sendLen, void* args);
|
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
|
} // namespace rwSpiCallback
|
||||||
#endif /* BSP_Q7S_RW_SPI_CALLBACK_H_ */
|
#endif /* BSP_Q7S_RW_SPI_CALLBACK_H_ */
|
||||||
|
@ -1,6 +1 @@
|
|||||||
target_sources(${OBSW_NAME} PRIVATE
|
target_sources(${OBSW_NAME} PRIVATE)
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,8 +1,4 @@
|
|||||||
target_sources(${OBSW_NAME} PRIVATE
|
target_sources(${OBSW_NAME} PRIVATE CoreController.cpp InitMission.cpp
|
||||||
CoreController.cpp
|
ObjectFactory.cpp)
|
||||||
InitMission.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
target_sources(${SIMPLE_OBSW_NAME} PRIVATE
|
target_sources(${SIMPLE_OBSW_NAME} PRIVATE InitMission.cpp)
|
||||||
InitMission.cpp
|
|
||||||
)
|
|
||||||
|
@ -87,6 +87,7 @@ ReturnValue_t CoreController::initializeLocalDataPool(localpool::DataPool &local
|
|||||||
localDataPoolMap.emplace(core::TEMPERATURE, new PoolEntry<float>({0}));
|
localDataPoolMap.emplace(core::TEMPERATURE, new PoolEntry<float>({0}));
|
||||||
localDataPoolMap.emplace(core::PS_VOLTAGE, new PoolEntry<float>({0}));
|
localDataPoolMap.emplace(core::PS_VOLTAGE, new PoolEntry<float>({0}));
|
||||||
localDataPoolMap.emplace(core::PL_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;
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -211,8 +212,13 @@ ReturnValue_t CoreController::executeAction(ActionId_t actionId, MessageQueueId_
|
|||||||
rewriteRebootFile(rebootFile);
|
rewriteRebootFile(rebootFile);
|
||||||
return HasActionsIF::EXECUTION_FINISHED;
|
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): {
|
case (REBOOT_OBC): {
|
||||||
return actionPerformReboot(data, size);
|
// Warning: This function will never return, because it reboots the system
|
||||||
|
return actionReboot(data, size);
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
return HasActionsIF::INVALID_ACTION_ID;
|
return HasActionsIF::INVALID_ACTION_ID;
|
||||||
@ -844,25 +850,18 @@ void CoreController::initPrint() {
|
|||||||
#endif
|
#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) {
|
if (size < 1) {
|
||||||
return HasActionsIF::INVALID_PARAMETERS;
|
return HasActionsIF::INVALID_PARAMETERS;
|
||||||
}
|
}
|
||||||
bool rebootSameBootCopy = data[0];
|
bool rebootSameBootCopy = data[0];
|
||||||
bool protOpPerformed;
|
bool protOpPerformed = false;
|
||||||
|
SdCardManager::instance()->setBlocking(true);
|
||||||
if (rebootSameBootCopy) {
|
if (rebootSameBootCopy) {
|
||||||
#if OBSW_VERBOSE_LEVEL >= 1
|
#if OBSW_VERBOSE_LEVEL >= 1
|
||||||
sif::info << "CoreController::actionPerformReboot: Rebooting on current image" << std::endl;
|
sif::info << "CoreController::actionPerformReboot: Rebooting on current image" << std::endl;
|
||||||
#endif
|
#endif
|
||||||
// Attempt graceful shutdown by unmounting and switching off SD cards
|
gracefulShutdownTasks(xsc::Chip::SELF_CHIP, xsc::Copy::SELF_COPY, protOpPerformed);
|
||||||
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;
|
|
||||||
}
|
|
||||||
int result = std::system("xsc_boot_copy -r");
|
int result = std::system("xsc_boot_copy -r");
|
||||||
if (result != 0) {
|
if (result != 0) {
|
||||||
utility::handleSystemError(result, "CoreController::executeAction");
|
utility::handleSystemError(result, "CoreController::executeAction");
|
||||||
@ -884,12 +883,8 @@ ReturnValue_t CoreController::actionPerformReboot(const uint8_t *data, size_t si
|
|||||||
auto tgtChip = static_cast<xsc::Chip>(data[1]);
|
auto tgtChip = static_cast<xsc::Chip>(data[1]);
|
||||||
auto tgtCopy = static_cast<xsc::Copy>(data[2]);
|
auto tgtCopy = static_cast<xsc::Copy>(data[2]);
|
||||||
|
|
||||||
ReturnValue_t retval =
|
// This function can not really fail
|
||||||
setBootCopyProtection(static_cast<xsc::Chip>(data[1]), static_cast<xsc::Copy>(data[2]), true,
|
gracefulShutdownTasks(tgtChip, tgtCopy, protOpPerformed);
|
||||||
protOpPerformed, false);
|
|
||||||
if (retval == HasReturnvaluesIF::RETURN_OK and protOpPerformed) {
|
|
||||||
sif::info << "Target slot was writeprotected before reboot" << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (tgtChip) {
|
switch (tgtChip) {
|
||||||
case (xsc::Chip::CHIP_0): {
|
case (xsc::Chip::CHIP_0): {
|
||||||
@ -930,6 +925,30 @@ ReturnValue_t CoreController::actionPerformReboot(const uint8_t *data, size_t si
|
|||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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() {}
|
CoreController::~CoreController() {}
|
||||||
|
|
||||||
void CoreController::determinePreferredSdCard() {
|
void CoreController::determinePreferredSdCard() {
|
||||||
|
@ -67,13 +67,16 @@ class CoreController : public ExtendedControllerBase {
|
|||||||
static constexpr ActionId_t SWITCH_IMG_LOCK = 7;
|
static constexpr ActionId_t SWITCH_IMG_LOCK = 7;
|
||||||
static constexpr ActionId_t SET_MAX_REBOOT_CNT = 8;
|
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;
|
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 uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::CORE;
|
||||||
|
|
||||||
static constexpr Event ALLOC_FAILURE = event::makeEvent(SUBSYSTEM_ID, 0, severity::MEDIUM);
|
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
|
//! P1: Current Chip, P2: Current Copy
|
||||||
static constexpr Event REBOOT_SW = event::makeEvent(SUBSYSTEM_ID, 1, severity::MEDIUM);
|
static constexpr Event REBOOT_SW = event::makeEvent(SUBSYSTEM_ID, 1, severity::MEDIUM);
|
||||||
//! [EXPORT] : [COMMENT] The reboot mechanism was triggered.
|
//! [EXPORT] : [COMMENT] The reboot mechanism was triggered.
|
||||||
@ -221,7 +224,10 @@ class CoreController : public ExtendedControllerBase {
|
|||||||
|
|
||||||
ReturnValue_t actionListDirectoryIntoFile(ActionId_t actionId, MessageQueueId_t commandedBy,
|
ReturnValue_t actionListDirectoryIntoFile(ActionId_t actionId, MessageQueueId_t commandedBy,
|
||||||
const uint8_t* data, size_t size);
|
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();
|
void performWatchdogControlOperation();
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
#include "bsp_q7s/core/InitMission.h"
|
#include "bsp_q7s/core/InitMission.h"
|
||||||
|
|
||||||
|
#include <fsfw/devicehandlers/DeviceCommunicationIF.h>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
@ -13,6 +15,7 @@
|
|||||||
#include "fsfw/tasks/FixedTimeslotTaskIF.h"
|
#include "fsfw/tasks/FixedTimeslotTaskIF.h"
|
||||||
#include "fsfw/tasks/PeriodicTaskIF.h"
|
#include "fsfw/tasks/PeriodicTaskIF.h"
|
||||||
#include "fsfw/tasks/TaskFactory.h"
|
#include "fsfw/tasks/TaskFactory.h"
|
||||||
|
#include "mission/devices/devicedefinitions/Max31865Definitions.h"
|
||||||
#include "mission/utility/InitMission.h"
|
#include "mission/utility/InitMission.h"
|
||||||
#include "pollingsequence/pollingSequenceFactory.h"
|
#include "pollingsequence/pollingSequenceFactory.h"
|
||||||
|
|
||||||
@ -33,8 +36,16 @@ ObjectManagerIF* objectManager = nullptr;
|
|||||||
|
|
||||||
void initmission::initMission() {
|
void initmission::initMission() {
|
||||||
sif::info << "Building global objects.." << std::endl;
|
sif::info << "Building global objects.." << std::endl;
|
||||||
|
try {
|
||||||
/* Instantiate global object manager and also create all objects */
|
/* Instantiate global object manager and also create all objects */
|
||||||
ObjectManager::instance()->setObjectFactoryFunction(ObjectFactory::produce, nullptr);
|
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;
|
sif::info << "Initializing all objects.." << std::endl;
|
||||||
ObjectManager::instance()->initialize();
|
ObjectManager::instance()->initialize();
|
||||||
|
|
||||||
@ -114,35 +125,80 @@ void initmission::initTasks() {
|
|||||||
#endif /* OBSW_USE_CCSDS_IP_CORE == 1 */
|
#endif /* OBSW_USE_CCSDS_IP_CORE == 1 */
|
||||||
|
|
||||||
#if OBSW_ADD_ACS_HANDLERS == 1
|
#if OBSW_ADD_ACS_HANDLERS == 1
|
||||||
PeriodicTaskIF* gpsTask = factory->createPeriodicTask(
|
PeriodicTaskIF* acsTask = factory->createPeriodicTask(
|
||||||
"ACS_CTRL", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.4, missedDeadlineFunc);
|
"ACS_TASK", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.4, missedDeadlineFunc);
|
||||||
result = gpsTask->addComponent(objects::GPS_CONTROLLER);
|
result = acsTask->addComponent(objects::GPS_CONTROLLER);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
initmission::printAddObjectError("GPS_CTRL", objects::GPS_CONTROLLER);
|
initmission::printAddObjectError("GPS_CTRL", objects::GPS_CONTROLLER);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* OBSW_ADD_ACS_HANDLERS */
|
#endif /* OBSW_ADD_ACS_HANDLERS */
|
||||||
|
|
||||||
PeriodicTaskIF* sysTask = factory->createPeriodicTask(
|
PeriodicTaskIF* sysTask = factory->createPeriodicTask(
|
||||||
"SYS_TASK", 45, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.4, missedDeadlineFunc);
|
"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);
|
result = sysTask->addComponent(objects::ACS_BOARD_ASS);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
initmission::printAddObjectError("ACS_BOARD_ASS", objects::ACS_BOARD_ASS);
|
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
|
#if OBSW_ADD_SUS_BOARD_ASS == 1
|
||||||
result = sysTask->addComponent(objects::SUS_BOARD_ASS);
|
result = sysTask->addComponent(objects::SUS_BOARD_ASS);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
initmission::printAddObjectError("SUS_BOARD_ASS", objects::SUS_BOARD_ASS);
|
initmission::printAddObjectError("SUS_BOARD_ASS", objects::SUS_BOARD_ASS);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
result = sysTask->addComponent(objects::TCS_BOARD_ASS);
|
|
||||||
|
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) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
initmission::printAddObjectError("TCS_BOARD_ASS", objects::TCS_BOARD_ASS);
|
initmission::printAddObjectError("SPI_RTD_POLLING", objects::SPI_RTD_COM_IF);
|
||||||
}
|
}
|
||||||
|
<<<<<<< HEAD
|
||||||
result = sysTask->addComponent(objects::ACS_SUBSYSTEM);
|
result = sysTask->addComponent(objects::ACS_SUBSYSTEM);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
initmission::printAddObjectError("ACS_SUBSYSTEM", objects::ACS_SUBSYSTEM);
|
initmission::printAddObjectError("ACS_SUBSYSTEM", objects::ACS_SUBSYSTEM);
|
||||||
}
|
}
|
||||||
|
#endif /* OBSW_ADD_RTD_DEVICES == 1 */
|
||||||
|
=======
|
||||||
|
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,
|
||||||
|
};
|
||||||
|
#if OBSW_ADD_RTD_DEVICES == 1
|
||||||
|
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 */
|
||||||
|
>>>>>>> origin/develop
|
||||||
|
|
||||||
// FS task, task interval does not matter because it runs in permanent loop, priority low
|
// FS task, task interval does not matter because it runs in permanent loop, priority low
|
||||||
// because it is a non-essential background task
|
// because it is a non-essential background task
|
||||||
@ -171,6 +227,15 @@ void initmission::initTasks() {
|
|||||||
}
|
}
|
||||||
#endif /* OBSW_ADD_PLOC_MPSOC */
|
#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
|
#if OBSW_TEST_CCSDS_BRIDGE == 1
|
||||||
PeriodicTaskIF* ptmeTestTask = factory->createPeriodicTask(
|
PeriodicTaskIF* ptmeTestTask = factory->createPeriodicTask(
|
||||||
"PTME_TEST", 80, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc);
|
"PTME_TEST", 80, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc);
|
||||||
@ -230,11 +295,20 @@ void initmission::initTasks() {
|
|||||||
strHelperTask->startTask();
|
strHelperTask->startTask();
|
||||||
#endif /* OBSW_ADD_STAR_TRACKER == 1 */
|
#endif /* OBSW_ADD_STAR_TRACKER == 1 */
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
#if OBSW_ADD_ACS_HANDLERS == 1
|
#if OBSW_ADD_ACS_HANDLERS == 1
|
||||||
gpsTask->startTask();
|
gpsTask->startTask();
|
||||||
#endif
|
#endif
|
||||||
|
#if OBSW_ADD_RTD_DEVICES == 1
|
||||||
|
=======
|
||||||
|
acsTask->startTask();
|
||||||
|
>>>>>>> origin/develop
|
||||||
sysTask->startTask();
|
sysTask->startTask();
|
||||||
|
tcsPollingTask->startTask();
|
||||||
|
tcsTask->startTask();
|
||||||
|
#if OBSW_ADD_PLOC_SUPERVISOR == 1
|
||||||
|
supvHelperTask->startTask();
|
||||||
|
#endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */
|
||||||
sif::info << "Tasks started.." << std::endl;
|
sif::info << "Tasks started.." << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -245,7 +319,7 @@ void initmission::createPstTasks(TaskFactory& factory,
|
|||||||
/* Polling Sequence Table Default */
|
/* Polling Sequence Table Default */
|
||||||
#if OBSW_ADD_SPI_TEST_CODE == 0
|
#if OBSW_ADD_SPI_TEST_CODE == 0
|
||||||
FixedTimeslotTaskIF* spiPst = factory.createFixedTimeslotTask(
|
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);
|
result = pst::pstSpi(spiPst);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) {
|
if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) {
|
||||||
@ -258,8 +332,23 @@ void initmission::createPstTasks(TaskFactory& factory,
|
|||||||
}
|
}
|
||||||
#endif
|
#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(
|
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);
|
result = pst::pstUart(uartPst);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) {
|
if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) {
|
||||||
@ -272,7 +361,7 @@ void initmission::createPstTasks(TaskFactory& factory,
|
|||||||
}
|
}
|
||||||
|
|
||||||
FixedTimeslotTaskIF* gpioPst = factory.createFixedTimeslotTask(
|
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);
|
result = pst::pstGpio(gpioPst);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) {
|
if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) {
|
||||||
@ -285,7 +374,7 @@ void initmission::createPstTasks(TaskFactory& factory,
|
|||||||
}
|
}
|
||||||
#if OBSW_ADD_I2C_TEST_CODE == 0
|
#if OBSW_ADD_I2C_TEST_CODE == 0
|
||||||
FixedTimeslotTaskIF* i2cPst = factory.createFixedTimeslotTask(
|
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);
|
result = pst::pstI2c(i2cPst);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) {
|
if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) {
|
||||||
@ -362,6 +451,10 @@ void initmission::createPusTasks(TaskFactory& factory,
|
|||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
initmission::printAddObjectError("PUS_200", objects::PUS_SERVICE_200_MODE_MGMT);
|
initmission::printAddObjectError("PUS_200", objects::PUS_SERVICE_200_MODE_MGMT);
|
||||||
}
|
}
|
||||||
|
result = pusMedPrio->addComponent(objects::PUS_SERVICE_201_HEALTH);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
initmission::printAddObjectError("PUS_201", objects::PUS_SERVICE_201_HEALTH);
|
||||||
|
}
|
||||||
result = pusMedPrio->addComponent(objects::PUS_SERVICE_20_PARAMETERS);
|
result = pusMedPrio->addComponent(objects::PUS_SERVICE_20_PARAMETERS);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
initmission::printAddObjectError("PUS_20", objects::PUS_SERVICE_20_PARAMETERS);
|
initmission::printAddObjectError("PUS_20", objects::PUS_SERVICE_20_PARAMETERS);
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "fsfw/tasks/Typedef.h"
|
#include "fsfw/tasks/definitions.h"
|
||||||
|
|
||||||
class PeriodicTaskIF;
|
class PeriodicTaskIF;
|
||||||
class TaskFactory;
|
class TaskFactory;
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
#include <mission/system/fdir/GomspacePowerFdir.h>
|
#include "ObjectFactory.h"
|
||||||
#include <mission/system/fdir/SyrlinksFdir.h>
|
|
||||||
|
|
||||||
#include "OBSWConfig.h"
|
#include "OBSWConfig.h"
|
||||||
#include "bsp_q7s/boardtest/Q7STestTask.h"
|
#include "bsp_q7s/boardtest/Q7STestTask.h"
|
||||||
@ -8,7 +7,6 @@
|
|||||||
#include "bsp_q7s/callbacks/q7sGpioCallbacks.h"
|
#include "bsp_q7s/callbacks/q7sGpioCallbacks.h"
|
||||||
#include "bsp_q7s/callbacks/rwSpiCallback.h"
|
#include "bsp_q7s/callbacks/rwSpiCallback.h"
|
||||||
#include "bsp_q7s/core/CoreController.h"
|
#include "bsp_q7s/core/CoreController.h"
|
||||||
#include "bsp_q7s/core/ObjectFactory.h"
|
|
||||||
#include "bsp_q7s/memory/FileSystemHandler.h"
|
#include "bsp_q7s/memory/FileSystemHandler.h"
|
||||||
#include "busConf.h"
|
#include "busConf.h"
|
||||||
#include "ccsdsConfig.h"
|
#include "ccsdsConfig.h"
|
||||||
@ -31,7 +29,6 @@
|
|||||||
#include "linux/devices/ploc/PlocMPSoCHelper.h"
|
#include "linux/devices/ploc/PlocMPSoCHelper.h"
|
||||||
#include "linux/devices/ploc/PlocMemoryDumper.h"
|
#include "linux/devices/ploc/PlocMemoryDumper.h"
|
||||||
#include "linux/devices/ploc/PlocSupervisorHandler.h"
|
#include "linux/devices/ploc/PlocSupervisorHandler.h"
|
||||||
#include "linux/devices/ploc/PlocUpdater.h"
|
|
||||||
#include "linux/devices/startracker/StarTrackerHandler.h"
|
#include "linux/devices/startracker/StarTrackerHandler.h"
|
||||||
#include "linux/devices/startracker/StrHelper.h"
|
#include "linux/devices/startracker/StrHelper.h"
|
||||||
#include "linux/obc/AxiPtmeConfig.h"
|
#include "linux/obc/AxiPtmeConfig.h"
|
||||||
@ -40,8 +37,11 @@
|
|||||||
#include "linux/obc/Ptme.h"
|
#include "linux/obc/Ptme.h"
|
||||||
#include "linux/obc/PtmeConfig.h"
|
#include "linux/obc/PtmeConfig.h"
|
||||||
#include "mission/system/fdir/AcsBoardFdir.h"
|
#include "mission/system/fdir/AcsBoardFdir.h"
|
||||||
|
#include "mission/system/fdir/GomspacePowerFdir.h"
|
||||||
#include "mission/system/fdir/RtdFdir.h"
|
#include "mission/system/fdir/RtdFdir.h"
|
||||||
#include "mission/system/fdir/SusFdir.h"
|
#include "mission/system/fdir/SusFdir.h"
|
||||||
|
#include "mission/system/fdir/SyrlinksFdir.h"
|
||||||
|
#include "mission/system/objects/RwAssembly.h"
|
||||||
#include "mission/system/objects/SusAssembly.h"
|
#include "mission/system/objects/SusAssembly.h"
|
||||||
#include "mission/system/objects/TcsBoardAssembly.h"
|
#include "mission/system/objects/TcsBoardAssembly.h"
|
||||||
#include "mission/system/tree/system.h"
|
#include "mission/system/tree/system.h"
|
||||||
@ -83,14 +83,12 @@
|
|||||||
#include "mission/devices/RadiationSensorHandler.h"
|
#include "mission/devices/RadiationSensorHandler.h"
|
||||||
#include "mission/devices/RwHandler.h"
|
#include "mission/devices/RwHandler.h"
|
||||||
#include "mission/devices/SolarArrayDeploymentHandler.h"
|
#include "mission/devices/SolarArrayDeploymentHandler.h"
|
||||||
#include "mission/devices/SusHandler.h"
|
|
||||||
#include "mission/devices/SyrlinksHkHandler.h"
|
#include "mission/devices/SyrlinksHkHandler.h"
|
||||||
#include "mission/devices/Tmp1075Handler.h"
|
#include "mission/devices/Tmp1075Handler.h"
|
||||||
#include "mission/devices/devicedefinitions/GomspaceDefinitions.h"
|
#include "mission/devices/devicedefinitions/GomspaceDefinitions.h"
|
||||||
#include "mission/devices/devicedefinitions/Max31865Definitions.h"
|
#include "mission/devices/devicedefinitions/Max31865Definitions.h"
|
||||||
#include "mission/devices/devicedefinitions/RadSensorDefinitions.h"
|
#include "mission/devices/devicedefinitions/RadSensorDefinitions.h"
|
||||||
#include "mission/devices/devicedefinitions/RwDefinitions.h"
|
#include "mission/devices/devicedefinitions/RwDefinitions.h"
|
||||||
#include "mission/devices/devicedefinitions/SusDefinitions.h"
|
|
||||||
#include "mission/devices/devicedefinitions/SyrlinksDefinitions.h"
|
#include "mission/devices/devicedefinitions/SyrlinksDefinitions.h"
|
||||||
#include "mission/devices/devicedefinitions/payloadPcduDefinitions.h"
|
#include "mission/devices/devicedefinitions/payloadPcduDefinitions.h"
|
||||||
#include "mission/system/objects/AcsBoardAssembly.h"
|
#include "mission/system/objects/AcsBoardAssembly.h"
|
||||||
@ -227,8 +225,10 @@ void ObjectFactory::createTmpComponents() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ObjectFactory::createCommunicationInterfaces(LinuxLibgpioIF** gpioComIF, UartComIF** uartComIF,
|
void ObjectFactory::createCommunicationInterfaces(LinuxLibgpioIF** gpioComIF, UartComIF** uartComIF,
|
||||||
SpiComIF** spiComIF, I2cComIF** i2cComIF) {
|
SpiComIF** spiMainComIF, I2cComIF** i2cComIF,
|
||||||
if (gpioComIF == nullptr or uartComIF == nullptr or spiComIF == nullptr) {
|
SpiComIF** spiRWComIF) {
|
||||||
|
if (gpioComIF == nullptr or uartComIF == nullptr or spiMainComIF == nullptr or
|
||||||
|
spiRWComIF == nullptr) {
|
||||||
sif::error << "ObjectFactory::createCommunicationInterfaces: Invalid passed ComIF pointer"
|
sif::error << "ObjectFactory::createCommunicationInterfaces: Invalid passed ComIF pointer"
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
}
|
}
|
||||||
@ -238,8 +238,8 @@ void ObjectFactory::createCommunicationInterfaces(LinuxLibgpioIF** gpioComIF, Ua
|
|||||||
new CspComIF(objects::CSP_COM_IF);
|
new CspComIF(objects::CSP_COM_IF);
|
||||||
*i2cComIF = new I2cComIF(objects::I2C_COM_IF);
|
*i2cComIF = new I2cComIF(objects::I2C_COM_IF);
|
||||||
*uartComIF = new UartComIF(objects::UART_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 */
|
/* Adding gpios for chip select decoding to the gpioComIf */
|
||||||
q7s::gpioCallbacks::initSpiCsDecoder(*gpioComIF);
|
q7s::gpioCallbacks::initSpiCsDecoder(*gpioComIF);
|
||||||
}
|
}
|
||||||
@ -297,12 +297,13 @@ void ObjectFactory::createRadSensorComponent(LinuxLibgpioIF* gpioComIF) {
|
|||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::ENABLE_RADFET, consumer.str(), Direction::OUT,
|
gpio = new GpiodRegularByLineName(q7s::gpioNames::ENABLE_RADFET, consumer.str(), Direction::OUT,
|
||||||
Levels::LOW);
|
Levels::LOW);
|
||||||
gpioCookieRadSensor->addGpio(gpioIds::ENABLE_RADFET, gpio);
|
gpioCookieRadSensor->addGpio(gpioIds::ENABLE_RADFET, gpio);
|
||||||
gpioComIF->addGpios(gpioCookieRadSensor);
|
gpioChecker(gpioComIF->addGpios(gpioCookieRadSensor), "RAD sensor");
|
||||||
|
|
||||||
SpiCookie* spiCookieRadSensor = new SpiCookie(
|
SpiCookie* spiCookieRadSensor =
|
||||||
addresses::RAD_SENSOR, gpioIds::CS_RAD_SENSOR, std::string(q7s::SPI_DEFAULT_DEV),
|
new SpiCookie(addresses::RAD_SENSOR, gpioIds::CS_RAD_SENSOR, RAD_SENSOR::READ_SIZE,
|
||||||
RAD_SENSOR::READ_SIZE, spi::DEFAULT_MAX_1227_MODE, spi::DEFAULT_MAX_1227_SPEED);
|
spi::DEFAULT_MAX_1227_MODE, spi::DEFAULT_MAX_1227_SPEED);
|
||||||
auto radSensor = new RadiationSensorHandler(objects::RAD_SENSOR, objects::SPI_COM_IF,
|
spiCookieRadSensor->setMutexParams(MutexIF::TimeoutType::WAITING, spi::RAD_SENSOR_CS_TIMEOUT);
|
||||||
|
auto radSensor = new RadiationSensorHandler(objects::RAD_SENSOR, objects::SPI_MAIN_COM_IF,
|
||||||
spiCookieRadSensor, gpioComIF);
|
spiCookieRadSensor, gpioComIF);
|
||||||
static_cast<void>(radSensor);
|
static_cast<void>(radSensor);
|
||||||
// The radiation sensor ADC is powered by the 5V stack connector which should always be on
|
// The radiation sensor ADC is powered by the 5V stack connector which should always be on
|
||||||
@ -413,16 +414,16 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
|
|||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::GNSS_SELECT, consumer.str(), Direction::OUT,
|
gpio = new GpiodRegularByLineName(q7s::gpioNames::GNSS_SELECT, consumer.str(), Direction::OUT,
|
||||||
Levels::LOW);
|
Levels::LOW);
|
||||||
gpioCookieAcsBoard->addGpio(gpioIds::GNSS_SELECT, gpio);
|
gpioCookieAcsBoard->addGpio(gpioIds::GNSS_SELECT, gpio);
|
||||||
gpioComIF->addGpios(gpioCookieAcsBoard);
|
gpioChecker(gpioComIF->addGpios(gpioCookieAcsBoard), "ACS Board");
|
||||||
AcsBoardFdir* fdir = nullptr;
|
AcsBoardFdir* fdir = nullptr;
|
||||||
static_cast<void>(fdir);
|
static_cast<void>(fdir);
|
||||||
|
|
||||||
#if OBSW_ADD_ACS_HANDLERS == 1
|
#if OBSW_ADD_ACS_HANDLERS == 1
|
||||||
std::string spiDev = q7s::SPI_DEFAULT_DEV;
|
std::string spiDev = q7s::SPI_DEFAULT_DEV;
|
||||||
SpiCookie* spiCookie =
|
SpiCookie* spiCookie =
|
||||||
new SpiCookie(addresses::MGM_0_LIS3, gpioIds::MGM_0_LIS3_CS, spiDev,
|
new SpiCookie(addresses::MGM_0_LIS3, gpioIds::MGM_0_LIS3_CS, MGMLIS3MDL::MAX_BUFFER_SIZE,
|
||||||
MGMLIS3MDL::MAX_BUFFER_SIZE, spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED);
|
spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED);
|
||||||
auto mgmLis3Handler = new MgmLIS3MDLHandler(objects::MGM_0_LIS3_HANDLER, objects::SPI_COM_IF,
|
auto mgmLis3Handler = new MgmLIS3MDLHandler(objects::MGM_0_LIS3_HANDLER, objects::SPI_MAIN_COM_IF,
|
||||||
spiCookie, spi::LIS3_TRANSITION_DELAY);
|
spiCookie, spi::LIS3_TRANSITION_DELAY);
|
||||||
fdir = new AcsBoardFdir(objects::MGM_0_LIS3_HANDLER);
|
fdir = new AcsBoardFdir(objects::MGM_0_LIS3_HANDLER);
|
||||||
mgmLis3Handler->setCustomFdir(fdir);
|
mgmLis3Handler->setCustomFdir(fdir);
|
||||||
@ -435,10 +436,11 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
|
|||||||
mgmLis3Handler->enablePeriodicPrintouts(true, 10);
|
mgmLis3Handler->enablePeriodicPrintouts(true, 10);
|
||||||
#endif
|
#endif
|
||||||
spiCookie =
|
spiCookie =
|
||||||
new SpiCookie(addresses::MGM_1_RM3100, gpioIds::MGM_1_RM3100_CS, spiDev,
|
new SpiCookie(addresses::MGM_1_RM3100, gpioIds::MGM_1_RM3100_CS, RM3100::MAX_BUFFER_SIZE,
|
||||||
RM3100::MAX_BUFFER_SIZE, spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED);
|
spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED);
|
||||||
auto mgmRm3100Handler = new MgmRM3100Handler(objects::MGM_1_RM3100_HANDLER, objects::SPI_COM_IF,
|
auto mgmRm3100Handler =
|
||||||
spiCookie, spi::RM3100_TRANSITION_DELAY);
|
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);
|
fdir = new AcsBoardFdir(objects::MGM_1_RM3100_HANDLER);
|
||||||
mgmRm3100Handler->setCustomFdir(fdir);
|
mgmRm3100Handler->setCustomFdir(fdir);
|
||||||
mgmRm3100Handler->setParent(objects::ACS_BOARD_ASS);
|
mgmRm3100Handler->setParent(objects::ACS_BOARD_ASS);
|
||||||
@ -451,9 +453,9 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
|
|||||||
mgmRm3100Handler->enablePeriodicPrintouts(true, 10);
|
mgmRm3100Handler->enablePeriodicPrintouts(true, 10);
|
||||||
#endif
|
#endif
|
||||||
spiCookie =
|
spiCookie =
|
||||||
new SpiCookie(addresses::MGM_2_LIS3, gpioIds::MGM_2_LIS3_CS, spiDev,
|
new SpiCookie(addresses::MGM_2_LIS3, gpioIds::MGM_2_LIS3_CS, MGMLIS3MDL::MAX_BUFFER_SIZE,
|
||||||
MGMLIS3MDL::MAX_BUFFER_SIZE, spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED);
|
spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED);
|
||||||
mgmLis3Handler = new MgmLIS3MDLHandler(objects::MGM_2_LIS3_HANDLER, objects::SPI_COM_IF,
|
mgmLis3Handler = new MgmLIS3MDLHandler(objects::MGM_2_LIS3_HANDLER, objects::SPI_MAIN_COM_IF,
|
||||||
spiCookie, spi::LIS3_TRANSITION_DELAY);
|
spiCookie, spi::LIS3_TRANSITION_DELAY);
|
||||||
fdir = new AcsBoardFdir(objects::MGM_2_LIS3_HANDLER);
|
fdir = new AcsBoardFdir(objects::MGM_2_LIS3_HANDLER);
|
||||||
mgmLis3Handler->setCustomFdir(fdir);
|
mgmLis3Handler->setCustomFdir(fdir);
|
||||||
@ -467,9 +469,9 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
|
|||||||
mgmLis3Handler->enablePeriodicPrintouts(true, 10);
|
mgmLis3Handler->enablePeriodicPrintouts(true, 10);
|
||||||
#endif
|
#endif
|
||||||
spiCookie =
|
spiCookie =
|
||||||
new SpiCookie(addresses::MGM_3_RM3100, gpioIds::MGM_3_RM3100_CS, spiDev,
|
new SpiCookie(addresses::MGM_3_RM3100, gpioIds::MGM_3_RM3100_CS, RM3100::MAX_BUFFER_SIZE,
|
||||||
RM3100::MAX_BUFFER_SIZE, spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED);
|
spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED);
|
||||||
mgmRm3100Handler = new MgmRM3100Handler(objects::MGM_3_RM3100_HANDLER, objects::SPI_COM_IF,
|
mgmRm3100Handler = new MgmRM3100Handler(objects::MGM_3_RM3100_HANDLER, objects::SPI_MAIN_COM_IF,
|
||||||
spiCookie, spi::RM3100_TRANSITION_DELAY);
|
spiCookie, spi::RM3100_TRANSITION_DELAY);
|
||||||
fdir = new AcsBoardFdir(objects::MGM_3_RM3100_HANDLER);
|
fdir = new AcsBoardFdir(objects::MGM_3_RM3100_HANDLER);
|
||||||
mgmRm3100Handler->setCustomFdir(fdir);
|
mgmRm3100Handler->setCustomFdir(fdir);
|
||||||
@ -483,11 +485,12 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
|
|||||||
#endif
|
#endif
|
||||||
// Commented until ACS board V2 in in clean room again
|
// Commented until ACS board V2 in in clean room again
|
||||||
// Gyro 0 Side A
|
// Gyro 0 Side A
|
||||||
spiCookie = new SpiCookie(addresses::GYRO_0_ADIS, gpioIds::GYRO_0_ADIS_CS, spiDev,
|
spiCookie =
|
||||||
ADIS1650X::MAXIMUM_REPLY_SIZE, spi::DEFAULT_ADIS16507_MODE,
|
new SpiCookie(addresses::GYRO_0_ADIS, gpioIds::GYRO_0_ADIS_CS, ADIS1650X::MAXIMUM_REPLY_SIZE,
|
||||||
spi::DEFAULT_ADIS16507_SPEED);
|
spi::DEFAULT_ADIS16507_MODE, spi::DEFAULT_ADIS16507_SPEED);
|
||||||
auto adisHandler = new GyroADIS1650XHandler(objects::GYRO_0_ADIS_HANDLER, objects::SPI_COM_IF,
|
auto adisHandler =
|
||||||
spiCookie, ADIS1650X::Type::ADIS16505);
|
new GyroADIS1650XHandler(objects::GYRO_0_ADIS_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie,
|
||||||
|
ADIS1650X::Type::ADIS16505);
|
||||||
fdir = new AcsBoardFdir(objects::GYRO_0_ADIS_HANDLER);
|
fdir = new AcsBoardFdir(objects::GYRO_0_ADIS_HANDLER);
|
||||||
adisHandler->setCustomFdir(fdir);
|
adisHandler->setCustomFdir(fdir);
|
||||||
adisHandler->setParent(objects::ACS_BOARD_ASS);
|
adisHandler->setParent(objects::ACS_BOARD_ASS);
|
||||||
@ -500,11 +503,10 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
|
|||||||
adisHandler->enablePeriodicPrintouts(true, 10);
|
adisHandler->enablePeriodicPrintouts(true, 10);
|
||||||
#endif
|
#endif
|
||||||
// Gyro 1 Side A
|
// Gyro 1 Side A
|
||||||
spiCookie =
|
spiCookie = new SpiCookie(addresses::GYRO_1_L3G, gpioIds::GYRO_1_L3G_CS, L3GD20H::MAX_BUFFER_SIZE,
|
||||||
new SpiCookie(addresses::GYRO_1_L3G, gpioIds::GYRO_1_L3G_CS, spiDev, L3GD20H::MAX_BUFFER_SIZE,
|
|
||||||
spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED);
|
spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED);
|
||||||
auto gyroL3gHandler = new GyroHandlerL3GD20H(objects::GYRO_1_L3G_HANDLER, objects::SPI_COM_IF,
|
auto gyroL3gHandler = new GyroHandlerL3GD20H(
|
||||||
spiCookie, spi::L3G_TRANSITION_DELAY);
|
objects::GYRO_1_L3G_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, spi::L3G_TRANSITION_DELAY);
|
||||||
fdir = new AcsBoardFdir(objects::GYRO_1_L3G_HANDLER);
|
fdir = new AcsBoardFdir(objects::GYRO_1_L3G_HANDLER);
|
||||||
gyroL3gHandler->setCustomFdir(fdir);
|
gyroL3gHandler->setCustomFdir(fdir);
|
||||||
gyroL3gHandler->setParent(objects::ACS_BOARD_ASS);
|
gyroL3gHandler->setParent(objects::ACS_BOARD_ASS);
|
||||||
@ -517,10 +519,10 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
|
|||||||
gyroL3gHandler->enablePeriodicPrintouts(true, 10);
|
gyroL3gHandler->enablePeriodicPrintouts(true, 10);
|
||||||
#endif
|
#endif
|
||||||
// Gyro 2 Side B
|
// Gyro 2 Side B
|
||||||
spiCookie = new SpiCookie(addresses::GYRO_2_ADIS, gpioIds::GYRO_2_ADIS_CS, spiDev,
|
spiCookie =
|
||||||
ADIS1650X::MAXIMUM_REPLY_SIZE, spi::DEFAULT_ADIS16507_MODE,
|
new SpiCookie(addresses::GYRO_2_ADIS, gpioIds::GYRO_2_ADIS_CS, ADIS1650X::MAXIMUM_REPLY_SIZE,
|
||||||
spi::DEFAULT_ADIS16507_SPEED);
|
spi::DEFAULT_ADIS16507_MODE, spi::DEFAULT_ADIS16507_SPEED);
|
||||||
adisHandler = new GyroADIS1650XHandler(objects::GYRO_2_ADIS_HANDLER, objects::SPI_COM_IF,
|
adisHandler = new GyroADIS1650XHandler(objects::GYRO_2_ADIS_HANDLER, objects::SPI_MAIN_COM_IF,
|
||||||
spiCookie, ADIS1650X::Type::ADIS16505);
|
spiCookie, ADIS1650X::Type::ADIS16505);
|
||||||
fdir = new AcsBoardFdir(objects::GYRO_2_ADIS_HANDLER);
|
fdir = new AcsBoardFdir(objects::GYRO_2_ADIS_HANDLER);
|
||||||
adisHandler->setCustomFdir(fdir);
|
adisHandler->setCustomFdir(fdir);
|
||||||
@ -530,10 +532,9 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
|
|||||||
adisHandler->setToGoToNormalModeImmediately();
|
adisHandler->setToGoToNormalModeImmediately();
|
||||||
#endif
|
#endif
|
||||||
// Gyro 3 Side B
|
// Gyro 3 Side B
|
||||||
spiCookie =
|
spiCookie = new SpiCookie(addresses::GYRO_3_L3G, gpioIds::GYRO_3_L3G_CS, L3GD20H::MAX_BUFFER_SIZE,
|
||||||
new SpiCookie(addresses::GYRO_3_L3G, gpioIds::GYRO_3_L3G_CS, spiDev, L3GD20H::MAX_BUFFER_SIZE,
|
|
||||||
spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED);
|
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);
|
spiCookie, spi::L3G_TRANSITION_DELAY);
|
||||||
fdir = new AcsBoardFdir(objects::GYRO_3_L3G_HANDLER);
|
fdir = new AcsBoardFdir(objects::GYRO_3_L3G_HANDLER);
|
||||||
gyroL3gHandler->setCustomFdir(fdir);
|
gyroL3gHandler->setCustomFdir(fdir);
|
||||||
@ -569,7 +570,8 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
|
|||||||
#endif /* OBSW_ADD_ACS_HANDLERS == 1 */
|
#endif /* OBSW_ADD_ACS_HANDLERS == 1 */
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectFactory::createHeaterComponents() {
|
void ObjectFactory::createHeaterComponents(GpioIF* gpioIF, PowerSwitchIF* pwrSwitcher,
|
||||||
|
HealthTableIF* healthTable) {
|
||||||
using namespace gpio;
|
using namespace gpio;
|
||||||
GpioCookie* heaterGpiosCookie = new GpioCookie;
|
GpioCookie* heaterGpiosCookie = new GpioCookie;
|
||||||
GpiodRegularByLineName* gpio = nullptr;
|
GpiodRegularByLineName* gpio = nullptr;
|
||||||
@ -610,8 +612,21 @@ void ObjectFactory::createHeaterComponents() {
|
|||||||
Levels::LOW);
|
Levels::LOW);
|
||||||
heaterGpiosCookie->addGpio(gpioIds::HEATER_7, gpio);
|
heaterGpiosCookie->addGpio(gpioIds::HEATER_7, gpio);
|
||||||
|
|
||||||
new HeaterHandler(objects::HEATER_HANDLER, objects::GPIO_IF, heaterGpiosCookie,
|
gpioIF->addGpios(heaterGpiosCookie);
|
||||||
objects::PCDU_HANDLER, pcdu::Switches::PDU2_CH3_TCS_BOARD_HEATER_IN_8V);
|
|
||||||
|
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() {
|
void ObjectFactory::createSolarArrayDeploymentComponents() {
|
||||||
@ -660,7 +675,7 @@ void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF) {
|
|||||||
consumer.str(), Direction::OUT, Levels::HIGH);
|
consumer.str(), Direction::OUT, Levels::HIGH);
|
||||||
auto mpsocGpioCookie = new GpioCookie;
|
auto mpsocGpioCookie = new GpioCookie;
|
||||||
mpsocGpioCookie->addGpio(gpioIds::ENABLE_MPSOC_UART, gpioConfigMPSoC);
|
mpsocGpioCookie->addGpio(gpioIds::ENABLE_MPSOC_UART, gpioConfigMPSoC);
|
||||||
gpioComIF->addGpios(mpsocGpioCookie);
|
gpioChecker(gpioComIF->addGpios(mpsocGpioCookie), "PLOC MPSoC");
|
||||||
auto mpsocCookie =
|
auto mpsocCookie =
|
||||||
new UartCookie(objects::PLOC_MPSOC_HANDLER, q7s::UART_PLOC_MPSOC_DEV, uart::PLOC_MPSOC_BAUD,
|
new UartCookie(objects::PLOC_MPSOC_HANDLER, q7s::UART_PLOC_MPSOC_DEV, uart::PLOC_MPSOC_BAUD,
|
||||||
mpsoc::MAX_REPLY_SIZE, UartModes::NON_CANONICAL);
|
mpsoc::MAX_REPLY_SIZE, UartModes::NON_CANONICAL);
|
||||||
@ -673,22 +688,24 @@ void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF) {
|
|||||||
#if OBSW_ADD_PLOC_SUPERVISOR == 1
|
#if OBSW_ADD_PLOC_SUPERVISOR == 1
|
||||||
consumer << "0x" << std::hex << objects::PLOC_SUPERVISOR_HANDLER;
|
consumer << "0x" << std::hex << objects::PLOC_SUPERVISOR_HANDLER;
|
||||||
auto gpioConfigSupv = new GpiodRegularByLineName(q7s::gpioNames::ENABLE_SUPV_UART, consumer.str(),
|
auto gpioConfigSupv = new GpiodRegularByLineName(q7s::gpioNames::ENABLE_SUPV_UART, consumer.str(),
|
||||||
Direction::OUT, Levels::HIGH);
|
Direction::OUT, Levels::LOW);
|
||||||
auto supvGpioCookie = new GpioCookie;
|
auto supvGpioCookie = new GpioCookie;
|
||||||
supvGpioCookie->addGpio(gpioIds::ENABLE_SUPV_UART, gpioConfigSupv);
|
supvGpioCookie->addGpio(gpioIds::ENABLE_SUPV_UART, gpioConfigSupv);
|
||||||
gpioComIF->addGpios(supvGpioCookie);
|
gpioComIF->addGpios(supvGpioCookie);
|
||||||
auto supervisorCookie = new UartCookie(objects::PLOC_SUPERVISOR_HANDLER,
|
auto supervisorCookie =
|
||||||
q7s::UART_PLOC_SUPERVSIOR_DEV, uart::PLOC_SUPERVISOR_BAUD,
|
new UartCookie(objects::PLOC_SUPERVISOR_HANDLER, q7s::UART_PLOC_SUPERVSIOR_DEV,
|
||||||
supv::MAX_PACKET_SIZE * 20, UartModes::NON_CANONICAL);
|
uart::PLOC_SUPV_BAUD, supv::MAX_PACKET_SIZE * 20, UartModes::NON_CANONICAL);
|
||||||
supervisorCookie->setNoFixedSizeReply();
|
supervisorCookie->setNoFixedSizeReply();
|
||||||
|
auto supvHelper = new PlocSupvHelper(objects::PLOC_SUPERVISOR_HELPER);
|
||||||
new PlocSupervisorHandler(objects::PLOC_SUPERVISOR_HANDLER, objects::UART_COM_IF,
|
new PlocSupervisorHandler(objects::PLOC_SUPERVISOR_HANDLER, objects::UART_COM_IF,
|
||||||
supervisorCookie, Gpio(gpioIds::ENABLE_SUPV_UART, gpioComIF),
|
supervisorCookie, Gpio(gpioIds::ENABLE_SUPV_UART, gpioComIF),
|
||||||
pcdu::PDU1_CH6_PLOC_12V);
|
pcdu::PDU1_CH6_PLOC_12V, supvHelper);
|
||||||
#endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */
|
#endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */
|
||||||
static_cast<void>(consumer);
|
static_cast<void>(consumer);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectFactory::createReactionWheelComponents(LinuxLibgpioIF* gpioComIF) {
|
void ObjectFactory::createReactionWheelComponents(LinuxLibgpioIF* gpioComIF,
|
||||||
|
PowerSwitchIF* pwrSwitcher) {
|
||||||
using namespace gpio;
|
using namespace gpio;
|
||||||
GpioCookie* gpioCookieRw = new GpioCookie;
|
GpioCookie* gpioCookieRw = new GpioCookie;
|
||||||
GpioCallback* csRw1 =
|
GpioCallback* csRw1 =
|
||||||
@ -730,50 +747,38 @@ void ObjectFactory::createReactionWheelComponents(LinuxLibgpioIF* gpioComIF) {
|
|||||||
Levels::LOW);
|
Levels::LOW);
|
||||||
gpioCookieRw->addGpio(gpioIds::EN_RW4, gpio);
|
gpioCookieRw->addGpio(gpioIds::EN_RW4, gpio);
|
||||||
|
|
||||||
gpioComIF->addGpios(gpioCookieRw);
|
gpioChecker(gpioComIF->addGpios(gpioCookieRw), "RWs");
|
||||||
|
|
||||||
#if OBSW_ADD_RW == 1
|
#if OBSW_ADD_RW == 1
|
||||||
auto rw1SpiCookie =
|
std::array<std::pair<address_t, gpioId_t>, 4> rwCookieParams = {
|
||||||
new SpiCookie(addresses::RW1, gpioIds::CS_RW1, q7s::SPI_RW_DEV, RwDefinitions::MAX_REPLY_SIZE,
|
{{addresses::RW1, gpioIds::CS_RW1},
|
||||||
spi::RW_MODE, spi::RW_SPEED, &rwSpiCallback::spiCallback, nullptr);
|
{addresses::RW2, gpioIds::CS_RW2},
|
||||||
auto rw2SpiCookie =
|
{addresses::RW3, gpioIds::CS_RW3},
|
||||||
new SpiCookie(addresses::RW2, gpioIds::CS_RW2, q7s::SPI_RW_DEV, RwDefinitions::MAX_REPLY_SIZE,
|
{addresses::RW4, gpioIds::CS_RW4}}};
|
||||||
spi::RW_MODE, spi::RW_SPEED, &rwSpiCallback::spiCallback, nullptr);
|
std::array<SpiCookie*, 4> rwCookies = {};
|
||||||
auto rw3SpiCookie =
|
std::array<object_id_t, 4> rwIds = {objects::RW1, objects::RW2, objects::RW3, objects::RW4};
|
||||||
new SpiCookie(addresses::RW3, gpioIds::CS_RW3, q7s::SPI_RW_DEV, RwDefinitions::MAX_REPLY_SIZE,
|
std::array<gpioId_t, 4> rwGpioIds = {gpioIds::EN_RW1, gpioIds::EN_RW2, gpioIds::EN_RW3,
|
||||||
spi::RW_MODE, spi::RW_SPEED, &rwSpiCallback::spiCallback, nullptr);
|
gpioIds::EN_RW4};
|
||||||
auto rw4SpiCookie =
|
std::array<RwHandler*, 4> rws = {};
|
||||||
new SpiCookie(addresses::RW4, gpioIds::CS_RW4, q7s::SPI_RW_DEV, RwDefinitions::MAX_REPLY_SIZE,
|
for (uint8_t idx = 0; idx < rwCookies.size(); idx++) {
|
||||||
spi::RW_MODE, spi::RW_SPEED, &rwSpiCallback::spiCallback, nullptr);
|
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
|
||||||
|
#if OBSW_DEBUG_RW == 1
|
||||||
|
rws[idx]->setDebugMode(true);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
auto rwHandler1 =
|
RwHelper rwHelper(rwIds);
|
||||||
new RwHandler(objects::RW1, objects::SPI_COM_IF, rw1SpiCookie, gpioComIF, gpioIds::EN_RW1);
|
auto* rwAss = new RwAssembly(objects::RW_ASS, objects::NO_OBJECT, pwrSwitcher,
|
||||||
rw1SpiCookie->setCallbackArgs(rwHandler1);
|
pcdu::Switches::PDU2_CH2_RW_5V, rwHelper);
|
||||||
#if OBSW_DEBUG_RW == 1
|
static_cast<void>(rwAss);
|
||||||
rwHandler1->setStartUpImmediately();
|
|
||||||
rwHandler1->setDebugMode(true);
|
|
||||||
#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);
|
|
||||||
#endif
|
|
||||||
#endif /* OBSW_ADD_RW == 1 */
|
#endif /* OBSW_ADD_RW == 1 */
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -812,7 +817,7 @@ void ObjectFactory::createCcsdsComponents(LinuxLibgpioIF* gpioComIF) {
|
|||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_EMPTY_SIGNAL_VC3, consumer.str());
|
gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_EMPTY_SIGNAL_VC3, consumer.str());
|
||||||
gpioCookiePtmeIp->addGpio(gpioIds::VC3_PAPB_EMPTY, gpio);
|
gpioCookiePtmeIp->addGpio(gpioIds::VC3_PAPB_EMPTY, gpio);
|
||||||
|
|
||||||
gpioComIF->addGpios(gpioCookiePtmeIp);
|
gpioChecker(gpioComIF->addGpios(gpioCookiePtmeIp), "PTME PAPB VCs");
|
||||||
|
|
||||||
// Creating virtual channel interfaces
|
// Creating virtual channel interfaces
|
||||||
VcInterfaceIF* vc0 =
|
VcInterfaceIF* vc0 =
|
||||||
@ -866,7 +871,7 @@ void ObjectFactory::createCcsdsComponents(LinuxLibgpioIF* gpioComIF) {
|
|||||||
Levels::LOW);
|
Levels::LOW);
|
||||||
gpioCookiePdec->addGpio(gpioIds::PDEC_RESET, gpio);
|
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,
|
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);
|
q7s::UIO_PDEC_CONFIG_MEMORY, q7s::UIO_PDEC_RAM, q7s::UIO_PDEC_REGISTERS);
|
||||||
@ -887,7 +892,7 @@ void ObjectFactory::createCcsdsComponents(LinuxLibgpioIF* gpioComIF) {
|
|||||||
Direction::OUT, Levels::LOW);
|
Direction::OUT, Levels::LOW);
|
||||||
gpioRS485Chip->addGpio(gpioIds::RS485_EN_RX_DATA, gpio);
|
gpioRS485Chip->addGpio(gpioIds::RS485_EN_RX_DATA, gpio);
|
||||||
|
|
||||||
gpioComIF->addGpios(gpioRS485Chip);
|
gpioChecker(gpioComIF->addGpios(gpioRS485Chip), "RS485 Transceiver");
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectFactory::createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF,
|
void ObjectFactory::createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF,
|
||||||
@ -932,14 +937,14 @@ void ObjectFactory::createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF*
|
|||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::PL_PCDU_ADC_CS, consumer, Direction::OUT,
|
gpio = new GpiodRegularByLineName(q7s::gpioNames::PL_PCDU_ADC_CS, consumer, Direction::OUT,
|
||||||
gpio::Levels::HIGH);
|
gpio::Levels::HIGH);
|
||||||
plPcduGpios->addGpio(gpioIds::PLPCDU_ADC_CS, gpio);
|
plPcduGpios->addGpio(gpioIds::PLPCDU_ADC_CS, gpio);
|
||||||
gpioComIF->addGpios(plPcduGpios);
|
gpioChecker(gpioComIF->addGpios(plPcduGpios), "PL PCDU");
|
||||||
SpiCookie* spiCookie = new SpiCookie(addresses::PLPCDU_ADC, gpioIds::PLPCDU_ADC_CS,
|
SpiCookie* spiCookie =
|
||||||
q7s::SPI_DEFAULT_DEV, plpcdu::MAX_ADC_REPLY_SIZE,
|
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);
|
spi::DEFAULT_MAX_1227_MODE, spi::PL_PCDU_MAX_1227_SPEED);
|
||||||
// Create device handler components
|
// Create device handler components
|
||||||
auto plPcduHandler = new PayloadPcduHandler(
|
auto plPcduHandler = new PayloadPcduHandler(
|
||||||
objects::PLPCDU_HANDLER, objects::SPI_COM_IF, spiCookie, gpioComIF, SdCardManager::instance(),
|
objects::PLPCDU_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, gpioComIF,
|
||||||
pwrSwitcher, pcdu::Switches::PDU2_CH1_PL_PCDU_BATT_0_14V8,
|
SdCardManager::instance(), pwrSwitcher, pcdu::Switches::PDU2_CH1_PL_PCDU_BATT_0_14V8,
|
||||||
pcdu::Switches::PDU2_CH6_PL_PCDU_BATT_1_14V8, false);
|
pcdu::Switches::PDU2_CH6_PL_PCDU_BATT_1_14V8, false);
|
||||||
spiCookie->setCallbackMode(PayloadPcduHandler::extConvAsTwoCallback, plPcduHandler);
|
spiCookie->setCallbackMode(PayloadPcduHandler::extConvAsTwoCallback, plPcduHandler);
|
||||||
// plPcduHandler->enablePeriodicPrintout(true, 5);
|
// plPcduHandler->enablePeriodicPrintout(true, 5);
|
||||||
@ -966,6 +971,50 @@ void ObjectFactory::createTestComponents(LinuxLibgpioIF* gpioComIF) {
|
|||||||
#endif
|
#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) {
|
void ObjectFactory::testAcsBrdAss(AcsBoardAssembly* acsAss) {
|
||||||
CommandMessage msg;
|
CommandMessage msg;
|
||||||
ModeMessage::setModeMessage(&msg, ModeMessage::CMD_MODE_COMMAND, DeviceHandlerIF::MODE_NORMAL,
|
ModeMessage::setModeMessage(&msg, ModeMessage::CMD_MODE_COMMAND, DeviceHandlerIF::MODE_NORMAL,
|
@ -1,12 +1,18 @@
|
|||||||
#ifndef BSP_Q7S_OBJECTFACTORY_H_
|
#ifndef BSP_Q7S_OBJECTFACTORY_H_
|
||||||
#define BSP_Q7S_OBJECTFACTORY_H_
|
#define BSP_Q7S_OBJECTFACTORY_H_
|
||||||
|
|
||||||
|
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
class LinuxLibgpioIF;
|
class LinuxLibgpioIF;
|
||||||
class UartComIF;
|
class UartComIF;
|
||||||
class SpiComIF;
|
class SpiComIF;
|
||||||
class I2cComIF;
|
class I2cComIF;
|
||||||
class PowerSwitchIF;
|
class PowerSwitchIF;
|
||||||
|
class HealthTableIF;
|
||||||
class AcsBoardAssembly;
|
class AcsBoardAssembly;
|
||||||
|
class GpioIF;
|
||||||
|
|
||||||
namespace ObjectFactory {
|
namespace ObjectFactory {
|
||||||
|
|
||||||
@ -14,7 +20,8 @@ void setStatics();
|
|||||||
void produce(void* args);
|
void produce(void* args);
|
||||||
|
|
||||||
void createCommunicationInterfaces(LinuxLibgpioIF** gpioComIF, UartComIF** uartComIF,
|
void createCommunicationInterfaces(LinuxLibgpioIF** gpioComIF, UartComIF** uartComIF,
|
||||||
SpiComIF** spiComIF, I2cComIF** i2cComIF);
|
SpiComIF** spiMainComIF, I2cComIF** i2cComIF,
|
||||||
|
SpiComIF** spiRwComIF);
|
||||||
void createPcduComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchIF** pwrSwitcher);
|
void createPcduComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchIF** pwrSwitcher);
|
||||||
void createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF,
|
void createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF,
|
||||||
PowerSwitchIF* pwrSwitcher);
|
PowerSwitchIF* pwrSwitcher);
|
||||||
@ -22,12 +29,17 @@ void createTmpComponents();
|
|||||||
void createRadSensorComponent(LinuxLibgpioIF* gpioComIF);
|
void createRadSensorComponent(LinuxLibgpioIF* gpioComIF);
|
||||||
void createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComIF* uartComIF,
|
void createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComIF* uartComIF,
|
||||||
PowerSwitchIF* pwrSwitcher);
|
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 createSolarArrayDeploymentComponents();
|
||||||
void createSyrlinksComponents(PowerSwitchIF* pwrSwitcher);
|
void createSyrlinksComponents(PowerSwitchIF* pwrSwitcher);
|
||||||
void createPayloadComponents(LinuxLibgpioIF* gpioComIF);
|
void createPayloadComponents(LinuxLibgpioIF* gpioComIF);
|
||||||
void createReactionWheelComponents(LinuxLibgpioIF* gpioComIF);
|
void createReactionWheelComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchIF* pwrSwitcher);
|
||||||
void createCcsdsComponents(LinuxLibgpioIF* gpioComIF);
|
void createCcsdsComponents(LinuxLibgpioIF* gpioComIF);
|
||||||
|
void createMiscComponents();
|
||||||
|
|
||||||
void createTestComponents(LinuxLibgpioIF* gpioComIF);
|
void createTestComponents(LinuxLibgpioIF* gpioComIF);
|
||||||
|
|
||||||
void testAcsBrdAss(AcsBoardAssembly* assAss);
|
void testAcsBrdAss(AcsBoardAssembly* assAss);
|
||||||
|
@ -1,3 +1 @@
|
|||||||
target_sources(${OBSW_NAME} PRIVATE
|
target_sources(${OBSW_NAME} PRIVATE emObjectFactory.cpp)
|
||||||
emObjectFactory.cpp
|
|
||||||
)
|
|
||||||
|
@ -1,153 +1,42 @@
|
|||||||
#include <mission/system/fdir/GomspacePowerFdir.h>
|
#include <fsfw/health/HealthTableIF.h>
|
||||||
#include <mission/system/fdir/SyrlinksFdir.h>
|
|
||||||
|
|
||||||
#include "OBSWConfig.h"
|
#include "OBSWConfig.h"
|
||||||
#include "bsp_q7s/boardtest/Q7STestTask.h"
|
|
||||||
#include "bsp_q7s/callbacks/gnssCallback.h"
|
|
||||||
#include "bsp_q7s/callbacks/pcduSwitchCb.h"
|
|
||||||
#include "bsp_q7s/callbacks/q7sGpioCallbacks.h"
|
|
||||||
#include "bsp_q7s/callbacks/rwSpiCallback.h"
|
|
||||||
#include "bsp_q7s/core/CoreController.h"
|
#include "bsp_q7s/core/CoreController.h"
|
||||||
#include "bsp_q7s/core/ObjectFactory.h"
|
#include "bsp_q7s/core/ObjectFactory.h"
|
||||||
#include "bsp_q7s/memory/FileSystemHandler.h"
|
|
||||||
#include "busConf.h"
|
#include "busConf.h"
|
||||||
#include "ccsdsConfig.h"
|
#include "commonObjects.h"
|
||||||
#include "devConf.h"
|
#include "devConf.h"
|
||||||
#include "devices/addresses.h"
|
|
||||||
#include "devices/gpioIds.h"
|
|
||||||
#include "devices/powerSwitcherList.h"
|
|
||||||
#include "fsfw/ipc/QueueFactory.h"
|
|
||||||
#include "linux/ObjectFactory.h"
|
|
||||||
#include "linux/boardtest/I2cTestClass.h"
|
|
||||||
#include "linux/boardtest/SpiTestClass.h"
|
|
||||||
#include "linux/boardtest/UartTestClass.h"
|
|
||||||
#include "linux/callbacks/gpioCallbacks.h"
|
|
||||||
#include "linux/csp/CspComIF.h"
|
|
||||||
#include "linux/csp/CspCookie.h"
|
|
||||||
#include "linux/devices/GPSHyperionLinuxController.h"
|
|
||||||
#include "linux/devices/devicedefinitions/PlocMPSoCDefinitions.h"
|
|
||||||
#include "linux/devices/devicedefinitions/StarTrackerDefinitions.h"
|
|
||||||
#include "linux/devices/ploc/PlocMPSoCHandler.h"
|
|
||||||
#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"
|
|
||||||
#include "linux/obc/PapbVcInterface.h"
|
|
||||||
#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/fdir/AcsBoardFdir.h"
|
|
||||||
#include "mission/system/fdir/RtdFdir.h"
|
|
||||||
#include "mission/system/fdir/SusFdir.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"
|
|
||||||
#include "fsfw/tmtcpacket/pus/tm.h"
|
|
||||||
#include "fsfw/tmtcservices/CommandingServiceBase.h"
|
|
||||||
#include "fsfw/tmtcservices/PusServiceBase.h"
|
|
||||||
#include "fsfw_hal/common/gpio/GpioCookie.h"
|
|
||||||
#include "fsfw_hal/common/gpio/gpioDefinitions.h"
|
|
||||||
#include "fsfw_hal/devicehandlers/GyroL3GD20Handler.h"
|
|
||||||
#include "fsfw_hal/devicehandlers/MgmLIS3MDLHandler.h"
|
|
||||||
#include "fsfw_hal/devicehandlers/MgmRM3100Handler.h"
|
|
||||||
#include "fsfw_hal/linux/gpio/LinuxLibgpioIF.h"
|
#include "fsfw_hal/linux/gpio/LinuxLibgpioIF.h"
|
||||||
#include "fsfw_hal/linux/i2c/I2cComIF.h"
|
#include "linux/ObjectFactory.h"
|
||||||
#include "fsfw_hal/linux/i2c/I2cCookie.h"
|
#include "linux/callbacks/gpioCallbacks.h"
|
||||||
#include "fsfw_hal/linux/spi/SpiComIF.h"
|
|
||||||
#include "fsfw_hal/linux/spi/SpiCookie.h"
|
|
||||||
#include "fsfw_hal/linux/uart/UartComIF.h"
|
|
||||||
#include "fsfw_hal/linux/uart/UartCookie.h"
|
|
||||||
#include "mission/core/GenericFactory.h"
|
#include "mission/core/GenericFactory.h"
|
||||||
#include "mission/devices/ACUHandler.h"
|
|
||||||
#include "mission/devices/BpxBatteryHandler.h"
|
|
||||||
#include "mission/devices/GyroADIS1650XHandler.h"
|
|
||||||
#include "mission/devices/HeaterHandler.h"
|
|
||||||
#include "mission/devices/IMTQHandler.h"
|
|
||||||
#include "mission/devices/Max31865PT1000Handler.h"
|
|
||||||
#include "mission/devices/P60DockHandler.h"
|
|
||||||
#include "mission/devices/PCDUHandler.h"
|
|
||||||
#include "mission/devices/PDU1Handler.h"
|
|
||||||
#include "mission/devices/PDU2Handler.h"
|
|
||||||
#include "mission/devices/PayloadPcduHandler.h"
|
|
||||||
#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"
|
|
||||||
#include "mission/tmtc/CCSDSHandler.h"
|
|
||||||
#include "mission/tmtc/VirtualChannel.h"
|
|
||||||
#include "mission/utility/TmFunnel.h"
|
|
||||||
ResetArgs resetArgsGnss0;
|
|
||||||
ResetArgs resetArgsGnss1;
|
|
||||||
|
|
||||||
void ObjectFactory::setStatics() { Factory::setStaticFrameworkObjectIds(); }
|
|
||||||
|
|
||||||
void Factory::setStaticFrameworkObjectIds() {
|
|
||||||
PusServiceBase::packetSource = objects::PUS_PACKET_DISTRIBUTOR;
|
|
||||||
PusServiceBase::packetDestination = objects::TM_FUNNEL;
|
|
||||||
|
|
||||||
CommandingServiceBase::defaultPacketSource = objects::PUS_PACKET_DISTRIBUTOR;
|
|
||||||
CommandingServiceBase::defaultPacketDestination = objects::TM_FUNNEL;
|
|
||||||
|
|
||||||
DeviceHandlerBase::powerSwitcherId = objects::PCDU_HANDLER;
|
|
||||||
// DeviceHandlerBase::powerSwitcherId = objects::NO_OBJECT;
|
|
||||||
#if OBSW_TM_TO_PTME == 1
|
|
||||||
TmFunnel::downlinkDestination = objects::CCSDS_HANDLER;
|
|
||||||
#else
|
|
||||||
TmFunnel::downlinkDestination = objects::TMTC_BRIDGE;
|
|
||||||
#endif /* OBSW_TM_TO_PTME == 1 */
|
|
||||||
// No storage object for now.
|
|
||||||
TmFunnel::storageDestination = objects::NO_OBJECT;
|
|
||||||
|
|
||||||
LocalDataPoolManager::defaultHkDestination = objects::PUS_SERVICE_3_HOUSEKEEPING;
|
|
||||||
|
|
||||||
VerificationReporter::messageReceiver = objects::PUS_SERVICE_1_VERIFICATION;
|
|
||||||
TmPacketBase::timeStamperId = objects::TIME_STAMPER;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ObjectFactory::produce(void* args) {
|
void ObjectFactory::produce(void* args) {
|
||||||
ObjectFactory::setStatics();
|
ObjectFactory::setStatics();
|
||||||
ObjectFactory::produceGenericObjects();
|
HealthTableIF* healthTable = nullptr;
|
||||||
|
ObjectFactory::produceGenericObjects(&healthTable);
|
||||||
|
|
||||||
LinuxLibgpioIF* gpioComIF = nullptr;
|
LinuxLibgpioIF* gpioComIF = nullptr;
|
||||||
UartComIF* uartComIF = nullptr;
|
UartComIF* uartComIF = nullptr;
|
||||||
SpiComIF* spiComIF = nullptr;
|
SpiComIF* spiMainComIF = nullptr;
|
||||||
I2cComIF* i2cComIF = nullptr;
|
I2cComIF* i2cComIF = nullptr;
|
||||||
PowerSwitchIF* pwrSwitcher = nullptr;
|
PowerSwitchIF* pwrSwitcher = nullptr;
|
||||||
createCommunicationInterfaces(&gpioComIF, &uartComIF, &spiComIF, &i2cComIF);
|
SpiComIF* spiRwComIF = nullptr;
|
||||||
|
createCommunicationInterfaces(&gpioComIF, &uartComIF, &spiMainComIF, &i2cComIF, &spiRwComIF);
|
||||||
createTmpComponents();
|
createTmpComponents();
|
||||||
new CoreController(objects::CORE_CONTROLLER);
|
new CoreController(objects::CORE_CONTROLLER);
|
||||||
|
|
||||||
gpioCallbacks::disableAllDecoder(gpioComIF);
|
gpioCallbacks::disableAllDecoder(gpioComIF);
|
||||||
createPcduComponents(gpioComIF, &pwrSwitcher);
|
createPcduComponents(gpioComIF, &pwrSwitcher);
|
||||||
createRadSensorComponent(gpioComIF);
|
createRadSensorComponent(gpioComIF);
|
||||||
createSunSensorComponents(gpioComIF, spiComIF, pwrSwitcher, q7s::SPI_DEFAULT_DEV);
|
createSunSensorComponents(gpioComIF, spiMainComIF, pwrSwitcher, q7s::SPI_DEFAULT_DEV);
|
||||||
|
|
||||||
#if OBSW_ADD_ACS_BOARD == 1
|
#if OBSW_ADD_ACS_BOARD == 1
|
||||||
createAcsBoardComponents(gpioComIF, uartComIF, pwrSwitcher);
|
createAcsBoardComponents(gpioComIF, uartComIF, pwrSwitcher);
|
||||||
#endif
|
#endif
|
||||||
createHeaterComponents();
|
createHeaterComponents(gpioComIF, pwrSwitcher, healthTable);
|
||||||
createSolarArrayDeploymentComponents();
|
createSolarArrayDeploymentComponents();
|
||||||
createPlPcduComponents(gpioComIF, spiComIF, pwrSwitcher);
|
createPlPcduComponents(gpioComIF, spiMainComIF, pwrSwitcher);
|
||||||
#if OBSW_ADD_SYRLINKS == 1
|
#if OBSW_ADD_SYRLINKS == 1
|
||||||
createSyrlinksComponents(pwrSwitcher);
|
createSyrlinksComponents(pwrSwitcher);
|
||||||
#endif /* OBSW_ADD_SYRLINKS == 1 */
|
#endif /* OBSW_ADD_SYRLINKS == 1 */
|
||||||
@ -155,45 +44,16 @@ void ObjectFactory::produce(void* args) {
|
|||||||
createPayloadComponents(gpioComIF);
|
createPayloadComponents(gpioComIF);
|
||||||
|
|
||||||
#if OBSW_ADD_MGT == 1
|
#if OBSW_ADD_MGT == 1
|
||||||
I2cCookie* imtqI2cCookie =
|
createImtqComponents(pwrSwitcher);
|
||||||
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
|
#endif
|
||||||
#if OBSW_DEBUG_IMTQ == 1
|
createReactionWheelComponents(gpioComIF, pwrSwitcher);
|
||||||
imtqHandler->setDebugMode(true);
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
createReactionWheelComponents(gpioComIF);
|
|
||||||
|
|
||||||
#if OBSW_ADD_BPX_BATTERY_HANDLER == 1
|
#if OBSW_ADD_BPX_BATTERY_HANDLER == 1
|
||||||
I2cCookie* bpxI2cCookie = new I2cCookie(addresses::BPX_BATTERY, 100, q7s::I2C_DEFAULT_DEV);
|
createBpxBatteryComponent();
|
||||||
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
|
||||||
#endif
|
|
||||||
new FileSystemHandler(objects::FILE_SYSTEM_HANDLER);
|
|
||||||
|
|
||||||
#if OBSW_ADD_STAR_TRACKER == 1
|
#if OBSW_ADD_STAR_TRACKER == 1
|
||||||
UartCookie* starTrackerCookie =
|
createStrComponents(pwrSwitcher);
|
||||||
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 */
|
#endif /* OBSW_ADD_STAR_TRACKER == 1 */
|
||||||
#if OBSW_USE_CCSDS_IP_CORE == 1
|
#if OBSW_USE_CCSDS_IP_CORE == 1
|
||||||
createCcsdsComponents(gpioComIF);
|
createCcsdsComponents(gpioComIF);
|
||||||
@ -202,771 +62,6 @@ void ObjectFactory::produce(void* args) {
|
|||||||
#if OBSW_ADD_TEST_CODE == 1
|
#if OBSW_ADD_TEST_CODE == 1
|
||||||
createTestComponents(gpioComIF);
|
createTestComponents(gpioComIF);
|
||||||
#endif /* OBSW_ADD_TEST_CODE == 1 */
|
#endif /* OBSW_ADD_TEST_CODE == 1 */
|
||||||
new PlocUpdater(objects::PLOC_UPDATER);
|
|
||||||
new PlocMemoryDumper(objects::PLOC_MEMORY_DUMPER);
|
createMiscComponents();
|
||||||
}
|
|
||||||
|
|
||||||
void ObjectFactory::createTmpComponents() {
|
|
||||||
I2cCookie* i2cCookieTmp1075tcs1 =
|
|
||||||
new I2cCookie(addresses::TMP1075_TCS_1, TMP1075::MAX_REPLY_LENGTH, q7s::I2C_DEFAULT_DEV);
|
|
||||||
I2cCookie* i2cCookieTmp1075tcs2 =
|
|
||||||
new I2cCookie(addresses::TMP1075_TCS_2, TMP1075::MAX_REPLY_LENGTH, q7s::I2C_DEFAULT_DEV);
|
|
||||||
|
|
||||||
/* Temperature sensors */
|
|
||||||
Tmp1075Handler* tmp1075Handler_1 =
|
|
||||||
new Tmp1075Handler(objects::TMP1075_HANDLER_1, objects::I2C_COM_IF, i2cCookieTmp1075tcs1);
|
|
||||||
(void)tmp1075Handler_1;
|
|
||||||
Tmp1075Handler* tmp1075Handler_2 =
|
|
||||||
new Tmp1075Handler(objects::TMP1075_HANDLER_2, objects::I2C_COM_IF, i2cCookieTmp1075tcs2);
|
|
||||||
(void)tmp1075Handler_2;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ObjectFactory::createCommunicationInterfaces(LinuxLibgpioIF** gpioComIF, UartComIF** uartComIF,
|
|
||||||
SpiComIF** spiComIF, I2cComIF** i2cComIF) {
|
|
||||||
if (gpioComIF == nullptr or uartComIF == nullptr or spiComIF == nullptr) {
|
|
||||||
sif::error << "ObjectFactory::createCommunicationInterfaces: Invalid passed ComIF pointer"
|
|
||||||
<< std::endl;
|
|
||||||
}
|
|
||||||
*gpioComIF = new LinuxLibgpioIF(objects::GPIO_IF);
|
|
||||||
|
|
||||||
/* Communication interfaces */
|
|
||||||
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);
|
|
||||||
|
|
||||||
/* Adding gpios for chip select decoding to the gpioComIf */
|
|
||||||
q7s::gpioCallbacks::initSpiCsDecoder(*gpioComIF);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ObjectFactory::createPcduComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchIF** pwrSwitcher) {
|
|
||||||
CspCookie* p60DockCspCookie = new CspCookie(P60Dock::MAX_REPLY_LENGTH, addresses::P60DOCK);
|
|
||||||
CspCookie* pdu1CspCookie = new CspCookie(PDU::MAX_REPLY_LENGTH, addresses::PDU1);
|
|
||||||
CspCookie* pdu2CspCookie = new CspCookie(PDU::MAX_REPLY_LENGTH, addresses::PDU2);
|
|
||||||
CspCookie* acuCspCookie = new CspCookie(ACU::MAX_REPLY_LENGTH, addresses::ACU);
|
|
||||||
|
|
||||||
auto p60Fdir = new GomspacePowerFdir(objects::P60DOCK_HANDLER);
|
|
||||||
P60DockHandler* p60dockhandler =
|
|
||||||
new P60DockHandler(objects::P60DOCK_HANDLER, objects::CSP_COM_IF, p60DockCspCookie, p60Fdir);
|
|
||||||
|
|
||||||
auto pdu1Fdir = new GomspacePowerFdir(objects::PDU1_HANDLER);
|
|
||||||
PDU1Handler* pdu1handler =
|
|
||||||
new PDU1Handler(objects::PDU1_HANDLER, objects::CSP_COM_IF, pdu1CspCookie, pdu1Fdir);
|
|
||||||
|
|
||||||
auto pdu2Fdir = new GomspacePowerFdir(objects::PDU2_HANDLER);
|
|
||||||
PDU2Handler* pdu2handler =
|
|
||||||
new PDU2Handler(objects::PDU2_HANDLER, objects::CSP_COM_IF, pdu2CspCookie, pdu2Fdir);
|
|
||||||
|
|
||||||
auto acuFdir = new GomspacePowerFdir(objects::ACU_HANDLER);
|
|
||||||
ACUHandler* acuhandler =
|
|
||||||
new ACUHandler(objects::ACU_HANDLER, objects::CSP_COM_IF, acuCspCookie, acuFdir);
|
|
||||||
auto pcduHandler = new PCDUHandler(objects::PCDU_HANDLER, 50);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Setting PCDU devices to mode normal immediately after start up because PCDU is always
|
|
||||||
* running.
|
|
||||||
*/
|
|
||||||
p60dockhandler->setModeNormal();
|
|
||||||
pdu1handler->setModeNormal();
|
|
||||||
pdu2handler->setModeNormal();
|
|
||||||
acuhandler->setModeNormal();
|
|
||||||
if (pwrSwitcher != nullptr) {
|
|
||||||
*pwrSwitcher = pcduHandler;
|
|
||||||
}
|
|
||||||
#if OBSW_DEBUG_P60DOCK == 1
|
|
||||||
p60dockhandler->setDebugMode(true);
|
|
||||||
#endif
|
|
||||||
#if OBSW_DEBUG_ACU == 1
|
|
||||||
acuhandler->setDebugMode(true);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
void ObjectFactory::createRadSensorComponent(LinuxLibgpioIF* gpioComIF) {
|
|
||||||
using namespace gpio;
|
|
||||||
GpioCookie* gpioCookieRadSensor = new GpioCookie;
|
|
||||||
std::stringstream consumer;
|
|
||||||
consumer << "0x" << std::hex << objects::RAD_SENSOR;
|
|
||||||
GpiodRegularByLineName* gpio = new GpiodRegularByLineName(
|
|
||||||
q7s::gpioNames::RAD_SENSOR_CHIP_SELECT, consumer.str(), Direction::OUT, Levels::HIGH);
|
|
||||||
gpioCookieRadSensor->addGpio(gpioIds::CS_RAD_SENSOR, gpio);
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::ENABLE_RADFET, consumer.str(), Direction::OUT,
|
|
||||||
Levels::LOW);
|
|
||||||
gpioCookieRadSensor->addGpio(gpioIds::ENABLE_RADFET, gpio);
|
|
||||||
gpioComIF->addGpios(gpioCookieRadSensor);
|
|
||||||
|
|
||||||
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,
|
|
||||||
spiCookieRadSensor, gpioComIF);
|
|
||||||
static_cast<void>(radSensor);
|
|
||||||
// The radiation sensor ADC is powered by the 5V stack connector which should always be on
|
|
||||||
radSensor->setStartUpImmediately();
|
|
||||||
// It's a simple sensor, so just to to normal mode immediately
|
|
||||||
radSensor->setToGoToNormalModeImmediately();
|
|
||||||
#if OBSW_DEBUG_RAD_SENSOR == 1
|
|
||||||
radSensor->enablePeriodicDataPrint(true);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComIF* uartComIF,
|
|
||||||
PowerSwitchIF* pwrSwitcher) {
|
|
||||||
using namespace gpio;
|
|
||||||
GpioCookie* gpioCookieAcsBoard = new GpioCookie();
|
|
||||||
|
|
||||||
std::stringstream consumer;
|
|
||||||
GpiodRegularByLineName* gpio = nullptr;
|
|
||||||
consumer << "0x" << std::hex << objects::GYRO_0_ADIS_HANDLER;
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_0_ADIS_CS, consumer.str(), Direction::OUT,
|
|
||||||
Levels::HIGH);
|
|
||||||
gpioCookieAcsBoard->addGpio(gpioIds::GYRO_0_ADIS_CS, gpio);
|
|
||||||
|
|
||||||
consumer.str("");
|
|
||||||
consumer << "0x" << std::hex << objects::GYRO_1_L3G_HANDLER;
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_1_L3G_CS, consumer.str(), Direction::OUT,
|
|
||||||
Levels::HIGH);
|
|
||||||
gpioCookieAcsBoard->addGpio(gpioIds::GYRO_1_L3G_CS, gpio);
|
|
||||||
|
|
||||||
consumer.str("");
|
|
||||||
consumer << "0x" << std::hex << objects::GYRO_2_ADIS_HANDLER;
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_2_ADIS_CS, consumer.str(), Direction::OUT,
|
|
||||||
Levels::HIGH);
|
|
||||||
gpioCookieAcsBoard->addGpio(gpioIds::GYRO_2_ADIS_CS, gpio);
|
|
||||||
|
|
||||||
consumer.str("");
|
|
||||||
consumer << "0x" << std::hex << objects::GYRO_3_L3G_HANDLER;
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_3_L3G_CS, consumer.str(), Direction::OUT,
|
|
||||||
Levels::HIGH);
|
|
||||||
gpioCookieAcsBoard->addGpio(gpioIds::GYRO_3_L3G_CS, gpio);
|
|
||||||
|
|
||||||
consumer.str("");
|
|
||||||
consumer << "0x" << std::hex << objects::MGM_0_LIS3_HANDLER;
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::MGM_0_CS, consumer.str(), Direction::OUT,
|
|
||||||
Levels::HIGH);
|
|
||||||
gpioCookieAcsBoard->addGpio(gpioIds::MGM_0_LIS3_CS, gpio);
|
|
||||||
|
|
||||||
consumer.str("");
|
|
||||||
consumer << "0x" << std::hex << objects::MGM_1_RM3100_HANDLER;
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::MGM_1_CS, consumer.str(), Direction::OUT,
|
|
||||||
Levels::HIGH);
|
|
||||||
gpioCookieAcsBoard->addGpio(gpioIds::MGM_1_RM3100_CS, gpio);
|
|
||||||
|
|
||||||
consumer.str("");
|
|
||||||
consumer << "0x" << std::hex << objects::MGM_2_LIS3_HANDLER;
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::MGM_2_CS, consumer.str(), Direction::OUT,
|
|
||||||
Levels::HIGH);
|
|
||||||
gpioCookieAcsBoard->addGpio(gpioIds::MGM_2_LIS3_CS, gpio);
|
|
||||||
|
|
||||||
consumer.str("");
|
|
||||||
consumer << "0x" << std::hex << objects::MGM_3_RM3100_HANDLER;
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::MGM_3_CS, consumer.str(), Direction::OUT,
|
|
||||||
Levels::HIGH);
|
|
||||||
gpioCookieAcsBoard->addGpio(gpioIds::MGM_3_RM3100_CS, gpio);
|
|
||||||
|
|
||||||
consumer.str("");
|
|
||||||
consumer << "0x" << std::hex << objects::GPS_CONTROLLER;
|
|
||||||
// GNSS reset pins are active low
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::RESET_GNSS_0, consumer.str(), Direction::OUT,
|
|
||||||
Levels::HIGH);
|
|
||||||
gpioCookieAcsBoard->addGpio(gpioIds::GNSS_0_NRESET, gpio);
|
|
||||||
|
|
||||||
consumer.str("");
|
|
||||||
consumer << "0x" << std::hex << objects::GPS_CONTROLLER;
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::RESET_GNSS_1, consumer.str(), Direction::OUT,
|
|
||||||
Levels::HIGH);
|
|
||||||
gpioCookieAcsBoard->addGpio(gpioIds::GNSS_1_NRESET, gpio);
|
|
||||||
|
|
||||||
consumer.str("");
|
|
||||||
consumer << "0x" << std::hex << objects::GYRO_0_ADIS_HANDLER;
|
|
||||||
// Enable pins must be pulled low for regular operations
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_0_ENABLE, consumer.str(), Direction::OUT,
|
|
||||||
Levels::LOW);
|
|
||||||
gpioCookieAcsBoard->addGpio(gpioIds::GYRO_0_ENABLE, gpio);
|
|
||||||
|
|
||||||
consumer.str("");
|
|
||||||
consumer << "0x" << std::hex << objects::GYRO_2_ADIS_HANDLER;
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_2_ENABLE, consumer.str(), Direction::OUT,
|
|
||||||
Levels::LOW);
|
|
||||||
gpioCookieAcsBoard->addGpio(gpioIds::GYRO_2_ENABLE, gpio);
|
|
||||||
|
|
||||||
// Enable pins for GNSS
|
|
||||||
consumer.str("");
|
|
||||||
consumer << "0x" << std::hex << objects::GPS_CONTROLLER;
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::GNSS_0_ENABLE, consumer.str(), Direction::OUT,
|
|
||||||
Levels::LOW);
|
|
||||||
gpioCookieAcsBoard->addGpio(gpioIds::GNSS_0_ENABLE, gpio);
|
|
||||||
|
|
||||||
consumer.str("");
|
|
||||||
consumer << "0x" << std::hex << objects::GPS_CONTROLLER;
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::GNSS_1_ENABLE, consumer.str(), Direction::OUT,
|
|
||||||
Levels::LOW);
|
|
||||||
gpioCookieAcsBoard->addGpio(gpioIds::GNSS_1_ENABLE, gpio);
|
|
||||||
|
|
||||||
// Select pin. 0 for GPS side A, 1 for GPS side B
|
|
||||||
consumer.str("");
|
|
||||||
consumer << "0x" << std::hex << objects::GPS_CONTROLLER;
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::GNSS_SELECT, consumer.str(), Direction::OUT,
|
|
||||||
Levels::LOW);
|
|
||||||
gpioCookieAcsBoard->addGpio(gpioIds::GNSS_SELECT, gpio);
|
|
||||||
gpioComIF->addGpios(gpioCookieAcsBoard);
|
|
||||||
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,
|
|
||||||
spiCookie, spi::LIS3_TRANSITION_DELAY);
|
|
||||||
fdir = new AcsBoardFdir(objects::MGM_0_LIS3_HANDLER);
|
|
||||||
mgmLis3Handler->setCustomFdir(fdir);
|
|
||||||
static_cast<void>(mgmLis3Handler);
|
|
||||||
#if OBSW_TEST_ACS == 1
|
|
||||||
mgmLis3Handler->setStartUpImmediately();
|
|
||||||
mgmLis3Handler->setToGoToNormalMode(true);
|
|
||||||
#endif
|
|
||||||
#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);
|
|
||||||
fdir = new AcsBoardFdir(objects::MGM_1_RM3100_HANDLER);
|
|
||||||
mgmRm3100Handler->setCustomFdir(fdir);
|
|
||||||
mgmRm3100Handler->setParent(objects::ACS_BOARD_ASS);
|
|
||||||
static_cast<void>(mgmRm3100Handler);
|
|
||||||
#if OBSW_TEST_ACS == 1
|
|
||||||
mgmRm3100Handler->setStartUpImmediately();
|
|
||||||
mgmRm3100Handler->setToGoToNormalMode(true);
|
|
||||||
#endif
|
|
||||||
#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,
|
|
||||||
spiCookie, spi::LIS3_TRANSITION_DELAY);
|
|
||||||
fdir = new AcsBoardFdir(objects::MGM_2_LIS3_HANDLER);
|
|
||||||
mgmLis3Handler->setCustomFdir(fdir);
|
|
||||||
mgmLis3Handler->setParent(objects::ACS_BOARD_ASS);
|
|
||||||
static_cast<void>(mgmLis3Handler);
|
|
||||||
#if OBSW_TEST_ACS == 1
|
|
||||||
mgmLis3Handler->setStartUpImmediately();
|
|
||||||
mgmLis3Handler->setToGoToNormalMode(true);
|
|
||||||
#endif
|
|
||||||
#if OBSW_DEBUG_ACS == 1
|
|
||||||
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,
|
|
||||||
spiCookie, spi::RM3100_TRANSITION_DELAY);
|
|
||||||
fdir = new AcsBoardFdir(objects::MGM_3_RM3100_HANDLER);
|
|
||||||
mgmRm3100Handler->setCustomFdir(fdir);
|
|
||||||
mgmRm3100Handler->setParent(objects::ACS_BOARD_ASS);
|
|
||||||
#if OBSW_TEST_ACS == 1
|
|
||||||
mgmRm3100Handler->setStartUpImmediately();
|
|
||||||
mgmRm3100Handler->setToGoToNormalMode(true);
|
|
||||||
#endif
|
|
||||||
#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);
|
|
||||||
fdir = new AcsBoardFdir(objects::GYRO_0_ADIS_HANDLER);
|
|
||||||
adisHandler->setCustomFdir(fdir);
|
|
||||||
adisHandler->setParent(objects::ACS_BOARD_ASS);
|
|
||||||
static_cast<void>(adisHandler);
|
|
||||||
#if OBSW_TEST_ACS == 1
|
|
||||||
adisHandler->setStartUpImmediately();
|
|
||||||
adisHandler->setToGoToNormalModeImmediately();
|
|
||||||
#endif
|
|
||||||
#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,
|
|
||||||
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);
|
|
||||||
fdir = new AcsBoardFdir(objects::GYRO_1_L3G_HANDLER);
|
|
||||||
gyroL3gHandler->setCustomFdir(fdir);
|
|
||||||
gyroL3gHandler->setParent(objects::ACS_BOARD_ASS);
|
|
||||||
static_cast<void>(gyroL3gHandler);
|
|
||||||
#if OBSW_TEST_ACS == 1
|
|
||||||
gyroL3gHandler->setStartUpImmediately();
|
|
||||||
gyroL3gHandler->setToGoToNormalMode(true);
|
|
||||||
#endif
|
|
||||||
#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, ADIS1650X::Type::ADIS16505);
|
|
||||||
fdir = new AcsBoardFdir(objects::GYRO_2_ADIS_HANDLER);
|
|
||||||
adisHandler->setCustomFdir(fdir);
|
|
||||||
adisHandler->setParent(objects::ACS_BOARD_ASS);
|
|
||||||
#if OBSW_TEST_ACS == 1
|
|
||||||
adisHandler->setStartUpImmediately();
|
|
||||||
adisHandler->setToGoToNormalModeImmediately();
|
|
||||||
#endif
|
|
||||||
// Gyro 3 Side B
|
|
||||||
spiCookie =
|
|
||||||
new SpiCookie(addresses::GYRO_3_L3G, gpioIds::GYRO_3_L3G_CS, spiDev, 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, spi::L3G_TRANSITION_DELAY);
|
|
||||||
fdir = new AcsBoardFdir(objects::GYRO_3_L3G_HANDLER);
|
|
||||||
gyroL3gHandler->setCustomFdir(fdir);
|
|
||||||
gyroL3gHandler->setParent(objects::ACS_BOARD_ASS);
|
|
||||||
#if OBSW_TEST_ACS == 1
|
|
||||||
gyroL3gHandler->setStartUpImmediately();
|
|
||||||
gyroL3gHandler->setToGoToNormalMode(true);
|
|
||||||
#endif
|
|
||||||
#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 =
|
|
||||||
new GPSHyperionLinuxController(objects::GPS_CONTROLLER, objects::NO_OBJECT, debugGps);
|
|
||||||
gpsHandler0->setResetPinTriggerFunction(gps::triggerGpioResetPin, &resetArgsGnss0);
|
|
||||||
|
|
||||||
AcsBoardHelper acsBoardHelper = AcsBoardHelper(
|
|
||||||
objects::MGM_0_LIS3_HANDLER, objects::MGM_1_RM3100_HANDLER, objects::MGM_2_LIS3_HANDLER,
|
|
||||||
objects::MGM_3_RM3100_HANDLER, objects::GYRO_0_ADIS_HANDLER, objects::GYRO_1_L3G_HANDLER,
|
|
||||||
objects::GYRO_2_ADIS_HANDLER, objects::GYRO_3_L3G_HANDLER, objects::GPS_CONTROLLER);
|
|
||||||
auto acsAss = new AcsBoardAssembly(objects::ACS_BOARD_ASS, objects::NO_OBJECT, pwrSwitcher,
|
|
||||||
acsBoardHelper, gpioComIF);
|
|
||||||
static_cast<void>(acsAss);
|
|
||||||
#endif /* OBSW_ADD_ACS_HANDLERS == 1 */
|
|
||||||
}
|
|
||||||
|
|
||||||
void ObjectFactory::createHeaterComponents() {
|
|
||||||
using namespace gpio;
|
|
||||||
GpioCookie* heaterGpiosCookie = new GpioCookie;
|
|
||||||
GpiodRegularByLineName* gpio = nullptr;
|
|
||||||
|
|
||||||
std::stringstream consumer;
|
|
||||||
consumer << "0x" << std::hex << objects::HEATER_HANDLER;
|
|
||||||
/* Pin H2-11 on stack connector */
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::HEATER_0, consumer.str(), Direction::OUT,
|
|
||||||
Levels::LOW);
|
|
||||||
heaterGpiosCookie->addGpio(gpioIds::HEATER_0, gpio);
|
|
||||||
/* Pin H2-12 on stack connector */
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::HEATER_1, consumer.str(), Direction::OUT,
|
|
||||||
Levels::LOW);
|
|
||||||
heaterGpiosCookie->addGpio(gpioIds::HEATER_1, gpio);
|
|
||||||
|
|
||||||
/* Pin H2-13 on stack connector */
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::HEATER_2, consumer.str(), Direction::OUT,
|
|
||||||
Levels::LOW);
|
|
||||||
heaterGpiosCookie->addGpio(gpioIds::HEATER_2, gpio);
|
|
||||||
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::HEATER_3, consumer.str(), Direction::OUT,
|
|
||||||
Levels::LOW);
|
|
||||||
heaterGpiosCookie->addGpio(gpioIds::HEATER_3, gpio);
|
|
||||||
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::HEATER_4, consumer.str(), Direction::OUT,
|
|
||||||
Levels::LOW);
|
|
||||||
heaterGpiosCookie->addGpio(gpioIds::HEATER_4, gpio);
|
|
||||||
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::HEATER_5, consumer.str(), Direction::OUT,
|
|
||||||
Levels::LOW);
|
|
||||||
heaterGpiosCookie->addGpio(gpioIds::HEATER_5, gpio);
|
|
||||||
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::HEATER_6, consumer.str(), Direction::OUT,
|
|
||||||
Levels::LOW);
|
|
||||||
heaterGpiosCookie->addGpio(gpioIds::HEATER_6, gpio);
|
|
||||||
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::HEATER_7, consumer.str(), Direction::OUT,
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ObjectFactory::createSolarArrayDeploymentComponents() {
|
|
||||||
using namespace gpio;
|
|
||||||
GpioCookie* solarArrayDeplCookie = new GpioCookie;
|
|
||||||
GpiodRegularByLineName* gpio = nullptr;
|
|
||||||
|
|
||||||
std::stringstream consumer;
|
|
||||||
consumer << "0x" << std::hex << objects::SOLAR_ARRAY_DEPL_HANDLER;
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::SA_DPL_PIN_0, consumer.str(), Direction::OUT,
|
|
||||||
Levels::LOW);
|
|
||||||
solarArrayDeplCookie->addGpio(gpioIds::DEPLSA1, gpio);
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::SA_DPL_PIN_1, consumer.str(), Direction::OUT,
|
|
||||||
Levels::LOW);
|
|
||||||
solarArrayDeplCookie->addGpio(gpioIds::DEPLSA2, gpio);
|
|
||||||
|
|
||||||
// TODO: Find out burn time. For now set to 1000 ms.
|
|
||||||
new SolarArrayDeploymentHandler(objects::SOLAR_ARRAY_DEPL_HANDLER, objects::GPIO_IF,
|
|
||||||
solarArrayDeplCookie, objects::PCDU_HANDLER,
|
|
||||||
pcdu::Switches::PDU2_CH5_DEPLOYMENT_MECHANISM_8V,
|
|
||||||
gpioIds::DEPLSA1, gpioIds::DEPLSA2, 1000);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ObjectFactory::createSyrlinksComponents(PowerSwitchIF* pwrSwitcher) {
|
|
||||||
UartCookie* syrlinksUartCookie =
|
|
||||||
new UartCookie(objects::SYRLINKS_HK_HANDLER, q7s::UART_SYRLINKS_DEV, uart::SYRLINKS_BAUD,
|
|
||||||
syrlinks::MAX_REPLY_SIZE, UartModes::NON_CANONICAL);
|
|
||||||
syrlinksUartCookie->setParityEven();
|
|
||||||
|
|
||||||
auto syrlinksFdir = new SyrlinksFdir(objects::SYRLINKS_HK_HANDLER);
|
|
||||||
auto syrlinksHandler =
|
|
||||||
new SyrlinksHkHandler(objects::SYRLINKS_HK_HANDLER, objects::UART_COM_IF, syrlinksUartCookie,
|
|
||||||
pcdu::PDU1_CH1_SYRLINKS_12V, syrlinksFdir);
|
|
||||||
syrlinksHandler->setPowerSwitcher(pwrSwitcher);
|
|
||||||
#if OBSW_DEBUG_SYRLINKS == 1
|
|
||||||
syrlinksHandler->setDebugMode(true);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF) {
|
|
||||||
using namespace gpio;
|
|
||||||
std::stringstream consumer;
|
|
||||||
#if OBSW_ADD_PLOC_MPSOC == 1
|
|
||||||
consumer << "0x" << std::hex << objects::PLOC_MPSOC_HANDLER;
|
|
||||||
auto gpioConfigMPSoC = new GpiodRegularByLineName(q7s::gpioNames::ENABLE_MPSOC_UART,
|
|
||||||
consumer.str(), Direction::OUT, Levels::HIGH);
|
|
||||||
auto mpsocGpioCookie = new GpioCookie;
|
|
||||||
mpsocGpioCookie->addGpio(gpioIds::ENABLE_MPSOC_UART, gpioConfigMPSoC);
|
|
||||||
gpioComIF->addGpios(mpsocGpioCookie);
|
|
||||||
auto mpsocCookie =
|
|
||||||
new UartCookie(objects::PLOC_MPSOC_HANDLER, q7s::UART_PLOC_MPSOC_DEV, uart::PLOC_MPSOC_BAUD,
|
|
||||||
mpsoc::MAX_REPLY_SIZE, UartModes::NON_CANONICAL);
|
|
||||||
mpsocCookie->setNoFixedSizeReply();
|
|
||||||
auto plocMpsocHelper = new PlocMPSoCHelper(objects::PLOC_MPSOC_HELPER);
|
|
||||||
new PlocMPSoCHandler(objects::PLOC_MPSOC_HANDLER, objects::UART_COM_IF, mpsocCookie,
|
|
||||||
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);
|
|
||||||
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);
|
|
||||||
supervisorCookie->setNoFixedSizeReply();
|
|
||||||
new PlocSupervisorHandler(objects::PLOC_SUPERVISOR_HANDLER, objects::UART_COM_IF,
|
|
||||||
supervisorCookie, Gpio(gpioIds::ENABLE_SUPV_UART, gpioComIF),
|
|
||||||
pcdu::PDU1_CH6_PLOC_12V);
|
|
||||||
#endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */
|
|
||||||
static_cast<void>(consumer);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ObjectFactory::createReactionWheelComponents(LinuxLibgpioIF* gpioComIF) {
|
|
||||||
using namespace gpio;
|
|
||||||
GpioCookie* gpioCookieRw = new GpioCookie;
|
|
||||||
GpioCallback* csRw1 =
|
|
||||||
new GpioCallback("Chip select reaction wheel 1", Direction::OUT, Levels::HIGH,
|
|
||||||
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
|
|
||||||
gpioCookieRw->addGpio(gpioIds::CS_RW1, csRw1);
|
|
||||||
GpioCallback* csRw2 =
|
|
||||||
new GpioCallback("Chip select reaction wheel 2", Direction::OUT, Levels::HIGH,
|
|
||||||
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
|
|
||||||
gpioCookieRw->addGpio(gpioIds::CS_RW2, csRw2);
|
|
||||||
GpioCallback* csRw3 =
|
|
||||||
new GpioCallback("Chip select reaction wheel 3", Direction::OUT, Levels::HIGH,
|
|
||||||
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
|
|
||||||
gpioCookieRw->addGpio(gpioIds::CS_RW3, csRw3);
|
|
||||||
GpioCallback* csRw4 =
|
|
||||||
new GpioCallback("Chip select reaction wheel 4", Direction::OUT, Levels::HIGH,
|
|
||||||
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
|
|
||||||
gpioCookieRw->addGpio(gpioIds::CS_RW4, csRw4);
|
|
||||||
|
|
||||||
std::stringstream consumer;
|
|
||||||
GpiodRegularByLineName* gpio = nullptr;
|
|
||||||
consumer << "0x" << std::hex << objects::RW1;
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::EN_RW_1, consumer.str(), Direction::OUT,
|
|
||||||
Levels::LOW);
|
|
||||||
gpioCookieRw->addGpio(gpioIds::EN_RW1, gpio);
|
|
||||||
consumer.str("");
|
|
||||||
consumer << "0x" << std::hex << objects::RW2;
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::EN_RW_2, consumer.str(), Direction::OUT,
|
|
||||||
Levels::LOW);
|
|
||||||
gpioCookieRw->addGpio(gpioIds::EN_RW2, gpio);
|
|
||||||
consumer.str("");
|
|
||||||
consumer << "0x" << std::hex << objects::RW3;
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::EN_RW_3, consumer.str(), Direction::OUT,
|
|
||||||
Levels::LOW);
|
|
||||||
gpioCookieRw->addGpio(gpioIds::EN_RW3, gpio);
|
|
||||||
consumer.str("");
|
|
||||||
consumer << "0x" << std::hex << objects::RW4;
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::EN_RW_4, consumer.str(), Direction::OUT,
|
|
||||||
Levels::LOW);
|
|
||||||
gpioCookieRw->addGpio(gpioIds::EN_RW4, gpio);
|
|
||||||
|
|
||||||
gpioComIF->addGpios(gpioCookieRw);
|
|
||||||
|
|
||||||
#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);
|
|
||||||
#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);
|
|
||||||
#endif
|
|
||||||
#endif /* OBSW_ADD_RW == 1 */
|
|
||||||
}
|
|
||||||
|
|
||||||
void ObjectFactory::createCcsdsComponents(LinuxLibgpioIF* gpioComIF) {
|
|
||||||
using namespace gpio;
|
|
||||||
// GPIO definitions of signals connected to the virtual channel interfaces of the PTME IP Core
|
|
||||||
GpioCookie* gpioCookiePtmeIp = new GpioCookie;
|
|
||||||
GpiodRegularByLineName* gpio = nullptr;
|
|
||||||
std::stringstream consumer;
|
|
||||||
consumer.str("PAPB VC0");
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_BUSY_SIGNAL_VC0, consumer.str());
|
|
||||||
gpioCookiePtmeIp->addGpio(gpioIds::VC0_PAPB_BUSY, gpio);
|
|
||||||
consumer.str("PAPB VC0");
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_EMPTY_SIGNAL_VC0, consumer.str());
|
|
||||||
gpioCookiePtmeIp->addGpio(gpioIds::VC0_PAPB_EMPTY, gpio);
|
|
||||||
consumer.str("PAPB VC 1");
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_BUSY_SIGNAL_VC1, consumer.str());
|
|
||||||
gpioCookiePtmeIp->addGpio(gpioIds::VC1_PAPB_BUSY, gpio);
|
|
||||||
consumer.str("");
|
|
||||||
consumer.str("PAPB VC 1");
|
|
||||||
gpioCookiePtmeIp->addGpio(gpioIds::VC1_PAPB_EMPTY, gpio);
|
|
||||||
consumer.str("");
|
|
||||||
consumer.str("PAPB VC 2");
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_BUSY_SIGNAL_VC2, consumer.str());
|
|
||||||
gpioCookiePtmeIp->addGpio(gpioIds::VC2_PAPB_BUSY, gpio);
|
|
||||||
consumer.str("");
|
|
||||||
consumer.str("PAPB VC 2");
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_EMPTY_SIGNAL_VC2, consumer.str());
|
|
||||||
gpioCookiePtmeIp->addGpio(gpioIds::VC2_PAPB_EMPTY, gpio);
|
|
||||||
consumer.str("");
|
|
||||||
consumer.str("PAPB VC 3");
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_BUSY_SIGNAL_VC3, consumer.str());
|
|
||||||
gpioCookiePtmeIp->addGpio(gpioIds::VC3_PAPB_BUSY, gpio);
|
|
||||||
consumer.str("");
|
|
||||||
consumer.str("PAPB VC 3");
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_EMPTY_SIGNAL_VC3, consumer.str());
|
|
||||||
gpioCookiePtmeIp->addGpio(gpioIds::VC3_PAPB_EMPTY, gpio);
|
|
||||||
|
|
||||||
gpioComIF->addGpios(gpioCookiePtmeIp);
|
|
||||||
|
|
||||||
// Creating virtual channel interfaces
|
|
||||||
VcInterfaceIF* vc0 =
|
|
||||||
new PapbVcInterface(gpioComIF, gpioIds::VC0_PAPB_BUSY, gpioIds::VC0_PAPB_EMPTY, q7s::UIO_PTME,
|
|
||||||
q7s::uiomapids::PTME_VC0);
|
|
||||||
VcInterfaceIF* vc1 =
|
|
||||||
new PapbVcInterface(gpioComIF, gpioIds::VC1_PAPB_BUSY, gpioIds::VC1_PAPB_EMPTY, q7s::UIO_PTME,
|
|
||||||
q7s::uiomapids::PTME_VC1);
|
|
||||||
VcInterfaceIF* vc2 =
|
|
||||||
new PapbVcInterface(gpioComIF, gpioIds::VC2_PAPB_BUSY, gpioIds::VC2_PAPB_EMPTY, q7s::UIO_PTME,
|
|
||||||
q7s::uiomapids::PTME_VC2);
|
|
||||||
VcInterfaceIF* vc3 =
|
|
||||||
new PapbVcInterface(gpioComIF, gpioIds::VC3_PAPB_BUSY, gpioIds::VC3_PAPB_EMPTY, q7s::UIO_PTME,
|
|
||||||
q7s::uiomapids::PTME_VC3);
|
|
||||||
|
|
||||||
// Creating ptme object and adding virtual channel interfaces
|
|
||||||
Ptme* ptme = new Ptme(objects::PTME);
|
|
||||||
ptme->addVcInterface(ccsds::VC0, vc0);
|
|
||||||
ptme->addVcInterface(ccsds::VC1, vc1);
|
|
||||||
ptme->addVcInterface(ccsds::VC2, vc2);
|
|
||||||
ptme->addVcInterface(ccsds::VC3, vc3);
|
|
||||||
|
|
||||||
AxiPtmeConfig* axiPtmeConfig =
|
|
||||||
new AxiPtmeConfig(objects::AXI_PTME_CONFIG, q7s::UIO_PTME, q7s::uiomapids::PTME_CONFIG);
|
|
||||||
PtmeConfig* ptmeConfig = new PtmeConfig(objects::PTME_CONFIG, axiPtmeConfig);
|
|
||||||
#if OBSW_ENABLE_SYRLINKS_TRANSMIT_TIMEOUT == 1
|
|
||||||
// Set to high value when not sending via syrlinks
|
|
||||||
static const uint32_t TRANSMITTER_TIMEOUT = 86400000; // 1 day
|
|
||||||
#else
|
|
||||||
static const uint32_t TRANSMITTER_TIMEOUT = 900000; // 15 minutes
|
|
||||||
#endif
|
|
||||||
CCSDSHandler* ccsdsHandler = new CCSDSHandler(
|
|
||||||
objects::CCSDS_HANDLER, objects::PTME, objects::CCSDS_PACKET_DISTRIBUTOR, ptmeConfig,
|
|
||||||
gpioComIF, gpioIds::RS485_EN_TX_CLOCK, gpioIds::RS485_EN_TX_DATA, TRANSMITTER_TIMEOUT);
|
|
||||||
|
|
||||||
VirtualChannel* vc = nullptr;
|
|
||||||
vc = new VirtualChannel(ccsds::VC0, common::VC0_QUEUE_SIZE, objects::CCSDS_HANDLER);
|
|
||||||
ccsdsHandler->addVirtualChannel(ccsds::VC0, vc);
|
|
||||||
vc = new VirtualChannel(ccsds::VC1, common::VC1_QUEUE_SIZE, objects::CCSDS_HANDLER);
|
|
||||||
ccsdsHandler->addVirtualChannel(ccsds::VC1, vc);
|
|
||||||
vc = new VirtualChannel(ccsds::VC2, common::VC2_QUEUE_SIZE, objects::CCSDS_HANDLER);
|
|
||||||
ccsdsHandler->addVirtualChannel(ccsds::VC2, vc);
|
|
||||||
vc = new VirtualChannel(ccsds::VC3, common::VC3_QUEUE_SIZE, objects::CCSDS_HANDLER);
|
|
||||||
ccsdsHandler->addVirtualChannel(ccsds::VC3, vc);
|
|
||||||
|
|
||||||
GpioCookie* gpioCookiePdec = new GpioCookie;
|
|
||||||
consumer.str("");
|
|
||||||
consumer << "0x" << std::hex << objects::PDEC_HANDLER;
|
|
||||||
// GPIO also low after linux boot (specified by device-tree)
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::PDEC_RESET, consumer.str(), Direction::OUT,
|
|
||||||
Levels::LOW);
|
|
||||||
gpioCookiePdec->addGpio(gpioIds::PDEC_RESET, gpio);
|
|
||||||
|
|
||||||
gpioComIF->addGpios(gpioCookiePdec);
|
|
||||||
|
|
||||||
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);
|
|
||||||
|
|
||||||
GpioCookie* gpioRS485Chip = new GpioCookie;
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::RS485_EN_TX_CLOCK, "RS485 Transceiver",
|
|
||||||
Direction::OUT, Levels::LOW);
|
|
||||||
gpioRS485Chip->addGpio(gpioIds::RS485_EN_TX_CLOCK, gpio);
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::RS485_EN_TX_DATA, "RS485 Transceiver",
|
|
||||||
Direction::OUT, Levels::LOW);
|
|
||||||
gpioRS485Chip->addGpio(gpioIds::RS485_EN_TX_DATA, gpio);
|
|
||||||
|
|
||||||
// Default configuration enables RX channels (RXEN = LOW)
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::RS485_EN_RX_CLOCK, "RS485 Transceiver",
|
|
||||||
Direction::OUT, Levels::LOW);
|
|
||||||
gpioRS485Chip->addGpio(gpioIds::RS485_EN_RX_CLOCK, gpio);
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::RS485_EN_RX_DATA, "RS485 Transceiver",
|
|
||||||
Direction::OUT, Levels::LOW);
|
|
||||||
gpioRS485Chip->addGpio(gpioIds::RS485_EN_RX_DATA, gpio);
|
|
||||||
|
|
||||||
gpioComIF->addGpios(gpioRS485Chip);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ObjectFactory::createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF,
|
|
||||||
PowerSwitchIF* pwrSwitcher) {
|
|
||||||
using namespace gpio;
|
|
||||||
// Create all GPIO components first
|
|
||||||
GpioCookie* plPcduGpios = new GpioCookie;
|
|
||||||
GpiodRegularByLineName* gpio = nullptr;
|
|
||||||
std::string consumer;
|
|
||||||
// Switch pins are active high
|
|
||||||
consumer = "PLPCDU_ENB_VBAT_0";
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::PL_PCDU_ENABLE_VBAT0, consumer, Direction::OUT,
|
|
||||||
gpio::Levels::LOW);
|
|
||||||
plPcduGpios->addGpio(gpioIds::PLPCDU_ENB_VBAT0, gpio);
|
|
||||||
consumer = "PLPCDU_ENB_VBAT_1";
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::PL_PCDU_ENABLE_VBAT1, consumer, Direction::OUT,
|
|
||||||
gpio::Levels::LOW);
|
|
||||||
plPcduGpios->addGpio(gpioIds::PLPCDU_ENB_VBAT1, gpio);
|
|
||||||
consumer = "PLPCDU_ENB_DRO";
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::PL_PCDU_ENABLE_DRO, consumer, Direction::OUT,
|
|
||||||
gpio::Levels::LOW);
|
|
||||||
plPcduGpios->addGpio(gpioIds::PLPCDU_ENB_DRO, gpio);
|
|
||||||
consumer = "PLPCDU_ENB_X8";
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::PL_PCDU_ENABLE_X8, consumer, Direction::OUT,
|
|
||||||
gpio::Levels::LOW);
|
|
||||||
plPcduGpios->addGpio(gpioIds::PLPCDU_ENB_X8, gpio);
|
|
||||||
consumer = "PLPCDU_ENB_TX";
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::PL_PCDU_ENABLE_TX, consumer, Direction::OUT,
|
|
||||||
gpio::Levels::LOW);
|
|
||||||
plPcduGpios->addGpio(gpioIds::PLPCDU_ENB_TX, gpio);
|
|
||||||
consumer = "PLPCDU_ENB_MPA";
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::PL_PCDU_ENABLE_MPA, consumer, Direction::OUT,
|
|
||||||
gpio::Levels::LOW);
|
|
||||||
plPcduGpios->addGpio(gpioIds::PLPCDU_ENB_MPA, gpio);
|
|
||||||
consumer = "PLPCDU_ENB_HPA";
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::PL_PCDU_ENABLE_HPA, consumer, Direction::OUT,
|
|
||||||
gpio::Levels::LOW);
|
|
||||||
plPcduGpios->addGpio(gpioIds::PLPCDU_ENB_HPA, gpio);
|
|
||||||
|
|
||||||
// Chip select pin is active low
|
|
||||||
consumer = "PLPCDU_ADC_CS";
|
|
||||||
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,
|
|
||||||
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,
|
|
||||||
pcdu::Switches::PDU2_CH6_PL_PCDU_BATT_1_14V8, false);
|
|
||||||
spiCookie->setCallbackMode(PayloadPcduHandler::extConvAsTwoCallback, plPcduHandler);
|
|
||||||
// plPcduHandler->enablePeriodicPrintout(true, 5);
|
|
||||||
// static_cast<void>(plPcduHandler);
|
|
||||||
#if OBSW_TEST_PL_PCDU == 1
|
|
||||||
plPcduHandler->setStartUpImmediately();
|
|
||||||
#endif
|
|
||||||
#if OBSW_DEBUG_PL_PCDU == 1
|
|
||||||
plPcduHandler->setToGoToNormalModeImmediately(true);
|
|
||||||
plPcduHandler->enablePeriodicPrintout(true, 10);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
void ObjectFactory::createTestComponents(LinuxLibgpioIF* gpioComIF) {
|
|
||||||
new Q7STestTask(objects::TEST_TASK);
|
|
||||||
#if OBSW_ADD_SPI_TEST_CODE == 1
|
|
||||||
new SpiTestClass(objects::SPI_TEST, gpioComIF);
|
|
||||||
#endif
|
|
||||||
#if OBSW_ADD_I2C_TEST_CODE == 1
|
|
||||||
new I2cTestClass(objects::I2C_TEST, q7s::I2C_DEFAULT_DEV);
|
|
||||||
#endif
|
|
||||||
#if OBSW_ADD_UART_TEST_CODE == 1
|
|
||||||
new UartTestClass(objects::UART_TEST);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
void ObjectFactory::testAcsBrdAss(AcsBoardAssembly* acsAss) {
|
|
||||||
CommandMessage msg;
|
|
||||||
ModeMessage::setModeMessage(&msg, ModeMessage::CMD_MODE_COMMAND, DeviceHandlerIF::MODE_NORMAL,
|
|
||||||
duallane::A_SIDE);
|
|
||||||
ReturnValue_t result = MessageQueueSenderIF::sendMessage(acsAss->getCommandQueue(), &msg);
|
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
|
||||||
sif::warning << "Sending mode command failed" << std::endl;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
target_sources(${OBSW_NAME} PRIVATE
|
|
||||||
fmObjectFactory.cpp
|
|
||||||
)
|
|
67
bsp_q7s/fmObjectFactory.cpp
Normal file
67
bsp_q7s/fmObjectFactory.cpp
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
#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"
|
||||||
|
#include "mission/system/tree/acsModeTree.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();
|
||||||
|
satsystem::initAcsSubsystem();
|
||||||
|
}
|
@ -1,6 +1,2 @@
|
|||||||
target_sources(${OBSW_NAME} PRIVATE
|
target_sources(${OBSW_NAME} PRIVATE FileSystemHandler.cpp SdCardManager.cpp
|
||||||
FileSystemHandler.cpp
|
scratchApi.cpp FilesystemHelper.cpp)
|
||||||
SdCardManager.cpp
|
|
||||||
scratchApi.cpp
|
|
||||||
FilesystemHelper.cpp
|
|
||||||
)
|
|
||||||
|
@ -8,8 +8,6 @@
|
|||||||
|
|
||||||
FilesystemHelper::FilesystemHelper() {}
|
FilesystemHelper::FilesystemHelper() {}
|
||||||
|
|
||||||
FilesystemHelper::~FilesystemHelper() {}
|
|
||||||
|
|
||||||
ReturnValue_t FilesystemHelper::checkPath(std::string path) {
|
ReturnValue_t FilesystemHelper::checkPath(std::string path) {
|
||||||
SdCardManager* sdcMan = SdCardManager::instance();
|
SdCardManager* sdcMan = SdCardManager::instance();
|
||||||
if (sdcMan == nullptr) {
|
if (sdcMan == nullptr) {
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
|
#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
|
* @author J. Meier
|
||||||
*/
|
*/
|
||||||
@ -20,11 +20,8 @@ class FilesystemHelper : public HasReturnvaluesIF {
|
|||||||
//! [EXPORT] : [COMMENT] Specified file does not exist on filesystem
|
//! [EXPORT] : [COMMENT] Specified file does not exist on filesystem
|
||||||
static const ReturnValue_t FILE_NOT_EXISTS = MAKE_RETURN_CODE(0xA1);
|
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.
|
* appropriate SD card is mounted.
|
||||||
*
|
*
|
||||||
* @param path Path to check
|
* @param path Path to check
|
||||||
@ -39,11 +36,14 @@ class FilesystemHelper : public HasReturnvaluesIF {
|
|||||||
/**
|
/**
|
||||||
* @brief Checks if the file exists on the filesystem.
|
* @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);
|
static ReturnValue_t fileExists(std::string file);
|
||||||
|
|
||||||
|
private:
|
||||||
|
FilesystemHelper();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* BSP_Q7S_MEMORY_FILESYSTEMHELPER_H_ */
|
#endif /* BSP_Q7S_MEMORY_FILESYSTEMHELPER_H_ */
|
||||||
|
@ -8,14 +8,19 @@
|
|||||||
#include "core/InitMission.h"
|
#include "core/InitMission.h"
|
||||||
#include "fsfw/tasks/TaskFactory.h"
|
#include "fsfw/tasks/TaskFactory.h"
|
||||||
#include "fsfw/version.h"
|
#include "fsfw/version.h"
|
||||||
|
#include "q7sConfig.h"
|
||||||
#include "watchdog/definitions.h"
|
#include "watchdog/definitions.h"
|
||||||
|
|
||||||
static int OBSW_ALREADY_RUNNING = -2;
|
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() {
|
int obsw::obsw() {
|
||||||
using namespace fsfw;
|
using namespace fsfw;
|
||||||
std::cout << "-- EIVE OBSW --" << std::endl;
|
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::cout << "-- OBSW v" << common::OBSW_VERSION << " | FSFW v" << fsfw::FSFW_VERSION << " --"
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
std::cout << "-- " << __DATE__ << " " << __TIME__ << " --" << std::endl;
|
std::cout << "-- " << __DATE__ << " " << __TIME__ << " --" << std::endl;
|
||||||
|
@ -1,3 +1 @@
|
|||||||
target_sources(${SIMPLE_OBSW_NAME} PRIVATE
|
target_sources(${SIMPLE_OBSW_NAME} PRIVATE simple.cpp)
|
||||||
simple.cpp
|
|
||||||
)
|
|
||||||
|
@ -1,3 +1 @@
|
|||||||
target_sources(${OBSW_NAME} PRIVATE
|
target_sources(${OBSW_NAME} PRIVATE Xadc.cpp)
|
||||||
Xadc.cpp
|
|
||||||
)
|
|
||||||
|
@ -89,13 +89,23 @@ void initmission::initTasks() {
|
|||||||
}
|
}
|
||||||
pstTasks.push_back(pst);
|
pstTasks.push_back(pst);
|
||||||
|
|
||||||
|
#if OBSW_ADD_PLOC_MPSOC == 1
|
||||||
PeriodicTaskIF* mpsocHelperTask = factory->createPeriodicTask(
|
PeriodicTaskIF* mpsocHelperTask = factory->createPeriodicTask(
|
||||||
"PLOC_MPSOC_HELPER", 20, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc);
|
"PLOC_MPSOC_HELPER", 20, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc);
|
||||||
result = mpsocHelperTask->addComponent(objects::PLOC_MPSOC_HELPER);
|
result = mpsocHelperTask->addComponent(objects::PLOC_MPSOC_HELPER);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
initmission::printAddObjectError("PLOC_MPSOC_HELPER", objects::PLOC_MPSOC_HELPER);
|
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) {
|
auto taskStarter = [](std::vector<PeriodicTaskIF*>& taskVector, std::string name) {
|
||||||
for (const auto& task : taskVector) {
|
for (const auto& task : taskVector) {
|
||||||
@ -111,6 +121,12 @@ void initmission::initTasks() {
|
|||||||
tmtcDistributor->startTask();
|
tmtcDistributor->startTask();
|
||||||
tmtcBridgeTask->startTask();
|
tmtcBridgeTask->startTask();
|
||||||
tmtcPollingTask->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(pstTasks, "PST Tasks");
|
||||||
taskStarter(pusTasks, "PUS Tasks");
|
taskStarter(pusTasks, "PUS Tasks");
|
||||||
|
@ -1,27 +1,30 @@
|
|||||||
#include "ObjectFactory.h"
|
#include "ObjectFactory.h"
|
||||||
|
|
||||||
#include <devConf.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 "OBSWConfig.h"
|
||||||
#include "busConf.h"
|
#include "busConf.h"
|
||||||
#include "devConf.h"
|
#include "devConf.h"
|
||||||
|
#include "devices/addresses.h"
|
||||||
|
#include "devices/gpioIds.h"
|
||||||
#include "fsfw/datapoollocal/LocalDataPoolManager.h"
|
#include "fsfw/datapoollocal/LocalDataPoolManager.h"
|
||||||
#include "fsfw/tmtcpacket/pus/tm.h"
|
#include "fsfw/tmtcpacket/pus/tm.h"
|
||||||
#include "fsfw/tmtcservices/CommandingServiceBase.h"
|
#include "fsfw/tmtcservices/CommandingServiceBase.h"
|
||||||
#include "fsfw/tmtcservices/PusServiceBase.h"
|
#include "fsfw/tmtcservices/PusServiceBase.h"
|
||||||
|
#include "fsfw_hal/linux/i2c/I2cComIF.h"
|
||||||
#include "fsfw_hal/linux/i2c/I2cCookie.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/PlocMPSoCHandler.h"
|
||||||
#include "linux/devices/ploc/PlocMPSoCHelper.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/core/GenericFactory.h"
|
||||||
|
#include "mission/devices/Tmp1075Handler.h"
|
||||||
#include "mission/utility/TmFunnel.h"
|
#include "mission/utility/TmFunnel.h"
|
||||||
#include "test/gpio/DummyGpioIF.h"
|
|
||||||
#include "objects/systemObjectList.h"
|
#include "objects/systemObjectList.h"
|
||||||
#include "devices/addresses.h"
|
#include "test/gpio/DummyGpioIF.h"
|
||||||
#include "devices/gpioIds.h"
|
|
||||||
#include "tmtc/apid.h"
|
#include "tmtc/apid.h"
|
||||||
#include "tmtc/pusIds.h"
|
#include "tmtc/pusIds.h"
|
||||||
|
|
||||||
@ -43,12 +46,13 @@ void ObjectFactory::produce(void* args) {
|
|||||||
Factory::setStaticFrameworkObjectIds();
|
Factory::setStaticFrameworkObjectIds();
|
||||||
ObjectFactory::produceGenericObjects();
|
ObjectFactory::produceGenericObjects();
|
||||||
|
|
||||||
|
new UartComIF(objects::UART_COM_IF);
|
||||||
|
|
||||||
#if OBSW_ADD_PLOC_MPSOC == 1
|
#if OBSW_ADD_PLOC_MPSOC == 1
|
||||||
UartCookie* mpsocUartCookie = new UartCookie(objects::PLOC_MPSOC_HANDLER, te0720_1cfa::MPSOC_UART,
|
UartCookie* mpsocUartCookie = new UartCookie(objects::PLOC_MPSOC_HANDLER, te0720_1cfa::MPSOC_UART,
|
||||||
uart::PLOC_MPSOC_BAUD, mpsoc::MAX_REPLY_SIZE);
|
uart::PLOC_MPSOC_BAUD, mpsoc::MAX_REPLY_SIZE);
|
||||||
mpsocUartCookie->setNoFixedSizeReply();
|
mpsocUartCookie->setNoFixedSizeReply();
|
||||||
PlocMPSoCHelper* plocMpsocHelper = new PlocMPSoCHelper(objects::PLOC_MPSOC_HELPER);
|
PlocMPSoCHelper* plocMpsocHelper = new PlocMPSoCHelper(objects::PLOC_MPSOC_HELPER);
|
||||||
new UartComIF(objects::UART_COM_IF);
|
|
||||||
auto dummyGpioIF = new DummyGpioIF();
|
auto dummyGpioIF = new DummyGpioIF();
|
||||||
PlocMPSoCHandler* plocMPSoCHandler = new PlocMPSoCHandler(
|
PlocMPSoCHandler* plocMPSoCHandler = new PlocMPSoCHandler(
|
||||||
objects::PLOC_MPSOC_HANDLER, objects::UART_COM_IF, mpsocUartCookie, plocMpsocHelper,
|
objects::PLOC_MPSOC_HANDLER, objects::UART_COM_IF, mpsocUartCookie, plocMpsocHelper,
|
||||||
@ -56,6 +60,20 @@ void ObjectFactory::produce(void* args) {
|
|||||||
plocMPSoCHandler->setStartUpImmediately();
|
plocMPSoCHandler->setStartUpImmediately();
|
||||||
#endif /* OBSW_ADD_PLOC_MPSOC == 1 */
|
#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_LIBGPIOD == 1
|
||||||
#if OBSW_TEST_GPIO_OPEN_BYLABEL == 1
|
#if OBSW_TEST_GPIO_OPEN_BYLABEL == 1
|
||||||
/* Configure MIO0 as input */
|
/* Configure MIO0 as input */
|
||||||
@ -124,18 +142,7 @@ void ObjectFactory::produce(void* args) {
|
|||||||
GpioCookie* gpioCookie = new GpioCookie;
|
GpioCookie* gpioCookie = new GpioCookie;
|
||||||
gpioCookie->addGpio(gpioIds::HEATER_0, heaterGpio);
|
gpioCookie->addGpio(gpioIds::HEATER_0, heaterGpio);
|
||||||
new HeaterHandler(objects::HEATER_HANDLER, objects::GPIO_IF, gpioCookie, objects::PCDU_HANDLER,
|
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
|
#endif
|
||||||
|
|
||||||
new I2cComIF(objects::I2C_COM_IF);
|
new I2cComIF(objects::I2C_COM_IF);
|
||||||
|
@ -33,6 +33,10 @@ add_compile_options(
|
|||||||
set(STRIPPED_OBSW_NAME ${OBSW_BIN_NAME}-stripped)
|
set(STRIPPED_OBSW_NAME ${OBSW_BIN_NAME}-stripped)
|
||||||
set(STRIPPED_WATCHDOG_NAME eive-watchdog-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(
|
add_custom_command(
|
||||||
TARGET ${OBSW_NAME}
|
TARGET ${OBSW_NAME}
|
||||||
POST_BUILD
|
POST_BUILD
|
||||||
@ -41,6 +45,16 @@ add_custom_command(
|
|||||||
COMMENT "Generating stripped executable ${STRIPPED_OBSW_NAME}.."
|
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(
|
add_custom_command(
|
||||||
TARGET ${WATCHDOG_NAME}
|
TARGET ${WATCHDOG_NAME}
|
||||||
POST_BUILD
|
POST_BUILD
|
||||||
|
@ -20,7 +20,7 @@ else
|
|||||||
cfg_script_name="${EIVE_OBSW_ROOT}/cmake/scripts/${cfg_script_name}"
|
cfg_script_name="${EIVE_OBSW_ROOT}/cmake/scripts/${cfg_script_name}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z "${EIVE_Q7S_EM}" ]]; then
|
if [ ! -z "${EIVE_Q7S_EM}" ]; then
|
||||||
build_defs="EIVE_Q7S_EM=ON"
|
build_defs="EIVE_Q7S_EM=ON"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ else
|
|||||||
cfg_script_name="${EIVE_OBSW_ROOT}/cmake/scripts/${cfg_script_name}"
|
cfg_script_name="${EIVE_OBSW_ROOT}/cmake/scripts/${cfg_script_name}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z "${EIVE_Q7S_EM}" ]]; then
|
if [ ! -z "${EIVE_Q7S_EM}" ]; then
|
||||||
build_defs="EIVE_Q7S_EM=ON"
|
build_defs="EIVE_Q7S_EM=ON"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ else
|
|||||||
cfg_script_name="${EIVE_OBSW_ROOT}/cmake/scripts/${cfg_script_name}"
|
cfg_script_name="${EIVE_OBSW_ROOT}/cmake/scripts/${cfg_script_name}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z "${EIVE_Q7S_EM}" ]]; then
|
if [ ! -z "${EIVE_Q7S_EM}" ]; then
|
||||||
build_defs="EIVE_Q7S_EM=ON"
|
build_defs="EIVE_Q7S_EM=ON"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -1,7 +1,3 @@
|
|||||||
target_include_directories(${OBSW_NAME} PRIVATE
|
target_include_directories(${OBSW_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
|
||||||
)
|
|
||||||
|
|
||||||
target_sources(${OBSW_NAME} PRIVATE
|
target_sources(${OBSW_NAME} PRIVATE commonConfig.cpp)
|
||||||
commonConfig.cpp
|
|
||||||
)
|
|
||||||
|
@ -2,14 +2,7 @@
|
|||||||
#define COMMON_CONFIG_CCSDSCONFIG_H_
|
#define COMMON_CONFIG_CCSDSCONFIG_H_
|
||||||
|
|
||||||
namespace ccsds {
|
namespace ccsds {
|
||||||
enum {
|
enum { VC0, VC1, VC2, VC3 };
|
||||||
VC0,
|
|
||||||
VC1,
|
|
||||||
VC2,
|
|
||||||
VC3
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* COMMON_CONFIG_CCSDSCONFIG_H_ */
|
#endif /* COMMON_CONFIG_CCSDSCONFIG_H_ */
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#define COMMON_CONFIG_COMMONCLASSIDS_H_
|
#define COMMON_CONFIG_COMMONCLASSIDS_H_
|
||||||
|
|
||||||
#include <fsfw/returnvalues/FwClassIds.h>
|
#include <fsfw/returnvalues/FwClassIds.h>
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
namespace CLASS_ID {
|
namespace CLASS_ID {
|
||||||
@ -16,6 +17,7 @@ enum commonClassIds: uint8_t {
|
|||||||
DWLPWRON_CMD, // DWLPWRON
|
DWLPWRON_CMD, // DWLPWRON
|
||||||
MPSOC_TM, // MPTM
|
MPSOC_TM, // MPTM
|
||||||
PLOC_SUPERVISOR_HANDLER, // PLSV
|
PLOC_SUPERVISOR_HANDLER, // PLSV
|
||||||
|
PLOC_SUPV_HELPER, // PLSPVhLP
|
||||||
SUS_HANDLER, // SUSS
|
SUS_HANDLER, // SUSS
|
||||||
CCSDS_IP_CORE_BRIDGE, // IPCI
|
CCSDS_IP_CORE_BRIDGE, // IPCI
|
||||||
PTME, // PTME
|
PTME, // PTME
|
||||||
@ -32,6 +34,7 @@ enum commonClassIds: uint8_t {
|
|||||||
PLOC_MPSOC_HELPER, // PLMPHLP
|
PLOC_MPSOC_HELPER, // PLMPHLP
|
||||||
SA_DEPL_HANDLER, // SADPL
|
SA_DEPL_HANDLER, // SADPL
|
||||||
MPSOC_RETURN_VALUES_IF, // MPSOCRTVIF
|
MPSOC_RETURN_VALUES_IF, // MPSOCRTVIF
|
||||||
|
SUPV_RETURN_VALUES_IF, // SPVRTVIF
|
||||||
COMMON_CLASS_ID_END // [EXPORT] : [END]
|
COMMON_CLASS_ID_END // [EXPORT] : [END]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
#include "commonConfig.h"
|
#include "commonConfig.h"
|
||||||
#include "tmtc/apid.h"
|
|
||||||
#include "fsfw/tmtcpacket/SpacePacket.h"
|
|
||||||
|
|
||||||
const Version common::OBSW_VERSION { OBSW_VERSION_MAJOR, OBSW_VERSION_MINOR, OBSW_VERSION_REVISION, OBSW_VERSION_CST_GIT_SHA1 };
|
#include "fsfw/tmtcpacket/SpacePacket.h"
|
||||||
|
#include "tmtc/apid.h"
|
||||||
|
|
||||||
|
const fsfw::Version common::OBSW_VERSION{OBSW_VERSION_MAJOR, OBSW_VERSION_MINOR,
|
||||||
|
OBSW_VERSION_REVISION, OBSW_VERSION_CST_GIT_SHA1};
|
||||||
const uint16_t common::PUS_PACKET_ID = spacepacket::getTcSpacePacketIdFromApid(apid::EIVE_OBSW);
|
const uint16_t common::PUS_PACKET_ID = spacepacket::getTcSpacePacketIdFromApid(apid::EIVE_OBSW);
|
||||||
|
@ -33,7 +33,7 @@ static constexpr uint8_t OBSW_VERSION_REVISION = @OBSW_VERSION_REVISION@;
|
|||||||
// CST: Commits since tag
|
// CST: Commits since tag
|
||||||
static const char OBSW_VERSION_CST_GIT_SHA1[] = "@OBSW_VERSION_CST_GIT_SHA1@";
|
static const char OBSW_VERSION_CST_GIT_SHA1[] = "@OBSW_VERSION_CST_GIT_SHA1@";
|
||||||
|
|
||||||
extern const Version OBSW_VERSION;
|
extern const fsfw::Version OBSW_VERSION;
|
||||||
|
|
||||||
extern const uint16_t PUS_PACKET_ID;
|
extern const uint16_t PUS_PACKET_ID;
|
||||||
|
|
||||||
|
@ -22,13 +22,6 @@ enum commonObjects: uint32_t {
|
|||||||
CORE_CONTROLLER = 0x43000003,
|
CORE_CONTROLLER = 0x43000003,
|
||||||
|
|
||||||
/* 0x44 ('D') for device handlers */
|
/* 0x44 ('D') for device handlers */
|
||||||
P60DOCK_HANDLER = 0x44250000,
|
|
||||||
PDU1_HANDLER = 0x44250001,
|
|
||||||
PDU2_HANDLER = 0x44250002,
|
|
||||||
ACU_HANDLER = 0x44250003,
|
|
||||||
BPX_BATT_HANDLER = 0x44260000,
|
|
||||||
TMP1075_HANDLER_1 = 0x44420004,
|
|
||||||
TMP1075_HANDLER_2 = 0x44420005,
|
|
||||||
MGM_0_LIS3_HANDLER = 0x44120006,
|
MGM_0_LIS3_HANDLER = 0x44120006,
|
||||||
MGM_1_RM3100_HANDLER = 0x44120107,
|
MGM_1_RM3100_HANDLER = 0x44120107,
|
||||||
MGM_2_LIS3_HANDLER = 0x44120208,
|
MGM_2_LIS3_HANDLER = 0x44120208,
|
||||||
@ -37,62 +30,92 @@ enum commonObjects: uint32_t {
|
|||||||
GYRO_1_L3G_HANDLER = 0x44120111,
|
GYRO_1_L3G_HANDLER = 0x44120111,
|
||||||
GYRO_2_ADIS_HANDLER = 0x44120212,
|
GYRO_2_ADIS_HANDLER = 0x44120212,
|
||||||
GYRO_3_L3G_HANDLER = 0x44120313,
|
GYRO_3_L3G_HANDLER = 0x44120313,
|
||||||
PLPCDU_HANDLER = 0x44300000,
|
RW1 = 0x44120047,
|
||||||
SCEX_HANDLER = 0x44400000,
|
RW2 = 0x44120148,
|
||||||
|
RW3 = 0x44120249,
|
||||||
|
RW4 = 0x44120350,
|
||||||
|
STAR_TRACKER = 0x44130001,
|
||||||
|
GPS_CONTROLLER = 0x44130045,
|
||||||
|
|
||||||
IMTQ_HANDLER = 0x44140014,
|
IMTQ_HANDLER = 0x44140014,
|
||||||
|
TMP1075_HANDLER_1 = 0x44420004,
|
||||||
|
TMP1075_HANDLER_2 = 0x44420005,
|
||||||
|
PCDU_HANDLER = 0x442000A1,
|
||||||
|
P60DOCK_HANDLER = 0x44250000,
|
||||||
|
PDU1_HANDLER = 0x44250001,
|
||||||
|
PDU2_HANDLER = 0x44250002,
|
||||||
|
ACU_HANDLER = 0x44250003,
|
||||||
|
BPX_BATT_HANDLER = 0x44260000,
|
||||||
|
PLPCDU_HANDLER = 0x44300000,
|
||||||
|
RAD_SENSOR = 0x443200A5,
|
||||||
|
PLOC_UPDATER = 0x44330000,
|
||||||
|
PLOC_MEMORY_DUMPER = 0x44330001,
|
||||||
|
STR_HELPER = 0x44330002,
|
||||||
|
PLOC_MPSOC_HELPER = 0x44330003,
|
||||||
|
AXI_PTME_CONFIG = 0x44330004,
|
||||||
|
PTME_CONFIG = 0x44330005,
|
||||||
PLOC_MPSOC_HANDLER = 0x44330015,
|
PLOC_MPSOC_HANDLER = 0x44330015,
|
||||||
PLOC_SUPERVISOR_HANDLER = 0x44330016,
|
PLOC_SUPERVISOR_HANDLER = 0x44330016,
|
||||||
PLOC_SUPERVISOR_HELPER = 0x44330017,
|
PLOC_SUPERVISOR_HELPER = 0x44330017,
|
||||||
|
SOLAR_ARRAY_DEPL_HANDLER = 0x444100A2,
|
||||||
|
HEATER_HANDLER = 0x444100A4,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Not yet specified which pt1000 will measure which device/location in the satellite.
|
* Not yet specified which pt1000 will measure which device/location in the satellite.
|
||||||
* Therefore object ids are named according to the IC naming of the RTDs in the schematic.
|
* Therefore object ids are named according to the IC naming of the RTDs in the schematic.
|
||||||
*/
|
*/
|
||||||
RTD_IC_3 = 0x44420016,
|
RTD_0_IC3_PLOC_HEATSPREADER = 0x44420016,
|
||||||
RTD_IC_4 = 0x44420017,
|
RTD_1_IC4_PLOC_MISSIONBOARD = 0x44420017,
|
||||||
RTD_IC_5 = 0x44420018,
|
RTD_2_IC5_4K_CAMERA = 0x44420018,
|
||||||
RTD_IC_6 = 0x44420019,
|
RTD_3_IC6_DAC_HEATSPREADER = 0x44420019,
|
||||||
RTD_IC_7 = 0x44420020,
|
RTD_4_IC7_STARTRACKER = 0x44420020,
|
||||||
RTD_IC_8 = 0x44420021,
|
RTD_5_IC8_RW1_MX_MY = 0x44420021,
|
||||||
RTD_IC_9 = 0x44420022,
|
RTD_6_IC9_DRO = 0x44420022,
|
||||||
RTD_IC_10 = 0x44420023,
|
RTD_7_IC10_SCEX = 0x44420023,
|
||||||
RTD_IC_11 = 0x44420024,
|
RTD_8_IC11_X8 = 0x44420024,
|
||||||
RTD_IC_12 = 0x44420025,
|
RTD_9_IC12_HPA = 0x44420025,
|
||||||
RTD_IC_13 = 0x44420026,
|
RTD_10_IC13_PL_TX = 0x44420026,
|
||||||
RTD_IC_14 = 0x44420027,
|
RTD_11_IC14_MPA = 0x44420027,
|
||||||
RTD_IC_15 = 0x44420028,
|
RTD_12_IC15_ACU = 0x44420028,
|
||||||
RTD_IC_16 = 0x44420029,
|
RTD_13_IC16_PLPCDU_HEATSPREADER = 0x44420029,
|
||||||
RTD_IC_17 = 0x44420030,
|
RTD_14_IC17_TCS_BOARD = 0x44420030,
|
||||||
RTD_IC_18 = 0x44420031,
|
RTD_15_IC18_IMTQ = 0x44420031,
|
||||||
|
|
||||||
SUS_0 = 0x44120032,
|
// Name convention for SUS devices
|
||||||
SUS_1 = 0x44120033,
|
// SUS_<IDX>_<N/R>_LOC_X<F/M/B>Y<F/M/B>Z<F/M/B>_PT_<DIR><F/B>
|
||||||
SUS_2 = 0x44120034,
|
// LOC: Location
|
||||||
SUS_3 = 0x44120035,
|
// PT: Pointing
|
||||||
SUS_4 = 0x44120036,
|
// N/R: Nominal/Redundant
|
||||||
SUS_5 = 0x44120037,
|
// F/M/B: Forward/Middle/Backwards
|
||||||
SUS_6 = 0x44120038,
|
SUS_0_N_LOC_XFYFZM_PT_XF = 0x44120032,
|
||||||
SUS_7 = 0x44120039,
|
SUS_6_R_LOC_XFYBZM_PT_XF = 0x44120038,
|
||||||
SUS_8 = 0x44120040,
|
|
||||||
SUS_9 = 0x44120041,
|
|
||||||
SUS_10 = 0x44120042,
|
|
||||||
SUS_11 = 0x44120043,
|
|
||||||
|
|
||||||
GPS_CONTROLLER = 0x44130045,
|
SUS_1_N_LOC_XBYFZM_PT_XB = 0x44120033,
|
||||||
|
SUS_7_R_LOC_XBYBZM_PT_XB = 0x44120039,
|
||||||
|
|
||||||
RW1 = 0x44120047,
|
SUS_2_N_LOC_XFYBZB_PT_YB = 0x44120034,
|
||||||
RW2 = 0x44120148,
|
SUS_8_R_LOC_XBYBZB_PT_YB = 0x44120040,
|
||||||
RW3 = 0x44120249,
|
|
||||||
RW4 = 0x44120350,
|
|
||||||
|
|
||||||
STAR_TRACKER = 0x44130001,
|
SUS_3_N_LOC_XFYBZF_PT_YF = 0x44120035,
|
||||||
|
SUS_9_R_LOC_XBYBZB_PT_YF = 0x44120041,
|
||||||
|
|
||||||
PLOC_UPDATER = 0x44330000,
|
SUS_4_N_LOC_XMYFZF_PT_ZF = 0x44120036,
|
||||||
PLOC_MEMORY_DUMPER = 0x44330001,
|
SUS_10_N_LOC_XMYBZF_PT_ZF = 0x44120042,
|
||||||
STR_HELPER = 0x44330002,
|
|
||||||
PLOC_MPSOC_HELPER = 0x44330003,
|
SUS_5_N_LOC_XFYMZB_PT_ZB = 0x44120037,
|
||||||
AXI_PTME_CONFIG = 44330004,
|
SUS_11_R_LOC_XBYMZB_PT_ZB = 0x44120043,
|
||||||
PTME_CONFIG = 44330005,
|
|
||||||
|
SYRLINKS_HK_HANDLER = 0x445300A3,
|
||||||
|
|
||||||
|
// 0x60 for other stuff
|
||||||
|
HEATER_0_PLOC_PROC_BRD = 0x60000000,
|
||||||
|
HEATER_1_PCDU_BRD = 0x60000001,
|
||||||
|
HEATER_2_ACS_BRD = 0x60000002,
|
||||||
|
HEATER_3_OBC_BRD = 0x60000003,
|
||||||
|
HEATER_4_CAMERA = 0x60000004,
|
||||||
|
HEATER_5_STR = 0x60000005,
|
||||||
|
HEATER_6_DRO = 0x60000006,
|
||||||
|
HEATER_7_HPA = 0x60000007,
|
||||||
|
|
||||||
// 0x73 ('s') for assemblies and system/subsystem components
|
// 0x73 ('s') for assemblies and system/subsystem components
|
||||||
ACS_BOARD_ASS = 0x73000001,
|
ACS_BOARD_ASS = 0x73000001,
|
||||||
@ -101,12 +124,11 @@ enum commonObjects: uint32_t {
|
|||||||
RW_ASS = 0x73000004,
|
RW_ASS = 0x73000004,
|
||||||
PLOC_SWITCHER = 0x73000005,
|
PLOC_SWITCHER = 0x73000005,
|
||||||
CAM_SWITCHER = 0x73000006,
|
CAM_SWITCHER = 0x73000006,
|
||||||
EIVE_SYSTEM = 0x73010000,
|
|
||||||
ACS_SUBSYSTEM = 0x73010001,
|
ACS_SUBSYSTEM = 0x73010001,
|
||||||
PL_SUBSYSTEM = 0x73010002,
|
PL_SUBSYSTEM = 0x73010002,
|
||||||
PLOC_SUBSYSTEM = 0x73010003,
|
PLOC_SUBSYSTEM = 0x73010003,
|
||||||
|
EIVE_SYSTEM = 0x73010000,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif /* COMMON_CONFIG_COMMONOBJECTS_H_ */
|
#endif /* COMMON_CONFIG_COMMONOBJECTS_H_ */
|
||||||
|
@ -30,10 +30,10 @@ enum: uint8_t {
|
|||||||
PDU1_HANDLER = 133,
|
PDU1_HANDLER = 133,
|
||||||
PDU2_HANDLER = 134,
|
PDU2_HANDLER = 134,
|
||||||
ACU_HANDLER = 135,
|
ACU_HANDLER = 135,
|
||||||
SYRLINKS = 136,
|
PLOC_SUPV_HELPER = 136,
|
||||||
|
SYRLINKS = 137,
|
||||||
COMMON_SUBSYSTEM_ID_END
|
COMMON_SUBSYSTEM_ID_END
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif /* COMMON_CONFIG_COMMONSUBSYSTEMIDS_H_ */
|
#endif /* COMMON_CONFIG_COMMONSUBSYSTEMIDS_H_ */
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
#ifndef COMMON_CONFIG_DEVCONF_H_
|
#ifndef COMMON_CONFIG_DEVCONF_H_
|
||||||
#define COMMON_CONFIG_DEVCONF_H_
|
#define COMMON_CONFIG_DEVCONF_H_
|
||||||
|
|
||||||
#include <cstdint>
|
|
||||||
#include <fsfw_hal/linux/spi/spiDefinitions.h>
|
#include <fsfw_hal/linux/spi/spiDefinitions.h>
|
||||||
#include <fsfw_hal/linux/uart/UartCookie.h>
|
#include <fsfw_hal/linux/uart/UartCookie.h>
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SPI configuration will be contained here to let the device handlers remain independent
|
* SPI configuration will be contained here to let the device handlers remain independent
|
||||||
* of SPI specific properties.
|
* of SPI specific properties.
|
||||||
@ -31,6 +32,7 @@ static constexpr spi::SpiModes DEFAULT_L3G_MODE = spi::SpiModes::MODE_3;
|
|||||||
static const uint32_t SUS_MAX1227_SPI_FREQ = 976'000;
|
static const uint32_t SUS_MAX1227_SPI_FREQ = 976'000;
|
||||||
static constexpr spi::SpiModes SUS_MAX_1227_MODE = spi::SpiModes::MODE_3;
|
static constexpr spi::SpiModes SUS_MAX_1227_MODE = spi::SpiModes::MODE_3;
|
||||||
|
|
||||||
|
static constexpr dur_millis_t RAD_SENSOR_CS_TIMEOUT = 120;
|
||||||
static constexpr uint32_t DEFAULT_MAX_1227_SPEED = 976'000;
|
static constexpr uint32_t DEFAULT_MAX_1227_SPEED = 976'000;
|
||||||
static constexpr spi::SpiModes DEFAULT_MAX_1227_MODE = spi::SpiModes::MODE_3;
|
static constexpr spi::SpiModes DEFAULT_MAX_1227_MODE = spi::SpiModes::MODE_3;
|
||||||
|
|
||||||
@ -42,10 +44,11 @@ static constexpr spi::SpiModes DEFAULT_ADIS16507_MODE = spi::SpiModes::MODE_3;
|
|||||||
static constexpr uint32_t RW_SPEED = 300'000;
|
static constexpr uint32_t RW_SPEED = 300'000;
|
||||||
static constexpr spi::SpiModes RW_MODE = spi::SpiModes::MODE_0;
|
static constexpr spi::SpiModes RW_MODE = spi::SpiModes::MODE_0;
|
||||||
|
|
||||||
|
static constexpr dur_millis_t RTD_CS_TIMEOUT = 50;
|
||||||
static constexpr uint32_t RTD_SPEED = 2'000'000;
|
static constexpr uint32_t RTD_SPEED = 2'000'000;
|
||||||
static constexpr spi::SpiModes RTD_MODE = spi::SpiModes::MODE_3;
|
static constexpr spi::SpiModes RTD_MODE = spi::SpiModes::MODE_3;
|
||||||
|
|
||||||
}
|
} // namespace spi
|
||||||
|
|
||||||
namespace uart {
|
namespace uart {
|
||||||
|
|
||||||
@ -53,9 +56,9 @@ static constexpr size_t HYPERION_GPS_REPLY_MAX_BUFFER = 1024;
|
|||||||
static constexpr UartBaudRate SYRLINKS_BAUD = UartBaudRate::RATE_38400;
|
static constexpr UartBaudRate SYRLINKS_BAUD = UartBaudRate::RATE_38400;
|
||||||
static constexpr UartBaudRate GNSS_BAUD = UartBaudRate::RATE_9600;
|
static constexpr UartBaudRate GNSS_BAUD = UartBaudRate::RATE_9600;
|
||||||
static constexpr UartBaudRate PLOC_MPSOC_BAUD = UartBaudRate::RATE_115200;
|
static constexpr UartBaudRate PLOC_MPSOC_BAUD = UartBaudRate::RATE_115200;
|
||||||
static constexpr UartBaudRate PLOC_SUPERVISOR_BAUD = UartBaudRate::RATE_115200;
|
static constexpr UartBaudRate PLOC_SUPV_BAUD = UartBaudRate::RATE_115200;
|
||||||
static constexpr UartBaudRate STAR_TRACKER_BAUD = UartBaudRate::RATE_921600;
|
static constexpr UartBaudRate STAR_TRACKER_BAUD = UartBaudRate::RATE_921600;
|
||||||
|
|
||||||
}
|
} // namespace uart
|
||||||
|
|
||||||
#endif /* COMMON_CONFIG_DEVCONF_H_ */
|
#endif /* COMMON_CONFIG_DEVCONF_H_ */
|
||||||
|
@ -3,16 +3,16 @@
|
|||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
namespace heaterSwitches {
|
namespace heater {
|
||||||
enum switcherList: uint8_t {
|
enum Switchers : uint8_t {
|
||||||
HEATER_0,
|
HEATER_0_OBC_BRD,
|
||||||
HEATER_1,
|
HEATER_1_PLOC_PROC_BRD,
|
||||||
HEATER_2,
|
HEATER_2_ACS_BRD,
|
||||||
HEATER_3,
|
HEATER_3_PCDU_PDU,
|
||||||
HEATER_4,
|
HEATER_4_CAMERA,
|
||||||
HEATER_5,
|
HEATER_5_STR,
|
||||||
HEATER_6,
|
HEATER_6_DRO,
|
||||||
HEATER_7,
|
HEATER_7_HPA,
|
||||||
NUMBER_OF_SWITCHES
|
NUMBER_OF_SWITCHES
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,6 @@ static constexpr uint8_t LIVE_TM = 0;
|
|||||||
static constexpr uint32_t MAX_PATH_SIZE = 100;
|
static constexpr uint32_t MAX_PATH_SIZE = 100;
|
||||||
static constexpr uint32_t MAX_FILENAME_SIZE = 50;
|
static constexpr uint32_t MAX_FILENAME_SIZE = 50;
|
||||||
|
|
||||||
}
|
} // namespace config
|
||||||
|
|
||||||
|
|
||||||
#endif /* COMMON_CONFIG_DEFINITIONS_H_ */
|
#endif /* COMMON_CONFIG_DEFINITIONS_H_ */
|
||||||
|
@ -15,5 +15,4 @@ namespace apid {
|
|||||||
static const uint16_t EIVE_OBSW = 0x65;
|
static const uint16_t EIVE_OBSW = 0x65;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif /* FSFWCONFIG_TMTC_APID_H_ */
|
#endif /* FSFWCONFIG_TMTC_APID_H_ */
|
||||||
|
2
fsfw
2
fsfw
@ -1 +1 @@
|
|||||||
Subproject commit 80cb0e682fb423b4e7b8f45b66b3b5b7249e0d48
|
Subproject commit c8355251967009559ea790b63c3ebfc67a27efef
|
@ -1,187 +1,206 @@
|
|||||||
2200;0x0898;STORE_SEND_WRITE_FAILED;LOW;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
|
2200;0x0898;STORE_SEND_WRITE_FAILED;LOW;;fsfw\src\fsfw\tmstorage\TmStoreBackendIF.h
|
||||||
2201;0x0899;STORE_WRITE_FAILED;LOW;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
|
2201;0x0899;STORE_WRITE_FAILED;LOW;;fsfw\src\fsfw\tmstorage\TmStoreBackendIF.h
|
||||||
2202;0x089a;STORE_SEND_READ_FAILED;LOW;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
|
2202;0x089a;STORE_SEND_READ_FAILED;LOW;;fsfw\src\fsfw\tmstorage\TmStoreBackendIF.h
|
||||||
2203;0x089b;STORE_READ_FAILED;LOW;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
|
2203;0x089b;STORE_READ_FAILED;LOW;;fsfw\src\fsfw\tmstorage\TmStoreBackendIF.h
|
||||||
2204;0x089c;UNEXPECTED_MSG;LOW;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
|
2204;0x089c;UNEXPECTED_MSG;LOW;;fsfw\src\fsfw\tmstorage\TmStoreBackendIF.h
|
||||||
2205;0x089d;STORING_FAILED;LOW;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
|
2205;0x089d;STORING_FAILED;LOW;;fsfw\src\fsfw\tmstorage\TmStoreBackendIF.h
|
||||||
2206;0x089e;TM_DUMP_FAILED;LOW;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
|
2206;0x089e;TM_DUMP_FAILED;LOW;;fsfw\src\fsfw\tmstorage\TmStoreBackendIF.h
|
||||||
2207;0x089f;STORE_INIT_FAILED;LOW;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
|
2207;0x089f;STORE_INIT_FAILED;LOW;;fsfw\src\fsfw\tmstorage\TmStoreBackendIF.h
|
||||||
2208;0x08a0;STORE_INIT_EMPTY;INFO;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
|
2208;0x08a0;STORE_INIT_EMPTY;INFO;;fsfw\src\fsfw\tmstorage\TmStoreBackendIF.h
|
||||||
2209;0x08a1;STORE_CONTENT_CORRUPTED;LOW;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
|
2209;0x08a1;STORE_CONTENT_CORRUPTED;LOW;;fsfw\src\fsfw\tmstorage\TmStoreBackendIF.h
|
||||||
2210;0x08a2;STORE_INITIALIZE;INFO;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
|
2210;0x08a2;STORE_INITIALIZE;INFO;;fsfw\src\fsfw\tmstorage\TmStoreBackendIF.h
|
||||||
2211;0x08a3;INIT_DONE;INFO;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
|
2211;0x08a3;INIT_DONE;INFO;;fsfw\src\fsfw\tmstorage\TmStoreBackendIF.h
|
||||||
2212;0x08a4;DUMP_FINISHED;INFO;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
|
2212;0x08a4;DUMP_FINISHED;INFO;;fsfw\src\fsfw\tmstorage\TmStoreBackendIF.h
|
||||||
2213;0x08a5;DELETION_FINISHED;INFO;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
|
2213;0x08a5;DELETION_FINISHED;INFO;;fsfw\src\fsfw\tmstorage\TmStoreBackendIF.h
|
||||||
2214;0x08a6;DELETION_FAILED;LOW;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
|
2214;0x08a6;DELETION_FAILED;LOW;;fsfw\src\fsfw\tmstorage\TmStoreBackendIF.h
|
||||||
2215;0x08a7;AUTO_CATALOGS_SENDING_FAILED;INFO;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
|
2215;0x08a7;AUTO_CATALOGS_SENDING_FAILED;INFO;;fsfw\src\fsfw\tmstorage\TmStoreBackendIF.h
|
||||||
2600;0x0a28;GET_DATA_FAILED;LOW;;fsfw/src/fsfw/storagemanager/StorageManagerIF.h
|
2600;0x0a28;GET_DATA_FAILED;LOW;;fsfw\src\fsfw\storagemanager\StorageManagerIF.h
|
||||||
2601;0x0a29;STORE_DATA_FAILED;LOW;;fsfw/src/fsfw/storagemanager/StorageManagerIF.h
|
2601;0x0a29;STORE_DATA_FAILED;LOW;;fsfw\src\fsfw\storagemanager\StorageManagerIF.h
|
||||||
2800;0x0af0;DEVICE_BUILDING_COMMAND_FAILED;LOW;;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
|
2800;0x0af0;DEVICE_BUILDING_COMMAND_FAILED;LOW;;fsfw\src\fsfw\devicehandlers\DeviceHandlerIF.h
|
||||||
2801;0x0af1;DEVICE_SENDING_COMMAND_FAILED;LOW;;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
|
2801;0x0af1;DEVICE_SENDING_COMMAND_FAILED;LOW;;fsfw\src\fsfw\devicehandlers\DeviceHandlerIF.h
|
||||||
2802;0x0af2;DEVICE_REQUESTING_REPLY_FAILED;LOW;;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
|
2802;0x0af2;DEVICE_REQUESTING_REPLY_FAILED;LOW;;fsfw\src\fsfw\devicehandlers\DeviceHandlerIF.h
|
||||||
2803;0x0af3;DEVICE_READING_REPLY_FAILED;LOW;;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
|
2803;0x0af3;DEVICE_READING_REPLY_FAILED;LOW;;fsfw\src\fsfw\devicehandlers\DeviceHandlerIF.h
|
||||||
2804;0x0af4;DEVICE_INTERPRETING_REPLY_FAILED;LOW;;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
|
2804;0x0af4;DEVICE_INTERPRETING_REPLY_FAILED;LOW;;fsfw\src\fsfw\devicehandlers\DeviceHandlerIF.h
|
||||||
2805;0x0af5;DEVICE_MISSED_REPLY;LOW;;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
|
2805;0x0af5;DEVICE_MISSED_REPLY;LOW;;fsfw\src\fsfw\devicehandlers\DeviceHandlerIF.h
|
||||||
2806;0x0af6;DEVICE_UNKNOWN_REPLY;LOW;;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
|
2806;0x0af6;DEVICE_UNKNOWN_REPLY;LOW;;fsfw\src\fsfw\devicehandlers\DeviceHandlerIF.h
|
||||||
2807;0x0af7;DEVICE_UNREQUESTED_REPLY;LOW;;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
|
2807;0x0af7;DEVICE_UNREQUESTED_REPLY;LOW;;fsfw\src\fsfw\devicehandlers\DeviceHandlerIF.h
|
||||||
2808;0x0af8;INVALID_DEVICE_COMMAND;LOW;Indicates a SW bug in child class.;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
|
2808;0x0af8;INVALID_DEVICE_COMMAND;LOW;Indicates a SW bug in child class.;fsfw\src\fsfw\devicehandlers\DeviceHandlerIF.h
|
||||||
2809;0x0af9;MONITORING_LIMIT_EXCEEDED;LOW;;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
|
2809;0x0af9;MONITORING_LIMIT_EXCEEDED;LOW;;fsfw\src\fsfw\devicehandlers\DeviceHandlerIF.h
|
||||||
2810;0x0afa;MONITORING_AMBIGUOUS;HIGH;;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
|
2810;0x0afa;MONITORING_AMBIGUOUS;HIGH;;fsfw\src\fsfw\devicehandlers\DeviceHandlerIF.h
|
||||||
2811;0x0afb;DEVICE_WANTS_HARD_REBOOT;HIGH;;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
|
2811;0x0afb;DEVICE_WANTS_HARD_REBOOT;HIGH;;fsfw\src\fsfw\devicehandlers\DeviceHandlerIF.h
|
||||||
4201;0x1069;FUSE_CURRENT_HIGH;LOW;;fsfw/src/fsfw/power/Fuse.h
|
4201;0x1069;FUSE_CURRENT_HIGH;LOW;;fsfw\src\fsfw\power\Fuse.h
|
||||||
4202;0x106a;FUSE_WENT_OFF;LOW;;fsfw/src/fsfw/power/Fuse.h
|
4202;0x106a;FUSE_WENT_OFF;LOW;;fsfw\src\fsfw\power\Fuse.h
|
||||||
4204;0x106c;POWER_ABOVE_HIGH_LIMIT;LOW;;fsfw/src/fsfw/power/Fuse.h
|
4204;0x106c;POWER_ABOVE_HIGH_LIMIT;LOW;;fsfw\src\fsfw\power\Fuse.h
|
||||||
4205;0x106d;POWER_BELOW_LOW_LIMIT;LOW;;fsfw/src/fsfw/power/Fuse.h
|
4205;0x106d;POWER_BELOW_LOW_LIMIT;LOW;;fsfw\src\fsfw\power\Fuse.h
|
||||||
4300;0x10cc;SWITCH_WENT_OFF;LOW;;fsfw/src/fsfw/power/PowerSwitchIF.h
|
4300;0x10cc;SWITCH_WENT_OFF;LOW;;fsfw\src\fsfw\power\PowerSwitchIF.h
|
||||||
5000;0x1388;HEATER_ON;INFO;;fsfw/src/fsfw/thermal/Heater.h
|
5000;0x1388;HEATER_ON;INFO;;fsfw\src\fsfw\thermal\Heater.h
|
||||||
5001;0x1389;HEATER_OFF;INFO;;fsfw/src/fsfw/thermal/Heater.h
|
5001;0x1389;HEATER_OFF;INFO;;fsfw\src\fsfw\thermal\Heater.h
|
||||||
5002;0x138a;HEATER_TIMEOUT;LOW;;fsfw/src/fsfw/thermal/Heater.h
|
5002;0x138a;HEATER_TIMEOUT;LOW;;fsfw\src\fsfw\thermal\Heater.h
|
||||||
5003;0x138b;HEATER_STAYED_ON;LOW;;fsfw/src/fsfw/thermal/Heater.h
|
5003;0x138b;HEATER_STAYED_ON;LOW;;fsfw\src\fsfw\thermal\Heater.h
|
||||||
5004;0x138c;HEATER_STAYED_OFF;LOW;;fsfw/src/fsfw/thermal/Heater.h
|
5004;0x138c;HEATER_STAYED_OFF;LOW;;fsfw\src\fsfw\thermal\Heater.h
|
||||||
5200;0x1450;TEMP_SENSOR_HIGH;LOW;;fsfw/src/fsfw/thermal/AbstractTemperatureSensor.h
|
5200;0x1450;TEMP_SENSOR_HIGH;LOW;;fsfw\src\fsfw\thermal\AbstractTemperatureSensor.h
|
||||||
5201;0x1451;TEMP_SENSOR_LOW;LOW;;fsfw/src/fsfw/thermal/AbstractTemperatureSensor.h
|
5201;0x1451;TEMP_SENSOR_LOW;LOW;;fsfw\src\fsfw\thermal\AbstractTemperatureSensor.h
|
||||||
5202;0x1452;TEMP_SENSOR_GRADIENT;LOW;;fsfw/src/fsfw/thermal/AbstractTemperatureSensor.h
|
5202;0x1452;TEMP_SENSOR_GRADIENT;LOW;;fsfw\src\fsfw\thermal\AbstractTemperatureSensor.h
|
||||||
5901;0x170d;COMPONENT_TEMP_LOW;LOW;;fsfw/src/fsfw/thermal/ThermalComponentIF.h
|
5901;0x170d;COMPONENT_TEMP_LOW;LOW;;fsfw\src\fsfw\thermal\ThermalComponentIF.h
|
||||||
5902;0x170e;COMPONENT_TEMP_HIGH;LOW;;fsfw/src/fsfw/thermal/ThermalComponentIF.h
|
5902;0x170e;COMPONENT_TEMP_HIGH;LOW;;fsfw\src\fsfw\thermal\ThermalComponentIF.h
|
||||||
5903;0x170f;COMPONENT_TEMP_OOL_LOW;LOW;;fsfw/src/fsfw/thermal/ThermalComponentIF.h
|
5903;0x170f;COMPONENT_TEMP_OOL_LOW;LOW;;fsfw\src\fsfw\thermal\ThermalComponentIF.h
|
||||||
5904;0x1710;COMPONENT_TEMP_OOL_HIGH;LOW;;fsfw/src/fsfw/thermal/ThermalComponentIF.h
|
5904;0x1710;COMPONENT_TEMP_OOL_HIGH;LOW;;fsfw\src\fsfw\thermal\ThermalComponentIF.h
|
||||||
5905;0x1711;TEMP_NOT_IN_OP_RANGE;LOW;;fsfw/src/fsfw/thermal/ThermalComponentIF.h
|
5905;0x1711;TEMP_NOT_IN_OP_RANGE;LOW;;fsfw\src\fsfw\thermal\ThermalComponentIF.h
|
||||||
7101;0x1bbd;FDIR_CHANGED_STATE;INFO;;fsfw/src/fsfw/fdir/FailureIsolationBase.h
|
7101;0x1bbd;FDIR_CHANGED_STATE;INFO;;fsfw\src\fsfw\fdir\FailureIsolationBase.h
|
||||||
7102;0x1bbe;FDIR_STARTS_RECOVERY;MEDIUM;;fsfw/src/fsfw/fdir/FailureIsolationBase.h
|
7102;0x1bbe;FDIR_STARTS_RECOVERY;MEDIUM;;fsfw\src\fsfw\fdir\FailureIsolationBase.h
|
||||||
7103;0x1bbf;FDIR_TURNS_OFF_DEVICE;MEDIUM;;fsfw/src/fsfw/fdir/FailureIsolationBase.h
|
7103;0x1bbf;FDIR_TURNS_OFF_DEVICE;MEDIUM;;fsfw\src\fsfw\fdir\FailureIsolationBase.h
|
||||||
7201;0x1c21;MONITOR_CHANGED_STATE;LOW;;fsfw/src/fsfw/monitoring/MonitoringIF.h
|
7201;0x1c21;MONITOR_CHANGED_STATE;LOW;;fsfw\src\fsfw\monitoring\MonitoringIF.h
|
||||||
7202;0x1c22;VALUE_BELOW_LOW_LIMIT;LOW;;fsfw/src/fsfw/monitoring/MonitoringIF.h
|
7202;0x1c22;VALUE_BELOW_LOW_LIMIT;LOW;;fsfw\src\fsfw\monitoring\MonitoringIF.h
|
||||||
7203;0x1c23;VALUE_ABOVE_HIGH_LIMIT;LOW;;fsfw/src/fsfw/monitoring/MonitoringIF.h
|
7203;0x1c23;VALUE_ABOVE_HIGH_LIMIT;LOW;;fsfw\src\fsfw\monitoring\MonitoringIF.h
|
||||||
7204;0x1c24;VALUE_OUT_OF_RANGE;LOW;;fsfw/src/fsfw/monitoring/MonitoringIF.h
|
7204;0x1c24;VALUE_OUT_OF_RANGE;LOW;;fsfw\src\fsfw\monitoring\MonitoringIF.h
|
||||||
7400;0x1ce8;CHANGING_MODE;INFO;;fsfw/src/fsfw/modes/HasModesIF.h
|
7400;0x1ce8;CHANGING_MODE;INFO;;fsfw\src\fsfw\modes\HasModesIF.h
|
||||||
7401;0x1ce9;MODE_INFO;INFO;;fsfw/src/fsfw/modes/HasModesIF.h
|
7401;0x1ce9;MODE_INFO;INFO;;fsfw\src\fsfw\modes\HasModesIF.h
|
||||||
7402;0x1cea;FALLBACK_FAILED;HIGH;;fsfw/src/fsfw/modes/HasModesIF.h
|
7402;0x1cea;FALLBACK_FAILED;HIGH;;fsfw\src\fsfw\modes\HasModesIF.h
|
||||||
7403;0x1ceb;MODE_TRANSITION_FAILED;LOW;;fsfw/src/fsfw/modes/HasModesIF.h
|
7403;0x1ceb;MODE_TRANSITION_FAILED;LOW;;fsfw\src\fsfw\modes\HasModesIF.h
|
||||||
7404;0x1cec;CANT_KEEP_MODE;HIGH;;fsfw/src/fsfw/modes/HasModesIF.h
|
7404;0x1cec;CANT_KEEP_MODE;HIGH;;fsfw\src\fsfw\modes\HasModesIF.h
|
||||||
7405;0x1ced;OBJECT_IN_INVALID_MODE;LOW;;fsfw/src/fsfw/modes/HasModesIF.h
|
7405;0x1ced;OBJECT_IN_INVALID_MODE;LOW;;fsfw\src\fsfw\modes\HasModesIF.h
|
||||||
7406;0x1cee;FORCING_MODE;MEDIUM;;fsfw/src/fsfw/modes/HasModesIF.h
|
7406;0x1cee;FORCING_MODE;MEDIUM;;fsfw\src\fsfw\modes\HasModesIF.h
|
||||||
7407;0x1cef;MODE_CMD_REJECTED;LOW;;fsfw/src/fsfw/modes/HasModesIF.h
|
7407;0x1cef;MODE_CMD_REJECTED;LOW;;fsfw\src\fsfw\modes\HasModesIF.h
|
||||||
7506;0x1d52;HEALTH_INFO;INFO;;fsfw/src/fsfw/health/HasHealthIF.h
|
7506;0x1d52;HEALTH_INFO;INFO;;fsfw\src\fsfw\health\HasHealthIF.h
|
||||||
7507;0x1d53;CHILD_CHANGED_HEALTH;INFO;;fsfw/src/fsfw/health/HasHealthIF.h
|
7507;0x1d53;CHILD_CHANGED_HEALTH;INFO;;fsfw\src\fsfw\health\HasHealthIF.h
|
||||||
7508;0x1d54;CHILD_PROBLEMS;LOW;;fsfw/src/fsfw/health/HasHealthIF.h
|
7508;0x1d54;CHILD_PROBLEMS;LOW;;fsfw\src\fsfw\health\HasHealthIF.h
|
||||||
7509;0x1d55;OVERWRITING_HEALTH;LOW;;fsfw/src/fsfw/health/HasHealthIF.h
|
7509;0x1d55;OVERWRITING_HEALTH;LOW;;fsfw\src\fsfw\health\HasHealthIF.h
|
||||||
7510;0x1d56;TRYING_RECOVERY;MEDIUM;;fsfw/src/fsfw/health/HasHealthIF.h
|
7510;0x1d56;TRYING_RECOVERY;MEDIUM;;fsfw\src\fsfw\health\HasHealthIF.h
|
||||||
7511;0x1d57;RECOVERY_STEP;MEDIUM;;fsfw/src/fsfw/health/HasHealthIF.h
|
7511;0x1d57;RECOVERY_STEP;MEDIUM;;fsfw\src\fsfw\health\HasHealthIF.h
|
||||||
7512;0x1d58;RECOVERY_DONE;MEDIUM;;fsfw/src/fsfw/health/HasHealthIF.h
|
7512;0x1d58;RECOVERY_DONE;MEDIUM;;fsfw\src\fsfw\health\HasHealthIF.h
|
||||||
7900;0x1edc;RF_AVAILABLE;INFO;A RF available signal was detected. P1: raw RFA state, P2: 0;fsfw/src/fsfw/datalinklayer/DataLinkLayer.h
|
7900;0x1edc;RF_AVAILABLE;INFO;A RF available signal was detected. P1: raw RFA state, P2: 0;fsfw\src\fsfw\datalinklayer\DataLinkLayer.h
|
||||||
7901;0x1edd;RF_LOST;INFO;A previously found RF available signal was lost. P1: raw RFA state, P2: 0;fsfw/src/fsfw/datalinklayer/DataLinkLayer.h
|
7901;0x1edd;RF_LOST;INFO;A previously found RF available signal was lost. P1: raw RFA state, P2: 0;fsfw\src\fsfw\datalinklayer\DataLinkLayer.h
|
||||||
7902;0x1ede;BIT_LOCK;INFO;A Bit Lock signal. Was detected. P1: raw BLO state, P2: 0;fsfw/src/fsfw/datalinklayer/DataLinkLayer.h
|
7902;0x1ede;BIT_LOCK;INFO;A Bit Lock signal. Was detected. P1: raw BLO state, P2: 0;fsfw\src\fsfw\datalinklayer\DataLinkLayer.h
|
||||||
7903;0x1edf;BIT_LOCK_LOST;INFO;A previously found Bit Lock signal was lost. P1: raw BLO state, P2: 0;fsfw/src/fsfw/datalinklayer/DataLinkLayer.h
|
7903;0x1edf;BIT_LOCK_LOST;INFO;A previously found Bit Lock signal was lost. P1: raw BLO state, P2: 0;fsfw\src\fsfw\datalinklayer\DataLinkLayer.h
|
||||||
7905;0x1ee1;FRAME_PROCESSING_FAILED;LOW;The CCSDS Board could not interpret a TC;fsfw/src/fsfw/datalinklayer/DataLinkLayer.h
|
7905;0x1ee1;FRAME_PROCESSING_FAILED;LOW;The CCSDS Board could not interpret a TC;fsfw\src\fsfw\datalinklayer\DataLinkLayer.h
|
||||||
8900;0x22c4;CLOCK_SET;INFO;;fsfw/src/fsfw/pus/Service9TimeManagement.h
|
8900;0x22c4;CLOCK_SET;INFO;;fsfw\src\fsfw\pus\Service9TimeManagement.h
|
||||||
8901;0x22c5;CLOCK_SET_FAILURE;LOW;;fsfw/src/fsfw/pus/Service9TimeManagement.h
|
8901;0x22c5;CLOCK_SET_FAILURE;LOW;;fsfw\src\fsfw\pus\Service9TimeManagement.h
|
||||||
9700;0x25e4;TEST;INFO;;fsfw/src/fsfw/pus/Service17Test.h
|
9700;0x25e4;TEST;INFO;;fsfw\src\fsfw\pus\Service17Test.h
|
||||||
10600;0x2968;CHANGE_OF_SETUP_PARAMETER;LOW;;fsfw/hal/src/fsfw_hal/devicehandlers/MgmLIS3MDLHandler.h
|
10600;0x2968;CHANGE_OF_SETUP_PARAMETER;LOW;;fsfw\hal\src\fsfw_hal\devicehandlers\MgmLIS3MDLHandler.h
|
||||||
11300;0x2c24;SWITCH_CMD_SENT;INFO;Indicates that a FSFW object requested setting a switch P1: 1 if on was requested, 0 for off | P2: Switch Index;mission/devices/devicedefinitions/powerDefinitions.h
|
11300;0x2c24;SWITCH_CMD_SENT;INFO;Indicates that a FSFW object requested setting a switch P1: 1 if on was requested, 0 for off | P2: Switch Index;mission\devices\devicedefinitions\powerDefinitions.h
|
||||||
11301;0x2c25;SWITCH_HAS_CHANGED;INFO;Indicated that a swithc state has changed P1: New switch state, 1 for on, 0 for off | P2: Switch Index;mission/devices/devicedefinitions/powerDefinitions.h
|
11301;0x2c25;SWITCH_HAS_CHANGED;INFO;Indicated that a switch state has changed P1: New switch state, 1 for on, 0 for off | P2: Switch Index;mission\devices\devicedefinitions\powerDefinitions.h
|
||||||
11302;0x2c26;SWITCHING_Q7S_DENIED;MEDIUM;;mission/devices/devicedefinitions/powerDefinitions.h
|
11302;0x2c26;SWITCHING_Q7S_DENIED;MEDIUM;;mission\devices\devicedefinitions\powerDefinitions.h
|
||||||
11303;0x2c27;FDIR_REACTION_IGNORED;MEDIUM;;mission/devices/devicedefinitions/powerDefinitions.h
|
11303;0x2c27;FDIR_REACTION_IGNORED;MEDIUM;;mission\devices\devicedefinitions\powerDefinitions.h
|
||||||
11400;0x2c88;GPIO_PULL_HIGH_FAILED;LOW;;mission/devices/HeaterHandler.h
|
11400;0x2c88;GPIO_PULL_HIGH_FAILED;LOW;;mission\devices\HeaterHandler.h
|
||||||
11401;0x2c89;GPIO_PULL_LOW_FAILED;LOW;;mission/devices/HeaterHandler.h
|
11401;0x2c89;GPIO_PULL_LOW_FAILED;LOW;;mission\devices\HeaterHandler.h
|
||||||
11402;0x2c8a;SWITCH_ALREADY_ON;LOW;;mission/devices/HeaterHandler.h
|
11402;0x2c8a;HEATER_WENT_ON;INFO;;mission\devices\HeaterHandler.h
|
||||||
11403;0x2c8b;SWITCH_ALREADY_OFF;LOW;;mission/devices/HeaterHandler.h
|
11403;0x2c8b;HEATER_WENT_OFF;INFO;;mission\devices\HeaterHandler.h
|
||||||
11404;0x2c8c;MAIN_SWITCH_TIMEOUT;LOW;;mission/devices/HeaterHandler.h
|
11404;0x2c8c;SWITCH_ALREADY_ON;LOW;;mission\devices\HeaterHandler.h
|
||||||
11500;0x2cec;MAIN_SWITCH_ON_TIMEOUT;LOW;;mission/devices/SolarArrayDeploymentHandler.h
|
11405;0x2c8d;SWITCH_ALREADY_OFF;LOW;;mission\devices\HeaterHandler.h
|
||||||
11501;0x2ced;MAIN_SWITCH_OFF_TIMEOUT;LOW;;mission/devices/SolarArrayDeploymentHandler.h
|
11406;0x2c8e;MAIN_SWITCH_TIMEOUT;MEDIUM;;mission\devices\HeaterHandler.h
|
||||||
11502;0x2cee;DEPLOYMENT_FAILED;HIGH;;mission/devices/SolarArrayDeploymentHandler.h
|
11407;0x2c8f;FAULTY_HEATER_WAS_ON;LOW;;mission\devices\HeaterHandler.h
|
||||||
11503;0x2cef;DEPL_SA1_GPIO_SWTICH_ON_FAILED;HIGH;;mission/devices/SolarArrayDeploymentHandler.h
|
11500;0x2cec;MAIN_SWITCH_ON_TIMEOUT;LOW;;mission\devices\SolarArrayDeploymentHandler.h
|
||||||
11504;0x2cf0;DEPL_SA2_GPIO_SWTICH_ON_FAILED;HIGH;;mission/devices/SolarArrayDeploymentHandler.h
|
11501;0x2ced;MAIN_SWITCH_OFF_TIMEOUT;LOW;;mission\devices\SolarArrayDeploymentHandler.h
|
||||||
11601;0x2d51;MEMORY_READ_RPT_CRC_FAILURE;LOW;PLOC crc failure in telemetry packet;linux/devices/ploc/PlocMPSoCHandler.h
|
11502;0x2cee;DEPLOYMENT_FAILED;HIGH;;mission\devices\SolarArrayDeploymentHandler.h
|
||||||
11602;0x2d52;ACK_FAILURE;LOW;PLOC receive acknowledgment failure report P1: Command Id which leads the acknowledgment failure report P2: The status field inserted by the MPSoC into the data field;linux/devices/ploc/PlocMPSoCHandler.h
|
11503;0x2cef;DEPL_SA1_GPIO_SWTICH_ON_FAILED;HIGH;;mission\devices\SolarArrayDeploymentHandler.h
|
||||||
11603;0x2d53;EXE_FAILURE;LOW;PLOC receive execution failure report P1: Command Id which leads the execution failure report P2: The status field inserted by the MPSoC into the data field;linux/devices/ploc/PlocMPSoCHandler.h
|
11504;0x2cf0;DEPL_SA2_GPIO_SWTICH_ON_FAILED;HIGH;;mission\devices\SolarArrayDeploymentHandler.h
|
||||||
11604;0x2d54;MPSOC_HANDLER_CRC_FAILURE;LOW;PLOC reply has invalid crc;linux/devices/ploc/PlocMPSoCHandler.h
|
11601;0x2d51;MEMORY_READ_RPT_CRC_FAILURE;LOW;PLOC crc failure in telemetry packet;linux\devices\ploc\PlocMPSoCHandler.h
|
||||||
11605;0x2d55;MPSOC_HANDLER_SEQ_CNT_MISMATCH;LOW;Packet sequence count in received space packet does not match expected count P1: Expected sequence count P2: Received sequence count;linux/devices/ploc/PlocMPSoCHandler.h
|
11602;0x2d52;ACK_FAILURE;LOW;PLOC receive acknowledgment failure report P1: Command Id which leads the acknowledgment failure report P2: The status field inserted by the MPSoC into the data field;linux\devices\ploc\PlocMPSoCHandler.h
|
||||||
11606;0x2d56;MPSOC_SHUTDOWN_FAILED;HIGH;Supervisor fails to shutdown MPSoC. Requires to power off the PLOC and thus also to shutdown the supervisor.;linux/devices/ploc/PlocMPSoCHandler.h
|
11603;0x2d53;EXE_FAILURE;LOW;PLOC receive execution failure report P1: Command Id which leads the execution failure report P2: The status field inserted by the MPSoC into the data field;linux\devices\ploc\PlocMPSoCHandler.h
|
||||||
11701;0x2db5;SELF_TEST_I2C_FAILURE;LOW;Get self test result returns I2C failure P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/devices/IMTQHandler.h
|
11604;0x2d54;MPSOC_HANDLER_CRC_FAILURE;LOW;PLOC reply has invalid crc;linux\devices\ploc\PlocMPSoCHandler.h
|
||||||
11702;0x2db6;SELF_TEST_SPI_FAILURE;LOW;Get self test result returns SPI failure. This concerns the MTM connectivity. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/devices/IMTQHandler.h
|
11605;0x2d55;MPSOC_HANDLER_SEQUENCE_COUNT_MISMATCH;LOW;Packet sequence count in received space packet does not match expected count P1: Expected sequence count P2: Received sequence count;linux\devices\ploc\PlocMPSoCHandler.h
|
||||||
11703;0x2db7;SELF_TEST_ADC_FAILURE;LOW;Get self test result returns failure in measurement of current and temperature. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/devices/IMTQHandler.h
|
11606;0x2d56;MPSOC_SHUTDOWN_FAILED;HIGH;Supervisor fails to shutdown MPSoC. Requires to power off the PLOC and thus also to shutdown the supervisor.;linux\devices\ploc\PlocMPSoCHandler.h
|
||||||
11704;0x2db8;SELF_TEST_PWM_FAILURE;LOW;Get self test result returns PWM failure which concerns the coil actuation. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/devices/IMTQHandler.h
|
11701;0x2db5;SELF_TEST_I2C_FAILURE;LOW;Get self test result returns I2C failure P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission\devices\IMTQHandler.h
|
||||||
11705;0x2db9;SELF_TEST_TC_FAILURE;LOW;Get self test result returns TC failure (system failure) P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/devices/IMTQHandler.h
|
11702;0x2db6;SELF_TEST_SPI_FAILURE;LOW;Get self test result returns SPI failure. This concerns the MTM connectivity. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission\devices\IMTQHandler.h
|
||||||
11706;0x2dba;SELF_TEST_MTM_RANGE_FAILURE;LOW;Get self test result returns failure that MTM values were outside of the expected range. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/devices/IMTQHandler.h
|
11703;0x2db7;SELF_TEST_ADC_FAILURE;LOW;Get self test result returns failure in measurement of current and temperature. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission\devices\IMTQHandler.h
|
||||||
11707;0x2dbb;SELF_TEST_COIL_CURRENT_FAILURE;LOW;Get self test result returns failure indicating that the coil current was outside of the expected range P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/devices/IMTQHandler.h
|
11704;0x2db8;SELF_TEST_PWM_FAILURE;LOW;Get self test result returns PWM failure which concerns the coil actuation. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission\devices\IMTQHandler.h
|
||||||
11708;0x2dbc;INVALID_ERROR_BYTE;LOW;Received invalid error byte. This indicates an error of the communication link between IMTQ and OBC.;mission/devices/IMTQHandler.h
|
11705;0x2db9;SELF_TEST_TC_FAILURE;LOW;Get self test result returns TC failure (system failure) P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission\devices\IMTQHandler.h
|
||||||
11801;0x2e19;ERROR_STATE;HIGH;Reaction wheel signals an error state;mission/devices/RwHandler.h
|
11706;0x2dba;SELF_TEST_MTM_RANGE_FAILURE;LOW;Get self test result returns failure that MTM values were outside of the expected range. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission\devices\IMTQHandler.h
|
||||||
11901;0x2e7d;BOOTING_FIRMWARE_FAILED;LOW;Failed to boot firmware;linux/devices/startracker/StarTrackerHandler.h
|
11707;0x2dbb;SELF_TEST_COIL_CURRENT_FAILURE;LOW;Get self test result returns failure indicating that the coil current was outside of the expected range P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission\devices\IMTQHandler.h
|
||||||
11902;0x2e7e;BOOTING_BOOTLOADER_FAILED;LOW;Failed to boot star tracker into bootloader mode;linux/devices/startracker/StarTrackerHandler.h
|
11708;0x2dbc;INVALID_ERROR_BYTE;LOW;Received invalid error byte. This indicates an error of the communication link between IMTQ and OBC.;mission\devices\IMTQHandler.h
|
||||||
12001;0x2ee1;SUPV_MEMORY_READ_RPT_CRC_FAILURE;LOW;PLOC supervisor crc failure in telemetry packet;linux/devices/ploc/PlocSupervisorHandler.h
|
11801;0x2e19;ERROR_STATE;HIGH;Reaction wheel signals an error state;mission\devices\devicedefinitions\RwDefinitions.h
|
||||||
12002;0x2ee2;SUPV_ACK_FAILURE;LOW;PLOC supervisor received acknowledgment failure report;linux/devices/ploc/PlocSupervisorHandler.h
|
11802;0x2e1a;RESET_OCCURED;LOW;;mission\devices\devicedefinitions\RwDefinitions.h
|
||||||
12003;0x2ee3;SUPV_EXE_FAILURE;LOW;PLOC received execution failure report;linux/devices/ploc/PlocSupervisorHandler.h
|
11901;0x2e7d;BOOTING_FIRMWARE_FAILED;LOW;Failed to boot firmware;linux\devices\startracker\StarTrackerHandler.h
|
||||||
12004;0x2ee4;SUPV_CRC_FAILURE_EVENT;LOW;PLOC supervisor reply has invalid crc;linux/devices/ploc/PlocSupervisorHandler.h
|
11902;0x2e7e;BOOTING_BOOTLOADER_FAILED;LOW;Failed to boot star tracker into bootloader mode;linux\devices\startracker\StarTrackerHandler.h
|
||||||
12100;0x2f44;SANITIZATION_FAILED;LOW;;bsp_q7s/memory/SdCardManager.h
|
12001;0x2ee1;SUPV_MEMORY_READ_RPT_CRC_FAILURE;LOW;PLOC supervisor crc failure in telemetry packet;linux\devices\ploc\PlocSupervisorHandler.h
|
||||||
12101;0x2f45;MOUNTED_SD_CARD;INFO;;bsp_q7s/memory/SdCardManager.h
|
12002;0x2ee2;SUPV_ACK_FAILURE;LOW;PLOC supervisor received acknowledgment failure report;linux\devices\ploc\PlocSupervisorHandler.h
|
||||||
12200;0x2fa8;UPDATE_FILE_NOT_EXISTS;LOW;;linux/devices/ploc/PlocUpdater.h
|
12003;0x2ee3;SUPV_EXE_FAILURE;LOW;PLOC received execution failure report P1: ID of command for which the execution failed P2: Status code sent by the supervisor handler;linux\devices\ploc\PlocSupervisorHandler.h
|
||||||
12201;0x2fa9;ACTION_COMMANDING_FAILED;LOW;Failed to send command to supervisor handler P1: Return value of CommandActionHelper::commandAction P2: Action ID of command to send;linux/devices/ploc/PlocUpdater.h
|
12004;0x2ee4;SUPV_CRC_FAILURE_EVENT;LOW;PLOC supervisor reply has invalid crc;linux\devices\ploc\PlocSupervisorHandler.h
|
||||||
12202;0x2faa;UPDATE_AVAILABLE_FAILED;LOW;Supervisor handler replied action message indicating a command execution failure of the update available command;linux/devices/ploc/PlocUpdater.h
|
12005;0x2ee5;SUPV_MPSOC_SHUWDOWN_BUILD_FAILED;LOW;Failed to build the command to shutdown the MPSoC;linux\devices\ploc\PlocSupervisorHandler.h
|
||||||
12203;0x2fab;UPDATE_TRANSFER_FAILED;LOW;Supervisor handler failed to transfer an update space packet. P1: Parameter holds the number of update packets already sent (inclusive the failed packet);linux/devices/ploc/PlocUpdater.h
|
12100;0x2f44;SANITIZATION_FAILED;LOW;;bsp_q7s\memory\SdCardManager.h
|
||||||
12204;0x2fac;UPDATE_VERIFY_FAILED;LOW;Supervisor failed to execute the update verify command.;linux/devices/ploc/PlocUpdater.h
|
12101;0x2f45;MOUNTED_SD_CARD;INFO;;bsp_q7s\memory\SdCardManager.h
|
||||||
12205;0x2fad;UPDATE_FINISHED;INFO;MPSoC update successful completed;linux/devices/ploc/PlocUpdater.h
|
12300;0x300c;SEND_MRAM_DUMP_FAILED;LOW;Failed to send mram dump command to supervisor handler P1: Return value of commandAction function P2: Start address of MRAM to dump with this command;linux\devices\ploc\PlocMemoryDumper.h
|
||||||
12300;0x300c;SEND_MRAM_DUMP_FAILED;LOW;Failed to send mram dump command to supervisor handler P1: Return value of commandAction function P2: Start address of MRAM to dump with this command;linux/devices/ploc/PlocMemoryDumper.h
|
12301;0x300d;MRAM_DUMP_FAILED;LOW;Received completion failure report form PLOC supervisor handler P1: MRAM start address of failing dump command;linux\devices\ploc\PlocMemoryDumper.h
|
||||||
12301;0x300d;MRAM_DUMP_FAILED;LOW;Received completion failure report form PLOC supervisor handler P1: MRAM start address of failing dump command;linux/devices/ploc/PlocMemoryDumper.h
|
12302;0x300e;MRAM_DUMP_FINISHED;LOW;MRAM dump finished successfully;linux\devices\ploc\PlocMemoryDumper.h
|
||||||
12302;0x300e;MRAM_DUMP_FINISHED;LOW;MRAM dump finished successfully;linux/devices/ploc/PlocMemoryDumper.h
|
12401;0x3071;INVALID_TC_FRAME;HIGH;;linux\obc\PdecHandler.h
|
||||||
12401;0x3071;INVALID_TC_FRAME;HIGH;;linux/obc/PdecHandler.h
|
12402;0x3072;INVALID_FAR;HIGH;Read invalid FAR from PDEC after startup;linux\obc\PdecHandler.h
|
||||||
12402;0x3072;INVALID_FAR;HIGH;Read invalid FAR from PDEC after startup;linux/obc/PdecHandler.h
|
12403;0x3073;CARRIER_LOCK;INFO;Carrier lock detected;linux\obc\PdecHandler.h
|
||||||
12403;0x3073;CARRIER_LOCK;INFO;Carrier lock detected;linux/obc/PdecHandler.h
|
12404;0x3074;BIT_LOCK_PDEC;INFO;Bit lock detected (data valid);linux\obc\PdecHandler.h
|
||||||
12404;0x3074;BIT_LOCK_PDEC;INFO;Bit lock detected (data valid);linux/obc/PdecHandler.h
|
12500;0x30d4;IMAGE_UPLOAD_FAILED;LOW;Image upload failed;linux\devices\startracker\StrHelper.h
|
||||||
12500;0x30d4;IMAGE_UPLOAD_FAILED;LOW;Image upload failed;linux/devices/startracker/StrHelper.h
|
12501;0x30d5;IMAGE_DOWNLOAD_FAILED;LOW;Image download failed;linux\devices\startracker\StrHelper.h
|
||||||
12501;0x30d5;IMAGE_DOWNLOAD_FAILED;LOW;Image download failed;linux/devices/startracker/StrHelper.h
|
12502;0x30d6;IMAGE_UPLOAD_SUCCESSFUL;LOW;Uploading image to star tracker was successfulop;linux\devices\startracker\StrHelper.h
|
||||||
12502;0x30d6;IMAGE_UPLOAD_SUCCESSFUL;LOW;Uploading image to star tracker was successfulop;linux/devices/startracker/StrHelper.h
|
12503;0x30d7;IMAGE_DOWNLOAD_SUCCESSFUL;LOW;Image download was successful;linux\devices\startracker\StrHelper.h
|
||||||
12503;0x30d7;IMAGE_DOWNLOAD_SUCCESSFUL;LOW;Image download was successful;linux/devices/startracker/StrHelper.h
|
12504;0x30d8;FLASH_WRITE_SUCCESSFUL;LOW;Finished flash write procedure successfully;linux\devices\startracker\StrHelper.h
|
||||||
12504;0x30d8;FLASH_WRITE_SUCCESSFUL;LOW;Finished flash write procedure successfully;linux/devices/startracker/StrHelper.h
|
12505;0x30d9;FLASH_READ_SUCCESSFUL;LOW;Finished flash read procedure successfully;linux\devices\startracker\StrHelper.h
|
||||||
12505;0x30d9;FLASH_READ_SUCCESSFUL;LOW;Finished flash read procedure successfully;linux/devices/startracker/StrHelper.h
|
12506;0x30da;FLASH_READ_FAILED;LOW;Flash read procedure failed;linux\devices\startracker\StrHelper.h
|
||||||
12506;0x30da;FLASH_READ_FAILED;LOW;Flash read procedure failed;linux/devices/startracker/StrHelper.h
|
12507;0x30db;FIRMWARE_UPDATE_SUCCESSFUL;LOW;Firmware update was successful;linux\devices\startracker\StrHelper.h
|
||||||
12507;0x30db;FIRMWARE_UPDATE_SUCCESSFUL;LOW;Firmware update was successful;linux/devices/startracker/StrHelper.h
|
12508;0x30dc;FIRMWARE_UPDATE_FAILED;LOW;Firmware update failed;linux\devices\startracker\StrHelper.h
|
||||||
12508;0x30dc;FIRMWARE_UPDATE_FAILED;LOW;Firmware update failed;linux/devices/startracker/StrHelper.h
|
12509;0x30dd;STR_HELPER_READING_REPLY_FAILED;LOW;Failed to read communication interface reply data P1: Return code of failed communication interface read call P1: Upload/download position for which the read call failed;linux\devices\startracker\StrHelper.h
|
||||||
12509;0x30dd;STR_HELPER_READING_REPLY_FAILED;LOW;Failed to read communication interface reply data P1: Return code of failed communication interface read call P1: Upload/download position for which the read call failed;linux/devices/startracker/StrHelper.h
|
12510;0x30de;STR_HELPER_COM_ERROR;LOW;Unexpected stop of decoding sequence P1: Return code of failed communication interface read call P1: Upload/download position for which the read call failed;linux\devices\startracker\StrHelper.h
|
||||||
12510;0x30de;STR_HELPER_COM_ERROR;LOW;Unexpected stop of decoding sequence P1: Return code of failed communication interface read call P1: Upload/download position for which the read call failed;linux/devices/startracker/StrHelper.h
|
12511;0x30df;STR_HELPER_NO_REPLY;LOW;Star tracker did not send replies (maybe device is powered off) P1: Position of upload or download packet for which no reply was sent;linux\devices\startracker\StrHelper.h
|
||||||
12511;0x30df;STR_HELPER_NO_REPLY;LOW;Star tracker did not send replies (maybe device is powered off) P1: Position of upload or download packet for which no reply was sent;linux/devices/startracker/StrHelper.h
|
12512;0x30e0;STR_HELPER_DEC_ERROR;LOW;Error during decoding of received reply occurred P1: Return value of decoding function P2: Position of upload/download packet, or address of flash write/read request;linux\devices\startracker\StrHelper.h
|
||||||
12512;0x30e0;STR_HELPER_DEC_ERROR;LOW;Error during decoding of received reply occurred P1: Return value of decoding function P2: Position of upload/download packet, or address of flash write/read request;linux/devices/startracker/StrHelper.h
|
12513;0x30e1;POSITION_MISMATCH;LOW;Position mismatch P1: The expected position and thus the position for which the image upload/download failed;linux\devices\startracker\StrHelper.h
|
||||||
12513;0x30e1;POSITION_MISMATCH;LOW;Position mismatch P1: The expected position and thus the position for which the image upload/download failed;linux/devices/startracker/StrHelper.h
|
12514;0x30e2;STR_HELPER_FILE_NOT_EXISTS;LOW;Specified file does not exist P1: Internal state of str helper;linux\devices\startracker\StrHelper.h
|
||||||
12514;0x30e2;STR_HELPER_FILE_NOT_EXISTS;LOW;Specified file does not exist P1: Internal state of str helper;linux/devices/startracker/StrHelper.h
|
12515;0x30e3;STR_HELPER_SENDING_PACKET_FAILED;LOW;;linux\devices\startracker\StrHelper.h
|
||||||
12515;0x30e3;STR_HELPER_SENDING_PACKET_FAILED;LOW;;linux/devices/startracker/StrHelper.h
|
12516;0x30e4;STR_HELPER_REQUESTING_MSG_FAILED;LOW;;linux\devices\startracker\StrHelper.h
|
||||||
12516;0x30e4;STR_HELPER_REQUESTING_MSG_FAILED;LOW;;linux/devices/startracker/StrHelper.h
|
12600;0x3138;MPSOC_FLASH_WRITE_FAILED;LOW;Flash write fails;linux\devices\ploc\PlocMPSoCHelper.h
|
||||||
12600;0x3138;MPSOC_FLASH_WRITE_FAILED;LOW;Flash write fails;linux/devices/ploc/PlocMPSoCHelper.h
|
12601;0x3139;MPSOC_FLASH_WRITE_SUCCESSFUL;LOW;Flash write successful;linux\devices\ploc\PlocMPSoCHelper.h
|
||||||
12601;0x3139;MPSOC_FLASH_WRITE_SUCCESSFUL;LOW;Flash write successful;linux/devices/ploc/PlocMPSoCHelper.h
|
12602;0x313a;MPSOC_SENDING_COMMAND_FAILED;LOW;;linux\devices\ploc\PlocMPSoCHelper.h
|
||||||
12602;0x313a;SENDING_COMMAND_FAILED;LOW;;linux/devices/ploc/PlocMPSoCHelper.h
|
12603;0x313b;MPSOC_HELPER_REQUESTING_REPLY_FAILED;LOW;Request receive message of communication interface failed P1: Return value returned by the communication interface requestReceiveMessage function P2: Internal state of MPSoC helper;linux\devices\ploc\PlocMPSoCHelper.h
|
||||||
12603;0x313b;MPSOC_HELPER_REQUESTING_REPLY_FAILED;LOW;Request receive message of communication interface failed P1: Return value returned by the communication interface requestReceiveMessage function P2: Internal state of MPSoC helper;linux/devices/ploc/PlocMPSoCHelper.h
|
12604;0x313c;MPSOC_HELPER_READING_REPLY_FAILED;LOW;Reading receive message of communication interface failed P1: Return value returned by the communication interface readingReceivedMessage function P2: Internal state of MPSoC helper;linux\devices\ploc\PlocMPSoCHelper.h
|
||||||
12604;0x313c;MPSOC_HELPER_READING_REPLY_FAILED;LOW;Reading receive message of communication interface failed P1: Return value returned by the communication interface readingReceivedMessage function P2: Internal state of MPSoC helper;linux/devices/ploc/PlocMPSoCHelper.h
|
12605;0x313d;MPSOC_MISSING_ACK;LOW;Did not receive acknowledgment report P1: Number of bytes missing P2: Internal state of MPSoC helper;linux\devices\ploc\PlocMPSoCHelper.h
|
||||||
12605;0x313d;MISSING_ACK;LOW;Did not receive acknowledgement report P1: Number of bytes missing P2: Internal state of MPSoC helper;linux/devices/ploc/PlocMPSoCHelper.h
|
12606;0x313e;MPSOC_MISSING_EXE;LOW;Did not receive execution report P1: Number of bytes missing P2: Internal state of MPSoC helper;linux\devices\ploc\PlocMPSoCHelper.h
|
||||||
12606;0x313e;MISSING_EXE;LOW;Did not receive execution report P1: Number of bytes missing P2: Internal state of MPSoC helper;linux/devices/ploc/PlocMPSoCHelper.h
|
12607;0x313f;MPSOC_ACK_FAILURE_REPORT;LOW;Received acknowledgment failure report P1: Internal state of MPSoC;linux\devices\ploc\PlocMPSoCHelper.h
|
||||||
12607;0x313f;ACK_FAILURE_REPORT;LOW;Received acknowledgement failure report P1: Internal state of MPSoC;linux/devices/ploc/PlocMPSoCHelper.h
|
12608;0x3140;MPSOC_EXE_FAILURE_REPORT;LOW;Received execution failure report P1: Internal state of MPSoC;linux\devices\ploc\PlocMPSoCHelper.h
|
||||||
12608;0x3140;EXE_FAILURE_REPORT;LOW;Received execution failure report P1: Internal state of MPSoC;linux/devices/ploc/PlocMPSoCHelper.h
|
12609;0x3141;MPSOC_ACK_INVALID_APID;LOW;Expected acknowledgment report but received space packet with other apid P1: Apid of received space packet P2: Internal state of MPSoC;linux\devices\ploc\PlocMPSoCHelper.h
|
||||||
12609;0x3141;ACK_INVALID_APID;LOW;Expected acknowledgement report but received space packet with other apid P1: Apid of received space packet P2: Internal state of MPSoC;linux/devices/ploc/PlocMPSoCHelper.h
|
12610;0x3142;MPSOC_EXE_INVALID_APID;LOW;Expected execution report but received space packet with other apid P1: Apid of received space packet P2: Internal state of MPSoC;linux\devices\ploc\PlocMPSoCHelper.h
|
||||||
12610;0x3142;EXE_INVALID_APID;LOW;Expected execution report but received space packet with other apid P1: Apid of received space packet P2: Internal state of MPSoC;linux/devices/ploc/PlocMPSoCHelper.h
|
12611;0x3143;MPSOC_HELPER_SEQ_CNT_MISMATCH;LOW;Received sequence count does not match expected sequence count P1: Expected sequence count P2: Received sequence count;linux\devices\ploc\PlocMPSoCHelper.h
|
||||||
12611;0x3143;MPSOC_HELPER_SEQ_CNT_MISMATCH;LOW;Received sequence count does not match expected sequence count P1: Expected sequence count P2: Received sequence count;linux/devices/ploc/PlocMPSoCHelper.h
|
12700;0x319c;TRANSITION_BACK_TO_OFF;MEDIUM;Could not transition properly and went back to ALL OFF;mission\devices\PayloadPcduHandler.h
|
||||||
12700;0x319c;TRANSITION_BACK_TO_OFF;MEDIUM;Could not transition properly and went back to ALL OFF;mission/devices/PayloadPcduHandler.h
|
12701;0x319d;NEG_V_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission\devices\PayloadPcduHandler.h
|
||||||
12701;0x319d;NEG_V_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h
|
12702;0x319e;U_DRO_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission\devices\PayloadPcduHandler.h
|
||||||
12702;0x319e;U_DRO_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h
|
12703;0x319f;I_DRO_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission\devices\PayloadPcduHandler.h
|
||||||
12703;0x319f;I_DRO_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h
|
12704;0x31a0;U_X8_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission\devices\PayloadPcduHandler.h
|
||||||
12704;0x31a0;U_X8_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h
|
12705;0x31a1;I_X8_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission\devices\PayloadPcduHandler.h
|
||||||
12705;0x31a1;I_X8_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h
|
12706;0x31a2;U_TX_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission\devices\PayloadPcduHandler.h
|
||||||
12706;0x31a2;U_TX_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h
|
12707;0x31a3;I_TX_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission\devices\PayloadPcduHandler.h
|
||||||
12707;0x31a3;I_TX_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h
|
12708;0x31a4;U_MPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission\devices\PayloadPcduHandler.h
|
||||||
12708;0x31a4;U_MPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h
|
12709;0x31a5;I_MPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission\devices\PayloadPcduHandler.h
|
||||||
12709;0x31a5;I_MPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h
|
12710;0x31a6;U_HPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission\devices\PayloadPcduHandler.h
|
||||||
12710;0x31a6;U_HPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h
|
12711;0x31a7;I_HPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission\devices\PayloadPcduHandler.h
|
||||||
12711;0x31a7;I_HPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h
|
12800;0x3200;TRANSITION_OTHER_SIDE_FAILED;HIGH;;mission\system\AcsBoardAssembly.h
|
||||||
12800;0x3200;TRANSITION_OTHER_SIDE_FAILED;HIGH;;mission/system/AcsBoardAssembly.h
|
12801;0x3201;NOT_ENOUGH_DEVICES_DUAL_MODE;HIGH;;mission\system\AcsBoardAssembly.h
|
||||||
12801;0x3201;NOT_ENOUGH_DEVICES_DUAL_MODE;HIGH;;mission/system/AcsBoardAssembly.h
|
12802;0x3202;POWER_STATE_MACHINE_TIMEOUT;MEDIUM;;mission\system\AcsBoardAssembly.h
|
||||||
12802;0x3202;POWER_STATE_MACHINE_TIMEOUT;MEDIUM;;mission/system/AcsBoardAssembly.h
|
12803;0x3203;SIDE_SWITCH_TRANSITION_NOT_ALLOWED;LOW;Not implemented, would increase already high complexity. Operator should instead command the assembly off first and then command the assembly on into the desired mode/submode combination;mission\system\AcsBoardAssembly.h
|
||||||
12803;0x3203;SIDE_SWITCH_TRANSITION_NOT_ALLOWED;LOW;Not implemented, would increase already high complexity. Operator should instead command the assembly off first and then command the assembly on into the desired mode/submode combination;mission/system/AcsBoardAssembly.h
|
12900;0x3264;TRANSITION_OTHER_SIDE_FAILED;HIGH;;mission\system\SusAssembly.h
|
||||||
12900;0x3264;TRANSITION_OTHER_SIDE_FAILED;HIGH;;mission/system/SusAssembly.h
|
12901;0x3265;NOT_ENOUGH_DEVICES_DUAL_MODE;HIGH;;mission\system\SusAssembly.h
|
||||||
12901;0x3265;NOT_ENOUGH_DEVICES_DUAL_MODE;HIGH;;mission/system/SusAssembly.h
|
12902;0x3266;POWER_STATE_MACHINE_TIMEOUT;MEDIUM;;mission\system\SusAssembly.h
|
||||||
12902;0x3266;POWER_STATE_MACHINE_TIMEOUT;MEDIUM;;mission/system/SusAssembly.h
|
12903;0x3267;SIDE_SWITCH_TRANSITION_NOT_ALLOWED;LOW;Not implemented, would increase already high complexity. Operator should instead command the assembly off first and then command the assembly on into the desired mode/submode combination;mission\system\SusAssembly.h
|
||||||
12903;0x3267;SIDE_SWITCH_TRANSITION_NOT_ALLOWED;LOW;Not implemented, would increase already high complexity. Operator should instead command the assembly off first and then command the assembly on into the desired mode/submode combination;mission/system/SusAssembly.h
|
13000;0x32c8;CHILDREN_LOST_MODE;MEDIUM;;mission\system\TcsBoardAssembly.h
|
||||||
13000;0x32c8;CHILDREN_LOST_MODE;MEDIUM;;mission/system/TcsBoardAssembly.h
|
13100;0x332c;GPS_FIX_CHANGE;INFO;Fix has changed. P1: Old fix. P2: New fix 0: Not seen, 1: No Fix, 2: 2D-Fix, 3: 3D-Fix;mission\devices\devicedefinitions\GPSDefinitions.h
|
||||||
13100;0x332c;GPS_FIX_CHANGE;INFO;Fix has changed. P1: Old fix. P2: New fix 0: Not seen, 1: No Fix, 2: 2D-Fix, 3: 3D-Fix;mission/devices/devicedefinitions/GPSDefinitions.h
|
13200;0x3390;P60_BOOT_COUNT;INFO;P60 boot count is broadcasted once at SW startup. P1: Boot count;mission\devices\P60DockHandler.h
|
||||||
13200;0x3390;P60_BOOT_COUNT;INFO;P60 boot count is broadcasted once at SW startup. P1: Boot count;mission/devices/P60DockHandler.h
|
13201;0x3391;BATT_MODE;INFO;Battery mode is broadcasted at startup. P1: Mode;mission\devices\P60DockHandler.h
|
||||||
13201;0x3391;BATT_MODE;INFO;Battery mode is broadcasted at startup. P1: Mode;mission/devices/P60DockHandler.h
|
13202;0x3392;BATT_MODE_CHANGED;MEDIUM;Battery mode has changed. P1: Old mode. P2: New mode;mission\devices\P60DockHandler.h
|
||||||
13202;0x3392;BATT_MODE_CHANGED;MEDIUM;Battery mode has changed. P1: Old mode. P2: New mode;mission/devices/P60DockHandler.h
|
13600;0x3520;SUPV_UPDATE_FAILED;LOW;update failed;linux\devices\ploc\PlocSupvHelper.h
|
||||||
13600;0x3520;ALLOC_FAILURE;MEDIUM;;bsp_q7s/core/CoreController.h
|
13601;0x3521;SUPV_UPDATE_SUCCESSFUL;LOW;update successful;linux\devices\ploc\PlocSupvHelper.h
|
||||||
13601;0x3521;REBOOT_SW;MEDIUM; Software reboot occured. Can also be a systemd reboot. P1: Current Chip, P2: Current Copy;bsp_q7s/core/CoreController.h
|
13602;0x3522;SUPV_CONTINUE_UPDATE_FAILED;LOW;Continue update command failed;linux\devices\ploc\PlocSupvHelper.h
|
||||||
13602;0x3522;REBOOT_MECHANISM_TRIGGERED;MEDIUM;The reboot mechanism was triggered. P1: First 16 bits: Last Chip, Last 16 bits: Last Copy, P2: Each byte is the respective reboot count for the slots;bsp_q7s/core/CoreController.h
|
13603;0x3523;SUPV_CONTINUE_UPDATE_SUCCESSFUL;LOW;Continue update command successful;linux\devices\ploc\PlocSupvHelper.h
|
||||||
13603;0x3523;REBOOT_HW;MEDIUM;;bsp_q7s/core/CoreController.h
|
13604;0x3524;TERMINATED_UPDATE_PROCEDURE;LOW;Terminated update procedure by command;linux\devices\ploc\PlocSupvHelper.h
|
||||||
|
13605;0x3525;SUPV_EVENT_BUFFER_REQUEST_SUCCESSFUL;LOW;Requesting event buffer was successful;linux\devices\ploc\PlocSupvHelper.h
|
||||||
|
13606;0x3526;SUPV_EVENT_BUFFER_REQUEST_FAILED;LOW;Requesting event buffer failed;linux\devices\ploc\PlocSupvHelper.h
|
||||||
|
13607;0x3527;SUPV_EVENT_BUFFER_REQUEST_TERMINATED;LOW;Terminated event buffer request by command P1: Number of packets read before process was terminated;linux\devices\ploc\PlocSupvHelper.h
|
||||||
|
13608;0x3528;SUPV_SENDING_COMMAND_FAILED;LOW;;linux\devices\ploc\PlocSupvHelper.h
|
||||||
|
13609;0x3529;SUPV_HELPER_REQUESTING_REPLY_FAILED;LOW;Request receive message of communication interface failed P1: Return value returned by the communication interface requestReceiveMessage function P2: Internal state of supervisor helper;linux\devices\ploc\PlocSupvHelper.h
|
||||||
|
13610;0x352a;SUPV_HELPER_READING_REPLY_FAILED;LOW;Reading receive message of communication interface failed P1: Return value returned by the communication interface readingReceivedMessage function P2: Internal state of supervisor helper;linux\devices\ploc\PlocSupvHelper.h
|
||||||
|
13611;0x352b;SUPV_MISSING_ACK;LOW;Did not receive acknowledgement report P1: Number of bytes missing P2: Internal state of MPSoC helper;linux\devices\ploc\PlocSupvHelper.h
|
||||||
|
13612;0x352c;SUPV_MISSING_EXE;LOW;Supervisor did not receive execution report P1: Number of bytes missing P2: Internal state of supervisor helper;linux\devices\ploc\PlocSupvHelper.h
|
||||||
|
13613;0x352d;SUPV_ACK_FAILURE_REPORT;LOW;Supervisor received acknowledgment failure report P1: Internal state of supervisor helper;linux\devices\ploc\PlocSupvHelper.h
|
||||||
|
13614;0x352e;SUPV_EXE_FAILURE_REPORT;LOW;Execution report failure P1:;linux\devices\ploc\PlocSupvHelper.h
|
||||||
|
13615;0x352f;SUPV_ACK_INVALID_APID;LOW;Supervisor expected acknowledgment report but received space packet with other apid P1: Apid of received space packet P2: Internal state of supervisor helper;linux\devices\ploc\PlocSupvHelper.h
|
||||||
|
13616;0x3530;SUPV_EXE_INVALID_APID;LOW;Supervisor helper expected execution report but received space packet with other apid P1: Apid of received space packet P2: Internal state of supervisor helper;linux\devices\ploc\PlocSupvHelper.h
|
||||||
|
13617;0x3531;ACK_RECEPTION_FAILURE;LOW;Failed to receive acknowledgment report P1: Return value P2: Apid of command for which the reception of the acknowledgment report failed;linux\devices\ploc\PlocSupvHelper.h
|
||||||
|
13618;0x3532;EXE_RECEPTION_FAILURE;LOW;Failed to receive execution report P1: Return value P2: Apid of command for which the reception of the execution report failed;linux\devices\ploc\PlocSupvHelper.h
|
||||||
|
13619;0x3533;WRITE_MEMORY_FAILED;LOW;Update procedure failed when sending packet with number P1 P1: Packet number for which the memory write command fails;linux\devices\ploc\PlocSupvHelper.h
|
||||||
|
13700;0x3584;ALLOC_FAILURE;MEDIUM;;bsp_q7s\core\CoreController.h
|
||||||
|
13701;0x3585;REBOOT_SW;MEDIUM; Software reboot occurred. Can also be a systemd reboot. P1: Current Chip, P2: Current Copy;bsp_q7s\core\CoreController.h
|
||||||
|
13702;0x3586;REBOOT_MECHANISM_TRIGGERED;MEDIUM;The reboot mechanism was triggered. P1: First 16 bits: Last Chip, Last 16 bits: Last Copy, P2: Each byte is the respective reboot count for the slots;bsp_q7s\core\CoreController.h
|
||||||
|
13703;0x3587;REBOOT_HW;MEDIUM;;bsp_q7s\core\CoreController.h
|
||||||
|
|
@ -4,18 +4,18 @@
|
|||||||
0x43400001;THERMAL_CONTROLLER
|
0x43400001;THERMAL_CONTROLLER
|
||||||
0x44120006;MGM_0_LIS3_HANDLER
|
0x44120006;MGM_0_LIS3_HANDLER
|
||||||
0x44120010;GYRO_0_ADIS_HANDLER
|
0x44120010;GYRO_0_ADIS_HANDLER
|
||||||
0x44120032;SUS_0
|
0x44120032;SUS_0_N_LOC_XFYFZM_PT_XF
|
||||||
0x44120033;SUS_1
|
0x44120033;SUS_1_N_LOC_XBYFZM_PT_XB
|
||||||
0x44120034;SUS_2
|
0x44120034;SUS_2_N_LOC_XFYBZB_PT_YB
|
||||||
0x44120035;SUS_3
|
0x44120035;SUS_3_N_LOC_XFYBZF_PT_YF
|
||||||
0x44120036;SUS_4
|
0x44120036;SUS_4_N_LOC_XMYFZF_PT_ZF
|
||||||
0x44120037;SUS_5
|
0x44120037;SUS_5_N_LOC_XFYMZB_PT_ZB
|
||||||
0x44120038;SUS_6
|
0x44120038;SUS_6_R_LOC_XFYBZM_PT_XF
|
||||||
0x44120039;SUS_7
|
0x44120039;SUS_7_R_LOC_XBYBZM_PT_XB
|
||||||
0x44120040;SUS_8
|
0x44120040;SUS_8_R_LOC_XBYBZB_PT_YB
|
||||||
0x44120041;SUS_9
|
0x44120041;SUS_9_R_LOC_XBYBZB_PT_YF
|
||||||
0x44120042;SUS_10
|
0x44120042;SUS_10_N_LOC_XMYBZF_PT_ZF
|
||||||
0x44120043;SUS_11
|
0x44120043;SUS_11_R_LOC_XBYMZB_PT_ZB
|
||||||
0x44120047;RW1
|
0x44120047;RW1
|
||||||
0x44120107;MGM_1_RM3100_HANDLER
|
0x44120107;MGM_1_RM3100_HANDLER
|
||||||
0x44120111;GYRO_1_L3G_HANDLER
|
0x44120111;GYRO_1_L3G_HANDLER
|
||||||
@ -41,6 +41,8 @@
|
|||||||
0x44330001;PLOC_MEMORY_DUMPER
|
0x44330001;PLOC_MEMORY_DUMPER
|
||||||
0x44330002;STR_HELPER
|
0x44330002;STR_HELPER
|
||||||
0x44330003;PLOC_MPSOC_HELPER
|
0x44330003;PLOC_MPSOC_HELPER
|
||||||
|
0x44330004;AXI_PTME_CONFIG
|
||||||
|
0x44330005;PTME_CONFIG
|
||||||
0x44330015;PLOC_MPSOC_HANDLER
|
0x44330015;PLOC_MPSOC_HANDLER
|
||||||
0x44330016;PLOC_SUPERVISOR_HANDLER
|
0x44330016;PLOC_SUPERVISOR_HANDLER
|
||||||
0x44330017;PLOC_SUPERVISOR_HELPER
|
0x44330017;PLOC_SUPERVISOR_HELPER
|
||||||
@ -48,26 +50,28 @@
|
|||||||
0x444100A4;HEATER_HANDLER
|
0x444100A4;HEATER_HANDLER
|
||||||
0x44420004;TMP1075_HANDLER_1
|
0x44420004;TMP1075_HANDLER_1
|
||||||
0x44420005;TMP1075_HANDLER_2
|
0x44420005;TMP1075_HANDLER_2
|
||||||
0x44420016;RTD_IC_3
|
0x44420016;RTD_0_IC3_PLOC_HEATSPREADER
|
||||||
0x44420017;RTD_IC_4
|
0x44420017;RTD_1_IC4_PLOC_MISSIONBOARD
|
||||||
0x44420018;RTD_IC_5
|
0x44420018;RTD_2_IC5_4K_CAMERA
|
||||||
0x44420019;RTD_IC_6
|
0x44420019;RTD_3_IC6_DAC_HEATSPREADER
|
||||||
0x44420020;RTD_IC_7
|
0x44420020;RTD_4_IC7_STARTRACKER
|
||||||
0x44420021;RTD_IC_8
|
0x44420021;RTD_5_IC8_RW1_MX_MY
|
||||||
0x44420022;RTD_IC_9
|
0x44420022;RTD_6_IC9_DRO
|
||||||
0x44420023;RTD_IC_10
|
0x44420023;RTD_7_IC10_SCEX
|
||||||
0x44420024;RTD_IC_11
|
0x44420024;RTD_8_IC11_X8
|
||||||
0x44420025;RTD_IC_12
|
0x44420025;RTD_9_IC12_HPA
|
||||||
0x44420026;RTD_IC_13
|
0x44420026;RTD_10_IC13_PL_TX
|
||||||
0x44420027;RTD_IC_14
|
0x44420027;RTD_11_IC14_MPA
|
||||||
0x44420028;RTD_IC_15
|
0x44420028;RTD_12_IC15_ACU
|
||||||
0x44420029;RTD_IC_16
|
0x44420029;RTD_13_IC16_PLPCDU_HEATSPREADER
|
||||||
0x44420030;RTD_IC_17
|
0x44420030;RTD_14_IC17_TCS_BOARD
|
||||||
0x44420031;RTD_IC_18
|
0x44420031;RTD_15_IC18_IMTQ
|
||||||
0x445300A3;SYRLINKS_HK_HANDLER
|
0x445300A3;SYRLINKS_HK_HANDLER
|
||||||
0x49000000;ARDUINO_COM_IF
|
0x49000000;ARDUINO_COM_IF
|
||||||
0x49010005;GPIO_IF
|
0x49010005;GPIO_IF
|
||||||
0x49020004;SPI_COM_IF
|
0x49020004;SPI_MAIN_COM_IF
|
||||||
|
0x49020005;SPI_RW_COM_IF
|
||||||
|
0x49020006;SPI_RTD_COM_IF
|
||||||
0x49030003;UART_COM_IF
|
0x49030003;UART_COM_IF
|
||||||
0x49040002;I2C_COM_IF
|
0x49040002;I2C_COM_IF
|
||||||
0x49050001;CSP_COM_IF
|
0x49050001;CSP_COM_IF
|
||||||
@ -88,6 +92,7 @@
|
|||||||
0x53000005;PUS_SERVICE_5_EVENT_REPORTING
|
0x53000005;PUS_SERVICE_5_EVENT_REPORTING
|
||||||
0x53000008;PUS_SERVICE_8_FUNCTION_MGMT
|
0x53000008;PUS_SERVICE_8_FUNCTION_MGMT
|
||||||
0x53000009;PUS_SERVICE_9_TIME_MGMT
|
0x53000009;PUS_SERVICE_9_TIME_MGMT
|
||||||
|
0x53000011;PUS_SERVICE_11_TC_SCHEDULER
|
||||||
0x53000017;PUS_SERVICE_17_TEST
|
0x53000017;PUS_SERVICE_17_TEST
|
||||||
0x53000020;PUS_SERVICE_20_PARAMETERS
|
0x53000020;PUS_SERVICE_20_PARAMETERS
|
||||||
0x53000200;PUS_SERVICE_200_MODE_MGMT
|
0x53000200;PUS_SERVICE_200_MODE_MGMT
|
||||||
@ -109,9 +114,18 @@
|
|||||||
0x5400CAFE;DUMMY_INTERFACE
|
0x5400CAFE;DUMMY_INTERFACE
|
||||||
0x54123456;LIBGPIOD_TEST
|
0x54123456;LIBGPIOD_TEST
|
||||||
0x54694269;TEST_TASK
|
0x54694269;TEST_TASK
|
||||||
|
0x60000000;HEATER_0_PLOC_PROC_BRD
|
||||||
|
0x60000001;HEATER_1_PCDU_BRD
|
||||||
|
0x60000002;HEATER_2_ACS_BRD
|
||||||
|
0x60000003;HEATER_3_OBC_BRD
|
||||||
|
0x60000004;HEATER_4_CAMERA
|
||||||
|
0x60000005;HEATER_5_STR
|
||||||
|
0x60000006;HEATER_6_DRO
|
||||||
|
0x60000007;HEATER_7_HPA
|
||||||
0x73000001;ACS_BOARD_ASS
|
0x73000001;ACS_BOARD_ASS
|
||||||
0x73000002;SUS_BOARD_ASS
|
0x73000002;SUS_BOARD_ASS
|
||||||
0x73000003;TCS_BOARD_ASS
|
0x73000003;TCS_BOARD_ASS
|
||||||
|
0x73000004;RW_ASS
|
||||||
0x73000100;TM_FUNNEL
|
0x73000100;TM_FUNNEL
|
||||||
0x73500000;CCSDS_IP_CORE_BRIDGE
|
0x73500000;CCSDS_IP_CORE_BRIDGE
|
||||||
0xFFFFFFFF;NO_OBJECT
|
0xFFFFFFFF;NO_OBJECT
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* @brief Auto-generated event translation file. Contains 187 translations.
|
* @brief Auto-generated event translation file. Contains 206 translations.
|
||||||
* @details
|
* @details
|
||||||
* Generated on: 2022-05-03 16:32:00
|
* Generated on: 2022-05-23 16:46:55
|
||||||
*/
|
*/
|
||||||
#include "translateEvents.h"
|
#include "translateEvents.h"
|
||||||
|
|
||||||
@ -90,9 +90,12 @@ const char *SWITCHING_Q7S_DENIED_STRING = "SWITCHING_Q7S_DENIED";
|
|||||||
const char *FDIR_REACTION_IGNORED_STRING = "FDIR_REACTION_IGNORED";
|
const char *FDIR_REACTION_IGNORED_STRING = "FDIR_REACTION_IGNORED";
|
||||||
const char *GPIO_PULL_HIGH_FAILED_STRING = "GPIO_PULL_HIGH_FAILED";
|
const char *GPIO_PULL_HIGH_FAILED_STRING = "GPIO_PULL_HIGH_FAILED";
|
||||||
const char *GPIO_PULL_LOW_FAILED_STRING = "GPIO_PULL_LOW_FAILED";
|
const char *GPIO_PULL_LOW_FAILED_STRING = "GPIO_PULL_LOW_FAILED";
|
||||||
|
const char *HEATER_WENT_ON_STRING = "HEATER_WENT_ON";
|
||||||
|
const char *HEATER_WENT_OFF_STRING = "HEATER_WENT_OFF";
|
||||||
const char *SWITCH_ALREADY_ON_STRING = "SWITCH_ALREADY_ON";
|
const char *SWITCH_ALREADY_ON_STRING = "SWITCH_ALREADY_ON";
|
||||||
const char *SWITCH_ALREADY_OFF_STRING = "SWITCH_ALREADY_OFF";
|
const char *SWITCH_ALREADY_OFF_STRING = "SWITCH_ALREADY_OFF";
|
||||||
const char *MAIN_SWITCH_TIMEOUT_STRING = "MAIN_SWITCH_TIMEOUT";
|
const char *MAIN_SWITCH_TIMEOUT_STRING = "MAIN_SWITCH_TIMEOUT";
|
||||||
|
const char *FAULTY_HEATER_WAS_ON_STRING = "FAULTY_HEATER_WAS_ON";
|
||||||
const char *MAIN_SWITCH_ON_TIMEOUT_STRING = "MAIN_SWITCH_ON_TIMEOUT";
|
const char *MAIN_SWITCH_ON_TIMEOUT_STRING = "MAIN_SWITCH_ON_TIMEOUT";
|
||||||
const char *MAIN_SWITCH_OFF_TIMEOUT_STRING = "MAIN_SWITCH_OFF_TIMEOUT";
|
const char *MAIN_SWITCH_OFF_TIMEOUT_STRING = "MAIN_SWITCH_OFF_TIMEOUT";
|
||||||
const char *DEPLOYMENT_FAILED_STRING = "DEPLOYMENT_FAILED";
|
const char *DEPLOYMENT_FAILED_STRING = "DEPLOYMENT_FAILED";
|
||||||
@ -102,7 +105,7 @@ const char *MEMORY_READ_RPT_CRC_FAILURE_STRING = "MEMORY_READ_RPT_CRC_FAILURE";
|
|||||||
const char *ACK_FAILURE_STRING = "ACK_FAILURE";
|
const char *ACK_FAILURE_STRING = "ACK_FAILURE";
|
||||||
const char *EXE_FAILURE_STRING = "EXE_FAILURE";
|
const char *EXE_FAILURE_STRING = "EXE_FAILURE";
|
||||||
const char *MPSOC_HANDLER_CRC_FAILURE_STRING = "MPSOC_HANDLER_CRC_FAILURE";
|
const char *MPSOC_HANDLER_CRC_FAILURE_STRING = "MPSOC_HANDLER_CRC_FAILURE";
|
||||||
const char *MPSOC_HANDLER_SEQ_CNT_MISMATCH_STRING = "MPSOC_HANDLER_SEQ_CNT_MISMATCH";
|
const char *MPSOC_HANDLER_SEQUENCE_COUNT_MISMATCH_STRING = "MPSOC_HANDLER_SEQUENCE_COUNT_MISMATCH";
|
||||||
const char *MPSOC_SHUTDOWN_FAILED_STRING = "MPSOC_SHUTDOWN_FAILED";
|
const char *MPSOC_SHUTDOWN_FAILED_STRING = "MPSOC_SHUTDOWN_FAILED";
|
||||||
const char *SELF_TEST_I2C_FAILURE_STRING = "SELF_TEST_I2C_FAILURE";
|
const char *SELF_TEST_I2C_FAILURE_STRING = "SELF_TEST_I2C_FAILURE";
|
||||||
const char *SELF_TEST_SPI_FAILURE_STRING = "SELF_TEST_SPI_FAILURE";
|
const char *SELF_TEST_SPI_FAILURE_STRING = "SELF_TEST_SPI_FAILURE";
|
||||||
@ -113,20 +116,16 @@ const char *SELF_TEST_MTM_RANGE_FAILURE_STRING = "SELF_TEST_MTM_RANGE_FAILURE";
|
|||||||
const char *SELF_TEST_COIL_CURRENT_FAILURE_STRING = "SELF_TEST_COIL_CURRENT_FAILURE";
|
const char *SELF_TEST_COIL_CURRENT_FAILURE_STRING = "SELF_TEST_COIL_CURRENT_FAILURE";
|
||||||
const char *INVALID_ERROR_BYTE_STRING = "INVALID_ERROR_BYTE";
|
const char *INVALID_ERROR_BYTE_STRING = "INVALID_ERROR_BYTE";
|
||||||
const char *ERROR_STATE_STRING = "ERROR_STATE";
|
const char *ERROR_STATE_STRING = "ERROR_STATE";
|
||||||
|
const char *RESET_OCCURED_STRING = "RESET_OCCURED";
|
||||||
const char *BOOTING_FIRMWARE_FAILED_STRING = "BOOTING_FIRMWARE_FAILED";
|
const char *BOOTING_FIRMWARE_FAILED_STRING = "BOOTING_FIRMWARE_FAILED";
|
||||||
const char *BOOTING_BOOTLOADER_FAILED_STRING = "BOOTING_BOOTLOADER_FAILED";
|
const char *BOOTING_BOOTLOADER_FAILED_STRING = "BOOTING_BOOTLOADER_FAILED";
|
||||||
const char *SUPV_MEMORY_READ_RPT_CRC_FAILURE_STRING = "SUPV_MEMORY_READ_RPT_CRC_FAILURE";
|
const char *SUPV_MEMORY_READ_RPT_CRC_FAILURE_STRING = "SUPV_MEMORY_READ_RPT_CRC_FAILURE";
|
||||||
const char *SUPV_ACK_FAILURE_STRING = "SUPV_ACK_FAILURE";
|
const char *SUPV_ACK_FAILURE_STRING = "SUPV_ACK_FAILURE";
|
||||||
const char *SUPV_EXE_FAILURE_STRING = "SUPV_EXE_FAILURE";
|
const char *SUPV_EXE_FAILURE_STRING = "SUPV_EXE_FAILURE";
|
||||||
const char *SUPV_CRC_FAILURE_EVENT_STRING = "SUPV_CRC_FAILURE_EVENT";
|
const char *SUPV_CRC_FAILURE_EVENT_STRING = "SUPV_CRC_FAILURE_EVENT";
|
||||||
|
const char *SUPV_MPSOC_SHUWDOWN_BUILD_FAILED_STRING = "SUPV_MPSOC_SHUWDOWN_BUILD_FAILED";
|
||||||
const char *SANITIZATION_FAILED_STRING = "SANITIZATION_FAILED";
|
const char *SANITIZATION_FAILED_STRING = "SANITIZATION_FAILED";
|
||||||
const char *MOUNTED_SD_CARD_STRING = "MOUNTED_SD_CARD";
|
const char *MOUNTED_SD_CARD_STRING = "MOUNTED_SD_CARD";
|
||||||
const char *UPDATE_FILE_NOT_EXISTS_STRING = "UPDATE_FILE_NOT_EXISTS";
|
|
||||||
const char *ACTION_COMMANDING_FAILED_STRING = "ACTION_COMMANDING_FAILED";
|
|
||||||
const char *UPDATE_AVAILABLE_FAILED_STRING = "UPDATE_AVAILABLE_FAILED";
|
|
||||||
const char *UPDATE_TRANSFER_FAILED_STRING = "UPDATE_TRANSFER_FAILED";
|
|
||||||
const char *UPDATE_VERIFY_FAILED_STRING = "UPDATE_VERIFY_FAILED";
|
|
||||||
const char *UPDATE_FINISHED_STRING = "UPDATE_FINISHED";
|
|
||||||
const char *SEND_MRAM_DUMP_FAILED_STRING = "SEND_MRAM_DUMP_FAILED";
|
const char *SEND_MRAM_DUMP_FAILED_STRING = "SEND_MRAM_DUMP_FAILED";
|
||||||
const char *MRAM_DUMP_FAILED_STRING = "MRAM_DUMP_FAILED";
|
const char *MRAM_DUMP_FAILED_STRING = "MRAM_DUMP_FAILED";
|
||||||
const char *MRAM_DUMP_FINISHED_STRING = "MRAM_DUMP_FINISHED";
|
const char *MRAM_DUMP_FINISHED_STRING = "MRAM_DUMP_FINISHED";
|
||||||
@ -153,15 +152,15 @@ const char *STR_HELPER_SENDING_PACKET_FAILED_STRING = "STR_HELPER_SENDING_PACKET
|
|||||||
const char *STR_HELPER_REQUESTING_MSG_FAILED_STRING = "STR_HELPER_REQUESTING_MSG_FAILED";
|
const char *STR_HELPER_REQUESTING_MSG_FAILED_STRING = "STR_HELPER_REQUESTING_MSG_FAILED";
|
||||||
const char *MPSOC_FLASH_WRITE_FAILED_STRING = "MPSOC_FLASH_WRITE_FAILED";
|
const char *MPSOC_FLASH_WRITE_FAILED_STRING = "MPSOC_FLASH_WRITE_FAILED";
|
||||||
const char *MPSOC_FLASH_WRITE_SUCCESSFUL_STRING = "MPSOC_FLASH_WRITE_SUCCESSFUL";
|
const char *MPSOC_FLASH_WRITE_SUCCESSFUL_STRING = "MPSOC_FLASH_WRITE_SUCCESSFUL";
|
||||||
const char *SENDING_COMMAND_FAILED_STRING = "SENDING_COMMAND_FAILED";
|
const char *MPSOC_SENDING_COMMAND_FAILED_STRING = "MPSOC_SENDING_COMMAND_FAILED";
|
||||||
const char *MPSOC_HELPER_REQUESTING_REPLY_FAILED_STRING = "MPSOC_HELPER_REQUESTING_REPLY_FAILED";
|
const char *MPSOC_HELPER_REQUESTING_REPLY_FAILED_STRING = "MPSOC_HELPER_REQUESTING_REPLY_FAILED";
|
||||||
const char *MPSOC_HELPER_READING_REPLY_FAILED_STRING = "MPSOC_HELPER_READING_REPLY_FAILED";
|
const char *MPSOC_HELPER_READING_REPLY_FAILED_STRING = "MPSOC_HELPER_READING_REPLY_FAILED";
|
||||||
const char *MISSING_ACK_STRING = "MISSING_ACK";
|
const char *MPSOC_MISSING_ACK_STRING = "MPSOC_MISSING_ACK";
|
||||||
const char *MISSING_EXE_STRING = "MISSING_EXE";
|
const char *MPSOC_MISSING_EXE_STRING = "MPSOC_MISSING_EXE";
|
||||||
const char *ACK_FAILURE_REPORT_STRING = "ACK_FAILURE_REPORT";
|
const char *MPSOC_ACK_FAILURE_REPORT_STRING = "MPSOC_ACK_FAILURE_REPORT";
|
||||||
const char *EXE_FAILURE_REPORT_STRING = "EXE_FAILURE_REPORT";
|
const char *MPSOC_EXE_FAILURE_REPORT_STRING = "MPSOC_EXE_FAILURE_REPORT";
|
||||||
const char *ACK_INVALID_APID_STRING = "ACK_INVALID_APID";
|
const char *MPSOC_ACK_INVALID_APID_STRING = "MPSOC_ACK_INVALID_APID";
|
||||||
const char *EXE_INVALID_APID_STRING = "EXE_INVALID_APID";
|
const char *MPSOC_EXE_INVALID_APID_STRING = "MPSOC_EXE_INVALID_APID";
|
||||||
const char *MPSOC_HELPER_SEQ_CNT_MISMATCH_STRING = "MPSOC_HELPER_SEQ_CNT_MISMATCH";
|
const char *MPSOC_HELPER_SEQ_CNT_MISMATCH_STRING = "MPSOC_HELPER_SEQ_CNT_MISMATCH";
|
||||||
const char *TRANSITION_BACK_TO_OFF_STRING = "TRANSITION_BACK_TO_OFF";
|
const char *TRANSITION_BACK_TO_OFF_STRING = "TRANSITION_BACK_TO_OFF";
|
||||||
const char *NEG_V_OUT_OF_BOUNDS_STRING = "NEG_V_OUT_OF_BOUNDS";
|
const char *NEG_V_OUT_OF_BOUNDS_STRING = "NEG_V_OUT_OF_BOUNDS";
|
||||||
@ -184,6 +183,26 @@ const char *GPS_FIX_CHANGE_STRING = "GPS_FIX_CHANGE";
|
|||||||
const char *P60_BOOT_COUNT_STRING = "P60_BOOT_COUNT";
|
const char *P60_BOOT_COUNT_STRING = "P60_BOOT_COUNT";
|
||||||
const char *BATT_MODE_STRING = "BATT_MODE";
|
const char *BATT_MODE_STRING = "BATT_MODE";
|
||||||
const char *BATT_MODE_CHANGED_STRING = "BATT_MODE_CHANGED";
|
const char *BATT_MODE_CHANGED_STRING = "BATT_MODE_CHANGED";
|
||||||
|
const char *SUPV_UPDATE_FAILED_STRING = "SUPV_UPDATE_FAILED";
|
||||||
|
const char *SUPV_UPDATE_SUCCESSFUL_STRING = "SUPV_UPDATE_SUCCESSFUL";
|
||||||
|
const char *SUPV_CONTINUE_UPDATE_FAILED_STRING = "SUPV_CONTINUE_UPDATE_FAILED";
|
||||||
|
const char *SUPV_CONTINUE_UPDATE_SUCCESSFUL_STRING = "SUPV_CONTINUE_UPDATE_SUCCESSFUL";
|
||||||
|
const char *TERMINATED_UPDATE_PROCEDURE_STRING = "TERMINATED_UPDATE_PROCEDURE";
|
||||||
|
const char *SUPV_EVENT_BUFFER_REQUEST_SUCCESSFUL_STRING = "SUPV_EVENT_BUFFER_REQUEST_SUCCESSFUL";
|
||||||
|
const char *SUPV_EVENT_BUFFER_REQUEST_FAILED_STRING = "SUPV_EVENT_BUFFER_REQUEST_FAILED";
|
||||||
|
const char *SUPV_EVENT_BUFFER_REQUEST_TERMINATED_STRING = "SUPV_EVENT_BUFFER_REQUEST_TERMINATED";
|
||||||
|
const char *SUPV_SENDING_COMMAND_FAILED_STRING = "SUPV_SENDING_COMMAND_FAILED";
|
||||||
|
const char *SUPV_HELPER_REQUESTING_REPLY_FAILED_STRING = "SUPV_HELPER_REQUESTING_REPLY_FAILED";
|
||||||
|
const char *SUPV_HELPER_READING_REPLY_FAILED_STRING = "SUPV_HELPER_READING_REPLY_FAILED";
|
||||||
|
const char *SUPV_MISSING_ACK_STRING = "SUPV_MISSING_ACK";
|
||||||
|
const char *SUPV_MISSING_EXE_STRING = "SUPV_MISSING_EXE";
|
||||||
|
const char *SUPV_ACK_FAILURE_REPORT_STRING = "SUPV_ACK_FAILURE_REPORT";
|
||||||
|
const char *SUPV_EXE_FAILURE_REPORT_STRING = "SUPV_EXE_FAILURE_REPORT";
|
||||||
|
const char *SUPV_ACK_INVALID_APID_STRING = "SUPV_ACK_INVALID_APID";
|
||||||
|
const char *SUPV_EXE_INVALID_APID_STRING = "SUPV_EXE_INVALID_APID";
|
||||||
|
const char *ACK_RECEPTION_FAILURE_STRING = "ACK_RECEPTION_FAILURE";
|
||||||
|
const char *EXE_RECEPTION_FAILURE_STRING = "EXE_RECEPTION_FAILURE";
|
||||||
|
const char *WRITE_MEMORY_FAILED_STRING = "WRITE_MEMORY_FAILED";
|
||||||
const char *ALLOC_FAILURE_STRING = "ALLOC_FAILURE";
|
const char *ALLOC_FAILURE_STRING = "ALLOC_FAILURE";
|
||||||
const char *REBOOT_SW_STRING = "REBOOT_SW";
|
const char *REBOOT_SW_STRING = "REBOOT_SW";
|
||||||
const char *REBOOT_MECHANISM_TRIGGERED_STRING = "REBOOT_MECHANISM_TRIGGERED";
|
const char *REBOOT_MECHANISM_TRIGGERED_STRING = "REBOOT_MECHANISM_TRIGGERED";
|
||||||
@ -362,11 +381,17 @@ const char *translateEvents(Event event) {
|
|||||||
case (11401):
|
case (11401):
|
||||||
return GPIO_PULL_LOW_FAILED_STRING;
|
return GPIO_PULL_LOW_FAILED_STRING;
|
||||||
case (11402):
|
case (11402):
|
||||||
return SWITCH_ALREADY_ON_STRING;
|
return HEATER_WENT_ON_STRING;
|
||||||
case (11403):
|
case (11403):
|
||||||
return SWITCH_ALREADY_OFF_STRING;
|
return HEATER_WENT_OFF_STRING;
|
||||||
case (11404):
|
case (11404):
|
||||||
|
return SWITCH_ALREADY_ON_STRING;
|
||||||
|
case (11405):
|
||||||
|
return SWITCH_ALREADY_OFF_STRING;
|
||||||
|
case (11406):
|
||||||
return MAIN_SWITCH_TIMEOUT_STRING;
|
return MAIN_SWITCH_TIMEOUT_STRING;
|
||||||
|
case (11407):
|
||||||
|
return FAULTY_HEATER_WAS_ON_STRING;
|
||||||
case (11500):
|
case (11500):
|
||||||
return MAIN_SWITCH_ON_TIMEOUT_STRING;
|
return MAIN_SWITCH_ON_TIMEOUT_STRING;
|
||||||
case (11501):
|
case (11501):
|
||||||
@ -386,7 +411,7 @@ const char *translateEvents(Event event) {
|
|||||||
case (11604):
|
case (11604):
|
||||||
return MPSOC_HANDLER_CRC_FAILURE_STRING;
|
return MPSOC_HANDLER_CRC_FAILURE_STRING;
|
||||||
case (11605):
|
case (11605):
|
||||||
return MPSOC_HANDLER_SEQ_CNT_MISMATCH_STRING;
|
return MPSOC_HANDLER_SEQUENCE_COUNT_MISMATCH_STRING;
|
||||||
case (11606):
|
case (11606):
|
||||||
return MPSOC_SHUTDOWN_FAILED_STRING;
|
return MPSOC_SHUTDOWN_FAILED_STRING;
|
||||||
case (11701):
|
case (11701):
|
||||||
@ -407,6 +432,8 @@ const char *translateEvents(Event event) {
|
|||||||
return INVALID_ERROR_BYTE_STRING;
|
return INVALID_ERROR_BYTE_STRING;
|
||||||
case (11801):
|
case (11801):
|
||||||
return ERROR_STATE_STRING;
|
return ERROR_STATE_STRING;
|
||||||
|
case (11802):
|
||||||
|
return RESET_OCCURED_STRING;
|
||||||
case (11901):
|
case (11901):
|
||||||
return BOOTING_FIRMWARE_FAILED_STRING;
|
return BOOTING_FIRMWARE_FAILED_STRING;
|
||||||
case (11902):
|
case (11902):
|
||||||
@ -419,22 +446,12 @@ const char *translateEvents(Event event) {
|
|||||||
return SUPV_EXE_FAILURE_STRING;
|
return SUPV_EXE_FAILURE_STRING;
|
||||||
case (12004):
|
case (12004):
|
||||||
return SUPV_CRC_FAILURE_EVENT_STRING;
|
return SUPV_CRC_FAILURE_EVENT_STRING;
|
||||||
|
case (12005):
|
||||||
|
return SUPV_MPSOC_SHUWDOWN_BUILD_FAILED_STRING;
|
||||||
case (12100):
|
case (12100):
|
||||||
return SANITIZATION_FAILED_STRING;
|
return SANITIZATION_FAILED_STRING;
|
||||||
case (12101):
|
case (12101):
|
||||||
return MOUNTED_SD_CARD_STRING;
|
return MOUNTED_SD_CARD_STRING;
|
||||||
case (12200):
|
|
||||||
return UPDATE_FILE_NOT_EXISTS_STRING;
|
|
||||||
case (12201):
|
|
||||||
return ACTION_COMMANDING_FAILED_STRING;
|
|
||||||
case (12202):
|
|
||||||
return UPDATE_AVAILABLE_FAILED_STRING;
|
|
||||||
case (12203):
|
|
||||||
return UPDATE_TRANSFER_FAILED_STRING;
|
|
||||||
case (12204):
|
|
||||||
return UPDATE_VERIFY_FAILED_STRING;
|
|
||||||
case (12205):
|
|
||||||
return UPDATE_FINISHED_STRING;
|
|
||||||
case (12300):
|
case (12300):
|
||||||
return SEND_MRAM_DUMP_FAILED_STRING;
|
return SEND_MRAM_DUMP_FAILED_STRING;
|
||||||
case (12301):
|
case (12301):
|
||||||
@ -488,23 +505,23 @@ const char *translateEvents(Event event) {
|
|||||||
case (12601):
|
case (12601):
|
||||||
return MPSOC_FLASH_WRITE_SUCCESSFUL_STRING;
|
return MPSOC_FLASH_WRITE_SUCCESSFUL_STRING;
|
||||||
case (12602):
|
case (12602):
|
||||||
return SENDING_COMMAND_FAILED_STRING;
|
return MPSOC_SENDING_COMMAND_FAILED_STRING;
|
||||||
case (12603):
|
case (12603):
|
||||||
return MPSOC_HELPER_REQUESTING_REPLY_FAILED_STRING;
|
return MPSOC_HELPER_REQUESTING_REPLY_FAILED_STRING;
|
||||||
case (12604):
|
case (12604):
|
||||||
return MPSOC_HELPER_READING_REPLY_FAILED_STRING;
|
return MPSOC_HELPER_READING_REPLY_FAILED_STRING;
|
||||||
case (12605):
|
case (12605):
|
||||||
return MISSING_ACK_STRING;
|
return MPSOC_MISSING_ACK_STRING;
|
||||||
case (12606):
|
case (12606):
|
||||||
return MISSING_EXE_STRING;
|
return MPSOC_MISSING_EXE_STRING;
|
||||||
case (12607):
|
case (12607):
|
||||||
return ACK_FAILURE_REPORT_STRING;
|
return MPSOC_ACK_FAILURE_REPORT_STRING;
|
||||||
case (12608):
|
case (12608):
|
||||||
return EXE_FAILURE_REPORT_STRING;
|
return MPSOC_EXE_FAILURE_REPORT_STRING;
|
||||||
case (12609):
|
case (12609):
|
||||||
return ACK_INVALID_APID_STRING;
|
return MPSOC_ACK_INVALID_APID_STRING;
|
||||||
case (12610):
|
case (12610):
|
||||||
return EXE_INVALID_APID_STRING;
|
return MPSOC_EXE_INVALID_APID_STRING;
|
||||||
case (12611):
|
case (12611):
|
||||||
return MPSOC_HELPER_SEQ_CNT_MISMATCH_STRING;
|
return MPSOC_HELPER_SEQ_CNT_MISMATCH_STRING;
|
||||||
case (12700):
|
case (12700):
|
||||||
@ -550,12 +567,52 @@ const char *translateEvents(Event event) {
|
|||||||
case (13202):
|
case (13202):
|
||||||
return BATT_MODE_CHANGED_STRING;
|
return BATT_MODE_CHANGED_STRING;
|
||||||
case (13600):
|
case (13600):
|
||||||
return ALLOC_FAILURE_STRING;
|
return SUPV_UPDATE_FAILED_STRING;
|
||||||
case (13601):
|
case (13601):
|
||||||
return REBOOT_SW_STRING;
|
return SUPV_UPDATE_SUCCESSFUL_STRING;
|
||||||
case (13602):
|
case (13602):
|
||||||
return REBOOT_MECHANISM_TRIGGERED_STRING;
|
return SUPV_CONTINUE_UPDATE_FAILED_STRING;
|
||||||
case (13603):
|
case (13603):
|
||||||
|
return SUPV_CONTINUE_UPDATE_SUCCESSFUL_STRING;
|
||||||
|
case (13604):
|
||||||
|
return TERMINATED_UPDATE_PROCEDURE_STRING;
|
||||||
|
case (13605):
|
||||||
|
return SUPV_EVENT_BUFFER_REQUEST_SUCCESSFUL_STRING;
|
||||||
|
case (13606):
|
||||||
|
return SUPV_EVENT_BUFFER_REQUEST_FAILED_STRING;
|
||||||
|
case (13607):
|
||||||
|
return SUPV_EVENT_BUFFER_REQUEST_TERMINATED_STRING;
|
||||||
|
case (13608):
|
||||||
|
return SUPV_SENDING_COMMAND_FAILED_STRING;
|
||||||
|
case (13609):
|
||||||
|
return SUPV_HELPER_REQUESTING_REPLY_FAILED_STRING;
|
||||||
|
case (13610):
|
||||||
|
return SUPV_HELPER_READING_REPLY_FAILED_STRING;
|
||||||
|
case (13611):
|
||||||
|
return SUPV_MISSING_ACK_STRING;
|
||||||
|
case (13612):
|
||||||
|
return SUPV_MISSING_EXE_STRING;
|
||||||
|
case (13613):
|
||||||
|
return SUPV_ACK_FAILURE_REPORT_STRING;
|
||||||
|
case (13614):
|
||||||
|
return SUPV_EXE_FAILURE_REPORT_STRING;
|
||||||
|
case (13615):
|
||||||
|
return SUPV_ACK_INVALID_APID_STRING;
|
||||||
|
case (13616):
|
||||||
|
return SUPV_EXE_INVALID_APID_STRING;
|
||||||
|
case (13617):
|
||||||
|
return ACK_RECEPTION_FAILURE_STRING;
|
||||||
|
case (13618):
|
||||||
|
return EXE_RECEPTION_FAILURE_STRING;
|
||||||
|
case (13619):
|
||||||
|
return WRITE_MEMORY_FAILED_STRING;
|
||||||
|
case (13700):
|
||||||
|
return ALLOC_FAILURE_STRING;
|
||||||
|
case (13701):
|
||||||
|
return REBOOT_SW_STRING;
|
||||||
|
case (13702):
|
||||||
|
return REBOOT_MECHANISM_TRIGGERED_STRING;
|
||||||
|
case (13703):
|
||||||
return REBOOT_HW_STRING;
|
return REBOOT_HW_STRING;
|
||||||
default:
|
default:
|
||||||
return "UNKNOWN_EVENT";
|
return "UNKNOWN_EVENT";
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* @brief Auto-generated object translation file.
|
* @brief Auto-generated object translation file.
|
||||||
* @details
|
* @details
|
||||||
* Contains 117 translations.
|
* Contains 131 translations.
|
||||||
* Generated on: 2022-05-03 16:32:00
|
* Generated on: 2022-05-23 16:46:58
|
||||||
*/
|
*/
|
||||||
#include "translateObjects.h"
|
#include "translateObjects.h"
|
||||||
|
|
||||||
@ -12,18 +12,18 @@ const char *ACS_CONTROLLER_STRING = "ACS_CONTROLLER";
|
|||||||
const char *THERMAL_CONTROLLER_STRING = "THERMAL_CONTROLLER";
|
const char *THERMAL_CONTROLLER_STRING = "THERMAL_CONTROLLER";
|
||||||
const char *MGM_0_LIS3_HANDLER_STRING = "MGM_0_LIS3_HANDLER";
|
const char *MGM_0_LIS3_HANDLER_STRING = "MGM_0_LIS3_HANDLER";
|
||||||
const char *GYRO_0_ADIS_HANDLER_STRING = "GYRO_0_ADIS_HANDLER";
|
const char *GYRO_0_ADIS_HANDLER_STRING = "GYRO_0_ADIS_HANDLER";
|
||||||
const char *SUS_0_STRING = "SUS_0";
|
const char *SUS_0_N_LOC_XFYFZM_PT_XF_STRING = "SUS_0_N_LOC_XFYFZM_PT_XF";
|
||||||
const char *SUS_1_STRING = "SUS_1";
|
const char *SUS_1_N_LOC_XBYFZM_PT_XB_STRING = "SUS_1_N_LOC_XBYFZM_PT_XB";
|
||||||
const char *SUS_2_STRING = "SUS_2";
|
const char *SUS_2_N_LOC_XFYBZB_PT_YB_STRING = "SUS_2_N_LOC_XFYBZB_PT_YB";
|
||||||
const char *SUS_3_STRING = "SUS_3";
|
const char *SUS_3_N_LOC_XFYBZF_PT_YF_STRING = "SUS_3_N_LOC_XFYBZF_PT_YF";
|
||||||
const char *SUS_4_STRING = "SUS_4";
|
const char *SUS_4_N_LOC_XMYFZF_PT_ZF_STRING = "SUS_4_N_LOC_XMYFZF_PT_ZF";
|
||||||
const char *SUS_5_STRING = "SUS_5";
|
const char *SUS_5_N_LOC_XFYMZB_PT_ZB_STRING = "SUS_5_N_LOC_XFYMZB_PT_ZB";
|
||||||
const char *SUS_6_STRING = "SUS_6";
|
const char *SUS_6_R_LOC_XFYBZM_PT_XF_STRING = "SUS_6_R_LOC_XFYBZM_PT_XF";
|
||||||
const char *SUS_7_STRING = "SUS_7";
|
const char *SUS_7_R_LOC_XBYBZM_PT_XB_STRING = "SUS_7_R_LOC_XBYBZM_PT_XB";
|
||||||
const char *SUS_8_STRING = "SUS_8";
|
const char *SUS_8_R_LOC_XBYBZB_PT_YB_STRING = "SUS_8_R_LOC_XBYBZB_PT_YB";
|
||||||
const char *SUS_9_STRING = "SUS_9";
|
const char *SUS_9_R_LOC_XBYBZB_PT_YF_STRING = "SUS_9_R_LOC_XBYBZB_PT_YF";
|
||||||
const char *SUS_10_STRING = "SUS_10";
|
const char *SUS_10_N_LOC_XMYBZF_PT_ZF_STRING = "SUS_10_N_LOC_XMYBZF_PT_ZF";
|
||||||
const char *SUS_11_STRING = "SUS_11";
|
const char *SUS_11_R_LOC_XBYMZB_PT_ZB_STRING = "SUS_11_R_LOC_XBYMZB_PT_ZB";
|
||||||
const char *RW1_STRING = "RW1";
|
const char *RW1_STRING = "RW1";
|
||||||
const char *MGM_1_RM3100_HANDLER_STRING = "MGM_1_RM3100_HANDLER";
|
const char *MGM_1_RM3100_HANDLER_STRING = "MGM_1_RM3100_HANDLER";
|
||||||
const char *GYRO_1_L3G_HANDLER_STRING = "GYRO_1_L3G_HANDLER";
|
const char *GYRO_1_L3G_HANDLER_STRING = "GYRO_1_L3G_HANDLER";
|
||||||
@ -49,6 +49,8 @@ const char *PLOC_UPDATER_STRING = "PLOC_UPDATER";
|
|||||||
const char *PLOC_MEMORY_DUMPER_STRING = "PLOC_MEMORY_DUMPER";
|
const char *PLOC_MEMORY_DUMPER_STRING = "PLOC_MEMORY_DUMPER";
|
||||||
const char *STR_HELPER_STRING = "STR_HELPER";
|
const char *STR_HELPER_STRING = "STR_HELPER";
|
||||||
const char *PLOC_MPSOC_HELPER_STRING = "PLOC_MPSOC_HELPER";
|
const char *PLOC_MPSOC_HELPER_STRING = "PLOC_MPSOC_HELPER";
|
||||||
|
const char *AXI_PTME_CONFIG_STRING = "AXI_PTME_CONFIG";
|
||||||
|
const char *PTME_CONFIG_STRING = "PTME_CONFIG";
|
||||||
const char *PLOC_MPSOC_HANDLER_STRING = "PLOC_MPSOC_HANDLER";
|
const char *PLOC_MPSOC_HANDLER_STRING = "PLOC_MPSOC_HANDLER";
|
||||||
const char *PLOC_SUPERVISOR_HANDLER_STRING = "PLOC_SUPERVISOR_HANDLER";
|
const char *PLOC_SUPERVISOR_HANDLER_STRING = "PLOC_SUPERVISOR_HANDLER";
|
||||||
const char *PLOC_SUPERVISOR_HELPER_STRING = "PLOC_SUPERVISOR_HELPER";
|
const char *PLOC_SUPERVISOR_HELPER_STRING = "PLOC_SUPERVISOR_HELPER";
|
||||||
@ -56,26 +58,28 @@ const char *SOLAR_ARRAY_DEPL_HANDLER_STRING = "SOLAR_ARRAY_DEPL_HANDLER";
|
|||||||
const char *HEATER_HANDLER_STRING = "HEATER_HANDLER";
|
const char *HEATER_HANDLER_STRING = "HEATER_HANDLER";
|
||||||
const char *TMP1075_HANDLER_1_STRING = "TMP1075_HANDLER_1";
|
const char *TMP1075_HANDLER_1_STRING = "TMP1075_HANDLER_1";
|
||||||
const char *TMP1075_HANDLER_2_STRING = "TMP1075_HANDLER_2";
|
const char *TMP1075_HANDLER_2_STRING = "TMP1075_HANDLER_2";
|
||||||
const char *RTD_IC_3_STRING = "RTD_IC_3";
|
const char *RTD_0_IC3_PLOC_HEATSPREADER_STRING = "RTD_0_IC3_PLOC_HEATSPREADER";
|
||||||
const char *RTD_IC_4_STRING = "RTD_IC_4";
|
const char *RTD_1_IC4_PLOC_MISSIONBOARD_STRING = "RTD_1_IC4_PLOC_MISSIONBOARD";
|
||||||
const char *RTD_IC_5_STRING = "RTD_IC_5";
|
const char *RTD_2_IC5_4K_CAMERA_STRING = "RTD_2_IC5_4K_CAMERA";
|
||||||
const char *RTD_IC_6_STRING = "RTD_IC_6";
|
const char *RTD_3_IC6_DAC_HEATSPREADER_STRING = "RTD_3_IC6_DAC_HEATSPREADER";
|
||||||
const char *RTD_IC_7_STRING = "RTD_IC_7";
|
const char *RTD_4_IC7_STARTRACKER_STRING = "RTD_4_IC7_STARTRACKER";
|
||||||
const char *RTD_IC_8_STRING = "RTD_IC_8";
|
const char *RTD_5_IC8_RW1_MX_MY_STRING = "RTD_5_IC8_RW1_MX_MY";
|
||||||
const char *RTD_IC_9_STRING = "RTD_IC_9";
|
const char *RTD_6_IC9_DRO_STRING = "RTD_6_IC9_DRO";
|
||||||
const char *RTD_IC_10_STRING = "RTD_IC_10";
|
const char *RTD_7_IC10_SCEX_STRING = "RTD_7_IC10_SCEX";
|
||||||
const char *RTD_IC_11_STRING = "RTD_IC_11";
|
const char *RTD_8_IC11_X8_STRING = "RTD_8_IC11_X8";
|
||||||
const char *RTD_IC_12_STRING = "RTD_IC_12";
|
const char *RTD_9_IC12_HPA_STRING = "RTD_9_IC12_HPA";
|
||||||
const char *RTD_IC_13_STRING = "RTD_IC_13";
|
const char *RTD_10_IC13_PL_TX_STRING = "RTD_10_IC13_PL_TX";
|
||||||
const char *RTD_IC_14_STRING = "RTD_IC_14";
|
const char *RTD_11_IC14_MPA_STRING = "RTD_11_IC14_MPA";
|
||||||
const char *RTD_IC_15_STRING = "RTD_IC_15";
|
const char *RTD_12_IC15_ACU_STRING = "RTD_12_IC15_ACU";
|
||||||
const char *RTD_IC_16_STRING = "RTD_IC_16";
|
const char *RTD_13_IC16_PLPCDU_HEATSPREADER_STRING = "RTD_13_IC16_PLPCDU_HEATSPREADER";
|
||||||
const char *RTD_IC_17_STRING = "RTD_IC_17";
|
const char *RTD_14_IC17_TCS_BOARD_STRING = "RTD_14_IC17_TCS_BOARD";
|
||||||
const char *RTD_IC_18_STRING = "RTD_IC_18";
|
const char *RTD_15_IC18_IMTQ_STRING = "RTD_15_IC18_IMTQ";
|
||||||
const char *SYRLINKS_HK_HANDLER_STRING = "SYRLINKS_HK_HANDLER";
|
const char *SYRLINKS_HK_HANDLER_STRING = "SYRLINKS_HK_HANDLER";
|
||||||
const char *ARDUINO_COM_IF_STRING = "ARDUINO_COM_IF";
|
const char *ARDUINO_COM_IF_STRING = "ARDUINO_COM_IF";
|
||||||
const char *GPIO_IF_STRING = "GPIO_IF";
|
const char *GPIO_IF_STRING = "GPIO_IF";
|
||||||
const char *SPI_COM_IF_STRING = "SPI_COM_IF";
|
const char *SPI_MAIN_COM_IF_STRING = "SPI_MAIN_COM_IF";
|
||||||
|
const char *SPI_RW_COM_IF_STRING = "SPI_RW_COM_IF";
|
||||||
|
const char *SPI_RTD_COM_IF_STRING = "SPI_RTD_COM_IF";
|
||||||
const char *UART_COM_IF_STRING = "UART_COM_IF";
|
const char *UART_COM_IF_STRING = "UART_COM_IF";
|
||||||
const char *I2C_COM_IF_STRING = "I2C_COM_IF";
|
const char *I2C_COM_IF_STRING = "I2C_COM_IF";
|
||||||
const char *CSP_COM_IF_STRING = "CSP_COM_IF";
|
const char *CSP_COM_IF_STRING = "CSP_COM_IF";
|
||||||
@ -96,6 +100,7 @@ const char *PUS_SERVICE_3_HOUSEKEEPING_STRING = "PUS_SERVICE_3_HOUSEKEEPING";
|
|||||||
const char *PUS_SERVICE_5_EVENT_REPORTING_STRING = "PUS_SERVICE_5_EVENT_REPORTING";
|
const char *PUS_SERVICE_5_EVENT_REPORTING_STRING = "PUS_SERVICE_5_EVENT_REPORTING";
|
||||||
const char *PUS_SERVICE_8_FUNCTION_MGMT_STRING = "PUS_SERVICE_8_FUNCTION_MGMT";
|
const char *PUS_SERVICE_8_FUNCTION_MGMT_STRING = "PUS_SERVICE_8_FUNCTION_MGMT";
|
||||||
const char *PUS_SERVICE_9_TIME_MGMT_STRING = "PUS_SERVICE_9_TIME_MGMT";
|
const char *PUS_SERVICE_9_TIME_MGMT_STRING = "PUS_SERVICE_9_TIME_MGMT";
|
||||||
|
const char *PUS_SERVICE_11_TC_SCHEDULER_STRING = "PUS_SERVICE_11_TC_SCHEDULER";
|
||||||
const char *PUS_SERVICE_17_TEST_STRING = "PUS_SERVICE_17_TEST";
|
const char *PUS_SERVICE_17_TEST_STRING = "PUS_SERVICE_17_TEST";
|
||||||
const char *PUS_SERVICE_20_PARAMETERS_STRING = "PUS_SERVICE_20_PARAMETERS";
|
const char *PUS_SERVICE_20_PARAMETERS_STRING = "PUS_SERVICE_20_PARAMETERS";
|
||||||
const char *PUS_SERVICE_200_MODE_MGMT_STRING = "PUS_SERVICE_200_MODE_MGMT";
|
const char *PUS_SERVICE_200_MODE_MGMT_STRING = "PUS_SERVICE_200_MODE_MGMT";
|
||||||
@ -117,9 +122,18 @@ const char *DUMMY_HANDLER_STRING = "DUMMY_HANDLER";
|
|||||||
const char *DUMMY_INTERFACE_STRING = "DUMMY_INTERFACE";
|
const char *DUMMY_INTERFACE_STRING = "DUMMY_INTERFACE";
|
||||||
const char *LIBGPIOD_TEST_STRING = "LIBGPIOD_TEST";
|
const char *LIBGPIOD_TEST_STRING = "LIBGPIOD_TEST";
|
||||||
const char *TEST_TASK_STRING = "TEST_TASK";
|
const char *TEST_TASK_STRING = "TEST_TASK";
|
||||||
|
const char *HEATER_0_PLOC_PROC_BRD_STRING = "HEATER_0_PLOC_PROC_BRD";
|
||||||
|
const char *HEATER_1_PCDU_BRD_STRING = "HEATER_1_PCDU_BRD";
|
||||||
|
const char *HEATER_2_ACS_BRD_STRING = "HEATER_2_ACS_BRD";
|
||||||
|
const char *HEATER_3_OBC_BRD_STRING = "HEATER_3_OBC_BRD";
|
||||||
|
const char *HEATER_4_CAMERA_STRING = "HEATER_4_CAMERA";
|
||||||
|
const char *HEATER_5_STR_STRING = "HEATER_5_STR";
|
||||||
|
const char *HEATER_6_DRO_STRING = "HEATER_6_DRO";
|
||||||
|
const char *HEATER_7_HPA_STRING = "HEATER_7_HPA";
|
||||||
const char *ACS_BOARD_ASS_STRING = "ACS_BOARD_ASS";
|
const char *ACS_BOARD_ASS_STRING = "ACS_BOARD_ASS";
|
||||||
const char *SUS_BOARD_ASS_STRING = "SUS_BOARD_ASS";
|
const char *SUS_BOARD_ASS_STRING = "SUS_BOARD_ASS";
|
||||||
const char *TCS_BOARD_ASS_STRING = "TCS_BOARD_ASS";
|
const char *TCS_BOARD_ASS_STRING = "TCS_BOARD_ASS";
|
||||||
|
const char *RW_ASS_STRING = "RW_ASS";
|
||||||
const char *TM_FUNNEL_STRING = "TM_FUNNEL";
|
const char *TM_FUNNEL_STRING = "TM_FUNNEL";
|
||||||
const char *CCSDS_IP_CORE_BRIDGE_STRING = "CCSDS_IP_CORE_BRIDGE";
|
const char *CCSDS_IP_CORE_BRIDGE_STRING = "CCSDS_IP_CORE_BRIDGE";
|
||||||
const char *NO_OBJECT_STRING = "NO_OBJECT";
|
const char *NO_OBJECT_STRING = "NO_OBJECT";
|
||||||
@ -139,29 +153,29 @@ const char *translateObject(object_id_t object) {
|
|||||||
case 0x44120010:
|
case 0x44120010:
|
||||||
return GYRO_0_ADIS_HANDLER_STRING;
|
return GYRO_0_ADIS_HANDLER_STRING;
|
||||||
case 0x44120032:
|
case 0x44120032:
|
||||||
return SUS_0_STRING;
|
return SUS_0_N_LOC_XFYFZM_PT_XF_STRING;
|
||||||
case 0x44120033:
|
case 0x44120033:
|
||||||
return SUS_1_STRING;
|
return SUS_1_N_LOC_XBYFZM_PT_XB_STRING;
|
||||||
case 0x44120034:
|
case 0x44120034:
|
||||||
return SUS_2_STRING;
|
return SUS_2_N_LOC_XFYBZB_PT_YB_STRING;
|
||||||
case 0x44120035:
|
case 0x44120035:
|
||||||
return SUS_3_STRING;
|
return SUS_3_N_LOC_XFYBZF_PT_YF_STRING;
|
||||||
case 0x44120036:
|
case 0x44120036:
|
||||||
return SUS_4_STRING;
|
return SUS_4_N_LOC_XMYFZF_PT_ZF_STRING;
|
||||||
case 0x44120037:
|
case 0x44120037:
|
||||||
return SUS_5_STRING;
|
return SUS_5_N_LOC_XFYMZB_PT_ZB_STRING;
|
||||||
case 0x44120038:
|
case 0x44120038:
|
||||||
return SUS_6_STRING;
|
return SUS_6_R_LOC_XFYBZM_PT_XF_STRING;
|
||||||
case 0x44120039:
|
case 0x44120039:
|
||||||
return SUS_7_STRING;
|
return SUS_7_R_LOC_XBYBZM_PT_XB_STRING;
|
||||||
case 0x44120040:
|
case 0x44120040:
|
||||||
return SUS_8_STRING;
|
return SUS_8_R_LOC_XBYBZB_PT_YB_STRING;
|
||||||
case 0x44120041:
|
case 0x44120041:
|
||||||
return SUS_9_STRING;
|
return SUS_9_R_LOC_XBYBZB_PT_YF_STRING;
|
||||||
case 0x44120042:
|
case 0x44120042:
|
||||||
return SUS_10_STRING;
|
return SUS_10_N_LOC_XMYBZF_PT_ZF_STRING;
|
||||||
case 0x44120043:
|
case 0x44120043:
|
||||||
return SUS_11_STRING;
|
return SUS_11_R_LOC_XBYMZB_PT_ZB_STRING;
|
||||||
case 0x44120047:
|
case 0x44120047:
|
||||||
return RW1_STRING;
|
return RW1_STRING;
|
||||||
case 0x44120107:
|
case 0x44120107:
|
||||||
@ -212,6 +226,10 @@ const char *translateObject(object_id_t object) {
|
|||||||
return STR_HELPER_STRING;
|
return STR_HELPER_STRING;
|
||||||
case 0x44330003:
|
case 0x44330003:
|
||||||
return PLOC_MPSOC_HELPER_STRING;
|
return PLOC_MPSOC_HELPER_STRING;
|
||||||
|
case 0x44330004:
|
||||||
|
return AXI_PTME_CONFIG_STRING;
|
||||||
|
case 0x44330005:
|
||||||
|
return PTME_CONFIG_STRING;
|
||||||
case 0x44330015:
|
case 0x44330015:
|
||||||
return PLOC_MPSOC_HANDLER_STRING;
|
return PLOC_MPSOC_HANDLER_STRING;
|
||||||
case 0x44330016:
|
case 0x44330016:
|
||||||
@ -227,37 +245,37 @@ const char *translateObject(object_id_t object) {
|
|||||||
case 0x44420005:
|
case 0x44420005:
|
||||||
return TMP1075_HANDLER_2_STRING;
|
return TMP1075_HANDLER_2_STRING;
|
||||||
case 0x44420016:
|
case 0x44420016:
|
||||||
return RTD_IC_3_STRING;
|
return RTD_0_IC3_PLOC_HEATSPREADER_STRING;
|
||||||
case 0x44420017:
|
case 0x44420017:
|
||||||
return RTD_IC_4_STRING;
|
return RTD_1_IC4_PLOC_MISSIONBOARD_STRING;
|
||||||
case 0x44420018:
|
case 0x44420018:
|
||||||
return RTD_IC_5_STRING;
|
return RTD_2_IC5_4K_CAMERA_STRING;
|
||||||
case 0x44420019:
|
case 0x44420019:
|
||||||
return RTD_IC_6_STRING;
|
return RTD_3_IC6_DAC_HEATSPREADER_STRING;
|
||||||
case 0x44420020:
|
case 0x44420020:
|
||||||
return RTD_IC_7_STRING;
|
return RTD_4_IC7_STARTRACKER_STRING;
|
||||||
case 0x44420021:
|
case 0x44420021:
|
||||||
return RTD_IC_8_STRING;
|
return RTD_5_IC8_RW1_MX_MY_STRING;
|
||||||
case 0x44420022:
|
case 0x44420022:
|
||||||
return RTD_IC_9_STRING;
|
return RTD_6_IC9_DRO_STRING;
|
||||||
case 0x44420023:
|
case 0x44420023:
|
||||||
return RTD_IC_10_STRING;
|
return RTD_7_IC10_SCEX_STRING;
|
||||||
case 0x44420024:
|
case 0x44420024:
|
||||||
return RTD_IC_11_STRING;
|
return RTD_8_IC11_X8_STRING;
|
||||||
case 0x44420025:
|
case 0x44420025:
|
||||||
return RTD_IC_12_STRING;
|
return RTD_9_IC12_HPA_STRING;
|
||||||
case 0x44420026:
|
case 0x44420026:
|
||||||
return RTD_IC_13_STRING;
|
return RTD_10_IC13_PL_TX_STRING;
|
||||||
case 0x44420027:
|
case 0x44420027:
|
||||||
return RTD_IC_14_STRING;
|
return RTD_11_IC14_MPA_STRING;
|
||||||
case 0x44420028:
|
case 0x44420028:
|
||||||
return RTD_IC_15_STRING;
|
return RTD_12_IC15_ACU_STRING;
|
||||||
case 0x44420029:
|
case 0x44420029:
|
||||||
return RTD_IC_16_STRING;
|
return RTD_13_IC16_PLPCDU_HEATSPREADER_STRING;
|
||||||
case 0x44420030:
|
case 0x44420030:
|
||||||
return RTD_IC_17_STRING;
|
return RTD_14_IC17_TCS_BOARD_STRING;
|
||||||
case 0x44420031:
|
case 0x44420031:
|
||||||
return RTD_IC_18_STRING;
|
return RTD_15_IC18_IMTQ_STRING;
|
||||||
case 0x445300A3:
|
case 0x445300A3:
|
||||||
return SYRLINKS_HK_HANDLER_STRING;
|
return SYRLINKS_HK_HANDLER_STRING;
|
||||||
case 0x49000000:
|
case 0x49000000:
|
||||||
@ -265,7 +283,11 @@ const char *translateObject(object_id_t object) {
|
|||||||
case 0x49010005:
|
case 0x49010005:
|
||||||
return GPIO_IF_STRING;
|
return GPIO_IF_STRING;
|
||||||
case 0x49020004:
|
case 0x49020004:
|
||||||
return SPI_COM_IF_STRING;
|
return SPI_MAIN_COM_IF_STRING;
|
||||||
|
case 0x49020005:
|
||||||
|
return SPI_RW_COM_IF_STRING;
|
||||||
|
case 0x49020006:
|
||||||
|
return SPI_RTD_COM_IF_STRING;
|
||||||
case 0x49030003:
|
case 0x49030003:
|
||||||
return UART_COM_IF_STRING;
|
return UART_COM_IF_STRING;
|
||||||
case 0x49040002:
|
case 0x49040002:
|
||||||
@ -306,6 +328,8 @@ const char *translateObject(object_id_t object) {
|
|||||||
return PUS_SERVICE_8_FUNCTION_MGMT_STRING;
|
return PUS_SERVICE_8_FUNCTION_MGMT_STRING;
|
||||||
case 0x53000009:
|
case 0x53000009:
|
||||||
return PUS_SERVICE_9_TIME_MGMT_STRING;
|
return PUS_SERVICE_9_TIME_MGMT_STRING;
|
||||||
|
case 0x53000011:
|
||||||
|
return PUS_SERVICE_11_TC_SCHEDULER_STRING;
|
||||||
case 0x53000017:
|
case 0x53000017:
|
||||||
return PUS_SERVICE_17_TEST_STRING;
|
return PUS_SERVICE_17_TEST_STRING;
|
||||||
case 0x53000020:
|
case 0x53000020:
|
||||||
@ -348,12 +372,30 @@ const char *translateObject(object_id_t object) {
|
|||||||
return LIBGPIOD_TEST_STRING;
|
return LIBGPIOD_TEST_STRING;
|
||||||
case 0x54694269:
|
case 0x54694269:
|
||||||
return TEST_TASK_STRING;
|
return TEST_TASK_STRING;
|
||||||
|
case 0x60000000:
|
||||||
|
return HEATER_0_PLOC_PROC_BRD_STRING;
|
||||||
|
case 0x60000001:
|
||||||
|
return HEATER_1_PCDU_BRD_STRING;
|
||||||
|
case 0x60000002:
|
||||||
|
return HEATER_2_ACS_BRD_STRING;
|
||||||
|
case 0x60000003:
|
||||||
|
return HEATER_3_OBC_BRD_STRING;
|
||||||
|
case 0x60000004:
|
||||||
|
return HEATER_4_CAMERA_STRING;
|
||||||
|
case 0x60000005:
|
||||||
|
return HEATER_5_STR_STRING;
|
||||||
|
case 0x60000006:
|
||||||
|
return HEATER_6_DRO_STRING;
|
||||||
|
case 0x60000007:
|
||||||
|
return HEATER_7_HPA_STRING;
|
||||||
case 0x73000001:
|
case 0x73000001:
|
||||||
return ACS_BOARD_ASS_STRING;
|
return ACS_BOARD_ASS_STRING;
|
||||||
case 0x73000002:
|
case 0x73000002:
|
||||||
return SUS_BOARD_ASS_STRING;
|
return SUS_BOARD_ASS_STRING;
|
||||||
case 0x73000003:
|
case 0x73000003:
|
||||||
return TCS_BOARD_ASS_STRING;
|
return TCS_BOARD_ASS_STRING;
|
||||||
|
case 0x73000004:
|
||||||
|
return RW_ASS_STRING;
|
||||||
case 0x73000100:
|
case 0x73000100:
|
||||||
return TM_FUNNEL_STRING;
|
return TM_FUNNEL_STRING;
|
||||||
case 0x73500000:
|
case 0x73500000:
|
||||||
|
@ -6,6 +6,4 @@ add_subdirectory(devices)
|
|||||||
add_subdirectory(fsfwconfig)
|
add_subdirectory(fsfwconfig)
|
||||||
add_subdirectory(obc)
|
add_subdirectory(obc)
|
||||||
|
|
||||||
target_sources(${OBSW_NAME} PUBLIC
|
target_sources(${OBSW_NAME} PUBLIC ObjectFactory.cpp)
|
||||||
ObjectFactory.cpp
|
|
||||||
)
|
|
||||||
|
@ -7,6 +7,8 @@
|
|||||||
#include <fsfw_hal/linux/spi/SpiComIF.h>
|
#include <fsfw_hal/linux/spi/SpiComIF.h>
|
||||||
#include <fsfw_hal/linux/spi/SpiCookie.h>
|
#include <fsfw_hal/linux/spi/SpiCookie.h>
|
||||||
#include <linux/callbacks/gpioCallbacks.h>
|
#include <linux/callbacks/gpioCallbacks.h>
|
||||||
|
#include <linux/devices/Max31865RtdLowlevelHandler.h>
|
||||||
|
#include <mission/devices/Max31865EiveHandler.h>
|
||||||
#include <mission/devices/Max31865PT1000Handler.h>
|
#include <mission/devices/Max31865PT1000Handler.h>
|
||||||
#include <mission/devices/SusHandler.h>
|
#include <mission/devices/SusHandler.h>
|
||||||
#include <mission/system/fdir/RtdFdir.h>
|
#include <mission/system/fdir/RtdFdir.h>
|
||||||
@ -62,93 +64,104 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo
|
|||||||
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
|
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
|
||||||
gpioCookieSus->addGpio(gpioIds::CS_SUS_11, susgpio);
|
gpioCookieSus->addGpio(gpioIds::CS_SUS_11, susgpio);
|
||||||
|
|
||||||
gpioComIF->addGpios(gpioCookieSus);
|
gpioChecker(gpioComIF->addGpios(gpioCookieSus), "Sun Sensors");
|
||||||
|
|
||||||
#if OBSW_ADD_SUN_SENSORS == 1
|
#if OBSW_ADD_SUN_SENSORS == 1
|
||||||
SusFdir* fdir = nullptr;
|
SusFdir* fdir = nullptr;
|
||||||
std::array<SusHandler*, 12> susHandlers = {};
|
std::array<SusHandler*, 12> susHandlers = {};
|
||||||
SpiCookie* spiCookie =
|
SpiCookie* spiCookie = new SpiCookie(addresses::SUS_0, gpioIds::CS_SUS_0, SUS::MAX_CMD_SIZE,
|
||||||
new SpiCookie(addresses::SUS_0, gpioIds::CS_SUS_0, spiDev, SUS::MAX_CMD_SIZE,
|
|
||||||
spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
|
spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
|
||||||
susHandlers[0] = new SusHandler(objects::SUS_0, 0, objects::SPI_COM_IF, spiCookie);
|
susHandlers[0] =
|
||||||
fdir = new SusFdir(objects::SUS_0);
|
new SusHandler(objects::SUS_0_N_LOC_XFYFZM_PT_XF, 0, objects::SPI_MAIN_COM_IF, spiCookie);
|
||||||
|
fdir = new SusFdir(objects::SUS_0_N_LOC_XFYFZM_PT_XF);
|
||||||
susHandlers[0]->setParent(objects::SUS_BOARD_ASS);
|
susHandlers[0]->setParent(objects::SUS_BOARD_ASS);
|
||||||
susHandlers[0]->setCustomFdir(fdir);
|
susHandlers[0]->setCustomFdir(fdir);
|
||||||
|
|
||||||
spiCookie = new SpiCookie(addresses::SUS_1, gpioIds::CS_SUS_1, spiDev, SUS::MAX_CMD_SIZE,
|
spiCookie = new SpiCookie(addresses::SUS_1, gpioIds::CS_SUS_1, SUS::MAX_CMD_SIZE,
|
||||||
spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
|
spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
|
||||||
susHandlers[1] = new SusHandler(objects::SUS_1, 1, objects::SPI_COM_IF, spiCookie);
|
susHandlers[1] =
|
||||||
fdir = new SusFdir(objects::SUS_1);
|
new SusHandler(objects::SUS_1_N_LOC_XBYFZM_PT_XB, 1, objects::SPI_MAIN_COM_IF, spiCookie);
|
||||||
|
fdir = new SusFdir(objects::SUS_1_N_LOC_XBYFZM_PT_XB);
|
||||||
susHandlers[1]->setParent(objects::SUS_BOARD_ASS);
|
susHandlers[1]->setParent(objects::SUS_BOARD_ASS);
|
||||||
susHandlers[1]->setCustomFdir(fdir);
|
susHandlers[1]->setCustomFdir(fdir);
|
||||||
|
|
||||||
spiCookie = new SpiCookie(addresses::SUS_2, gpioIds::CS_SUS_2, spiDev, SUS::MAX_CMD_SIZE,
|
spiCookie = new SpiCookie(addresses::SUS_2, gpioIds::CS_SUS_2, SUS::MAX_CMD_SIZE,
|
||||||
spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
|
spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
|
||||||
susHandlers[2] = new SusHandler(objects::SUS_2, 2, objects::SPI_COM_IF, spiCookie);
|
susHandlers[2] =
|
||||||
fdir = new SusFdir(objects::SUS_2);
|
new SusHandler(objects::SUS_2_N_LOC_XFYBZB_PT_YB, 2, objects::SPI_MAIN_COM_IF, spiCookie);
|
||||||
|
fdir = new SusFdir(objects::SUS_2_N_LOC_XFYBZB_PT_YB);
|
||||||
susHandlers[2]->setParent(objects::SUS_BOARD_ASS);
|
susHandlers[2]->setParent(objects::SUS_BOARD_ASS);
|
||||||
susHandlers[2]->setCustomFdir(fdir);
|
susHandlers[2]->setCustomFdir(fdir);
|
||||||
|
|
||||||
spiCookie = new SpiCookie(addresses::SUS_3, gpioIds::CS_SUS_3, spiDev, SUS::MAX_CMD_SIZE,
|
spiCookie = new SpiCookie(addresses::SUS_3, gpioIds::CS_SUS_3, SUS::MAX_CMD_SIZE,
|
||||||
spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
|
spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
|
||||||
susHandlers[3] = new SusHandler(objects::SUS_3, 3, objects::SPI_COM_IF, spiCookie);
|
susHandlers[3] =
|
||||||
fdir = new SusFdir(objects::SUS_3);
|
new SusHandler(objects::SUS_3_N_LOC_XFYBZF_PT_YF, 3, objects::SPI_MAIN_COM_IF, spiCookie);
|
||||||
|
fdir = new SusFdir(objects::SUS_3_N_LOC_XFYBZF_PT_YF);
|
||||||
susHandlers[3]->setParent(objects::SUS_BOARD_ASS);
|
susHandlers[3]->setParent(objects::SUS_BOARD_ASS);
|
||||||
susHandlers[3]->setCustomFdir(fdir);
|
susHandlers[3]->setCustomFdir(fdir);
|
||||||
|
|
||||||
spiCookie = new SpiCookie(addresses::SUS_4, gpioIds::CS_SUS_4, spiDev, SUS::MAX_CMD_SIZE,
|
spiCookie = new SpiCookie(addresses::SUS_4, gpioIds::CS_SUS_4, SUS::MAX_CMD_SIZE,
|
||||||
spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
|
spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
|
||||||
susHandlers[4] = new SusHandler(objects::SUS_4, 4, objects::SPI_COM_IF, spiCookie);
|
susHandlers[4] =
|
||||||
fdir = new SusFdir(objects::SUS_4);
|
new SusHandler(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, 4, objects::SPI_MAIN_COM_IF, spiCookie);
|
||||||
|
fdir = new SusFdir(objects::SUS_4_N_LOC_XMYFZF_PT_ZF);
|
||||||
susHandlers[4]->setParent(objects::SUS_BOARD_ASS);
|
susHandlers[4]->setParent(objects::SUS_BOARD_ASS);
|
||||||
susHandlers[4]->setCustomFdir(fdir);
|
susHandlers[4]->setCustomFdir(fdir);
|
||||||
|
|
||||||
spiCookie = new SpiCookie(addresses::SUS_5, gpioIds::CS_SUS_5, spiDev, SUS::MAX_CMD_SIZE,
|
spiCookie = new SpiCookie(addresses::SUS_5, gpioIds::CS_SUS_5, SUS::MAX_CMD_SIZE,
|
||||||
spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
|
spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
|
||||||
susHandlers[5] = new SusHandler(objects::SUS_5, 5, objects::SPI_COM_IF, spiCookie);
|
susHandlers[5] =
|
||||||
fdir = new SusFdir(objects::SUS_5);
|
new SusHandler(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, 5, objects::SPI_MAIN_COM_IF, spiCookie);
|
||||||
|
fdir = new SusFdir(objects::SUS_5_N_LOC_XFYMZB_PT_ZB);
|
||||||
susHandlers[5]->setParent(objects::SUS_BOARD_ASS);
|
susHandlers[5]->setParent(objects::SUS_BOARD_ASS);
|
||||||
susHandlers[5]->setCustomFdir(fdir);
|
susHandlers[5]->setCustomFdir(fdir);
|
||||||
|
|
||||||
spiCookie = new SpiCookie(addresses::SUS_6, gpioIds::CS_SUS_6, spiDev, SUS::MAX_CMD_SIZE,
|
spiCookie = new SpiCookie(addresses::SUS_6, gpioIds::CS_SUS_6, SUS::MAX_CMD_SIZE,
|
||||||
spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
|
spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
|
||||||
susHandlers[6] = new SusHandler(objects::SUS_6, 6, objects::SPI_COM_IF, spiCookie);
|
susHandlers[6] =
|
||||||
fdir = new SusFdir(objects::SUS_6);
|
new SusHandler(objects::SUS_6_R_LOC_XFYBZM_PT_XF, 6, objects::SPI_MAIN_COM_IF, spiCookie);
|
||||||
|
fdir = new SusFdir(objects::SUS_6_R_LOC_XFYBZM_PT_XF);
|
||||||
susHandlers[6]->setParent(objects::SUS_BOARD_ASS);
|
susHandlers[6]->setParent(objects::SUS_BOARD_ASS);
|
||||||
susHandlers[6]->setCustomFdir(fdir);
|
susHandlers[6]->setCustomFdir(fdir);
|
||||||
|
|
||||||
spiCookie = new SpiCookie(addresses::SUS_7, gpioIds::CS_SUS_7, spiDev, SUS::MAX_CMD_SIZE,
|
spiCookie = new SpiCookie(addresses::SUS_7, gpioIds::CS_SUS_7, SUS::MAX_CMD_SIZE,
|
||||||
spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
|
spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
|
||||||
susHandlers[7] = new SusHandler(objects::SUS_7, 7, objects::SPI_COM_IF, spiCookie);
|
susHandlers[7] =
|
||||||
fdir = new SusFdir(objects::SUS_7);
|
new SusHandler(objects::SUS_7_R_LOC_XBYBZM_PT_XB, 7, objects::SPI_MAIN_COM_IF, spiCookie);
|
||||||
|
fdir = new SusFdir(objects::SUS_7_R_LOC_XBYBZM_PT_XB);
|
||||||
susHandlers[7]->setParent(objects::SUS_BOARD_ASS);
|
susHandlers[7]->setParent(objects::SUS_BOARD_ASS);
|
||||||
susHandlers[7]->setCustomFdir(fdir);
|
susHandlers[7]->setCustomFdir(fdir);
|
||||||
|
|
||||||
spiCookie = new SpiCookie(addresses::SUS_8, gpioIds::CS_SUS_8, spiDev, SUS::MAX_CMD_SIZE,
|
spiCookie = new SpiCookie(addresses::SUS_8, gpioIds::CS_SUS_8, SUS::MAX_CMD_SIZE,
|
||||||
spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
|
spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
|
||||||
susHandlers[8] = new SusHandler(objects::SUS_8, 8, objects::SPI_COM_IF, spiCookie);
|
susHandlers[8] =
|
||||||
fdir = new SusFdir(objects::SUS_8);
|
new SusHandler(objects::SUS_8_R_LOC_XBYBZB_PT_YB, 8, objects::SPI_MAIN_COM_IF, spiCookie);
|
||||||
|
fdir = new SusFdir(objects::SUS_8_R_LOC_XBYBZB_PT_YB);
|
||||||
susHandlers[8]->setParent(objects::SUS_BOARD_ASS);
|
susHandlers[8]->setParent(objects::SUS_BOARD_ASS);
|
||||||
susHandlers[8]->setCustomFdir(fdir);
|
susHandlers[8]->setCustomFdir(fdir);
|
||||||
|
|
||||||
spiCookie = new SpiCookie(addresses::SUS_9, gpioIds::CS_SUS_9, spiDev, SUS::MAX_CMD_SIZE,
|
spiCookie = new SpiCookie(addresses::SUS_9, gpioIds::CS_SUS_9, SUS::MAX_CMD_SIZE,
|
||||||
spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
|
spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
|
||||||
susHandlers[9] = new SusHandler(objects::SUS_9, 9, objects::SPI_COM_IF, spiCookie);
|
susHandlers[9] =
|
||||||
fdir = new SusFdir(objects::SUS_9);
|
new SusHandler(objects::SUS_9_R_LOC_XBYBZB_PT_YF, 9, objects::SPI_MAIN_COM_IF, spiCookie);
|
||||||
|
fdir = new SusFdir(objects::SUS_9_R_LOC_XBYBZB_PT_YF);
|
||||||
susHandlers[9]->setParent(objects::SUS_BOARD_ASS);
|
susHandlers[9]->setParent(objects::SUS_BOARD_ASS);
|
||||||
susHandlers[9]->setCustomFdir(fdir);
|
susHandlers[9]->setCustomFdir(fdir);
|
||||||
|
|
||||||
spiCookie = new SpiCookie(addresses::SUS_10, gpioIds::CS_SUS_10, spiDev, SUS::MAX_CMD_SIZE,
|
spiCookie = new SpiCookie(addresses::SUS_10, gpioIds::CS_SUS_10, SUS::MAX_CMD_SIZE,
|
||||||
spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
|
spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
|
||||||
susHandlers[10] = new SusHandler(objects::SUS_10, 10, objects::SPI_COM_IF, spiCookie);
|
susHandlers[10] =
|
||||||
fdir = new SusFdir(objects::SUS_10);
|
new SusHandler(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, 10, objects::SPI_MAIN_COM_IF, spiCookie);
|
||||||
|
fdir = new SusFdir(objects::SUS_10_N_LOC_XMYBZF_PT_ZF);
|
||||||
susHandlers[10]->setParent(objects::SUS_BOARD_ASS);
|
susHandlers[10]->setParent(objects::SUS_BOARD_ASS);
|
||||||
susHandlers[10]->setCustomFdir(fdir);
|
susHandlers[10]->setCustomFdir(fdir);
|
||||||
|
|
||||||
spiCookie = new SpiCookie(addresses::SUS_11, gpioIds::CS_SUS_11, spiDev, SUS::MAX_CMD_SIZE,
|
spiCookie = new SpiCookie(addresses::SUS_11, gpioIds::CS_SUS_11, SUS::MAX_CMD_SIZE,
|
||||||
spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
|
spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
|
||||||
susHandlers[11] = new SusHandler(objects::SUS_11, 11, objects::SPI_COM_IF, spiCookie);
|
susHandlers[11] =
|
||||||
fdir = new SusFdir(objects::SUS_11);
|
new SusHandler(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, 11, objects::SPI_MAIN_COM_IF, spiCookie);
|
||||||
|
fdir = new SusFdir(objects::SUS_11_R_LOC_XBYMZB_PT_ZB);
|
||||||
susHandlers[11]->setParent(objects::SUS_BOARD_ASS);
|
susHandlers[11]->setParent(objects::SUS_BOARD_ASS);
|
||||||
susHandlers[11]->setCustomFdir(fdir);
|
susHandlers[11]->setCustomFdir(fdir);
|
||||||
|
|
||||||
@ -163,10 +176,13 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
std::array<object_id_t, 12> susIds = {objects::SUS_0, objects::SUS_1, objects::SUS_2,
|
std::array<object_id_t, 12> susIds = {
|
||||||
objects::SUS_3, objects::SUS_4, objects::SUS_5,
|
objects::SUS_0_N_LOC_XFYFZM_PT_XF, objects::SUS_1_N_LOC_XBYFZM_PT_XB,
|
||||||
objects::SUS_6, objects::SUS_7, objects::SUS_8,
|
objects::SUS_2_N_LOC_XFYBZB_PT_YB, objects::SUS_3_N_LOC_XFYBZF_PT_YF,
|
||||||
objects::SUS_9, objects::SUS_10, objects::SUS_11};
|
objects::SUS_4_N_LOC_XMYFZF_PT_ZF, objects::SUS_5_N_LOC_XFYMZB_PT_ZB,
|
||||||
|
objects::SUS_6_R_LOC_XFYBZM_PT_XF, objects::SUS_7_R_LOC_XBYBZM_PT_XB,
|
||||||
|
objects::SUS_8_R_LOC_XBYBZB_PT_YB, objects::SUS_9_R_LOC_XBYBZB_PT_YF,
|
||||||
|
objects::SUS_10_N_LOC_XMYBZF_PT_ZF, objects::SUS_11_R_LOC_XBYMZB_PT_ZB};
|
||||||
SusAssHelper susAssHelper = SusAssHelper(susIds);
|
SusAssHelper susAssHelper = SusAssHelper(susIds);
|
||||||
auto susAss =
|
auto susAss =
|
||||||
new SusAssembly(objects::SUS_BOARD_ASS, objects::NO_OBJECT, pwrSwitcher, susAssHelper);
|
new SusAssembly(objects::SUS_BOARD_ASS, objects::NO_OBJECT, pwrSwitcher, susAssHelper);
|
||||||
@ -175,7 +191,7 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ObjectFactory::createRtdComponents(std::string spiDev, GpioIF* gpioComIF,
|
void ObjectFactory::createRtdComponents(std::string spiDev, GpioIF* gpioComIF,
|
||||||
PowerSwitchIF* pwrSwitcher) {
|
PowerSwitchIF* pwrSwitcher, SpiComIF* comIF) {
|
||||||
using namespace gpio;
|
using namespace gpio;
|
||||||
GpioCookie* rtdGpioCookie = new GpioCookie;
|
GpioCookie* rtdGpioCookie = new GpioCookie;
|
||||||
|
|
||||||
@ -228,11 +244,11 @@ void ObjectFactory::createRtdComponents(std::string spiDev, GpioIF* gpioComIF,
|
|||||||
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
|
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
|
||||||
rtdGpioCookie->addGpio(gpioIds::RTD_IC_18, gpioRtdIc15);
|
rtdGpioCookie->addGpio(gpioIds::RTD_IC_18, gpioRtdIc15);
|
||||||
|
|
||||||
gpioComIF->addGpios(rtdGpioCookie);
|
gpioChecker(gpioComIF->addGpios(rtdGpioCookie), "RTDs");
|
||||||
|
|
||||||
#if OBSW_ADD_RTD_DEVICES == 1
|
#if OBSW_ADD_RTD_DEVICES == 1
|
||||||
static constexpr uint8_t NUMBER_RTDS = 16;
|
using namespace EiveMax31855;
|
||||||
std::array<std::pair<address_t, gpioId_t>, NUMBER_RTDS> cookieArgs = {{
|
std::array<std::pair<address_t, gpioId_t>, NUM_RTDS> cookieArgs = {{
|
||||||
{addresses::RTD_IC_3, gpioIds::RTD_IC_3},
|
{addresses::RTD_IC_3, gpioIds::RTD_IC_3},
|
||||||
{addresses::RTD_IC_4, gpioIds::RTD_IC_4},
|
{addresses::RTD_IC_4, gpioIds::RTD_IC_4},
|
||||||
{addresses::RTD_IC_5, gpioIds::RTD_IC_5},
|
{addresses::RTD_IC_5, gpioIds::RTD_IC_5},
|
||||||
@ -250,40 +266,61 @@ void ObjectFactory::createRtdComponents(std::string spiDev, GpioIF* gpioComIF,
|
|||||||
{addresses::RTD_IC_17, gpioIds::RTD_IC_17},
|
{addresses::RTD_IC_17, gpioIds::RTD_IC_17},
|
||||||
{addresses::RTD_IC_18, gpioIds::RTD_IC_18},
|
{addresses::RTD_IC_18, gpioIds::RTD_IC_18},
|
||||||
}};
|
}};
|
||||||
std::array<object_id_t, NUMBER_RTDS> rtdIds = {
|
// HSPD: Heatspreader
|
||||||
objects::RTD_IC_3, objects::RTD_IC_4, objects::RTD_IC_5, objects::RTD_IC_6,
|
std::array<std::pair<object_id_t, std::string>, NUM_RTDS> rtdInfos = {{
|
||||||
objects::RTD_IC_7, objects::RTD_IC_8, objects::RTD_IC_9, objects::RTD_IC_10,
|
{objects::RTD_0_IC3_PLOC_HEATSPREADER, "RTD_0_PLOC_HSPD"},
|
||||||
objects::RTD_IC_11, objects::RTD_IC_12, objects::RTD_IC_13, objects::RTD_IC_14,
|
{objects::RTD_1_IC4_PLOC_MISSIONBOARD, "RTD_1_PLOC_MISSIONBRD"},
|
||||||
objects::RTD_IC_15, objects::RTD_IC_16, objects::RTD_IC_17, objects::RTD_IC_18};
|
{objects::RTD_2_IC5_4K_CAMERA, "RTD_2_4K_CAMERA"},
|
||||||
std::array<SpiCookie*, NUMBER_RTDS> rtdCookies = {};
|
{objects::RTD_3_IC6_DAC_HEATSPREADER, "RTD_3_DAC_HSPD"},
|
||||||
std::array<Max31865PT1000Handler*, NUMBER_RTDS> rtds = {};
|
{objects::RTD_4_IC7_STARTRACKER, "RTD_4_STARTRACKER"},
|
||||||
|
{objects::RTD_5_IC8_RW1_MX_MY, "RTD_5_RW1_MX_MY"},
|
||||||
|
{objects::RTD_6_IC9_DRO, "RTD_6_DRO"},
|
||||||
|
{objects::RTD_7_IC10_SCEX, "RTD_7_SCEX"},
|
||||||
|
{objects::RTD_8_IC11_X8, "RTD_8_X8"},
|
||||||
|
{objects::RTD_9_IC12_HPA, "RTD_9_HPA"},
|
||||||
|
{objects::RTD_10_IC13_PL_TX, "RTD_10_PL_TX,"},
|
||||||
|
{objects::RTD_11_IC14_MPA, "RTD_11_MPA"},
|
||||||
|
{objects::RTD_12_IC15_ACU, "RTD_12_ACU"},
|
||||||
|
{objects::RTD_13_IC16_PLPCDU_HEATSPREADER, "RTD_13_PLPCDU_HSPD"},
|
||||||
|
{objects::RTD_14_IC17_TCS_BOARD, "RTD_14_TCS_BOARD"},
|
||||||
|
{objects::RTD_15_IC18_IMTQ, "RTD_15_IMTQ"},
|
||||||
|
}};
|
||||||
|
std::array<SpiCookie*, NUM_RTDS> rtdCookies = {};
|
||||||
|
std::array<Max31865EiveHandler*, NUM_RTDS> rtds = {};
|
||||||
RtdFdir* rtdFdir = nullptr;
|
RtdFdir* rtdFdir = nullptr;
|
||||||
for (uint8_t idx = 0; idx < NUMBER_RTDS; idx++) {
|
// Create special low level reader communication interface
|
||||||
rtdCookies[idx] =
|
new Max31865RtdReader(objects::SPI_RTD_COM_IF, comIF, gpioComIF);
|
||||||
new SpiCookie(cookieArgs[idx].first, cookieArgs[idx].second, spiDev,
|
for (uint8_t idx = 0; idx < NUM_RTDS; idx++) {
|
||||||
Max31865Definitions::MAX_REPLY_SIZE, spi::RTD_MODE, spi::RTD_SPEED);
|
rtdCookies[idx] = new SpiCookie(cookieArgs[idx].first, cookieArgs[idx].second,
|
||||||
rtds[idx] = new Max31865PT1000Handler(rtdIds[idx], objects::SPI_COM_IF, rtdCookies[idx]);
|
MAX31865::MAX_REPLY_SIZE, spi::RTD_MODE, spi::RTD_SPEED);
|
||||||
|
rtdCookies[idx]->setMutexParams(MutexIF::TimeoutType::WAITING, spi::RTD_CS_TIMEOUT);
|
||||||
|
Max31865ReaderCookie* rtdLowLevelCookie =
|
||||||
|
new Max31865ReaderCookie(rtdInfos[idx].first, idx, rtdInfos[idx].second, rtdCookies[idx]);
|
||||||
|
rtds[idx] =
|
||||||
|
new Max31865EiveHandler(rtdInfos[idx].first, objects::SPI_RTD_COM_IF, rtdLowLevelCookie);
|
||||||
|
rtds[idx]->setDeviceInfo(idx, rtdInfos[idx].second);
|
||||||
rtds[idx]->setParent(objects::TCS_BOARD_ASS);
|
rtds[idx]->setParent(objects::TCS_BOARD_ASS);
|
||||||
rtdFdir = new RtdFdir(rtdIds[idx]);
|
rtdFdir = new RtdFdir(rtdInfos[idx].first);
|
||||||
rtds[idx]->setCustomFdir(rtdFdir);
|
rtds[idx]->setCustomFdir(rtdFdir);
|
||||||
rtds[idx]->setDeviceIdx(idx + 3);
|
|
||||||
#if OBSW_DEBUG_RTD == 1
|
#if OBSW_DEBUG_RTD == 1
|
||||||
rtds[idx]->setDebugMode(true);
|
rtds[idx]->setDebugMode(true, 5);
|
||||||
|
#endif
|
||||||
|
#if OBSW_TEST_RTD == 1
|
||||||
|
rtds[idx]->setInstantNormal(true);
|
||||||
|
rtds[idx]->setStartUpImmediately();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if OBSW_TEST_RTD == 1
|
TcsBoardHelper helper(rtdInfos);
|
||||||
for (auto& rtd : rtds) {
|
|
||||||
if (rtd != nullptr) {
|
|
||||||
rtd->setStartUpImmediately();
|
|
||||||
rtd->setInstantNormal(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif // OBSW_TEST_RTD == 1
|
|
||||||
TcsBoardHelper helper(rtdIds);
|
|
||||||
TcsBoardAssembly* tcsBoardAss =
|
TcsBoardAssembly* tcsBoardAss =
|
||||||
new TcsBoardAssembly(objects::TCS_BOARD_ASS, objects::NO_OBJECT, pwrSwitcher,
|
new TcsBoardAssembly(objects::TCS_BOARD_ASS, objects::NO_OBJECT, pwrSwitcher,
|
||||||
pcdu::Switches::PDU1_CH0_TCS_BOARD_3V3, helper);
|
pcdu::Switches::PDU1_CH0_TCS_BOARD_3V3, helper);
|
||||||
static_cast<void>(tcsBoardAss);
|
static_cast<void>(tcsBoardAss);
|
||||||
#endif // OBSW_ADD_RTD_DEVICES == 1
|
#endif // OBSW_ADD_RTD_DEVICES == 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ObjectFactory::gpioChecker(ReturnValue_t result, std::string output) {
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
sif::error << "ObjectFactory: Adding GPIOs failed for " << output << std::endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
class GpioIF;
|
class GpioIF;
|
||||||
@ -10,6 +12,9 @@ namespace ObjectFactory {
|
|||||||
|
|
||||||
void createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiComIF, PowerSwitchIF* pwrSwitcher,
|
void createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiComIF, PowerSwitchIF* pwrSwitcher,
|
||||||
std::string spiDev);
|
std::string spiDev);
|
||||||
void createRtdComponents(std::string spiDev, GpioIF* gpioComIF, PowerSwitchIF* pwrSwitcher);
|
void createRtdComponents(std::string spiDev, GpioIF* gpioComIF, PowerSwitchIF* pwrSwitcher,
|
||||||
|
SpiComIF* comIF);
|
||||||
|
|
||||||
|
void gpioChecker(ReturnValue_t result, std::string output);
|
||||||
|
|
||||||
} // namespace ObjectFactory
|
} // namespace ObjectFactory
|
||||||
|
@ -1,10 +1,2 @@
|
|||||||
target_sources(${OBSW_NAME} PRIVATE
|
target_sources(${OBSW_NAME} PRIVATE LibgpiodTest.cpp I2cTestClass.cpp
|
||||||
LibgpiodTest.cpp
|
SpiTestClass.cpp UartTestClass.cpp)
|
||||||
I2cTestClass.cpp
|
|
||||||
SpiTestClass.cpp
|
|
||||||
UartTestClass.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -29,8 +29,8 @@ ReturnValue_t LibgpiodTest::performPeriodicAction() {
|
|||||||
sif::warning << "LibgpiodTest::performPeriodicAction: Failed to read gpio " << std::endl;
|
sif::warning << "LibgpiodTest::performPeriodicAction: Failed to read gpio " << std::endl;
|
||||||
return RETURN_FAILED;
|
return RETURN_FAILED;
|
||||||
} else {
|
} else {
|
||||||
sif::debug << "LibgpiodTest::performPeriodicAction: MIO 0 state = " <<
|
sif::debug << "LibgpiodTest::performPeriodicAction: MIO 0 state = "
|
||||||
static_cast<int>(gpioState) << std::endl;
|
<< static_cast<int>(gpioState) << std::endl;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1 @@
|
|||||||
target_sources(${OBSW_NAME} PRIVATE
|
target_sources(${OBSW_NAME} PRIVATE gpioCallbacks.cpp)
|
||||||
gpioCallbacks.cpp
|
|
||||||
)
|
|
||||||
|
@ -1,8 +1 @@
|
|||||||
target_sources(${OBSW_NAME} PUBLIC
|
target_sources(${OBSW_NAME} PUBLIC CspComIF.cpp CspCookie.cpp)
|
||||||
CspComIF.cpp
|
|
||||||
CspCookie.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
if(EIVE_BUILD_GPSD_GPS_HANDLER)
|
if(EIVE_BUILD_GPSD_GPS_HANDLER)
|
||||||
target_sources(${OBSW_NAME} PRIVATE
|
target_sources(${OBSW_NAME} PRIVATE GPSHyperionLinuxController.cpp)
|
||||||
GPSHyperionLinuxController.cpp
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
target_sources(${OBSW_NAME} PRIVATE Max31865RtdLowlevelHandler.cpp)
|
||||||
|
|
||||||
add_subdirectory(ploc)
|
add_subdirectory(ploc)
|
||||||
add_subdirectory(startracker)
|
add_subdirectory(startracker)
|
||||||
|
465
linux/devices/Max31865RtdLowlevelHandler.cpp
Normal file
465
linux/devices/Max31865RtdLowlevelHandler.cpp
Normal file
@ -0,0 +1,465 @@
|
|||||||
|
#include "Max31865RtdLowlevelHandler.h"
|
||||||
|
|
||||||
|
#include <fsfw/tasks/TaskFactory.h>
|
||||||
|
#include <fsfw/timemanager/Stopwatch.h>
|
||||||
|
#include <fsfw_hal/linux/spi/ManualCsLockGuard.h>
|
||||||
|
|
||||||
|
#define OBSW_RTD_AUTO_MODE 1
|
||||||
|
|
||||||
|
#if OBSW_RTD_AUTO_MODE == 1
|
||||||
|
static constexpr uint8_t BASE_CFG = (MAX31865::Bias::ON << MAX31865::CfgBitPos::BIAS_SEL) |
|
||||||
|
(MAX31865::Wires::FOUR_WIRE << MAX31865::CfgBitPos::WIRE_SEL) |
|
||||||
|
(MAX31865::ConvMode::AUTO << MAX31865::CfgBitPos::CONV_MODE);
|
||||||
|
#else
|
||||||
|
static constexpr uint8_t BASE_CFG =
|
||||||
|
(MAX31865::Bias::OFF << MAX31865::CfgBitPos::BIAS_SEL) |
|
||||||
|
(MAX31865::Wires::FOUR_WIRE << MAX31865::CfgBitPos::WIRE_SEL) |
|
||||||
|
(MAX31865::ConvMode::NORM_OFF << MAX31865::CfgBitPos::CONV_MODE);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
Max31865RtdReader::Max31865RtdReader(object_id_t objectId, SpiComIF* lowLevelComIF, GpioIF* gpioIF)
|
||||||
|
: SystemObject(objectId), rtds(EiveMax31855::NUM_RTDS), comIF(lowLevelComIF), gpioIF(gpioIF) {
|
||||||
|
readerMutex = MutexFactory::instance()->createMutex();
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t Max31865RtdReader::performOperation(uint8_t operationCode) {
|
||||||
|
using namespace MAX31865;
|
||||||
|
ReturnValue_t result = RETURN_OK;
|
||||||
|
static_cast<void>(result);
|
||||||
|
// Stopwatch watch;
|
||||||
|
if (periodicInitHandling()) {
|
||||||
|
#if OBSW_RTD_AUTO_MODE == 0
|
||||||
|
// 10 ms delay for VBIAS startup
|
||||||
|
TaskFactory::delayTask(10);
|
||||||
|
#endif
|
||||||
|
} else {
|
||||||
|
// No devices usable (e.g. TCS board off)
|
||||||
|
return RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if OBSW_RTD_AUTO_MODE == 0
|
||||||
|
result = periodicReadReqHandling();
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
// After requesting, 65 milliseconds delay required
|
||||||
|
TaskFactory::delayTask(65);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return periodicReadHandling();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Max31865RtdReader::rtdIsActive(uint8_t idx) {
|
||||||
|
if (rtds[idx]->on and rtds[idx]->active and rtds[idx]->configured) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Max31865RtdReader::periodicInitHandling() {
|
||||||
|
using namespace MAX31865;
|
||||||
|
MutexGuard mg(readerMutex);
|
||||||
|
ReturnValue_t result = RETURN_OK;
|
||||||
|
if (mg.getLockResult() != RETURN_OK) {
|
||||||
|
sif::warning << "Max31865RtdReader::periodicInitHandling: Mutex lock failed" << std::endl;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (auto& rtd : rtds) {
|
||||||
|
if (rtd == nullptr) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if ((rtd->on or rtd->active) and not rtd->configured and rtd->cd.hasTimedOut()) {
|
||||||
|
ManualCsLockWrapper mg(csLock, gpioIF, rtd->spiCookie, csTimeoutType, csTimeoutMs);
|
||||||
|
if (mg.lockResult != RETURN_OK or mg.gpioResult != RETURN_OK) {
|
||||||
|
sif::error << "Max31865RtdReader::periodicInitHandling: Manual CS lock failed" << std::endl;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
result = writeCfgReg(rtd->spiCookie, BASE_CFG);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
handleSpiError(rtd, result, "writeCfgReg");
|
||||||
|
}
|
||||||
|
if (rtd->writeLowThreshold) {
|
||||||
|
result = writeLowThreshold(rtd->spiCookie, rtd->lowThreshold);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
handleSpiError(rtd, result, "writeLowThreshold");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (rtd->writeHighThreshold) {
|
||||||
|
result = writeHighThreshold(rtd->spiCookie, rtd->highThreshold);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
handleSpiError(rtd, result, "writeHighThreshold");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
result = clearFaultStatus(rtd->spiCookie);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
handleSpiError(rtd, result, "clearFaultStatus");
|
||||||
|
}
|
||||||
|
rtd->configured = true;
|
||||||
|
rtd->db.configured = true;
|
||||||
|
if (rtd->active) {
|
||||||
|
rtd->db.active = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (rtd->active and rtd->configured and not rtd->db.active) {
|
||||||
|
rtd->db.active = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
bool someRtdUsable = false;
|
||||||
|
for (auto& rtd : rtds) {
|
||||||
|
if (rtd == nullptr) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (rtdIsActive(rtd->idx)) {
|
||||||
|
#if OBSW_RTD_AUTO_MODE == 0
|
||||||
|
result = writeBiasSel(Bias::ON, rtd->spiCookie, BASE_CFG);
|
||||||
|
#endif
|
||||||
|
someRtdUsable = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return someRtdUsable;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t Max31865RtdReader::periodicReadReqHandling() {
|
||||||
|
using namespace MAX31865;
|
||||||
|
MutexGuard mg(readerMutex);
|
||||||
|
if (mg.getLockResult() != RETURN_OK) {
|
||||||
|
sif::warning << "Max31865RtdReader::periodicReadReqHandling: Mutex lock failed" << std::endl;
|
||||||
|
return RETURN_FAILED;
|
||||||
|
}
|
||||||
|
// Now request one shot config for all active RTDs
|
||||||
|
for (auto& rtd : rtds) {
|
||||||
|
if (rtd == nullptr) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (rtdIsActive(rtd->idx)) {
|
||||||
|
ReturnValue_t result = writeCfgReg(rtd->spiCookie, BASE_CFG | (1 << CfgBitPos::ONE_SHOT));
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
handleSpiError(rtd, result, "writeCfgReg");
|
||||||
|
// Release mutex ASAP
|
||||||
|
return RETURN_FAILED;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t Max31865RtdReader::periodicReadHandling() {
|
||||||
|
using namespace MAX31865;
|
||||||
|
auto result = RETURN_OK;
|
||||||
|
MutexGuard mg(readerMutex);
|
||||||
|
if (mg.getLockResult() != RETURN_OK) {
|
||||||
|
sif::warning << "Max31865RtdReader::periodicReadReqHandling: Mutex lock failed" << std::endl;
|
||||||
|
return RETURN_FAILED;
|
||||||
|
}
|
||||||
|
// Now read the RTD values
|
||||||
|
for (auto& rtd : rtds) {
|
||||||
|
if (rtd == nullptr) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (rtdIsActive(rtd->idx)) {
|
||||||
|
uint16_t rtdVal = 0;
|
||||||
|
bool faultBitSet = false;
|
||||||
|
result = readRtdVal(rtd->spiCookie, rtdVal, faultBitSet);
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
handleSpiError(rtd, result, "readRtdVal");
|
||||||
|
return RETURN_FAILED;
|
||||||
|
}
|
||||||
|
if (faultBitSet) {
|
||||||
|
rtd->db.faultBitSet = faultBitSet;
|
||||||
|
}
|
||||||
|
rtd->db.adcCode = rtdVal;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#if OBSW_RTD_AUTO_MODE == 0
|
||||||
|
for (auto& rtd : rtds) {
|
||||||
|
if (rtd == nullptr) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// Even if a device was made inactive, turn off the bias here. If it was turned off, not
|
||||||
|
// necessary anymore..
|
||||||
|
if (rtd->on) {
|
||||||
|
result = writeBiasSel(Bias::OFF, rtd->spiCookie, BASE_CFG);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t Max31865RtdReader::initializeInterface(CookieIF* cookie) {
|
||||||
|
if (cookie == nullptr) {
|
||||||
|
throw std::invalid_argument("Invalid MAX31865 Reader Cookie");
|
||||||
|
}
|
||||||
|
auto* rtdCookie = dynamic_cast<Max31865ReaderCookie*>(cookie);
|
||||||
|
ReturnValue_t result = comIF->initializeInterface(rtdCookie->spiCookie);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
if (rtdCookie->idx > EiveMax31855::NUM_RTDS) {
|
||||||
|
throw std::invalid_argument("Invalid RTD index");
|
||||||
|
}
|
||||||
|
rtds[rtdCookie->idx] = rtdCookie;
|
||||||
|
MutexGuard mg(readerMutex);
|
||||||
|
if (dbLen == 0) {
|
||||||
|
dbLen = rtdCookie->db.getSerializedSize();
|
||||||
|
}
|
||||||
|
return RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t Max31865RtdReader::sendMessage(CookieIF* cookie, const uint8_t* sendData,
|
||||||
|
size_t sendLen) {
|
||||||
|
if (cookie == nullptr) {
|
||||||
|
return RETURN_FAILED;
|
||||||
|
}
|
||||||
|
// Empty command.. don't fail for now
|
||||||
|
if (sendLen < 1) {
|
||||||
|
return RETURN_OK;
|
||||||
|
}
|
||||||
|
MutexGuard mg(readerMutex);
|
||||||
|
if (mg.getLockResult() != RETURN_OK) {
|
||||||
|
sif::warning << "Max31865RtdReader::sendMessage: Mutex lock failed" << std::endl;
|
||||||
|
return RETURN_FAILED;
|
||||||
|
}
|
||||||
|
auto* rtdCookie = dynamic_cast<Max31865ReaderCookie*>(cookie);
|
||||||
|
uint8_t cmdRaw = sendData[0];
|
||||||
|
if (cmdRaw > EiveMax31855::RtdCommands::NUM_CMDS) {
|
||||||
|
sif::warning << "Max31865RtdReader::sendMessage: Invalid command" << std::endl;
|
||||||
|
return RETURN_FAILED;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto thresholdHandler = [](Max31865ReaderCookie* rtdCookie, const uint8_t* sendData) {
|
||||||
|
rtdCookie->lowThreshold = (sendData[1] << 8) | sendData[2];
|
||||||
|
rtdCookie->highThreshold = (sendData[3] << 8) | sendData[4];
|
||||||
|
rtdCookie->writeLowThreshold = true;
|
||||||
|
rtdCookie->writeHighThreshold = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
auto cmd = static_cast<EiveMax31855::RtdCommands>(sendData[0]);
|
||||||
|
switch (cmd) {
|
||||||
|
case (EiveMax31855::RtdCommands::ON): {
|
||||||
|
if (not rtdCookie->on) {
|
||||||
|
rtdCookie->cd.setTimeout(MAX31865::WARMUP_MS);
|
||||||
|
rtdCookie->cd.resetTimer();
|
||||||
|
rtdCookie->on = true;
|
||||||
|
rtdCookie->active = false;
|
||||||
|
rtdCookie->configured = false;
|
||||||
|
if (sendLen == 5) {
|
||||||
|
thresholdHandler(rtdCookie, sendData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case (EiveMax31855::RtdCommands::ACTIVE): {
|
||||||
|
if (not rtdCookie->on) {
|
||||||
|
rtdCookie->cd.setTimeout(MAX31865::WARMUP_MS);
|
||||||
|
rtdCookie->cd.resetTimer();
|
||||||
|
rtdCookie->on = true;
|
||||||
|
rtdCookie->active = true;
|
||||||
|
rtdCookie->configured = false;
|
||||||
|
} else {
|
||||||
|
rtdCookie->active = true;
|
||||||
|
}
|
||||||
|
if (sendLen == 5) {
|
||||||
|
thresholdHandler(rtdCookie, sendData);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case (EiveMax31855::RtdCommands::OFF): {
|
||||||
|
rtdCookie->on = false;
|
||||||
|
rtdCookie->active = false;
|
||||||
|
rtdCookie->configured = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case (EiveMax31855::RtdCommands::HIGH_TRESHOLD): {
|
||||||
|
if (sendLen == 3) {
|
||||||
|
rtdCookie->highThreshold = (sendData[1] << 8) | sendData[2];
|
||||||
|
rtdCookie->writeHighThreshold = true;
|
||||||
|
} else {
|
||||||
|
return RETURN_FAILED;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case (EiveMax31855::RtdCommands::LOW_THRESHOLD): {
|
||||||
|
if (sendLen == 3) {
|
||||||
|
rtdCookie->lowThreshold = (sendData[1] << 8) | sendData[2];
|
||||||
|
rtdCookie->writeLowThreshold = true;
|
||||||
|
} else {
|
||||||
|
return RETURN_FAILED;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case (EiveMax31855::RtdCommands::CFG):
|
||||||
|
default: {
|
||||||
|
// TODO: Only implement if needed
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t Max31865RtdReader::getSendSuccess(CookieIF* cookie) { return RETURN_OK; }
|
||||||
|
|
||||||
|
ReturnValue_t Max31865RtdReader::requestReceiveMessage(CookieIF* cookie, size_t requestLen) {
|
||||||
|
return RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t Max31865RtdReader::readReceivedMessage(CookieIF* cookie, uint8_t** buffer,
|
||||||
|
size_t* size) {
|
||||||
|
MutexGuard mg(readerMutex);
|
||||||
|
if (mg.getLockResult() != RETURN_OK) {
|
||||||
|
// TODO: Emit warning
|
||||||
|
return RETURN_FAILED;
|
||||||
|
}
|
||||||
|
auto* rtdCookie = dynamic_cast<Max31865ReaderCookie*>(cookie);
|
||||||
|
uint8_t* exchangePtr = rtdCookie->exchangeBuf.data();
|
||||||
|
size_t serLen = 0;
|
||||||
|
auto result = rtdCookie->db.serialize(&exchangePtr, &serLen, rtdCookie->exchangeBuf.size(),
|
||||||
|
SerializeIF::Endianness::MACHINE);
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
// TODO: Emit warning
|
||||||
|
return RETURN_FAILED;
|
||||||
|
}
|
||||||
|
*buffer = reinterpret_cast<uint8_t*>(rtdCookie->exchangeBuf.data());
|
||||||
|
*size = serLen;
|
||||||
|
return RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t Max31865RtdReader::writeCfgReg(SpiCookie* cookie, uint8_t cfg) {
|
||||||
|
using namespace MAX31865;
|
||||||
|
return writeNToReg(cookie, CONFIG, 1, &cfg, nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t Max31865RtdReader::writeBiasSel(MAX31865::Bias bias, SpiCookie* cookie,
|
||||||
|
uint8_t baseCfg) {
|
||||||
|
using namespace MAX31865;
|
||||||
|
if (bias == MAX31865::Bias::OFF) {
|
||||||
|
baseCfg &= ~(1 << CfgBitPos::BIAS_SEL);
|
||||||
|
} else {
|
||||||
|
baseCfg |= (1 << CfgBitPos::BIAS_SEL);
|
||||||
|
}
|
||||||
|
return writeCfgReg(cookie, baseCfg);
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t Max31865RtdReader::clearFaultStatus(SpiCookie* cookie) {
|
||||||
|
using namespace MAX31865;
|
||||||
|
// Read back the current configuration to avoid overwriting it when clearing te fault status
|
||||||
|
uint8_t currentCfg = 0;
|
||||||
|
auto result = readCfgReg(cookie, currentCfg);
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
// Clear bytes 5, 3 and 2 which need to be 0
|
||||||
|
currentCfg &= ~0x2C;
|
||||||
|
currentCfg |= (1 << CfgBitPos::FAULT_STATUS_CLEAR);
|
||||||
|
return writeCfgReg(cookie, currentCfg);
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t Max31865RtdReader::readCfgReg(SpiCookie* cookie, uint8_t& cfg) {
|
||||||
|
using namespace MAX31865;
|
||||||
|
uint8_t* replyPtr = nullptr;
|
||||||
|
auto result = readNFromReg(cookie, CONFIG, 1, &replyPtr);
|
||||||
|
if (result == RETURN_OK) {
|
||||||
|
cfg = replyPtr[0];
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t Max31865RtdReader::writeLowThreshold(SpiCookie* cookie, uint16_t val) {
|
||||||
|
using namespace MAX31865;
|
||||||
|
uint8_t cmd[2] = {static_cast<uint8_t>((val >> 8) & 0xff), static_cast<uint8_t>(val & 0xff)};
|
||||||
|
return writeNToReg(cookie, LOW_THRESHOLD, 2, cmd, nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t Max31865RtdReader::writeHighThreshold(SpiCookie* cookie, uint16_t val) {
|
||||||
|
using namespace MAX31865;
|
||||||
|
uint8_t cmd[2] = {static_cast<uint8_t>((val >> 8) & 0xff), static_cast<uint8_t>(val & 0xff)};
|
||||||
|
return writeNToReg(cookie, HIGH_THRESHOLD, 2, cmd, nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t Max31865RtdReader::readLowThreshold(SpiCookie* cookie, uint16_t& lowThreshold) {
|
||||||
|
using namespace MAX31865;
|
||||||
|
uint8_t* replyPtr = nullptr;
|
||||||
|
auto result = readNFromReg(cookie, LOW_THRESHOLD, 2, &replyPtr);
|
||||||
|
if (result == RETURN_OK) {
|
||||||
|
lowThreshold = (replyPtr[0] << 8) | replyPtr[1];
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t Max31865RtdReader::readHighThreshold(SpiCookie* cookie, uint16_t& highThreshold) {
|
||||||
|
using namespace MAX31865;
|
||||||
|
uint8_t* replyPtr = nullptr;
|
||||||
|
auto result = readNFromReg(cookie, HIGH_THRESHOLD, 2, &replyPtr);
|
||||||
|
if (result == RETURN_OK) {
|
||||||
|
highThreshold = (replyPtr[0] << 8) | replyPtr[1];
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t Max31865RtdReader::writeNToReg(SpiCookie* cookie, uint8_t reg, size_t n, uint8_t* cmd,
|
||||||
|
uint8_t** reply) {
|
||||||
|
using namespace MAX31865;
|
||||||
|
if (n > cmdBuf.size() - 1) {
|
||||||
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
|
}
|
||||||
|
cmdBuf[0] = reg | WRITE_BIT;
|
||||||
|
for (size_t idx = 0; idx < n; idx++) {
|
||||||
|
cmdBuf[idx + 1] = cmd[idx];
|
||||||
|
}
|
||||||
|
return comIF->sendMessage(cookie, cmdBuf.data(), n + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t Max31865RtdReader::readRtdVal(SpiCookie* cookie, uint16_t& val, bool& faultBitSet) {
|
||||||
|
using namespace MAX31865;
|
||||||
|
uint8_t* replyPtr = nullptr;
|
||||||
|
auto result = readNFromReg(cookie, RTD, 2, &replyPtr);
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
if (replyPtr[1] & 0b0000'0001) {
|
||||||
|
faultBitSet = true;
|
||||||
|
}
|
||||||
|
// Shift 1 to the right to remove fault bit
|
||||||
|
val = ((replyPtr[0] << 8) | replyPtr[1]) >> 1;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t Max31865RtdReader::readNFromReg(SpiCookie* cookie, uint8_t reg, size_t n,
|
||||||
|
uint8_t** reply) {
|
||||||
|
using namespace MAX31865;
|
||||||
|
if (n > 4) {
|
||||||
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
|
}
|
||||||
|
// Clear write bit in any case
|
||||||
|
reg &= ~WRITE_BIT;
|
||||||
|
cmdBuf[0] = reg;
|
||||||
|
std::memset(cmdBuf.data() + 1, 0, n);
|
||||||
|
ReturnValue_t result = comIF->sendMessage(cookie, cmdBuf.data(), n + 1);
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
return RETURN_FAILED;
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t dummyLen = 0;
|
||||||
|
uint8_t* replyPtr = nullptr;
|
||||||
|
result = comIF->readReceivedMessage(cookie, &replyPtr, &dummyLen);
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
if (reply != nullptr) {
|
||||||
|
*reply = replyPtr + 1;
|
||||||
|
}
|
||||||
|
return RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t Max31865RtdReader::handleSpiError(Max31865ReaderCookie* cookie, ReturnValue_t result,
|
||||||
|
const char* ctx) {
|
||||||
|
cookie->db.spiErrorCount.value += 1;
|
||||||
|
sif::warning << "Max31865RtdReader::handleSpiError: " << ctx << " | Failed with result " << result
|
||||||
|
<< std::endl;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t Max31865RtdReader::initialize() {
|
||||||
|
csLock = comIF->getCsMutex();
|
||||||
|
return SystemObject::initialize();
|
||||||
|
}
|
87
linux/devices/Max31865RtdLowlevelHandler.h
Normal file
87
linux/devices/Max31865RtdLowlevelHandler.h
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
#ifndef LINUX_DEVICES_MAX31865RTDREADER_H_
|
||||||
|
#define LINUX_DEVICES_MAX31865RTDREADER_H_
|
||||||
|
|
||||||
|
#include <fsfw/ipc/MutexIF.h>
|
||||||
|
#include <fsfw/tasks/ExecutableObjectIF.h>
|
||||||
|
#include <fsfw_hal/linux/spi/SpiComIF.h>
|
||||||
|
#include <fsfw_hal/linux/spi/SpiCookie.h>
|
||||||
|
|
||||||
|
#include "fsfw/devicehandlers/DeviceCommunicationIF.h"
|
||||||
|
#include "mission/devices/devicedefinitions/Max31865Definitions.h"
|
||||||
|
|
||||||
|
struct Max31865ReaderCookie : public CookieIF {
|
||||||
|
Max31865ReaderCookie(){};
|
||||||
|
Max31865ReaderCookie(object_id_t handlerId_, uint8_t idx_, const std::string& locString_,
|
||||||
|
SpiCookie* spiCookie_)
|
||||||
|
: idx(idx_), handlerId(handlerId_), locString(locString_), spiCookie(spiCookie_) {}
|
||||||
|
|
||||||
|
uint8_t idx = 0;
|
||||||
|
object_id_t handlerId = objects::NO_OBJECT;
|
||||||
|
|
||||||
|
std::string locString = "";
|
||||||
|
std::array<uint8_t, 12> exchangeBuf{};
|
||||||
|
Countdown cd = Countdown(MAX31865::WARMUP_MS);
|
||||||
|
|
||||||
|
bool on = false;
|
||||||
|
bool configured = false;
|
||||||
|
bool active = false;
|
||||||
|
bool writeLowThreshold = false;
|
||||||
|
bool writeHighThreshold = false;
|
||||||
|
uint16_t lowThreshold = 0;
|
||||||
|
uint16_t highThreshold = 0;
|
||||||
|
SpiCookie* spiCookie = nullptr;
|
||||||
|
|
||||||
|
// Exchange data buffer struct
|
||||||
|
EiveMax31855::ReadOutStruct db;
|
||||||
|
};
|
||||||
|
|
||||||
|
class Max31865RtdReader : public SystemObject,
|
||||||
|
public ExecutableObjectIF,
|
||||||
|
public DeviceCommunicationIF {
|
||||||
|
public:
|
||||||
|
Max31865RtdReader(object_id_t objectId, SpiComIF* lowLevelComIF, GpioIF* gpioIF);
|
||||||
|
|
||||||
|
ReturnValue_t performOperation(uint8_t operationCode) override;
|
||||||
|
ReturnValue_t initialize() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::vector<Max31865ReaderCookie*> rtds;
|
||||||
|
std::array<uint8_t, 4> cmdBuf = {};
|
||||||
|
size_t dbLen = 0;
|
||||||
|
MutexIF* readerMutex;
|
||||||
|
|
||||||
|
SpiComIF* comIF;
|
||||||
|
GpioIF* gpioIF;
|
||||||
|
MutexIF::TimeoutType csTimeoutType = MutexIF::TimeoutType::BLOCKING;
|
||||||
|
uint32_t csTimeoutMs = 0;
|
||||||
|
MutexIF* csLock = nullptr;
|
||||||
|
|
||||||
|
bool periodicInitHandling();
|
||||||
|
ReturnValue_t periodicReadReqHandling();
|
||||||
|
ReturnValue_t periodicReadHandling();
|
||||||
|
|
||||||
|
bool rtdIsActive(uint8_t idx);
|
||||||
|
ReturnValue_t writeCfgReg(SpiCookie* cookie, uint8_t cfg);
|
||||||
|
ReturnValue_t writeBiasSel(MAX31865::Bias bias, SpiCookie* cookie, uint8_t baseCfg);
|
||||||
|
ReturnValue_t readCfgReg(SpiCookie* cookie, uint8_t& cfg);
|
||||||
|
ReturnValue_t readRtdVal(SpiCookie* cookie, uint16_t& val, bool& faultBitSet);
|
||||||
|
ReturnValue_t writeLowThreshold(SpiCookie* cookie, uint16_t val);
|
||||||
|
ReturnValue_t writeHighThreshold(SpiCookie* cookie, uint16_t val);
|
||||||
|
ReturnValue_t readLowThreshold(SpiCookie* cookie, uint16_t& val);
|
||||||
|
ReturnValue_t readHighThreshold(SpiCookie* cookie, uint16_t& val);
|
||||||
|
ReturnValue_t clearFaultStatus(SpiCookie* cookie);
|
||||||
|
|
||||||
|
ReturnValue_t readNFromReg(SpiCookie* cookie, uint8_t reg, size_t n, uint8_t** reply);
|
||||||
|
ReturnValue_t writeNToReg(SpiCookie* cookie, uint8_t reg, size_t n, uint8_t* cmd,
|
||||||
|
uint8_t** reply);
|
||||||
|
|
||||||
|
ReturnValue_t initializeInterface(CookieIF* cookie) override;
|
||||||
|
ReturnValue_t sendMessage(CookieIF* cookie, const uint8_t* sendData, size_t sendLen) override;
|
||||||
|
ReturnValue_t getSendSuccess(CookieIF* cookie) override;
|
||||||
|
ReturnValue_t requestReceiveMessage(CookieIF* cookie, size_t requestLen) override;
|
||||||
|
ReturnValue_t readReceivedMessage(CookieIF* cookie, uint8_t** buffer, size_t* size) override;
|
||||||
|
|
||||||
|
ReturnValue_t handleSpiError(Max31865ReaderCookie* cookie, ReturnValue_t result, const char* ctx);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* LINUX_DEVICES_MAX31865RTDREADER_H_ */
|
@ -29,6 +29,8 @@ static const DeviceCommandId_t TC_MODE_REPLAY = 16;
|
|||||||
static const DeviceCommandId_t TC_CAM_CMD_SEND = 17;
|
static const DeviceCommandId_t TC_CAM_CMD_SEND = 17;
|
||||||
static const DeviceCommandId_t TC_MODE_IDLE = 18;
|
static const DeviceCommandId_t TC_MODE_IDLE = 18;
|
||||||
static const DeviceCommandId_t TM_CAM_CMD_RPT = 19;
|
static const DeviceCommandId_t TM_CAM_CMD_RPT = 19;
|
||||||
|
static const DeviceCommandId_t SET_UART_TX_TRISTATE = 20;
|
||||||
|
static const DeviceCommandId_t RELEASE_UART_TX = 21;
|
||||||
|
|
||||||
// Will reset the sequence count of the OBSW
|
// Will reset the sequence count of the OBSW
|
||||||
static const DeviceCommandId_t OBSW_RESET_SEQ_COUNT = 50;
|
static const DeviceCommandId_t OBSW_RESET_SEQ_COUNT = 50;
|
||||||
@ -576,6 +578,9 @@ class TcReplayWriteSeq : public TcBase {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Helps to extract the fields of the flash write command from the PUS packet.
|
||||||
|
*/
|
||||||
class FlashWritePusCmd : public MPSoCReturnValuesIF {
|
class FlashWritePusCmd : public MPSoCReturnValuesIF {
|
||||||
public:
|
public:
|
||||||
FlashWritePusCmd(){};
|
FlashWritePusCmd(){};
|
||||||
|
File diff suppressed because it is too large
Load Diff
61
linux/devices/devicedefinitions/SupvReturnValuesIF.h
Normal file
61
linux/devices/devicedefinitions/SupvReturnValuesIF.h
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
#ifndef SUPV_RETURN_VALUES_IF_H_
|
||||||
|
#define SUPV_RETURN_VALUES_IF_H_
|
||||||
|
|
||||||
|
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
|
||||||
|
|
||||||
|
class SupvReturnValuesIF {
|
||||||
|
public:
|
||||||
|
static const uint8_t INTERFACE_ID = CLASS_ID::SUPV_RETURN_VALUES_IF;
|
||||||
|
|
||||||
|
//! [EXPORT] : [COMMENT] Space Packet received from PLOC supervisor has invalid CRC
|
||||||
|
static const ReturnValue_t CRC_FAILURE = MAKE_RETURN_CODE(0xA0);
|
||||||
|
//! [EXPORT] : [COMMENT] Received ACK failure reply from PLOC supervisor
|
||||||
|
static const ReturnValue_t RECEIVED_ACK_FAILURE = MAKE_RETURN_CODE(0xA1);
|
||||||
|
//! [EXPORT] : [COMMENT] Received execution failure reply from PLOC supervisor
|
||||||
|
static const ReturnValue_t RECEIVED_EXE_FAILURE = MAKE_RETURN_CODE(0xA2);
|
||||||
|
//! [EXPORT] : [COMMENT] Received space packet with invalid APID from PLOC supervisor
|
||||||
|
static const ReturnValue_t INVALID_APID = MAKE_RETURN_CODE(0xA3);
|
||||||
|
//! [EXPORT] : [COMMENT] Failed to read current system time
|
||||||
|
static const ReturnValue_t GET_TIME_FAILURE = MAKE_RETURN_CODE(0xA4);
|
||||||
|
//! [EXPORT] : [COMMENT] Received command with invalid watchdog parameter. Valid watchdogs are 0
|
||||||
|
//! for PS, 1 for PL and 2 for INT
|
||||||
|
static const ReturnValue_t INVALID_WATCHDOG = MAKE_RETURN_CODE(0xA5);
|
||||||
|
//! [EXPORT] : [COMMENT] Received watchdog timeout config command with invalid timeout. Valid
|
||||||
|
//! timeouts must be in the range between 1000 and 360000 ms.
|
||||||
|
static const ReturnValue_t INVALID_WATCHDOG_TIMEOUT = MAKE_RETURN_CODE(0xA6);
|
||||||
|
//! [EXPORT] : [COMMENT] Received latchup config command with invalid latchup ID
|
||||||
|
static const ReturnValue_t INVALID_LATCHUP_ID = MAKE_RETURN_CODE(0xA7);
|
||||||
|
//! [EXPORT] : [COMMENT] Received set adc sweep period command with invalid sweep period. Must be
|
||||||
|
//! larger than 21.
|
||||||
|
static const ReturnValue_t SWEEP_PERIOD_TOO_SMALL = MAKE_RETURN_CODE(0xA8);
|
||||||
|
//! [EXPORT] : [COMMENT] Receive auto EM test command with invalid test param. Valid params are 1
|
||||||
|
//! and 2.
|
||||||
|
static const ReturnValue_t INVALID_TEST_PARAM = MAKE_RETURN_CODE(0xA9);
|
||||||
|
//! [EXPORT] : [COMMENT] Returned when scanning for MRAM dump packets failed.
|
||||||
|
static const ReturnValue_t MRAM_PACKET_PARSING_FAILURE = MAKE_RETURN_CODE(0xAA);
|
||||||
|
//! [EXPORT] : [COMMENT] Returned when the start and stop addresses of the MRAM dump or MRAM wipe
|
||||||
|
//! commands are invalid (e.g. start address bigger than stop address)
|
||||||
|
static const ReturnValue_t INVALID_MRAM_ADDRESSES = MAKE_RETURN_CODE(0xAB);
|
||||||
|
//! [EXPORT] : [COMMENT] Expect reception of an MRAM dump packet but received space packet with
|
||||||
|
//! other apid.
|
||||||
|
static const ReturnValue_t NO_MRAM_PACKET = MAKE_RETURN_CODE(0xAC);
|
||||||
|
//! [EXPORT] : [COMMENT] Path to PLOC directory on SD card does not exist
|
||||||
|
static const ReturnValue_t PATH_DOES_NOT_EXIST = MAKE_RETURN_CODE(0xAD);
|
||||||
|
//! [EXPORT] : [COMMENT] MRAM dump file does not exists. The file should actually already have
|
||||||
|
//! been created with the reception of the first dump packet.
|
||||||
|
static const ReturnValue_t MRAM_FILE_NOT_EXISTS = MAKE_RETURN_CODE(0xAE);
|
||||||
|
//! [EXPORT] : [COMMENT] Received action command has invalid length
|
||||||
|
static const ReturnValue_t INVALID_LENGTH = MAKE_RETURN_CODE(0xAF);
|
||||||
|
//! [EXPORT] : [COMMENT] Filename too long
|
||||||
|
static const ReturnValue_t FILENAME_TOO_LONG = MAKE_RETURN_CODE(0xB0);
|
||||||
|
//! [EXPORT] : [COMMENT] Received update status report with invalid packet length field
|
||||||
|
static const ReturnValue_t UPDATE_STATUS_REPORT_INVALID_LENGTH = MAKE_RETURN_CODE(0xB1);
|
||||||
|
//! [EXPORT] : [COMMENT] Update status report does not contain expected CRC. There might be a bit
|
||||||
|
//! flip in the update memory region.
|
||||||
|
static const ReturnValue_t UPDATE_CRC_FAILURE = MAKE_RETURN_CODE(0xB2);
|
||||||
|
//! [EXPORT] : [COMMENT] Supervisor helper task ist currently executing a command (wait until
|
||||||
|
//! helper tas has finished or interrupt by sending the terminate command)
|
||||||
|
static const ReturnValue_t SUPV_HELPER_EXECUTING = MAKE_RETURN_CODE(0xB3);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* SUPV_RETURN_VALUES_IF_H_ */
|
@ -1,7 +1,4 @@
|
|||||||
target_sources(${OBSW_NAME} PRIVATE
|
target_sources(
|
||||||
PlocSupervisorHandler.cpp
|
${OBSW_NAME}
|
||||||
PlocUpdater.cpp
|
PRIVATE PlocSupervisorHandler.cpp PlocMemoryDumper.cpp PlocMPSoCHandler.cpp
|
||||||
PlocMemoryDumper.cpp
|
PlocMPSoCHelper.cpp PlocSupvHelper.cpp)
|
||||||
PlocMPSoCHandler.cpp
|
|
||||||
PlocMPSoCHelper.cpp
|
|
||||||
)
|
|
||||||
|
@ -99,6 +99,20 @@ void PlocMPSoCHandler::performOperationHook() {
|
|||||||
ReturnValue_t PlocMPSoCHandler::executeAction(ActionId_t actionId, MessageQueueId_t commandedBy,
|
ReturnValue_t PlocMPSoCHandler::executeAction(ActionId_t actionId, MessageQueueId_t commandedBy,
|
||||||
const uint8_t* data, size_t size) {
|
const uint8_t* data, size_t size) {
|
||||||
ReturnValue_t result = RETURN_OK;
|
ReturnValue_t result = RETURN_OK;
|
||||||
|
switch (actionId) {
|
||||||
|
case mpsoc::SET_UART_TX_TRISTATE: {
|
||||||
|
uartIsolatorSwitch.pullLow();
|
||||||
|
return EXECUTION_FINISHED;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case mpsoc::RELEASE_UART_TX: {
|
||||||
|
uartIsolatorSwitch.pullHigh();
|
||||||
|
return EXECUTION_FINISHED;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (plocMPSoCHelperExecuting) {
|
if (plocMPSoCHelperExecuting) {
|
||||||
return MPSoCReturnValuesIF::MPSOC_HELPER_EXECUTING;
|
return MPSoCReturnValuesIF::MPSOC_HELPER_EXECUTING;
|
||||||
@ -134,6 +148,7 @@ ReturnValue_t PlocMPSoCHandler::executeAction(ActionId_t actionId, MessageQueueI
|
|||||||
|
|
||||||
void PlocMPSoCHandler::doStartUp() {
|
void PlocMPSoCHandler::doStartUp() {
|
||||||
#ifdef XIPHOS_Q7S
|
#ifdef XIPHOS_Q7S
|
||||||
|
#if not OBSW_MPSOC_JTAG_BOOT == 1
|
||||||
switch (powerState) {
|
switch (powerState) {
|
||||||
case PowerState::OFF:
|
case PowerState::OFF:
|
||||||
commandActionHelper.commandAction(supervisorHandler, supv::START_MPSOC);
|
commandActionHelper.commandAction(supervisorHandler, supv::START_MPSOC);
|
||||||
@ -147,11 +162,19 @@ void PlocMPSoCHandler::doStartUp() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
powerState = PowerState::ON;
|
||||||
|
setMode(_MODE_TO_ON);
|
||||||
|
uartIsolatorSwitch.pullHigh();
|
||||||
|
#endif /* not MSPOC_JTAG_BOOT == 1 */
|
||||||
|
#else
|
||||||
|
powerState = PowerState::ON;
|
||||||
setMode(_MODE_TO_ON);
|
setMode(_MODE_TO_ON);
|
||||||
#endif /* XIPHOS_Q7S */
|
#endif /* XIPHOS_Q7S */
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlocMPSoCHandler::doShutDown() {
|
void PlocMPSoCHandler::doShutDown() {
|
||||||
|
#ifdef XIPHOS_Q7S
|
||||||
|
#if not OBSW_MPSOC_JTAG_BOOT == 1
|
||||||
switch (powerState) {
|
switch (powerState) {
|
||||||
case PowerState::ON:
|
case PowerState::ON:
|
||||||
uartIsolatorSwitch.pullLow();
|
uartIsolatorSwitch.pullLow();
|
||||||
@ -164,6 +187,12 @@ void PlocMPSoCHandler::doShutDown() {
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
uartIsolatorSwitch.pullLow();
|
||||||
|
setMode(_MODE_POWER_DOWN);
|
||||||
|
powerState = PowerState::OFF;
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t PlocMPSoCHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) {
|
ReturnValue_t PlocMPSoCHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) {
|
||||||
@ -252,6 +281,8 @@ void PlocMPSoCHandler::fillCommandAndReplyMap() {
|
|||||||
this->insertInCommandMap(mpsoc::TC_MODE_REPLAY);
|
this->insertInCommandMap(mpsoc::TC_MODE_REPLAY);
|
||||||
this->insertInCommandMap(mpsoc::TC_MODE_IDLE);
|
this->insertInCommandMap(mpsoc::TC_MODE_IDLE);
|
||||||
this->insertInCommandMap(mpsoc::TC_CAM_CMD_SEND);
|
this->insertInCommandMap(mpsoc::TC_CAM_CMD_SEND);
|
||||||
|
this->insertInCommandMap(mpsoc::RELEASE_UART_TX);
|
||||||
|
this->insertInCommandMap(mpsoc::SET_UART_TX_TRISTATE);
|
||||||
this->insertInReplyMap(mpsoc::ACK_REPORT, 3, nullptr, mpsoc::SIZE_ACK_REPORT);
|
this->insertInReplyMap(mpsoc::ACK_REPORT, 3, nullptr, mpsoc::SIZE_ACK_REPORT);
|
||||||
this->insertInReplyMap(mpsoc::EXE_REPORT, 3, nullptr, mpsoc::SIZE_EXE_REPORT);
|
this->insertInReplyMap(mpsoc::EXE_REPORT, 3, nullptr, mpsoc::SIZE_EXE_REPORT);
|
||||||
this->insertInReplyMap(mpsoc::TM_MEMORY_READ_REPORT, 2, nullptr, mpsoc::SIZE_TM_MEM_READ_REPORT);
|
this->insertInReplyMap(mpsoc::TM_MEMORY_READ_REPORT, 2, nullptr, mpsoc::SIZE_TM_MEM_READ_REPORT);
|
||||||
@ -302,7 +333,7 @@ ReturnValue_t PlocMPSoCHandler::scanForReply(const uint8_t* start, size_t remain
|
|||||||
sequenceCount++;
|
sequenceCount++;
|
||||||
uint16_t recvSeqCnt = (*(start + 2) << 8 | *(start + 3)) & PACKET_SEQUENCE_COUNT_MASK;
|
uint16_t recvSeqCnt = (*(start + 2) << 8 | *(start + 3)) & PACKET_SEQUENCE_COUNT_MASK;
|
||||||
if (recvSeqCnt != sequenceCount) {
|
if (recvSeqCnt != sequenceCount) {
|
||||||
triggerEvent(MPSOC_HANDLER_SEQ_CNT_MISMATCH, sequenceCount, recvSeqCnt);
|
triggerEvent(MPSOC_HANDLER_SEQUENCE_COUNT_MISMATCH, sequenceCount, recvSeqCnt);
|
||||||
sequenceCount = recvSeqCnt;
|
sequenceCount = recvSeqCnt;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
@ -656,10 +687,12 @@ ReturnValue_t PlocMPSoCHandler::handleCamCmdRpt(const uint8_t* data) {
|
|||||||
std::string camCmdRptMsg(
|
std::string camCmdRptMsg(
|
||||||
reinterpret_cast<const char*>(dataFieldPtr),
|
reinterpret_cast<const char*>(dataFieldPtr),
|
||||||
tmCamCmdRpt.rememberSpacePacketSize - mpsoc::SPACE_PACKET_HEADER_SIZE - 3);
|
tmCamCmdRpt.rememberSpacePacketSize - mpsoc::SPACE_PACKET_HEADER_SIZE - 3);
|
||||||
|
#if OBSW_DEBUG_PLOC_MPSOC == 1
|
||||||
uint8_t ackValue = *(packet.getPacketData() + packet.getPacketDataLength() - 2);
|
uint8_t ackValue = *(packet.getPacketData() + packet.getPacketDataLength() - 2);
|
||||||
sif::info << "CamCmdRpt message: " << camCmdRptMsg << std::endl;
|
sif::info << "PlocMPSoCHandler: CamCmdRpt message: " << camCmdRptMsg << std::endl;
|
||||||
sif::info << "CamCmdRpt Ack value: 0x" << std::hex << static_cast<unsigned int>(ackValue)
|
sif::info << "PlocMPSoCHandler: CamCmdRpt Ack value: 0x" << std::hex
|
||||||
<< std::endl;
|
<< static_cast<unsigned int>(ackValue) << std::endl;
|
||||||
|
#endif /* OBSW_DEBUG_PLOC_MPSOC == 1 */
|
||||||
handleDeviceTM(packet.getPacketData(), packet.getPacketDataLength() - 1, mpsoc::TM_CAM_CMD_RPT);
|
handleDeviceTM(packet.getPacketData(), packet.getPacketDataLength() - 1, mpsoc::TM_CAM_CMD_RPT);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -799,6 +832,14 @@ size_t PlocMPSoCHandler::getNextReplyLength(DeviceCommandId_t commandId) {
|
|||||||
return replyLen;
|
return replyLen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ReturnValue_t PlocMPSoCHandler::doSendReadHook() {
|
||||||
|
// Prevent DHB from polling UART during commands executed by the mpsoc helper task
|
||||||
|
if (plocMPSoCHelperExecuting) {
|
||||||
|
return RETURN_FAILED;
|
||||||
|
}
|
||||||
|
return RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
MessageQueueIF* PlocMPSoCHandler::getCommandQueuePtr() { return commandActionHelperQueue; }
|
MessageQueueIF* PlocMPSoCHandler::getCommandQueuePtr() { return commandActionHelperQueue; }
|
||||||
|
|
||||||
void PlocMPSoCHandler::stepSuccessfulReceived(ActionId_t actionId, uint8_t step) { return; }
|
void PlocMPSoCHandler::stepSuccessfulReceived(ActionId_t actionId, uint8_t step) { return; }
|
||||||
@ -806,16 +847,19 @@ void PlocMPSoCHandler::stepSuccessfulReceived(ActionId_t actionId, uint8_t step)
|
|||||||
void PlocMPSoCHandler::stepFailedReceived(ActionId_t actionId, uint8_t step,
|
void PlocMPSoCHandler::stepFailedReceived(ActionId_t actionId, uint8_t step,
|
||||||
ReturnValue_t returnCode) {
|
ReturnValue_t returnCode) {
|
||||||
switch (actionId) {
|
switch (actionId) {
|
||||||
case supv::START_MPSOC:
|
case supv::START_MPSOC: {
|
||||||
sif::warning << "PlocMPSoCHandler::stepFailedReceived: Failed to start MPSoC" << std::endl;
|
sif::warning << "PlocMPSoCHandler::stepFailedReceived: Failed to start MPSoC" << std::endl;
|
||||||
|
// This usually happens when the supervisor handler is in off mode
|
||||||
powerState = PowerState::OFF;
|
powerState = PowerState::OFF;
|
||||||
|
setMode(MODE_OFF);
|
||||||
break;
|
break;
|
||||||
case supv::SHUTDOWN_MPSOC:
|
}
|
||||||
|
case supv::SHUTDOWN_MPSOC: {
|
||||||
triggerEvent(MPSOC_SHUTDOWN_FAILED);
|
triggerEvent(MPSOC_SHUTDOWN_FAILED);
|
||||||
sif::warning << "PlocMPSoCHandler::stepFailedReceived: Failed to shutdown MPSoC" << std::endl;
|
sif::warning << "PlocMPSoCHandler::stepFailedReceived: Failed to shutdown MPSoC" << std::endl;
|
||||||
// TODO: Setting state to on or off here?
|
powerState = PowerState::OFF;
|
||||||
powerState = PowerState::ON;
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
sif::debug << "PlocMPSoCHandler::stepFailedReceived: Received unexpected action reply"
|
sif::debug << "PlocMPSoCHandler::stepFailedReceived: Received unexpected action reply"
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
@ -879,10 +923,11 @@ void PlocMPSoCHandler::handleDeviceTM(const uint8_t* data, size_t dataSize,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PlocMPSoCHandler::disableAllReplies() {
|
void PlocMPSoCHandler::disableAllReplies() {
|
||||||
|
using namespace mpsoc;
|
||||||
DeviceReplyMap::iterator iter;
|
DeviceReplyMap::iterator iter;
|
||||||
|
|
||||||
/* Disable ack reply */
|
/* Disable ack reply */
|
||||||
iter = deviceReplyMap.find(mpsoc::ACK_REPORT);
|
iter = deviceReplyMap.find(ACK_REPORT);
|
||||||
DeviceReplyInfo* info = &(iter->second);
|
DeviceReplyInfo* info = &(iter->second);
|
||||||
info->delayCycles = 0;
|
info->delayCycles = 0;
|
||||||
info->command = deviceCommandMap.end();
|
info->command = deviceCommandMap.end();
|
||||||
@ -891,17 +936,26 @@ void PlocMPSoCHandler::disableAllReplies() {
|
|||||||
|
|
||||||
/* If the command expects a telemetry packet the appropriate tm reply will be disabled here */
|
/* If the command expects a telemetry packet the appropriate tm reply will be disabled here */
|
||||||
switch (commandId) {
|
switch (commandId) {
|
||||||
case mpsoc::TC_MEM_WRITE:
|
case TC_MEM_WRITE:
|
||||||
break;
|
break;
|
||||||
case mpsoc::TC_MEM_READ: {
|
case TC_MEM_READ: {
|
||||||
iter = deviceReplyMap.find(mpsoc::TM_MEMORY_READ_REPORT);
|
iter = deviceReplyMap.find(TM_MEMORY_READ_REPORT);
|
||||||
info = &(iter->second);
|
info = &(iter->second);
|
||||||
info->delayCycles = 0;
|
info->delayCycles = 0;
|
||||||
|
info->active = false;
|
||||||
|
info->command = deviceCommandMap.end();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case TC_CAM_CMD_SEND: {
|
||||||
|
iter = deviceReplyMap.find(TM_CAM_CMD_RPT);
|
||||||
|
info = &(iter->second);
|
||||||
|
info->delayCycles = 0;
|
||||||
|
info->active = false;
|
||||||
info->command = deviceCommandMap.end();
|
info->command = deviceCommandMap.end();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
sif::debug << "PlocMPSoCHandler::disableAllReplies: Unknown command id" << commandId
|
sif::debug << "PlocMPSoCHandler::disableAllReplies: Unknown command id: " << commandId
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -959,15 +1013,19 @@ void PlocMPSoCHandler::handleActionCommandFailure(ActionId_t actionId) {
|
|||||||
}
|
}
|
||||||
switch (powerState) {
|
switch (powerState) {
|
||||||
case PowerState::BOOTING: {
|
case PowerState::BOOTING: {
|
||||||
sif::warning << "PlocMPSoCHandler::handleActionCommandFailure: Failed to boot MPSoC"
|
sif::info << "PlocMPSoCHandler::handleActionCommandFailure: MPSoC boot command failed"
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
powerState = PowerState::OFF;
|
// This is commonly the case when the MPSoC is already operational. Thus the power state is
|
||||||
|
// set to on here
|
||||||
|
powerState = PowerState::ON;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PowerState::SHUTDOWN: {
|
case PowerState::SHUTDOWN: {
|
||||||
|
// FDIR will intercept event and switch PLOC power off
|
||||||
|
triggerEvent(MPSOC_SHUTDOWN_FAILED);
|
||||||
sif::warning << "PlocMPSoCHandler::handleActionCommandFailure: Failed to shutdown MPSoC"
|
sif::warning << "PlocMPSoCHandler::handleActionCommandFailure: Failed to shutdown MPSoC"
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
powerState = PowerState::ON;
|
powerState = PowerState::OFF;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
#include "fsfw_hal/linux/uart/UartComIF.h"
|
#include "fsfw_hal/linux/uart/UartComIF.h"
|
||||||
#include "linux/devices/devicedefinitions/MPSoCReturnValuesIF.h"
|
#include "linux/devices/devicedefinitions/MPSoCReturnValuesIF.h"
|
||||||
#include "linux/devices/devicedefinitions/PlocMPSoCDefinitions.h"
|
#include "linux/devices/devicedefinitions/PlocMPSoCDefinitions.h"
|
||||||
|
#include "linux/devices/devicedefinitions/PlocSupervisorDefinitions.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This is the device handler for the MPSoC of the payload computer.
|
* @brief This is the device handler for the MPSoC of the payload computer.
|
||||||
@ -76,6 +77,7 @@ class PlocMPSoCHandler : public DeviceHandlerBase, public CommandsActionsIF {
|
|||||||
uint8_t expectedReplies = 1, bool useAlternateId = false,
|
uint8_t expectedReplies = 1, bool useAlternateId = false,
|
||||||
DeviceCommandId_t alternateReplyID = 0) override;
|
DeviceCommandId_t alternateReplyID = 0) override;
|
||||||
size_t getNextReplyLength(DeviceCommandId_t deviceCommand) override;
|
size_t getNextReplyLength(DeviceCommandId_t deviceCommand) override;
|
||||||
|
virtual ReturnValue_t doSendReadHook() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::PLOC_MPSOC_HANDLER;
|
static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::PLOC_MPSOC_HANDLER;
|
||||||
@ -94,7 +96,7 @@ class PlocMPSoCHandler : public DeviceHandlerBase, public CommandsActionsIF {
|
|||||||
static const Event MPSOC_HANDLER_CRC_FAILURE = MAKE_EVENT(4, severity::LOW);
|
static const Event MPSOC_HANDLER_CRC_FAILURE = MAKE_EVENT(4, severity::LOW);
|
||||||
//! [EXPORT] : [COMMENT] Packet sequence count in received space packet does not match expected
|
//! [EXPORT] : [COMMENT] Packet sequence count in received space packet does not match expected
|
||||||
//! count P1: Expected sequence count P2: Received sequence count
|
//! count P1: Expected sequence count P2: Received sequence count
|
||||||
static const Event MPSOC_HANDLER_SEQ_CNT_MISMATCH = MAKE_EVENT(5, severity::LOW);
|
static const Event MPSOC_HANDLER_SEQUENCE_COUNT_MISMATCH = MAKE_EVENT(5, severity::LOW);
|
||||||
//! [EXPORT] : [COMMENT] Supervisor fails to shutdown MPSoC. Requires to power off the PLOC and
|
//! [EXPORT] : [COMMENT] Supervisor fails to shutdown MPSoC. Requires to power off the PLOC and
|
||||||
//! thus also to shutdown the supervisor.
|
//! thus also to shutdown the supervisor.
|
||||||
static const Event MPSOC_SHUTDOWN_FAILED = MAKE_EVENT(6, severity::HIGH);
|
static const Event MPSOC_SHUTDOWN_FAILED = MAKE_EVENT(6, severity::HIGH);
|
||||||
@ -106,7 +108,11 @@ class PlocMPSoCHandler : public DeviceHandlerBase, public CommandsActionsIF {
|
|||||||
MessageQueueIF* eventQueue = nullptr;
|
MessageQueueIF* eventQueue = nullptr;
|
||||||
MessageQueueIF* commandActionHelperQueue = nullptr;
|
MessageQueueIF* commandActionHelperQueue = nullptr;
|
||||||
|
|
||||||
SourceSequenceCounter sequenceCount;
|
// Initiate the sequence count with the maximum value. It is incremented before
|
||||||
|
// a packet is sent, so the first value will be 0 accordingly using
|
||||||
|
// the wrap around of the counter.
|
||||||
|
SourceSequenceCounter sequenceCount =
|
||||||
|
SourceSequenceCounter(SpacePacketBase::LIMIT_SEQUENCE_COUNT - 1);
|
||||||
|
|
||||||
uint8_t commandBuffer[mpsoc::MAX_COMMAND_SIZE];
|
uint8_t commandBuffer[mpsoc::MAX_COMMAND_SIZE];
|
||||||
|
|
||||||
|
@ -204,7 +204,7 @@ ReturnValue_t PlocMPSoCHelper::sendCommand(mpsoc::TcBase& tc) {
|
|||||||
result = uartComIF->sendMessage(comCookie, tc.getWholeData(), tc.getFullSize());
|
result = uartComIF->sendMessage(comCookie, tc.getWholeData(), tc.getFullSize());
|
||||||
if (result != RETURN_OK) {
|
if (result != RETURN_OK) {
|
||||||
sif::warning << "PlocMPSoCHelper::sendCommand: Failed to send command" << std::endl;
|
sif::warning << "PlocMPSoCHelper::sendCommand: Failed to send command" << std::endl;
|
||||||
triggerEvent(SENDING_COMMAND_FAILED, result, static_cast<uint32_t>(internalState));
|
triggerEvent(MPSOC_SENDING_COMMAND_FAILED, result, static_cast<uint32_t>(internalState));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
@ -227,11 +227,11 @@ ReturnValue_t PlocMPSoCHelper::handleAck() {
|
|||||||
|
|
||||||
void PlocMPSoCHelper::handleAckApidFailure(uint16_t apid) {
|
void PlocMPSoCHelper::handleAckApidFailure(uint16_t apid) {
|
||||||
if (apid == mpsoc::apid::ACK_FAILURE) {
|
if (apid == mpsoc::apid::ACK_FAILURE) {
|
||||||
triggerEvent(ACK_FAILURE_REPORT, static_cast<uint32_t>(internalState));
|
triggerEvent(MPSOC_ACK_FAILURE_REPORT, static_cast<uint32_t>(internalState));
|
||||||
sif::warning << "PlocMPSoCHelper::handleAckApidFailure: Received acknowledgement failure "
|
sif::warning << "PlocMPSoCHelper::handleAckApidFailure: Received acknowledgement failure "
|
||||||
<< "report" << std::endl;
|
<< "report" << std::endl;
|
||||||
} else {
|
} else {
|
||||||
triggerEvent(ACK_INVALID_APID, apid, static_cast<uint32_t>(internalState));
|
triggerEvent(MPSOC_ACK_INVALID_APID, apid, static_cast<uint32_t>(internalState));
|
||||||
sif::warning << "PlocMPSoCHelper::handleAckApidFailure: Expected acknowledgement report "
|
sif::warning << "PlocMPSoCHelper::handleAckApidFailure: Expected acknowledgement report "
|
||||||
<< "but received space packet with apid " << std::hex << apid << std::endl;
|
<< "but received space packet with apid " << std::hex << apid << std::endl;
|
||||||
}
|
}
|
||||||
@ -254,11 +254,11 @@ ReturnValue_t PlocMPSoCHelper::handleExe() {
|
|||||||
|
|
||||||
void PlocMPSoCHelper::handleExeApidFailure(uint16_t apid) {
|
void PlocMPSoCHelper::handleExeApidFailure(uint16_t apid) {
|
||||||
if (apid == mpsoc::apid::EXE_FAILURE) {
|
if (apid == mpsoc::apid::EXE_FAILURE) {
|
||||||
triggerEvent(EXE_FAILURE_REPORT, static_cast<uint32_t>(internalState));
|
triggerEvent(MPSOC_EXE_FAILURE_REPORT, static_cast<uint32_t>(internalState));
|
||||||
sif::warning << "PlocMPSoCHelper::handleExeApidFailure: Received execution failure "
|
sif::warning << "PlocMPSoCHelper::handleExeApidFailure: Received execution failure "
|
||||||
<< "report" << std::endl;
|
<< "report" << std::endl;
|
||||||
} else {
|
} else {
|
||||||
triggerEvent(EXE_INVALID_APID, apid, static_cast<uint32_t>(internalState));
|
triggerEvent(MPSOC_EXE_INVALID_APID, apid, static_cast<uint32_t>(internalState));
|
||||||
sif::warning << "PlocMPSoCHelper::handleExeApidFailure: Expected execution report "
|
sif::warning << "PlocMPSoCHelper::handleExeApidFailure: Expected execution report "
|
||||||
<< "but received space packet with apid " << std::hex << apid << std::endl;
|
<< "but received space packet with apid " << std::hex << apid << std::endl;
|
||||||
}
|
}
|
||||||
@ -281,7 +281,7 @@ ReturnValue_t PlocMPSoCHelper::handleTmReception(mpsoc::TmPacket* tmPacket, size
|
|||||||
}
|
}
|
||||||
if (remainingBytes != 0) {
|
if (remainingBytes != 0) {
|
||||||
sif::warning << "PlocMPSoCHelper::handleTmReception: Failed to receive reply" << std::endl;
|
sif::warning << "PlocMPSoCHelper::handleTmReception: Failed to receive reply" << std::endl;
|
||||||
triggerEvent(MISSING_EXE, remainingBytes, static_cast<uint32_t>(internalState));
|
triggerEvent(MPSOC_MISSING_EXE, remainingBytes, static_cast<uint32_t>(internalState));
|
||||||
return RETURN_FAILED;
|
return RETURN_FAILED;
|
||||||
}
|
}
|
||||||
result = tmPacket->checkCrc();
|
result = tmPacket->checkCrc();
|
||||||
|
@ -29,10 +29,10 @@ class PlocMPSoCHelper : public SystemObject, public ExecutableObjectIF, public H
|
|||||||
//! [EXPORT] : [COMMENT] Flash write successful
|
//! [EXPORT] : [COMMENT] Flash write successful
|
||||||
static const Event MPSOC_FLASH_WRITE_SUCCESSFUL = MAKE_EVENT(1, severity::LOW);
|
static const Event MPSOC_FLASH_WRITE_SUCCESSFUL = MAKE_EVENT(1, severity::LOW);
|
||||||
//! [EXPORT] : [COMMENT] Communication interface returned failure when trying to send the command
|
//! [EXPORT] : [COMMENT] Communication interface returned failure when trying to send the command
|
||||||
//! ot the PLOC
|
//! to the MPSoC
|
||||||
//! P1: Return value returned by the communication interface sendMessage function
|
//! P1: Return value returned by the communication interface sendMessage function
|
||||||
//! P2: Internal state of MPSoC helper
|
//! P2: Internal state of MPSoC helper
|
||||||
static const Event SENDING_COMMAND_FAILED = MAKE_EVENT(2, severity::LOW);
|
static const Event MPSOC_SENDING_COMMAND_FAILED = MAKE_EVENT(2, severity::LOW);
|
||||||
//! [EXPORT] : [COMMENT] Request receive message of communication interface failed
|
//! [EXPORT] : [COMMENT] Request receive message of communication interface failed
|
||||||
//! P1: Return value returned by the communication interface requestReceiveMessage function
|
//! P1: Return value returned by the communication interface requestReceiveMessage function
|
||||||
//! P2: Internal state of MPSoC helper
|
//! P2: Internal state of MPSoC helper
|
||||||
@ -41,28 +41,28 @@ class PlocMPSoCHelper : public SystemObject, public ExecutableObjectIF, public H
|
|||||||
//! P1: Return value returned by the communication interface readingReceivedMessage function
|
//! P1: Return value returned by the communication interface readingReceivedMessage function
|
||||||
//! P2: Internal state of MPSoC helper
|
//! P2: Internal state of MPSoC helper
|
||||||
static const Event MPSOC_HELPER_READING_REPLY_FAILED = MAKE_EVENT(4, severity::LOW);
|
static const Event MPSOC_HELPER_READING_REPLY_FAILED = MAKE_EVENT(4, severity::LOW);
|
||||||
//! [EXPORT] : [COMMENT] Did not receive acknowledgement report
|
//! [EXPORT] : [COMMENT] Did not receive acknowledgment report
|
||||||
//! P1: Number of bytes missing
|
//! P1: Number of bytes missing
|
||||||
//! P2: Internal state of MPSoC helper
|
//! P2: Internal state of MPSoC helper
|
||||||
static const Event MISSING_ACK = MAKE_EVENT(5, severity::LOW);
|
static const Event MPSOC_MISSING_ACK = MAKE_EVENT(5, severity::LOW);
|
||||||
//! [EXPORT] : [COMMENT] Did not receive execution report
|
//! [EXPORT] : [COMMENT] Did not receive execution report
|
||||||
//! P1: Number of bytes missing
|
//! P1: Number of bytes missing
|
||||||
//! P2: Internal state of MPSoC helper
|
//! P2: Internal state of MPSoC helper
|
||||||
static const Event MISSING_EXE = MAKE_EVENT(6, severity::LOW);
|
static const Event MPSOC_MISSING_EXE = MAKE_EVENT(6, severity::LOW);
|
||||||
//! [EXPORT] : [COMMENT] Received acknowledgement failure report
|
//! [EXPORT] : [COMMENT] Received acknowledgment failure report
|
||||||
//! P1: Internal state of MPSoC
|
//! P1: Internal state of MPSoC
|
||||||
static const Event ACK_FAILURE_REPORT = MAKE_EVENT(7, severity::LOW);
|
static const Event MPSOC_ACK_FAILURE_REPORT = MAKE_EVENT(7, severity::LOW);
|
||||||
//! [EXPORT] : [COMMENT] Received execution failure report
|
//! [EXPORT] : [COMMENT] Received execution failure report
|
||||||
//! P1: Internal state of MPSoC
|
//! P1: Internal state of MPSoC
|
||||||
static const Event EXE_FAILURE_REPORT = MAKE_EVENT(8, severity::LOW);
|
static const Event MPSOC_EXE_FAILURE_REPORT = MAKE_EVENT(8, severity::LOW);
|
||||||
//! [EXPORT] : [COMMENT] Expected acknowledgement report but received space packet with other apid
|
//! [EXPORT] : [COMMENT] Expected acknowledgment report but received space packet with other apid
|
||||||
//! P1: Apid of received space packet
|
//! P1: Apid of received space packet
|
||||||
//! P2: Internal state of MPSoC
|
//! P2: Internal state of MPSoC
|
||||||
static const Event ACK_INVALID_APID = MAKE_EVENT(9, severity::LOW);
|
static const Event MPSOC_ACK_INVALID_APID = MAKE_EVENT(9, severity::LOW);
|
||||||
//! [EXPORT] : [COMMENT] Expected execution report but received space packet with other apid
|
//! [EXPORT] : [COMMENT] Expected execution report but received space packet with other apid
|
||||||
//! P1: Apid of received space packet
|
//! P1: Apid of received space packet
|
||||||
//! P2: Internal state of MPSoC
|
//! P2: Internal state of MPSoC
|
||||||
static const Event EXE_INVALID_APID = MAKE_EVENT(10, severity::LOW);
|
static const Event MPSOC_EXE_INVALID_APID = MAKE_EVENT(10, severity::LOW);
|
||||||
//! [EXPORT] : [COMMENT] Received sequence count does not match expected sequence count
|
//! [EXPORT] : [COMMENT] Received sequence count does not match expected sequence count
|
||||||
//! P1: Expected sequence count
|
//! P1: Expected sequence count
|
||||||
//! P2: Received sequence count
|
//! P2: Received sequence count
|
||||||
|
@ -121,7 +121,10 @@ void PlocMemoryDumper::doStateMachine() {
|
|||||||
void PlocMemoryDumper::stepSuccessfulReceived(ActionId_t actionId, uint8_t step) {}
|
void PlocMemoryDumper::stepSuccessfulReceived(ActionId_t actionId, uint8_t step) {}
|
||||||
|
|
||||||
void PlocMemoryDumper::stepFailedReceived(ActionId_t actionId, uint8_t step,
|
void PlocMemoryDumper::stepFailedReceived(ActionId_t actionId, uint8_t step,
|
||||||
ReturnValue_t returnCode) {}
|
ReturnValue_t returnCode) {
|
||||||
|
triggerEvent(MRAM_DUMP_FAILED);
|
||||||
|
state = State::IDLE;
|
||||||
|
}
|
||||||
|
|
||||||
void PlocMemoryDumper::dataReceived(ActionId_t actionId, const uint8_t* data, uint32_t size) {}
|
void PlocMemoryDumper::dataReceived(ActionId_t actionId, const uint8_t* data, uint32_t size) {}
|
||||||
|
|
||||||
@ -149,10 +152,9 @@ void PlocMemoryDumper::completionFailedReceived(ActionId_t actionId, ReturnValue
|
|||||||
case (supv::FIRST_MRAM_DUMP):
|
case (supv::FIRST_MRAM_DUMP):
|
||||||
case (supv::CONSECUTIVE_MRAM_DUMP):
|
case (supv::CONSECUTIVE_MRAM_DUMP):
|
||||||
triggerEvent(MRAM_DUMP_FAILED, mram.lastStartAddress);
|
triggerEvent(MRAM_DUMP_FAILED, mram.lastStartAddress);
|
||||||
|
pendingCommand = NONE;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
sif::debug << "PlocMemoryDumper::completionFailedReceived: Invalid pending command "
|
|
||||||
<< std::endl;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
state = State::IDLE;
|
state = State::IDLE;
|
||||||
@ -168,12 +170,12 @@ void PlocMemoryDumper::commandNextMramDump(ActionId_t dumpCommand) {
|
|||||||
tempStartAddress = mram.startAddress;
|
tempStartAddress = mram.startAddress;
|
||||||
tempEndAddress = mram.startAddress + MAX_MRAM_DUMP_SIZE;
|
tempEndAddress = mram.startAddress + MAX_MRAM_DUMP_SIZE;
|
||||||
mram.startAddress += MAX_MRAM_DUMP_SIZE;
|
mram.startAddress += MAX_MRAM_DUMP_SIZE;
|
||||||
mram.lastStartAddress = tempStartAddress;
|
|
||||||
} else {
|
} else {
|
||||||
tempStartAddress = mram.startAddress;
|
tempStartAddress = mram.startAddress;
|
||||||
tempEndAddress = mram.endAddress;
|
tempEndAddress = mram.endAddress;
|
||||||
mram.startAddress = mram.endAddress;
|
mram.startAddress = mram.endAddress;
|
||||||
}
|
}
|
||||||
|
mram.lastStartAddress = tempStartAddress;
|
||||||
|
|
||||||
MemoryParams params(tempStartAddress, tempEndAddress);
|
MemoryParams params(tempStartAddress, tempEndAddress);
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -2,19 +2,22 @@
|
|||||||
#define MISSION_DEVICES_PLOCSUPERVISORHANDLER_H_
|
#define MISSION_DEVICES_PLOCSUPERVISORHANDLER_H_
|
||||||
|
|
||||||
#include "OBSWConfig.h"
|
#include "OBSWConfig.h"
|
||||||
|
#include "PlocSupvHelper.h"
|
||||||
#include "bsp_q7s/memory/SdCardManager.h"
|
#include "bsp_q7s/memory/SdCardManager.h"
|
||||||
#include "devices/powerSwitcherList.h"
|
#include "devices/powerSwitcherList.h"
|
||||||
#include "fsfw/devicehandlers/DeviceHandlerBase.h"
|
#include "fsfw/devicehandlers/DeviceHandlerBase.h"
|
||||||
|
#include "fsfw/timemanager/Countdown.h"
|
||||||
#include "fsfw_hal/linux/gpio/Gpio.h"
|
#include "fsfw_hal/linux/gpio/Gpio.h"
|
||||||
#include "fsfw_hal/linux/gpio/LinuxLibgpioIF.h"
|
#include "fsfw_hal/linux/gpio/LinuxLibgpioIF.h"
|
||||||
#include "fsfw_hal/linux/uart/UartComIF.h"
|
#include "fsfw_hal/linux/uart/UartComIF.h"
|
||||||
#include "linux/devices/devicedefinitions/PlocSupervisorDefinitions.h"
|
#include "linux/devices/devicedefinitions/PlocSupervisorDefinitions.h"
|
||||||
|
#include "linux/devices/devicedefinitions/SupvReturnValuesIF.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This is the device handler for the supervisor of the PLOC which is programmed by
|
* @brief This is the device handler for the supervisor of the PLOC which is programmed by
|
||||||
* Thales.
|
* Thales.
|
||||||
*
|
*
|
||||||
* @details The PLOC uses the space packet protocol for communication. To each command the PLOC
|
* @details The PLOC uses the space packet protocol for communication. On each command the PLOC
|
||||||
* answers with at least one acknowledgment and one execution report.
|
* answers with at least one acknowledgment and one execution report.
|
||||||
* Flight manual:
|
* Flight manual:
|
||||||
* https://egit.irs.uni-stuttgart.de/redmine/projects/eive-flight-manual/wiki/PLOC_Commands
|
* https://egit.irs.uni-stuttgart.de/redmine/projects/eive-flight-manual/wiki/PLOC_Commands
|
||||||
@ -25,10 +28,14 @@
|
|||||||
class PlocSupervisorHandler : public DeviceHandlerBase {
|
class PlocSupervisorHandler : public DeviceHandlerBase {
|
||||||
public:
|
public:
|
||||||
PlocSupervisorHandler(object_id_t objectId, object_id_t uartComIFid, CookieIF* comCookie,
|
PlocSupervisorHandler(object_id_t objectId, object_id_t uartComIFid, CookieIF* comCookie,
|
||||||
Gpio uartIsolatorSwitch, power::Switch_t powerSwitch);
|
Gpio uartIsolatorSwitch, power::Switch_t powerSwitch,
|
||||||
|
PlocSupvHelper* supvHelper);
|
||||||
virtual ~PlocSupervisorHandler();
|
virtual ~PlocSupervisorHandler();
|
||||||
|
|
||||||
virtual ReturnValue_t initialize() override;
|
virtual ReturnValue_t initialize() override;
|
||||||
|
void performOperationHook() override;
|
||||||
|
ReturnValue_t executeAction(ActionId_t actionId, MessageQueueId_t commandedBy,
|
||||||
|
const uint8_t* data, size_t size) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void doStartUp() override;
|
void doStartUp() override;
|
||||||
@ -49,48 +56,10 @@ class PlocSupervisorHandler : public DeviceHandlerBase {
|
|||||||
uint8_t expectedReplies = 1, bool useAlternateId = false,
|
uint8_t expectedReplies = 1, bool useAlternateId = false,
|
||||||
DeviceCommandId_t alternateReplyID = 0) override;
|
DeviceCommandId_t alternateReplyID = 0) override;
|
||||||
size_t getNextReplyLength(DeviceCommandId_t deviceCommand) override;
|
size_t getNextReplyLength(DeviceCommandId_t deviceCommand) override;
|
||||||
|
ReturnValue_t doSendReadHook() override;
|
||||||
|
void doOffActivity() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const uint8_t INTERFACE_ID = CLASS_ID::PLOC_SUPERVISOR_HANDLER;
|
|
||||||
|
|
||||||
//! [EXPORT] : [COMMENT] Space Packet received from PLOC supervisor has invalid CRC
|
|
||||||
static const ReturnValue_t CRC_FAILURE = MAKE_RETURN_CODE(0xA0);
|
|
||||||
//! [EXPORT] : [COMMENT] Received ACK failure reply from PLOC supervisor
|
|
||||||
static const ReturnValue_t RECEIVED_ACK_FAILURE = MAKE_RETURN_CODE(0xA1);
|
|
||||||
//! [EXPORT] : [COMMENT] Received execution failure reply from PLOC supervisor
|
|
||||||
static const ReturnValue_t RECEIVED_EXE_FAILURE = MAKE_RETURN_CODE(0xA2);
|
|
||||||
//! [EXPORT] : [COMMENT] Received space packet with invalid APID from PLOC supervisor
|
|
||||||
static const ReturnValue_t INVALID_APID = MAKE_RETURN_CODE(0xA3);
|
|
||||||
//! [EXPORT] : [COMMENT] Failed to read current system time
|
|
||||||
static const ReturnValue_t GET_TIME_FAILURE = MAKE_RETURN_CODE(0xA4);
|
|
||||||
//! [EXPORT] : [COMMENT] Received command with invalid watchdog parameter. Valid watchdogs are 0
|
|
||||||
//! for PS, 1 for PL and 2 for INT
|
|
||||||
static const ReturnValue_t INVALID_WATCHDOG = MAKE_RETURN_CODE(0xA5);
|
|
||||||
//! [EXPORT] : [COMMENT] Received watchdog timeout config command with invalid timeout. Valid
|
|
||||||
//! timeouts must be in the range between 1000 and 360000 ms.
|
|
||||||
static const ReturnValue_t INVALID_WATCHDOG_TIMEOUT = MAKE_RETURN_CODE(0xA6);
|
|
||||||
//! [EXPORT] : [COMMENT] Received latchup config command with invalid latchup ID
|
|
||||||
static const ReturnValue_t INVALID_LATCHUP_ID = MAKE_RETURN_CODE(0xA7);
|
|
||||||
//! [EXPORT] : [COMMENT] Received set adc sweep period command with invalid sweep period. Must be
|
|
||||||
//! larger than 21.
|
|
||||||
static const ReturnValue_t SWEEP_PERIOD_TOO_SMALL = MAKE_RETURN_CODE(0xA8);
|
|
||||||
//! [EXPORT] : [COMMENT] Receive auto EM test command with invalid test param. Valid params are 1
|
|
||||||
//! and 2.
|
|
||||||
static const ReturnValue_t INVALID_TEST_PARAM = MAKE_RETURN_CODE(0xA9);
|
|
||||||
//! [EXPORT] : [COMMENT] Returned when scanning for MRAM dump packets failed.
|
|
||||||
static const ReturnValue_t MRAM_PACKET_PARSING_FAILURE = MAKE_RETURN_CODE(0xAA);
|
|
||||||
//! [EXPORT] : [COMMENT] Returned when the start and stop addresses of the MRAM dump or MRAM wipe
|
|
||||||
//! commands are invalid (e.g. start address bigger than stop address)
|
|
||||||
static const ReturnValue_t INVALID_MRAM_ADDRESSES = MAKE_RETURN_CODE(0xAB);
|
|
||||||
//! [EXPORT] : [COMMENT] Expect reception of an MRAM dump packet but received space packet with
|
|
||||||
//! other apid.
|
|
||||||
static const ReturnValue_t NO_MRAM_PACKET = MAKE_RETURN_CODE(0xAC);
|
|
||||||
//! [EXPORT] : [COMMENT] Path to PLOC directory on SD card does not exist
|
|
||||||
static const ReturnValue_t PATH_DOES_NOT_EXIST = MAKE_RETURN_CODE(0xAD);
|
|
||||||
//! [EXPORT] : [COMMENT] MRAM dump file does not exists. The file should actually already have
|
|
||||||
//! been created with the reception of the first dump packet.
|
|
||||||
static const ReturnValue_t MRAM_FILE_NOT_EXISTS = MAKE_RETURN_CODE(0xAE);
|
|
||||||
|
|
||||||
static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::PLOC_SUPERVISOR_HANDLER;
|
static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::PLOC_SUPERVISOR_HANDLER;
|
||||||
|
|
||||||
//! [EXPORT] : [COMMENT] PLOC supervisor crc failure in telemetry packet
|
//! [EXPORT] : [COMMENT] PLOC supervisor crc failure in telemetry packet
|
||||||
@ -98,12 +67,35 @@ class PlocSupervisorHandler : public DeviceHandlerBase {
|
|||||||
//! [EXPORT] : [COMMENT] PLOC supervisor received acknowledgment failure report
|
//! [EXPORT] : [COMMENT] PLOC supervisor received acknowledgment failure report
|
||||||
static const Event SUPV_ACK_FAILURE = MAKE_EVENT(2, severity::LOW);
|
static const Event SUPV_ACK_FAILURE = MAKE_EVENT(2, severity::LOW);
|
||||||
//! [EXPORT] : [COMMENT] PLOC received execution failure report
|
//! [EXPORT] : [COMMENT] PLOC received execution failure report
|
||||||
|
//! P1: ID of command for which the execution failed
|
||||||
|
//! P2: Status code sent by the supervisor handler
|
||||||
static const Event SUPV_EXE_FAILURE = MAKE_EVENT(3, severity::LOW);
|
static const Event SUPV_EXE_FAILURE = MAKE_EVENT(3, severity::LOW);
|
||||||
//! [EXPORT] : [COMMENT] PLOC supervisor reply has invalid crc
|
//! [EXPORT] : [COMMENT] PLOC supervisor reply has invalid crc
|
||||||
static const Event SUPV_CRC_FAILURE_EVENT = MAKE_EVENT(4, severity::LOW);
|
static const Event SUPV_CRC_FAILURE_EVENT = MAKE_EVENT(4, severity::LOW);
|
||||||
|
//! [EXPORT] : [COMMENT] Supervisor helper currently executing a command
|
||||||
|
static const Event SUPV_HELPER_EXECUTING = MAKE_EVENT(5, severity::LOW);
|
||||||
|
//! [EXPORT] : [COMMENT] Failed to build the command to shutdown the MPSoC
|
||||||
|
static const Event SUPV_MPSOC_SHUWDOWN_BUILD_FAILED = MAKE_EVENT(5, severity::LOW);
|
||||||
|
|
||||||
static const uint16_t APID_MASK = 0x7FF;
|
static const uint16_t APID_MASK = 0x7FF;
|
||||||
static const uint16_t PACKET_SEQUENCE_COUNT_MASK = 0x3FFF;
|
static const uint16_t PACKET_SEQUENCE_COUNT_MASK = 0x3FFF;
|
||||||
|
static const uint8_t EXE_STATUS_OFFSET = 10;
|
||||||
|
static const uint8_t SIZE_NULL_TERMINATOR = 1;
|
||||||
|
// 5 s
|
||||||
|
static const uint32_t EXECUTION_DEFAULT_TIMEOUT = 5000;
|
||||||
|
// 70 S
|
||||||
|
static const uint32_t ACKNOWLEDGE_DEFAULT_TIMEOUT = 70000;
|
||||||
|
// 60 s
|
||||||
|
static const uint32_t MRAM_DUMP_EXECUTION_TIMEOUT = 60000;
|
||||||
|
// 70 s
|
||||||
|
static const uint32_t COPY_ADC_TO_MRAM_TIMEOUT = 70000;
|
||||||
|
// 60 s
|
||||||
|
static const uint32_t MRAM_DUMP_TIMEOUT = 60000;
|
||||||
|
// 2 s
|
||||||
|
static const uint32_t BOOT_TIMEOUT = 2000;
|
||||||
|
enum class StartupState : uint8_t { OFF, BOOTING, SET_TIME, SET_TIME_EXECUTING, ON };
|
||||||
|
|
||||||
|
StartupState startupState = StartupState::OFF;
|
||||||
|
|
||||||
uint8_t commandBuffer[supv::MAX_COMMAND_SIZE];
|
uint8_t commandBuffer[supv::MAX_COMMAND_SIZE];
|
||||||
|
|
||||||
@ -121,9 +113,14 @@ class PlocSupervisorHandler : public DeviceHandlerBase {
|
|||||||
supv::HkSet hkset;
|
supv::HkSet hkset;
|
||||||
supv::BootStatusReport bootStatusReport;
|
supv::BootStatusReport bootStatusReport;
|
||||||
supv::LatchupStatusReport latchupStatusReport;
|
supv::LatchupStatusReport latchupStatusReport;
|
||||||
|
supv::LoggingReport loggingReport;
|
||||||
|
supv::AdcReport adcReport;
|
||||||
|
|
||||||
const power::Switch_t powerSwitch = power::NO_SWITCH;
|
const power::Switch_t powerSwitch = power::NO_SWITCH;
|
||||||
|
|
||||||
|
PlocSupvHelper* supvHelper = nullptr;
|
||||||
|
MessageQueueIF* eventQueue = nullptr;
|
||||||
|
|
||||||
/** Number of expected replies following the MRAM dump command */
|
/** Number of expected replies following the MRAM dump command */
|
||||||
uint32_t expectedMramDumpPackets = 0;
|
uint32_t expectedMramDumpPackets = 0;
|
||||||
uint32_t receivedMramDumpPackets = 0;
|
uint32_t receivedMramDumpPackets = 0;
|
||||||
@ -135,16 +132,32 @@ class PlocSupervisorHandler : public DeviceHandlerBase {
|
|||||||
/** This buffer is used to concatenate space packets received in two different read steps */
|
/** This buffer is used to concatenate space packets received in two different read steps */
|
||||||
uint8_t spacePacketBuffer[supv::MAX_PACKET_SIZE];
|
uint8_t spacePacketBuffer[supv::MAX_PACKET_SIZE];
|
||||||
|
|
||||||
#ifdef TE0720_1CFA
|
#ifndef TE0720_1CFA
|
||||||
SdCardManager* sdcMan = nullptr;
|
SdCardManager* sdcMan = nullptr;
|
||||||
#endif /* BOARD_TE0720 == 0 */
|
#endif /* BOARD_TE0720 == 0 */
|
||||||
|
|
||||||
/** Path to PLOC specific files on SD card */
|
// Path to supervisor specific files on SD card
|
||||||
std::string plocFilePath = "ploc";
|
std::string supervisorFilePath = "ploc/supervisor";
|
||||||
std::string activeMramFile;
|
std::string activeMramFile;
|
||||||
|
|
||||||
/** Setting this variable to true will enable direct downlink of MRAM packets */
|
// Supervisor helper class currently executing a command
|
||||||
bool downlinkMramDump = false;
|
bool plocSupvHelperExecuting = false;
|
||||||
|
|
||||||
|
Countdown executionReportTimeout = Countdown(EXECUTION_DEFAULT_TIMEOUT, false);
|
||||||
|
Countdown acknowledgementReportTimeout = Countdown(ACKNOWLEDGE_DEFAULT_TIMEOUT, false);
|
||||||
|
// Vorago nees some time to boot properly
|
||||||
|
Countdown bootTimeout = Countdown(BOOT_TIMEOUT);
|
||||||
|
Countdown mramDumpTimeout = Countdown(MRAM_DUMP_TIMEOUT);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Adjusts the timeout of the execution report dependent on command
|
||||||
|
*/
|
||||||
|
void setExecutionTimeout(DeviceCommandId_t command);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Handles event messages received from the supervisor helper
|
||||||
|
*/
|
||||||
|
void handleEvent(EventMessage* eventMessage);
|
||||||
|
|
||||||
ReturnValue_t getSwitches(const uint8_t** switches, uint8_t* numberOfSwitches);
|
ReturnValue_t getSwitches(const uint8_t** switches, uint8_t* numberOfSwitches);
|
||||||
|
|
||||||
@ -193,6 +206,8 @@ class PlocSupervisorHandler : public DeviceHandlerBase {
|
|||||||
ReturnValue_t handleBootStatusReport(const uint8_t* data);
|
ReturnValue_t handleBootStatusReport(const uint8_t* data);
|
||||||
|
|
||||||
ReturnValue_t handleLatchupStatusReport(const uint8_t* data);
|
ReturnValue_t handleLatchupStatusReport(const uint8_t* data);
|
||||||
|
ReturnValue_t handleLoggingReport(const uint8_t* data);
|
||||||
|
ReturnValue_t handleAdcReport(const uint8_t* data);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Depending on the current active command, this function sets the reply id of the
|
* @brief Depending on the current active command, this function sets the reply id of the
|
||||||
@ -253,22 +268,17 @@ class PlocSupervisorHandler : public DeviceHandlerBase {
|
|||||||
|
|
||||||
ReturnValue_t prepareLatchupConfigCmd(const uint8_t* commandData,
|
ReturnValue_t prepareLatchupConfigCmd(const uint8_t* commandData,
|
||||||
DeviceCommandId_t deviceCommand);
|
DeviceCommandId_t deviceCommand);
|
||||||
ReturnValue_t prepareAutoCalibrateAlertCmd(const uint8_t* commandData);
|
|
||||||
ReturnValue_t prepareSetAlertLimitCmd(const uint8_t* commandData);
|
ReturnValue_t prepareSetAlertLimitCmd(const uint8_t* commandData);
|
||||||
ReturnValue_t prepareSetAlertIrqFilterCmd(const uint8_t* commandData);
|
|
||||||
ReturnValue_t prepareSetAdcSweetPeriodCmd(const uint8_t* commandData);
|
|
||||||
void prepareSetAdcEnabledChannelsCmd(const uint8_t* commandData);
|
void prepareSetAdcEnabledChannelsCmd(const uint8_t* commandData);
|
||||||
void prepareSetAdcWindowAndStrideCmd(const uint8_t* commandData);
|
void prepareSetAdcWindowAndStrideCmd(const uint8_t* commandData);
|
||||||
void prepareSetAdcThresholdCmd(const uint8_t* commandData);
|
void prepareSetAdcThresholdCmd(const uint8_t* commandData);
|
||||||
void prepareEnableNvmsCmd(const uint8_t* commandData);
|
|
||||||
void prepareSelectNvmCmd(const uint8_t* commandData);
|
|
||||||
ReturnValue_t prepareRunAutoEmTest(const uint8_t* commandData);
|
ReturnValue_t prepareRunAutoEmTest(const uint8_t* commandData);
|
||||||
ReturnValue_t prepareWipeMramCmd(const uint8_t* commandData);
|
ReturnValue_t prepareWipeMramCmd(const uint8_t* commandData);
|
||||||
ReturnValue_t prepareDumpMramCmd(const uint8_t* commandData);
|
ReturnValue_t prepareDumpMramCmd(const uint8_t* commandData);
|
||||||
void preparePrintCpuStatsCmd(const uint8_t* commandData);
|
|
||||||
void prepareSetDbgVerbosityCmd(const uint8_t* commandData);
|
|
||||||
void prepareSetGpioCmd(const uint8_t* commandData);
|
void prepareSetGpioCmd(const uint8_t* commandData);
|
||||||
void prepareReadGpioCmd(const uint8_t* commandData);
|
void prepareReadGpioCmd(const uint8_t* commandData);
|
||||||
|
ReturnValue_t prepareLoggingRequest(const uint8_t* commandData, size_t commandDataLen);
|
||||||
|
ReturnValue_t prepareEnableNvmsCommand(const uint8_t* commandData);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Copies the content of a space packet to the command buffer.
|
* @brief Copies the content of a space packet to the command buffer.
|
||||||
@ -282,6 +292,8 @@ class PlocSupervisorHandler : public DeviceHandlerBase {
|
|||||||
*/
|
*/
|
||||||
void disableAllReplies();
|
void disableAllReplies();
|
||||||
|
|
||||||
|
void disableReply(DeviceCommandId_t replyId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This function sends a failure report if the active action was commanded by an other
|
* @brief This function sends a failure report if the active action was commanded by an other
|
||||||
* object.
|
* object.
|
||||||
@ -348,6 +360,15 @@ class PlocSupervisorHandler : public DeviceHandlerBase {
|
|||||||
|
|
||||||
ReturnValue_t createMramDumpFile();
|
ReturnValue_t createMramDumpFile();
|
||||||
ReturnValue_t getTimeStampString(std::string& timeStamp);
|
ReturnValue_t getTimeStampString(std::string& timeStamp);
|
||||||
|
|
||||||
|
void prepareSetShutdownTimeoutCmd(const uint8_t* commandData);
|
||||||
|
|
||||||
|
ReturnValue_t extractUpdateCommand(const uint8_t* commandData, size_t size, std::string* file,
|
||||||
|
uint8_t* memoryId, uint32_t* startAddress);
|
||||||
|
ReturnValue_t eventSubscription();
|
||||||
|
|
||||||
|
void handleExecutionSuccessReport(const uint8_t* data);
|
||||||
|
void handleExecutionFailureReport(uint16_t statusCode);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* MISSION_DEVICES_PLOCSUPERVISORHANDLER_H_ */
|
#endif /* MISSION_DEVICES_PLOCSUPERVISORHANDLER_H_ */
|
||||||
|
562
linux/devices/ploc/PlocSupvHelper.cpp
Normal file
562
linux/devices/ploc/PlocSupvHelper.cpp
Normal file
@ -0,0 +1,562 @@
|
|||||||
|
#include "PlocSupvHelper.h"
|
||||||
|
|
||||||
|
#include <filesystem>
|
||||||
|
#include <fstream>
|
||||||
|
|
||||||
|
#include "OBSWConfig.h"
|
||||||
|
#ifdef XIPHOS_Q7S
|
||||||
|
#include "bsp_q7s/memory/FilesystemHelper.h"
|
||||||
|
#include "bsp_q7s/memory/SdCardManager.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "fsfw/globalfunctions/CRC.h"
|
||||||
|
#include "fsfw/tasks/TaskFactory.h"
|
||||||
|
#include "fsfw/timemanager/Countdown.h"
|
||||||
|
#include "mission/utility/Filenaming.h"
|
||||||
|
#include "mission/utility/ProgressPrinter.h"
|
||||||
|
#include "mission/utility/Timestamp.h"
|
||||||
|
|
||||||
|
PlocSupvHelper::PlocSupvHelper(object_id_t objectId) : SystemObject(objectId) {}
|
||||||
|
|
||||||
|
PlocSupvHelper::~PlocSupvHelper() {}
|
||||||
|
|
||||||
|
ReturnValue_t PlocSupvHelper::initialize() {
|
||||||
|
#ifdef XIPHOS_Q7S
|
||||||
|
sdcMan = SdCardManager::instance();
|
||||||
|
if (sdcMan == nullptr) {
|
||||||
|
sif::warning << "PlocSupvHelper::initialize: Invalid SD Card Manager" << std::endl;
|
||||||
|
return RETURN_FAILED;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t PlocSupvHelper::performOperation(uint8_t operationCode) {
|
||||||
|
ReturnValue_t result = RETURN_OK;
|
||||||
|
semaphore.acquire();
|
||||||
|
while (true) {
|
||||||
|
switch (internalState) {
|
||||||
|
case InternalState::IDLE: {
|
||||||
|
semaphore.acquire();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case InternalState::UPDATE: {
|
||||||
|
result = performUpdate();
|
||||||
|
if (result == RETURN_OK) {
|
||||||
|
triggerEvent(SUPV_UPDATE_SUCCESSFUL, result);
|
||||||
|
} else if (result == PROCESS_TERMINATED) {
|
||||||
|
// Event already triggered
|
||||||
|
} else {
|
||||||
|
triggerEvent(SUPV_UPDATE_FAILED, result);
|
||||||
|
}
|
||||||
|
internalState = InternalState::IDLE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case InternalState::CONTINUE_UPDATE: {
|
||||||
|
result = continueUpdate();
|
||||||
|
if (result == RETURN_OK) {
|
||||||
|
triggerEvent(SUPV_CONTINUE_UPDATE_SUCCESSFUL, result);
|
||||||
|
} else if (result == PROCESS_TERMINATED) {
|
||||||
|
// Event already triggered
|
||||||
|
} else {
|
||||||
|
triggerEvent(SUPV_CONTINUE_UPDATE_FAILED, result);
|
||||||
|
}
|
||||||
|
internalState = InternalState::IDLE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case InternalState::REQUEST_EVENT_BUFFER: {
|
||||||
|
result = performEventBufferRequest();
|
||||||
|
if (result == RETURN_OK) {
|
||||||
|
triggerEvent(SUPV_EVENT_BUFFER_REQUEST_SUCCESSFUL, result);
|
||||||
|
} else if (result == PROCESS_TERMINATED) {
|
||||||
|
// Event already triggered
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
triggerEvent(SUPV_EVENT_BUFFER_REQUEST_FAILED, result);
|
||||||
|
}
|
||||||
|
internalState = InternalState::IDLE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
sif::debug << "PlocSupvHelper::performOperation: Invalid state" << std::endl;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t PlocSupvHelper::setComIF(UartComIF* uartComIF_) {
|
||||||
|
if (uartComIF_ == nullptr) {
|
||||||
|
sif::warning << "PlocSupvHelper::initialize: Provided invalid uart com if" << std::endl;
|
||||||
|
return RETURN_FAILED;
|
||||||
|
}
|
||||||
|
uartComIF = uartComIF_;
|
||||||
|
return RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
void PlocSupvHelper::setComCookie(CookieIF* comCookie_) { comCookie = comCookie_; }
|
||||||
|
|
||||||
|
ReturnValue_t PlocSupvHelper::startUpdate(std::string file, uint8_t memoryId,
|
||||||
|
uint32_t startAddress) {
|
||||||
|
ReturnValue_t result = RETURN_OK;
|
||||||
|
#ifdef XIPHOS_Q7S
|
||||||
|
result = FilesystemHelper::checkPath(file);
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
sif::warning << "PlocSupvHelper::startUpdate: File " << file << " does not exist" << std::endl;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
result = FilesystemHelper::fileExists(file);
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
sif::warning << "PlocSupvHelper::startUpdate: The file " << file << " does not exist"
|
||||||
|
<< std::endl;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef TE0720_1CFA
|
||||||
|
if (not std::filesystem::exists(file)) {
|
||||||
|
sif::warning << "PlocSupvHelper::startUpdate: The file " << file << " does not exist"
|
||||||
|
<< std::endl;
|
||||||
|
return RETURN_FAILED;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
update.file = file;
|
||||||
|
update.length = getFileSize(update.file);
|
||||||
|
update.memoryId = memoryId;
|
||||||
|
update.startAddress = startAddress;
|
||||||
|
update.remainingSize = update.length;
|
||||||
|
update.bytesWritten = 0;
|
||||||
|
update.packetNum = 1;
|
||||||
|
update.sequenceCount = 1;
|
||||||
|
internalState = InternalState::UPDATE;
|
||||||
|
uartComIF->flushUartTxAndRxBuf(comCookie);
|
||||||
|
semaphore.release();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
void PlocSupvHelper::initiateUpdateContinuation() {
|
||||||
|
internalState = InternalState::CONTINUE_UPDATE;
|
||||||
|
semaphore.release();
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t PlocSupvHelper::startEventbBufferRequest(std::string path) {
|
||||||
|
#ifdef XIPHOS_Q7S
|
||||||
|
ReturnValue_t result = FilesystemHelper::checkPath(path);
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
if (not std::filesystem::exists(path)) {
|
||||||
|
return PATH_NOT_EXISTS;
|
||||||
|
}
|
||||||
|
eventBufferReq.path = path;
|
||||||
|
internalState = InternalState::REQUEST_EVENT_BUFFER;
|
||||||
|
uartComIF->flushUartTxAndRxBuf(comCookie);
|
||||||
|
semaphore.release();
|
||||||
|
return RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
void PlocSupvHelper::stopProcess() { terminate = true; }
|
||||||
|
|
||||||
|
ReturnValue_t PlocSupvHelper::performUpdate() {
|
||||||
|
ReturnValue_t result = RETURN_OK;
|
||||||
|
result = calcImageCrc();
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
result = selectMemory();
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
result = prepareUpdate();
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
result = eraseMemory();
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
result = writeUpdatePackets();
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
result = handleCheckMemoryCommand();
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t PlocSupvHelper::continueUpdate() {
|
||||||
|
ReturnValue_t result = prepareUpdate();
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
result = writeUpdatePackets();
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
result = handleCheckMemoryCommand();
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t PlocSupvHelper::writeUpdatePackets() {
|
||||||
|
ReturnValue_t result = RETURN_OK;
|
||||||
|
#if OBSW_DEBUG_PLOC_SUPERVISOR == 1
|
||||||
|
ProgressPrinter progressPrinter("Supervisor update", update.length,
|
||||||
|
ProgressPrinter::HALF_PERCENT);
|
||||||
|
#endif /* OBSW_DEBUG_PLOC_SUPERVISOR == 1 */
|
||||||
|
uint8_t tempData[supv::WriteMemory::CHUNK_MAX];
|
||||||
|
std::ifstream file(update.file, std::ifstream::binary);
|
||||||
|
uint16_t dataLength = 0;
|
||||||
|
supv::SequenceFlags seqFlags;
|
||||||
|
while (update.remainingSize > 0) {
|
||||||
|
if (terminate) {
|
||||||
|
terminate = false;
|
||||||
|
triggerEvent(TERMINATED_UPDATE_PROCEDURE);
|
||||||
|
return PROCESS_TERMINATED;
|
||||||
|
}
|
||||||
|
if (update.remainingSize > supv::WriteMemory::CHUNK_MAX) {
|
||||||
|
dataLength = supv::WriteMemory::CHUNK_MAX;
|
||||||
|
} else {
|
||||||
|
dataLength = static_cast<uint16_t>(update.remainingSize);
|
||||||
|
}
|
||||||
|
if (file.is_open()) {
|
||||||
|
file.seekg(update.bytesWritten, file.beg);
|
||||||
|
file.read(reinterpret_cast<char*>(tempData), dataLength);
|
||||||
|
if (!file) {
|
||||||
|
sif::warning << "PlocSupvHelper::performUpdate: Read only " << file.gcount() << " of "
|
||||||
|
<< dataLength << " bytes" << std::endl;
|
||||||
|
sif::info << "PlocSupvHelper::performUpdate: Failed when trying to read byte "
|
||||||
|
<< update.bytesWritten << std::endl;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return FILE_CLOSED_ACCIDENTALLY;
|
||||||
|
}
|
||||||
|
if (update.bytesWritten == 0) {
|
||||||
|
seqFlags = supv::SequenceFlags::FIRST_PKT;
|
||||||
|
} else if (update.remainingSize == 0) {
|
||||||
|
seqFlags = supv::SequenceFlags::LAST_PKT;
|
||||||
|
} else {
|
||||||
|
seqFlags = supv::SequenceFlags::CONTINUED_PKT;
|
||||||
|
}
|
||||||
|
supv::WriteMemory packet(seqFlags, update.sequenceCount++, update.memoryId,
|
||||||
|
update.startAddress + update.bytesWritten, dataLength, tempData);
|
||||||
|
result = handlePacketTransmission(packet);
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
update.sequenceCount--;
|
||||||
|
triggerEvent(WRITE_MEMORY_FAILED, update.packetNum);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
update.remainingSize -= dataLength;
|
||||||
|
update.packetNum += 1;
|
||||||
|
update.bytesWritten += dataLength;
|
||||||
|
#if OBSW_DEBUG_PLOC_SUPERVISOR == 1
|
||||||
|
progressPrinter.print(update.bytesWritten);
|
||||||
|
#endif /* OBSW_DEBUG_PLOC_SUPERVISOR == 1 */
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t PlocSupvHelper::performEventBufferRequest() {
|
||||||
|
using namespace supv;
|
||||||
|
ReturnValue_t result = RETURN_OK;
|
||||||
|
RequestLoggingData packet(RequestLoggingData::Sa::REQUEST_EVENT_BUFFERS);
|
||||||
|
result = sendCommand(packet);
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
result = handleAck();
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
result = handleEventBufferReception();
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
result = handleExe();
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t PlocSupvHelper::selectMemory() {
|
||||||
|
ReturnValue_t result = RETURN_OK;
|
||||||
|
supv::MPSoCBootSelect packet(update.memoryId);
|
||||||
|
result = handlePacketTransmission(packet);
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
return RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t PlocSupvHelper::prepareUpdate() {
|
||||||
|
ReturnValue_t result = RETURN_OK;
|
||||||
|
supv::ApidOnlyPacket packet(supv::APID_PREPARE_UPDATE);
|
||||||
|
result = handlePacketTransmission(packet, PREPARE_UPDATE_EXECUTION_REPORT);
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
return RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t PlocSupvHelper::eraseMemory() {
|
||||||
|
ReturnValue_t result = RETURN_OK;
|
||||||
|
supv::EraseMemory eraseMemory(update.memoryId, update.startAddress, update.length);
|
||||||
|
result = handlePacketTransmission(eraseMemory, supv::recv_timeout::ERASE_MEMORY);
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
return RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t PlocSupvHelper::handlePacketTransmission(SpacePacket& packet,
|
||||||
|
uint32_t timeoutExecutionReport) {
|
||||||
|
ReturnValue_t result = RETURN_OK;
|
||||||
|
result = sendCommand(packet);
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
result = handleAck();
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
result = handleExe(timeoutExecutionReport);
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
return RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t PlocSupvHelper::sendCommand(SpacePacket& packet) {
|
||||||
|
ReturnValue_t result = RETURN_OK;
|
||||||
|
rememberApid = packet.getAPID();
|
||||||
|
result = uartComIF->sendMessage(comCookie, packet.getWholeData(), packet.getFullSize());
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
sif::warning << "PlocSupvHelper::sendCommand: Failed to send command" << std::endl;
|
||||||
|
triggerEvent(SUPV_SENDING_COMMAND_FAILED, result, static_cast<uint32_t>(internalState));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t PlocSupvHelper::handleAck() {
|
||||||
|
ReturnValue_t result = RETURN_OK;
|
||||||
|
supv::AcknowledgmentReport ackReport;
|
||||||
|
result = handleTmReception(&ackReport, supv::SIZE_ACK_REPORT);
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
triggerEvent(ACK_RECEPTION_FAILURE, result, static_cast<uint32_t>(rememberApid));
|
||||||
|
sif::warning << "PlocSupvHelper::handleAck: Error in reception of acknowledgment report"
|
||||||
|
<< std::endl;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
result = ackReport.checkApid();
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
if (result == SupvReturnValuesIF::RECEIVED_ACK_FAILURE) {
|
||||||
|
triggerEvent(SUPV_ACK_FAILURE_REPORT, static_cast<uint32_t>(ackReport.getRefApid()));
|
||||||
|
} else if (result == SupvReturnValuesIF::INVALID_APID) {
|
||||||
|
triggerEvent(SUPV_ACK_INVALID_APID, static_cast<uint32_t>(rememberApid));
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
return RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t PlocSupvHelper::handleExe(uint32_t timeout) {
|
||||||
|
ReturnValue_t result = RETURN_OK;
|
||||||
|
supv::ExecutionReport exeReport;
|
||||||
|
result = handleTmReception(&exeReport, supv::SIZE_EXE_REPORT, timeout);
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
triggerEvent(EXE_RECEPTION_FAILURE, result, static_cast<uint32_t>(rememberApid));
|
||||||
|
sif::warning << "PlocSupvHelper::handleExe: Error in reception of execution report"
|
||||||
|
<< std::endl;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
result = exeReport.checkApid();
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
if (result == SupvReturnValuesIF::RECEIVED_EXE_FAILURE) {
|
||||||
|
triggerEvent(SUPV_EXE_FAILURE_REPORT, static_cast<uint32_t>(exeReport.getRefApid()));
|
||||||
|
} else if (result == SupvReturnValuesIF::INVALID_APID) {
|
||||||
|
triggerEvent(SUPV_EXE_INVALID_APID, static_cast<uint32_t>(rememberApid));
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
return RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t PlocSupvHelper::handleTmReception(supv::TmPacket* tmPacket, size_t remainingBytes,
|
||||||
|
uint32_t timeout) {
|
||||||
|
ReturnValue_t result = RETURN_OK;
|
||||||
|
size_t readBytes = 0;
|
||||||
|
size_t currentBytes = 0;
|
||||||
|
Countdown countdown(timeout);
|
||||||
|
while (!countdown.hasTimedOut()) {
|
||||||
|
result = receive(tmPacket->getWholeData() + readBytes, ¤tBytes, remainingBytes);
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
readBytes += currentBytes;
|
||||||
|
remainingBytes = remainingBytes - currentBytes;
|
||||||
|
if (remainingBytes == 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (remainingBytes != 0) {
|
||||||
|
sif::warning << "PlocSupvHelper::handleTmReception: Failed to read " << std::dec
|
||||||
|
<< remainingBytes << " bytes" << std::endl;
|
||||||
|
return RETURN_FAILED;
|
||||||
|
}
|
||||||
|
result = tmPacket->checkCrc();
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
sif::warning << "PlocSupvHelper::handleTmReception: CRC check failed" << std::endl;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t PlocSupvHelper::receive(uint8_t* data, size_t* readBytes, size_t requestBytes) {
|
||||||
|
ReturnValue_t result = RETURN_OK;
|
||||||
|
uint8_t* buffer = nullptr;
|
||||||
|
result = uartComIF->requestReceiveMessage(comCookie, requestBytes);
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
sif::warning << "PlocSupvHelper::receive: Failed to request reply" << std::endl;
|
||||||
|
triggerEvent(SUPV_HELPER_REQUESTING_REPLY_FAILED, result,
|
||||||
|
static_cast<uint32_t>(static_cast<uint32_t>(internalState)));
|
||||||
|
return RETURN_FAILED;
|
||||||
|
}
|
||||||
|
result = uartComIF->readReceivedMessage(comCookie, &buffer, readBytes);
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
sif::warning << "PlocSupvHelper::receive: Failed to read received message" << std::endl;
|
||||||
|
triggerEvent(SUPV_HELPER_READING_REPLY_FAILED, result, static_cast<uint32_t>(internalState));
|
||||||
|
return RETURN_FAILED;
|
||||||
|
}
|
||||||
|
if (*readBytes > 0) {
|
||||||
|
std::memcpy(data, buffer, *readBytes);
|
||||||
|
} else {
|
||||||
|
TaskFactory::delayTask(40);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t PlocSupvHelper::calcImageCrc() {
|
||||||
|
ReturnValue_t result = RETURN_OK;
|
||||||
|
#ifdef XIPHOS_Q7S
|
||||||
|
result = FilesystemHelper::checkPath(update.file);
|
||||||
|
#endif
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
sif::warning << "PlocSupvHelper::calcImageCrc: File " << update.file << " does not exist"
|
||||||
|
<< std::endl;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
std::ifstream file(update.file, std::ifstream::binary);
|
||||||
|
uint16_t remainder = CRC16_INIT;
|
||||||
|
uint8_t input;
|
||||||
|
#if OBSW_DEBUG_PLOC_SUPERVISOR == 1
|
||||||
|
ProgressPrinter progress("Supervisor update crc calculation", update.length,
|
||||||
|
ProgressPrinter::ONE_PERCENT);
|
||||||
|
#endif /* OBSW_DEBUG_PLOC_SUPERVISOR == 1 */
|
||||||
|
uint32_t byteCount = 0;
|
||||||
|
for (byteCount = 0; byteCount < update.length; byteCount++) {
|
||||||
|
file.seekg(byteCount, file.beg);
|
||||||
|
file.read(reinterpret_cast<char*>(&input), 1);
|
||||||
|
remainder = CRC::crc16ccitt(&input, sizeof(input), remainder);
|
||||||
|
#if OBSW_DEBUG_PLOC_SUPERVISOR == 1
|
||||||
|
progress.print(byteCount);
|
||||||
|
#endif /* OBSW_DEBUG_PLOC_SUPERVISOR == 1 */
|
||||||
|
}
|
||||||
|
#if OBSW_DEBUG_PLOC_SUPERVISOR == 1
|
||||||
|
progress.print(byteCount);
|
||||||
|
#endif /* OBSW_DEBUG_PLOC_SUPERVISOR == 1 */
|
||||||
|
file.close();
|
||||||
|
update.crc = remainder;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t PlocSupvHelper::handleCheckMemoryCommand() {
|
||||||
|
ReturnValue_t result = RETURN_OK;
|
||||||
|
// Verification of update write procedure
|
||||||
|
supv::CheckMemory packet(update.memoryId, update.startAddress, update.length);
|
||||||
|
result = sendCommand(packet);
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
result = handleAck();
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
supv::UpdateStatusReport updateStatusReport;
|
||||||
|
result = handleTmReception(&updateStatusReport,
|
||||||
|
static_cast<size_t>(updateStatusReport.getNominalSize()),
|
||||||
|
supv::recv_timeout::UPDATE_STATUS_REPORT);
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
sif::warning
|
||||||
|
<< "PlocSupvHelper::handleCheckMemoryCommand: Failed to receive update status report"
|
||||||
|
<< std::endl;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
result = handleExe(CRC_EXECUTION_TIMEOUT);
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
result = updateStatusReport.parseDataField();
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
result = updateStatusReport.verifycrc(update.crc);
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
sif::warning << "PlocSupvHelper::handleCheckMemoryCommand: CRC failure. Expected CRC 0x"
|
||||||
|
<< std::hex << update.crc << " but received CRC 0x" << updateStatusReport.getCrc()
|
||||||
|
<< std::endl;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t PlocSupvHelper::getFileSize(std::string filename) {
|
||||||
|
std::ifstream file(filename, std::ifstream::binary);
|
||||||
|
file.seekg(0, file.end);
|
||||||
|
uint32_t size = file.tellg();
|
||||||
|
file.close();
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t PlocSupvHelper::handleEventBufferReception() {
|
||||||
|
ReturnValue_t result = RETURN_OK;
|
||||||
|
std::string filename = Filenaming::generateAbsoluteFilename(
|
||||||
|
eventBufferReq.path, eventBufferReq.filename, timestamping);
|
||||||
|
std::ofstream file(filename, std::ios_base::app | std::ios_base::out);
|
||||||
|
uint32_t packetsRead = 0;
|
||||||
|
size_t requestLen = 0;
|
||||||
|
supv::TmPacket tmPacket;
|
||||||
|
for (packetsRead = 0; packetsRead < NUM_EVENT_BUFFER_PACKETS; packetsRead++) {
|
||||||
|
if (terminate) {
|
||||||
|
triggerEvent(SUPV_EVENT_BUFFER_REQUEST_TERMINATED, packetsRead - 1);
|
||||||
|
file.close();
|
||||||
|
return PROCESS_TERMINATED;
|
||||||
|
}
|
||||||
|
if (packetsRead == NUM_EVENT_BUFFER_PACKETS - 1) {
|
||||||
|
requestLen = SIZE_EVENT_BUFFER_LAST_PACKET;
|
||||||
|
} else {
|
||||||
|
requestLen = SIZE_EVENT_BUFFER_FULL_PACKET;
|
||||||
|
}
|
||||||
|
result = handleTmReception(&tmPacket, requestLen);
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
sif::debug << "PlocSupvHelper::handleEventBufferReception: Failed while trying to read packet"
|
||||||
|
<< " " << packetsRead + 1 << std::endl;
|
||||||
|
file.close();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
uint16_t apid = tmPacket.getAPID();
|
||||||
|
if (apid != supv::APID_MRAM_DUMP_TM) {
|
||||||
|
sif::warning << "PlocSupvHelper::handleEventBufferReception: Did not expect space packet "
|
||||||
|
<< "with APID 0x" << std::hex << apid << std::endl;
|
||||||
|
file.close();
|
||||||
|
return EVENT_BUFFER_REPLY_INVALID_APID;
|
||||||
|
}
|
||||||
|
file.write(reinterpret_cast<const char*>(tmPacket.getPacketData()),
|
||||||
|
tmPacket.getPayloadDataLength());
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
241
linux/devices/ploc/PlocSupvHelper.h
Normal file
241
linux/devices/ploc/PlocSupvHelper.h
Normal file
@ -0,0 +1,241 @@
|
|||||||
|
#ifndef BSP_Q7S_DEVICES_PLOCSUPVHELPER_H_
|
||||||
|
#define BSP_Q7S_DEVICES_PLOCSUPVHELPER_H_
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
#include "OBSWConfig.h"
|
||||||
|
#include "fsfw/devicehandlers/CookieIF.h"
|
||||||
|
#include "fsfw/objectmanager/SystemObject.h"
|
||||||
|
#include "fsfw/osal/linux/BinarySemaphore.h"
|
||||||
|
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
|
||||||
|
#include "fsfw/tasks/ExecutableObjectIF.h"
|
||||||
|
#include "fsfw_hal/linux/uart/UartComIF.h"
|
||||||
|
#include "linux/devices/devicedefinitions/PlocSupervisorDefinitions.h"
|
||||||
|
#ifdef XIPHOS_Q7S
|
||||||
|
#include "bsp_q7s/memory/SdCardManager.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Helper class for supervisor of PLOC intended to accelerate large data transfers between
|
||||||
|
* the supervisor and the OBC.
|
||||||
|
* @author J. Meier
|
||||||
|
*/
|
||||||
|
class PlocSupvHelper : public SystemObject, public ExecutableObjectIF, public HasReturnvaluesIF {
|
||||||
|
public:
|
||||||
|
static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::PLOC_SUPV_HELPER;
|
||||||
|
|
||||||
|
//! [EXPORT] : [COMMENT] update failed
|
||||||
|
static const Event SUPV_UPDATE_FAILED = MAKE_EVENT(0, severity::LOW);
|
||||||
|
//! [EXPORT] : [COMMENT] update successful
|
||||||
|
static const Event SUPV_UPDATE_SUCCESSFUL = MAKE_EVENT(1, severity::LOW);
|
||||||
|
//! [EXPORT] : [COMMENT] Continue update command failed
|
||||||
|
static const Event SUPV_CONTINUE_UPDATE_FAILED = MAKE_EVENT(2, severity::LOW);
|
||||||
|
//! [EXPORT] : [COMMENT] Continue update command successful
|
||||||
|
static const Event SUPV_CONTINUE_UPDATE_SUCCESSFUL = MAKE_EVENT(3, severity::LOW);
|
||||||
|
//! [EXPORT] : [COMMENT] Terminated update procedure by command
|
||||||
|
static const Event TERMINATED_UPDATE_PROCEDURE = MAKE_EVENT(4, severity::LOW);
|
||||||
|
//! [EXPORT] : [COMMENT] Requesting event buffer was successful
|
||||||
|
static const Event SUPV_EVENT_BUFFER_REQUEST_SUCCESSFUL = MAKE_EVENT(5, severity::LOW);
|
||||||
|
//! [EXPORT] : [COMMENT] Requesting event buffer failed
|
||||||
|
static const Event SUPV_EVENT_BUFFER_REQUEST_FAILED = MAKE_EVENT(6, severity::LOW);
|
||||||
|
//! [EXPORT] : [COMMENT] Terminated event buffer request by command
|
||||||
|
//! P1: Number of packets read before process was terminated
|
||||||
|
static const Event SUPV_EVENT_BUFFER_REQUEST_TERMINATED = MAKE_EVENT(7, severity::LOW);
|
||||||
|
//! [EXPORT] : [COMMENT] Communication interface returned failure when trying to send the command
|
||||||
|
//! to the supervisor
|
||||||
|
//! P1: Return value returned by the communication interface sendMessage function
|
||||||
|
//! P2: Internal state of supervisor helper
|
||||||
|
static const Event SUPV_SENDING_COMMAND_FAILED = MAKE_EVENT(8, severity::LOW);
|
||||||
|
//! [EXPORT] : [COMMENT] Request receive message of communication interface failed
|
||||||
|
//! P1: Return value returned by the communication interface requestReceiveMessage function
|
||||||
|
//! P2: Internal state of supervisor helper
|
||||||
|
static const Event SUPV_HELPER_REQUESTING_REPLY_FAILED = MAKE_EVENT(9, severity::LOW);
|
||||||
|
//! [EXPORT] : [COMMENT] Reading receive message of communication interface failed
|
||||||
|
//! P1: Return value returned by the communication interface readingReceivedMessage function
|
||||||
|
//! P2: Internal state of supervisor helper
|
||||||
|
static const Event SUPV_HELPER_READING_REPLY_FAILED = MAKE_EVENT(10, severity::LOW);
|
||||||
|
//! [EXPORT] : [COMMENT] Did not receive acknowledgement report
|
||||||
|
//! P1: Number of bytes missing
|
||||||
|
//! P2: Internal state of MPSoC helper
|
||||||
|
static const Event SUPV_MISSING_ACK = MAKE_EVENT(11, severity::LOW);
|
||||||
|
//! [EXPORT] : [COMMENT] Supervisor did not receive execution report
|
||||||
|
//! P1: Number of bytes missing
|
||||||
|
//! P2: Internal state of supervisor helper
|
||||||
|
static const Event SUPV_MISSING_EXE = MAKE_EVENT(12, severity::LOW);
|
||||||
|
//! [EXPORT] : [COMMENT] Supervisor received acknowledgment failure report
|
||||||
|
//! P1: Internal state of supervisor helper
|
||||||
|
static const Event SUPV_ACK_FAILURE_REPORT = MAKE_EVENT(13, severity::LOW);
|
||||||
|
//! [EXPORT] : [COMMENT] Execution report failure
|
||||||
|
//! P1:
|
||||||
|
static const Event SUPV_EXE_FAILURE_REPORT = MAKE_EVENT(14, severity::LOW);
|
||||||
|
//! [EXPORT] : [COMMENT] Supervisor expected acknowledgment report but received space packet with
|
||||||
|
//! other apid P1: Apid of received space packet P2: Internal state of supervisor helper
|
||||||
|
static const Event SUPV_ACK_INVALID_APID = MAKE_EVENT(15, severity::LOW);
|
||||||
|
//! [EXPORT] : [COMMENT] Supervisor helper expected execution report but received space packet
|
||||||
|
//! with other apid P1: Apid of received space packet P2: Internal state of supervisor helper
|
||||||
|
static const Event SUPV_EXE_INVALID_APID = MAKE_EVENT(16, severity::LOW);
|
||||||
|
//! [EXPORT] : [COMMENT] Failed to receive acknowledgment report
|
||||||
|
//! P1: Return value
|
||||||
|
//! P2: Apid of command for which the reception of the acknowledgment report failed
|
||||||
|
static const Event ACK_RECEPTION_FAILURE = MAKE_EVENT(17, severity::LOW);
|
||||||
|
//! [EXPORT] : [COMMENT] Failed to receive execution report
|
||||||
|
//! P1: Return value
|
||||||
|
//! P2: Apid of command for which the reception of the execution report failed
|
||||||
|
static const Event EXE_RECEPTION_FAILURE = MAKE_EVENT(18, severity::LOW);
|
||||||
|
//! [EXPORT] : [COMMENT] Update procedure failed when sending packet with number P1
|
||||||
|
//! P1: Packet number for which the memory write command fails
|
||||||
|
static const Event WRITE_MEMORY_FAILED = MAKE_EVENT(19, severity::LOW);
|
||||||
|
|
||||||
|
PlocSupvHelper(object_id_t objectId);
|
||||||
|
virtual ~PlocSupvHelper();
|
||||||
|
|
||||||
|
ReturnValue_t initialize() override;
|
||||||
|
ReturnValue_t performOperation(uint8_t operationCode = 0) override;
|
||||||
|
|
||||||
|
ReturnValue_t setComIF(UartComIF* uartComfIF_);
|
||||||
|
void setComCookie(CookieIF* comCookie_);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Starts update procedure
|
||||||
|
*
|
||||||
|
* @param file File containing the update data
|
||||||
|
* @param memoryId ID of the memory where to write to
|
||||||
|
* @param startAddress Address where to write data
|
||||||
|
*
|
||||||
|
* @return RETURN_OK if successful, otherwise error return value
|
||||||
|
*/
|
||||||
|
ReturnValue_t startUpdate(std::string file, uint8_t memoryId, uint32_t startAddress);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This initiate the continuation of a failed update.
|
||||||
|
*/
|
||||||
|
void initiateUpdateContinuation();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Calling this function will initiate the procedure to request the event buffer
|
||||||
|
*/
|
||||||
|
ReturnValue_t startEventbBufferRequest(std::string path);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Can be used to interrupt a running data transfer.
|
||||||
|
*/
|
||||||
|
void stopProcess();
|
||||||
|
|
||||||
|
private:
|
||||||
|
static const uint8_t INTERFACE_ID = CLASS_ID::PLOC_SUPV_HELPER;
|
||||||
|
|
||||||
|
//! [EXPORT] : [COMMENT] File accidentally close
|
||||||
|
static const ReturnValue_t FILE_CLOSED_ACCIDENTALLY = MAKE_RETURN_CODE(0xA0);
|
||||||
|
//! [EXPORT] : [COMMENT] Process has been terminated by command
|
||||||
|
static const ReturnValue_t PROCESS_TERMINATED = MAKE_RETURN_CODE(0xA1);
|
||||||
|
//! [EXPORT] : [COMMENT] Received command with invalid pathname
|
||||||
|
static const ReturnValue_t PATH_NOT_EXISTS = MAKE_RETURN_CODE(0xA2);
|
||||||
|
//! [EXPORT] : [COMMENT] Expected event buffer TM but received space packet with other APID
|
||||||
|
static const ReturnValue_t EVENT_BUFFER_REPLY_INVALID_APID = MAKE_RETURN_CODE(0xA3);
|
||||||
|
|
||||||
|
static const uint16_t CRC16_INIT = 0xFFFF;
|
||||||
|
// Event buffer reply will carry 24 space packets with 1016 bytes and one space packet with
|
||||||
|
// 192 bytes
|
||||||
|
static const uint8_t NUM_EVENT_BUFFER_PACKETS = 25;
|
||||||
|
static const size_t SIZE_EVENT_BUFFER_FULL_PACKET = 1024;
|
||||||
|
static const size_t SIZE_EVENT_BUFFER_LAST_PACKET = 200;
|
||||||
|
static const uint32_t CRC_EXECUTION_TIMEOUT = 60000;
|
||||||
|
static const uint32_t PREPARE_UPDATE_EXECUTION_REPORT = 2000;
|
||||||
|
|
||||||
|
struct Update {
|
||||||
|
uint8_t memoryId;
|
||||||
|
uint32_t startAddress;
|
||||||
|
// Absolute name of file containing update data
|
||||||
|
std::string file;
|
||||||
|
// Size of update
|
||||||
|
uint32_t length;
|
||||||
|
uint32_t crc;
|
||||||
|
size_t remainingSize;
|
||||||
|
size_t bytesWritten;
|
||||||
|
uint32_t packetNum;
|
||||||
|
uint16_t sequenceCount;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Update update;
|
||||||
|
|
||||||
|
struct EventBufferRequest {
|
||||||
|
std::string path = "";
|
||||||
|
// Default name of file where event buffer data will be written to. Timestamp will be added to
|
||||||
|
// name when new file is created
|
||||||
|
std::string filename = "event-buffer.bin";
|
||||||
|
};
|
||||||
|
|
||||||
|
EventBufferRequest eventBufferReq;
|
||||||
|
|
||||||
|
enum class InternalState { IDLE, UPDATE, CONTINUE_UPDATE, REQUEST_EVENT_BUFFER };
|
||||||
|
|
||||||
|
InternalState internalState = InternalState::IDLE;
|
||||||
|
|
||||||
|
BinarySemaphore semaphore;
|
||||||
|
#ifdef XIPHOS_Q7S
|
||||||
|
SdCardManager* sdcMan = nullptr;
|
||||||
|
#endif
|
||||||
|
uint8_t commandBuffer[supv::MAX_COMMAND_SIZE];
|
||||||
|
|
||||||
|
bool terminate = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Communication interface responsible for data transactions between OBC and Supervisor.
|
||||||
|
*/
|
||||||
|
UartComIF* uartComIF = nullptr;
|
||||||
|
// Communication cookie. Must be set by the supervisor Handler
|
||||||
|
CookieIF* comCookie = nullptr;
|
||||||
|
|
||||||
|
bool timestamping = true;
|
||||||
|
|
||||||
|
// Remembers APID to know at which command a procedure failed
|
||||||
|
uint16_t rememberApid = 0;
|
||||||
|
|
||||||
|
ReturnValue_t performUpdate();
|
||||||
|
ReturnValue_t continueUpdate();
|
||||||
|
ReturnValue_t writeUpdatePackets();
|
||||||
|
ReturnValue_t performEventBufferRequest();
|
||||||
|
ReturnValue_t handlePacketTransmission(SpacePacket& packet,
|
||||||
|
uint32_t timeoutExecutionReport = 60000);
|
||||||
|
ReturnValue_t sendCommand(SpacePacket& packet);
|
||||||
|
/**
|
||||||
|
* @brief Function which reads form the communication interface
|
||||||
|
*
|
||||||
|
* @param data Pointer to buffer where read data will be written to
|
||||||
|
* @param raedBytes Actual number of bytes read
|
||||||
|
* @param requestBytes Number of bytes to read
|
||||||
|
*/
|
||||||
|
ReturnValue_t receive(uint8_t* data, size_t* readBytes, size_t requestBytes);
|
||||||
|
ReturnValue_t handleAck();
|
||||||
|
ReturnValue_t handleExe(uint32_t timeout = 1000);
|
||||||
|
/**
|
||||||
|
* @brief Handles reading of TM packets from the communication interface
|
||||||
|
*
|
||||||
|
* @param tmPacket Pointer to space packet where received data will be written to
|
||||||
|
* @param reaminingBytes Number of bytes to read in the space packet
|
||||||
|
* @param timeout Receive timeout in milliseconds
|
||||||
|
*
|
||||||
|
* @note It can take up to 70 seconds until the supervisor replies with an acknowledgment
|
||||||
|
* failure report.
|
||||||
|
*/
|
||||||
|
ReturnValue_t handleTmReception(supv::TmPacket* tmPacket, size_t remainingBytes,
|
||||||
|
uint32_t timeout = 70000);
|
||||||
|
ReturnValue_t selectMemory();
|
||||||
|
ReturnValue_t prepareUpdate();
|
||||||
|
ReturnValue_t eraseMemory();
|
||||||
|
// Calculates CRC over image. Will be used for verification after update writing has
|
||||||
|
// finished.
|
||||||
|
ReturnValue_t calcImageCrc();
|
||||||
|
ReturnValue_t handleCheckMemoryCommand();
|
||||||
|
/**
|
||||||
|
* @brief Return size of file with name filename
|
||||||
|
*
|
||||||
|
* @param filename
|
||||||
|
*
|
||||||
|
* @return The size of the file
|
||||||
|
*/
|
||||||
|
uint32_t getFileSize(std::string filename);
|
||||||
|
ReturnValue_t handleEventBufferReception();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* BSP_Q7S_DEVICES_PLOCSUPVHELPER_H_ */
|
@ -1,385 +0,0 @@
|
|||||||
#include "PlocUpdater.h"
|
|
||||||
|
|
||||||
#include <filesystem>
|
|
||||||
#include <fstream>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
#include "fsfw/ipc/QueueFactory.h"
|
|
||||||
|
|
||||||
PlocUpdater::PlocUpdater(object_id_t objectId)
|
|
||||||
: SystemObject(objectId), commandActionHelper(this), actionHelper(this, nullptr) {
|
|
||||||
auto mqArgs = MqArgs(this->getObjectId());
|
|
||||||
commandQueue = QueueFactory::instance()->createMessageQueue(
|
|
||||||
QUEUE_SIZE, MessageQueueMessage::MAX_MESSAGE_SIZE, &mqArgs);
|
|
||||||
}
|
|
||||||
|
|
||||||
PlocUpdater::~PlocUpdater() {}
|
|
||||||
|
|
||||||
ReturnValue_t PlocUpdater::initialize() {
|
|
||||||
#ifdef XIPHOS_Q7S
|
|
||||||
sdcMan = SdCardManager::instance();
|
|
||||||
#endif
|
|
||||||
ReturnValue_t result = SystemObject::initialize();
|
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
result = commandActionHelper.initialize();
|
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
result = actionHelper.initialize(commandQueue);
|
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
ReturnValue_t PlocUpdater::performOperation(uint8_t operationCode) {
|
|
||||||
readCommandQueue();
|
|
||||||
doStateMachine();
|
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
ReturnValue_t PlocUpdater::executeAction(ActionId_t actionId, MessageQueueId_t commandedBy,
|
|
||||||
const uint8_t* data, size_t size) {
|
|
||||||
ReturnValue_t result = RETURN_FAILED;
|
|
||||||
|
|
||||||
if (state != State::IDLE) {
|
|
||||||
return IS_BUSY;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (size > MAX_PLOC_UPDATE_PATH) {
|
|
||||||
return NAME_TOO_LONG;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (actionId) {
|
|
||||||
case UPDATE_A_UBOOT:
|
|
||||||
image = Image::A;
|
|
||||||
partition = Partition::UBOOT;
|
|
||||||
break;
|
|
||||||
case UPDATE_A_BITSTREAM:
|
|
||||||
image = Image::A;
|
|
||||||
partition = Partition::BITSTREAM;
|
|
||||||
break;
|
|
||||||
case UPDATE_A_LINUX:
|
|
||||||
image = Image::A;
|
|
||||||
partition = Partition::LINUX_OS;
|
|
||||||
break;
|
|
||||||
case UPDATE_A_APP_SW:
|
|
||||||
image = Image::A;
|
|
||||||
partition = Partition::APP_SW;
|
|
||||||
break;
|
|
||||||
case UPDATE_B_UBOOT:
|
|
||||||
image = Image::B;
|
|
||||||
partition = Partition::UBOOT;
|
|
||||||
break;
|
|
||||||
case UPDATE_B_BITSTREAM:
|
|
||||||
image = Image::B;
|
|
||||||
partition = Partition::BITSTREAM;
|
|
||||||
break;
|
|
||||||
case UPDATE_B_LINUX:
|
|
||||||
image = Image::B;
|
|
||||||
partition = Partition::LINUX_OS;
|
|
||||||
break;
|
|
||||||
case UPDATE_B_APP_SW:
|
|
||||||
image = Image::B;
|
|
||||||
partition = Partition::APP_SW;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return INVALID_ACTION_ID;
|
|
||||||
}
|
|
||||||
|
|
||||||
result = getImageLocation(data, size);
|
|
||||||
|
|
||||||
if (result != RETURN_OK) {
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
state = State::UPDATE_AVAILABLE;
|
|
||||||
|
|
||||||
return EXECUTION_FINISHED;
|
|
||||||
}
|
|
||||||
|
|
||||||
MessageQueueId_t PlocUpdater::getCommandQueue() const { return commandQueue->getId(); }
|
|
||||||
|
|
||||||
MessageQueueIF* PlocUpdater::getCommandQueuePtr() { return commandQueue; }
|
|
||||||
|
|
||||||
void PlocUpdater::readCommandQueue() {
|
|
||||||
CommandMessage message;
|
|
||||||
ReturnValue_t result;
|
|
||||||
|
|
||||||
for (result = commandQueue->receiveMessage(&message); result == HasReturnvaluesIF::RETURN_OK;
|
|
||||||
result = commandQueue->receiveMessage(&message)) {
|
|
||||||
if (result != RETURN_OK) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
result = actionHelper.handleActionMessage(&message);
|
|
||||||
if (result == HasReturnvaluesIF::RETURN_OK) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
result = commandActionHelper.handleReply(&message);
|
|
||||||
if (result == HasReturnvaluesIF::RETURN_OK) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void PlocUpdater::doStateMachine() {
|
|
||||||
switch (state) {
|
|
||||||
case State::IDLE:
|
|
||||||
break;
|
|
||||||
case State::UPDATE_AVAILABLE:
|
|
||||||
commandUpdateAvailable();
|
|
||||||
break;
|
|
||||||
case State::UPDATE_TRANSFER:
|
|
||||||
commandUpdatePacket();
|
|
||||||
break;
|
|
||||||
case State::UPDATE_VERIFY:
|
|
||||||
commandUpdateVerify();
|
|
||||||
break;
|
|
||||||
case State::COMMAND_EXECUTING:
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ReturnValue_t PlocUpdater::checkNameLength(size_t size) {
|
|
||||||
if (size > MAX_PLOC_UPDATE_PATH) {
|
|
||||||
return NAME_TOO_LONG;
|
|
||||||
}
|
|
||||||
return RETURN_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
ReturnValue_t PlocUpdater::getImageLocation(const uint8_t* data, size_t size) {
|
|
||||||
ReturnValue_t result = checkNameLength(size);
|
|
||||||
if (result != RETURN_OK) {
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef XIPHOS_Q7S
|
|
||||||
// Check if file is stored on SD card and if associated SD card is mounted
|
|
||||||
if (std::string(reinterpret_cast<const char*>(data), SD_PREFIX_LENGTH) ==
|
|
||||||
std::string(SdCardManager::SD_0_MOUNT_POINT)) {
|
|
||||||
if (!sdcMan->isSdCardMounted(sd::SLOT_0)) {
|
|
||||||
sif::warning << "PlocUpdater::getImageLocation: SD card 0 not mounted" << std::endl;
|
|
||||||
return SD_NOT_MOUNTED;
|
|
||||||
}
|
|
||||||
} else if (std::string(reinterpret_cast<const char*>(data), SD_PREFIX_LENGTH) ==
|
|
||||||
std::string(SdCardManager::SD_1_MOUNT_POINT)) {
|
|
||||||
if (!sdcMan->isSdCardMounted(sd::SLOT_0)) {
|
|
||||||
sif::warning << "PlocUpdater::getImageLocation: SD card 1 not mounted" << std::endl;
|
|
||||||
return SD_NOT_MOUNTED;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// update image not stored on SD card
|
|
||||||
}
|
|
||||||
#endif /* BOARD_TE0720 == 0 */
|
|
||||||
|
|
||||||
updateFile = std::string(reinterpret_cast<const char*>(data), size);
|
|
||||||
|
|
||||||
// Check if file exists
|
|
||||||
if (not std::filesystem::exists(updateFile)) {
|
|
||||||
return FILE_NOT_EXISTS;
|
|
||||||
}
|
|
||||||
return RETURN_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
void PlocUpdater::stepSuccessfulReceived(ActionId_t actionId, uint8_t step) {}
|
|
||||||
|
|
||||||
void PlocUpdater::stepFailedReceived(ActionId_t actionId, uint8_t step, ReturnValue_t returnCode) {}
|
|
||||||
|
|
||||||
void PlocUpdater::dataReceived(ActionId_t actionId, const uint8_t* data, uint32_t size) {}
|
|
||||||
|
|
||||||
void PlocUpdater::completionSuccessfulReceived(ActionId_t actionId) {
|
|
||||||
switch (pendingCommand) {
|
|
||||||
case (supv::UPDATE_AVAILABLE):
|
|
||||||
state = State::UPDATE_TRANSFER;
|
|
||||||
break;
|
|
||||||
case (supv::UPDATE_IMAGE_DATA):
|
|
||||||
if (remainingPackets == 0) {
|
|
||||||
packetsSent = 0; // Reset packets sent variable for next update sequence
|
|
||||||
state = State::UPDATE_VERIFY;
|
|
||||||
} else {
|
|
||||||
state = State::UPDATE_TRANSFER;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case (supv::UPDATE_VERIFY):
|
|
||||||
triggerEvent(UPDATE_FINISHED);
|
|
||||||
state = State::IDLE;
|
|
||||||
pendingCommand = supv::NONE;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
state = State::IDLE;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void PlocUpdater::completionFailedReceived(ActionId_t actionId, ReturnValue_t returnCode) {
|
|
||||||
switch (pendingCommand) {
|
|
||||||
case (supv::UPDATE_AVAILABLE): {
|
|
||||||
triggerEvent(UPDATE_AVAILABLE_FAILED);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case (supv::UPDATE_IMAGE_DATA): {
|
|
||||||
triggerEvent(UPDATE_TRANSFER_FAILED, packetsSent);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case (supv::UPDATE_VERIFY): {
|
|
||||||
triggerEvent(UPDATE_VERIFY_FAILED);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
state = State::IDLE;
|
|
||||||
}
|
|
||||||
|
|
||||||
void PlocUpdater::commandUpdateAvailable() {
|
|
||||||
ReturnValue_t result = RETURN_OK;
|
|
||||||
|
|
||||||
if (not std::filesystem::exists(updateFile)) {
|
|
||||||
triggerEvent(UPDATE_FILE_NOT_EXISTS, static_cast<uint8_t>(state));
|
|
||||||
state = State::IDLE;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::ifstream file(updateFile, std::ifstream::binary);
|
|
||||||
file.seekg(0, file.end);
|
|
||||||
imageSize = static_cast<size_t>(file.tellg());
|
|
||||||
file.close();
|
|
||||||
|
|
||||||
numOfUpdatePackets = imageSize / MAX_SP_DATA;
|
|
||||||
if (imageSize % MAX_SP_DATA) {
|
|
||||||
numOfUpdatePackets++;
|
|
||||||
}
|
|
||||||
|
|
||||||
remainingPackets = numOfUpdatePackets;
|
|
||||||
packetsSent = 0;
|
|
||||||
|
|
||||||
calcImageCrc();
|
|
||||||
|
|
||||||
supv::UpdateInfo packet(supv::APID_UPDATE_AVAILABLE, static_cast<uint8_t>(image),
|
|
||||||
static_cast<uint8_t>(partition), imageSize, imageCrc, numOfUpdatePackets);
|
|
||||||
|
|
||||||
result =
|
|
||||||
commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, supv::UPDATE_AVAILABLE,
|
|
||||||
packet.getWholeData(), packet.getFullSize());
|
|
||||||
if (result != RETURN_OK) {
|
|
||||||
sif::warning << "PlocUpdater::commandUpdateAvailable: Failed to send update available"
|
|
||||||
<< " packet to supervisor handler" << std::endl;
|
|
||||||
triggerEvent(ACTION_COMMANDING_FAILED, result, supv::UPDATE_AVAILABLE);
|
|
||||||
state = State::IDLE;
|
|
||||||
pendingCommand = supv::NONE;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
pendingCommand = supv::UPDATE_AVAILABLE;
|
|
||||||
state = State::COMMAND_EXECUTING;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
void PlocUpdater::commandUpdatePacket() {
|
|
||||||
ReturnValue_t result = RETURN_OK;
|
|
||||||
uint16_t payloadLength = 0;
|
|
||||||
|
|
||||||
if (not std::filesystem::exists(updateFile)) {
|
|
||||||
triggerEvent(UPDATE_FILE_NOT_EXISTS, static_cast<uint8_t>(state), packetsSent);
|
|
||||||
state = State::IDLE;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::ifstream file(updateFile, std::ifstream::binary);
|
|
||||||
file.seekg(packetsSent * MAX_SP_DATA, file.beg);
|
|
||||||
|
|
||||||
if (remainingPackets == 1) {
|
|
||||||
payloadLength = imageSize - static_cast<uint16_t>(file.tellg());
|
|
||||||
} else {
|
|
||||||
payloadLength = MAX_SP_DATA;
|
|
||||||
}
|
|
||||||
|
|
||||||
supv::UpdatePacket packet(payloadLength);
|
|
||||||
file.read(reinterpret_cast<char*>(packet.getDataFieldPointer()), payloadLength);
|
|
||||||
file.close();
|
|
||||||
// sequence count of first packet is 1
|
|
||||||
packet.setPacketSequenceCount((packetsSent + 1) & supv::SEQUENCE_COUNT_MASK);
|
|
||||||
if (numOfUpdatePackets > 1) {
|
|
||||||
adjustSequenceFlags(packet);
|
|
||||||
}
|
|
||||||
packet.makeCrc();
|
|
||||||
|
|
||||||
result =
|
|
||||||
commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, supv::UPDATE_IMAGE_DATA,
|
|
||||||
packet.getWholeData(), packet.getFullSize());
|
|
||||||
|
|
||||||
if (result != RETURN_OK) {
|
|
||||||
sif::warning << "PlocUpdater::commandUpdateAvailable: Failed to send update"
|
|
||||||
<< " packet to supervisor handler" << std::endl;
|
|
||||||
triggerEvent(ACTION_COMMANDING_FAILED, result, supv::UPDATE_IMAGE_DATA);
|
|
||||||
state = State::IDLE;
|
|
||||||
pendingCommand = supv::NONE;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
remainingPackets--;
|
|
||||||
packetsSent++;
|
|
||||||
|
|
||||||
pendingCommand = supv::UPDATE_IMAGE_DATA;
|
|
||||||
state = State::COMMAND_EXECUTING;
|
|
||||||
}
|
|
||||||
|
|
||||||
void PlocUpdater::commandUpdateVerify() {
|
|
||||||
ReturnValue_t result = RETURN_OK;
|
|
||||||
|
|
||||||
supv::UpdateInfo packet(supv::APID_UPDATE_VERIFY, static_cast<uint8_t>(image),
|
|
||||||
static_cast<uint8_t>(partition), imageSize, imageCrc, numOfUpdatePackets);
|
|
||||||
|
|
||||||
result = commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, supv::UPDATE_VERIFY,
|
|
||||||
packet.getWholeData(), packet.getFullSize());
|
|
||||||
if (result != RETURN_OK) {
|
|
||||||
sif::warning << "PlocUpdater::commandUpdateAvailable: Failed to send update available"
|
|
||||||
<< " packet to supervisor handler" << std::endl;
|
|
||||||
triggerEvent(ACTION_COMMANDING_FAILED, result, supv::UPDATE_VERIFY);
|
|
||||||
state = State::IDLE;
|
|
||||||
pendingCommand = supv::NONE;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
state = State::COMMAND_EXECUTING;
|
|
||||||
pendingCommand = supv::UPDATE_VERIFY;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
void PlocUpdater::calcImageCrc() {
|
|
||||||
std::ifstream file(updateFile, std::ifstream::binary);
|
|
||||||
file.seekg(0, file.end);
|
|
||||||
uint32_t count;
|
|
||||||
uint32_t bit;
|
|
||||||
uint32_t remainder = INITIAL_REMAINDER_32;
|
|
||||||
char input;
|
|
||||||
for (count = 0; count < imageSize; count++) {
|
|
||||||
file.seekg(count, file.beg);
|
|
||||||
file.read(&input, 1);
|
|
||||||
remainder ^= (input << 16);
|
|
||||||
for (bit = 8; bit > 0; --bit) {
|
|
||||||
if (remainder & TOPBIT_32) {
|
|
||||||
remainder = (remainder << 1) ^ POLYNOMIAL_32;
|
|
||||||
} else {
|
|
||||||
remainder = (remainder << 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
file.close();
|
|
||||||
imageCrc = (remainder ^ FINAL_XOR_VALUE_32);
|
|
||||||
}
|
|
||||||
|
|
||||||
void PlocUpdater::adjustSequenceFlags(supv::UpdatePacket& packet) {
|
|
||||||
if (packetsSent == 0) {
|
|
||||||
packet.setSequenceFlags(static_cast<uint8_t>(supv::SequenceFlags::FIRST_PKT));
|
|
||||||
} else if (remainingPackets == 1) {
|
|
||||||
packet.setSequenceFlags(static_cast<uint8_t>(supv::SequenceFlags::LAST_PKT));
|
|
||||||
} else {
|
|
||||||
packet.setSequenceFlags(static_cast<uint8_t>(supv::SequenceFlags::CONTINUED_PKT));
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,174 +0,0 @@
|
|||||||
#ifndef MISSION_DEVICES_PLOCUPDATER_H_
|
|
||||||
#define MISSION_DEVICES_PLOCUPDATER_H_
|
|
||||||
|
|
||||||
#include <linux/devices/devicedefinitions/PlocSupervisorDefinitions.h>
|
|
||||||
|
|
||||||
#include "OBSWConfig.h"
|
|
||||||
#include "bsp_q7s/memory/SdCardManager.h"
|
|
||||||
#include "eive/definitions.h"
|
|
||||||
#include "fsfw/action/ActionHelper.h"
|
|
||||||
#include "fsfw/action/CommandActionHelper.h"
|
|
||||||
#include "fsfw/action/CommandsActionsIF.h"
|
|
||||||
#include "fsfw/action/HasActionsIF.h"
|
|
||||||
#include "fsfw/objectmanager/SystemObject.h"
|
|
||||||
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
|
|
||||||
#include "fsfw/tasks/ExecutableObjectIF.h"
|
|
||||||
#include "fsfw/tmtcpacket/SpacePacket.h"
|
|
||||||
#include "linux/devices/devicedefinitions/PlocSupervisorDefinitions.h"
|
|
||||||
#include "linux/fsfwconfig/objects/systemObjectList.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief An object of this class can be used to perform the software updates of the PLOC. The
|
|
||||||
* software update will be read from one of the SD cards, split into multiple space
|
|
||||||
* packets and sent to the PlocSupervisorHandler.
|
|
||||||
*
|
|
||||||
* @details The MPSoC has two boot memories (NVM0 and NVM1) where each stores two images (Partition
|
|
||||||
* A and Partition B)
|
|
||||||
*
|
|
||||||
* @author J. Meier
|
|
||||||
*/
|
|
||||||
class PlocUpdater : public SystemObject,
|
|
||||||
public HasActionsIF,
|
|
||||||
public ExecutableObjectIF,
|
|
||||||
public HasReturnvaluesIF,
|
|
||||||
public CommandsActionsIF {
|
|
||||||
public:
|
|
||||||
static const ActionId_t UPDATE_A_UBOOT = 0;
|
|
||||||
static const ActionId_t UPDATE_A_BITSTREAM = 1;
|
|
||||||
static const ActionId_t UPDATE_A_LINUX = 2;
|
|
||||||
static const ActionId_t UPDATE_A_APP_SW = 3;
|
|
||||||
static const ActionId_t UPDATE_B_UBOOT = 4;
|
|
||||||
static const ActionId_t UPDATE_B_BITSTREAM = 5;
|
|
||||||
static const ActionId_t UPDATE_B_LINUX = 6;
|
|
||||||
static const ActionId_t UPDATE_B_APP_SW = 7;
|
|
||||||
|
|
||||||
PlocUpdater(object_id_t objectId);
|
|
||||||
virtual ~PlocUpdater();
|
|
||||||
|
|
||||||
ReturnValue_t performOperation(uint8_t operationCode = 0) override;
|
|
||||||
ReturnValue_t executeAction(ActionId_t actionId, MessageQueueId_t commandedBy,
|
|
||||||
const uint8_t* data, size_t size);
|
|
||||||
MessageQueueId_t getCommandQueue() const;
|
|
||||||
ReturnValue_t initialize() override;
|
|
||||||
MessageQueueIF* getCommandQueuePtr() override;
|
|
||||||
void stepSuccessfulReceived(ActionId_t actionId, uint8_t step) override;
|
|
||||||
void stepFailedReceived(ActionId_t actionId, uint8_t step, ReturnValue_t returnCode) override;
|
|
||||||
void dataReceived(ActionId_t actionId, const uint8_t* data, uint32_t size) override;
|
|
||||||
void completionSuccessfulReceived(ActionId_t actionId) override;
|
|
||||||
void completionFailedReceived(ActionId_t actionId, ReturnValue_t returnCode) override;
|
|
||||||
|
|
||||||
private:
|
|
||||||
static const uint8_t INTERFACE_ID = CLASS_ID::PLOC_UPDATER;
|
|
||||||
|
|
||||||
//! [EXPORT] : [COMMENT] Updater is already performing an update
|
|
||||||
static const ReturnValue_t UPDATER_BUSY = MAKE_RETURN_CODE(0xA0);
|
|
||||||
//! [EXPORT] : [COMMENT] Received update command with invalid path string (too long).
|
|
||||||
static const ReturnValue_t NAME_TOO_LONG = MAKE_RETURN_CODE(0xA1);
|
|
||||||
//! [EXPORT] : [COMMENT] Received command to initiate update but SD card with update image not
|
|
||||||
//! mounted.
|
|
||||||
static const ReturnValue_t SD_NOT_MOUNTED = MAKE_RETURN_CODE(0xA2);
|
|
||||||
//! [EXPORT] : [COMMENT] Update file received with update command does not exist.
|
|
||||||
static const ReturnValue_t FILE_NOT_EXISTS = MAKE_RETURN_CODE(0xA3);
|
|
||||||
|
|
||||||
static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::PLOC_UPDATER;
|
|
||||||
|
|
||||||
//! [EXPORT] : [COMMENT] Try to read update file but the file does not exist.
|
|
||||||
//! P1: Indicates in which state the file read fails
|
|
||||||
//! P2: During the update transfer the second parameter gives information about the number of
|
|
||||||
//! already sent packets
|
|
||||||
static const Event UPDATE_FILE_NOT_EXISTS = MAKE_EVENT(0, severity::LOW);
|
|
||||||
//! [EXPORT] : [COMMENT] Failed to send command to supervisor handler
|
|
||||||
//! P1: Return value of CommandActionHelper::commandAction
|
|
||||||
//! P2: Action ID of command to send
|
|
||||||
static const Event ACTION_COMMANDING_FAILED = MAKE_EVENT(1, severity::LOW);
|
|
||||||
//! [EXPORT] : [COMMENT] Supervisor handler replied action message indicating a command execution
|
|
||||||
//! failure of the update available command
|
|
||||||
static const Event UPDATE_AVAILABLE_FAILED = MAKE_EVENT(2, severity::LOW);
|
|
||||||
//! [EXPORT] : [COMMENT] Supervisor handler failed to transfer an update space packet.
|
|
||||||
//! P1: Parameter holds the number of update packets already sent (inclusive the failed packet)
|
|
||||||
static const Event UPDATE_TRANSFER_FAILED = MAKE_EVENT(3, severity::LOW);
|
|
||||||
//! [EXPORT] : [COMMENT] Supervisor failed to execute the update verify command.
|
|
||||||
static const Event UPDATE_VERIFY_FAILED = MAKE_EVENT(4, severity::LOW);
|
|
||||||
//! [EXPORT] : [COMMENT] MPSoC update successful completed
|
|
||||||
static const Event UPDATE_FINISHED = MAKE_EVENT(5, severity::INFO);
|
|
||||||
|
|
||||||
static const uint32_t QUEUE_SIZE = config::PLOC_UPDATER_QUEUE_SIZE;
|
|
||||||
static const size_t MAX_PLOC_UPDATE_PATH = 50;
|
|
||||||
static const size_t SD_PREFIX_LENGTH = 8;
|
|
||||||
// Maximum size of update payload data per space packet (max size of space packet is 1024 bytes)
|
|
||||||
static const size_t MAX_SP_DATA = 1016;
|
|
||||||
|
|
||||||
static const uint32_t TOPBIT_32 = (1 << 31);
|
|
||||||
static const uint32_t POLYNOMIAL_32 = 0x04C11DB7;
|
|
||||||
static const uint32_t INITIAL_REMAINDER_32 = 0xFFFFFFFF;
|
|
||||||
static const uint32_t FINAL_XOR_VALUE_32 = 0xFFFFFFFF;
|
|
||||||
|
|
||||||
MessageQueueIF* commandQueue = nullptr;
|
|
||||||
|
|
||||||
#ifdef XIPHOS_Q7S
|
|
||||||
SdCardManager* sdcMan = nullptr;
|
|
||||||
#endif
|
|
||||||
CommandActionHelper commandActionHelper;
|
|
||||||
|
|
||||||
ActionHelper actionHelper;
|
|
||||||
|
|
||||||
enum class State : uint8_t {
|
|
||||||
IDLE,
|
|
||||||
UPDATE_AVAILABLE,
|
|
||||||
UPDATE_TRANSFER,
|
|
||||||
UPDATE_VERIFY,
|
|
||||||
COMMAND_EXECUTING
|
|
||||||
};
|
|
||||||
|
|
||||||
State state = State::IDLE;
|
|
||||||
|
|
||||||
ActionId_t pendingCommand = supv::NONE;
|
|
||||||
|
|
||||||
enum class Image : uint8_t { NONE, A, B };
|
|
||||||
|
|
||||||
Image image = Image::NONE;
|
|
||||||
|
|
||||||
enum class Partition : uint8_t { NONE, UBOOT, BITSTREAM, LINUX_OS, APP_SW };
|
|
||||||
|
|
||||||
Partition partition = Partition::NONE;
|
|
||||||
|
|
||||||
uint32_t packetsSent = 0;
|
|
||||||
uint32_t remainingPackets = 0;
|
|
||||||
// Number of packets required to transfer the update image
|
|
||||||
uint32_t numOfUpdatePackets = 0;
|
|
||||||
|
|
||||||
std::string updateFile;
|
|
||||||
uint32_t imageSize = 0;
|
|
||||||
uint32_t imageCrc = 0;
|
|
||||||
|
|
||||||
void readCommandQueue();
|
|
||||||
void doStateMachine();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Extracts the path and name of the update image from the service 8 command data.
|
|
||||||
*/
|
|
||||||
ReturnValue_t getImageLocation(const uint8_t* data, size_t size);
|
|
||||||
|
|
||||||
ReturnValue_t checkNameLength(size_t size);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Prepares and sends update available command to PLOC supervisor handler.
|
|
||||||
*/
|
|
||||||
void commandUpdateAvailable();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Prepares and sends and update packet to the PLOC supervisor handler.
|
|
||||||
*/
|
|
||||||
void commandUpdatePacket();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Prepares and sends the update verification packet to the PLOC supervisor handler.
|
|
||||||
*/
|
|
||||||
void commandUpdateVerify();
|
|
||||||
|
|
||||||
void calcImageCrc();
|
|
||||||
|
|
||||||
void adjustSequenceFlags(supv::UpdatePacket& packet);
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif /* MISSION_DEVICES_PLOCUPDATER_H_ */
|
|
@ -1,7 +1,4 @@
|
|||||||
target_sources(${OBSW_NAME} PRIVATE
|
target_sources(
|
||||||
StarTrackerHandler.cpp
|
${OBSW_NAME}
|
||||||
StarTrackerJsonCommands.cpp
|
PRIVATE StarTrackerHandler.cpp StarTrackerJsonCommands.cpp
|
||||||
ArcsecDatalinkLayer.cpp
|
ArcsecDatalinkLayer.cpp ArcsecJsonParamBase.cpp StrHelper.cpp)
|
||||||
ArcsecJsonParamBase.cpp
|
|
||||||
StrHelper.cpp
|
|
||||||
)
|
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
#include "OBSWConfig.h"
|
#include "OBSWConfig.h"
|
||||||
#include "fsfw/timemanager/Countdown.h"
|
#include "fsfw/timemanager/Countdown.h"
|
||||||
#include "linux/devices/devicedefinitions/StarTrackerDefinitions.h"
|
#include "linux/devices/devicedefinitions/StarTrackerDefinitions.h"
|
||||||
|
#include "mission/utility/Filenaming.h"
|
||||||
#include "mission/utility/ProgressPrinter.h"
|
#include "mission/utility/ProgressPrinter.h"
|
||||||
#include "mission/utility/Timestamp.h"
|
#include "mission/utility/Timestamp.h"
|
||||||
|
|
||||||
@ -181,7 +182,8 @@ ReturnValue_t StrHelper::performImageDownload() {
|
|||||||
struct DownloadActionRequest downloadReq;
|
struct DownloadActionRequest downloadReq;
|
||||||
uint32_t size = 0;
|
uint32_t size = 0;
|
||||||
uint32_t retries = 0;
|
uint32_t retries = 0;
|
||||||
std::string image = makeFullFilename(downloadImage.path, downloadImage.filename);
|
std::string image = Filenaming::generateAbsoluteFilename(downloadImage.path,
|
||||||
|
downloadImage.filename, timestamping);
|
||||||
std::ofstream file(image, std::ios_base::out);
|
std::ofstream file(image, std::ios_base::out);
|
||||||
if (not std::filesystem::exists(image)) {
|
if (not std::filesystem::exists(image)) {
|
||||||
return FILE_CREATION_FAILED;
|
return FILE_CREATION_FAILED;
|
||||||
@ -400,7 +402,8 @@ ReturnValue_t StrHelper::performFlashRead() {
|
|||||||
uint32_t size = 0;
|
uint32_t size = 0;
|
||||||
uint32_t retries = 0;
|
uint32_t retries = 0;
|
||||||
Timestamp timestamp;
|
Timestamp timestamp;
|
||||||
std::string fullname = makeFullFilename(flashRead.path, flashRead.filename);
|
std::string fullname =
|
||||||
|
Filenaming::generateAbsoluteFilename(flashRead.path, flashRead.filename, timestamping);
|
||||||
std::ofstream file(fullname, std::ios_base::app | std::ios_base::out);
|
std::ofstream file(fullname, std::ios_base::app | std::ios_base::out);
|
||||||
if (not std::filesystem::exists(fullname)) {
|
if (not std::filesystem::exists(fullname)) {
|
||||||
return FILE_CREATION_FAILED;
|
return FILE_CREATION_FAILED;
|
||||||
@ -588,14 +591,3 @@ ReturnValue_t StrHelper::unlockAndEraseRegions(uint32_t from, uint32_t to) {
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string StrHelper::makeFullFilename(std::string path, std::string filename) {
|
|
||||||
std::string image;
|
|
||||||
Timestamp timestamp;
|
|
||||||
if (timestamping) {
|
|
||||||
image = path + "/" + timestamp.str() + filename;
|
|
||||||
} else {
|
|
||||||
image = path + "/" + filename;
|
|
||||||
}
|
|
||||||
return image;
|
|
||||||
}
|
|
||||||
|
@ -173,8 +173,7 @@ class StrHelper : public SystemObject, public ExecutableObjectIF, public HasRetu
|
|||||||
static const size_t SIZE_IMAGE_PART = 1024;
|
static const size_t SIZE_IMAGE_PART = 1024;
|
||||||
static const uint32_t FLASH_REGION_SIZE = 0x20000;
|
static const uint32_t FLASH_REGION_SIZE = 0x20000;
|
||||||
|
|
||||||
class ImageDownload {
|
struct ImageDownload {
|
||||||
public:
|
|
||||||
static const uint32_t LAST_POSITION = 4095;
|
static const uint32_t LAST_POSITION = 4095;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -199,15 +198,13 @@ class StrHelper : public SystemObject, public ExecutableObjectIF, public HasRetu
|
|||||||
|
|
||||||
BinarySemaphore semaphore;
|
BinarySemaphore semaphore;
|
||||||
|
|
||||||
class UploadImage {
|
struct UploadImage {
|
||||||
public:
|
|
||||||
// Name including absolute path of image to upload
|
// Name including absolute path of image to upload
|
||||||
std::string uploadFile;
|
std::string uploadFile;
|
||||||
};
|
};
|
||||||
UploadImage uploadImage;
|
UploadImage uploadImage;
|
||||||
|
|
||||||
class DownloadImage {
|
struct DownloadImage {
|
||||||
public:
|
|
||||||
// Path where the downloaded image will be stored
|
// Path where the downloaded image will be stored
|
||||||
std::string path;
|
std::string path;
|
||||||
// Default name of downloaded image, can be changed via command
|
// Default name of downloaded image, can be changed via command
|
||||||
@ -215,8 +212,7 @@ class StrHelper : public SystemObject, public ExecutableObjectIF, public HasRetu
|
|||||||
};
|
};
|
||||||
DownloadImage downloadImage;
|
DownloadImage downloadImage;
|
||||||
|
|
||||||
class FlashWrite {
|
struct FlashWrite {
|
||||||
public:
|
|
||||||
// File which contains data to write when executing the flash write command
|
// File which contains data to write when executing the flash write command
|
||||||
std::string fullname;
|
std::string fullname;
|
||||||
// The first region to write to
|
// The first region to write to
|
||||||
@ -229,8 +225,7 @@ class StrHelper : public SystemObject, public ExecutableObjectIF, public HasRetu
|
|||||||
};
|
};
|
||||||
FlashWrite flashWrite;
|
FlashWrite flashWrite;
|
||||||
|
|
||||||
class FlashRead {
|
struct FlashRead {
|
||||||
public:
|
|
||||||
// Path where the file containing the read data will be stored
|
// Path where the file containing the read data will be stored
|
||||||
std::string path = "";
|
std::string path = "";
|
||||||
// Default name of file containing the data read from flash, can be changed via command
|
// Default name of file containing the data read from flash, can be changed via command
|
||||||
@ -349,16 +344,6 @@ class StrHelper : public SystemObject, public ExecutableObjectIF, public HasRetu
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
ReturnValue_t unlockAndEraseRegions(uint32_t from, uint32_t to);
|
ReturnValue_t unlockAndEraseRegions(uint32_t from, uint32_t to);
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Creates full filename either with timestamp or without
|
|
||||||
*
|
|
||||||
* @param path Path where to create the file
|
|
||||||
* @param filename Name fo the file
|
|
||||||
*
|
|
||||||
* @return Full filename
|
|
||||||
*/
|
|
||||||
std::string makeFullFilename(std::string path, std::string filename);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* BSP_Q7S_DEVICES_STRHELPER_H_ */
|
#endif /* BSP_Q7S_DEVICES_STRHELPER_H_ */
|
||||||
|
@ -1,28 +1,16 @@
|
|||||||
target_sources(${OBSW_NAME} PRIVATE
|
target_sources(${OBSW_NAME} PRIVATE ipc/MissionMessageTypes.cpp
|
||||||
ipc/MissionMessageTypes.cpp
|
pollingsequence/pollingSequenceFactory.cpp)
|
||||||
pollingsequence/pollingSequenceFactory.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
target_include_directories(${OBSW_NAME} PUBLIC
|
target_include_directories(${OBSW_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
|
||||||
)
|
|
||||||
|
|
||||||
# If a special translation file for object IDs exists, compile it.
|
# If a special translation file for object IDs exists, compile it.
|
||||||
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/objects/translateObjects.cpp")
|
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/objects/translateObjects.cpp")
|
||||||
target_sources(${OBSW_NAME} PRIVATE
|
target_sources(${OBSW_NAME} PRIVATE objects/translateObjects.cpp)
|
||||||
objects/translateObjects.cpp
|
target_sources(${UNITTEST_NAME} PRIVATE objects/translateObjects.cpp)
|
||||||
)
|
|
||||||
target_sources(${UNITTEST_NAME} PRIVATE
|
|
||||||
objects/translateObjects.cpp
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# If a special translation file for events exists, compile it.
|
# If a special translation file for events exists, compile it.
|
||||||
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/objects/translateObjects.cpp")
|
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/objects/translateObjects.cpp")
|
||||||
target_sources(${OBSW_NAME} PRIVATE
|
target_sources(${OBSW_NAME} PRIVATE events/translateEvents.cpp)
|
||||||
events/translateEvents.cpp
|
target_sources(${UNITTEST_NAME} PRIVATE events/translateEvents.cpp)
|
||||||
)
|
|
||||||
target_sources(${UNITTEST_NAME} PRIVATE
|
|
||||||
events/translateEvents.cpp
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
@ -24,18 +24,18 @@ enum logicalAddresses : address_t {
|
|||||||
|
|
||||||
RAD_SENSOR = objects::RAD_SENSOR,
|
RAD_SENSOR = objects::RAD_SENSOR,
|
||||||
|
|
||||||
SUS_0 = objects::SUS_0,
|
SUS_0 = objects::SUS_0_N_LOC_XFYFZM_PT_XF,
|
||||||
SUS_1 = objects::SUS_1,
|
SUS_1 = objects::SUS_1_N_LOC_XBYFZM_PT_XB,
|
||||||
SUS_2 = objects::SUS_2,
|
SUS_2 = objects::SUS_2_N_LOC_XFYBZB_PT_YB,
|
||||||
SUS_3 = objects::SUS_3,
|
SUS_3 = objects::SUS_3_N_LOC_XFYBZF_PT_YF,
|
||||||
SUS_4 = objects::SUS_4,
|
SUS_4 = objects::SUS_4_N_LOC_XMYFZF_PT_ZF,
|
||||||
SUS_5 = objects::SUS_5,
|
SUS_5 = objects::SUS_5_N_LOC_XFYMZB_PT_ZB,
|
||||||
SUS_6 = objects::SUS_6,
|
SUS_6 = objects::SUS_6_R_LOC_XFYBZM_PT_XF,
|
||||||
SUS_7 = objects::SUS_7,
|
SUS_7 = objects::SUS_7_R_LOC_XBYBZM_PT_XB,
|
||||||
SUS_8 = objects::SUS_8,
|
SUS_8 = objects::SUS_8_R_LOC_XBYBZB_PT_YB,
|
||||||
SUS_9 = objects::SUS_9,
|
SUS_9 = objects::SUS_9_R_LOC_XBYBZB_PT_YF,
|
||||||
SUS_10 = objects::SUS_10,
|
SUS_10 = objects::SUS_10_N_LOC_XMYBZF_PT_ZF,
|
||||||
SUS_11 = objects::SUS_11,
|
SUS_11 = objects::SUS_11_R_LOC_XBYMZB_PT_ZB,
|
||||||
|
|
||||||
/* Dummy and Test Addresses */
|
/* Dummy and Test Addresses */
|
||||||
DUMMY_ECHO = 129,
|
DUMMY_ECHO = 129,
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user