WIP: SCEX Init #272

Closed
muellerr wants to merge 62 commits from irini into develop
158 changed files with 7250 additions and 4588 deletions
Showing only changes of commit 188f8863d0 - Show all commits

View File

@ -20,6 +20,9 @@ option(EIVE_ADD_JSON_LIB "Add JSON library" ON)
option(EIVE_SYSROOT_MAGIC "Perform sysroot magic which might not be necessary" OFF) option(EIVE_SYSROOT_MAGIC "Perform sysroot magic which might not be necessary" OFF)
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)
set(OBSW_ADD_STAR_TRACKER 0)
set(OBSW_DEBUG_STARTRACKER 0)
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()
@ -71,7 +74,7 @@ set(LIB_JSON_NAME nlohmann_json::nlohmann_json)
# Set path names # Set path names
set(FSFW_PATH fsfw) set(FSFW_PATH fsfw)
set(TEST_PATH test/testtasks) set(TEST_PATH test)
set(UNITTEST_PATH unittest) set(UNITTEST_PATH unittest)
set(LINUX_PATH linux) set(LINUX_PATH linux)
set(COMMON_PATH common) set(COMMON_PATH common)
@ -98,6 +101,7 @@ pre_source_hw_os_config()
if(TGT_BSP) if(TGT_BSP)
if(TGT_BSP MATCHES "arm/q7s" OR TGT_BSP MATCHES "arm/raspberrypi" if(TGT_BSP MATCHES "arm/q7s" OR TGT_BSP MATCHES "arm/raspberrypi"
OR TGT_BSP MATCHES "arm/beagleboneblack" OR TGT_BSP MATCHES "arm/egse" OR TGT_BSP MATCHES "arm/beagleboneblack" OR TGT_BSP MATCHES "arm/egse"
OR TGT_BSP MATCHES "arm/te0720-1cfa"
) )
set(FSFW_CONFIG_PATH "linux/fsfwconfig") set(FSFW_CONFIG_PATH "linux/fsfwconfig")
if(NOT BUILD_Q7S_SIMPLE_MODE) if(NOT BUILD_Q7S_SIMPLE_MODE)
@ -117,6 +121,8 @@ if(TGT_BSP)
# Used by configure file # Used by configure file
set(EGSE ON) set(EGSE ON)
set(FSFW_HAL_LINUX_ADD_LIBGPIOD OFF) set(FSFW_HAL_LINUX_ADD_LIBGPIOD OFF)
set(OBSW_ADD_STAR_TRACKER 1)
set(OBSW_DEBUG_STARTRACKER 1)
endif() endif()
if(TGT_BSP MATCHES "arm/beagleboneblack") if(TGT_BSP MATCHES "arm/beagleboneblack")
@ -128,6 +134,10 @@ if(TGT_BSP)
# Used by configure file # Used by configure file
set(XIPHOS_Q7S ON) set(XIPHOS_Q7S ON)
endif() endif()
if(TGT_BSP MATCHES "arm/te0720-1cfa")
set(TE0720_1CFA ON)
endif()
else() else()
# Required by FSFW library # Required by FSFW library
set(FSFW_CONFIG_PATH "${BSP_PATH}/fsfwconfig") set(FSFW_CONFIG_PATH "${BSP_PATH}/fsfwconfig")
@ -200,7 +210,7 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set(COMPILER_FLAGS "/permissive-") set(COMPILER_FLAGS "/permissive-")
endif() endif()
if (NOT(TGT_BSP MATCHES "arm/te0720-1cfa") AND NOT(TGT_BSP MATCHES "arm/q7s"))
# 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 "Did not find a valid Catch2 installation. Using FetchContent to install it") message(STATUS "Did not find a valid Catch2 installation. Using FetchContent to install it")
@ -218,7 +228,7 @@ if(NOT Catch2_FOUND)
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()
add_library(${LIB_EIVE_MISSION}) add_library(${LIB_EIVE_MISSION})

View File

@ -385,20 +385,7 @@ more recent disitributions anymore.
## <a id="arm-toolchain"></a> Installing toolchain without Vivado ## <a id="arm-toolchain"></a> Installing toolchain without Vivado
You can download the toolchains for Windows and Linux You can download the toolchains for Windows and Linux
[from the EIVE cloud](https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files?dir=/EIVE_IRS/Software/tools&fileid=831898). [from the EIVE cloud](https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files/?dir=/EIVE_IRS/Software/tools).
If `wget` is available (e.g. MinGW64), you can use the following command to download the
toolchain for Windows
```sh
wget https://eive-cloud.irs.uni-stuttgart.de/index.php/s/rfoaistRd67yBbH/download/gcc-arm-linux-gnueabi-win.zip
```
or the following command for Linux (could be useful for CI/CD)
```sh
wget https://eive-cloud.irs.uni-stuttgart.de/index.php/s/MRaeA2XnMXpZ5Pp/download/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf.tar.xz
```
## Installing CMake and MSYS2 on Windows ## Installing CMake and MSYS2 on Windows

View File

@ -16,5 +16,5 @@ 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 Q7S_SYSROOT="/usr/rootfs/cortexa9hf-neon-xiphos-linux-gnueabi" ENV ZYNQ_7020_SYSROOT="/usr/rootfs/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"

View File

@ -5,7 +5,7 @@ pipeline {
} }
agent { agent {
docker { docker {
image 'eive-obsw-ci:d2' image 'eive-obsw-ci:d3'
args '--sysctl fs.mqueue.msg_max=100' args '--sysctl fs.mqueue.msg_max=100'
} }
} }

View File

@ -3,7 +3,6 @@
#include <devConf.h> #include <devConf.h>
#include <fsfw_hal/linux/uart/UartComIF.h> #include <fsfw_hal/linux/uart/UartComIF.h>
#include <fsfw_hal/linux/uart/UartCookie.h> #include <fsfw_hal/linux/uart/UartCookie.h>
#include <mission/devices/GPSHyperionHandler.h>
#include "OBSWConfig.h" #include "OBSWConfig.h"
#include "busConf.h" #include "busConf.h"

View File

@ -3,8 +3,8 @@
#include "InitMission.h" #include "InitMission.h"
#include "OBSWConfig.h" #include "OBSWConfig.h"
#include "OBSWVersion.h" #include "OBSWVersion.h"
#include "fsfw/FSFWVersion.h"
#include "fsfw/tasks/TaskFactory.h" #include "fsfw/tasks/TaskFactory.h"
#include "fsfw/version.h"
/** /**
* @brief This is the main program entry point for the egse (raspberry pi 4) * @brief This is the main program entry point for the egse (raspberry pi 4)

View File

@ -1,6 +1,7 @@
target_sources(${OBSW_NAME} PUBLIC target_sources(${OBSW_NAME} PUBLIC
InitMission.cpp InitMission.cpp
main.cpp main.cpp
gpioInit.cpp
ObjectFactory.cpp ObjectFactory.cpp
) )

View File

@ -192,7 +192,7 @@ void initmission::createPstTasks(TaskFactory& factory,
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
#if OBSW_ADD_SPI_TEST_CODE == 0 #if OBSW_ADD_SPI_TEST_CODE == 0
FixedTimeslotTaskIF* spiPst = factory.createFixedTimeslotTask( FixedTimeslotTaskIF* spiPst = factory.createFixedTimeslotTask(
"SPI_PST", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 3.0, missedDeadlineFunc); "SPI_PST", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 1.0, missedDeadlineFunc);
result = pst::pstSpi(spiPst); result = pst::pstSpi(spiPst);
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
sif::error << "InitMission::initTasks: Creating PST failed!" << std::endl; sif::error << "InitMission::initTasks: Creating PST failed!" << std::endl;

View File

@ -6,10 +6,13 @@
#include "devices/addresses.h" #include "devices/addresses.h"
#include "devices/gpioIds.h" #include "devices/gpioIds.h"
#include "fsfw/datapoollocal/LocalDataPoolManager.h" #include "fsfw/datapoollocal/LocalDataPoolManager.h"
#include "fsfw/power/DummyPowerSwitcher.h"
#include "fsfw/tasks/TaskFactory.h" #include "fsfw/tasks/TaskFactory.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 "gpioInit.h"
#include "linux/ObjectFactory.h"
#include "linux/boardtest/LibgpiodTest.h" #include "linux/boardtest/LibgpiodTest.h"
#include "linux/boardtest/SpiTestClass.h" #include "linux/boardtest/SpiTestClass.h"
#include "linux/boardtest/UartTestClass.h" #include "linux/boardtest/UartTestClass.h"
@ -65,37 +68,55 @@ void ObjectFactory::produce(void* args) {
GpioCookie* gpioCookie = nullptr; GpioCookie* gpioCookie = nullptr;
static_cast<void>(gpioCookie); static_cast<void>(gpioCookie);
new SpiComIF(objects::SPI_COM_IF, gpioIF); SpiComIF* spiComIF = new SpiComIF(objects::SPI_COM_IF, gpioIF);
static_cast<void>(spiComIF);
auto pwrSwitcher = new DummyPowerSwitcher(objects::PCDU_HANDLER, 18, 0);
static_cast<void>(pwrSwitcher);
std::string spiDev; #if OBSW_ADD_ACS_BOARD == 1 && defined(RASPBERRY_PI)
SpiCookie* spiCookie = nullptr; createRpiAcsBoard(gpioIF, spiDev);
static_cast<void>(spiCookie); #endif
#if OBSW_ADD_ACS_BOARD == 1 #if OBSW_ADD_SUN_SENSORS == 1 || defined(OBSW_ADD_RTD_DEVICES)
if (gpioCookie == nullptr) { #ifdef RASPBERRY_PI
gpioCookie = new GpioCookie(); rpi::gpio::initSpiCsDecoder(gpioIF);
} #endif
#endif
#if OBSW_ADD_SUN_SENSORS == 1
createSunSensorComponents(gpioIF, spiComIF, pwrSwitcher, spi::DEV);
#endif
#if OBSW_ADD_RTD_DEVICES == 1
createRtdComponents(spi::DEV, gpioIF, pwrSwitcher);
#endif
#if OBSW_ADD_TEST_CODE == 1
createTestTasks();
#endif /* OBSW_ADD_TEST_CODE == 1 */
}
void ObjectFactory::createRpiAcsBoard(GpioIF* gpioIF, std::string spiDev) {
GpioCookie* gpioCookie = new GpioCookie();
// TODO: Missing pin for Gyro 2 // TODO: Missing pin for Gyro 2
gpio::createRpiGpioConfig(gpioCookie, gpioIds::MGM_0_LIS3_CS, gpio::MGM_0_BCM_PIN, "MGM_0_LIS3", gpio::createRpiGpioConfig(gpioCookie, gpioIds::MGM_0_LIS3_CS, gpio::MGM_0_BCM_PIN, "MGM_0_LIS3",
gpio::Direction::OUT, 1); gpio::Direction::OUT, gpio::Levels::HIGH);
gpio::createRpiGpioConfig(gpioCookie, gpioIds::MGM_1_RM3100_CS, gpio::MGM_1_BCM_PIN, gpio::createRpiGpioConfig(gpioCookie, gpioIds::MGM_1_RM3100_CS, gpio::MGM_1_BCM_PIN,
"MGM_1_RM3100", gpio::Direction::OUT, 1); "MGM_1_RM3100", gpio::Direction::OUT, gpio::Levels::HIGH);
gpio::createRpiGpioConfig(gpioCookie, gpioIds::MGM_2_LIS3_CS, gpio::MGM_2_BCM_PIN, "MGM_2_LIS3", gpio::createRpiGpioConfig(gpioCookie, gpioIds::MGM_2_LIS3_CS, gpio::MGM_2_BCM_PIN, "MGM_2_LIS3",
gpio::Direction::OUT, 1); gpio::Direction::OUT, gpio::Levels::HIGH);
gpio::createRpiGpioConfig(gpioCookie, gpioIds::MGM_3_RM3100_CS, gpio::MGM_3_BCM_PIN, gpio::createRpiGpioConfig(gpioCookie, gpioIds::MGM_3_RM3100_CS, gpio::MGM_3_BCM_PIN,
"MGM_3_RM3100", gpio::Direction::OUT, 1); "MGM_3_RM3100", gpio::Direction::OUT, gpio::Levels::HIGH);
gpio::createRpiGpioConfig(gpioCookie, gpioIds::GYRO_0_ADIS_CS, gpio::GYRO_0_BCM_PIN, gpio::createRpiGpioConfig(gpioCookie, gpioIds::GYRO_0_ADIS_CS, gpio::GYRO_0_BCM_PIN,
"GYRO_0_ADIS", gpio::Direction::OUT, 1); "GYRO_0_ADIS", gpio::Direction::OUT, gpio::Levels::HIGH);
gpio::createRpiGpioConfig(gpioCookie, gpioIds::GYRO_1_L3G_CS, gpio::GYRO_1_BCM_PIN, "GYRO_1_L3G", gpio::createRpiGpioConfig(gpioCookie, gpioIds::GYRO_1_L3G_CS, gpio::GYRO_1_BCM_PIN, "GYRO_1_L3G",
gpio::Direction::OUT, 1); gpio::Direction::OUT, gpio::Levels::HIGH);
gpio::createRpiGpioConfig(gpioCookie, gpioIds::GYRO_2_ADIS_CS, gpio::GYRO_2_BCM_PIN, gpio::createRpiGpioConfig(gpioCookie, gpioIds::GYRO_2_ADIS_CS, gpio::GYRO_2_BCM_PIN,
"GYRO_2_ADIS", gpio::Direction::OUT, 1); "GYRO_2_ADIS", gpio::Direction::OUT, gpio::Levels::HIGH);
gpio::createRpiGpioConfig(gpioCookie, gpioIds::GYRO_3_L3G_CS, gpio::GYRO_3_BCM_PIN, "GYRO_3_L3G", gpio::createRpiGpioConfig(gpioCookie, gpioIds::GYRO_3_L3G_CS, gpio::GYRO_3_BCM_PIN, "GYRO_3_L3G",
gpio::Direction::OUT, 1); gpio::Direction::OUT, gpio::Levels::HIGH);
gpioIF->addGpios(gpioCookie); gpioIF->addGpios(gpioCookie);
SpiCookie* spiCookie =
spiDev = "/dev/spidev0.1";
spiCookie =
new SpiCookie(addresses::MGM_0_LIS3, gpioIds::MGM_0_LIS3_CS, spiDev, new SpiCookie(addresses::MGM_0_LIS3, gpioIds::MGM_0_LIS3_CS, spiDev,
MGMLIS3MDL::MAX_BUFFER_SIZE, spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED); MGMLIS3MDL::MAX_BUFFER_SIZE, spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED);
auto mgmLis3Handler = auto mgmLis3Handler =
@ -137,9 +158,9 @@ void ObjectFactory::produce(void* args) {
spiCookie = spiCookie =
new SpiCookie(addresses::GYRO_0_ADIS, gpioIds::GYRO_0_ADIS_CS, spiDev, new SpiCookie(addresses::GYRO_0_ADIS, gpioIds::GYRO_0_ADIS_CS, spiDev,
ADIS16507::MAXIMUM_REPLY_SIZE, spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED); ADIS1650X::MAXIMUM_REPLY_SIZE, spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED);
auto adisHandler = auto adisHandler = new GyroADIS1650XHandler(objects::GYRO_0_ADIS_HANDLER, objects::SPI_COM_IF,
new GyroADIS16507Handler(objects::GYRO_0_ADIS_HANDLER, objects::SPI_COM_IF, spiCookie); spiCookie, ADIS1650X::Type::ADIS16505);
adisHandler->setStartUpImmediately(); adisHandler->setStartUpImmediately();
spiCookie = spiCookie =
new SpiCookie(addresses::GYRO_1_L3G, gpioIds::GYRO_1_L3G_CS, spiDev, L3GD20H::MAX_BUFFER_SIZE, new SpiCookie(addresses::GYRO_1_L3G, gpioIds::GYRO_1_L3G_CS, spiDev, L3GD20H::MAX_BUFFER_SIZE,
@ -153,9 +174,9 @@ void ObjectFactory::produce(void* args) {
spiCookie = spiCookie =
new SpiCookie(addresses::GYRO_2_ADIS, gpioIds::GYRO_2_ADIS_CS, spiDev, new SpiCookie(addresses::GYRO_2_ADIS, gpioIds::GYRO_2_ADIS_CS, spiDev,
ADIS16507::MAXIMUM_REPLY_SIZE, spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED); ADIS1650X::MAXIMUM_REPLY_SIZE, spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED);
adisHandler = adisHandler = new GyroADIS1650XHandler(objects::GYRO_2_ADIS_HANDLER, objects::SPI_COM_IF,
new GyroADIS16507Handler(objects::GYRO_2_ADIS_HANDLER, objects::SPI_COM_IF, spiCookie); spiCookie, ADIS1650X::Type::ADIS16505);
adisHandler->setStartUpImmediately(); adisHandler->setStartUpImmediately();
spiCookie = spiCookie =
@ -167,12 +188,6 @@ void ObjectFactory::produce(void* args) {
#if FSFW_HAL_L3GD20_GYRO_DEBUG == 1 #if FSFW_HAL_L3GD20_GYRO_DEBUG == 1
gyroL3gHandler->setToGoToNormalMode(true); gyroL3gHandler->setToGoToNormalMode(true);
#endif #endif
#endif /* RPI_TEST_ACS_BOARD == 1 */
#if OBSW_ADD_TEST_CODE == 1
createTestTasks();
#endif /* OBSW_ADD_TEST_CODE == 1 */
} }
void ObjectFactory::createTestTasks() { void ObjectFactory::createTestTasks() {

View File

@ -1,10 +1,15 @@
#ifndef BSP_LINUX_OBJECTFACTORY_H_ #ifndef BSP_LINUX_OBJECTFACTORY_H_
#define BSP_LINUX_OBJECTFACTORY_H_ #define BSP_LINUX_OBJECTFACTORY_H_
#include <string>
class GpioIF;
namespace ObjectFactory { namespace ObjectFactory {
void setStatics(); void setStatics();
void produce(void* args); void produce(void* args);
void createRpiAcsBoard(GpioIF* gpioIF, std::string spiDev);
void createTestTasks(); void createTestTasks();
}; // namespace ObjectFactory }; // namespace ObjectFactory

View File

@ -17,16 +17,4 @@
#define RPI_ADD_UART_TEST 0 #define RPI_ADD_UART_TEST 0
/* Adapt these values accordingly */
namespace gpio {
static constexpr uint8_t MGM_0_BCM_PIN = 17;
static constexpr uint8_t MGM_1_BCM_PIN = 27;
static constexpr uint8_t MGM_2_BCM_PIN = 22;
static constexpr uint8_t MGM_3_BCM_PIN = 23;
static constexpr uint8_t GYRO_0_BCM_PIN = 5;
static constexpr uint8_t GYRO_1_BCM_PIN = 6;
static constexpr uint8_t GYRO_2_BCM_PIN = 13;
static constexpr uint8_t GYRO_3_BCM_PIN = 19;
}
#endif /* BSP_RPI_BOARDCONFIG_RPI_CONFIG_H_ */ #endif /* BSP_RPI_BOARDCONFIG_RPI_CONFIG_H_ */

View File

@ -0,0 +1,37 @@
#ifndef BSP_LINUX_BOARD_DEFINITIONS_H_
#define BSP_LINUX_BOARD_DEFINITIONS_H_
#include <cstdint>
#include "OBSWConfig.h"
#ifdef RASPBERRY_PI
namespace spi {
static constexpr char DEV[] = "/dev/spidev0.1";
}
/* Adapt these values accordingly */
namespace gpio {
static constexpr uint8_t MGM_0_BCM_PIN = 17;
static constexpr uint8_t MGM_1_BCM_PIN = 27;
static constexpr uint8_t MGM_2_BCM_PIN = 22;
static constexpr uint8_t MGM_3_BCM_PIN = 23;
static constexpr uint8_t GYRO_0_BCM_PIN = 5;
static constexpr uint8_t GYRO_1_BCM_PIN = 6;
static constexpr uint8_t GYRO_2_BCM_PIN = 13;
static constexpr uint8_t GYRO_3_BCM_PIN = 19;
static constexpr uint8_t SPI_MUX_0_BCM = 17;
static constexpr uint8_t SPI_MUX_1_BCM = 27;
static constexpr uint8_t SPI_MUX_2_BCM = 22;
static constexpr uint8_t SPI_MUX_3_BCM = 23;
static constexpr uint8_t SPI_MUX_4_BCM = 5;
static constexpr uint8_t SPI_MUX_5_BCM = 6;
} // namespace gpio
#endif
#endif /* BSP_LINUX_BOARD_DEFINITIONS_H_ */

View File

@ -0,0 +1,56 @@
#include "gpioInit.h"
#include <devices/gpioIds.h>
#include <fsfw/serviceinterface/ServiceInterface.h>
#include <fsfw_hal/common/gpio/GpioCookie.h>
#include <fsfw_hal/common/gpio/GpioIF.h>
#include "definitions.h"
#include "fsfw_hal/linux/rpi/GpioRPi.h"
#ifdef RASPBERRY_PI
struct MuxInfo {
MuxInfo(gpioId_t gpioId, int bcmNum, std::string consumer)
: gpioId(gpioId), bcmNum(bcmNum), consumer(consumer) {}
gpioId_t gpioId;
int bcmNum;
std::string consumer;
};
void rpi::gpio::initSpiCsDecoder(GpioIF* gpioComIF) {
using namespace ::gpio;
ReturnValue_t result;
if (gpioComIF == nullptr) {
sif::debug << "initSpiCsDecoder: Invalid gpioComIF" << std::endl;
return;
}
std::array<::MuxInfo, 6> muxInfo{
MuxInfo(gpioIds::SPI_MUX_BIT_0, SPI_MUX_0_BCM, "SPI_MUX_0"),
MuxInfo(gpioIds::SPI_MUX_BIT_1, SPI_MUX_1_BCM, "SPI_MUX_1"),
MuxInfo(gpioIds::SPI_MUX_BIT_2, SPI_MUX_2_BCM, "SPI_MUX_2"),
MuxInfo(gpioIds::SPI_MUX_BIT_3, SPI_MUX_3_BCM, "SPI_MUX_3"),
MuxInfo(gpioIds::SPI_MUX_BIT_4, SPI_MUX_4_BCM, "SPI_MUX_4"),
MuxInfo(gpioIds::SPI_MUX_BIT_5, SPI_MUX_5_BCM, "SPI_MUX_5"),
};
GpioCookie* spiMuxGpios = new GpioCookie;
for (const auto& info : muxInfo) {
result = createRpiGpioConfig(spiMuxGpios, info.gpioId, info.bcmNum, info.consumer,
Direction::OUT, Levels::LOW);
if (result != HasReturnvaluesIF::RETURN_OK) {
sif::error << "Creating Raspberry Pi SPI Mux GPIO failed with code " << result << std::endl;
return;
}
}
result = gpioComIF->addGpios(spiMuxGpios);
if (result != HasReturnvaluesIF::RETURN_OK) {
sif::error << "initSpiCsDecoder: Failed to add mux bit gpios to gpioComIF" << std::endl;
return;
}
}
#endif

View File

@ -0,0 +1,20 @@
#pragma once
#include "OBSWConfig.h"
class GpioIF;
#ifdef RASPBERRY_PI
namespace rpi {
namespace gpio {
/**
* @brief This function initializes the GPIOs used to control the SN74LVC138APWR decoders on
* the TCS Board and the interface board.
*/
void initSpiCsDecoder(GpioIF* gpioComIF);
} // namespace gpio
} // namespace rpi
#endif

View File

@ -3,8 +3,8 @@
#include "InitMission.h" #include "InitMission.h"
#include "OBSWConfig.h" #include "OBSWConfig.h"
#include "OBSWVersion.h" #include "OBSWVersion.h"
#include "fsfw/version.h"
#include "fsfw/tasks/TaskFactory.h" #include "fsfw/tasks/TaskFactory.h"
#include "fsfw/version.h"
#ifdef RASPBERRY_PI #ifdef RASPBERRY_PI
static const char* const BOARD_NAME = "Raspberry Pi"; static const char* const BOARD_NAME = "Raspberry Pi";
@ -22,8 +22,7 @@ int main(void) {
std::cout << "-- EIVE OBSW --" << std::endl; std::cout << "-- EIVE OBSW --" << std::endl;
std::cout << "-- Compiled for Linux board " << BOARD_NAME << " --" << std::endl; std::cout << "-- Compiled for Linux board " << BOARD_NAME << " --" << std::endl;
std::cout << "-- OBSW " << SW_NAME << " v" << SW_VERSION << "." << SW_SUBVERSION << "." std::cout << "-- OBSW " << SW_NAME << " v" << SW_VERSION << "." << SW_SUBVERSION << "."
<< SW_REVISION << ", FSFW v" << fsfw::FSFW_VERSION << SW_REVISION << ", FSFW v" << fsfw::FSFW_VERSION << " --" << std::endl;
<< "--" << std::endl;
std::cout << "-- " << __DATE__ << " " << __TIME__ << " --" << std::endl; std::cout << "-- " << __DATE__ << " " << __TIME__ << " --" << std::endl;
initmission::initMission(); initmission::initMission();

View File

@ -22,5 +22,4 @@ add_subdirectory(comIF)
add_subdirectory(core) add_subdirectory(core)
add_subdirectory(memory) add_subdirectory(memory)
add_subdirectory(callbacks) add_subdirectory(callbacks)
add_subdirectory(devices)
add_subdirectory(xadc) add_subdirectory(xadc)

View File

@ -84,6 +84,7 @@ static constexpr char RS485_EN_TX_DATA[] = "tx_data_enable_ltc2872";
static constexpr char RS485_EN_RX_CLOCK[] = "rx_clock_enable_ltc2872"; static constexpr char RS485_EN_RX_CLOCK[] = "rx_clock_enable_ltc2872";
static constexpr char RS485_EN_RX_DATA[] = "rx_data_enable_ltc2872"; static constexpr char RS485_EN_RX_DATA[] = "rx_data_enable_ltc2872";
static constexpr char PDEC_RESET[] = "pdec_reset"; static constexpr char PDEC_RESET[] = "pdec_reset";
static constexpr char SYRLINKS_FAULT[] = "syrlinks_fault";
static constexpr char PL_PCDU_ENABLE_VBAT0[] = "enable_plpcdu_vbat0"; static constexpr char PL_PCDU_ENABLE_VBAT0[] = "enable_plpcdu_vbat0";
static constexpr char PL_PCDU_ENABLE_VBAT1[] = "enable_plpcdu_vbat1"; static constexpr char PL_PCDU_ENABLE_VBAT1[] = "enable_plpcdu_vbat1";
@ -94,6 +95,9 @@ static constexpr char PL_PCDU_ENABLE_HPA[] = "enable_plpcdu_hpa";
static constexpr char PL_PCDU_ENABLE_MPA[] = "enable_plpcdu_mpa"; static constexpr char PL_PCDU_ENABLE_MPA[] = "enable_plpcdu_mpa";
static constexpr char PL_PCDU_ADC_CS[] = "plpcdu_adc_chip_select"; static constexpr char PL_PCDU_ADC_CS[] = "plpcdu_adc_chip_select";
static constexpr char ENABLE_SUPV_UART[] = "enable_supv_uart";
static constexpr char ENABLE_MPSOC_UART[] = "enable_mpsoc_uart";
} // namespace gpioNames } // namespace gpioNames
} // namespace q7s } // namespace q7s

View File

@ -2,5 +2,5 @@ target_sources(${OBSW_NAME} PRIVATE
rwSpiCallback.cpp rwSpiCallback.cpp
gnssCallback.cpp gnssCallback.cpp
pcduSwitchCb.cpp pcduSwitchCb.cpp
gpioCallbacks.cpp q7sGpioCallbacks.cpp
) )

View File

@ -1,487 +0,0 @@
#include "gpioCallbacks.h"
#include <devices/gpioIds.h>
#include <fsfw/serviceinterface/ServiceInterface.h>
#include <fsfw_hal/common/gpio/GpioCookie.h>
#include <fsfw_hal/linux/gpio/LinuxLibgpioIF.h>
#include "busConf.h"
namespace gpioCallbacks {
GpioIF* gpioComInterface;
void initSpiCsDecoder(GpioIF* gpioComIF) {
using namespace gpio;
ReturnValue_t result;
if (gpioComIF == nullptr) {
sif::debug << "initSpiCsDecoder: Invalid gpioComIF" << std::endl;
return;
}
gpioComInterface = gpioComIF;
GpioCookie* spiMuxGpios = new GpioCookie;
GpiodRegularByLineName* spiMuxBit = nullptr;
/** Setting mux bit 1 to low will disable IC21 on the interface board */
spiMuxBit = new GpiodRegularByLineName(q7s::gpioNames::SPI_MUX_BIT_0_PIN, "SPI Mux Bit 1",
Direction::OUT, Levels::HIGH);
spiMuxGpios->addGpio(gpioIds::SPI_MUX_BIT_0, spiMuxBit);
/** Setting mux bit 2 to low disables IC1 on the TCS board */
spiMuxBit = new GpiodRegularByLineName(q7s::gpioNames::SPI_MUX_BIT_1_PIN, "SPI Mux Bit 2",
Direction::OUT, Levels::HIGH);
spiMuxGpios->addGpio(gpioIds::SPI_MUX_BIT_1, spiMuxBit);
/** Setting mux bit 3 to low disables IC2 on the TCS board and IC22 on the interface board */
spiMuxBit = new GpiodRegularByLineName(q7s::gpioNames::SPI_MUX_BIT_2_PIN, "SPI Mux Bit 3",
Direction::OUT, Levels::LOW);
spiMuxGpios->addGpio(gpioIds::SPI_MUX_BIT_2, spiMuxBit);
/** The following gpios can take arbitrary initial values */
spiMuxBit = new GpiodRegularByLineName(q7s::gpioNames::SPI_MUX_BIT_3_PIN, "SPI Mux Bit 4",
Direction::OUT, Levels::LOW);
spiMuxGpios->addGpio(gpioIds::SPI_MUX_BIT_3, spiMuxBit);
spiMuxBit = new GpiodRegularByLineName(q7s::gpioNames::SPI_MUX_BIT_4_PIN, "SPI Mux Bit 5",
Direction::OUT, Levels::LOW);
spiMuxGpios->addGpio(gpioIds::SPI_MUX_BIT_4, spiMuxBit);
spiMuxBit = new GpiodRegularByLineName(q7s::gpioNames::SPI_MUX_BIT_5_PIN, "SPI Mux Bit 6",
Direction::OUT, Levels::LOW);
spiMuxGpios->addGpio(gpioIds::SPI_MUX_BIT_5, spiMuxBit);
GpiodRegularByLineName* enRwDecoder = new GpiodRegularByLineName(
q7s::gpioNames::EN_RW_CS, "EN_RW_CS", Direction::OUT, Levels::HIGH);
spiMuxGpios->addGpio(gpioIds::EN_RW_CS, enRwDecoder);
result = gpioComInterface->addGpios(spiMuxGpios);
if (result != HasReturnvaluesIF::RETURN_OK) {
sif::error << "initSpiCsDecoder: Failed to add mux bit gpios to gpioComIF" << std::endl;
return;
}
}
void spiCsDecoderCallback(gpioId_t gpioId, gpio::GpioOperation gpioOp, gpio::Levels value,
void* args) {
using namespace gpio;
if (gpioComInterface == nullptr) {
sif::debug << "spiCsDecoderCallback: No gpioComIF specified. Call initSpiCsDecoder "
<< "to specify gpioComIF" << std::endl;
return;
}
/* Reading is not supported by the callback function */
if (gpioOp == gpio::GpioOperation::READ) {
return;
}
if (value == Levels::HIGH) {
switch (gpioId) {
case (gpioIds::RTD_IC_3): {
disableDecoderTcsIc1();
break;
}
case (gpioIds::RTD_IC_4): {
disableDecoderTcsIc1();
break;
}
case (gpioIds::RTD_IC_5): {
disableDecoderTcsIc1();
break;
}
case (gpioIds::RTD_IC_6): {
disableDecoderTcsIc1();
break;
}
case (gpioIds::RTD_IC_7): {
disableDecoderTcsIc1();
break;
}
case (gpioIds::RTD_IC_8): {
disableDecoderTcsIc1();
break;
}
case (gpioIds::RTD_IC_9): {
disableDecoderTcsIc1();
break;
}
case (gpioIds::RTD_IC_10): {
disableDecoderTcsIc1();
break;
}
case (gpioIds::RTD_IC_11): {
disableDecoderTcsIc2();
break;
}
case (gpioIds::RTD_IC_12): {
disableDecoderTcsIc2();
break;
}
case (gpioIds::RTD_IC_13): {
disableDecoderTcsIc2();
break;
}
case (gpioIds::RTD_IC_14): {
disableDecoderTcsIc2();
break;
}
case (gpioIds::RTD_IC_15): {
disableDecoderTcsIc2();
break;
}
case (gpioIds::RTD_IC_16): {
disableDecoderTcsIc2();
break;
}
case (gpioIds::RTD_IC_17): {
disableDecoderTcsIc2();
break;
}
case (gpioIds::RTD_IC_18): {
disableDecoderTcsIc2();
break;
}
case (gpioIds::CS_SUS_0): {
disableDecoderInterfaceBoardIc1();
break;
}
case (gpioIds::CS_SUS_1): {
disableDecoderInterfaceBoardIc1();
break;
}
case (gpioIds::CS_SUS_2): {
disableDecoderInterfaceBoardIc1();
break;
}
case (gpioIds::CS_SUS_3): {
disableDecoderInterfaceBoardIc1();
break;
}
case (gpioIds::CS_SUS_4): {
disableDecoderInterfaceBoardIc1();
break;
}
case (gpioIds::CS_SUS_5): {
disableDecoderInterfaceBoardIc1();
break;
}
case (gpioIds::CS_SUS_6): {
disableDecoderInterfaceBoardIc2();
break;
}
case (gpioIds::CS_SUS_7): {
disableDecoderInterfaceBoardIc2();
break;
}
case (gpioIds::CS_SUS_8): {
disableDecoderInterfaceBoardIc2();
break;
}
case (gpioIds::CS_SUS_9): {
disableDecoderInterfaceBoardIc2();
break;
}
case (gpioIds::CS_SUS_10): {
disableDecoderInterfaceBoardIc2();
break;
}
case (gpioIds::CS_SUS_11): {
disableDecoderInterfaceBoardIc2();
break;
}
case (gpioIds::CS_RW1): {
disableRwDecoder();
break;
}
case (gpioIds::CS_RW2): {
disableRwDecoder();
break;
}
case (gpioIds::CS_RW3): {
disableRwDecoder();
break;
}
case (gpioIds::CS_RW4): {
disableRwDecoder();
break;
}
default:
sif::debug << "spiCsDecoderCallback: Invalid gpio id " << gpioId << std::endl;
}
} else if (value == Levels::LOW) {
switch (gpioId) {
case (gpioIds::RTD_IC_3): {
selectY7();
enableDecoderTcsIc1();
break;
}
case (gpioIds::RTD_IC_4): {
selectY6();
enableDecoderTcsIc1();
break;
}
case (gpioIds::RTD_IC_5): {
selectY5();
enableDecoderTcsIc1();
break;
}
case (gpioIds::RTD_IC_6): {
selectY4();
enableDecoderTcsIc1();
break;
}
case (gpioIds::RTD_IC_7): {
selectY3();
enableDecoderTcsIc1();
break;
}
case (gpioIds::RTD_IC_8): {
selectY2();
enableDecoderTcsIc1();
break;
}
case (gpioIds::RTD_IC_9): {
selectY1();
enableDecoderTcsIc1();
break;
}
case (gpioIds::RTD_IC_10): {
selectY0();
enableDecoderTcsIc1();
break;
}
case (gpioIds::RTD_IC_11): {
selectY7();
enableDecoderTcsIc2();
break;
}
case (gpioIds::RTD_IC_12): {
selectY6();
enableDecoderTcsIc2();
break;
}
case (gpioIds::RTD_IC_13): {
selectY5();
enableDecoderTcsIc2();
break;
}
case (gpioIds::RTD_IC_14): {
selectY4();
enableDecoderTcsIc2();
break;
}
case (gpioIds::RTD_IC_15): {
selectY3();
enableDecoderTcsIc2();
break;
}
case (gpioIds::RTD_IC_16): {
selectY2();
enableDecoderTcsIc2();
break;
}
case (gpioIds::RTD_IC_17): {
selectY1();
enableDecoderTcsIc2();
break;
}
case (gpioIds::RTD_IC_18): {
selectY0();
enableDecoderTcsIc2();
break;
}
case (gpioIds::CS_SUS_0): {
selectY0();
enableDecoderInterfaceBoardIc1();
break;
}
case (gpioIds::CS_SUS_1): {
selectY1();
enableDecoderInterfaceBoardIc1();
break;
}
case (gpioIds::CS_SUS_2): {
selectY2();
enableDecoderInterfaceBoardIc1();
break;
}
case (gpioIds::CS_SUS_3): {
selectY3();
enableDecoderInterfaceBoardIc1();
break;
}
case (gpioIds::CS_SUS_4): {
selectY4();
enableDecoderInterfaceBoardIc1();
break;
}
case (gpioIds::CS_SUS_5): {
selectY5();
enableDecoderInterfaceBoardIc1();
break;
}
case (gpioIds::CS_SUS_6): {
selectY0();
enableDecoderInterfaceBoardIc2();
break;
}
case (gpioIds::CS_SUS_7): {
selectY1();
enableDecoderInterfaceBoardIc2();
break;
}
case (gpioIds::CS_SUS_8): {
selectY2();
enableDecoderInterfaceBoardIc2();
break;
}
case (gpioIds::CS_SUS_9): {
selectY3();
enableDecoderInterfaceBoardIc2();
break;
}
case (gpioIds::CS_SUS_10): {
selectY4();
enableDecoderInterfaceBoardIc2();
break;
}
case (gpioIds::CS_SUS_11): {
selectY5();
enableDecoderInterfaceBoardIc2();
break;
}
case (gpioIds::CS_RW1): {
selectY0();
enableRwDecoder();
break;
}
case (gpioIds::CS_RW2): {
selectY1();
enableRwDecoder();
break;
}
case (gpioIds::CS_RW3): {
selectY2();
enableRwDecoder();
break;
}
case (gpioIds::CS_RW4): {
selectY3();
enableRwDecoder();
break;
}
default:
sif::debug << "spiCsDecoderCallback: Invalid gpio id " << gpioId << std::endl;
}
} else {
sif::debug << "spiCsDecoderCallback: Invalid value. Must be 0 or 1" << std::endl;
}
}
void enableDecoderTcsIc1() {
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_0);
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_1);
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_2);
}
void enableDecoderTcsIc2() {
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_2);
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_0);
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_1);
}
void enableDecoderInterfaceBoardIc1() {
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_0);
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_1);
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_2);
}
void enableDecoderInterfaceBoardIc2() {
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_0);
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_1);
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_2);
}
void disableDecoderTcsIc1() {
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_0);
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_1);
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_2);
}
void disableDecoderTcsIc2() {
// DO NOT CHANGE THE ORDER HERE
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_0);
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_2);
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_1);
}
void disableDecoderInterfaceBoardIc1() {
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_0);
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_1);
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_2);
}
void disableDecoderInterfaceBoardIc2() {
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_0);
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_1);
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_2);
}
void enableRwDecoder() { gpioComInterface->pullHigh(gpioIds::EN_RW_CS); }
void disableRwDecoder() { gpioComInterface->pullLow(gpioIds::EN_RW_CS); }
void selectY0() {
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_3);
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_4);
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_5);
}
void selectY1() {
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_3);
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_4);
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_5);
}
void selectY2() {
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_3);
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_4);
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_5);
}
void selectY3() {
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_3);
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_4);
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_5);
}
void selectY4() {
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_3);
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_4);
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_5);
}
void selectY5() {
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_3);
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_4);
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_5);
}
void selectY6() {
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_3);
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_4);
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_5);
}
void selectY7() {
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_3);
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_4);
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_5);
}
void disableAllDecoder() {
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_2);
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_0);
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_1);
gpioComInterface->pullLow(gpioIds::EN_RW_CS);
}
} // namespace gpioCallbacks

View File

@ -0,0 +1,54 @@
#include "q7sGpioCallbacks.h"
#include <devices/gpioIds.h>
#include <fsfw/serviceinterface/ServiceInterface.h>
#include <fsfw_hal/common/gpio/GpioCookie.h>
#include <fsfw_hal/common/gpio/GpioIF.h>
#include "busConf.h"
void q7s::gpioCallbacks::initSpiCsDecoder(GpioIF* gpioComIF) {
using namespace gpio;
ReturnValue_t result;
if (gpioComIF == nullptr) {
sif::debug << "initSpiCsDecoder: Invalid gpioComIF" << std::endl;
return;
}
GpioCookie* spiMuxGpios = new GpioCookie;
GpiodRegularByLineName* spiMuxBit = nullptr;
/** Setting mux bit 1 to low will disable IC21 on the interface board */
spiMuxBit = new GpiodRegularByLineName(q7s::gpioNames::SPI_MUX_BIT_0_PIN, "SPI Mux Bit 1",
Direction::OUT, Levels::HIGH);
spiMuxGpios->addGpio(gpioIds::SPI_MUX_BIT_0, spiMuxBit);
/** Setting mux bit 2 to low disables IC1 on the TCS board */
spiMuxBit = new GpiodRegularByLineName(q7s::gpioNames::SPI_MUX_BIT_1_PIN, "SPI Mux Bit 2",
Direction::OUT, Levels::HIGH);
spiMuxGpios->addGpio(gpioIds::SPI_MUX_BIT_1, spiMuxBit);
/** Setting mux bit 3 to low disables IC2 on the TCS board and IC22 on the interface board */
spiMuxBit = new GpiodRegularByLineName(q7s::gpioNames::SPI_MUX_BIT_2_PIN, "SPI Mux Bit 3",
Direction::OUT, Levels::LOW);
spiMuxGpios->addGpio(gpioIds::SPI_MUX_BIT_2, spiMuxBit);
/** The following gpios can take arbitrary initial values */
spiMuxBit = new GpiodRegularByLineName(q7s::gpioNames::SPI_MUX_BIT_3_PIN, "SPI Mux Bit 4",
Direction::OUT, Levels::LOW);
spiMuxGpios->addGpio(gpioIds::SPI_MUX_BIT_3, spiMuxBit);
spiMuxBit = new GpiodRegularByLineName(q7s::gpioNames::SPI_MUX_BIT_4_PIN, "SPI Mux Bit 5",
Direction::OUT, Levels::LOW);
spiMuxGpios->addGpio(gpioIds::SPI_MUX_BIT_4, spiMuxBit);
spiMuxBit = new GpiodRegularByLineName(q7s::gpioNames::SPI_MUX_BIT_5_PIN, "SPI Mux Bit 6",
Direction::OUT, Levels::LOW);
spiMuxGpios->addGpio(gpioIds::SPI_MUX_BIT_5, spiMuxBit);
GpiodRegularByLineName* enRwDecoder = new GpiodRegularByLineName(
q7s::gpioNames::EN_RW_CS, "EN_RW_CS", Direction::OUT, Levels::HIGH);
spiMuxGpios->addGpio(gpioIds::EN_RW_CS, enRwDecoder);
result = gpioComIF->addGpios(spiMuxGpios);
if (result != HasReturnvaluesIF::RETURN_OK) {
sif::error << "initSpiCsDecoder: Failed to add mux bit gpios to gpioComIF" << std::endl;
return;
}
}

View File

@ -0,0 +1,15 @@
#pragma once
class GpioIF;
namespace q7s {
namespace gpioCallbacks {
/**
* @brief This function initializes the GPIOs used to control the SN74LVC138APWR decoders on
* the TCS Board and the interface board.
*/
void initSpiCsDecoder(GpioIF* gpioComIF);
} // namespace gpioCallbacks
} // namespace q7s

View File

@ -1,6 +1,7 @@
#include "CoreController.h" #include "CoreController.h"
#include <fsfw/events/EventManager.h> #include <fsfw/events/EventManager.h>
#include <fsfw/ipc/QueueFactory.h>
#include "OBSWConfig.h" #include "OBSWConfig.h"
#include "OBSWVersion.h" #include "OBSWVersion.h"
@ -16,11 +17,13 @@
#include <fcntl.h> #include <fcntl.h>
#include <unistd.h> #include <unistd.h>
#include <algorithm>
#include <filesystem> #include <filesystem>
#include "bsp_q7s/memory/SdCardManager.h" #include "bsp_q7s/memory/SdCardManager.h"
#include "bsp_q7s/memory/scratchApi.h" #include "bsp_q7s/memory/scratchApi.h"
#include "bsp_q7s/xadc/Xadc.h" #include "bsp_q7s/xadc/Xadc.h"
#include "linux/utility/utility.h"
xsc::Chip CoreController::CURRENT_CHIP = xsc::Chip::NO_CHIP; xsc::Chip CoreController::CURRENT_CHIP = xsc::Chip::NO_CHIP;
xsc::Copy CoreController::CURRENT_COPY = xsc::Copy::NO_COPY; xsc::Copy CoreController::CURRENT_COPY = xsc::Copy::NO_COPY;
@ -50,6 +53,7 @@ CoreController::CoreController(object_id_t objectId)
} catch (const std::filesystem::filesystem_error &e) { } catch (const std::filesystem::filesystem_error &e) {
sif::error << "CoreController::CoreController: Failed with exception " << e.what() << std::endl; sif::error << "CoreController::CoreController: Failed with exception " << e.what() << std::endl;
} }
eventQueue = QueueFactory::instance()->createMessageQueue(5, EventMessage::MAX_MESSAGE_SIZE);
} }
ReturnValue_t CoreController::handleCommandMessage(CommandMessage *message) { ReturnValue_t CoreController::handleCommandMessage(CommandMessage *message) {
@ -57,6 +61,16 @@ ReturnValue_t CoreController::handleCommandMessage(CommandMessage *message) {
} }
void CoreController::performControlOperation() { void CoreController::performControlOperation() {
EventMessage event;
for (ReturnValue_t result = eventQueue->receiveMessage(&event); result == RETURN_OK;
result = eventQueue->receiveMessage(&event)) {
switch (event.getEvent()) {
case (GpsHyperion::GPS_FIX_CHANGE): {
gpsFix = static_cast<GpsHyperion::FixMode>(event.getParameter2());
break;
}
}
}
performWatchdogControlOperation(); performWatchdogControlOperation();
sdStateMachine(); sdStateMachine();
performMountedSdCardOperations(); performMountedSdCardOperations();
@ -79,8 +93,10 @@ LocalPoolDataSetBase *CoreController::getDataSetHandle(sid_t sid) {
} }
ReturnValue_t CoreController::initialize() { ReturnValue_t CoreController::initialize() {
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; ReturnValue_t result = ExtendedControllerBase::initialize();
if (result != HasReturnvaluesIF::RETURN_OK) {
sif::warning << "CoreController::initialize: Base init failed" << std::endl;
}
result = scratch::writeNumber(scratch::ALLOC_FAILURE_COUNT, 0); result = scratch::writeNumber(scratch::ALLOC_FAILURE_COUNT, 0);
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
sif::warning << "CoreController::initialize: Setting up alloc failure " sif::warning << "CoreController::initialize: Setting up alloc failure "
@ -91,7 +107,23 @@ ReturnValue_t CoreController::initialize() {
sdStateMachine(); sdStateMachine();
triggerEvent(REBOOT_SW, CURRENT_CHIP, CURRENT_COPY); triggerEvent(REBOOT_SW, CURRENT_CHIP, CURRENT_COPY);
return ExtendedControllerBase::initialize(); EventManagerIF *eventManager =
ObjectManager::instance()->get<EventManagerIF>(objects::EVENT_MANAGER);
if (eventManager == nullptr or eventQueue == nullptr) {
sif::warning << "CoreController::initialize: No valid event manager found or "
"queue invalid"
<< std::endl;
}
result = eventManager->registerListener(eventQueue->getId());
if (result != HasReturnvaluesIF::RETURN_OK) {
sif::warning << "CoreController::initialize: Registering as event listener failed" << std::endl;
}
result = eventManager->subscribeToEvent(eventQueue->getId(),
event::getEventId(GpsHyperion::GPS_FIX_CHANGE));
if (result != HasReturnvaluesIF::RETURN_OK) {
sif::warning << "Subscribing for GPS GPS_FIX_CHANGE event failed" << std::endl;
}
return RETURN_OK;
} }
ReturnValue_t CoreController::initializeAfterTaskCreation() { ReturnValue_t CoreController::initializeAfterTaskCreation() {
@ -639,8 +671,7 @@ ReturnValue_t CoreController::initVersionFile() {
fsfw::FSFW_VERSION.getVersion(versionString, sizeof(versionString)); fsfw::FSFW_VERSION.getVersion(versionString, sizeof(versionString));
std::string fullFsfwVersionString = "FSFW: v" + std::string(versionString); std::string fullFsfwVersionString = "FSFW: v" + std::string(versionString);
std::string systemString = "System: " + unameLine; std::string systemString = "System: " + unameLine;
std::string mountPrefix = SdCardManager::instance()->getCurrentMountPrefix(); std::string versionFilePath = currMntPrefix + VERSION_FILE;
std::string versionFilePath = mountPrefix + VERSION_FILE;
std::fstream versionFile; std::fstream versionFile;
if (not std::filesystem::exists(versionFilePath)) { if (not std::filesystem::exists(versionFilePath)) {
@ -1198,24 +1229,27 @@ void CoreController::performWatchdogControlOperation() {
} }
void CoreController::performMountedSdCardOperations() { void CoreController::performMountedSdCardOperations() {
currMntPrefix = sdcMan->getCurrentMountPrefix();
if (doPerformMountedSdCardOps) { if (doPerformMountedSdCardOps) {
bool sdCardMounted = false; bool sdCardMounted = false;
sdCardMounted = sdcMan->isSdCardMounted(sdInfo.pref); sdCardMounted = sdcMan->isSdCardMounted(sdInfo.pref);
if (sdCardMounted) { if (sdCardMounted) {
std::string path = sdcMan->getCurrentMountPrefix(sdInfo.pref) + "/" + CONF_FOLDER; std::string path = currMntPrefix + "/" + CONF_FOLDER;
if (not std::filesystem::exists(path)) { if (not std::filesystem::exists(path)) {
std::filesystem::create_directory(path); std::filesystem::create_directory(path);
} }
initVersionFile(); initVersionFile();
initClockFromTimeFile();
performRebootFileHandling(false); performRebootFileHandling(false);
doPerformMountedSdCardOps = false; doPerformMountedSdCardOps = false;
} }
} }
timeFileHandler();
} }
void CoreController::performRebootFileHandling(bool recreateFile) { void CoreController::performRebootFileHandling(bool recreateFile) {
using namespace std; using namespace std;
std::string path = sdcMan->getCurrentMountPrefix(sdInfo.pref) + REBOOT_FILE; std::string path = currMntPrefix + REBOOT_FILE;
if (not std::filesystem::exists(path) or recreateFile) { if (not std::filesystem::exists(path) or recreateFile) {
#if OBSW_VERBOSE_LEVEL >= 1 #if OBSW_VERBOSE_LEVEL >= 1
sif::info << "CoreController::performRebootFileHandling: Recreating reboot file" << std::endl; sif::info << "CoreController::performRebootFileHandling: Recreating reboot file" << std::endl;
@ -1594,7 +1628,7 @@ bool CoreController::parseRebootFile(std::string path, RebootFile &rf) {
} }
void CoreController::resetRebootCount(xsc::Chip tgtChip, xsc::Copy tgtCopy) { void CoreController::resetRebootCount(xsc::Chip tgtChip, xsc::Copy tgtCopy) {
std::string path = sdcMan->getCurrentMountPrefix(sdInfo.pref) + REBOOT_FILE; std::string path = currMntPrefix + REBOOT_FILE;
// Disable the reboot file mechanism // Disable the reboot file mechanism
parseRebootFile(path, rebootFile); parseRebootFile(path, rebootFile);
if (tgtChip == xsc::ALL_CHIP and tgtCopy == xsc::ALL_COPY) { if (tgtChip == xsc::ALL_CHIP and tgtCopy == xsc::ALL_COPY) {
@ -1621,7 +1655,7 @@ void CoreController::resetRebootCount(xsc::Chip tgtChip, xsc::Copy tgtCopy) {
} }
void CoreController::rewriteRebootFile(RebootFile file) { void CoreController::rewriteRebootFile(RebootFile file) {
std::string path = sdcMan->getCurrentMountPrefix(sdInfo.pref) + REBOOT_FILE; std::string path = currMntPrefix + REBOOT_FILE;
std::ofstream rebootFile(path); std::ofstream rebootFile(path);
if (rebootFile.is_open()) { if (rebootFile.is_open()) {
// Initiate reboot file first. Reboot handling will be on on initialization // Initiate reboot file first. Reboot handling will be on on initialization
@ -1657,6 +1691,57 @@ void CoreController::setRebootMechanismLock(bool lock, xsc::Chip tgtChip, xsc::C
rewriteRebootFile(rebootFile); rewriteRebootFile(rebootFile);
} }
ReturnValue_t CoreController::timeFileHandler() {
if (gpsFix == GpsHyperion::FixMode::FIX_2D or gpsFix == GpsHyperion::FixMode::FIX_3D) {
// It is assumed that the system time is set from the GPS time
timeval currentTime = {};
ReturnValue_t result = Clock::getClock_timeval(&currentTime);
if (result != HasReturnvaluesIF::RETURN_OK) {
return result;
}
std::ofstream timeFile(currMntPrefix + TIME_FILE);
timeFile << "UNIX SECONDS: " << currentTime.tv_sec << std::endl;
}
return RETURN_OK;
}
ReturnValue_t CoreController::initClockFromTimeFile() {
using namespace GpsHyperion;
using namespace std;
std::string fileName = currMntPrefix + TIME_FILE;
if (std::filesystem::exists(fileName) and
((gpsFix == FixMode::UNKNOWN or gpsFix == FixMode::NOT_SEEN) or
not utility::timeSanityCheck())) {
ifstream timeFile(fileName);
string nextWord;
getline(timeFile, nextWord);
istringstream iss(nextWord);
iss >> nextWord;
if (iss.bad() or nextWord != "UNIX") {
return RETURN_FAILED;
}
iss >> nextWord;
if (iss.bad() or nextWord != "SECONDS:") {
return RETURN_FAILED;
}
iss >> nextWord;
timeval currentTime = {};
char *checkPtr;
currentTime.tv_sec = strtol(nextWord.c_str(), &checkPtr, 10);
if (iss.bad() or *checkPtr) {
return RETURN_FAILED;
}
#if OBSW_VERBOSE_LEVEL >= 1
time_t timeRaw = currentTime.tv_sec;
std::tm *time = std::gmtime(&timeRaw);
sif::info << "Setting system time from time files: " << std::put_time(time, "%c %Z")
<< std::endl;
#endif
return Clock::setClock(&currentTime);
}
return RETURN_OK;
}
void CoreController::readHkData() { void CoreController::readHkData() {
ReturnValue_t result = RETURN_OK; ReturnValue_t result = RETURN_OK;
result = hkSet.read(TIMEOUT_TYPE, MUTEX_TIMEOUT); result = hkSet.read(TIMEOUT_TYPE, MUTEX_TIMEOUT);
@ -1690,3 +1775,8 @@ void CoreController::readHkData() {
return; return;
} }
} }
bool CoreController::isNumber(const std::string &s) {
return !s.empty() && std::find_if(s.begin(), s.end(),
[](unsigned char c) { return !std::isdigit(c); }) == s.end();
}

View File

@ -10,6 +10,7 @@
#include "bsp_q7s/memory/SdCardManager.h" #include "bsp_q7s/memory/SdCardManager.h"
#include "events/subsystemIdRanges.h" #include "events/subsystemIdRanges.h"
#include "fsfw/controller/ExtendedControllerBase.h" #include "fsfw/controller/ExtendedControllerBase.h"
#include "mission/devices/devicedefinitions/GPSDefinitions.h"
class Timer; class Timer;
class SdCardManager; class SdCardManager;
@ -53,10 +54,12 @@ class CoreController : public ExtendedControllerBase {
static constexpr char CONF_FOLDER[] = "conf"; static constexpr char CONF_FOLDER[] = "conf";
static constexpr char VERSION_FILE_NAME[] = "version.txt"; static constexpr char VERSION_FILE_NAME[] = "version.txt";
static constexpr char REBOOT_FILE_NAME[] = "reboot.txt"; static constexpr char REBOOT_FILE_NAME[] = "reboot.txt";
static constexpr char TIME_FILE_NAME[] = "time.txt";
const std::string VERSION_FILE = const std::string VERSION_FILE =
"/" + std::string(CONF_FOLDER) + "/" + std::string(VERSION_FILE_NAME); "/" + std::string(CONF_FOLDER) + "/" + std::string(VERSION_FILE_NAME);
const std::string REBOOT_FILE = const std::string REBOOT_FILE =
"/" + std::string(CONF_FOLDER) + "/" + std::string(REBOOT_FILE_NAME); "/" + std::string(CONF_FOLDER) + "/" + std::string(REBOOT_FILE_NAME);
const std::string TIME_FILE = "/" + std::string(CONF_FOLDER) + "/" + std::string(TIME_FILE_NAME);
static constexpr ActionId_t LIST_DIRECTORY_INTO_FILE = 0; static constexpr ActionId_t LIST_DIRECTORY_INTO_FILE = 0;
static constexpr ActionId_t SWITCH_REBOOT_FILE_HANDLING = 5; static constexpr ActionId_t SWITCH_REBOOT_FILE_HANDLING = 5;
@ -126,6 +129,7 @@ class CoreController : public ExtendedControllerBase {
// Designated value for rechecking FIFO open // Designated value for rechecking FIFO open
static constexpr int RETRY_FIFO_OPEN = -2; static constexpr int RETRY_FIFO_OPEN = -2;
int watchdogFifoFd = 0; int watchdogFifoFd = 0;
GpsHyperion::FixMode gpsFix = GpsHyperion::FixMode::UNKNOWN;
// States for SD state machine, which is used in non-blocking mode // States for SD state machine, which is used in non-blocking mode
enum class SdStates { enum class SdStates {
@ -151,6 +155,7 @@ class CoreController : public ExtendedControllerBase {
static constexpr bool BLOCKING_SD_INIT = false; static constexpr bool BLOCKING_SD_INIT = false;
SdCardManager* sdcMan = nullptr; SdCardManager* sdcMan = nullptr;
MessageQueueIF* eventQueue = nullptr;
struct SdInfo { struct SdInfo {
sd::SdCard pref = sd::SdCard::NONE; sd::SdCard pref = sd::SdCard::NONE;
@ -173,6 +178,7 @@ class CoreController : public ExtendedControllerBase {
sd::SdState commandedState = sd::SdState::OFF; sd::SdState commandedState = sd::SdState::OFF;
} sdInfo; } sdInfo;
RebootFile rebootFile = {}; RebootFile rebootFile = {};
std::string currMntPrefix;
bool doPerformMountedSdCardOps = true; bool doPerformMountedSdCardOps = true;
/** /**
@ -192,6 +198,9 @@ class CoreController : public ExtendedControllerBase {
ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode, uint32_t* msToReachTheMode); ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode, uint32_t* msToReachTheMode);
void performMountedSdCardOperations(); void performMountedSdCardOperations();
ReturnValue_t initVersionFile(); ReturnValue_t initVersionFile();
ReturnValue_t initClockFromTimeFile();
ReturnValue_t timeFileHandler();
ReturnValue_t initBootCopy(); ReturnValue_t initBootCopy();
ReturnValue_t initWatchdogFifo(); ReturnValue_t initWatchdogFifo();
ReturnValue_t initSdCardBlocking(); ReturnValue_t initSdCardBlocking();
@ -226,6 +235,7 @@ class CoreController : public ExtendedControllerBase {
bool parseRebootFile(std::string path, RebootFile& file); bool parseRebootFile(std::string path, RebootFile& file);
void rewriteRebootFile(RebootFile file); void rewriteRebootFile(RebootFile file);
void readHkData(); void readHkData();
bool isNumber(const std::string& s);
}; };
#endif /* BSP_Q7S_CORE_CORECONTROLLER_H_ */ #endif /* BSP_Q7S_CORE_CORECONTROLLER_H_ */

View File

@ -55,14 +55,12 @@ void initmission::initTasks() {
void (*missedDeadlineFunc)(void) = nullptr; void (*missedDeadlineFunc)(void) = nullptr;
#endif #endif
#if BOARD_TE0720 == 0
PeriodicTaskIF* coreController = factory->createPeriodicTask( PeriodicTaskIF* coreController = factory->createPeriodicTask(
"CORE_CTRL", 60, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.4, missedDeadlineFunc); "CORE_CTRL", 60, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.4, missedDeadlineFunc);
result = coreController->addComponent(objects::CORE_CONTROLLER); result = coreController->addComponent(objects::CORE_CONTROLLER);
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("CORE_CTRL", objects::CORE_CONTROLLER); initmission::printAddObjectError("CORE_CTRL", objects::CORE_CONTROLLER);
} }
#endif
/* TMTC Distribution */ /* TMTC Distribution */
PeriodicTaskIF* tmTcDistributor = factory->createPeriodicTask( PeriodicTaskIF* tmTcDistributor = factory->createPeriodicTask(
@ -129,18 +127,19 @@ void initmission::initTasks() {
"SYS_TASK", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.4, missedDeadlineFunc); "SYS_TASK", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.4, missedDeadlineFunc);
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_ASS", objects::ACS_BOARD_ASS); initmission::printAddObjectError("ACS_BOARD_ASS", objects::ACS_BOARD_ASS);
} }
#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_ASS", objects::SUS_BOARD_ASS); initmission::printAddObjectError("SUS_BOARD_ASS", objects::SUS_BOARD_ASS);
} }
#endif
result = sysTask->addComponent(objects::TCS_BOARD_ASS); result = sysTask->addComponent(objects::TCS_BOARD_ASS);
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("TCS_BOARD_ASS", objects::TCS_BOARD_ASS); initmission::printAddObjectError("TCS_BOARD_ASS", objects::TCS_BOARD_ASS);
} }
#if BOARD_TE0720 == 0
// 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
PeriodicTaskIF* fsTask = factory->createPeriodicTask( PeriodicTaskIF* fsTask = factory->createPeriodicTask(
@ -159,7 +158,14 @@ void initmission::initTasks() {
} }
#endif /* OBSW_ADD_STAR_TRACKER == 1 */ #endif /* OBSW_ADD_STAR_TRACKER == 1 */
#endif /* BOARD_TE0720 */ #if OBSW_ADD_PLOC_MPSOC == 1
PeriodicTaskIF* mpsocHelperTask = factory->createPeriodicTask(
"PLOC_MPSOC_HELPER", 20, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc);
result = mpsocHelperTask->addComponent(objects::PLOC_MPSOC_HELPER);
if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("PLOC_MPSOC_HELPER", objects::PLOC_MPSOC_HELPER);
}
#endif /* OBSW_ADD_PLOC_MPSOC */
#if OBSW_TEST_CCSDS_BRIDGE == 1 #if OBSW_TEST_CCSDS_BRIDGE == 1
PeriodicTaskIF* ptmeTestTask = factory->createPeriodicTask( PeriodicTaskIF* ptmeTestTask = factory->createPeriodicTask(
@ -203,9 +209,7 @@ void initmission::initTasks() {
pdecHandlerTask->startTask(); pdecHandlerTask->startTask();
#endif /* OBSW_USE_CCSDS_IP_CORE == 1 */ #endif /* OBSW_USE_CCSDS_IP_CORE == 1 */
#if BOARD_TE0720 == 0
coreController->startTask(); coreController->startTask();
#endif
taskStarter(pstTasks, "PST task vector"); taskStarter(pstTasks, "PST task vector");
taskStarter(pusTasks, "PUS task vector"); taskStarter(pusTasks, "PUS task vector");
@ -217,12 +221,10 @@ void initmission::initTasks() {
ptmeTestTask->startTask(); ptmeTestTask->startTask();
#endif #endif
#if BOARD_TE0720 == 0
fsTask->startTask(); fsTask->startTask();
#if OBSW_ADD_STAR_TRACKER == 1 #if OBSW_ADD_STAR_TRACKER == 1
strHelperTask > startTask(); strHelperTask->startTask();
#endif /* OBSW_ADD_STAR_TRACKER == 1 */ #endif /* OBSW_ADD_STAR_TRACKER == 1 */
#endif
#if OBSW_ADD_ACS_HANDLERS == 1 #if OBSW_ADD_ACS_HANDLERS == 1
acsTask->startTask(); acsTask->startTask();
@ -236,15 +238,16 @@ void initmission::createPstTasks(TaskFactory& factory,
TaskDeadlineMissedFunction missedDeadlineFunc, TaskDeadlineMissedFunction missedDeadlineFunc,
std::vector<PeriodicTaskIF*>& taskVec) { std::vector<PeriodicTaskIF*>& taskVec) {
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
#if BOARD_TE0720 == 0
/* 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); "PST_TASK_DEFAULT", 70, 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) {
sif::error << "InitMission::initTasks: Creating PST failed!" << std::endl; sif::warning << "InitMission::initTasks: SPI PST is empty" << std::endl;
} else {
sif::error << "InitMission::initTasks: Creating SPI PST failed!" << std::endl;
} }
} else { } else {
taskVec.push_back(spiPst); taskVec.push_back(spiPst);
@ -255,43 +258,51 @@ void initmission::createPstTasks(TaskFactory& factory,
"UART_PST", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 0.2, missedDeadlineFunc); "UART_PST", 70, 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) {
sif::error << "InitMission::initTasks: Creating PST failed!" << std::endl; if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) {
sif::warning << "InitMission::initTasks: UART PST is empty" << std::endl;
} else {
sif::error << "InitMission::initTasks: Creating UART PST failed!" << std::endl;
} }
} else {
taskVec.push_back(uartPst); taskVec.push_back(uartPst);
}
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 * 4, 0.2, missedDeadlineFunc);
result = pst::pstGpio(gpioPst); result = pst::pstGpio(gpioPst);
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
sif::error << "InitMission::initTasks: Creating PST failed!" << std::endl; if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) {
sif::warning << "InitMission::initTasks: GPIO PST is empty" << std::endl;
} else {
sif::error << "InitMission::initTasks: Creating GPIO PST failed!" << std::endl;
} }
} else {
taskVec.push_back(gpioPst); taskVec.push_back(gpioPst);
}
#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", 70, 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) {
sif::error << "InitMission::initTasks: Creating PST failed!" << std::endl; if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) {
sif::warning << "InitMission::initTasks: I2C PST is empty" << std::endl;
} else {
sif::error << "InitMission::initTasks: Creating I2C PST failed!" << std::endl;
} }
} else {
taskVec.push_back(i2cPst); taskVec.push_back(i2cPst);
}
#endif #endif
FixedTimeslotTaskIF* gomSpacePstTask = factory.createFixedTimeslotTask( FixedTimeslotTaskIF* gomSpacePstTask = factory.createFixedTimeslotTask(
"GS_PST_TASK", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 1.0, missedDeadlineFunc); "GS_PST_TASK", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 1.0, missedDeadlineFunc);
result = pst::pstGompaceCan(gomSpacePstTask); result = pst::pstGompaceCan(gomSpacePstTask);
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
if (result != FixedTimeslotTaskIF::SLOT_LIST_EMPTY) {
sif::error << "InitMission::initTasks: GomSpace PST initialization failed!" << std::endl; sif::error << "InitMission::initTasks: GomSpace PST initialization failed!" << std::endl;
} }
taskVec.push_back(gomSpacePstTask);
#else /* BOARD_TE7020 == 0 */
FixedTimeslotTaskIF* pollingSequenceTaskTE0720 = factory.createFixedTimeslotTask(
"PST_TASK_TE0720", 30, PeriodicTaskIF::MINIMUM_STACK_SIZE * 8, 3.0, missedDeadlineFunc);
result = pst::pollingSequenceTE0720(pollingSequenceTaskTE0720);
if (result != HasReturnvaluesIF::RETURN_OK) {
sif::error << "InitMission::initTasks: Creating TE0720 PST failed!" << std::endl;
} }
taskVec.push_back(pollingSequenceTaskTE0720); taskVec.push_back(gomSpacePstTask);
#endif /* BOARD_TE7020 == 1 */
} }
void initmission::createPusTasks(TaskFactory& factory, void initmission::createPusTasks(TaskFactory& factory,
@ -398,12 +409,6 @@ void initmission::createTestTasks(TaskFactory& factory,
} }
#endif #endif
#if BOARD_TE0720 == 1 && OBSW_TEST_LIBGPIOD == 1
result = testTask->addComponent(objects::LIBGPIOD_TEST);
if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("GPIOD_TEST", objects::LIBGPIOD_TEST);
}
#endif /* BOARD_TE0720 == 1 && OBSW_TEST_LIBGPIOD == 1 */
taskVec.push_back(testTask); taskVec.push_back(testTask);
#endif // OBSW_ADD_TEST_TASK == 1 && OBSW_ADD_TEST_CODE == 1 #endif // OBSW_ADD_TEST_TASK == 1 && OBSW_ADD_TEST_CODE == 1

View File

@ -1,27 +1,12 @@
#include "ObjectFactory.h" #include "ObjectFactory.h"
#include <fsfw/ipc/QueueFactory.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/AcsBoardFdir.h>
#include <mission/system/RtdFdir.h>
#include <mission/system/SusAssembly.h>
#include <mission/system/SusFdir.h>
#include <mission/system/TcsBoardAssembly.h>
#include "OBSWConfig.h" #include "OBSWConfig.h"
#include "bsp_q7s/boardtest/Q7STestTask.h" #include "bsp_q7s/boardtest/Q7STestTask.h"
#include "bsp_q7s/callbacks/gnssCallback.h" #include "bsp_q7s/callbacks/gnssCallback.h"
#include "bsp_q7s/callbacks/gpioCallbacks.h"
#include "bsp_q7s/callbacks/pcduSwitchCb.h" #include "bsp_q7s/callbacks/pcduSwitchCb.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/devices/PlocMemoryDumper.h"
#include "bsp_q7s/devices/PlocSupervisorHandler.h"
#include "bsp_q7s/devices/PlocUpdater.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"
@ -29,15 +14,34 @@
#include "devices/addresses.h" #include "devices/addresses.h"
#include "devices/gpioIds.h" #include "devices/gpioIds.h"
#include "devices/powerSwitcherList.h" #include "devices/powerSwitcherList.h"
#include "fsfw/ipc/QueueFactory.h"
#include "linux/ObjectFactory.h"
#include "linux/boardtest/I2cTestClass.h" #include "linux/boardtest/I2cTestClass.h"
#include "linux/boardtest/SpiTestClass.h" #include "linux/boardtest/SpiTestClass.h"
#include "linux/boardtest/UartTestClass.h" #include "linux/boardtest/UartTestClass.h"
#include "linux/callbacks/gpioCallbacks.h"
#include "linux/csp/CspComIF.h" #include "linux/csp/CspComIF.h"
#include "linux/csp/CspCookie.h" #include "linux/csp/CspCookie.h"
#include "linux/devices/GPSHyperionLinuxController.h" #include "linux/devices/GPSHyperionLinuxController.h"
#include "linux/devices/devicedefinitions/PlocMPSoCDefinitions.h"
#include "linux/devices/devicedefinitions/StarTrackerDefinitions.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/StarTrackerHandler.h"
#include "linux/devices/startracker/StrHelper.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/AcsBoardFdir.h"
#include "mission/system/RtdFdir.h"
#include "mission/system/SusAssembly.h"
#include "mission/system/SusFdir.h"
#include "mission/system/TcsBoardAssembly.h"
#include "tmtc/apid.h" #include "tmtc/apid.h"
#include "tmtc/pusIds.h" #include "tmtc/pusIds.h"
@ -52,6 +56,7 @@
#include "fsfw/tmtcservices/CommandingServiceBase.h" #include "fsfw/tmtcservices/CommandingServiceBase.h"
#include "fsfw/tmtcservices/PusServiceBase.h" #include "fsfw/tmtcservices/PusServiceBase.h"
#include "fsfw_hal/common/gpio/GpioCookie.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/GyroL3GD20Handler.h"
#include "fsfw_hal/devicehandlers/MgmLIS3MDLHandler.h" #include "fsfw_hal/devicehandlers/MgmLIS3MDLHandler.h"
#include "fsfw_hal/devicehandlers/MgmRM3100Handler.h" #include "fsfw_hal/devicehandlers/MgmRM3100Handler.h"
@ -74,7 +79,6 @@
#include "mission/devices/PDU1Handler.h" #include "mission/devices/PDU1Handler.h"
#include "mission/devices/PDU2Handler.h" #include "mission/devices/PDU2Handler.h"
#include "mission/devices/PayloadPcduHandler.h" #include "mission/devices/PayloadPcduHandler.h"
#include "mission/devices/PlocMPSoCHandler.h"
#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"
@ -83,7 +87,6 @@
#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/PlocMPSoCDefinitions.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/SusDefinitions.h"
@ -106,8 +109,8 @@ void Factory::setStaticFrameworkObjectIds() {
CommandingServiceBase::defaultPacketSource = objects::PUS_PACKET_DISTRIBUTOR; CommandingServiceBase::defaultPacketSource = objects::PUS_PACKET_DISTRIBUTOR;
CommandingServiceBase::defaultPacketDestination = objects::TM_FUNNEL; CommandingServiceBase::defaultPacketDestination = objects::TM_FUNNEL;
// DeviceHandlerBase::powerSwitcherId = objects::PCDU_HANDLER; DeviceHandlerBase::powerSwitcherId = objects::PCDU_HANDLER;
DeviceHandlerBase::powerSwitcherId = objects::NO_OBJECT; // DeviceHandlerBase::powerSwitcherId = objects::NO_OBJECT;
#if OBSW_TM_TO_PTME == 1 #if OBSW_TM_TO_PTME == 1
TmFunnel::downlinkDestination = objects::CCSDS_HANDLER; TmFunnel::downlinkDestination = objects::CCSDS_HANDLER;
@ -134,13 +137,12 @@ void ObjectFactory::produce(void* args) {
PowerSwitchIF* pwrSwitcher = nullptr; PowerSwitchIF* pwrSwitcher = nullptr;
createCommunicationInterfaces(&gpioComIF, &uartComIF, &spiComIF, &i2cComIF); createCommunicationInterfaces(&gpioComIF, &uartComIF, &spiComIF, &i2cComIF);
createTmpComponents(); createTmpComponents();
#if BOARD_TE0720 == 0
new CoreController(objects::CORE_CONTROLLER); new CoreController(objects::CORE_CONTROLLER);
gpioCallbacks::disableAllDecoder(); gpioCallbacks::disableAllDecoder(gpioComIF);
createPcduComponents(gpioComIF, &pwrSwitcher); createPcduComponents(gpioComIF, &pwrSwitcher);
createRadSensorComponent(gpioComIF); createRadSensorComponent(gpioComIF);
createSunSensorComponents(gpioComIF, spiComIF, pwrSwitcher); createSunSensorComponents(gpioComIF, spiComIF, 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);
@ -148,11 +150,12 @@ void ObjectFactory::produce(void* args) {
createHeaterComponents(); createHeaterComponents();
createSolarArrayDeploymentComponents(); createSolarArrayDeploymentComponents();
createPlPcduComponents(gpioComIF, spiComIF); createPlPcduComponents(gpioComIF, spiComIF, pwrSwitcher);
#if OBSW_ADD_SYRLINKS == 1 #if OBSW_ADD_SYRLINKS == 1
createSyrlinksComponents(); createSyrlinksComponents();
#endif /* OBSW_ADD_SYRLINKS == 1 */ #endif /* OBSW_ADD_SYRLINKS == 1 */
createRtdComponents(gpioComIF, pwrSwitcher); createRtdComponents(q7s::SPI_DEFAULT_DEV, gpioComIF, pwrSwitcher);
createPayloadComponents(gpioComIF);
#if OBSW_ADD_MGT == 1 #if OBSW_ADD_MGT == 1
I2cCookie* imtqI2cCookie = I2cCookie* imtqI2cCookie =
@ -160,8 +163,8 @@ void ObjectFactory::produce(void* args) {
auto imtqHandler = new IMTQHandler(objects::IMTQ_HANDLER, objects::I2C_COM_IF, imtqI2cCookie); auto imtqHandler = new IMTQHandler(objects::IMTQ_HANDLER, objects::I2C_COM_IF, imtqI2cCookie);
static_cast<void>(imtqHandler); static_cast<void>(imtqHandler);
#if OBSW_DEBUG_IMTQ == 1 #if OBSW_DEBUG_IMTQ == 1
imtqHandler->setToGoToNormal(true);
imtqHandler->setStartUpImmediately(); imtqHandler->setStartUpImmediately();
imtqHandler->setToGoToNormal(true);
#else #else
(void)imtqHandler; (void)imtqHandler;
#endif #endif
@ -180,39 +183,19 @@ void ObjectFactory::produce(void* args) {
#endif #endif
#endif #endif
#if OBSW_ADD_PLOC_MPSOC == 1
UartCookie* plocMpsocCookie =
new UartCookie(objects::PLOC_MPSOC_HANDLER, q7s::UART_PLOC_MPSOC_DEV,
UartModes::NON_CANONICAL, uart::PLOC_MPSOC_BAUD, PLOC_MPSOC::MAX_REPLY_SIZE);
new PlocMPSoCHandler(objects::PLOC_MPSOC_HANDLER, objects::UART_COM_IF, plocMpsocCookie);
#endif /* OBSW_ADD_PLOC_MPSOC == 1 */
#if OBSW_ADD_PLOC_SUPERVISOR == 1
UartCookie* plocSupervisorCookie = new UartCookie(
objects::PLOC_SUPERVISOR_HANDLER, q7s::UART_PLOC_SUPERVSIOR_DEV, UartModes::NON_CANONICAL,
uart::PLOC_SUPERVISOR_BAUD, PLOC_SPV::MAX_PACKET_SIZE * 20);
plocSupervisorCookie->setNoFixedSizeReply();
PlocSupervisorHandler* plocSupervisor = new PlocSupervisorHandler(
objects::PLOC_SUPERVISOR_HANDLER, objects::UART_COM_IF, plocSupervisorCookie);
plocSupervisor->setStartUpImmediately();
#endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */
new FileSystemHandler(objects::FILE_SYSTEM_HANDLER); new FileSystemHandler(objects::FILE_SYSTEM_HANDLER);
#if OBSW_ADD_STAR_TRACKER == 1 #if OBSW_ADD_STAR_TRACKER == 1
UartCookie* starTrackerCookie = UartCookie* starTrackerCookie =
new UartCookie(objects::STAR_TRACKER, q7s::UART_STAR_TRACKER_DEV, UartModes::NON_CANONICAL, new UartCookie(objects::STAR_TRACKER, q7s::UART_STAR_TRACKER_DEV, UartModes::NON_CANONICAL,
uart::STAR_TRACKER_BAUD, StarTracker::MAX_FRAME_SIZE * 2 + 2); uart::STAR_TRACKER_BAUD, startracker::MAX_FRAME_SIZE * 2 + 2);
starTrackerCookie->setNoFixedSizeReply(); starTrackerCookie->setNoFixedSizeReply();
StrHelper* strHelper = new StrHelper(objects::STR_HELPER); StrHelper* strHelper = new StrHelper(objects::STR_HELPER);
StarTrackerHandler* starTrackerHandler = new StarTrackerHandler( new StarTrackerHandler(objects::STAR_TRACKER, objects::UART_COM_IF, starTrackerCookie, strHelper,
objects::STAR_TRACKER, objects::UART_COM_IF, starTrackerCookie, strHelper); pcduSwitches::PDU1_CH2_STAR_TRACKER_5V);
starTrackerHandler->setStartUpImmediately();
#endif /* OBSW_ADD_STAR_TRACKER == 1 */ #endif /* OBSW_ADD_STAR_TRACKER == 1 */
#endif /* TE7020 == 0 */
#if OBSW_USE_CCSDS_IP_CORE == 1 #if OBSW_USE_CCSDS_IP_CORE == 1
createCcsdsComponents(gpioComIF); createCcsdsComponents(gpioComIF);
#endif /* OBSW_USE_CCSDS_IP_CORE == 1 */ #endif /* OBSW_USE_CCSDS_IP_CORE == 1 */
@ -227,17 +210,10 @@ void ObjectFactory::produce(void* args) {
} }
void ObjectFactory::createTmpComponents() { void ObjectFactory::createTmpComponents() {
#if BOARD_TE0720 == 1
I2cCookie* i2cCookieTmp1075tcs1 =
new I2cCookie(addresses::TMP1075_TCS_1, TMP1075::MAX_REPLY_LENGTH, std::string("/dev/i2c-0"));
I2cCookie* i2cCookieTmp1075tcs2 =
new I2cCookie(addresses::TMP1075_TCS_2, TMP1075::MAX_REPLY_LENGTH, std::string("/dev/i2c-0"));
#else
I2cCookie* i2cCookieTmp1075tcs1 = I2cCookie* i2cCookieTmp1075tcs1 =
new I2cCookie(addresses::TMP1075_TCS_1, TMP1075::MAX_REPLY_LENGTH, q7s::I2C_DEFAULT_DEV); new I2cCookie(addresses::TMP1075_TCS_1, TMP1075::MAX_REPLY_LENGTH, q7s::I2C_DEFAULT_DEV);
I2cCookie* i2cCookieTmp1075tcs2 = I2cCookie* i2cCookieTmp1075tcs2 =
new I2cCookie(addresses::TMP1075_TCS_2, TMP1075::MAX_REPLY_LENGTH, q7s::I2C_DEFAULT_DEV); new I2cCookie(addresses::TMP1075_TCS_2, TMP1075::MAX_REPLY_LENGTH, q7s::I2C_DEFAULT_DEV);
#endif
/* Temperature sensors */ /* Temperature sensors */
Tmp1075Handler* tmp1075Handler_1 = Tmp1075Handler* tmp1075Handler_1 =
@ -262,10 +238,8 @@ void ObjectFactory::createCommunicationInterfaces(LinuxLibgpioIF** gpioComIF, Ua
*uartComIF = new UartComIF(objects::UART_COM_IF); *uartComIF = new UartComIF(objects::UART_COM_IF);
*spiComIF = new SpiComIF(objects::SPI_COM_IF, *gpioComIF); *spiComIF = new SpiComIF(objects::SPI_COM_IF, *gpioComIF);
#if BOARD_TE0720 == 0
/* Adding gpios for chip select decoding to the gpioComIf */ /* Adding gpios for chip select decoding to the gpioComIf */
gpioCallbacks::initSpiCsDecoder(*gpioComIF); q7s::gpioCallbacks::initSpiCsDecoder(*gpioComIF);
#endif
} }
void ObjectFactory::createPcduComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchIF** pwrSwitcher) { void ObjectFactory::createPcduComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchIF** pwrSwitcher) {
@ -278,10 +252,8 @@ void ObjectFactory::createPcduComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchI
new P60DockHandler(objects::P60DOCK_HANDLER, objects::CSP_COM_IF, p60DockCspCookie); new P60DockHandler(objects::P60DOCK_HANDLER, objects::CSP_COM_IF, p60DockCspCookie);
PDU1Handler* pdu1handler = PDU1Handler* pdu1handler =
new PDU1Handler(objects::PDU1_HANDLER, objects::CSP_COM_IF, pdu1CspCookie); new PDU1Handler(objects::PDU1_HANDLER, objects::CSP_COM_IF, pdu1CspCookie);
pdu1handler->assignChannelHookFunction(&pcdu::switchCallback, gpioComIF);
PDU2Handler* pdu2handler = PDU2Handler* pdu2handler =
new PDU2Handler(objects::PDU2_HANDLER, objects::CSP_COM_IF, pdu2CspCookie); new PDU2Handler(objects::PDU2_HANDLER, objects::CSP_COM_IF, pdu2CspCookie);
pdu2handler->assignChannelHookFunction(&pcdu::switchCallback, gpioComIF);
ACUHandler* acuhandler = new ACUHandler(objects::ACU_HANDLER, objects::CSP_COM_IF, acuCspCookie); ACUHandler* acuhandler = new ACUHandler(objects::ACU_HANDLER, objects::CSP_COM_IF, acuCspCookie);
auto pcduHandler = new PCDUHandler(objects::PCDU_HANDLER, 50); auto pcduHandler = new PCDUHandler(objects::PCDU_HANDLER, 50);
@ -326,161 +298,6 @@ void ObjectFactory::createRadSensorComponent(LinuxLibgpioIF* gpioComIF) {
#endif #endif
} }
void ObjectFactory::createSunSensorComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF,
PowerSwitchIF* pwrSwitcher) {
using namespace gpio;
GpioCookie* gpioCookieSus = new GpioCookie();
GpioCallback* susgpio = nullptr;
susgpio = new GpioCallback("Chip select SUS 0", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_0, susgpio);
susgpio = new GpioCallback("Chip select SUS 1", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_1, susgpio);
susgpio = new GpioCallback("Chip select SUS 2", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_2, susgpio);
susgpio = new GpioCallback("Chip select SUS 3", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_3, susgpio);
susgpio = new GpioCallback("Chip select SUS 4", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_4, susgpio);
susgpio = new GpioCallback("Chip select SUS 5", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_5, susgpio);
susgpio = new GpioCallback("Chip select SUS 6", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_6, susgpio);
susgpio = new GpioCallback("Chip select SUS 7", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_7, susgpio);
susgpio = new GpioCallback("Chip select SUS 8", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_8, susgpio);
susgpio = new GpioCallback("Chip select SUS 9", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_9, susgpio);
susgpio = new GpioCallback("Chip select SUS 10", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_10, susgpio);
susgpio = new GpioCallback("Chip select SUS 11", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_11, susgpio);
gpioComIF->addGpios(gpioCookieSus);
SusFdir* fdir = nullptr;
std::array<SusHandler*, 12> susHandlers = {};
#if OBSW_ADD_SUN_SENSORS == 1
SpiCookie* spiCookie =
new SpiCookie(addresses::SUS_0, gpioIds::CS_SUS_0, q7s::SPI_DEFAULT_DEV, SUS::MAX_CMD_SIZE,
spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
susHandlers[0] = new SusHandler(objects::SUS_0, 0, objects::SPI_COM_IF, spiCookie);
fdir = new SusFdir(objects::SUS_0);
susHandlers[0]->setParent(objects::SUS_BOARD_ASS);
susHandlers[0]->setCustomFdir(fdir);
spiCookie = new SpiCookie(addresses::SUS_1, gpioIds::CS_SUS_1, q7s::SPI_DEFAULT_DEV,
SUS::MAX_CMD_SIZE, spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
susHandlers[1] = new SusHandler(objects::SUS_1, 1, objects::SPI_COM_IF, spiCookie);
fdir = new SusFdir(objects::SUS_1);
susHandlers[1]->setParent(objects::SUS_BOARD_ASS);
susHandlers[1]->setCustomFdir(fdir);
spiCookie = new SpiCookie(addresses::SUS_2, gpioIds::CS_SUS_2, q7s::SPI_DEFAULT_DEV,
SUS::MAX_CMD_SIZE, spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
susHandlers[2] = new SusHandler(objects::SUS_2, 2, objects::SPI_COM_IF, spiCookie);
fdir = new SusFdir(objects::SUS_2);
susHandlers[2]->setParent(objects::SUS_BOARD_ASS);
susHandlers[2]->setCustomFdir(fdir);
spiCookie = new SpiCookie(addresses::SUS_3, gpioIds::CS_SUS_3, std::string(q7s::SPI_DEFAULT_DEV),
SUS::MAX_CMD_SIZE, spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
susHandlers[3] = new SusHandler(objects::SUS_3, 3, objects::SPI_COM_IF, spiCookie);
fdir = new SusFdir(objects::SUS_3);
susHandlers[3]->setParent(objects::SUS_BOARD_ASS);
susHandlers[3]->setCustomFdir(fdir);
spiCookie = new SpiCookie(addresses::SUS_4, gpioIds::CS_SUS_4, std::string(q7s::SPI_DEFAULT_DEV),
SUS::MAX_CMD_SIZE, spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
susHandlers[4] = new SusHandler(objects::SUS_4, 4, objects::SPI_COM_IF, spiCookie);
fdir = new SusFdir(objects::SUS_4);
susHandlers[4]->setParent(objects::SUS_BOARD_ASS);
susHandlers[4]->setCustomFdir(fdir);
spiCookie = new SpiCookie(addresses::SUS_5, gpioIds::CS_SUS_5, std::string(q7s::SPI_DEFAULT_DEV),
SUS::MAX_CMD_SIZE, spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
susHandlers[5] = new SusHandler(objects::SUS_5, 5, objects::SPI_COM_IF, spiCookie);
fdir = new SusFdir(objects::SUS_5);
susHandlers[5]->setParent(objects::SUS_BOARD_ASS);
susHandlers[5]->setCustomFdir(fdir);
spiCookie = new SpiCookie(addresses::SUS_6, gpioIds::CS_SUS_6, q7s::SPI_DEFAULT_DEV,
SUS::MAX_CMD_SIZE, spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
susHandlers[6] = new SusHandler(objects::SUS_6, 6, objects::SPI_COM_IF, spiCookie);
fdir = new SusFdir(objects::SUS_6);
susHandlers[6]->setParent(objects::SUS_BOARD_ASS);
susHandlers[6]->setCustomFdir(fdir);
spiCookie = new SpiCookie(addresses::SUS_7, gpioIds::CS_SUS_7, q7s::SPI_DEFAULT_DEV,
SUS::MAX_CMD_SIZE, spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
susHandlers[7] = new SusHandler(objects::SUS_7, 7, objects::SPI_COM_IF, spiCookie);
fdir = new SusFdir(objects::SUS_7);
susHandlers[7]->setParent(objects::SUS_BOARD_ASS);
susHandlers[7]->setCustomFdir(fdir);
spiCookie = new SpiCookie(addresses::SUS_8, gpioIds::CS_SUS_8, q7s::SPI_DEFAULT_DEV,
SUS::MAX_CMD_SIZE, spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
susHandlers[8] = new SusHandler(objects::SUS_8, 8, objects::SPI_COM_IF, spiCookie);
fdir = new SusFdir(objects::SUS_8);
susHandlers[8]->setParent(objects::SUS_BOARD_ASS);
susHandlers[8]->setCustomFdir(fdir);
spiCookie = new SpiCookie(addresses::SUS_9, gpioIds::CS_SUS_9, q7s::SPI_DEFAULT_DEV,
SUS::MAX_CMD_SIZE, spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
susHandlers[9] = new SusHandler(objects::SUS_9, 9, objects::SPI_COM_IF, spiCookie);
fdir = new SusFdir(objects::SUS_9);
susHandlers[9]->setParent(objects::SUS_BOARD_ASS);
susHandlers[9]->setCustomFdir(fdir);
spiCookie = new SpiCookie(addresses::SUS_10, gpioIds::CS_SUS_10, q7s::SPI_DEFAULT_DEV,
SUS::MAX_CMD_SIZE, spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
susHandlers[10] = new SusHandler(objects::SUS_10, 10, objects::SPI_COM_IF, spiCookie);
fdir = new SusFdir(objects::SUS_10);
susHandlers[10]->setParent(objects::SUS_BOARD_ASS);
susHandlers[10]->setCustomFdir(fdir);
spiCookie = new SpiCookie(addresses::SUS_11, gpioIds::CS_SUS_11, q7s::SPI_DEFAULT_DEV,
SUS::MAX_CMD_SIZE, spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
susHandlers[11] = new SusHandler(objects::SUS_11, 11, objects::SPI_COM_IF, spiCookie);
fdir = new SusFdir(objects::SUS_11);
susHandlers[11]->setParent(objects::SUS_BOARD_ASS);
susHandlers[11]->setCustomFdir(fdir);
for (auto& sus : susHandlers) {
if (sus != nullptr) {
#if OBSW_TEST_SUS == 1
sus->setStartUpImmediately();
sus->setToGoToNormalMode(true);
#endif
#if OBSW_DEBUG_SUS == 1
sus->enablePeriodicPrintout(true, 3);
#endif
}
}
std::array<object_id_t, 12> susIds = {objects::SUS_0, objects::SUS_1, objects::SUS_2,
objects::SUS_3, objects::SUS_4, objects::SUS_5,
objects::SUS_6, objects::SUS_7, objects::SUS_8,
objects::SUS_9, objects::SUS_10, objects::SUS_11};
SusAssHelper susAssHelper = SusAssHelper(susIds);
auto susAss =
new SusAssembly(objects::SUS_BOARD_ASS, objects::NO_OBJECT, pwrSwitcher, susAssHelper);
static_cast<void>(susAss);
#endif /* OBSW_ADD_SUN_SENSORS == 1 */
}
void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComIF* uartComIF, void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComIF* uartComIF,
PowerSwitchIF* pwrSwitcher) { PowerSwitchIF* pwrSwitcher) {
using namespace gpio; using namespace gpio;
@ -739,15 +556,6 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
auto acsAss = new AcsBoardAssembly(objects::ACS_BOARD_ASS, objects::NO_OBJECT, pwrSwitcher, auto acsAss = new AcsBoardAssembly(objects::ACS_BOARD_ASS, objects::NO_OBJECT, pwrSwitcher,
acsBoardHelper, gpioComIF); acsBoardHelper, gpioComIF);
static_cast<void>(acsAss); static_cast<void>(acsAss);
#if OBSW_TEST_ACS_BOARD_ASS == 1
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;
}
#endif
#endif /* OBSW_ADD_ACS_HANDLERS == 1 */ #endif /* OBSW_ADD_ACS_HANDLERS == 1 */
} }
@ -820,119 +628,49 @@ void ObjectFactory::createSolarArrayDeploymentComponents() {
void ObjectFactory::createSyrlinksComponents() { void ObjectFactory::createSyrlinksComponents() {
UartCookie* syrlinksUartCookie = UartCookie* syrlinksUartCookie =
new UartCookie(objects::SYRLINKS_HK_HANDLER, q7s::UART_SYRLINKS_DEV, UartModes::NON_CANONICAL, new UartCookie(objects::SYRLINKS_HK_HANDLER, q7s::UART_SYRLINKS_DEV, UartModes::NON_CANONICAL,
uart::SYRLINKS_BAUD, SYRLINKS::MAX_REPLY_SIZE); uart::SYRLINKS_BAUD, syrlinks::MAX_REPLY_SIZE);
syrlinksUartCookie->setParityEven(); syrlinksUartCookie->setParityEven();
new SyrlinksHkHandler(objects::SYRLINKS_HK_HANDLER, objects::UART_COM_IF, syrlinksUartCookie); new SyrlinksHkHandler(objects::SYRLINKS_HK_HANDLER, objects::UART_COM_IF, syrlinksUartCookie,
pcduSwitches::PDU1_CH1_SYRLINKS_12V);
} }
void ObjectFactory::createRtdComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchIF* pwrSwitcher) { void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF) {
using namespace gpio; using namespace gpio;
GpioCookie* rtdGpioCookie = new GpioCookie; 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,
UartModes::NON_CANONICAL, uart::PLOC_MPSOC_BAUD, mpsoc::MAX_REPLY_SIZE);
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 */
GpioCallback* gpioRtdIc0 = new GpioCallback("Chip select RTD IC0", Direction::OUT, Levels::HIGH, #if OBSW_ADD_PLOC_SUPERVISOR == 1
&gpioCallbacks::spiCsDecoderCallback, gpioComIF); consumer << "0x" << std::hex << objects::PLOC_SUPERVISOR_HANDLER;
rtdGpioCookie->addGpio(gpioIds::RTD_IC_3, gpioRtdIc0); auto gpioConfigSupv = new GpiodRegularByLineName(q7s::gpioNames::ENABLE_SUPV_UART, consumer.str(),
GpioCallback* gpioRtdIc1 = new GpioCallback("Chip select RTD IC1", Direction::OUT, Levels::HIGH, Direction::OUT, Levels::HIGH);
&gpioCallbacks::spiCsDecoderCallback, gpioComIF); auto supvGpioCookie = new GpioCookie;
rtdGpioCookie->addGpio(gpioIds::RTD_IC_4, gpioRtdIc1); supvGpioCookie->addGpio(gpioIds::ENABLE_SUPV_UART, gpioConfigSupv);
GpioCallback* gpioRtdIc2 = new GpioCallback("Chip select RTD IC2", Direction::OUT, Levels::HIGH, gpioComIF->addGpios(supvGpioCookie);
&gpioCallbacks::spiCsDecoderCallback, gpioComIF); auto supervisorCookie = new UartCookie(objects::PLOC_SUPERVISOR_HANDLER,
rtdGpioCookie->addGpio(gpioIds::RTD_IC_5, gpioRtdIc2); q7s::UART_PLOC_SUPERVSIOR_DEV, UartModes::NON_CANONICAL,
GpioCallback* gpioRtdIc3 = new GpioCallback("Chip select RTD IC3", Direction::OUT, Levels::HIGH, uart::PLOC_SUPERVISOR_BAUD, supv::MAX_PACKET_SIZE * 20);
&gpioCallbacks::spiCsDecoderCallback, gpioComIF); supervisorCookie->setNoFixedSizeReply();
rtdGpioCookie->addGpio(gpioIds::RTD_IC_6, gpioRtdIc3); new PlocSupervisorHandler(objects::PLOC_SUPERVISOR_HANDLER, objects::UART_COM_IF,
GpioCallback* gpioRtdIc4 = new GpioCallback("Chip select RTD IC4", Direction::OUT, Levels::HIGH, supervisorCookie, Gpio(gpioIds::ENABLE_SUPV_UART, gpioComIF),
&gpioCallbacks::spiCsDecoderCallback, gpioComIF); pcduSwitches::PDU1_CH6_PLOC_12V);
rtdGpioCookie->addGpio(gpioIds::RTD_IC_7, gpioRtdIc4); #endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */
GpioCallback* gpioRtdIc5 = new GpioCallback("Chip select RTD IC5", Direction::OUT, Levels::HIGH, static_cast<void>(consumer);
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
rtdGpioCookie->addGpio(gpioIds::RTD_IC_8, gpioRtdIc5);
GpioCallback* gpioRtdIc6 = new GpioCallback("Chip select RTD IC6", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
rtdGpioCookie->addGpio(gpioIds::RTD_IC_9, gpioRtdIc6);
GpioCallback* gpioRtdIc7 = new GpioCallback("Chip select RTD IC7", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
rtdGpioCookie->addGpio(gpioIds::RTD_IC_10, gpioRtdIc7);
GpioCallback* gpioRtdIc8 = new GpioCallback("Chip select RTD IC8", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
rtdGpioCookie->addGpio(gpioIds::RTD_IC_11, gpioRtdIc8);
GpioCallback* gpioRtdIc9 = new GpioCallback("Chip select RTD IC9", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
rtdGpioCookie->addGpio(gpioIds::RTD_IC_12, gpioRtdIc9);
GpioCallback* gpioRtdIc10 = new GpioCallback("Chip select RTD IC10", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
rtdGpioCookie->addGpio(gpioIds::RTD_IC_13, gpioRtdIc10);
GpioCallback* gpioRtdIc11 = new GpioCallback("Chip select RTD IC11", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
rtdGpioCookie->addGpio(gpioIds::RTD_IC_14, gpioRtdIc11);
GpioCallback* gpioRtdIc12 = new GpioCallback("Chip select RTD IC12", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
rtdGpioCookie->addGpio(gpioIds::RTD_IC_15, gpioRtdIc12);
GpioCallback* gpioRtdIc13 = new GpioCallback("Chip select RTD IC13", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
rtdGpioCookie->addGpio(gpioIds::RTD_IC_16, gpioRtdIc13);
GpioCallback* gpioRtdIc14 = new GpioCallback("Chip select RTD IC14", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
rtdGpioCookie->addGpio(gpioIds::RTD_IC_17, gpioRtdIc14);
GpioCallback* gpioRtdIc15 = new GpioCallback("Chip select RTD IC15", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
rtdGpioCookie->addGpio(gpioIds::RTD_IC_18, gpioRtdIc15);
gpioComIF->addGpios(rtdGpioCookie);
static constexpr uint8_t NUMBER_RTDS = 16;
#if OBSW_ADD_RTD_DEVICES == 1
std::array<std::pair<address_t, gpioId_t>, NUMBER_RTDS> cookieArgs = {{
{addresses::RTD_IC_3, gpioIds::RTD_IC_3},
{addresses::RTD_IC_4, gpioIds::RTD_IC_4},
{addresses::RTD_IC_5, gpioIds::RTD_IC_5},
{addresses::RTD_IC_6, gpioIds::RTD_IC_6},
{addresses::RTD_IC_7, gpioIds::RTD_IC_7},
{addresses::RTD_IC_8, gpioIds::RTD_IC_8},
{addresses::RTD_IC_9, gpioIds::RTD_IC_9},
{addresses::RTD_IC_10, gpioIds::RTD_IC_10},
{addresses::RTD_IC_11, gpioIds::RTD_IC_11},
{addresses::RTD_IC_12, gpioIds::RTD_IC_12},
{addresses::RTD_IC_13, gpioIds::RTD_IC_13},
{addresses::RTD_IC_14, gpioIds::RTD_IC_14},
{addresses::RTD_IC_15, gpioIds::RTD_IC_15},
{addresses::RTD_IC_16, gpioIds::RTD_IC_16},
{addresses::RTD_IC_17, gpioIds::RTD_IC_17},
{addresses::RTD_IC_18, gpioIds::RTD_IC_18},
}};
std::array<object_id_t, NUMBER_RTDS> rtdIds = {
objects::RTD_IC_3, objects::RTD_IC_4, objects::RTD_IC_5, objects::RTD_IC_6,
objects::RTD_IC_7, objects::RTD_IC_8, objects::RTD_IC_9, objects::RTD_IC_10,
objects::RTD_IC_11, objects::RTD_IC_12, objects::RTD_IC_13, objects::RTD_IC_14,
objects::RTD_IC_15, objects::RTD_IC_16, objects::RTD_IC_17, objects::RTD_IC_18};
std::array<SpiCookie*, NUMBER_RTDS> rtdCookies = {};
std::array<Max31865PT1000Handler*, NUMBER_RTDS> rtds = {};
RtdFdir* rtdFdir = nullptr;
for (uint8_t idx = 0; idx < NUMBER_RTDS; idx++) {
rtdCookies[idx] =
new SpiCookie(cookieArgs[idx].first, cookieArgs[idx].second, q7s::SPI_DEFAULT_DEV,
Max31865Definitions::MAX_REPLY_SIZE, spi::RTD_MODE, spi::RTD_SPEED);
rtds[idx] = new Max31865PT1000Handler(rtdIds[idx], objects::SPI_COM_IF, rtdCookies[idx]);
rtds[idx]->setParent(objects::TCS_BOARD_ASS);
rtdFdir = new RtdFdir(rtdIds[idx]);
rtds[idx]->setCustomFdir(rtdFdir);
}
#if OBSW_TEST_RTD == 1
for (auto& rtd : rtds) {
if (rtd != nullptr) {
rtd->setStartUpImmediately();
rtd->setInstantNormal(true);
}
}
#endif // OBSW_TEST_RTD == 1
TcsBoardHelper helper(rtdIds);
TcsBoardAssembly* tcsBoardAss =
new TcsBoardAssembly(objects::TCS_BOARD_ASS, objects::NO_OBJECT, pwrSwitcher,
pcduSwitches::Switches::PDU1_CH0_TCS_BOARD_3V3, helper);
static_cast<void>(tcsBoardAss);
#endif // OBSW_ADD_RTD_DEVICES == 1
} }
void ObjectFactory::createReactionWheelComponents(LinuxLibgpioIF* gpioComIF) { void ObjectFactory::createReactionWheelComponents(LinuxLibgpioIF* gpioComIF) {
@ -1086,9 +824,15 @@ void ObjectFactory::createCcsdsComponents(LinuxLibgpioIF* gpioComIF) {
AxiPtmeConfig* axiPtmeConfig = AxiPtmeConfig* axiPtmeConfig =
new AxiPtmeConfig(objects::AXI_PTME_CONFIG, q7s::UIO_PTME, q7s::uiomapids::PTME_CONFIG); new AxiPtmeConfig(objects::AXI_PTME_CONFIG, q7s::UIO_PTME, q7s::uiomapids::PTME_CONFIG);
PtmeConfig* ptmeConfig = new PtmeConfig(objects::PTME_CONFIG, axiPtmeConfig); 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( CCSDSHandler* ccsdsHandler = new CCSDSHandler(
objects::CCSDS_HANDLER, objects::PTME, objects::CCSDS_PACKET_DISTRIBUTOR, ptmeConfig, objects::CCSDS_HANDLER, objects::PTME, objects::CCSDS_PACKET_DISTRIBUTOR, ptmeConfig,
gpioComIF, gpioIds::RS485_EN_TX_CLOCK, gpioIds::RS485_EN_TX_DATA); gpioComIF, gpioIds::RS485_EN_TX_CLOCK, gpioIds::RS485_EN_TX_DATA, TRANSMITTER_TIMEOUT);
VirtualChannel* vc = nullptr; VirtualChannel* vc = nullptr;
vc = new VirtualChannel(ccsds::VC0, common::VC0_QUEUE_SIZE, objects::CCSDS_HANDLER); vc = new VirtualChannel(ccsds::VC0, common::VC0_QUEUE_SIZE, objects::CCSDS_HANDLER);
@ -1113,7 +857,6 @@ void ObjectFactory::createCcsdsComponents(LinuxLibgpioIF* gpioComIF) {
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);
#if BOARD_TE0720 == 0
GpioCookie* gpioRS485Chip = new GpioCookie; GpioCookie* gpioRS485Chip = new GpioCookie;
gpio = new GpiodRegularByLineName(q7s::gpioNames::RS485_EN_TX_CLOCK, "RS485 Transceiver", gpio = new GpiodRegularByLineName(q7s::gpioNames::RS485_EN_TX_CLOCK, "RS485 Transceiver",
Direction::OUT, Levels::LOW); Direction::OUT, Levels::LOW);
@ -1131,10 +874,10 @@ void ObjectFactory::createCcsdsComponents(LinuxLibgpioIF* gpioComIF) {
gpioRS485Chip->addGpio(gpioIds::RS485_EN_RX_DATA, gpio); gpioRS485Chip->addGpio(gpioIds::RS485_EN_RX_DATA, gpio);
gpioComIF->addGpios(gpioRS485Chip); gpioComIF->addGpios(gpioRS485Chip);
#endif /* BOARD_TE0720 == 0 */
} }
void ObjectFactory::createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF) { void ObjectFactory::createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF,
PowerSwitchIF* pwrSwitcher) {
using namespace gpio; using namespace gpio;
// Create all GPIO components first // Create all GPIO components first
GpioCookie* plPcduGpios = new GpioCookie; GpioCookie* plPcduGpios = new GpioCookie;
@ -1180,116 +923,24 @@ void ObjectFactory::createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF*
q7s::SPI_DEFAULT_DEV, plpcdu::MAX_ADC_REPLY_SIZE, q7s::SPI_DEFAULT_DEV, 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 = auto plPcduHandler = new PayloadPcduHandler(
new PayloadPcduHandler(objects::PLPCDU_HANDLER, objects::SPI_COM_IF, spiCookie, gpioComIF, objects::PLPCDU_HANDLER, objects::SPI_COM_IF, spiCookie, gpioComIF, SdCardManager::instance(),
SdCardManager::instance(), false); pwrSwitcher, pcduSwitches::Switches::PDU2_CH1_PL_PCDU_BATT_0_14V8,
pcduSwitches::Switches::PDU2_CH6_PL_PCDU_BATT_1_14V8, false);
spiCookie->setCallbackMode(PayloadPcduHandler::extConvAsTwoCallback, plPcduHandler); spiCookie->setCallbackMode(PayloadPcduHandler::extConvAsTwoCallback, plPcduHandler);
static_cast<void>(plPcduHandler); // plPcduHandler->enablePeriodicPrintout(true, 5);
// static_cast<void>(plPcduHandler);
#if OBSW_TEST_PL_PCDU == 1 #if OBSW_TEST_PL_PCDU == 1
plPcduHandler->setStartUpImmediately(); plPcduHandler->setStartUpImmediately();
#endif #endif
#if OBSW_DEBUG_PL_PCDU == 1 #if OBSW_DEBUG_PL_PCDU == 1
plPcduHandler->setToGoToNormalModeImmediately(true); plPcduHandler->setToGoToNormalModeImmediately(true);
plPcduHandler->enablePeriodicPrintout(true, 5); plPcduHandler->enablePeriodicPrintout(true, 10);
#endif #endif
} }
void ObjectFactory::createTestComponents(LinuxLibgpioIF* gpioComIF) { void ObjectFactory::createTestComponents(LinuxLibgpioIF* gpioComIF) {
#if BOARD_TE0720 == 0
new Q7STestTask(objects::TEST_TASK); new Q7STestTask(objects::TEST_TASK);
#endif
#if BOARD_TE0720 == 1 && OBSW_TEST_LIBGPIOD == 1
#if OBSW_TEST_GPIO_OPEN_BYLABEL == 1
/* Configure MIO0 as input */
GpiodRegular* testGpio = new GpiodRegular("MIO0", Direction::OUT, 0, "/amba_pl/gpio@41200000", 0);
#elif OBSW_TEST_GPIO_OPEN_BY_LINE_NAME
GpiodRegularByLineName* testGpio =
new GpiodRegularByLineName("test-name", "gpio-test", Direction::OUT, 0);
#else
/* Configure MIO0 as input */
GpiodRegular* testGpio = new GpiodRegular("gpiochip0", 0, "MIO0", gpio::IN, 0);
#endif /* OBSW_TEST_GPIO_LABEL == 1 */
GpioCookie* gpioCookie = new GpioCookie;
gpioCookie->addGpio(gpioIds::TEST_ID_0, testGpio);
new LibgpiodTest(objects::LIBGPIOD_TEST, objects::GPIO_IF, gpioCookie);
#endif
#if BOARD_TE0720 == 1 && OBSW_TEST_SUS == 1
GpioCookie* gpioCookieSus = new GpioCookie;
GpiodRegular* chipSelectSus = new GpiodRegular(
std::string("gpiochip1"), 9, std::string("Chip Select Sus Sensor"), Direction::OUT, 1);
gpioCookieSus->addGpio(gpioIds::CS_SUS_0, chipSelectSus);
gpioComIF->addGpios(gpioCookieSus);
SpiCookie* spiCookieSus =
new SpiCookie(addresses::SUS_0, std::string("/dev/spidev1.0"), SUS::MAX_CMD_SIZE,
spi::DEFAULT_MAX_1227_MODE, spi::DEFAULT_MAX_1227_SPEED);
new SusHandler(objects::SUS_0, objects::SPI_COM_IF, spiCookieSus, gpioComIF, gpioIds::CS_SUS_0);
#endif
#if BOARD_TE0720 == 1 && OBSW_TEST_CCSDS_BRIDGE == 1
GpioCookie* gpioCookieCcsdsIp = new GpioCookie;
GpiodRegular* papbBusyN =
new GpiodRegular(std::string("gpiochip0"), 0, std::string("PAPBBusy_VC0"));
gpioCookieCcsdsIp->addGpio(gpioIds::PAPB_BUSY_N, papbBusyN);
GpiodRegular* papbEmpty =
new GpiodRegular(std::string("gpiochip0"), 1, std::string("PAPBEmpty_VC0"));
gpioCookieCcsdsIp->addGpio(gpioIds::PAPB_EMPTY, papbEmpty);
gpioComIF->addGpios(gpioCookieCcsdsIp);
new CCSDSIPCoreBridge(objects::CCSDS_IP_CORE_BRIDGE, objects::CCSDS_PACKET_DISTRIBUTOR,
objects::TM_STORE, objects::TC_STORE, gpioComIF, std::string("/dev/uio0"),
gpioIds::PAPB_BUSY_N, gpioIds::PAPB_EMPTY);
#endif
#if BOARD_TE0720 == 1 && OBSW_TEST_RAD_SENSOR == 1
GpioCookie* gpioCookieRadSensor = new GpioCookie;
GpiodRegular* chipSelectRadSensor = new GpiodRegular(
std::string("gpiochip1"), 0, std::string("Chip select radiation sensor"), Direction::OUT, 1);
gpioCookieRadSensor->addGpio(gpioIds::CS_RAD_SENSOR, chipSelectRadSensor);
gpioComIF->addGpios(gpioCookieRadSensor);
SpiCookie* spiCookieRadSensor =
new SpiCookie(addresses::RAD_SENSOR, gpioIds::CS_RAD_SENSOR, std::string("/dev/spidev1.0"),
SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, spi::DEFAULT_MAX_1227_SPEED);
RadiationSensorHandler* radSensor =
new RadiationSensorHandler(objects::RAD_SENSOR, objects::SPI_COM_IF, spiCookieRadSensor);
radSensor->setStartUpImmediately();
#endif
#if BOARD_TE0720 == 1 && OBSW_ADD_PLOC_MPSOC == 1
UartCookie* plocUartCookie =
new UartCookie(std::string("/dev/ttyPS1"), 115200, PLOC_MPSOC::MAX_REPLY_SIZE);
/* Testing PlocMPSoCHandler on TE0720-03-1CFA */
PlocMPSoCHandler* mpsocPlocHandler =
new PlocMPSoCHandler(objects::PLOC_MPSOC_HANDLER, objects::UART_COM_IF, plocUartCookie);
mpsocPlocHandler->setStartUpImmediately();
#endif
#if BOARD_TE0720 == 1 && OBSW_TEST_TE7020_HEATER == 1
/* Configuration for MIO0 on TE0720-03-1CFA */
GpiodRegular* heaterGpio =
new GpiodRegular(std::string("gpiochip0"), 0, std::string("MIO0"), gpio::IN, 0);
GpioCookie* gpioCookie = new GpioCookie;
gpioCookie->addGpio(gpioIds::HEATER_0, heaterGpio);
new HeaterHandler(objects::HEATER_HANDLER, objects::GPIO_IF, gpioCookie, objects::PCDU_HANDLER,
pcduSwitches::TCS_BOARD_8V_HEATER_IN);
#endif
#if BOARD_TE0720 == 1 && 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
#if OBSW_ADD_SPI_TEST_CODE == 1 #if OBSW_ADD_SPI_TEST_CODE == 1
new SpiTestClass(objects::SPI_TEST, gpioComIF); new SpiTestClass(objects::SPI_TEST, gpioComIF);
#endif #endif
@ -1300,3 +951,13 @@ void ObjectFactory::createTestComponents(LinuxLibgpioIF* gpioComIF) {
new UartTestClass(objects::UART_TEST); new UartTestClass(objects::UART_TEST);
#endif #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;
}
}

View File

@ -6,6 +6,7 @@ class UartComIF;
class SpiComIF; class SpiComIF;
class I2cComIF; class I2cComIF;
class PowerSwitchIF; class PowerSwitchIF;
class AcsBoardAssembly;
namespace ObjectFactory { namespace ObjectFactory {
@ -15,21 +16,22 @@ void produce(void* args);
void createCommunicationInterfaces(LinuxLibgpioIF** gpioComIF, UartComIF** uartComIF, void createCommunicationInterfaces(LinuxLibgpioIF** gpioComIF, UartComIF** uartComIF,
SpiComIF** spiComIF, I2cComIF** i2cComIF); SpiComIF** spiComIF, I2cComIF** i2cComIF);
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);
void createTmpComponents(); void createTmpComponents();
void createRadSensorComponent(LinuxLibgpioIF* gpioComIF); void createRadSensorComponent(LinuxLibgpioIF* gpioComIF);
void createSunSensorComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF,
PowerSwitchIF* pwrSwitcher);
void createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComIF* uartComIF, void createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComIF* uartComIF,
PowerSwitchIF* pwrSwitcher); PowerSwitchIF* pwrSwitcher);
void createHeaterComponents(); void createHeaterComponents();
void createSolarArrayDeploymentComponents(); void createSolarArrayDeploymentComponents();
void createSyrlinksComponents(); void createSyrlinksComponents();
void createRtdComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchIF* pwrSwitcher); void createPayloadComponents(LinuxLibgpioIF* gpioComIF);
void createReactionWheelComponents(LinuxLibgpioIF* gpioComIF); void createReactionWheelComponents(LinuxLibgpioIF* gpioComIF);
void createCcsdsComponents(LinuxLibgpioIF* gpioComIF); void createCcsdsComponents(LinuxLibgpioIF* gpioComIF);
void createTestComponents(LinuxLibgpioIF* gpioComIF); void createTestComponents(LinuxLibgpioIF* gpioComIF);
void testAcsBrdAss(AcsBoardAssembly* assAss);
}; // namespace ObjectFactory }; // namespace ObjectFactory
#endif /* BSP_Q7S_OBJECTFACTORY_H_ */ #endif /* BSP_Q7S_OBJECTFACTORY_H_ */

View File

@ -15,11 +15,7 @@ static int OBSW_ALREADY_RUNNING = -2;
int obsw::obsw() { int obsw::obsw() {
using namespace fsfw; using namespace fsfw;
std::cout << "-- EIVE OBSW --" << std::endl; std::cout << "-- EIVE OBSW --" << std::endl;
#if BOARD_TE0720 == 0
std::cout << "-- Compiled for Linux (Xiphos Q7S) --" << std::endl; std::cout << "-- Compiled for Linux (Xiphos Q7S) --" << std::endl;
#else
std::cout << "-- Compiled for Linux (TE0720) --" << std::endl;
#endif
std::cout << "-- OBSW v" << SW_VERSION << "." << SW_SUBVERSION << "." << SW_REVISION << ", FSFW v" std::cout << "-- OBSW v" << SW_VERSION << "." << SW_SUBVERSION << "." << SW_REVISION << ", FSFW v"
<< FSFW_VERSION << "--" << std::endl; << FSFW_VERSION << "--" << std::endl;
std::cout << "-- " << __DATE__ << " " << __TIME__ << " --" << std::endl; std::cout << "-- " << __DATE__ << " " << __TIME__ << " --" << std::endl;

View File

@ -2,4 +2,5 @@ target_sources(${OBSW_NAME} PRIVATE
FileSystemHandler.cpp FileSystemHandler.cpp
SdCardManager.cpp SdCardManager.cpp
scratchApi.cpp scratchApi.cpp
FilesystemHelper.cpp
) )

View File

@ -6,6 +6,7 @@
#include "OBSWConfig.h" #include "OBSWConfig.h"
#include "SdCardManager.h" #include "SdCardManager.h"
#include "eive/definitions.h"
#include "fsfw/ipc/MessageQueueIF.h" #include "fsfw/ipc/MessageQueueIF.h"
#include "fsfw/memory/HasFileSystemIF.h" #include "fsfw/memory/HasFileSystemIF.h"
#include "fsfw/objectmanager/SystemObject.h" #include "fsfw/objectmanager/SystemObject.h"

View File

@ -0,0 +1,40 @@
#include "FilesystemHelper.h"
#include <filesystem>
#include <fstream>
#include "bsp_q7s/memory/SdCardManager.h"
#include "fsfw/serviceinterface/ServiceInterfaceStream.h"
FilesystemHelper::FilesystemHelper() {}
FilesystemHelper::~FilesystemHelper() {}
ReturnValue_t FilesystemHelper::checkPath(std::string path) {
SdCardManager* sdcMan = SdCardManager::instance();
if (sdcMan == nullptr) {
sif::warning << "FilesystemHelper::checkPath: Invalid SD card manager" << std::endl;
return RETURN_FAILED;
}
if (path.substr(0, sizeof(SdCardManager::SD_0_MOUNT_POINT)) ==
std::string(SdCardManager::SD_0_MOUNT_POINT)) {
if (!sdcMan->isSdCardMounted(sd::SLOT_0)) {
sif::warning << "FilesystemHelper::checkPath: SD card 0 not mounted" << std::endl;
return SD_NOT_MOUNTED;
}
} else if (path.substr(0, sizeof(SdCardManager::SD_1_MOUNT_POINT)) ==
std::string(SdCardManager::SD_1_MOUNT_POINT)) {
if (!sdcMan->isSdCardMounted(sd::SLOT_0)) {
sif::warning << "FilesystemHelper::checkPath: SD card 1 not mounted" << std::endl;
return SD_NOT_MOUNTED;
}
}
return RETURN_OK;
}
ReturnValue_t FilesystemHelper::fileExists(std::string file) {
if (not std::filesystem::exists(file)) {
return FILE_NOT_EXISTS;
}
return RETURN_OK;
}

View File

@ -0,0 +1,49 @@
#ifndef BSP_Q7S_MEMORY_FILESYSTEMHELPER_H_
#define BSP_Q7S_MEMORY_FILESYSTEMHELPER_H_
#include <string>
#include "commonClassIds.h"
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
/**
* @brief This class implements often used functions concerning the file system management.
*
* @author J. Meier
*/
class FilesystemHelper : public HasReturnvaluesIF {
public:
static const uint8_t INTERFACE_ID = CLASS_ID::FILE_SYSTEM_HELPER;
//! [EXPORT] : [COMMENT] SD card specified with path string not mounted
static const ReturnValue_t SD_NOT_MOUNTED = MAKE_RETURN_CODE(0xA0);
//! [EXPORT] : [COMMENT] Specified file does not exist on filesystem
static const ReturnValue_t FILE_NOT_EXISTS = MAKE_RETURN_CODE(0xA1);
FilesystemHelper();
virtual ~FilesystemHelper();
/**
* @brief In case the path points to a directory on the sd card the function checks if the
* appropriate SD card is mounted.
*
* @param path Path to check
*
* @return RETURN_OK if path points to SD card and the appropriate SD card is mounted or if
* path does not point to SD card.
* Return error code if path points to SD card and the corresponding SD card is not
* mounted.
*/
static ReturnValue_t checkPath(std::string path);
/**
* @brief Checks if the file exists on the filesystem.
*
* param file File to check
*
* @return RETURN_OK if fiel exists, otherwise return error code.
*/
static ReturnValue_t fileExists(std::string file);
};
#endif /* BSP_Q7S_MEMORY_FILESYSTEMHELPER_H_ */

View File

@ -0,0 +1,7 @@
target_sources(${OBSW_NAME} PUBLIC
InitMission.cpp
main.cpp
ObjectFactory.cpp
)
add_subdirectory(boardconfig)

View File

@ -0,0 +1,188 @@
#include "InitMission.h"
#include <fsfw/objectmanager/ObjectManager.h>
#include <fsfw/objectmanager/ObjectManagerIF.h>
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
#include <fsfw/serviceinterface/ServiceInterface.h>
#include <fsfw/tasks/FixedTimeslotTaskIF.h>
#include <fsfw/tasks/PeriodicTaskIF.h>
#include <fsfw/tasks/TaskFactory.h>
#include <mission/utility/InitMission.h>
#include <iostream>
#include "OBSWConfig.h"
#include "ObjectFactory.h"
#include "objects/systemObjectList.h"
#include "pollingsequence/pollingSequenceFactory.h"
ServiceInterfaceStream sif::debug("DEBUG");
ServiceInterfaceStream sif::info("INFO");
ServiceInterfaceStream sif::warning("WARNING");
ServiceInterfaceStream sif::error("ERROR");
ObjectManagerIF* objectManager = nullptr;
void initmission::initMission() {
sif::info << "Building global objects.." << std::endl;
/* Instantiate global object manager and also create all objects */
ObjectManager::instance()->setObjectFactoryFunction(ObjectFactory::produce, nullptr);
sif::info << "Initializing all objects.." << std::endl;
ObjectManager::instance()->initialize();
/* This function creates and starts all tasks */
initTasks();
}
void initmission::initTasks() {
TaskFactory* factory = TaskFactory::instance();
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
if (factory == nullptr) {
/* Should never happen ! */
return;
}
#if OBSW_PRINT_MISSED_DEADLINES == 1
void (*missedDeadlineFunc)(void) = TaskFactory::printMissedDeadline;
#else
void (*missedDeadlineFunc)(void) = nullptr;
#endif
/* TMTC Distribution */
PeriodicTaskIF* tmtcDistributor = factory->createPeriodicTask(
"DIST", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc);
result = tmtcDistributor->addComponent(objects::CCSDS_PACKET_DISTRIBUTOR);
if (result != HasReturnvaluesIF::RETURN_OK) {
sif::error << "Object add component failed" << std::endl;
}
result = tmtcDistributor->addComponent(objects::PUS_PACKET_DISTRIBUTOR);
if (result != HasReturnvaluesIF::RETURN_OK) {
sif::error << "Object add component failed" << std::endl;
}
result = tmtcDistributor->addComponent(objects::TM_FUNNEL);
if (result != HasReturnvaluesIF::RETURN_OK) {
sif::error << "Object add component failed" << std::endl;
}
PeriodicTaskIF* tmtcBridgeTask = factory->createPeriodicTask(
"TMTC_BRIDGE", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc);
result = tmtcBridgeTask->addComponent(objects::TMTC_BRIDGE);
if (result != HasReturnvaluesIF::RETURN_OK) {
sif::error << "Add component TMTC Bridge failed" << std::endl;
}
PeriodicTaskIF* tmtcPollingTask = factory->createPeriodicTask(
"TMTC_POLLING", 80, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc);
result = tmtcPollingTask->addComponent(objects::TMTC_POLLING_TASK);
if (result != HasReturnvaluesIF::RETURN_OK) {
sif::error << "Add component TMTC Polling failed" << std::endl;
}
/* PUS Services */
std::vector<PeriodicTaskIF*> pusTasks;
createPusTasks(*factory, missedDeadlineFunc, pusTasks);
std::vector<PeriodicTaskIF*> pstTasks;
FixedTimeslotTaskIF* pst = factory->createFixedTimeslotTask(
"UART_PST", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 0.5, missedDeadlineFunc);
result = pst::pstUart(pst);
if (result != HasReturnvaluesIF::RETURN_OK) {
sif::error << "InitMission::initTasks: Creating PST failed!" << std::endl;
}
pstTasks.push_back(pst);
PeriodicTaskIF* mpsocHelperTask = factory->createPeriodicTask(
"PLOC_MPSOC_HELPER", 20, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc);
result = mpsocHelperTask->addComponent(objects::PLOC_MPSOC_HELPER);
if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("PLOC_MPSOC_HELPER", objects::PLOC_MPSOC_HELPER);
}
pstTasks.push_back(mpsocHelperTask);
auto taskStarter = [](std::vector<PeriodicTaskIF*>& taskVector, std::string name) {
for (const auto& task : taskVector) {
if (task != nullptr) {
task->startTask();
} else {
sif::error << "Task in vector " << name << " is invalid!" << std::endl;
}
}
};
sif::info << "Starting tasks.." << std::endl;
tmtcDistributor->startTask();
tmtcBridgeTask->startTask();
tmtcPollingTask->startTask();
taskStarter(pstTasks, "PST Tasks");
taskStarter(pusTasks, "PUS Tasks");
sif::info << "Tasks started.." << std::endl;
}
void initmission::createPusTasks(TaskFactory& factory,
TaskDeadlineMissedFunction missedDeadlineFunc,
std::vector<PeriodicTaskIF*>& taskVec) {
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
PeriodicTaskIF* pusVerification = factory.createPeriodicTask(
"PUS_VERIF", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, missedDeadlineFunc);
result = pusVerification->addComponent(objects::PUS_SERVICE_1_VERIFICATION);
if (result != HasReturnvaluesIF::RETURN_OK) {
sif::error << "Object add component failed" << std::endl;
}
taskVec.push_back(pusVerification);
PeriodicTaskIF* pusEvents = factory.createPeriodicTask(
"PUS_EVENTS", 60, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, missedDeadlineFunc);
result = pusEvents->addComponent(objects::PUS_SERVICE_5_EVENT_REPORTING);
if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("PUS_EVENTS", objects::PUS_SERVICE_5_EVENT_REPORTING);
}
result = pusEvents->addComponent(objects::EVENT_MANAGER);
if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("PUS_MGMT", objects::EVENT_MANAGER);
}
taskVec.push_back(pusEvents);
PeriodicTaskIF* pusHighPrio = factory.createPeriodicTask(
"PUS_HIGH_PRIO", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, missedDeadlineFunc);
result = pusHighPrio->addComponent(objects::PUS_SERVICE_2_DEVICE_ACCESS);
if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("PUS2", objects::PUS_SERVICE_2_DEVICE_ACCESS);
}
result = pusHighPrio->addComponent(objects::PUS_SERVICE_9_TIME_MGMT);
if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("PUS9", objects::PUS_SERVICE_9_TIME_MGMT);
}
taskVec.push_back(pusHighPrio);
PeriodicTaskIF* pusMedPrio = factory.createPeriodicTask(
"PUS_MED_PRIO", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.8, missedDeadlineFunc);
result = pusMedPrio->addComponent(objects::PUS_SERVICE_8_FUNCTION_MGMT);
if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("PUS8", objects::PUS_SERVICE_8_FUNCTION_MGMT);
}
result = pusMedPrio->addComponent(objects::PUS_SERVICE_200_MODE_MGMT);
if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("PUS200", objects::PUS_SERVICE_200_MODE_MGMT);
}
result = pusMedPrio->addComponent(objects::PUS_SERVICE_20_PARAMETERS);
if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("PUS20", objects::PUS_SERVICE_20_PARAMETERS);
}
result = pusMedPrio->addComponent(objects::PUS_SERVICE_3_HOUSEKEEPING);
if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("PUS3", objects::PUS_SERVICE_3_HOUSEKEEPING);
}
taskVec.push_back(pusMedPrio);
PeriodicTaskIF* pusLowPrio = factory.createPeriodicTask(
"PUS_LOW_PRIO", 30, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.6, missedDeadlineFunc);
result = pusLowPrio->addComponent(objects::PUS_SERVICE_17_TEST);
if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("PUS17", objects::PUS_SERVICE_17_TEST);
}
result = pusLowPrio->addComponent(objects::INTERNAL_ERROR_REPORTER);
if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("INT_ERR_RPRT", objects::INTERNAL_ERROR_REPORTER);
}
taskVec.push_back(pusLowPrio);
}

View File

@ -0,0 +1,21 @@
#ifndef BSP_LINUX_INITMISSION_H_
#define BSP_LINUX_INITMISSION_H_
#include <vector>
#include "fsfw/tasks/Typedef.h"
class PeriodicTaskIF;
class TaskFactory;
namespace initmission {
void initMission();
void initTasks();
void createPstTasks(TaskFactory& factory, TaskDeadlineMissedFunction missedDeadlineFunc,
std::vector<PeriodicTaskIF*>& taskVec);
void createPusTasks(TaskFactory& factory, TaskDeadlineMissedFunction missedDeadlineFunc,
std::vector<PeriodicTaskIF*>& taskVec);
}; // namespace initmission
#endif /* BSP_LINUX_INITMISSION_H_ */

View File

@ -0,0 +1,152 @@
#include "ObjectFactory.h"
#include <devConf.h>
#include "fsfw_hal/linux/uart/UartComIF.h"
#include "fsfw_hal/linux/i2c/I2cComIF.h"
#include "fsfw_hal/linux/uart/UartCookie.h"
#include "OBSWConfig.h"
#include "busConf.h"
#include "devConf.h"
#include "fsfw/datapoollocal/LocalDataPoolManager.h"
#include "fsfw/tmtcpacket/pus/tm.h"
#include "fsfw/tmtcservices/CommandingServiceBase.h"
#include "fsfw/tmtcservices/PusServiceBase.h"
#include "fsfw_hal/linux/i2c/I2cCookie.h"
#include "linux/devices/ploc/PlocMPSoCHandler.h"
#include "linux/devices/ploc/PlocMPSoCHelper.h"
#include "mission/devices/Tmp1075Handler.h"
#include "mission/core/GenericFactory.h"
#include "mission/utility/TmFunnel.h"
#include "test/gpio/DummyGpioIF.h"
#include "objects/systemObjectList.h"
#include "devices/addresses.h"
#include "devices/gpioIds.h"
#include "tmtc/apid.h"
#include "tmtc/pusIds.h"
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;
TmFunnel::downlinkDestination = objects::TMTC_BRIDGE;
TmFunnel::storageDestination = objects::NO_OBJECT;
VerificationReporter::messageReceiver = objects::PUS_SERVICE_1_VERIFICATION;
TmPacketBase::timeStamperId = objects::TIME_STAMPER;
}
void ObjectFactory::produce(void* args) {
Factory::setStaticFrameworkObjectIds();
ObjectFactory::produceGenericObjects();
#if OBSW_ADD_PLOC_MPSOC == 1
UartCookie* mpsocUartCookie =
new UartCookie(objects::PLOC_MPSOC_HANDLER, te0720_1cfa::MPSOC_UART, UartModes::NON_CANONICAL,
uart::PLOC_MPSOC_BAUD, mpsoc::MAX_REPLY_SIZE);
mpsocUartCookie->setNoFixedSizeReply();
PlocMPSoCHelper* plocMpsocHelper = new PlocMPSoCHelper(objects::PLOC_MPSOC_HELPER);
new UartComIF(objects::UART_COM_IF);
auto dummyGpioIF = new DummyGpioIF();
PlocMPSoCHandler* plocMPSoCHandler =
new PlocMPSoCHandler(objects::PLOC_MPSOC_HANDLER, objects::UART_COM_IF, mpsocUartCookie,
plocMpsocHelper, Gpio(gpioIds::ENABLE_MPSOC_UART, dummyGpioIF));
plocMPSoCHandler->setStartUpImmediately();
#endif /* OBSW_ADD_PLOC_MPSOC == 1 */
#if OBSW_TEST_LIBGPIOD == 1
#if OBSW_TEST_GPIO_OPEN_BYLABEL == 1
/* Configure MIO0 as input */
GpiodRegular* testGpio = new GpiodRegular("MIO0", Direction::OUT, 0, "/amba_pl/gpio@41200000", 0);
#elif OBSW_TEST_GPIO_OPEN_BY_LINE_NAME
GpiodRegularByLineName* testGpio =
new GpiodRegularByLineName("test-name", "gpio-test", Direction::OUT, 0);
#else
/* Configure MIO0 as input */
GpiodRegular* testGpio = new GpiodRegular("gpiochip0", 0, "MIO0", gpio::IN, 0);
#endif /* OBSW_TEST_GPIO_LABEL == 1 */
GpioCookie* gpioCookie = new GpioCookie;
gpioCookie->addGpio(gpioIds::TEST_ID_0, testGpio);
new LibgpiodTest(objects::LIBGPIOD_TEST, objects::GPIO_IF, gpioCookie);
#endif
#if OBSW_TEST_SUS == 1
GpioCookie* gpioCookieSus = new GpioCookie;
GpiodRegular* chipSelectSus = new GpiodRegular(
std::string("gpiochip1"), 9, std::string("Chip Select Sus Sensor"), Direction::OUT, 1);
gpioCookieSus->addGpio(gpioIds::CS_SUS_0, chipSelectSus);
gpioComIF->addGpios(gpioCookieSus);
SpiCookie* spiCookieSus =
new SpiCookie(addresses::SUS_0, std::string("/dev/spidev1.0"), SUS::MAX_CMD_SIZE,
spi::DEFAULT_MAX_1227_MODE, spi::DEFAULT_MAX_1227_SPEED);
new SusHandler(objects::SUS_0, objects::SPI_COM_IF, spiCookieSus, gpioComIF, gpioIds::CS_SUS_0);
#endif
#if OBSW_TEST_CCSDS_BRIDGE == 1
GpioCookie* gpioCookieCcsdsIp = new GpioCookie;
GpiodRegular* papbBusyN =
new GpiodRegular(std::string("gpiochip0"), 0, std::string("PAPBBusy_VC0"));
gpioCookieCcsdsIp->addGpio(gpioIds::PAPB_BUSY_N, papbBusyN);
GpiodRegular* papbEmpty =
new GpiodRegular(std::string("gpiochip0"), 1, std::string("PAPBEmpty_VC0"));
gpioCookieCcsdsIp->addGpio(gpioIds::PAPB_EMPTY, papbEmpty);
gpioComIF->addGpios(gpioCookieCcsdsIp);
new CCSDSIPCoreBridge(objects::CCSDS_IP_CORE_BRIDGE, objects::CCSDS_PACKET_DISTRIBUTOR,
objects::TM_STORE, objects::TC_STORE, gpioComIF, std::string("/dev/uio0"),
gpioIds::PAPB_BUSY_N, gpioIds::PAPB_EMPTY);
#endif
#if OBSW_TEST_RAD_SENSOR == 1
GpioCookie* gpioCookieRadSensor = new GpioCookie;
GpiodRegular* chipSelectRadSensor = new GpiodRegular(
std::string("gpiochip1"), 0, std::string("Chip select radiation sensor"), Direction::OUT, 1);
gpioCookieRadSensor->addGpio(gpioIds::CS_RAD_SENSOR, chipSelectRadSensor);
gpioComIF->addGpios(gpioCookieRadSensor);
SpiCookie* spiCookieRadSensor =
new SpiCookie(addresses::RAD_SENSOR, gpioIds::CS_RAD_SENSOR, std::string("/dev/spidev1.0"),
SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, spi::DEFAULT_MAX_1227_SPEED);
RadiationSensorHandler* radSensor =
new RadiationSensorHandler(objects::RAD_SENSOR, objects::SPI_COM_IF, spiCookieRadSensor);
radSensor->setStartUpImmediately();
#endif
#if OBSW_TEST_TE7020_HEATER == 1
/* Configuration for MIO0 on TE0720-03-1CFA */
GpiodRegular* heaterGpio =
new GpiodRegular(std::string("gpiochip0"), 0, std::string("MIO0"), gpio::IN, 0);
GpioCookie* gpioCookie = new GpioCookie;
gpioCookie->addGpio(gpioIds::HEATER_0, heaterGpio);
new HeaterHandler(objects::HEATER_HANDLER, objects::GPIO_IF, gpioCookie, objects::PCDU_HANDLER,
pcduSwitches::TCS_BOARD_8V_HEATER_IN);
#endif
#if OBSW_ADD_PLOC_SUPERVISOR == 1
/* Configuration for MIO0 on TE0720-03-1CFA */
UartCookie* plocSupervisorCookie =
new UartCookie(objects::PLOC_SUPERVISOR_HANDLER, std::string("/dev/ttyPS1"),
UartModes::NON_CANONICAL, 115200, PLOC_SPV::MAX_PACKET_SIZE * 20);
plocSupervisorCookie->setNoFixedSizeReply();
PlocSupervisorHandler* plocSupervisor = new PlocSupervisorHandler(
objects::PLOC_SUPERVISOR_HANDLER, objects::UART_COM_IF, plocSupervisorCookie);
plocSupervisor->setStartUpImmediately();
#endif
new I2cComIF(objects::I2C_COM_IF);
I2cCookie* i2cCookieTmp1075tcs1 =
new I2cCookie(addresses::TMP1075_TCS_1, TMP1075::MAX_REPLY_LENGTH, std::string("/dev/i2c-0"));
I2cCookie* i2cCookieTmp1075tcs2 =
new I2cCookie(addresses::TMP1075_TCS_2, TMP1075::MAX_REPLY_LENGTH, std::string("/dev/i2c-0"));
/* Temperature sensors */
new Tmp1075Handler(objects::TMP1075_HANDLER_1, objects::I2C_COM_IF, i2cCookieTmp1075tcs1);
new Tmp1075Handler(objects::TMP1075_HANDLER_2, objects::I2C_COM_IF, i2cCookieTmp1075tcs2);
}

View File

@ -0,0 +1,8 @@
#ifndef BSP_LINUX_OBJECTFACTORY_H_
#define BSP_LINUX_OBJECTFACTORY_H_
namespace ObjectFactory {
void produce(void* args);
}; // namespace ObjectFactory
#endif /* BSP_LINUX_OBJECTFACTORY_H_ */

View File

@ -0,0 +1,7 @@
target_sources(${OBSW_NAME} PRIVATE
print.c
)
target_include_directories(${OBSW_NAME} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
)

View File

@ -0,0 +1,11 @@
#ifndef BSP_EGSE_BOARDCONFIG_BUSCONF_H_
#define BSP_EGSE_BOARDCONFIG_BUSCONF_H_
namespace te0720_1cfa {
static constexpr char MPSOC_UART[] = "/dev/ttyPS1";
namespace baudrate {
}
}
#endif /* BSP_EGSE_BOARDCONFIG_BUSCONF_H_ */

View File

@ -0,0 +1,38 @@
///\file
/******************************************************************************
The MIT License(MIT)
Embedded Template Library.
https://github.com/ETLCPP/etl
https://www.etlcpp.com
Copyright(c) 2019 jwellbelove
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files(the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions :
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
******************************************************************************/
#ifndef __ETL_PROFILE_H__
#define __ETL_PROFILE_H__
#define ETL_CHECK_PUSH_POP
#define ETL_CPP11_SUPPORTED 1
#define ETL_NO_NULLPTR_SUPPORT 0
#endif

View File

@ -0,0 +1,15 @@
#ifndef LINUX_GCOV_H_
#define LINUX_GCOV_H_
#include <fsfw/serviceinterface/ServiceInterfaceStream.h>
#ifdef GCOV
extern "C" void __gcov_flush();
#else
void __gcov_flush() {
sif::info << "GCC GCOV: Please supply GCOV=1 in Makefile if "
"coverage information is desired.\n"
<< std::flush;
}
#endif
#endif /* LINUX_GCOV_H_ */

View File

@ -0,0 +1,10 @@
#include <bsp_te0720_1cfa/boardconfig/print.h>
#include <stdio.h>
void printChar(const char* character, bool errStream) {
if (errStream) {
putc(*character, stderr);
return;
}
putc(*character, stdout);
}

View File

@ -0,0 +1,8 @@
#ifndef HOSTED_BOARDCONFIG_PRINT_H_
#define HOSTED_BOARDCONFIG_PRINT_H_
#include <stdbool.h>
void printChar(const char* character, bool errStream);
#endif /* HOSTED_BOARDCONFIG_PRINT_H_ */

29
bsp_te0720_1cfa/main.cpp Normal file
View File

@ -0,0 +1,29 @@
#include <iostream>
#include "InitMission.h"
#include "OBSWConfig.h"
#include "OBSWVersion.h"
#include "fsfw/version.h"
#include "fsfw/tasks/TaskFactory.h"
/**
* @brief This is the main program entry point for the obsw running on the trenz electronic
* te0720-1cfa.
* @return
*/
int main(void) {
using namespace fsfw;
std::cout << "-- EIVE OBSW --" << std::endl;
std::cout << "-- Compiled for Trenz TE0720-1CFA"
<< " --" << std::endl;
std::cout << "-- OBSW v" << SW_VERSION << "." << SW_SUBVERSION << "." << SW_REVISION << ", FSFW v"
<< FSFW_VERSION << "--" << std::endl;
std::cout << "-- " << __DATE__ << " " << __TIME__ << " --" << std::endl;
initmission::initMission();
for (;;) {
/* Suspend main thread by sleeping it. */
TaskFactory::delayTask(5000);
}
}

View File

@ -59,6 +59,8 @@ if(TGT_BSP)
set(BSP_PATH "bsp_q7s") set(BSP_PATH "bsp_q7s")
elseif(TGT_BSP MATCHES "arm/egse") elseif(TGT_BSP MATCHES "arm/egse")
set(BSP_PATH "bsp_egse") set(BSP_PATH "bsp_egse")
elseif(TGT_BSP MATCHES "arm/te0720-1cfa")
set(BSP_PATH "bsp_te0720_1cfa")
else() else()
message(WARNING "CMake not configured for this target!") message(WARNING "CMake not configured for this target!")
message(FATAL_ERROR "Target: ${TGT_BSP}!") message(FATAL_ERROR "Target: ${TGT_BSP}!")

View File

@ -12,9 +12,9 @@ endif()
# Disable compiler checks for cross-compiling. # Disable compiler checks for cross-compiling.
if(FSFW_OSAL MATCHES linux AND TGT_BSP) if(FSFW_OSAL MATCHES linux AND TGT_BSP)
if(TGT_BSP MATCHES "arm/q7s") if(TGT_BSP MATCHES "arm/q7s" OR TGT_BSP MATCHES "arm/te0720-1cfa")
set(CMAKE_TOOLCHAIN_FILE set(CMAKE_TOOLCHAIN_FILE
"${CMAKE_SCRIPT_PATH}/Q7SCrossCompileConfig.cmake" "${CMAKE_SCRIPT_PATH}/Zynq7020CrossCompileConfig.cmake"
PARENT_SCOPE PARENT_SCOPE
) )
elseif(TGT_BSP MATCHES "arm/raspberrypi" OR TGT_BSP MATCHES "arm/egse") elseif(TGT_BSP MATCHES "arm/raspberrypi" OR TGT_BSP MATCHES "arm/egse")

View File

@ -1,16 +1,16 @@
if(DEFINED ENV{Q7S_SYSROOT}) if(DEFINED ENV{ZYNQ_7020_SYSROOT})
set(ENV{Q7S_ROOTFS} $ENV{Q7S_SYSROOT}) set(ENV{ZYNQ_7020_ROOTFS} $ENV{ZYNQ_7020_SYSROOT})
endif() endif()
# CROSS_COMPILE also needs to be set accordingly or passed to the CMake command # CROSS_COMPILE also needs to be set accordingly or passed to the CMake command
if(NOT DEFINED ENV{Q7S_ROOTFS}) if(NOT DEFINED ENV{ZYNQ_7020_ROOTFS})
# Sysroot has not been cached yet and was not set in environment either # Sysroot has not been cached yet and was not set in environment either
if(NOT DEFINED SYSROOT_PATH) if(NOT DEFINED SYSROOT_PATH)
message(FATAL_ERROR message(FATAL_ERROR
"Define the Q7S_ROOTFS variable to point to the Q7S rootfs." "Define the ZYNQ_7020_ROOTFS variable to point to the Zynq-7020 rootfs."
) )
endif() endif()
else() else()
set(SYSROOT_PATH "$ENV{Q7S_ROOTFS}" CACHE PATH "Q7S root filesystem path") set(SYSROOT_PATH "$ENV{ZYNQ_7020_ROOTFS}" CACHE PATH "Zynq-7020 root filesystem path")
endif() endif()
if(NOT DEFINED ENV{CROSS_COMPILE}) if(NOT DEFINED ENV{CROSS_COMPILE})
@ -87,18 +87,21 @@ set(C_FLAGS
-mfloat-abi=hard -mfloat-abi=hard
${COMMON_FLAGS} ${COMMON_FLAGS}
-lgpiod -lgpiod
-lxiphos
) )
if (TGT_BSP MATCHES "arm/q7s")
set(C_FLAGS ${C_FLAGS} -lxiphos)
endif()
string (REPLACE ";" " " C_FLAGS "${C_FLAGS}") string (REPLACE ";" " " C_FLAGS "${C_FLAGS}")
set(CMAKE_C_FLAGS set(CMAKE_C_FLAGS
${C_FLAGS} ${C_FLAGS}
CACHE STRING "C flags for Q7S" CACHE STRING "C flags for Zynq-7020"
) )
set(CMAKE_CXX_FLAGS set(CMAKE_CXX_FLAGS
"${CMAKE_C_FLAGS}" "${CMAKE_C_FLAGS}"
CACHE STRING "CPP flags for Q7S" CACHE STRING "CPP flags for Zynq-7020"
) )
# search for programs in the build host directories # search for programs in the build host directories

View File

@ -2,6 +2,6 @@
export PATH=$PATH:"$HOME/EIVE/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin" export PATH=$PATH:"$HOME/EIVE/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin"
export CROSS_COMPILE="arm-linux-gnueabihf" export CROSS_COMPILE="arm-linux-gnueabihf"
export Q7S_SYSROOT="$HOME/Xilinx/cortexa9hf-neon-xiphos-linux-gnueabi" export ZYNQ_7020_SYSROOT="$HOME/Xilinx/cortexa9hf-neon-xiphos-linux-gnueabi"
export CONSOLE_PREFIX="[Q7S ENV]" export CONSOLE_PREFIX="[Q7S ENV]"
/bin/bash /bin/bash

View File

@ -0,0 +1,49 @@
#!/bin/sh
# Run with: source win-q7s-env.sh [OPTIONS]
function help () {
echo "source win-q7s-env.sh [options] -t|--toolchain=<toolchain path> -s|--sysroot=<sysroot path>"
}
TOOLCHAIN_PATH="/c/Xilinx/Vitis/2019.2/gnu/aarch32/nt/gcc-arm-linux-gnueabi/bin"
SYSROOT="/c/Users/${USER}/eive-software/cortexa9hf-neon-xiphos-linux-gnueabi"
for i in "$@"; do
case $i in
-t=*|--toolchain=*)
TOOLCHAIN_PATH="${i#*=}"
shift
;;
-s=*|--sysroot=*)
SYSROOT="${i#*=}"
shift
;;
-h|--help)
help
shift
;;
-*|--*)
echo "Unknown option $i"
help
return
;;
*)
;;
esac
done
if [ -d "$TOOLCHAIN_PATH" ]; then
export PATH=$PATH:"/c/Xilinx/Vitis/2019.2/gnu/aarch32/nt/gcc-arm-linux-gnueabi/bin"
export CROSS_COMPILE="arm-linux-gnueabihf"
echo "Set toolchain path to /c/Xilinx/Vitis/2019.2/gnu/aarch32/nt/gcc-arm-linux-gnueabi/bin"
else
echo "Toolchain path $TOOLCHAIN_PATH does not exist"
return
fi
if [ -d "$SYSROOT" ]; then
export ZYNQ_7020_SYSROOT=$SYSROOT
echo "Set sysroot path to $SYSROOT"
else
echo "Sysroot path $SYSROOT does not exist"
return
fi

View File

@ -12,6 +12,7 @@ import os
import sys import sys
import argparse import argparse
import shutil import shutil
import stat
def main(): def main():
@ -102,7 +103,7 @@ def main():
build_path = source_location + os.path.sep + build_folder build_path = source_location + os.path.sep + build_folder
remove_old_dir = False remove_old_dir = False
if remove_old_dir: if remove_old_dir:
shutil.rmtree(build_path) rm_build_dir(build_path)
os.chdir(source_location) os.chdir(source_location)
os.mkdir(build_folder) os.mkdir(build_folder)
print(f"Navigating into build directory: {build_path}") print(f"Navigating into build directory: {build_path}")
@ -119,6 +120,14 @@ def main():
print("-- CMake configuration done. --") print("-- CMake configuration done. --")
def rm_build_dir(path: str):
# On windows the permissions of the build directory may have been set to read-only. If this
# is the case the permissions are changed before trying to delete the directory.
if not os.access(path, os.W_OK):
os.chmod(path, stat.S_IWUSR)
shutil.rmtree(path)
def determine_source_location() -> str: def determine_source_location() -> str:
index = 0 index = 0
while not os.path.isdir("fsfw"): while not os.path.isdir("fsfw"):

View File

@ -0,0 +1,34 @@
#!/bin/sh
counter=0
cfg_script_name="cmake-build-cfg.py"
while [ ${counter} -lt 5 ]
do
cd ..
if [ -f ${cfg_script_name} ];then
break
fi
counter=$((counter=counter + 1))
done
if [ "${counter}" -ge 5 ];then
echo "${cfg_script_name} not found in upper directories!"
exit 1
fi
os_fsfw="linux"
tgt_bsp="arm/te0720-1cfa"
build_generator="make"
build_dir="build-Debug-te0720-1cfa"
if [ "${OS}" = "Windows_NT" ]; then
python="py"
# Could be other OS but this works for now.
else
python="python3"
fi
echo "Running command (without the leading +):"
set -x # Print command
${python} ${cfg_script_name} -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" \
-l"${build_dir}"
# set +x

View File

@ -5,7 +5,7 @@ function help () {
} }
TOOLCHAIN_PATH="/c/Xilinx/Vitis/2019.2/gnu/aarch32/nt/gcc-arm-linux-gnueabi/bin" TOOLCHAIN_PATH="/c/Xilinx/Vitis/2019.2/gnu/aarch32/nt/gcc-arm-linux-gnueabi/bin"
SYSROOT="/c/Users/${USER}/eive-software/cortexa9hf-neon-xiphos-linux-gnueabi" SYSROOT="/c/Users/${USER}/eive-software/sysroots-petalinux-2019-2/cortexa9t2hf-neon-xilinx-linux-gnueabi"
for i in "$@"; do for i in "$@"; do
case $i in case $i in
@ -41,7 +41,7 @@ else
fi fi
if [ -d "$SYSROOT" ]; then if [ -d "$SYSROOT" ]; then
export Q7S_SYSROOT=$SYSROOT export ZYNQ_7020_SYSROOT=$SYSROOT
echo "Set sysroot path to $SYSROOT" echo "Set sysroot path to $SYSROOT"
else else
echo "Sysroot path $SYSROOT does not exist" echo "Sysroot path $SYSROOT does not exist"

View File

@ -13,7 +13,8 @@ enum commonClassIds: uint8_t {
IMTQ_HANDLER, //IMTQ IMTQ_HANDLER, //IMTQ
RW_HANDLER, //RWHA RW_HANDLER, //RWHA
STR_HANDLER, //STRH STR_HANDLER, //STRH
PLOC_MPSOC_HANDLER, //PLMP DWLPWRON_CMD, //DWLPWRON
MPSOC_TM, //MPTM
PLOC_SUPERVISOR_HANDLER, //PLSV PLOC_SUPERVISOR_HANDLER, //PLSV
SUS_HANDLER, //SUSS SUS_HANDLER, //SUSS
CCSDS_IP_CORE_BRIDGE, //IPCI CCSDS_IP_CORE_BRIDGE, //IPCI
@ -27,7 +28,10 @@ enum commonClassIds: uint8_t {
RATE_SETTER, //RS RATE_SETTER, //RS
ARCSEC_JSON_BASE, //JSONBASE ARCSEC_JSON_BASE, //JSONBASE
NVM_PARAM_BASE, //NVMB NVM_PARAM_BASE, //NVMB
FILE_SYSTEM_HELPER, //FSHLP
PLOC_MPSOC_HELPER, // PLMPHLP
SA_DEPL_HANDLER, //SADPL SA_DEPL_HANDLER, //SADPL
MPSOC_RETURN_VALUES_IF, //MPSOCRTVIF
COMMON_CLASS_ID_END // [EXPORT] : [END] COMMON_CLASS_ID_END // [EXPORT] : [END]
}; };

View File

@ -42,6 +42,7 @@ enum commonObjects: uint32_t {
IMTQ_HANDLER = 0x44140014, IMTQ_HANDLER = 0x44140014,
PLOC_MPSOC_HANDLER = 0x44330015, PLOC_MPSOC_HANDLER = 0x44330015,
PLOC_SUPERVISOR_HANDLER = 0x44330016, PLOC_SUPERVISOR_HANDLER = 0x44330016,
PLOC_SUPERVISOR_HELPER = 0x44330017,
/** /**
* 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.
@ -89,8 +90,9 @@ enum commonObjects: uint32_t {
PLOC_UPDATER = 0x44330000, PLOC_UPDATER = 0x44330000,
PLOC_MEMORY_DUMPER = 0x44330001, PLOC_MEMORY_DUMPER = 0x44330001,
STR_HELPER = 0x44330002, STR_HELPER = 0x44330002,
AXI_PTME_CONFIG = 44330003, PLOC_MPSOC_HELPER = 0x44330003,
PTME_CONFIG = 44330004, AXI_PTME_CONFIG = 44330004,
PTME_CONFIG = 44330005,
// 0x73 ('s') for assemblies and system/subsystem components // 0x73 ('s') for assemblies and system/subsystem components
ACS_BOARD_ASS = 0x73000001, ACS_BOARD_ASS = 0x73000001,

View File

@ -6,23 +6,26 @@
namespace SUBSYSTEM_ID { namespace SUBSYSTEM_ID {
enum: uint8_t { enum: uint8_t {
COMMON_SUBSYSTEM_ID_START = FW_SUBSYSTEM_ID_RANGE, COMMON_SUBSYSTEM_ID_START = FW_SUBSYSTEM_ID_RANGE,
PCDU_HANDLER = 108, ACS_SUBSYSTEM = 112,
HEATER_HANDLER = 109, PCDU_HANDLER = 113,
SA_DEPL_HANDLER = 110, HEATER_HANDLER = 114,
PLOC_MPSOC_HANDLER = 111, SA_DEPL_HANDLER = 115,
IMTQ_HANDLER = 112, PLOC_MPSOC_HANDLER = 116,
RW_HANDLER = 113, IMTQ_HANDLER = 117,
STR_HANDLER = 114, RW_HANDLER = 118,
PLOC_SUPERVISOR_HANDLER = 115, STR_HANDLER = 119,
FILE_SYSTEM = 116, PLOC_SUPERVISOR_HANDLER = 120,
PLOC_UPDATER = 117, FILE_SYSTEM = 121,
PLOC_MEMORY_DUMPER = 118, PLOC_UPDATER = 122,
PDEC_HANDLER = 119, PLOC_MEMORY_DUMPER = 123,
STR_HELPER = 120, PDEC_HANDLER = 124,
PL_PCDU_HANDLER = 121, STR_HELPER = 125,
ACS_BOARD_ASS = 122, PLOC_MPSOC_HELPER = 126,
SUS_BOARD_ASS = 123, PL_PCDU_HANDLER = 127,
TCS_BOARD_ASS = 124, ACS_BOARD_ASS = 128,
SUS_BOARD_ASS = 129,
TCS_BOARD_ASS = 130,
GPS_HANDLER = 131,
COMMON_SUBSYSTEM_ID_END COMMON_SUBSYSTEM_ID_END
}; };
} }

View File

@ -51,7 +51,7 @@ namespace uart {
static constexpr size_t HYPERION_GPS_REPLY_MAX_BUFFER = 1024; static constexpr size_t HYPERION_GPS_REPLY_MAX_BUFFER = 1024;
static constexpr uint32_t SYRLINKS_BAUD = 38400; static constexpr uint32_t SYRLINKS_BAUD = 38400;
static constexpr uint32_t GNSS_BAUD = 9600; static constexpr uint32_t GNSS_BAUD = 9600;
static constexpr uint32_t PLOC_MPSOC_BAUD = 921600; static constexpr uint32_t PLOC_MPSOC_BAUD = 115200;
static constexpr uint32_t PLOC_SUPERVISOR_BAUD = 115200; static constexpr uint32_t PLOC_SUPERVISOR_BAUD = 115200;
static constexpr uint32_t STAR_TRACKER_BAUD = 921600; static constexpr uint32_t STAR_TRACKER_BAUD = 921600;

View File

@ -119,7 +119,11 @@ enum gpioId_t {
PLPCDU_ENB_TX, PLPCDU_ENB_TX,
PLPCDU_ENB_HPA, PLPCDU_ENB_HPA,
PLPCDU_ENB_MPA, PLPCDU_ENB_MPA,
PLPCDU_ADC_CS PLPCDU_ADC_CS,
ENABLE_MPSOC_UART,
ENABLE_SUPV_UART
}; };
} }

View File

@ -3,12 +3,15 @@
#include "OBSWConfig.h" #include "OBSWConfig.h"
#include <fsfw/power/definitions.h>
#include <array> #include <array>
#include <cstdint> #include <cstdint>
namespace pcduSwitches { namespace pcduSwitches {
/* Switches are uint8_t datatype and go from 0 to 255 */ /* Switches are uint8_t datatype and go from 0 to 255 */
enum Switches: uint8_t { enum Switches: power::Switch_t {
PDU1_CH0_TCS_BOARD_3V3, PDU1_CH0_TCS_BOARD_3V3,
PDU1_CH1_SYRLINKS_12V, PDU1_CH1_SYRLINKS_12V,
PDU1_CH2_STAR_TRACKER_5V, PDU1_CH2_STAR_TRACKER_5V,
@ -39,7 +42,7 @@ static const uint8_t OFF = 0;
const std::array<uint8_t, NUMBER_OF_SWITCHES> INIT_SWITCH_STATES = { const std::array<uint8_t, NUMBER_OF_SWITCHES> INIT_SWITCH_STATES = {
// PDU 1 // PDU 1
// Because the TE0720 is not connected to the PCDU, this switch is always on // Because the TE0720 is not connected to the PCDU, this switch is always on
#if BOARD_TE0720 == 1 #ifdef TE0720_1CFA
ON, ON,
#else #else
OFF, OFF,

View File

@ -0,0 +1,25 @@
#ifndef COMMON_CONFIG_DEFINITIONS_H_
#define COMMON_CONFIG_DEFINITIONS_H_
#include <cstdint>
namespace config {
static constexpr uint32_t PL_PCDU_TRANSITION_TIMEOUT_MS = 20 * 60 * 1000;
static constexpr uint32_t LONGEST_MODE_TIMEOUT_SECONDS = PL_PCDU_TRANSITION_TIMEOUT_MS / 1000;
/* Add mission configuration flags here */
static constexpr uint32_t OBSW_FILESYSTEM_HANDLER_QUEUE_SIZE = 50;
static constexpr uint32_t PLOC_UPDATER_QUEUE_SIZE = 50;
static constexpr uint32_t STR_IMG_HELPER_QUEUE_SIZE = 50;
static constexpr uint8_t LIVE_TM = 0;
/* Limits for filename and path checks */
static constexpr uint32_t MAX_PATH_SIZE = 100;
static constexpr uint32_t MAX_FILENAME_SIZE = 50;
}
#endif /* COMMON_CONFIG_DEFINITIONS_H_ */

2
fsfw

@ -1 +1 @@
Subproject commit e6130263ef144c5b1f6eafef734a0150a92d6cda Subproject commit 5bda877d97b41e82bf36d939c9f367cef611446a

View File

@ -77,91 +77,106 @@
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
10800;0x2a30;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
10801;0x2a31;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 swithc state has changed P1: New switch state, 1 for on, 0 for off | P2: Switch Index;mission/devices/devicedefinitions/powerDefinitions.h
10802;0x2a32;SWITCHING_Q7S_DENIED;MEDIUM;;mission/devices/devicedefinitions/powerDefinitions.h 11302;0x2c26;SWITCHING_Q7S_DENIED;MEDIUM;;mission/devices/devicedefinitions/powerDefinitions.h
10900;0x2a94;GPIO_PULL_HIGH_FAILED;LOW;;mission/devices/HeaterHandler.h 11400;0x2c88;GPIO_PULL_HIGH_FAILED;LOW;;mission/devices/HeaterHandler.h
10901;0x2a95;GPIO_PULL_LOW_FAILED;LOW;;mission/devices/HeaterHandler.h 11401;0x2c89;GPIO_PULL_LOW_FAILED;LOW;;mission/devices/HeaterHandler.h
10902;0x2a96;SWITCH_ALREADY_ON;LOW;;mission/devices/HeaterHandler.h 11402;0x2c8a;SWITCH_ALREADY_ON;LOW;;mission/devices/HeaterHandler.h
10903;0x2a97;SWITCH_ALREADY_OFF;LOW;;mission/devices/HeaterHandler.h 11403;0x2c8b;SWITCH_ALREADY_OFF;LOW;;mission/devices/HeaterHandler.h
10904;0x2a98;MAIN_SWITCH_TIMEOUT;LOW;;mission/devices/HeaterHandler.h 11404;0x2c8c;MAIN_SWITCH_TIMEOUT;LOW;;mission/devices/HeaterHandler.h
11000;0x2af8;MAIN_SWITCH_ON_TIMEOUT;LOW;;mission/devices/SolarArrayDeploymentHandler.h 11500;0x2cec;MAIN_SWITCH_ON_TIMEOUT;LOW;;mission/devices/SolarArrayDeploymentHandler.h
11001;0x2af9;MAIN_SWITCH_OFF_TIMEOUT;LOW;;mission/devices/SolarArrayDeploymentHandler.h 11501;0x2ced;MAIN_SWITCH_OFF_TIMEOUT;LOW;;mission/devices/SolarArrayDeploymentHandler.h
11002;0x2afa;DEPLOYMENT_FAILED;HIGH;;mission/devices/SolarArrayDeploymentHandler.h 11502;0x2cee;DEPLOYMENT_FAILED;HIGH;;mission/devices/SolarArrayDeploymentHandler.h
11003;0x2afb;DEPL_SA1_GPIO_SWTICH_ON_FAILED;HIGH;;mission/devices/SolarArrayDeploymentHandler.h 11503;0x2cef;DEPL_SA1_GPIO_SWTICH_ON_FAILED;HIGH;;mission/devices/SolarArrayDeploymentHandler.h
11004;0x2afc;DEPL_SA2_GPIO_SWTICH_ON_FAILED;HIGH;;mission/devices/SolarArrayDeploymentHandler.h 11504;0x2cf0;DEPL_SA2_GPIO_SWTICH_ON_FAILED;HIGH;;mission/devices/SolarArrayDeploymentHandler.h
11101;0x2b5d;MEMORY_READ_RPT_CRC_FAILURE;LOW;;mission/devices/PlocMPSoCHandler.h 11601;0x2d51;MEMORY_READ_RPT_CRC_FAILURE;LOW;PLOC crc failure in telemetry packet;linux/devices/ploc/PlocMPSoCHandler.h
11102;0x2b5e;ACK_FAILURE;LOW;;mission/devices/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
11103;0x2b5f;EXE_FAILURE;LOW;;mission/devices/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
11104;0x2b60;CRC_FAILURE_EVENT;LOW;;mission/devices/PlocMPSoCHandler.h 11604;0x2d54;MPSOC_HANDLER_CRC_FAILURE;LOW;PLOC reply has invalid crc;linux/devices/ploc/PlocMPSoCHandler.h
11201;0x2bc1;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 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
11202;0x2bc2;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 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
11203;0x2bc3;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 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
11204;0x2bc4;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 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
11205;0x2bc5;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 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
11206;0x2bc6;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 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
11207;0x2bc7;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 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
11208;0x2bc8;INVALID_ERROR_BYTE;LOW;Received invalid error byte. This indicates an error of the communication link between IMTQ and OBC.;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
11301;0x2c25;ERROR_STATE;HIGH;Reaction wheel signals an error state;mission/devices/RwHandler.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
11401;0x2c89;BOOTING_FIRMWARE_FAILED;LOW;Failed to boot firmware;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
11402;0x2c8a;BOOTING_BOOTLOADER_FAILED;LOW;Failed to boot star tracker into bootloader mode;linux/devices/startracker/StarTrackerHandler.h 11801;0x2e19;ERROR_STATE;HIGH;Reaction wheel signals an error state;mission/devices/RwHandler.h
11501;0x2ced;SUPV_MEMORY_READ_RPT_CRC_FAILURE;LOW;PLOC supervisor crc failure in telemetry packet;bsp_q7s/devices/PlocSupervisorHandler.h 11901;0x2e7d;BOOTING_FIRMWARE_FAILED;LOW;Failed to boot firmware;linux/devices/startracker/StarTrackerHandler.h
11502;0x2cee;SUPV_ACK_FAILURE;LOW;PLOC supervisor received acknowledgment failure report;bsp_q7s/devices/PlocSupervisorHandler.h 11902;0x2e7e;BOOTING_BOOTLOADER_FAILED;LOW;Failed to boot star tracker into bootloader mode;linux/devices/startracker/StarTrackerHandler.h
11503;0x2cef;SUPV_EXE_FAILURE;LOW;PLOC received execution failure report;bsp_q7s/devices/PlocSupervisorHandler.h 12001;0x2ee1;SUPV_MEMORY_READ_RPT_CRC_FAILURE;LOW;PLOC supervisor crc failure in telemetry packet;linux/devices/ploc/PlocSupervisorHandler.h
11504;0x2cf0;SUPV_CRC_FAILURE_EVENT;LOW;PLOC supervisor reply has invalid crc;bsp_q7s/devices/PlocSupervisorHandler.h 12002;0x2ee2;SUPV_ACK_FAILURE;LOW;PLOC supervisor received acknowledgment failure report;linux/devices/ploc/PlocSupervisorHandler.h
11600;0x2d50;SANITIZATION_FAILED;LOW;;bsp_q7s/memory/SdCardManager.h 12003;0x2ee3;SUPV_EXE_FAILURE;LOW;PLOC received execution failure report;linux/devices/ploc/PlocSupervisorHandler.h
11601;0x2d51;MOUNTED_SD_CARD;INFO;;bsp_q7s/memory/SdCardManager.h 12004;0x2ee4;SUPV_CRC_FAILURE_EVENT;LOW;PLOC supervisor reply has invalid crc;linux/devices/ploc/PlocSupervisorHandler.h
11700;0x2db4;UPDATE_FILE_NOT_EXISTS;LOW;;bsp_q7s/devices/PlocUpdater.h 12100;0x2f44;SANITIZATION_FAILED;LOW;;bsp_q7s/memory/SdCardManager.h
11701;0x2db5;ACTION_COMMANDING_FAILED;LOW;Failed to send command to supervisor handler P1: Return value of CommandActionHelper::commandAction P2: Action ID of command to send;bsp_q7s/devices/PlocUpdater.h 12101;0x2f45;MOUNTED_SD_CARD;INFO;;bsp_q7s/memory/SdCardManager.h
11702;0x2db6;UPDATE_AVAILABLE_FAILED;LOW;Supervisor handler replied action message indicating a command execution failure of the update available command;bsp_q7s/devices/PlocUpdater.h 12200;0x2fa8;UPDATE_FILE_NOT_EXISTS;LOW;;linux/devices/ploc/PlocUpdater.h
11703;0x2db7;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);bsp_q7s/devices/PlocUpdater.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
11704;0x2db8;UPDATE_VERIFY_FAILED;LOW;Supervisor failed to execute the update verify command.;bsp_q7s/devices/PlocUpdater.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
11705;0x2db9;UPDATE_FINISHED;INFO;MPSoC update successful completed;bsp_q7s/devices/PlocUpdater.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
11800;0x2e18;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;bsp_q7s/devices/PlocMemoryDumper.h 12204;0x2fac;UPDATE_VERIFY_FAILED;LOW;Supervisor failed to execute the update verify command.;linux/devices/ploc/PlocUpdater.h
11801;0x2e19;MRAM_DUMP_FAILED;LOW;Received completion failure report form PLOC supervisor handler P1: MRAM start address of failing dump command;bsp_q7s/devices/PlocMemoryDumper.h 12205;0x2fad;UPDATE_FINISHED;INFO;MPSoC update successful completed;linux/devices/ploc/PlocUpdater.h
11802;0x2e1a;MRAM_DUMP_FINISHED;LOW;MRAM dump finished successfully;bsp_q7s/devices/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
11901;0x2e7d;INVALID_TC_FRAME;HIGH;;linux/obc/PdecHandler.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
11902;0x2e7e;INVALID_FAR;HIGH;Read invalid FAR from PDEC after startup;linux/obc/PdecHandler.h 12302;0x300e;MRAM_DUMP_FINISHED;LOW;MRAM dump finished successfully;linux/devices/ploc/PlocMemoryDumper.h
11903;0x2e7f;CARRIER_LOCK;INFO;Carrier lock detected;linux/obc/PdecHandler.h 12401;0x3071;INVALID_TC_FRAME;HIGH;;linux/obc/PdecHandler.h
11904;0x2e80;BIT_LOCK_PDEC;INFO;Bit lock detected (data valid);linux/obc/PdecHandler.h 12402;0x3072;INVALID_FAR;HIGH;Read invalid FAR from PDEC after startup;linux/obc/PdecHandler.h
12000;0x2ee0;IMAGE_UPLOAD_FAILED;LOW;Image upload failed;linux/devices/startracker/StrHelper.h 12403;0x3073;CARRIER_LOCK;INFO;Carrier lock detected;linux/obc/PdecHandler.h
12001;0x2ee1;IMAGE_DOWNLOAD_FAILED;LOW;Image download failed;linux/devices/startracker/StrHelper.h 12404;0x3074;BIT_LOCK_PDEC;INFO;Bit lock detected (data valid);linux/obc/PdecHandler.h
12002;0x2ee2;IMAGE_UPLOAD_SUCCESSFUL;LOW;Uploading image to star tracker was successfulop;linux/devices/startracker/StrHelper.h 12500;0x30d4;IMAGE_UPLOAD_FAILED;LOW;Image upload failed;linux/devices/startracker/StrHelper.h
12003;0x2ee3;IMAGE_DOWNLOAD_SUCCESSFUL;LOW;Image download was successful;linux/devices/startracker/StrHelper.h 12501;0x30d5;IMAGE_DOWNLOAD_FAILED;LOW;Image download failed;linux/devices/startracker/StrHelper.h
12004;0x2ee4;FLASH_WRITE_SUCCESSFUL;LOW;Finished flash write procedure successfully;linux/devices/startracker/StrHelper.h 12502;0x30d6;IMAGE_UPLOAD_SUCCESSFUL;LOW;Uploading image to star tracker was successfulop;linux/devices/startracker/StrHelper.h
12005;0x2ee5;FLASH_READ_SUCCESSFUL;LOW;Finished flash read procedure successfully;linux/devices/startracker/StrHelper.h 12503;0x30d7;IMAGE_DOWNLOAD_SUCCESSFUL;LOW;Image download was successful;linux/devices/startracker/StrHelper.h
12006;0x2ee6;FLASH_READ_FAILED;LOW;Flash read procedure failed;linux/devices/startracker/StrHelper.h 12504;0x30d8;FLASH_WRITE_SUCCESSFUL;LOW;Finished flash write procedure successfully;linux/devices/startracker/StrHelper.h
12007;0x2ee7;FIRMWARE_UPDATE_SUCCESSFUL;LOW;Firmware update was successful;linux/devices/startracker/StrHelper.h 12505;0x30d9;FLASH_READ_SUCCESSFUL;LOW;Finished flash read procedure successfully;linux/devices/startracker/StrHelper.h
12008;0x2ee8;FIRMWARE_UPDATE_FAILED;LOW;Firmware update failed;linux/devices/startracker/StrHelper.h 12506;0x30da;FLASH_READ_FAILED;LOW;Flash read procedure failed;linux/devices/startracker/StrHelper.h
12009;0x2ee9;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 12507;0x30db;FIRMWARE_UPDATE_SUCCESSFUL;LOW;Firmware update was successful;linux/devices/startracker/StrHelper.h
12010;0x2eea;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 12508;0x30dc;FIRMWARE_UPDATE_FAILED;LOW;Firmware update failed;linux/devices/startracker/StrHelper.h
12011;0x2eeb;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 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
12012;0x2eec;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 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
12013;0x2eed;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 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
12014;0x2eee;STR_HELPER_FILE_NOT_EXISTS;LOW;Specified file does not exist P1: Internal state of str helper;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
12015;0x2eef;STR_HELPER_SENDING_PACKET_FAILED;LOW;;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
12016;0x2ef0;STR_HELPER_REQUESTING_MSG_FAILED;LOW;;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
12100;0x2f44;TRANSITION_BACK_TO_OFF;MEDIUM;Could not transition properly and went back to ALL OFF;mission/devices/PayloadPcduHandler.h 12515;0x30e3;STR_HELPER_SENDING_PACKET_FAILED;LOW;;linux/devices/startracker/StrHelper.h
12101;0x2f45;NEG_V_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h 12516;0x30e4;STR_HELPER_REQUESTING_MSG_FAILED;LOW;;linux/devices/startracker/StrHelper.h
12102;0x2f46;U_DRO_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h 12600;0x3138;MPSOC_FLASH_WRITE_FAILED;LOW;Flash write fails;linux/devices/ploc/PlocMPSoCHelper.h
12103;0x2f47;I_DRO_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h 12601;0x3139;MPSOC_FLASH_WRITE_SUCCESSFUL;LOW;Flash write successful;linux/devices/ploc/PlocMPSoCHelper.h
12104;0x2f48;U_X8_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h 12602;0x313a;SENDING_COMMAND_FAILED;LOW;;linux/devices/ploc/PlocMPSoCHelper.h
12105;0x2f49;I_X8_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.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
12106;0x2f4a;U_TX_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.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
12107;0x2f4b;I_TX_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.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
12108;0x2f4c;U_MPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.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
12109;0x2f4d;I_MPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h 12607;0x313f;ACK_FAILURE_REPORT;LOW;Received acknowledgement failure report P1: Internal state of MPSoC;linux/devices/ploc/PlocMPSoCHelper.h
12110;0x2f4e;U_HPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h 12608;0x3140;EXE_FAILURE_REPORT;LOW;Received execution failure report P1: Internal state of MPSoC;linux/devices/ploc/PlocMPSoCHelper.h
12111;0x2f4f;I_HPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.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
12200;0x2fa8;TRANSITION_OTHER_SIDE_FAILED;HIGH;;mission/system/AcsBoardAssembly.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
12201;0x2fa9;NOT_ENOUGH_DEVICES_DUAL_MODE;HIGH;;mission/system/AcsBoardAssembly.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
12202;0x2faa;POWER_STATE_MACHINE_TIMEOUT;MEDIUM;;mission/system/AcsBoardAssembly.h 12700;0x319c;TRANSITION_BACK_TO_OFF;MEDIUM;Could not transition properly and went back to ALL OFF;mission/devices/PayloadPcduHandler.h
12203;0x2fab;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 12701;0x319d;NEG_V_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h
12300;0x300c;TRANSITION_OTHER_SIDE_FAILED;HIGH;;mission/system/SusAssembly.h 12702;0x319e;U_DRO_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h
12301;0x300d;NOT_ENOUGH_DEVICES_DUAL_MODE;HIGH;;mission/system/SusAssembly.h 12703;0x319f;I_DRO_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h
12302;0x300e;POWER_STATE_MACHINE_TIMEOUT;MEDIUM;;mission/system/SusAssembly.h 12704;0x31a0;U_X8_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h
12303;0x300f;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 12705;0x31a1;I_X8_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h
12400;0x3070;CHILDREN_LOST_MODE;MEDIUM;;mission/system/TcsBoardAssembly.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
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
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
12800;0x3200;TRANSITION_OTHER_SIDE_FAILED;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
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
12901;0x3265;NOT_ENOUGH_DEVICES_DUAL_MODE;HIGH;;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
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
13600;0x3520;ALLOC_FAILURE;MEDIUM;;bsp_q7s/core/CoreController.h 13600;0x3520;ALLOC_FAILURE;MEDIUM;;bsp_q7s/core/CoreController.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 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;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 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

1 Event ID (dec) 2200 Event ID (hex) 0x0898 Name STORE_SEND_WRITE_FAILED Severity LOW Description File Path fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
77 8900 8901 0x22c4 0x22c5 CLOCK_SET CLOCK_SET_FAILURE INFO LOW fsfw/src/fsfw/pus/Service9TimeManagement.h
78 8901 9700 0x22c5 0x25e4 CLOCK_SET_FAILURE TEST LOW INFO fsfw/src/fsfw/pus/Service9TimeManagement.h fsfw/src/fsfw/pus/Service17Test.h
79 9100 10600 0x238c 0x2968 TC_DELETION_FAILED CHANGE_OF_SETUP_PARAMETER MEDIUM LOW Deletion of a TC from the map failed. P1: First 32 bit of request ID, P2. Last 32 bit of Request ID fsfw/src/fsfw/pus/Service11TelecommandScheduling.h fsfw/hal/src/fsfw_hal/devicehandlers/MgmLIS3MDLHandler.h
80 9700 11300 0x25e4 0x2c24 TEST SWITCH_CMD_SENT INFO INFO Indicates that a FSFW object requested setting a switch P1: 1 if on was requested, 0 for off | P2: Switch Index fsfw/src/fsfw/pus/Service17Test.h mission/devices/devicedefinitions/powerDefinitions.h
81 10600 11301 0x2968 0x2c25 CHANGE_OF_SETUP_PARAMETER SWITCH_HAS_CHANGED LOW INFO Indicated that a swithc state has changed P1: New switch state, 1 for on, 0 for off | P2: Switch Index fsfw/src/fsfw_hal/devicehandlers/MgmLIS3MDLHandler.h mission/devices/devicedefinitions/powerDefinitions.h
82 11300 11302 0x2c24 0x2c26 SWITCH_CMD_SENT SWITCHING_Q7S_DENIED INFO MEDIUM 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
83 11301 11400 0x2c25 0x2c88 SWITCH_HAS_CHANGED GPIO_PULL_HIGH_FAILED INFO LOW 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 mission/devices/HeaterHandler.h
84 11302 11401 0x2c26 0x2c89 SWITCHING_Q7S_DENIED GPIO_PULL_LOW_FAILED MEDIUM LOW mission/devices/devicedefinitions/powerDefinitions.h mission/devices/HeaterHandler.h
85 11303 11402 0x2c27 0x2c8a FDIR_REACTION_IGNORED SWITCH_ALREADY_ON MEDIUM LOW mission/devices/devicedefinitions/powerDefinitions.h mission/devices/HeaterHandler.h
86 11400 11403 0x2c88 0x2c8b GPIO_PULL_HIGH_FAILED SWITCH_ALREADY_OFF LOW LOW mission/devices/HeaterHandler.h
87 11401 11404 0x2c89 0x2c8c GPIO_PULL_LOW_FAILED MAIN_SWITCH_TIMEOUT LOW LOW mission/devices/HeaterHandler.h
88 11402 11500 0x2c8a 0x2cec HEATER_WENT_ON MAIN_SWITCH_ON_TIMEOUT INFO LOW mission/devices/HeaterHandler.h mission/devices/SolarArrayDeploymentHandler.h
89 11403 11501 0x2c8b 0x2ced HEATER_WENT_OFF MAIN_SWITCH_OFF_TIMEOUT INFO LOW mission/devices/HeaterHandler.h mission/devices/SolarArrayDeploymentHandler.h
90 11404 11502 0x2c8c 0x2cee SWITCH_ALREADY_ON DEPLOYMENT_FAILED LOW HIGH mission/devices/HeaterHandler.h mission/devices/SolarArrayDeploymentHandler.h
91 11405 11503 0x2c8d 0x2cef SWITCH_ALREADY_OFF DEPL_SA1_GPIO_SWTICH_ON_FAILED LOW HIGH mission/devices/HeaterHandler.h mission/devices/SolarArrayDeploymentHandler.h
92 11406 11504 0x2c8e 0x2cf0 MAIN_SWITCH_TIMEOUT DEPL_SA2_GPIO_SWTICH_ON_FAILED MEDIUM HIGH mission/devices/HeaterHandler.h mission/devices/SolarArrayDeploymentHandler.h
93 11407 11601 0x2c8f 0x2d51 FAULTY_HEATER_WAS_ON MEMORY_READ_RPT_CRC_FAILURE LOW LOW PLOC crc failure in telemetry packet mission/devices/HeaterHandler.h linux/devices/ploc/PlocMPSoCHandler.h
94 11500 11602 0x2cec 0x2d52 MAIN_SWITCH_ON_TIMEOUT ACK_FAILURE LOW 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 mission/devices/SolarArrayDeploymentHandler.h linux/devices/ploc/PlocMPSoCHandler.h
95 11501 11603 0x2ced 0x2d53 MAIN_SWITCH_OFF_TIMEOUT EXE_FAILURE LOW 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 mission/devices/SolarArrayDeploymentHandler.h linux/devices/ploc/PlocMPSoCHandler.h
96 11502 11604 0x2cee 0x2d54 DEPLOYMENT_FAILED MPSOC_HANDLER_CRC_FAILURE HIGH LOW PLOC reply has invalid crc mission/devices/SolarArrayDeploymentHandler.h linux/devices/ploc/PlocMPSoCHandler.h
97 11503 11605 0x2cef 0x2d55 DEPL_SA1_GPIO_SWTICH_ON_FAILED MPSOC_HANDLER_SEQ_CNT_MISMATCH HIGH LOW Packet sequence count in received space packet does not match expected count P1: Expected sequence count P2: Received sequence count mission/devices/SolarArrayDeploymentHandler.h linux/devices/ploc/PlocMPSoCHandler.h
98 11504 11606 0x2cf0 0x2d56 DEPL_SA2_GPIO_SWTICH_ON_FAILED MPSOC_SHUTDOWN_FAILED HIGH HIGH Supervisor fails to shutdown MPSoC. Requires to power off the PLOC and thus also to shutdown the supervisor. mission/devices/SolarArrayDeploymentHandler.h linux/devices/ploc/PlocMPSoCHandler.h
99 11601 11701 0x2d51 0x2db5 MEMORY_READ_RPT_CRC_FAILURE SELF_TEST_I2C_FAILURE LOW LOW PLOC crc failure in telemetry packet 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 linux/devices/ploc/PlocMPSoCHandler.h mission/devices/IMTQHandler.h
100 11602 11702 0x2d52 0x2db6 ACK_FAILURE SELF_TEST_SPI_FAILURE LOW 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 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 linux/devices/ploc/PlocMPSoCHandler.h mission/devices/IMTQHandler.h
101 11603 11703 0x2d53 0x2db7 EXE_FAILURE SELF_TEST_ADC_FAILURE LOW 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 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 linux/devices/ploc/PlocMPSoCHandler.h mission/devices/IMTQHandler.h
102 11604 11704 0x2d54 0x2db8 MPSOC_HANDLER_CRC_FAILURE SELF_TEST_PWM_FAILURE LOW LOW PLOC reply has invalid crc 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 linux/devices/ploc/PlocMPSoCHandler.h mission/devices/IMTQHandler.h
103 11605 11705 0x2d55 0x2db9 MPSOC_HANDLER_SEQUENCE_COUNT_MISMATCH SELF_TEST_TC_FAILURE LOW LOW Packet sequence count in received space packet does not match expected count P1: Expected sequence count P2: Received sequence count 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 linux/devices/ploc/PlocMPSoCHandler.h mission/devices/IMTQHandler.h
104 11606 11706 0x2d56 0x2dba MPSOC_SHUTDOWN_FAILED SELF_TEST_MTM_RANGE_FAILURE HIGH LOW Supervisor fails to shutdown MPSoC. Requires to power off the PLOC and thus also to shutdown the supervisor. 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 linux/devices/ploc/PlocMPSoCHandler.h mission/devices/IMTQHandler.h
105 11701 11707 0x2db5 0x2dbb SELF_TEST_I2C_FAILURE SELF_TEST_COIL_CURRENT_FAILURE LOW 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 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
106 11702 11708 0x2db6 0x2dbc SELF_TEST_SPI_FAILURE INVALID_ERROR_BYTE LOW 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 Received invalid error byte. This indicates an error of the communication link between IMTQ and OBC. mission/devices/IMTQHandler.h
107 11703 11801 0x2db7 0x2e19 SELF_TEST_ADC_FAILURE ERROR_STATE LOW HIGH 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 Reaction wheel signals an error state mission/devices/IMTQHandler.h mission/devices/RwHandler.h
108 11704 11901 0x2db8 0x2e7d SELF_TEST_PWM_FAILURE BOOTING_FIRMWARE_FAILED LOW 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 Failed to boot firmware mission/devices/IMTQHandler.h linux/devices/startracker/StarTrackerHandler.h
109 11705 11902 0x2db9 0x2e7e SELF_TEST_TC_FAILURE BOOTING_BOOTLOADER_FAILED LOW 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 Failed to boot star tracker into bootloader mode mission/devices/IMTQHandler.h linux/devices/startracker/StarTrackerHandler.h
110 11706 12001 0x2dba 0x2ee1 SELF_TEST_MTM_RANGE_FAILURE SUPV_MEMORY_READ_RPT_CRC_FAILURE LOW 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 PLOC supervisor crc failure in telemetry packet mission/devices/IMTQHandler.h linux/devices/ploc/PlocSupervisorHandler.h
111 11707 12002 0x2dbb 0x2ee2 SELF_TEST_COIL_CURRENT_FAILURE SUPV_ACK_FAILURE LOW 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 PLOC supervisor received acknowledgment failure report mission/devices/IMTQHandler.h linux/devices/ploc/PlocSupervisorHandler.h
112 11708 12003 0x2dbc 0x2ee3 INVALID_ERROR_BYTE SUPV_EXE_FAILURE LOW LOW Received invalid error byte. This indicates an error of the communication link between IMTQ and OBC. PLOC received execution failure report mission/devices/IMTQHandler.h linux/devices/ploc/PlocSupervisorHandler.h
113 11801 12004 0x2e19 0x2ee4 ERROR_STATE SUPV_CRC_FAILURE_EVENT HIGH LOW Reaction wheel signals an error state PLOC supervisor reply has invalid crc mission/devices/devicedefinitions/RwDefinitions.h linux/devices/ploc/PlocSupervisorHandler.h
114 11802 12100 0x2e1a 0x2f44 RESET_OCCURED SANITIZATION_FAILED LOW LOW mission/devices/devicedefinitions/RwDefinitions.h bsp_q7s/memory/SdCardManager.h
115 11901 12101 0x2e7d 0x2f45 BOOTING_FIRMWARE_FAILED MOUNTED_SD_CARD LOW INFO Failed to boot firmware linux/devices/startracker/StarTrackerHandler.h bsp_q7s/memory/SdCardManager.h
116 11902 12200 0x2e7e 0x2fa8 BOOTING_BOOTLOADER_FAILED UPDATE_FILE_NOT_EXISTS LOW LOW Failed to boot star tracker into bootloader mode linux/devices/startracker/StarTrackerHandler.h linux/devices/ploc/PlocUpdater.h
117 12001 12201 0x2ee1 0x2fa9 SUPV_MEMORY_READ_RPT_CRC_FAILURE ACTION_COMMANDING_FAILED LOW LOW PLOC supervisor crc failure in telemetry packet Failed to send command to supervisor handler P1: Return value of CommandActionHelper::commandAction P2: Action ID of command to send linux/devices/ploc/PlocSupervisorHandler.h linux/devices/ploc/PlocUpdater.h
118 12002 12202 0x2ee2 0x2faa SUPV_ACK_FAILURE UPDATE_AVAILABLE_FAILED LOW LOW PLOC supervisor received acknowledgment failure report Supervisor handler replied action message indicating a command execution failure of the update available command linux/devices/ploc/PlocSupervisorHandler.h linux/devices/ploc/PlocUpdater.h
119 12003 12203 0x2ee3 0x2fab SUPV_EXE_FAILURE UPDATE_TRANSFER_FAILED LOW LOW PLOC received execution failure report P1: ID of command for which the execution failed P2: Status code sent by the supervisor handler 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/PlocSupervisorHandler.h linux/devices/ploc/PlocUpdater.h
120 12004 12204 0x2ee4 0x2fac SUPV_CRC_FAILURE_EVENT UPDATE_VERIFY_FAILED LOW LOW PLOC supervisor reply has invalid crc Supervisor failed to execute the update verify command. linux/devices/ploc/PlocSupervisorHandler.h linux/devices/ploc/PlocUpdater.h
121 12005 12205 0x2ee5 0x2fad SUPV_MPSOC_SHUWDOWN_BUILD_FAILED UPDATE_FINISHED LOW INFO Failed to build the command to shutdown the MPSoC MPSoC update successful completed linux/devices/ploc/PlocSupervisorHandler.h linux/devices/ploc/PlocUpdater.h
122 12100 12300 0x2f44 0x300c SANITIZATION_FAILED SEND_MRAM_DUMP_FAILED LOW 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 bsp_q7s/memory/SdCardManager.h linux/devices/ploc/PlocMemoryDumper.h
123 12101 12301 0x2f45 0x300d MOUNTED_SD_CARD MRAM_DUMP_FAILED INFO LOW Received completion failure report form PLOC supervisor handler P1: MRAM start address of failing dump command bsp_q7s/memory/SdCardManager.h linux/devices/ploc/PlocMemoryDumper.h
124 12300 12302 0x300c 0x300e SEND_MRAM_DUMP_FAILED MRAM_DUMP_FINISHED LOW 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 MRAM dump finished successfully linux/devices/ploc/PlocMemoryDumper.h
125 12301 12401 0x300d 0x3071 MRAM_DUMP_FAILED INVALID_TC_FRAME LOW HIGH Received completion failure report form PLOC supervisor handler P1: MRAM start address of failing dump command linux/devices/ploc/PlocMemoryDumper.h linux/obc/PdecHandler.h
126 12302 12402 0x300e 0x3072 MRAM_DUMP_FINISHED INVALID_FAR LOW HIGH MRAM dump finished successfully Read invalid FAR from PDEC after startup linux/devices/ploc/PlocMemoryDumper.h linux/obc/PdecHandler.h
127 12401 12403 0x3071 0x3073 INVALID_TC_FRAME CARRIER_LOCK HIGH INFO Carrier lock detected linux/obc/PdecHandler.h
128 12402 12404 0x3072 0x3074 INVALID_FAR BIT_LOCK_PDEC HIGH INFO Read invalid FAR from PDEC after startup Bit lock detected (data valid) linux/obc/PdecHandler.h
129 12403 12500 0x3073 0x30d4 CARRIER_LOCK IMAGE_UPLOAD_FAILED INFO LOW Carrier lock detected Image upload failed linux/obc/PdecHandler.h linux/devices/startracker/StrHelper.h
130 12404 12501 0x3074 0x30d5 BIT_LOCK_PDEC IMAGE_DOWNLOAD_FAILED INFO LOW Bit lock detected (data valid) Image download failed linux/obc/PdecHandler.h linux/devices/startracker/StrHelper.h
131 12405 12502 0x3075 0x30d6 LOST_CARRIER_LOCK_PDEC IMAGE_UPLOAD_SUCCESSFUL INFO LOW Lost carrier lock Uploading image to star tracker was successfulop linux/obc/PdecHandler.h linux/devices/startracker/StrHelper.h
132 12406 12503 0x3076 0x30d7 LOST_BIT_LOCK_PDEC IMAGE_DOWNLOAD_SUCCESSFUL INFO LOW Lost bit lock Image download was successful linux/obc/PdecHandler.h linux/devices/startracker/StrHelper.h
133 12500 12504 0x30d4 0x30d8 IMAGE_UPLOAD_FAILED FLASH_WRITE_SUCCESSFUL LOW LOW Image upload failed Finished flash write procedure successfully linux/devices/startracker/StrHelper.h
134 12501 12505 0x30d5 0x30d9 IMAGE_DOWNLOAD_FAILED FLASH_READ_SUCCESSFUL LOW LOW Image download failed Finished flash read procedure successfully linux/devices/startracker/StrHelper.h
135 12502 12506 0x30d6 0x30da IMAGE_UPLOAD_SUCCESSFUL FLASH_READ_FAILED LOW LOW Uploading image to star tracker was successfulop Flash read procedure failed linux/devices/startracker/StrHelper.h
136 12503 12507 0x30d7 0x30db IMAGE_DOWNLOAD_SUCCESSFUL FIRMWARE_UPDATE_SUCCESSFUL LOW LOW Image download was successful Firmware update was successful linux/devices/startracker/StrHelper.h
137 12504 12508 0x30d8 0x30dc FLASH_WRITE_SUCCESSFUL FIRMWARE_UPDATE_FAILED LOW LOW Finished flash write procedure successfully Firmware update failed linux/devices/startracker/StrHelper.h
138 12505 12509 0x30d9 0x30dd FLASH_READ_SUCCESSFUL STR_HELPER_READING_REPLY_FAILED LOW LOW Finished flash read procedure successfully 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
139 12506 12510 0x30da 0x30de FLASH_READ_FAILED STR_HELPER_COM_ERROR LOW LOW Flash read procedure failed 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
140 12507 12511 0x30db 0x30df FIRMWARE_UPDATE_SUCCESSFUL STR_HELPER_NO_REPLY LOW LOW Firmware update was successful 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
141 12508 12512 0x30dc 0x30e0 FIRMWARE_UPDATE_FAILED STR_HELPER_DEC_ERROR LOW LOW Firmware update failed 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
142 12509 12513 0x30dd 0x30e1 STR_HELPER_READING_REPLY_FAILED POSITION_MISMATCH LOW 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 Position mismatch P1: The expected position and thus the position for which the image upload/download failed linux/devices/startracker/StrHelper.h
143 12510 12514 0x30de 0x30e2 STR_HELPER_COM_ERROR STR_HELPER_FILE_NOT_EXISTS LOW 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 Specified file does not exist P1: Internal state of str helper linux/devices/startracker/StrHelper.h
144 12511 12515 0x30df 0x30e3 STR_HELPER_NO_REPLY STR_HELPER_SENDING_PACKET_FAILED LOW 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
145 12512 12516 0x30e0 0x30e4 STR_HELPER_DEC_ERROR STR_HELPER_REQUESTING_MSG_FAILED LOW 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
146 12513 12600 0x30e1 0x3138 POSITION_MISMATCH MPSOC_FLASH_WRITE_FAILED LOW LOW Position mismatch P1: The expected position and thus the position for which the image upload/download failed Flash write fails linux/devices/startracker/StrHelper.h linux/devices/ploc/PlocMPSoCHelper.h
147 12514 12601 0x30e2 0x3139 STR_HELPER_FILE_NOT_EXISTS MPSOC_FLASH_WRITE_SUCCESSFUL LOW LOW Specified file does not exist P1: Internal state of str helper Flash write successful linux/devices/startracker/StrHelper.h linux/devices/ploc/PlocMPSoCHelper.h
148 12515 12602 0x30e3 0x313a STR_HELPER_SENDING_PACKET_FAILED SENDING_COMMAND_FAILED LOW LOW linux/devices/startracker/StrHelper.h linux/devices/ploc/PlocMPSoCHelper.h
149 12516 12603 0x30e4 0x313b STR_HELPER_REQUESTING_MSG_FAILED MPSOC_HELPER_REQUESTING_REPLY_FAILED LOW 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/startracker/StrHelper.h linux/devices/ploc/PlocMPSoCHelper.h
150 12600 12604 0x3138 0x313c MPSOC_FLASH_WRITE_FAILED MPSOC_HELPER_READING_REPLY_FAILED LOW LOW Flash write fails 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
151 12601 12605 0x3139 0x313d MPSOC_FLASH_WRITE_SUCCESSFUL MISSING_ACK LOW LOW Flash write successful Did not receive acknowledgement report P1: Number of bytes missing P2: Internal state of MPSoC helper linux/devices/ploc/PlocMPSoCHelper.h
152 12602 12606 0x313a 0x313e MPSOC_SENDING_COMMAND_FAILED MISSING_EXE LOW LOW Did not receive execution report P1: Number of bytes missing P2: Internal state of MPSoC helper linux/devices/ploc/PlocMPSoCHelper.h
153 12603 12607 0x313b 0x313f MPSOC_HELPER_REQUESTING_REPLY_FAILED ACK_FAILURE_REPORT LOW LOW Request receive message of communication interface failed P1: Return value returned by the communication interface requestReceiveMessage function P2: Internal state of MPSoC helper Received acknowledgement failure report P1: Internal state of MPSoC linux/devices/ploc/PlocMPSoCHelper.h
154 12604 12608 0x313c 0x3140 MPSOC_HELPER_READING_REPLY_FAILED EXE_FAILURE_REPORT LOW LOW Reading receive message of communication interface failed P1: Return value returned by the communication interface readingReceivedMessage function P2: Internal state of MPSoC helper Received execution failure report P1: Internal state of MPSoC linux/devices/ploc/PlocMPSoCHelper.h
155 12605 12609 0x313d 0x3141 MPSOC_MISSING_ACK ACK_INVALID_APID LOW LOW Did not receive acknowledgment report P1: Number of bytes missing P2: Internal state of MPSoC helper 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
156 12606 12610 0x313e 0x3142 MPSOC_MISSING_EXE EXE_INVALID_APID LOW LOW Did not receive execution report P1: Number of bytes missing P2: Internal state of MPSoC helper 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
157 12607 12611 0x313f 0x3143 MPSOC_ACK_FAILURE_REPORT MPSOC_HELPER_SEQ_CNT_MISMATCH LOW LOW Received acknowledgment failure report P1: Internal state of MPSoC Received sequence count does not match expected sequence count P1: Expected sequence count P2: Received sequence count linux/devices/ploc/PlocMPSoCHelper.h
158 12608 12700 0x3140 0x319c MPSOC_EXE_FAILURE_REPORT TRANSITION_BACK_TO_OFF LOW MEDIUM Received execution failure report P1: Internal state of MPSoC Could not transition properly and went back to ALL OFF linux/devices/ploc/PlocMPSoCHelper.h mission/devices/PayloadPcduHandler.h
159 12609 12701 0x3141 0x319d MPSOC_ACK_INVALID_APID NEG_V_OUT_OF_BOUNDS LOW MEDIUM Expected acknowledgment report but received space packet with other apid P1: Apid of received space packet P2: Internal state of MPSoC P1: 0 -> too low, 1 -> too high P2: Float value linux/devices/ploc/PlocMPSoCHelper.h mission/devices/PayloadPcduHandler.h
160 12610 12702 0x3142 0x319e MPSOC_EXE_INVALID_APID U_DRO_OUT_OF_BOUNDS LOW MEDIUM Expected execution report but received space packet with other apid P1: Apid of received space packet P2: Internal state of MPSoC P1: 0 -> too low, 1 -> too high P2: Float value linux/devices/ploc/PlocMPSoCHelper.h mission/devices/PayloadPcduHandler.h
161 12611 12703 0x3143 0x319f MPSOC_HELPER_SEQ_CNT_MISMATCH I_DRO_OUT_OF_BOUNDS LOW MEDIUM Received sequence count does not match expected sequence count P1: Expected sequence count P2: Received sequence count P1: 0 -> too low, 1 -> too high P2: Float value linux/devices/ploc/PlocMPSoCHelper.h mission/devices/PayloadPcduHandler.h
162 12612 12704 0x3144 0x31a0 MPSOC_TM_SIZE_ERROR U_X8_OUT_OF_BOUNDS LOW MEDIUM P1: 0 -> too low, 1 -> too high P2: Float value linux/devices/ploc/PlocMPSoCHelper.h mission/devices/PayloadPcduHandler.h
163 12613 12705 0x3145 0x31a1 MPSOC_TM_CRC_MISSMATCH I_X8_OUT_OF_BOUNDS LOW MEDIUM P1: 0 -> too low, 1 -> too high P2: Float value linux/devices/ploc/PlocMPSoCHelper.h mission/devices/PayloadPcduHandler.h
164 12700 12706 0x319c 0x31a2 TRANSITION_BACK_TO_OFF U_TX_OUT_OF_BOUNDS MEDIUM MEDIUM Could not transition properly and went back to ALL OFF P1: 0 -> too low, 1 -> too high P2: Float value mission/devices/PayloadPcduHandler.h
165 12707 0x31a3 I_TX_OUT_OF_BOUNDS MEDIUM P1: 0 -> too low, 1 -> too high P2: Float value mission/devices/PayloadPcduHandler.h
166 12708 0x31a4 U_MPA_OUT_OF_BOUNDS MEDIUM P1: 0 -> too low, 1 -> too high P2: Float value mission/devices/PayloadPcduHandler.h
167 12709 0x31a5 I_MPA_OUT_OF_BOUNDS MEDIUM P1: 0 -> too low, 1 -> too high P2: Float value mission/devices/PayloadPcduHandler.h
168 12710 0x31a6 U_HPA_OUT_OF_BOUNDS MEDIUM P1: 0 -> too low, 1 -> too high P2: Float value mission/devices/PayloadPcduHandler.h
169 12711 0x31a7 I_HPA_OUT_OF_BOUNDS MEDIUM P1: 0 -> too low, 1 -> too high P2: Float value mission/devices/PayloadPcduHandler.h
170 12800 0x3200 TRANSITION_OTHER_SIDE_FAILED HIGH mission/system/AcsBoardAssembly.h
171 12801 0x3201 NOT_ENOUGH_DEVICES_DUAL_MODE HIGH mission/system/AcsBoardAssembly.h
172 12802 0x3202 POWER_STATE_MACHINE_TIMEOUT MEDIUM mission/system/AcsBoardAssembly.h
173 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
174 12900 0x3264 TRANSITION_OTHER_SIDE_FAILED HIGH mission/system/SusAssembly.h
175 12901 0x3265 NOT_ENOUGH_DEVICES_DUAL_MODE HIGH mission/system/SusAssembly.h
176 12902 0x3266 POWER_STATE_MACHINE_TIMEOUT MEDIUM mission/system/SusAssembly.h
177 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
178 13000 0x32c8 CHILDREN_LOST_MODE MEDIUM mission/system/TcsBoardAssembly.h
179 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
180 12701 13600 0x319d 0x3520 NEG_V_OUT_OF_BOUNDS ALLOC_FAILURE MEDIUM MEDIUM P1: 0 -> too low, 1 -> too high P2: Float value mission/devices/PayloadPcduHandler.h bsp_q7s/core/CoreController.h
181 12702 13601 0x319e 0x3521 U_DRO_OUT_OF_BOUNDS REBOOT_SW MEDIUM MEDIUM P1: 0 -> too low, 1 -> too high P2: Float value Software reboot occured. Can also be a systemd reboot. P1: Current Chip, P2: Current Copy mission/devices/PayloadPcduHandler.h bsp_q7s/core/CoreController.h
182 12703 13602 0x319f 0x3522 I_DRO_OUT_OF_BOUNDS REBOOT_MECHANISM_TRIGGERED MEDIUM MEDIUM P1: 0 -> too low, 1 -> too high P2: Float value 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 mission/devices/PayloadPcduHandler.h bsp_q7s/core/CoreController.h

View File

@ -40,8 +40,10 @@
0x44330000;PLOC_UPDATER 0x44330000;PLOC_UPDATER
0x44330001;PLOC_MEMORY_DUMPER 0x44330001;PLOC_MEMORY_DUMPER
0x44330002;STR_HELPER 0x44330002;STR_HELPER
0x44330003;PLOC_MPSOC_HELPER
0x44330015;PLOC_MPSOC_HANDLER 0x44330015;PLOC_MPSOC_HANDLER
0x44330016;PLOC_SUPERVISOR_HANDLER 0x44330016;PLOC_SUPERVISOR_HANDLER
0x44330017;PLOC_SUPERVISOR_HELPER
0x444100A2;SOLAR_ARRAY_DEPL_HANDLER 0x444100A2;SOLAR_ARRAY_DEPL_HANDLER
0x444100A4;HEATER_HANDLER 0x444100A4;HEATER_HANDLER
0x44420004;TMP1075_HANDLER_1 0x44420004;TMP1075_HANDLER_1

1 0x00005060 P60DOCK_TEST_TASK
40 0x44330000 PLOC_UPDATER
41 0x44330001 PLOC_MEMORY_DUMPER
42 0x44330002 STR_HELPER
43 0x44330003 PLOC_MPSOC_HELPER
44 0x44330003 0x44330015 PLOC_MPSOC_HELPER PLOC_MPSOC_HANDLER
45 0x44330004 0x44330016 AXI_PTME_CONFIG PLOC_SUPERVISOR_HANDLER
46 0x44330017 PLOC_SUPERVISOR_HELPER
47 0x44330005 0x444100A2 PTME_CONFIG SOLAR_ARRAY_DEPL_HANDLER
48 0x44330015 0x444100A4 PLOC_MPSOC_HANDLER HEATER_HANDLER
49 0x44330016 0x44420004 PLOC_SUPERVISOR_HANDLER TMP1075_HANDLER_1

View File

@ -1,12 +1,12 @@
0x0;OK;System-wide code for ok.;RETURN_OK;HasReturnvaluesIF.h;HasReturnvaluesIF 0x0;OK;System-wide code for ok.;RETURN_OK;HasReturnvaluesIF.h;HasReturnvaluesIF
0x1;Failed;Unspecified system-wide code for failed.;RETURN_FAILED;HasReturnvaluesIF.h;HasReturnvaluesIF 0x1;Failed;Unspecified system-wide code for failed.;RETURN_FAILED;HasReturnvaluesIF.h;HasReturnvaluesIF
0x61a0;CCSDS_CommandNotImplemented;Received action message with unknown action id;0xA0;mission/tmtc/CCSDSHandler.h;CCSDS_HANDLER 0x62a0;CCSDS_CommandNotImplemented;Received action message with unknown action id;0xA0;mission/tmtc/CCSDSHandler.h;CCSDS_HANDLER
0x5e00;GOMS_PacketTooLong;;0;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER 0x5f00;GOMS_PacketTooLong;;0;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER
0x5e01;GOMS_InvalidTableId;;1;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER 0x5f01;GOMS_InvalidTableId;;1;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER
0x5e02;GOMS_InvalidAddress;;2;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER 0x5f02;GOMS_InvalidAddress;;2;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER
0x5e03;GOMS_InvalidParamSize;;3;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER 0x5f03;GOMS_InvalidParamSize;;3;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER
0x5e04;GOMS_InvalidPayloadSize;;4;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER 0x5f04;GOMS_InvalidPayloadSize;;4;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER
0x5e05;GOMS_UnknownReplyId;;5;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER 0x5f05;GOMS_UnknownReplyId;;5;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER
0x55b0;RWHA_SpiWriteFailure;;0xB0;mission/devices/RwHandler.h;RW_HANDLER 0x55b0;RWHA_SpiWriteFailure;;0xB0;mission/devices/RwHandler.h;RW_HANDLER
0x55b1;RWHA_SpiReadFailure;Used by the spi send function to tell a failing read call;0xB1;mission/devices/RwHandler.h;RW_HANDLER 0x55b1;RWHA_SpiReadFailure;Used by the spi send function to tell a failing read call;0xB1;mission/devices/RwHandler.h;RW_HANDLER
0x55b2;RWHA_MissingStartSign;Can be used by the HDLC decoding mechanism to inform about a missing start sign 0x7E;0xB2;mission/devices/RwHandler.h;RW_HANDLER 0x55b2;RWHA_MissingStartSign;Can be used by the HDLC decoding mechanism to inform about a missing start sign 0x7E;0xB2;mission/devices/RwHandler.h;RW_HANDLER
@ -24,8 +24,8 @@
0x52a3;HEATER_InvalidSwitchNr;;0xA3;mission/devices/HeaterHandler.h;HEATER_HANDLER 0x52a3;HEATER_InvalidSwitchNr;;0xA3;mission/devices/HeaterHandler.h;HEATER_HANDLER
0x52a4;HEATER_MainSwitchSetTimeout;;0xA4;mission/devices/HeaterHandler.h;HEATER_HANDLER 0x52a4;HEATER_MainSwitchSetTimeout;;0xA4;mission/devices/HeaterHandler.h;HEATER_HANDLER
0x52a5;HEATER_CommandAlreadyWaiting;;0xA5;mission/devices/HeaterHandler.h;HEATER_HANDLER 0x52a5;HEATER_CommandAlreadyWaiting;;0xA5;mission/devices/HeaterHandler.h;HEATER_HANDLER
0x59a0;SUSS_ErrorUnlockMutex;;0xA0;mission/devices/SusHandler.h;SUS_HANDLER 0x5aa0;SUSS_ErrorUnlockMutex;;0xA0;mission/devices/SusHandler.h;SUS_HANDLER
0x59a1;SUSS_ErrorLockMutex;;0xA1;mission/devices/SusHandler.h;SUS_HANDLER 0x5aa1;SUSS_ErrorLockMutex;;0xA1;mission/devices/SusHandler.h;SUS_HANDLER
0x54a0;IMTQ_InvalidCommandCode;;0xA0;mission/devices/IMTQHandler.h;IMTQ_HANDLER 0x54a0;IMTQ_InvalidCommandCode;;0xA0;mission/devices/IMTQHandler.h;IMTQ_HANDLER
0x54a1;IMTQ_ParameterMissing;;0xA1;mission/devices/IMTQHandler.h;IMTQ_HANDLER 0x54a1;IMTQ_ParameterMissing;;0xA1;mission/devices/IMTQHandler.h;IMTQ_HANDLER
0x54a2;IMTQ_ParameterInvalid;;0xA2;mission/devices/IMTQHandler.h;IMTQ_HANDLER 0x54a2;IMTQ_ParameterInvalid;;0xA2;mission/devices/IMTQHandler.h;IMTQ_HANDLER
@ -43,16 +43,12 @@
0x53a6;SYRLINKS_BadCrcAck;;0xA6;mission/devices/SyrlinksHkHandler.h;SYRLINKS_HANDLER 0x53a6;SYRLINKS_BadCrcAck;;0xA6;mission/devices/SyrlinksHkHandler.h;SYRLINKS_HANDLER
0x53a7;SYRLINKS_ReplyWrongSize;;0xA7;mission/devices/SyrlinksHkHandler.h;SYRLINKS_HANDLER 0x53a7;SYRLINKS_ReplyWrongSize;;0xA7;mission/devices/SyrlinksHkHandler.h;SYRLINKS_HANDLER
0x53a8;SYRLINKS_MissingStartFrameCharacter;;0xA8;mission/devices/SyrlinksHkHandler.h;SYRLINKS_HANDLER 0x53a8;SYRLINKS_MissingStartFrameCharacter;;0xA8;mission/devices/SyrlinksHkHandler.h;SYRLINKS_HANDLER
0x65a0;SADPL_CommandNotSupported;;0xA0;mission/devices/SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER 0x68a0;SADPL_CommandNotSupported;;0xA0;mission/devices/SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER
0x65a1;SADPL_DeploymentAlreadyExecuting;;0xA1;mission/devices/SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER 0x68a1;SADPL_DeploymentAlreadyExecuting;;0xA1;mission/devices/SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER
0x65a2;SADPL_MainSwitchTimeoutFailure;;0xA2;mission/devices/SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER 0x68a2;SADPL_MainSwitchTimeoutFailure;;0xA2;mission/devices/SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER
0x65a3;SADPL_SwitchingDeplSa1Failed;;0xA3;mission/devices/SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER 0x68a3;SADPL_SwitchingDeplSa1Failed;;0xA3;mission/devices/SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER
0x65a4;SADPL_SwitchingDeplSa2Failed;;0xA4;mission/devices/SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER 0x68a4;SADPL_SwitchingDeplSa2Failed;;0xA4;mission/devices/SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER
0x57a0;PLMP_CrcFailure;;0xA0;mission/devices/PlocMPSoCHandler.h;PLOC_MPSOC_HANDLER 0x65a0;NVMB_KeyNotExists;Specified key does not exist in json file;0xA0;mission/memory/NVMParameterBase.h;NVM_PARAM_BASE
0x57a1;PLMP_ReceivedAckFailure;;0xA1;mission/devices/PlocMPSoCHandler.h;PLOC_MPSOC_HANDLER
0x57a2;PLMP_ReceivedExeFailure;;0xA2;mission/devices/PlocMPSoCHandler.h;PLOC_MPSOC_HANDLER
0x57a3;PLMP_InvalidApid;;0xA3;mission/devices/PlocMPSoCHandler.h;PLOC_MPSOC_HANDLER
0x64a0;NVMB_KeyNotExists;Specified key does not exist in json file;0xA0;mission/memory/NVMParameterBase.h;NVM_PARAM_BASE
0x4300; HSPI_HalTimeoutRetval;;0;fsfw/hal/src/fsfw_hal/stm32h7/spi/spiDefinitions.h;HAL_SPI 0x4300; HSPI_HalTimeoutRetval;;0;fsfw/hal/src/fsfw_hal/stm32h7/spi/spiDefinitions.h;HAL_SPI
0x4301; HSPI_HalBusyRetval;;1;fsfw/hal/src/fsfw_hal/stm32h7/spi/spiDefinitions.h;HAL_SPI 0x4301; HSPI_HalBusyRetval;;1;fsfw/hal/src/fsfw_hal/stm32h7/spi/spiDefinitions.h;HAL_SPI
0x4302; HSPI_HalErrorRetval;;2;fsfw/hal/src/fsfw_hal/stm32h7/spi/spiDefinitions.h;HAL_SPI 0x4302; HSPI_HalErrorRetval;;2;fsfw/hal/src/fsfw_hal/stm32h7/spi/spiDefinitions.h;HAL_SPI
@ -448,45 +444,47 @@
0x1401; SE_BufferTooShort;;1;fsfw/src/fsfw/serialize/SerializeIF.h;SERIALIZE_IF 0x1401; SE_BufferTooShort;;1;fsfw/src/fsfw/serialize/SerializeIF.h;SERIALIZE_IF
0x1402; SE_StreamTooShort;;2;fsfw/src/fsfw/serialize/SerializeIF.h;SERIALIZE_IF 0x1402; SE_StreamTooShort;;2;fsfw/src/fsfw/serialize/SerializeIF.h;SERIALIZE_IF
0x1403; SE_TooManyElements;;3;fsfw/src/fsfw/serialize/SerializeIF.h;SERIALIZE_IF 0x1403; SE_TooManyElements;;3;fsfw/src/fsfw/serialize/SerializeIF.h;SERIALIZE_IF
0x58a0;PLSV_CrcFailure;Space Packet received from PLOC supervisor has invalid CRC;0xA0;bsp_q7s/devices/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER 0x66a0;FSHLP_SdNotMounted;SD card specified with path string not mounted;0xA0;bsp_q7s/memory/FilesystemHelper.h;FILE_SYSTEM_HELPER
0x58a1;PLSV_ReceivedAckFailure;Received ACK failure reply from PLOC supervisor;0xA1;bsp_q7s/devices/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER 0x66a1;FSHLP_FileNotExists;Specified file does not exist on filesystem;0xA1;bsp_q7s/memory/FilesystemHelper.h;FILE_SYSTEM_HELPER
0x58a2;PLSV_ReceivedExeFailure;Received execution failure reply from PLOC supervisor;0xA2;bsp_q7s/devices/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER 0x7000; SDMA_OpOngoing;;0;bsp_q7s/memory/SdCardManager.h;SD_CARD_MANAGER
0x58a3;PLSV_InvalidApid;Received space packet with invalid APID from PLOC supervisor;0xA3;bsp_q7s/devices/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER 0x7001; SDMA_AlreadyOn;;1;bsp_q7s/memory/SdCardManager.h;SD_CARD_MANAGER
0x58a4;PLSV_GetTimeFailure;Failed to read current system time;0xA4;bsp_q7s/devices/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER 0x7002; SDMA_AlreadyMounted;;2;bsp_q7s/memory/SdCardManager.h;SD_CARD_MANAGER
0x58a5;PLSV_InvalidUartComIf;Invalid communication interface specified;0xA5;bsp_q7s/devices/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER 0x7003; SDMA_AlreadyOff;;3;bsp_q7s/memory/SdCardManager.h;SD_CARD_MANAGER
0x58a6;PLSV_InvalidWatchdog;Received command with invalid watchdog parameter. Valid watchdogs are 0 for PS, 1 for PL and 2 for INT;0xA6;bsp_q7s/devices/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER 0x700a; SDMA_StatusFileNexists;;10;bsp_q7s/memory/SdCardManager.h;SD_CARD_MANAGER
0x58a7;PLSV_InvalidWatchdogTimeout;Received watchdog timeout config command with invalid timeout. Valid timeouts must be in the range between 1000 and 360000 ms.;0xA7;bsp_q7s/devices/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER 0x700b; SDMA_StatusFileFormatInvalid;;11;bsp_q7s/memory/SdCardManager.h;SD_CARD_MANAGER
0x58a8;PLSV_InvalidLatchupId;Received latchup config command with invalid latchup ID;0xA8;bsp_q7s/devices/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER 0x700c; SDMA_MountError;;12;bsp_q7s/memory/SdCardManager.h;SD_CARD_MANAGER
0x58a9;PLSV_SweepPeriodTooSmall;Received set adc sweep period command with invalid sweep period. Must be larger than 21.;0xA9;bsp_q7s/devices/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER 0x700d; SDMA_UnmountError;;13;bsp_q7s/memory/SdCardManager.h;SD_CARD_MANAGER
0x58aa;PLSV_InvalidTestParam;Receive auto EM test command with invalid test param. Valid params are 1 and 2.;0xAA;bsp_q7s/devices/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER 0x700e; SDMA_SystemCallError;;14;bsp_q7s/memory/SdCardManager.h;SD_CARD_MANAGER
0x58ab;PLSV_MramPacketParsingFailure;Returned when scanning for MRAM dump packets failed.;0xAB;bsp_q7s/devices/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER 0x700f; SDMA_PopenCallError;;15;bsp_q7s/memory/SdCardManager.h;SD_CARD_MANAGER
0x58ac;PLSV_InvalidMramAddresses;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);0xAC;bsp_q7s/devices/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER 0x7100; SCBU_KeyNotFound;;0;bsp_q7s/memory/scratchApi.h;SCRATCH_BUFFER
0x58ad;PLSV_NoMramPacket;Expect reception of an MRAM dump packet but received space packet with other apid.;0xAD;bsp_q7s/devices/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER 0x59a0;PLSV_CrcFailure;Space Packet received from PLOC supervisor has invalid CRC;0xA0;linux/devices/ploc/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER
0x58ae;PLSV_PathDoesNotExist;Path to PLOC directory on SD card does not exist;0xAE;bsp_q7s/devices/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER 0x59a1;PLSV_ReceivedAckFailure;Received ACK failure reply from PLOC supervisor;0xA1;linux/devices/ploc/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER
0x58af;PLSV_MramFileNotExists;MRAM dump file does not exists. The file should actually already have been created with the reception of the first dump packet.;0xAF;bsp_q7s/devices/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER 0x59a2;PLSV_ReceivedExeFailure;Received execution failure reply from PLOC supervisor;0xA2;linux/devices/ploc/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER
0x5fa0;PLMEMDUMP_MramAddressTooHigh;The capacity of the MRAM amounts to 512 kB. Thus the maximum address must not be higher than 0x7d000.;0xA0;bsp_q7s/devices/PlocMemoryDumper.h;PLOC_MEMORY_DUMPER 0x59a3;PLSV_InvalidApid;Received space packet with invalid APID from PLOC supervisor;0xA3;linux/devices/ploc/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER
0x5fa1;PLMEMDUMP_MramInvalidAddressCombination;The specified end address is lower than the start address;0xA1;bsp_q7s/devices/PlocMemoryDumper.h;PLOC_MEMORY_DUMPER 0x59a4;PLSV_GetTimeFailure;Failed to read current system time;0xA4;linux/devices/ploc/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER
0x5ca0;PLUD_UpdaterBusy;Updater is already performing an update;0xA0;bsp_q7s/devices/PlocUpdater.h;PLOC_UPDATER 0x59a5;PLSV_InvalidWatchdog;Received command with invalid watchdog parameter. Valid watchdogs are 0 for PS, 1 for PL and 2 for INT;0xA5;linux/devices/ploc/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER
0x5ca1;PLUD_NameTooLong;Received update command with invalid path string (too long).;0xA1;bsp_q7s/devices/PlocUpdater.h;PLOC_UPDATER 0x59a6;PLSV_InvalidWatchdogTimeout;Received watchdog timeout config command with invalid timeout. Valid timeouts must be in the range between 1000 and 360000 ms.;0xA6;linux/devices/ploc/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER
0x5ca2;PLUD_SdNotMounted;Received command to initiate update but SD card with update image not mounted.;0xA2;bsp_q7s/devices/PlocUpdater.h;PLOC_UPDATER 0x59a7;PLSV_InvalidLatchupId;Received latchup config command with invalid latchup ID;0xA7;linux/devices/ploc/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER
0x5ca3;PLUD_FileNotExists;Update file received with update command does not exist.;0xA3;bsp_q7s/devices/PlocUpdater.h;PLOC_UPDATER 0x59a8;PLSV_SweepPeriodTooSmall;Received set adc sweep period command with invalid sweep period. Must be larger than 21.;0xA8;linux/devices/ploc/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER
0x6c00; SDMA_OpOngoing;;0;bsp_q7s/memory/SdCardManager.h;SD_CARD_MANAGER 0x59a9;PLSV_InvalidTestParam;Receive auto EM test command with invalid test param. Valid params are 1 and 2.;0xA9;linux/devices/ploc/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER
0x6c01; SDMA_AlreadyOn;;1;bsp_q7s/memory/SdCardManager.h;SD_CARD_MANAGER 0x59aa;PLSV_MramPacketParsingFailure;Returned when scanning for MRAM dump packets failed.;0xAA;linux/devices/ploc/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER
0x6c02; SDMA_AlreadyMounted;;2;bsp_q7s/memory/SdCardManager.h;SD_CARD_MANAGER 0x59ab;PLSV_InvalidMramAddresses;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);0xAB;linux/devices/ploc/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER
0x6c03; SDMA_AlreadyOff;;3;bsp_q7s/memory/SdCardManager.h;SD_CARD_MANAGER 0x59ac;PLSV_NoMramPacket;Expect reception of an MRAM dump packet but received space packet with other apid.;0xAC;linux/devices/ploc/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER
0x6c0a; SDMA_StatusFileNexists;;10;bsp_q7s/memory/SdCardManager.h;SD_CARD_MANAGER 0x59ad;PLSV_PathDoesNotExist;Path to PLOC directory on SD card does not exist;0xAD;linux/devices/ploc/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER
0x6c0b; SDMA_StatusFileFormatInvalid;;11;bsp_q7s/memory/SdCardManager.h;SD_CARD_MANAGER 0x59ae;PLSV_MramFileNotExists;MRAM dump file does not exists. The file should actually already have been created with the reception of the first dump packet.;0xAE;linux/devices/ploc/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER
0x6c0c; SDMA_MountError;;12;bsp_q7s/memory/SdCardManager.h;SD_CARD_MANAGER 0x67a0; PLMPHLP_FileClosedAccidentally;File accidentally close;0xA0;linux/devices/ploc/PlocMPSoCHelper.h;PLOC_MPSOC_HELPER
0x6c0d; SDMA_UnmountError;;13;bsp_q7s/memory/SdCardManager.h;SD_CARD_MANAGER 0x60a0;PLMEMDUMP_MramAddressTooHigh;The capacity of the MRAM amounts to 512 kB. Thus the maximum address must not be higher than 0x7d000.;0xA0;linux/devices/ploc/PlocMemoryDumper.h;PLOC_MEMORY_DUMPER
0x6c0e; SDMA_SystemCallError;;14;bsp_q7s/memory/SdCardManager.h;SD_CARD_MANAGER 0x60a1;PLMEMDUMP_MramInvalidAddressCombination;The specified end address is lower than the start address;0xA1;linux/devices/ploc/PlocMemoryDumper.h;PLOC_MEMORY_DUMPER
0x6c0f; SDMA_PopenCallError;;15;bsp_q7s/memory/SdCardManager.h;SD_CARD_MANAGER 0x5da0;PLUD_UpdaterBusy;Updater is already performing an update;0xA0;linux/devices/ploc/PlocUpdater.h;PLOC_UPDATER
0x6d00; SCBU_KeyNotFound;;0;bsp_q7s/memory/scratchApi.h;SCRATCH_BUFFER 0x5da1;PLUD_NameTooLong;Received update command with invalid path string (too long).;0xA1;linux/devices/ploc/PlocUpdater.h;PLOC_UPDATER
0x5da2;PLUD_SdNotMounted;Received command to initiate update but SD card with update image not mounted.;0xA2;linux/devices/ploc/PlocUpdater.h;PLOC_UPDATER
0x5da3;PLUD_FileNotExists;Update file received with update command does not exist.;0xA3;linux/devices/ploc/PlocUpdater.h;PLOC_UPDATER
0x56a0;STRH_TemperatureReqFailed;Status in temperature reply signals error;0xA0;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER 0x56a0;STRH_TemperatureReqFailed;Status in temperature reply signals error;0xA0;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER
0x56a1;STRH_PingFailed;Ping command failed;0xA1;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER 0x56a1;STRH_PingFailed;Ping command failed;0xA1;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER
0x56a2;STRH_VersionReqFailed;Status in version reply signals error;0xA2;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER 0x56a2;STRH_VersionReqFailed;Status in version reply signals error;0xA2;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER
0x6301;JSONBASE_JsonFileNotExists;Specified json file does not exist;1;linux/devices/startracker/ArcsecJsonParamBase.h;ARCSEC_JSON_BASE 0x6401;JSONBASE_JsonFileNotExists;Specified json file does not exist;1;linux/devices/startracker/ArcsecJsonParamBase.h;ARCSEC_JSON_BASE
0x6302;JSONBASE_SetNotExists;Requested set does not exist in json file;2;linux/devices/startracker/ArcsecJsonParamBase.h;ARCSEC_JSON_BASE 0x6402;JSONBASE_SetNotExists;Requested set does not exist in json file;2;linux/devices/startracker/ArcsecJsonParamBase.h;ARCSEC_JSON_BASE
0x6303;JSONBASE_ParamNotExists;Requested parameter does not exist in json file;3;linux/devices/startracker/ArcsecJsonParamBase.h;ARCSEC_JSON_BASE 0x6403;JSONBASE_ParamNotExists;Requested parameter does not exist in json file;3;linux/devices/startracker/ArcsecJsonParamBase.h;ARCSEC_JSON_BASE
0x56a3;STRH_InterfaceReqFailed;Status in interface reply signals error;0xA3;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER 0x56a3;STRH_InterfaceReqFailed;Status in interface reply signals error;0xA3;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER
0x56a4;STRH_PowerReqFailed;Status in power reply signals error;0xA4;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER 0x56a4;STRH_PowerReqFailed;Status in power reply signals error;0xA4;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER
0x56a5;STRH_SetParamFailed;Status of reply to parameter set command signals error;0xA5;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER 0x56a5;STRH_SetParamFailed;Status of reply to parameter set command signals error;0xA5;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER
@ -509,33 +507,45 @@
0x56b6;STRH_StartrackerAlreadyBooted;Star tracker is already in firmware mode;0xB6;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER 0x56b6;STRH_StartrackerAlreadyBooted;Star tracker is already in firmware mode;0xB6;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER
0x56b7;STRH_StartrackerRunningFirmware;Star tracker is in firmware mode but must be in bootloader mode to execute this command;0xB7;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER 0x56b7;STRH_StartrackerRunningFirmware;Star tracker is in firmware mode but must be in bootloader mode to execute this command;0xB7;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER
0x56b8;STRH_StartrackerRunningBootloader;Star tracker is in bootloader mode but must be in firmware mode to execute this command;0xB8;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER 0x56b8;STRH_StartrackerRunningBootloader;Star tracker is in bootloader mode but must be in firmware mode to execute this command;0xB8;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER
0x5da0;STRHLP_SdNotMounted;SD card specified in path string not mounted;0xA0;linux/devices/startracker/StrHelper.h;STR_HELPER 0x5ea0;STRHLP_SdNotMounted;SD card specified in path string not mounted;0xA0;linux/devices/startracker/StrHelper.h;STR_HELPER
0x5da1;STRHLP_FileNotExists;Specified file does not exist on filesystem;0xA1;linux/devices/startracker/StrHelper.h;STR_HELPER 0x5ea1;STRHLP_FileNotExists;Specified file does not exist on filesystem;0xA1;linux/devices/startracker/StrHelper.h;STR_HELPER
0x5da2;STRHLP_PathNotExists;Specified path does not exist;0xA2;linux/devices/startracker/StrHelper.h;STR_HELPER 0x5ea2;STRHLP_PathNotExists;Specified path does not exist;0xA2;linux/devices/startracker/StrHelper.h;STR_HELPER
0x5da3;STRHLP_FileCreationFailed;Failed to create download image or read flash file;0xA3;linux/devices/startracker/StrHelper.h;STR_HELPER 0x5ea3;STRHLP_FileCreationFailed;Failed to create download image or read flash file;0xA3;linux/devices/startracker/StrHelper.h;STR_HELPER
0x5da4;STRHLP_RegionMismatch;Region in flash write/read reply does not match expected region;0xA4;linux/devices/startracker/StrHelper.h;STR_HELPER 0x5ea4;STRHLP_RegionMismatch;Region in flash write/read reply does not match expected region;0xA4;linux/devices/startracker/StrHelper.h;STR_HELPER
0x5da5;STRHLP_AddressMismatch;Address in flash write/read reply does not match expected address;0xA5;linux/devices/startracker/StrHelper.h;STR_HELPER 0x5ea5;STRHLP_AddressMismatch;Address in flash write/read reply does not match expected address;0xA5;linux/devices/startracker/StrHelper.h;STR_HELPER
0x5da6;STRHLP_LengthMismatch;Length in flash write/read reply does not match expected length;0xA6;linux/devices/startracker/StrHelper.h;STR_HELPER 0x5ea6;STRHLP_LengthMismatch;Length in flash write/read reply does not match expected length;0xA6;linux/devices/startracker/StrHelper.h;STR_HELPER
0x5da7;STRHLP_StatusError;Status field in reply signals error;0xA7;linux/devices/startracker/StrHelper.h;STR_HELPER 0x5ea7;STRHLP_StatusError;Status field in reply signals error;0xA7;linux/devices/startracker/StrHelper.h;STR_HELPER
0x5da8;STRHLP_InvalidTypeId;Reply has invalid type ID (should be of action reply type);0xA8;linux/devices/startracker/StrHelper.h;STR_HELPER 0x5ea8;STRHLP_InvalidTypeId;Reply has invalid type ID (should be of action reply type);0xA8;linux/devices/startracker/StrHelper.h;STR_HELPER
0x5aa0;IPCI_PapbBusy;;0xA0;linux/obc/PapbVcInterface.h;CCSDS_IP_CORE_BRIDGE 0x69a0;MPSOCRTVIF_CrcFailure;Space Packet received from PLOC has invalid CRC;0xA0;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF
0x5ba0;PTME_UnknownVcId;;0xA0;linux/obc/Ptme.h;PTME 0x69a1;MPSOCRTVIF_ReceivedAckFailure;Received ACK failure reply from PLOC;0xA1;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF
0x60a0;PDEC_AbandonedCltu;;0xA0;linux/obc/PdecHandler.h;PDEC_HANDLER 0x69a2;MPSOCRTVIF_ReceivedExeFailure;Received execution failure reply from PLOC;0xA2;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF
0x60a1;PDEC_FrameDirty;;0xA1;linux/obc/PdecHandler.h;PDEC_HANDLER 0x69a3;MPSOCRTVIF_InvalidApid;Received space packet with invalid APID from PLOC;0xA3;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF
0x60a2;PDEC_FrameIllegalMultipleReasons;;0xA2;linux/obc/PdecHandler.h;PDEC_HANDLER 0x69a4;MPSOCRTVIF_InvalidLength;Received command with invalid length;0xA4;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF
0x60a3;PDEC_AdDiscardedLockout;;0xA3;linux/obc/PdecHandler.h;PDEC_HANDLER 0x69a5;MPSOCRTVIF_FilenameTooLong;Filename of file in OBC filesystem is too long;0xA5;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF
0x60a4;PDEC_AdDiscardedWait;;0xA4;linux/obc/PdecHandler.h;PDEC_HANDLER 0x69a6;MPSOCRTVIF_MpsocHelperExecuting;MPSoC helper is currently executing a command;0xA6;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF
0x60a5;PDEC_AdDiscardedNsVs;;0xA5;linux/obc/PdecHandler.h;PDEC_HANDLER 0x69a7;MPSOCRTVIF_MpsocFilenameTooLong;Filename of MPSoC file is to long (max. 256 bytes);0xA7;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF
0x60b0;PDEC_CommandNotImplemented;Received action message with unknown action id;0xB0;linux/obc/PdecHandler.h;PDEC_HANDLER 0x69a8;MPSOCRTVIF_InvalidParameter;Command has invalid parameter;0xA8;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF
0x60a6;PDEC_NoReport;;0xA6;linux/obc/PdecHandler.h;PDEC_HANDLER 0x69a9;MPSOCRTVIF_NameTooLong;Received command has file string with invalid length;0xA9;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF
0x60a7;PDEC_ErrorVersionNumber;;0xA7;linux/obc/PdecHandler.h;PDEC_HANDLER 0x57e0;DWLPWRON_InvalidMode;Received command has invalid JESD mode (valid modes are 0 - 5);0xE0;linux/devices/devicedefinitions/PlocMPSoCDefinitions.h;DWLPWRON_CMD
0x60a8;PDEC_IllegalCombination;;0xA8;linux/obc/PdecHandler.h;PDEC_HANDLER 0x57e1;DWLPWRON_InvalidLaneRate;Received command has invalid lane rate (valid lane rate are 0 - 9);0xE1;linux/devices/devicedefinitions/PlocMPSoCDefinitions.h;DWLPWRON_CMD
0x60a9;PDEC_InvalidScId;;0xA9;linux/obc/PdecHandler.h;PDEC_HANDLER 0x5ba0;IPCI_PapbBusy;;0xA0;linux/obc/PapbVcInterface.h;CCSDS_IP_CORE_BRIDGE
0x60aa;PDEC_InvalidVcIdMsb;;0xAA;linux/obc/PdecHandler.h;PDEC_HANDLER 0x5ca0;PTME_UnknownVcId;;0xA0;linux/obc/Ptme.h;PTME
0x60ab;PDEC_InvalidVcIdLsb;;0xAB;linux/obc/PdecHandler.h;PDEC_HANDLER 0x61a0;PDEC_AbandonedCltu;;0xA0;linux/obc/PdecHandler.h;PDEC_HANDLER
0x60ac;PDEC_NsNotZero;;0xAC;linux/obc/PdecHandler.h;PDEC_HANDLER 0x61a1;PDEC_FrameDirty;;0xA1;linux/obc/PdecHandler.h;PDEC_HANDLER
0x60ae;PDEC_InvalidBcCc;;0xAE;linux/obc/PdecHandler.h;PDEC_HANDLER 0x61a2;PDEC_FrameIllegalMultipleReasons;;0xA2;linux/obc/PdecHandler.h;PDEC_HANDLER
0x62a0;RS_RateNotSupported;The commanded rate is not supported by the current FPGA design;0xA0;linux/obc/PtmeConfig.h;RATE_SETTER 0x61a3;PDEC_AdDiscardedLockout;;0xA3;linux/obc/PdecHandler.h;PDEC_HANDLER
0x62a1;RS_BadBitRate;Bad bitrate has been commanded (e.g. 0);0xA1;linux/obc/PtmeConfig.h;RATE_SETTER 0x61a4;PDEC_AdDiscardedWait;;0xA4;linux/obc/PdecHandler.h;PDEC_HANDLER
0x62a2;RS_ClkInversionFailed;Failed to invert clock and thus change the time the data is updated with respect to the tx clock;0xA2;linux/obc/PtmeConfig.h;RATE_SETTER 0x61a5;PDEC_AdDiscardedNsVs;;0xA5;linux/obc/PdecHandler.h;PDEC_HANDLER
0x62a3;RS_TxManipulatorConfigFailed;Failed to change configuration bit of tx clock manipulator;0xA3;linux/obc/PtmeConfig.h;RATE_SETTER 0x61b0;PDEC_CommandNotImplemented;Received action message with unknown action id;0xB0;linux/obc/PdecHandler.h;PDEC_HANDLER
0x61a6;PDEC_NoReport;;0xA6;linux/obc/PdecHandler.h;PDEC_HANDLER
0x61a7;PDEC_ErrorVersionNumber;;0xA7;linux/obc/PdecHandler.h;PDEC_HANDLER
0x61a8;PDEC_IllegalCombination;;0xA8;linux/obc/PdecHandler.h;PDEC_HANDLER
0x61a9;PDEC_InvalidScId;;0xA9;linux/obc/PdecHandler.h;PDEC_HANDLER
0x61aa;PDEC_InvalidVcIdMsb;;0xAA;linux/obc/PdecHandler.h;PDEC_HANDLER
0x61ab;PDEC_InvalidVcIdLsb;;0xAB;linux/obc/PdecHandler.h;PDEC_HANDLER
0x61ac;PDEC_NsNotZero;;0xAC;linux/obc/PdecHandler.h;PDEC_HANDLER
0x61ae;PDEC_InvalidBcCc;;0xAE;linux/obc/PdecHandler.h;PDEC_HANDLER
0x63a0;RS_RateNotSupported;The commanded rate is not supported by the current FPGA design;0xA0;linux/obc/PtmeConfig.h;RATE_SETTER
0x63a1;RS_BadBitRate;Bad bitrate has been commanded (e.g. 0);0xA1;linux/obc/PtmeConfig.h;RATE_SETTER
0x63a2;RS_ClkInversionFailed;Failed to invert clock and thus change the time the data is updated with respect to the tx clock;0xA2;linux/obc/PtmeConfig.h;RATE_SETTER
0x63a3;RS_TxManipulatorConfigFailed;Failed to change configuration bit of tx clock manipulator;0xA3;linux/obc/PtmeConfig.h;RATE_SETTER

Can't render this file because it has a wrong number of fields in line 17.

View File

@ -1,7 +1,7 @@
/** /**
* @brief Auto-generated event translation file. Contains 168 translations. * @brief Auto-generated event translation file. Contains 183 translations.
* @details * @details
* Generated on: 2022-03-22 20:43:04 * Generated on: 2022-04-08 11:21:58
*/ */
#include "translateEvents.h" #include "translateEvents.h"
@ -100,7 +100,9 @@ const char *DEPL_SA2_GPIO_SWTICH_ON_FAILED_STRING = "DEPL_SA2_GPIO_SWTICH_ON_FAI
const char *MEMORY_READ_RPT_CRC_FAILURE_STRING = "MEMORY_READ_RPT_CRC_FAILURE"; 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 *CRC_FAILURE_EVENT_STRING = "CRC_FAILURE_EVENT"; 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_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";
const char *SELF_TEST_ADC_FAILURE_STRING = "SELF_TEST_ADC_FAILURE"; const char *SELF_TEST_ADC_FAILURE_STRING = "SELF_TEST_ADC_FAILURE";
@ -148,6 +150,18 @@ const char *POSITION_MISMATCH_STRING = "POSITION_MISMATCH";
const char *STR_HELPER_FILE_NOT_EXISTS_STRING = "STR_HELPER_FILE_NOT_EXISTS"; const char *STR_HELPER_FILE_NOT_EXISTS_STRING = "STR_HELPER_FILE_NOT_EXISTS";
const char *STR_HELPER_SENDING_PACKET_FAILED_STRING = "STR_HELPER_SENDING_PACKET_FAILED"; const char *STR_HELPER_SENDING_PACKET_FAILED_STRING = "STR_HELPER_SENDING_PACKET_FAILED";
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_SUCCESSFUL_STRING = "MPSOC_FLASH_WRITE_SUCCESSFUL";
const char *SENDING_COMMAND_FAILED_STRING = "SENDING_COMMAND_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 *MISSING_ACK_STRING = "MISSING_ACK";
const char *MISSING_EXE_STRING = "MISSING_EXE";
const char *ACK_FAILURE_REPORT_STRING = "ACK_FAILURE_REPORT";
const char *EXE_FAILURE_REPORT_STRING = "EXE_FAILURE_REPORT";
const char *ACK_INVALID_APID_STRING = "ACK_INVALID_APID";
const char *EXE_INVALID_APID_STRING = "EXE_INVALID_APID";
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";
const char *U_DRO_OUT_OF_BOUNDS_STRING = "U_DRO_OUT_OF_BOUNDS"; const char *U_DRO_OUT_OF_BOUNDS_STRING = "U_DRO_OUT_OF_BOUNDS";
@ -165,6 +179,7 @@ const char *NOT_ENOUGH_DEVICES_DUAL_MODE_STRING = "NOT_ENOUGH_DEVICES_DUAL_MODE"
const char *POWER_STATE_MACHINE_TIMEOUT_STRING = "POWER_STATE_MACHINE_TIMEOUT"; const char *POWER_STATE_MACHINE_TIMEOUT_STRING = "POWER_STATE_MACHINE_TIMEOUT";
const char *SIDE_SWITCH_TRANSITION_NOT_ALLOWED_STRING = "SIDE_SWITCH_TRANSITION_NOT_ALLOWED"; const char *SIDE_SWITCH_TRANSITION_NOT_ALLOWED_STRING = "SIDE_SWITCH_TRANSITION_NOT_ALLOWED";
const char *CHILDREN_LOST_MODE_STRING = "CHILDREN_LOST_MODE"; const char *CHILDREN_LOST_MODE_STRING = "CHILDREN_LOST_MODE";
const char *GPS_FIX_CHANGE_STRING = "GPS_FIX_CHANGE";
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";
@ -330,168 +345,198 @@ const char *translateEvents(Event event) {
return TEST_STRING; return TEST_STRING;
case (10600): case (10600):
return CHANGE_OF_SETUP_PARAMETER_STRING; return CHANGE_OF_SETUP_PARAMETER_STRING;
case (10800): case (11300):
return SWITCH_CMD_SENT_STRING; return SWITCH_CMD_SENT_STRING;
case (10801):
return SWITCH_HAS_CHANGED_STRING;
case (10802):
return SWITCHING_Q7S_DENIED_STRING;
case (10900):
return GPIO_PULL_HIGH_FAILED_STRING;
case (10901):
return GPIO_PULL_LOW_FAILED_STRING;
case (10902):
return SWITCH_ALREADY_ON_STRING;
case (10903):
return SWITCH_ALREADY_OFF_STRING;
case (10904):
return MAIN_SWITCH_TIMEOUT_STRING;
case (11000):
return MAIN_SWITCH_ON_TIMEOUT_STRING;
case (11001):
return MAIN_SWITCH_OFF_TIMEOUT_STRING;
case (11002):
return DEPLOYMENT_FAILED_STRING;
case (11003):
return DEPL_SA1_GPIO_SWTICH_ON_FAILED_STRING;
case (11004):
return DEPL_SA2_GPIO_SWTICH_ON_FAILED_STRING;
case (11101):
return MEMORY_READ_RPT_CRC_FAILURE_STRING;
case (11102):
return ACK_FAILURE_STRING;
case (11103):
return EXE_FAILURE_STRING;
case (11104):
return CRC_FAILURE_EVENT_STRING;
case (11201):
return SELF_TEST_I2C_FAILURE_STRING;
case (11202):
return SELF_TEST_SPI_FAILURE_STRING;
case (11203):
return SELF_TEST_ADC_FAILURE_STRING;
case (11204):
return SELF_TEST_PWM_FAILURE_STRING;
case (11205):
return SELF_TEST_TC_FAILURE_STRING;
case (11206):
return SELF_TEST_MTM_RANGE_FAILURE_STRING;
case (11207):
return SELF_TEST_COIL_CURRENT_FAILURE_STRING;
case (11208):
return INVALID_ERROR_BYTE_STRING;
case (11301): case (11301):
return ERROR_STATE_STRING; return SWITCH_HAS_CHANGED_STRING;
case (11302):
return SWITCHING_Q7S_DENIED_STRING;
case (11400):
return GPIO_PULL_HIGH_FAILED_STRING;
case (11401): case (11401):
return BOOTING_FIRMWARE_FAILED_STRING; return GPIO_PULL_LOW_FAILED_STRING;
case (11402): case (11402):
return BOOTING_BOOTLOADER_FAILED_STRING; return SWITCH_ALREADY_ON_STRING;
case (11403):
return SWITCH_ALREADY_OFF_STRING;
case (11404):
return MAIN_SWITCH_TIMEOUT_STRING;
case (11500):
return MAIN_SWITCH_ON_TIMEOUT_STRING;
case (11501): case (11501):
return SUPV_MEMORY_READ_RPT_CRC_FAILURE_STRING; return MAIN_SWITCH_OFF_TIMEOUT_STRING;
case (11502): case (11502):
return SUPV_ACK_FAILURE_STRING; return DEPLOYMENT_FAILED_STRING;
case (11503): case (11503):
return SUPV_EXE_FAILURE_STRING; return DEPL_SA1_GPIO_SWTICH_ON_FAILED_STRING;
case (11504): case (11504):
return SUPV_CRC_FAILURE_EVENT_STRING; return DEPL_SA2_GPIO_SWTICH_ON_FAILED_STRING;
case (11600):
return SANITIZATION_FAILED_STRING;
case (11601): case (11601):
return MOUNTED_SD_CARD_STRING; return MEMORY_READ_RPT_CRC_FAILURE_STRING;
case (11700): case (11602):
return UPDATE_FILE_NOT_EXISTS_STRING; return ACK_FAILURE_STRING;
case (11603):
return EXE_FAILURE_STRING;
case (11604):
return MPSOC_HANDLER_CRC_FAILURE_STRING;
case (11605):
return MPSOC_HANDLER_SEQ_CNT_MISMATCH_STRING;
case (11606):
return MPSOC_SHUTDOWN_FAILED_STRING;
case (11701): case (11701):
return ACTION_COMMANDING_FAILED_STRING; return SELF_TEST_I2C_FAILURE_STRING;
case (11702): case (11702):
return UPDATE_AVAILABLE_FAILED_STRING; return SELF_TEST_SPI_FAILURE_STRING;
case (11703): case (11703):
return UPDATE_TRANSFER_FAILED_STRING; return SELF_TEST_ADC_FAILURE_STRING;
case (11704): case (11704):
return UPDATE_VERIFY_FAILED_STRING; return SELF_TEST_PWM_FAILURE_STRING;
case (11705): case (11705):
return UPDATE_FINISHED_STRING; return SELF_TEST_TC_FAILURE_STRING;
case (11800): case (11706):
return SEND_MRAM_DUMP_FAILED_STRING; return SELF_TEST_MTM_RANGE_FAILURE_STRING;
case (11707):
return SELF_TEST_COIL_CURRENT_FAILURE_STRING;
case (11708):
return INVALID_ERROR_BYTE_STRING;
case (11801): case (11801):
return MRAM_DUMP_FAILED_STRING; return ERROR_STATE_STRING;
case (11802):
return MRAM_DUMP_FINISHED_STRING;
case (11901): case (11901):
return INVALID_TC_FRAME_STRING; return BOOTING_FIRMWARE_FAILED_STRING;
case (11902): case (11902):
return INVALID_FAR_STRING; return BOOTING_BOOTLOADER_FAILED_STRING;
case (11903):
return CARRIER_LOCK_STRING;
case (11904):
return BIT_LOCK_PDEC_STRING;
case (12000):
return IMAGE_UPLOAD_FAILED_STRING;
case (12001): case (12001):
return IMAGE_DOWNLOAD_FAILED_STRING; return SUPV_MEMORY_READ_RPT_CRC_FAILURE_STRING;
case (12002): case (12002):
return IMAGE_UPLOAD_SUCCESSFUL_STRING; return SUPV_ACK_FAILURE_STRING;
case (12003): case (12003):
return IMAGE_DOWNLOAD_SUCCESSFUL_STRING; return SUPV_EXE_FAILURE_STRING;
case (12004): case (12004):
return FLASH_WRITE_SUCCESSFUL_STRING; return SUPV_CRC_FAILURE_EVENT_STRING;
case (12005):
return FLASH_READ_SUCCESSFUL_STRING;
case (12006):
return FLASH_READ_FAILED_STRING;
case (12007):
return FIRMWARE_UPDATE_SUCCESSFUL_STRING;
case (12008):
return FIRMWARE_UPDATE_FAILED_STRING;
case (12009):
return STR_HELPER_READING_REPLY_FAILED_STRING;
case (12010):
return STR_HELPER_COM_ERROR_STRING;
case (12011):
return STR_HELPER_NO_REPLY_STRING;
case (12012):
return STR_HELPER_DEC_ERROR_STRING;
case (12013):
return POSITION_MISMATCH_STRING;
case (12014):
return STR_HELPER_FILE_NOT_EXISTS_STRING;
case (12015):
return STR_HELPER_SENDING_PACKET_FAILED_STRING;
case (12016):
return STR_HELPER_REQUESTING_MSG_FAILED_STRING;
case (12100): case (12100):
return TRANSITION_BACK_TO_OFF_STRING; return SANITIZATION_FAILED_STRING;
case (12101): case (12101):
return NEG_V_OUT_OF_BOUNDS_STRING; return MOUNTED_SD_CARD_STRING;
case (12102):
return U_DRO_OUT_OF_BOUNDS_STRING;
case (12103):
return I_DRO_OUT_OF_BOUNDS_STRING;
case (12104):
return U_X8_OUT_OF_BOUNDS_STRING;
case (12105):
return I_X8_OUT_OF_BOUNDS_STRING;
case (12106):
return U_TX_OUT_OF_BOUNDS_STRING;
case (12107):
return I_TX_OUT_OF_BOUNDS_STRING;
case (12108):
return U_MPA_OUT_OF_BOUNDS_STRING;
case (12109):
return I_MPA_OUT_OF_BOUNDS_STRING;
case (12110):
return U_HPA_OUT_OF_BOUNDS_STRING;
case (12111):
return I_HPA_OUT_OF_BOUNDS_STRING;
case (12200): case (12200):
return TRANSITION_OTHER_SIDE_FAILED_STRING; return UPDATE_FILE_NOT_EXISTS_STRING;
case (12201): case (12201):
return NOT_ENOUGH_DEVICES_DUAL_MODE_STRING; return ACTION_COMMANDING_FAILED_STRING;
case (12202): case (12202):
return POWER_STATE_MACHINE_TIMEOUT_STRING; return UPDATE_AVAILABLE_FAILED_STRING;
case (12203): case (12203):
return UPDATE_TRANSFER_FAILED_STRING;
case (12204):
return UPDATE_VERIFY_FAILED_STRING;
case (12205):
return UPDATE_FINISHED_STRING;
case (12300):
return SEND_MRAM_DUMP_FAILED_STRING;
case (12301):
return MRAM_DUMP_FAILED_STRING;
case (12302):
return MRAM_DUMP_FINISHED_STRING;
case (12401):
return INVALID_TC_FRAME_STRING;
case (12402):
return INVALID_FAR_STRING;
case (12403):
return CARRIER_LOCK_STRING;
case (12404):
return BIT_LOCK_PDEC_STRING;
case (12500):
return IMAGE_UPLOAD_FAILED_STRING;
case (12501):
return IMAGE_DOWNLOAD_FAILED_STRING;
case (12502):
return IMAGE_UPLOAD_SUCCESSFUL_STRING;
case (12503):
return IMAGE_DOWNLOAD_SUCCESSFUL_STRING;
case (12504):
return FLASH_WRITE_SUCCESSFUL_STRING;
case (12505):
return FLASH_READ_SUCCESSFUL_STRING;
case (12506):
return FLASH_READ_FAILED_STRING;
case (12507):
return FIRMWARE_UPDATE_SUCCESSFUL_STRING;
case (12508):
return FIRMWARE_UPDATE_FAILED_STRING;
case (12509):
return STR_HELPER_READING_REPLY_FAILED_STRING;
case (12510):
return STR_HELPER_COM_ERROR_STRING;
case (12511):
return STR_HELPER_NO_REPLY_STRING;
case (12512):
return STR_HELPER_DEC_ERROR_STRING;
case (12513):
return POSITION_MISMATCH_STRING;
case (12514):
return STR_HELPER_FILE_NOT_EXISTS_STRING;
case (12515):
return STR_HELPER_SENDING_PACKET_FAILED_STRING;
case (12516):
return STR_HELPER_REQUESTING_MSG_FAILED_STRING;
case (12600):
return MPSOC_FLASH_WRITE_FAILED_STRING;
case (12601):
return MPSOC_FLASH_WRITE_SUCCESSFUL_STRING;
case (12602):
return SENDING_COMMAND_FAILED_STRING;
case (12603):
return MPSOC_HELPER_REQUESTING_REPLY_FAILED_STRING;
case (12604):
return MPSOC_HELPER_READING_REPLY_FAILED_STRING;
case (12605):
return MISSING_ACK_STRING;
case (12606):
return MISSING_EXE_STRING;
case (12607):
return ACK_FAILURE_REPORT_STRING;
case (12608):
return EXE_FAILURE_REPORT_STRING;
case (12609):
return ACK_INVALID_APID_STRING;
case (12610):
return EXE_INVALID_APID_STRING;
case (12611):
return MPSOC_HELPER_SEQ_CNT_MISMATCH_STRING;
case (12700):
return TRANSITION_BACK_TO_OFF_STRING;
case (12701):
return NEG_V_OUT_OF_BOUNDS_STRING;
case (12702):
return U_DRO_OUT_OF_BOUNDS_STRING;
case (12703):
return I_DRO_OUT_OF_BOUNDS_STRING;
case (12704):
return U_X8_OUT_OF_BOUNDS_STRING;
case (12705):
return I_X8_OUT_OF_BOUNDS_STRING;
case (12706):
return U_TX_OUT_OF_BOUNDS_STRING;
case (12707):
return I_TX_OUT_OF_BOUNDS_STRING;
case (12708):
return U_MPA_OUT_OF_BOUNDS_STRING;
case (12709):
return I_MPA_OUT_OF_BOUNDS_STRING;
case (12710):
return U_HPA_OUT_OF_BOUNDS_STRING;
case (12711):
return I_HPA_OUT_OF_BOUNDS_STRING;
case (12800):
return TRANSITION_OTHER_SIDE_FAILED_STRING;
case (12801):
return NOT_ENOUGH_DEVICES_DUAL_MODE_STRING;
case (12802):
return POWER_STATE_MACHINE_TIMEOUT_STRING;
case (12803):
return SIDE_SWITCH_TRANSITION_NOT_ALLOWED_STRING; return SIDE_SWITCH_TRANSITION_NOT_ALLOWED_STRING;
case (12400): case (13000):
return CHILDREN_LOST_MODE_STRING; return CHILDREN_LOST_MODE_STRING;
case (13100):
return GPS_FIX_CHANGE_STRING;
case (13600): case (13600):
return ALLOC_FAILURE_STRING; return ALLOC_FAILURE_STRING;
case (13601): case (13601):

@ -1 +1 @@
Subproject commit a3ea5dd2e7223c52e4f494e170850609b7b3a572 Subproject commit 5ad9fb94af3312d29863527106396395f7b808a5

View File

@ -1,8 +1,8 @@
/** /**
* @brief Auto-generated object translation file. * @brief Auto-generated object translation file.
* @details * @details
* Contains 115 translations. * Contains 117 translations.
* Generated on: 2022-03-22 20:43:04 * Generated on: 2022-04-08 11:21:58
*/ */
#include "translateObjects.h" #include "translateObjects.h"
@ -48,8 +48,10 @@ const char *RAD_SENSOR_STRING = "RAD_SENSOR";
const char *PLOC_UPDATER_STRING = "PLOC_UPDATER"; 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_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 *SOLAR_ARRAY_DEPL_HANDLER_STRING = "SOLAR_ARRAY_DEPL_HANDLER"; 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";
@ -208,10 +210,14 @@ const char *translateObject(object_id_t object) {
return PLOC_MEMORY_DUMPER_STRING; return PLOC_MEMORY_DUMPER_STRING;
case 0x44330002: case 0x44330002:
return STR_HELPER_STRING; return STR_HELPER_STRING;
case 0x44330003:
return PLOC_MPSOC_HELPER_STRING;
case 0x44330015: case 0x44330015:
return PLOC_MPSOC_HANDLER_STRING; return PLOC_MPSOC_HANDLER_STRING;
case 0x44330016: case 0x44330016:
return PLOC_SUPERVISOR_HANDLER_STRING; return PLOC_SUPERVISOR_HANDLER_STRING;
case 0x44330017:
return PLOC_SUPERVISOR_HELPER_STRING;
case 0x444100A2: case 0x444100A2:
return SOLAR_ARRAY_DEPL_HANDLER_STRING; return SOLAR_ARRAY_DEPL_HANDLER_STRING;
case 0x444100A4: case 0x444100A4:

View File

@ -1,6 +1,11 @@
add_subdirectory(csp) add_subdirectory(csp)
add_subdirectory(utility) add_subdirectory(utility)
add_subdirectory(callbacks)
add_subdirectory(boardtest) add_subdirectory(boardtest)
add_subdirectory(devices) add_subdirectory(devices)
add_subdirectory(fsfwconfig) add_subdirectory(fsfwconfig)
add_subdirectory(obc) add_subdirectory(obc)
target_sources(${OBSW_NAME} PUBLIC
ObjectFactory.cpp
)

286
linux/ObjectFactory.cpp Normal file
View File

@ -0,0 +1,286 @@
#include "ObjectFactory.h"
#include <fsfw/power/PowerSwitchIF.h>
#include <fsfw_hal/common/gpio/GpioCookie.h>
#include <fsfw_hal/common/gpio/GpioIF.h>
#include <fsfw_hal/common/gpio/gpioDefinitions.h>
#include <fsfw_hal/linux/spi/SpiComIF.h>
#include <fsfw_hal/linux/spi/SpiCookie.h>
#include <linux/callbacks/gpioCallbacks.h>
#include <mission/devices/Max31865PT1000Handler.h>
#include <mission/devices/SusHandler.h>
#include <mission/system/RtdFdir.h>
#include <mission/system/SusAssembly.h>
#include <mission/system/SusFdir.h>
#include <mission/system/TcsBoardAssembly.h>
#include "OBSWConfig.h"
#include "devConf.h"
#include "devices/addresses.h"
#include "devices/gpioIds.h"
void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiComIF,
PowerSwitchIF* pwrSwitcher, std::string spiDev) {
using namespace gpio;
GpioCookie* gpioCookieSus = new GpioCookie();
GpioCallback* susgpio = nullptr;
susgpio = new GpioCallback("Chip select SUS 0", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_0, susgpio);
susgpio = new GpioCallback("Chip select SUS 1", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_1, susgpio);
susgpio = new GpioCallback("Chip select SUS 2", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_2, susgpio);
susgpio = new GpioCallback("Chip select SUS 3", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_3, susgpio);
susgpio = new GpioCallback("Chip select SUS 4", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_4, susgpio);
susgpio = new GpioCallback("Chip select SUS 5", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_5, susgpio);
susgpio = new GpioCallback("Chip select SUS 6", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_6, susgpio);
susgpio = new GpioCallback("Chip select SUS 7", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_7, susgpio);
susgpio = new GpioCallback("Chip select SUS 8", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_8, susgpio);
susgpio = new GpioCallback("Chip select SUS 9", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_9, susgpio);
susgpio = new GpioCallback("Chip select SUS 10", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_10, susgpio);
susgpio = new GpioCallback("Chip select SUS 11", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_11, susgpio);
gpioComIF->addGpios(gpioCookieSus);
#if OBSW_ADD_SUN_SENSORS == 1
SusFdir* fdir = nullptr;
std::array<SusHandler*, 12> susHandlers = {};
SpiCookie* spiCookie =
new SpiCookie(addresses::SUS_0, gpioIds::CS_SUS_0, spiDev, SUS::MAX_CMD_SIZE,
spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
susHandlers[0] = new SusHandler(objects::SUS_0, 0, objects::SPI_COM_IF, spiCookie);
fdir = new SusFdir(objects::SUS_0);
susHandlers[0]->setParent(objects::SUS_BOARD_ASS);
susHandlers[0]->setCustomFdir(fdir);
spiCookie = new SpiCookie(addresses::SUS_1, gpioIds::CS_SUS_1, spiDev, SUS::MAX_CMD_SIZE,
spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
susHandlers[1] = new SusHandler(objects::SUS_1, 1, objects::SPI_COM_IF, spiCookie);
fdir = new SusFdir(objects::SUS_1);
susHandlers[1]->setParent(objects::SUS_BOARD_ASS);
susHandlers[1]->setCustomFdir(fdir);
spiCookie = new SpiCookie(addresses::SUS_2, gpioIds::CS_SUS_2, spiDev, SUS::MAX_CMD_SIZE,
spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
susHandlers[2] = new SusHandler(objects::SUS_2, 2, objects::SPI_COM_IF, spiCookie);
fdir = new SusFdir(objects::SUS_2);
susHandlers[2]->setParent(objects::SUS_BOARD_ASS);
susHandlers[2]->setCustomFdir(fdir);
spiCookie = new SpiCookie(addresses::SUS_3, gpioIds::CS_SUS_3, spiDev, SUS::MAX_CMD_SIZE,
spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
susHandlers[3] = new SusHandler(objects::SUS_3, 3, objects::SPI_COM_IF, spiCookie);
fdir = new SusFdir(objects::SUS_3);
susHandlers[3]->setParent(objects::SUS_BOARD_ASS);
susHandlers[3]->setCustomFdir(fdir);
spiCookie = new SpiCookie(addresses::SUS_4, gpioIds::CS_SUS_4, spiDev, SUS::MAX_CMD_SIZE,
spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
susHandlers[4] = new SusHandler(objects::SUS_4, 4, objects::SPI_COM_IF, spiCookie);
fdir = new SusFdir(objects::SUS_4);
susHandlers[4]->setParent(objects::SUS_BOARD_ASS);
susHandlers[4]->setCustomFdir(fdir);
spiCookie = new SpiCookie(addresses::SUS_5, gpioIds::CS_SUS_5, spiDev, SUS::MAX_CMD_SIZE,
spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
susHandlers[5] = new SusHandler(objects::SUS_5, 5, objects::SPI_COM_IF, spiCookie);
fdir = new SusFdir(objects::SUS_5);
susHandlers[5]->setParent(objects::SUS_BOARD_ASS);
susHandlers[5]->setCustomFdir(fdir);
spiCookie = new SpiCookie(addresses::SUS_6, gpioIds::CS_SUS_6, spiDev, SUS::MAX_CMD_SIZE,
spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
susHandlers[6] = new SusHandler(objects::SUS_6, 6, objects::SPI_COM_IF, spiCookie);
fdir = new SusFdir(objects::SUS_6);
susHandlers[6]->setParent(objects::SUS_BOARD_ASS);
susHandlers[6]->setCustomFdir(fdir);
spiCookie = new SpiCookie(addresses::SUS_7, gpioIds::CS_SUS_7, spiDev, SUS::MAX_CMD_SIZE,
spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
susHandlers[7] = new SusHandler(objects::SUS_7, 7, objects::SPI_COM_IF, spiCookie);
fdir = new SusFdir(objects::SUS_7);
susHandlers[7]->setParent(objects::SUS_BOARD_ASS);
susHandlers[7]->setCustomFdir(fdir);
spiCookie = new SpiCookie(addresses::SUS_8, gpioIds::CS_SUS_8, spiDev, SUS::MAX_CMD_SIZE,
spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
susHandlers[8] = new SusHandler(objects::SUS_8, 8, objects::SPI_COM_IF, spiCookie);
fdir = new SusFdir(objects::SUS_8);
susHandlers[8]->setParent(objects::SUS_BOARD_ASS);
susHandlers[8]->setCustomFdir(fdir);
spiCookie = new SpiCookie(addresses::SUS_9, gpioIds::CS_SUS_9, spiDev, SUS::MAX_CMD_SIZE,
spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
susHandlers[9] = new SusHandler(objects::SUS_9, 9, objects::SPI_COM_IF, spiCookie);
fdir = new SusFdir(objects::SUS_9);
susHandlers[9]->setParent(objects::SUS_BOARD_ASS);
susHandlers[9]->setCustomFdir(fdir);
spiCookie = new SpiCookie(addresses::SUS_10, gpioIds::CS_SUS_10, spiDev, SUS::MAX_CMD_SIZE,
spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
susHandlers[10] = new SusHandler(objects::SUS_10, 10, objects::SPI_COM_IF, spiCookie);
fdir = new SusFdir(objects::SUS_10);
susHandlers[10]->setParent(objects::SUS_BOARD_ASS);
susHandlers[10]->setCustomFdir(fdir);
spiCookie = new SpiCookie(addresses::SUS_11, gpioIds::CS_SUS_11, spiDev, SUS::MAX_CMD_SIZE,
spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
susHandlers[11] = new SusHandler(objects::SUS_11, 11, objects::SPI_COM_IF, spiCookie);
fdir = new SusFdir(objects::SUS_11);
susHandlers[11]->setParent(objects::SUS_BOARD_ASS);
susHandlers[11]->setCustomFdir(fdir);
for (auto& sus : susHandlers) {
if (sus != nullptr) {
#if OBSW_TEST_SUS == 1
sus->setStartUpImmediately();
sus->setToGoToNormalMode(true);
#endif
#if OBSW_DEBUG_SUS == 1
sus->enablePeriodicPrintout(true, 3);
#endif
}
}
std::array<object_id_t, 12> susIds = {objects::SUS_0, objects::SUS_1, objects::SUS_2,
objects::SUS_3, objects::SUS_4, objects::SUS_5,
objects::SUS_6, objects::SUS_7, objects::SUS_8,
objects::SUS_9, objects::SUS_10, objects::SUS_11};
SusAssHelper susAssHelper = SusAssHelper(susIds);
auto susAss =
new SusAssembly(objects::SUS_BOARD_ASS, objects::NO_OBJECT, pwrSwitcher, susAssHelper);
static_cast<void>(susAss);
#endif /* OBSW_ADD_SUN_SENSORS == 1 */
}
void ObjectFactory::createRtdComponents(std::string spiDev, GpioIF* gpioComIF,
PowerSwitchIF* pwrSwitcher) {
using namespace gpio;
GpioCookie* rtdGpioCookie = new GpioCookie;
GpioCallback* gpioRtdIc0 = new GpioCallback("Chip select RTD IC0", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
rtdGpioCookie->addGpio(gpioIds::RTD_IC_3, gpioRtdIc0);
GpioCallback* gpioRtdIc1 = new GpioCallback("Chip select RTD IC1", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
rtdGpioCookie->addGpio(gpioIds::RTD_IC_4, gpioRtdIc1);
GpioCallback* gpioRtdIc2 = new GpioCallback("Chip select RTD IC2", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
rtdGpioCookie->addGpio(gpioIds::RTD_IC_5, gpioRtdIc2);
GpioCallback* gpioRtdIc3 = new GpioCallback("Chip select RTD IC3", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
rtdGpioCookie->addGpio(gpioIds::RTD_IC_6, gpioRtdIc3);
GpioCallback* gpioRtdIc4 = new GpioCallback("Chip select RTD IC4", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
rtdGpioCookie->addGpio(gpioIds::RTD_IC_7, gpioRtdIc4);
GpioCallback* gpioRtdIc5 = new GpioCallback("Chip select RTD IC5", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
rtdGpioCookie->addGpio(gpioIds::RTD_IC_8, gpioRtdIc5);
GpioCallback* gpioRtdIc6 = new GpioCallback("Chip select RTD IC6", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
rtdGpioCookie->addGpio(gpioIds::RTD_IC_9, gpioRtdIc6);
GpioCallback* gpioRtdIc7 = new GpioCallback("Chip select RTD IC7", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
rtdGpioCookie->addGpio(gpioIds::RTD_IC_10, gpioRtdIc7);
GpioCallback* gpioRtdIc8 = new GpioCallback("Chip select RTD IC8", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
rtdGpioCookie->addGpio(gpioIds::RTD_IC_11, gpioRtdIc8);
GpioCallback* gpioRtdIc9 = new GpioCallback("Chip select RTD IC9", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
rtdGpioCookie->addGpio(gpioIds::RTD_IC_12, gpioRtdIc9);
GpioCallback* gpioRtdIc10 = new GpioCallback("Chip select RTD IC10", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
rtdGpioCookie->addGpio(gpioIds::RTD_IC_13, gpioRtdIc10);
GpioCallback* gpioRtdIc11 = new GpioCallback("Chip select RTD IC11", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
rtdGpioCookie->addGpio(gpioIds::RTD_IC_14, gpioRtdIc11);
GpioCallback* gpioRtdIc12 = new GpioCallback("Chip select RTD IC12", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
rtdGpioCookie->addGpio(gpioIds::RTD_IC_15, gpioRtdIc12);
GpioCallback* gpioRtdIc13 = new GpioCallback("Chip select RTD IC13", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
rtdGpioCookie->addGpio(gpioIds::RTD_IC_16, gpioRtdIc13);
GpioCallback* gpioRtdIc14 = new GpioCallback("Chip select RTD IC14", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
rtdGpioCookie->addGpio(gpioIds::RTD_IC_17, gpioRtdIc14);
GpioCallback* gpioRtdIc15 = new GpioCallback("Chip select RTD IC15", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
rtdGpioCookie->addGpio(gpioIds::RTD_IC_18, gpioRtdIc15);
gpioComIF->addGpios(rtdGpioCookie);
#if OBSW_ADD_RTD_DEVICES == 1
static constexpr uint8_t NUMBER_RTDS = 16;
std::array<std::pair<address_t, gpioId_t>, NUMBER_RTDS> cookieArgs = {{
{addresses::RTD_IC_3, gpioIds::RTD_IC_3},
{addresses::RTD_IC_4, gpioIds::RTD_IC_4},
{addresses::RTD_IC_5, gpioIds::RTD_IC_5},
{addresses::RTD_IC_6, gpioIds::RTD_IC_6},
{addresses::RTD_IC_7, gpioIds::RTD_IC_7},
{addresses::RTD_IC_8, gpioIds::RTD_IC_8},
{addresses::RTD_IC_9, gpioIds::RTD_IC_9},
{addresses::RTD_IC_10, gpioIds::RTD_IC_10},
{addresses::RTD_IC_11, gpioIds::RTD_IC_11},
{addresses::RTD_IC_12, gpioIds::RTD_IC_12},
{addresses::RTD_IC_13, gpioIds::RTD_IC_13},
{addresses::RTD_IC_14, gpioIds::RTD_IC_14},
{addresses::RTD_IC_15, gpioIds::RTD_IC_15},
{addresses::RTD_IC_16, gpioIds::RTD_IC_16},
{addresses::RTD_IC_17, gpioIds::RTD_IC_17},
{addresses::RTD_IC_18, gpioIds::RTD_IC_18},
}};
std::array<object_id_t, NUMBER_RTDS> rtdIds = {
objects::RTD_IC_3, objects::RTD_IC_4, objects::RTD_IC_5, objects::RTD_IC_6,
objects::RTD_IC_7, objects::RTD_IC_8, objects::RTD_IC_9, objects::RTD_IC_10,
objects::RTD_IC_11, objects::RTD_IC_12, objects::RTD_IC_13, objects::RTD_IC_14,
objects::RTD_IC_15, objects::RTD_IC_16, objects::RTD_IC_17, objects::RTD_IC_18};
std::array<SpiCookie*, NUMBER_RTDS> rtdCookies = {};
std::array<Max31865PT1000Handler*, NUMBER_RTDS> rtds = {};
RtdFdir* rtdFdir = nullptr;
for (uint8_t idx = 0; idx < NUMBER_RTDS; idx++) {
rtdCookies[idx] =
new SpiCookie(cookieArgs[idx].first, cookieArgs[idx].second, spiDev,
Max31865Definitions::MAX_REPLY_SIZE, spi::RTD_MODE, spi::RTD_SPEED);
rtds[idx] = new Max31865PT1000Handler(rtdIds[idx], objects::SPI_COM_IF, rtdCookies[idx]);
rtds[idx]->setParent(objects::TCS_BOARD_ASS);
rtdFdir = new RtdFdir(rtdIds[idx]);
rtds[idx]->setCustomFdir(rtdFdir);
rtds[idx]->setDeviceIdx(idx + 3);
}
#if OBSW_TEST_RTD == 1
for (auto& rtd : rtds) {
if (rtd != nullptr) {
rtd->setStartUpImmediately();
rtd->setInstantNormal(true);
}
}
#endif // OBSW_TEST_RTD == 1
TcsBoardHelper helper(rtdIds);
TcsBoardAssembly* tcsBoardAss =
new TcsBoardAssembly(objects::TCS_BOARD_ASS, objects::NO_OBJECT, pwrSwitcher,
pcduSwitches::Switches::PDU1_CH0_TCS_BOARD_3V3, helper);
static_cast<void>(tcsBoardAss);
#endif // OBSW_ADD_RTD_DEVICES == 1
}

15
linux/ObjectFactory.h Normal file
View File

@ -0,0 +1,15 @@
#pragma once
#include <string>
class GpioIF;
class SpiComIF;
class PowerSwitchIF;
namespace ObjectFactory {
void createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiComIF, PowerSwitchIF* pwrSwitcher,
std::string spiDev);
void createRtdComponents(std::string spiDev, GpioIF* gpioComIF, PowerSwitchIF* pwrSwitcher);
} // namespace ObjectFactory

View File

@ -339,6 +339,8 @@ void SpiTestClass::performMax1227Test() {
std::string deviceName = ""; std::string deviceName = "";
#elif defined(EGSE) #elif defined(EGSE)
std::string deviceName = ""; std::string deviceName = "";
#elif defined(TE0720_1CFA)
std::string deviceName = "";
#endif #endif
int fd = 0; int fd = 0;
UnixFileGuard fileHelper(deviceName, &fd, O_RDWR, "SpiComIF::initializeInterface"); UnixFileGuard fileHelper(deviceName, &fd, O_RDWR, "SpiComIF::initializeInterface");

View File

@ -3,9 +3,14 @@
#include "OBSWConfig.h" #include "OBSWConfig.h"
#if defined(XIPHOS_Q7S) #ifdef XIPHOS_Q7S
#include "busConf.h" #include "busConf.h"
#endif #endif
#ifdef RASPBERRY_PI
#include <bsp_linux_board/definitions.h>
#endif
#include <fsfw_hal/common/gpio/GpioIF.h> #include <fsfw_hal/common/gpio/GpioIF.h>
#include <fsfw_hal/linux/spi/SpiCookie.h> #include <fsfw_hal/linux/spi/SpiCookie.h>
#include <test/testtasks/TestTask.h> #include <test/testtasks/TestTask.h>

View File

@ -0,0 +1,3 @@
target_sources(${OBSW_NAME} PRIVATE
gpioCallbacks.cpp
)

View File

@ -0,0 +1,431 @@
#include "gpioCallbacks.h"
#include "devices/gpioIds.h"
#include "fsfw/serviceinterface/ServiceInterface.h"
#include "fsfw_hal/common/gpio/GpioCookie.h"
#include "fsfw_hal/common/gpio/GpioIF.h"
void gpioCallbacks::spiCsDecoderCallback(gpioId_t gpioId, gpio::GpioOperation gpioOp,
gpio::Levels value, void* args) {
GpioIF* gpioIF = reinterpret_cast<GpioIF*>(args);
if (gpioIF == nullptr) {
sif::debug << "spiCsDecoderCallback: No gpioComIF specified. Call initSpiCsDecoder "
<< "to specify gpioComIF" << std::endl;
return;
}
/* Reading is not supported by the callback function */
if (gpioOp == gpio::GpioOperation::READ) {
return;
}
if (value == gpio::Levels::HIGH) {
switch (gpioId) {
case (gpioIds::RTD_IC_3): {
disableDecoderTcsIc1(gpioIF);
break;
}
case (gpioIds::RTD_IC_4): {
disableDecoderTcsIc1(gpioIF);
break;
}
case (gpioIds::RTD_IC_5): {
disableDecoderTcsIc1(gpioIF);
break;
}
case (gpioIds::RTD_IC_6): {
disableDecoderTcsIc1(gpioIF);
break;
}
case (gpioIds::RTD_IC_7): {
disableDecoderTcsIc1(gpioIF);
break;
}
case (gpioIds::RTD_IC_8): {
disableDecoderTcsIc1(gpioIF);
break;
}
case (gpioIds::RTD_IC_9): {
disableDecoderTcsIc1(gpioIF);
break;
}
case (gpioIds::RTD_IC_10): {
disableDecoderTcsIc1(gpioIF);
break;
}
case (gpioIds::RTD_IC_11): {
disableDecoderTcsIc2(gpioIF);
break;
}
case (gpioIds::RTD_IC_12): {
disableDecoderTcsIc2(gpioIF);
break;
}
case (gpioIds::RTD_IC_13): {
disableDecoderTcsIc2(gpioIF);
break;
}
case (gpioIds::RTD_IC_14): {
disableDecoderTcsIc2(gpioIF);
break;
}
case (gpioIds::RTD_IC_15): {
disableDecoderTcsIc2(gpioIF);
break;
}
case (gpioIds::RTD_IC_16): {
disableDecoderTcsIc2(gpioIF);
break;
}
case (gpioIds::RTD_IC_17): {
disableDecoderTcsIc2(gpioIF);
break;
}
case (gpioIds::RTD_IC_18): {
disableDecoderTcsIc2(gpioIF);
break;
}
case (gpioIds::CS_SUS_0): {
disableDecoderInterfaceBoardIc1(gpioIF);
break;
}
case (gpioIds::CS_SUS_1): {
disableDecoderInterfaceBoardIc1(gpioIF);
break;
}
case (gpioIds::CS_SUS_2): {
disableDecoderInterfaceBoardIc1(gpioIF);
break;
}
case (gpioIds::CS_SUS_3): {
disableDecoderInterfaceBoardIc1(gpioIF);
break;
}
case (gpioIds::CS_SUS_4): {
disableDecoderInterfaceBoardIc1(gpioIF);
break;
}
case (gpioIds::CS_SUS_5): {
disableDecoderInterfaceBoardIc1(gpioIF);
break;
}
case (gpioIds::CS_SUS_6): {
disableDecoderInterfaceBoardIc2(gpioIF);
break;
}
case (gpioIds::CS_SUS_7): {
disableDecoderInterfaceBoardIc2(gpioIF);
break;
}
case (gpioIds::CS_SUS_8): {
disableDecoderInterfaceBoardIc2(gpioIF);
break;
}
case (gpioIds::CS_SUS_9): {
disableDecoderInterfaceBoardIc2(gpioIF);
break;
}
case (gpioIds::CS_SUS_10): {
disableDecoderInterfaceBoardIc2(gpioIF);
break;
}
case (gpioIds::CS_SUS_11): {
disableDecoderInterfaceBoardIc2(gpioIF);
break;
}
case (gpioIds::CS_RW1): {
disableRwDecoder(gpioIF);
break;
}
case (gpioIds::CS_RW2): {
disableRwDecoder(gpioIF);
break;
}
case (gpioIds::CS_RW3): {
disableRwDecoder(gpioIF);
break;
}
case (gpioIds::CS_RW4): {
disableRwDecoder(gpioIF);
break;
}
default:
sif::debug << "spiCsDecoderCallback: Invalid gpio id " << gpioId << std::endl;
}
} else if (value == gpio::Levels::LOW) {
switch (gpioId) {
case (gpioIds::RTD_IC_3): {
selectY7(gpioIF);
enableDecoderTcsIc1(gpioIF);
break;
}
case (gpioIds::RTD_IC_4): {
selectY6(gpioIF);
enableDecoderTcsIc1(gpioIF);
break;
}
case (gpioIds::RTD_IC_5): {
selectY5(gpioIF);
enableDecoderTcsIc1(gpioIF);
break;
}
case (gpioIds::RTD_IC_6): {
selectY4(gpioIF);
enableDecoderTcsIc1(gpioIF);
break;
}
case (gpioIds::RTD_IC_7): {
selectY3(gpioIF);
enableDecoderTcsIc1(gpioIF);
break;
}
case (gpioIds::RTD_IC_8): {
selectY2(gpioIF);
enableDecoderTcsIc1(gpioIF);
break;
}
case (gpioIds::RTD_IC_9): {
selectY1(gpioIF);
enableDecoderTcsIc1(gpioIF);
break;
}
case (gpioIds::RTD_IC_10): {
selectY0(gpioIF);
enableDecoderTcsIc1(gpioIF);
break;
}
case (gpioIds::RTD_IC_11): {
selectY7(gpioIF);
enableDecoderTcsIc2(gpioIF);
break;
}
case (gpioIds::RTD_IC_12): {
selectY6(gpioIF);
enableDecoderTcsIc2(gpioIF);
break;
}
case (gpioIds::RTD_IC_13): {
selectY5(gpioIF);
enableDecoderTcsIc2(gpioIF);
break;
}
case (gpioIds::RTD_IC_14): {
selectY4(gpioIF);
enableDecoderTcsIc2(gpioIF);
break;
}
case (gpioIds::RTD_IC_15): {
selectY3(gpioIF);
enableDecoderTcsIc2(gpioIF);
break;
}
case (gpioIds::RTD_IC_16): {
selectY2(gpioIF);
enableDecoderTcsIc2(gpioIF);
break;
}
case (gpioIds::RTD_IC_17): {
selectY1(gpioIF);
enableDecoderTcsIc2(gpioIF);
break;
}
case (gpioIds::RTD_IC_18): {
selectY0(gpioIF);
enableDecoderTcsIc2(gpioIF);
break;
}
case (gpioIds::CS_SUS_0): {
selectY0(gpioIF);
enableDecoderInterfaceBoardIc1(gpioIF);
break;
}
case (gpioIds::CS_SUS_1): {
selectY1(gpioIF);
enableDecoderInterfaceBoardIc1(gpioIF);
break;
}
case (gpioIds::CS_SUS_2): {
selectY2(gpioIF);
enableDecoderInterfaceBoardIc1(gpioIF);
break;
}
case (gpioIds::CS_SUS_3): {
selectY3(gpioIF);
enableDecoderInterfaceBoardIc1(gpioIF);
break;
}
case (gpioIds::CS_SUS_4): {
selectY4(gpioIF);
enableDecoderInterfaceBoardIc1(gpioIF);
break;
}
case (gpioIds::CS_SUS_5): {
selectY5(gpioIF);
enableDecoderInterfaceBoardIc1(gpioIF);
break;
}
case (gpioIds::CS_SUS_6): {
selectY0(gpioIF);
enableDecoderInterfaceBoardIc2(gpioIF);
break;
}
case (gpioIds::CS_SUS_7): {
selectY1(gpioIF);
enableDecoderInterfaceBoardIc2(gpioIF);
break;
}
case (gpioIds::CS_SUS_8): {
selectY2(gpioIF);
enableDecoderInterfaceBoardIc2(gpioIF);
break;
}
case (gpioIds::CS_SUS_9): {
selectY3(gpioIF);
enableDecoderInterfaceBoardIc2(gpioIF);
break;
}
case (gpioIds::CS_SUS_10): {
selectY4(gpioIF);
enableDecoderInterfaceBoardIc2(gpioIF);
break;
}
case (gpioIds::CS_SUS_11): {
selectY5(gpioIF);
enableDecoderInterfaceBoardIc2(gpioIF);
break;
}
case (gpioIds::CS_RW1): {
selectY0(gpioIF);
enableRwDecoder(gpioIF);
break;
}
case (gpioIds::CS_RW2): {
selectY1(gpioIF);
enableRwDecoder(gpioIF);
break;
}
case (gpioIds::CS_RW3): {
selectY2(gpioIF);
enableRwDecoder(gpioIF);
break;
}
case (gpioIds::CS_RW4): {
selectY3(gpioIF);
enableRwDecoder(gpioIF);
break;
}
default:
sif::debug << "spiCsDecoderCallback: Invalid gpio id " << gpioId << std::endl;
}
} else {
sif::debug << "spiCsDecoderCallback: Invalid value. Must be 0 or 1" << std::endl;
}
}
void gpioCallbacks::enableDecoderTcsIc1(GpioIF* gpioIF) {
gpioIF->pullLow(gpioIds::SPI_MUX_BIT_0);
gpioIF->pullHigh(gpioIds::SPI_MUX_BIT_1);
gpioIF->pullLow(gpioIds::SPI_MUX_BIT_2);
}
void gpioCallbacks::enableDecoderTcsIc2(GpioIF* gpioIF) {
gpioIF->pullHigh(gpioIds::SPI_MUX_BIT_2);
gpioIF->pullLow(gpioIds::SPI_MUX_BIT_0);
gpioIF->pullHigh(gpioIds::SPI_MUX_BIT_1);
}
void gpioCallbacks::enableDecoderInterfaceBoardIc1(GpioIF* gpioIF) {
gpioIF->pullHigh(gpioIds::SPI_MUX_BIT_0);
gpioIF->pullLow(gpioIds::SPI_MUX_BIT_1);
gpioIF->pullLow(gpioIds::SPI_MUX_BIT_2);
}
void gpioCallbacks::enableDecoderInterfaceBoardIc2(GpioIF* gpioIF) {
gpioIF->pullHigh(gpioIds::SPI_MUX_BIT_0);
gpioIF->pullLow(gpioIds::SPI_MUX_BIT_1);
gpioIF->pullHigh(gpioIds::SPI_MUX_BIT_2);
}
void gpioCallbacks::disableDecoderTcsIc1(GpioIF* gpioIF) {
gpioIF->pullHigh(gpioIds::SPI_MUX_BIT_0);
gpioIF->pullHigh(gpioIds::SPI_MUX_BIT_1);
gpioIF->pullLow(gpioIds::SPI_MUX_BIT_2);
}
void gpioCallbacks::disableDecoderTcsIc2(GpioIF* gpioIF) {
// DO NOT CHANGE THE ORDER HERE
gpioIF->pullHigh(gpioIds::SPI_MUX_BIT_0);
gpioIF->pullLow(gpioIds::SPI_MUX_BIT_2);
gpioIF->pullHigh(gpioIds::SPI_MUX_BIT_1);
}
void gpioCallbacks::disableDecoderInterfaceBoardIc1(GpioIF* gpioIF) {
gpioIF->pullHigh(gpioIds::SPI_MUX_BIT_0);
gpioIF->pullHigh(gpioIds::SPI_MUX_BIT_1);
gpioIF->pullLow(gpioIds::SPI_MUX_BIT_2);
}
void gpioCallbacks::disableDecoderInterfaceBoardIc2(GpioIF* gpioIF) {
gpioIF->pullHigh(gpioIds::SPI_MUX_BIT_0);
gpioIF->pullHigh(gpioIds::SPI_MUX_BIT_1);
gpioIF->pullLow(gpioIds::SPI_MUX_BIT_2);
}
void gpioCallbacks::enableRwDecoder(GpioIF* gpioIF) { gpioIF->pullHigh(gpioIds::EN_RW_CS); }
void gpioCallbacks::disableRwDecoder(GpioIF* gpioIF) { gpioIF->pullLow(gpioIds::EN_RW_CS); }
void gpioCallbacks::selectY0(GpioIF* gpioIF) {
gpioIF->pullLow(gpioIds::SPI_MUX_BIT_3);
gpioIF->pullLow(gpioIds::SPI_MUX_BIT_4);
gpioIF->pullLow(gpioIds::SPI_MUX_BIT_5);
}
void gpioCallbacks::selectY1(GpioIF* gpioIF) {
gpioIF->pullHigh(gpioIds::SPI_MUX_BIT_3);
gpioIF->pullLow(gpioIds::SPI_MUX_BIT_4);
gpioIF->pullLow(gpioIds::SPI_MUX_BIT_5);
}
void gpioCallbacks::selectY2(GpioIF* gpioIF) {
gpioIF->pullLow(gpioIds::SPI_MUX_BIT_3);
gpioIF->pullHigh(gpioIds::SPI_MUX_BIT_4);
gpioIF->pullLow(gpioIds::SPI_MUX_BIT_5);
}
void gpioCallbacks::selectY3(GpioIF* gpioIF) {
gpioIF->pullHigh(gpioIds::SPI_MUX_BIT_3);
gpioIF->pullHigh(gpioIds::SPI_MUX_BIT_4);
gpioIF->pullLow(gpioIds::SPI_MUX_BIT_5);
}
void gpioCallbacks::selectY4(GpioIF* gpioIF) {
gpioIF->pullLow(gpioIds::SPI_MUX_BIT_3);
gpioIF->pullLow(gpioIds::SPI_MUX_BIT_4);
gpioIF->pullHigh(gpioIds::SPI_MUX_BIT_5);
}
void gpioCallbacks::selectY5(GpioIF* gpioIF) {
gpioIF->pullHigh(gpioIds::SPI_MUX_BIT_3);
gpioIF->pullLow(gpioIds::SPI_MUX_BIT_4);
gpioIF->pullHigh(gpioIds::SPI_MUX_BIT_5);
}
void gpioCallbacks::selectY6(GpioIF* gpioIF) {
gpioIF->pullLow(gpioIds::SPI_MUX_BIT_3);
gpioIF->pullHigh(gpioIds::SPI_MUX_BIT_4);
gpioIF->pullHigh(gpioIds::SPI_MUX_BIT_5);
}
void gpioCallbacks::selectY7(GpioIF* gpioIF) {
gpioIF->pullHigh(gpioIds::SPI_MUX_BIT_3);
gpioIF->pullHigh(gpioIds::SPI_MUX_BIT_4);
gpioIF->pullHigh(gpioIds::SPI_MUX_BIT_5);
}
void gpioCallbacks::disableAllDecoder(GpioIF* gpioIF) {
gpioIF->pullLow(gpioIds::SPI_MUX_BIT_2);
gpioIF->pullLow(gpioIds::SPI_MUX_BIT_0);
gpioIF->pullLow(gpioIds::SPI_MUX_BIT_1);
gpioIF->pullLow(gpioIds::EN_RW_CS);
}

View File

@ -1,16 +1,10 @@
#ifndef LINUX_GPIO_GPIOCALLBACKS_H_ #pragma once
#define LINUX_GPIO_GPIOCALLBACKS_H_
#include <fsfw_hal/common/gpio/GpioIF.h>
#include <fsfw_hal/common/gpio/gpioDefinitions.h> #include <fsfw_hal/common/gpio/gpioDefinitions.h>
namespace gpioCallbacks { class GpioIF;
/** namespace gpioCallbacks {
* @brief This function initializes the GPIOs used to control the SN74LVC138APWR decoders on
* the TCS Board and the interface board.
*/
void initSpiCsDecoder(GpioIF* gpioComIF);
/** /**
* @brief This function implements the decoding to multiply gpios by using the decoder * @brief This function implements the decoding to multiply gpios by using the decoder
@ -23,51 +17,50 @@ void spiCsDecoderCallback(gpioId_t gpioId, gpio::GpioOperation gpioOp, gpio::Lev
* @brief This function sets mux bits 1-3 to a state which will only enable the decoder * @brief This function sets mux bits 1-3 to a state which will only enable the decoder
* on the TCS board which is named to IC1 in the schematic. * on the TCS board which is named to IC1 in the schematic.
*/ */
void enableDecoderTcsIc1(); void enableDecoderTcsIc1(GpioIF* gpioIF);
/** /**
* @brief This function sets mux bits 1-3 to a state which will only enable the decoder * @brief This function sets mux bits 1-3 to a state which will only enable the decoder
* on the TCS board which is named to IC2 in the schematic. * on the TCS board which is named to IC2 in the schematic.
*/ */
void enableDecoderTcsIc2(); void enableDecoderTcsIc2(GpioIF* gpioIF);
/** /**
* @brief This function sets mux bits 1-3 to a state which will only enable the decoder * @brief This function sets mux bits 1-3 to a state which will only enable the decoder
* on the inteface board board which is named to IC21 in the schematic. * on the inteface board board which is named to IC21 in the schematic.
*/ */
void enableDecoderInterfaceBoardIc1(); void enableDecoderInterfaceBoardIc1(GpioIF* gpioIF);
/** /**
* @brief This function sets mux bits 1-3 to a state which will only enable the decoder * @brief This function sets mux bits 1-3 to a state which will only enable the decoder
* on the inteface board board which is named to IC22 in the schematic. * on the inteface board board which is named to IC22 in the schematic.
*/ */
void enableDecoderInterfaceBoardIc2(); void enableDecoderInterfaceBoardIc2(GpioIF* gpioIF);
void disableDecoderTcsIc1(); void disableDecoderTcsIc1(GpioIF* gpioIF);
void disableDecoderTcsIc2(); void disableDecoderTcsIc2(GpioIF* gpioIF);
void disableDecoderInterfaceBoardIc1(); void disableDecoderInterfaceBoardIc1(GpioIF* gpioIF);
void disableDecoderInterfaceBoardIc2(); void disableDecoderInterfaceBoardIc2(GpioIF* gpioIF);
/** /**
* @brief Enables the reaction wheel chip select decoder (IC3). * @brief Enables the reaction wheel chip select decoder (IC3).
*/ */
void enableRwDecoder(); void enableRwDecoder(GpioIF* gpioIF);
void disableRwDecoder(); void disableRwDecoder(GpioIF* gpioIF);
/** /**
* @brief This function disables all decoder. * @brief This function disables all decoder.
*/ */
void disableAllDecoder(); void disableAllDecoder(GpioIF* gpioIF);
/** The following functions enable the appropriate channel of the currently enabled decoder */ /** The following functions enable the appropriate channel of the currently enabled decoder */
void selectY0(); void selectY0(GpioIF* gpioIF);
void selectY1(); void selectY1(GpioIF* gpioIF);
void selectY2(); void selectY2(GpioIF* gpioIF);
void selectY3(); void selectY3(GpioIF* gpioIF);
void selectY4(); void selectY4(GpioIF* gpioIF);
void selectY5(); void selectY5(GpioIF* gpioIF);
void selectY6(); void selectY6(GpioIF* gpioIF);
void selectY7(); void selectY7(GpioIF* gpioIF);
} // namespace gpioCallbacks
#endif /* LINUX_GPIO_GPIOCALLBACKS_H_ */ } // namespace gpioCallbacks

View File

@ -4,7 +4,11 @@ if(EIVE_BUILD_GPSD_GPS_HANDLER)
) )
endif() endif()
<<<<<<< HEAD
target_sources(${OBSW_NAME} PRIVATE target_sources(${OBSW_NAME} PRIVATE
ScexUartReader.cpp ScexUartReader.cpp
) )
=======
add_subdirectory(ploc)
>>>>>>> origin/develop
add_subdirectory(startracker) add_subdirectory(startracker)

View File

@ -3,19 +3,24 @@
#include "OBSWConfig.h" #include "OBSWConfig.h"
#include "fsfw/datapool/PoolReadGuard.h" #include "fsfw/datapool/PoolReadGuard.h"
#include "fsfw/timemanager/Clock.h" #include "fsfw/timemanager/Clock.h"
#include "linux/utility/utility.h"
#include "mission/utility/compileTime.h"
#if FSFW_DEV_HYPERION_GPS_CREATE_NMEA_CSV == 1 #if FSFW_DEV_HYPERION_GPS_CREATE_NMEA_CSV == 1
#include <filesystem> #include <filesystem>
#include <fstream> #include <fstream>
#endif #endif
#include <cmath> #include <cmath>
#include <ctime>
GPSHyperionLinuxController::GPSHyperionLinuxController(object_id_t objectId, object_id_t parentId, GPSHyperionLinuxController::GPSHyperionLinuxController(object_id_t objectId, object_id_t parentId,
bool debugHyperionGps) bool debugHyperionGps)
: ExtendedControllerBase(objectId, objects::NO_OBJECT), : ExtendedControllerBase(objectId, objects::NO_OBJECT),
gpsSet(this), gpsSet(this),
myGpsmm(GPSD_SHARED_MEMORY, nullptr), myGpsmm(GPSD_SHARED_MEMORY, nullptr),
debugHyperionGps(debugHyperionGps) {} debugHyperionGps(debugHyperionGps) {
timeUpdateCd.resetTimer();
}
GPSHyperionLinuxController::~GPSHyperionLinuxController() {} GPSHyperionLinuxController::~GPSHyperionLinuxController() {}
@ -76,9 +81,7 @@ ReturnValue_t GPSHyperionLinuxController::initializeLocalDataPool(
localDataPoolMap.emplace(GpsHyperion::SATS_IN_USE, new PoolEntry<uint8_t>()); localDataPoolMap.emplace(GpsHyperion::SATS_IN_USE, new PoolEntry<uint8_t>());
localDataPoolMap.emplace(GpsHyperion::SATS_IN_VIEW, new PoolEntry<uint8_t>()); localDataPoolMap.emplace(GpsHyperion::SATS_IN_VIEW, new PoolEntry<uint8_t>());
localDataPoolMap.emplace(GpsHyperion::FIX_MODE, new PoolEntry<uint8_t>()); localDataPoolMap.emplace(GpsHyperion::FIX_MODE, new PoolEntry<uint8_t>());
#if OBSW_ENABLE_PERIODIC_HK == 1 poolManager.subscribeForPeriodicPacket(gpsSet.getSid(), false, 30.0, false);
poolManager.subscribeForPeriodicPacket(gpsSet.getSid(), true, 2.0, false);
#endif
return HasReturnvaluesIF::RETURN_OK; return HasReturnvaluesIF::RETURN_OK;
} }
@ -124,8 +127,17 @@ void GPSHyperionLinuxController::readGpsDataFromGpsd() {
return; return;
} }
bool validFix = false;
static_cast<void>(validFix);
// 0: Not seen, 1: No fix, 2: 2D-Fix, 3: 3D-Fix // 0: Not seen, 1: No fix, 2: 2D-Fix, 3: 3D-Fix
gpsSet.fixMode.value = gps->fix.mode; int newFixMode = gps->fix.mode;
if (newFixMode == 2 or newFixMode == 3) {
validFix = true;
}
if (gpsSet.fixMode.value != newFixMode) {
triggerEvent(GpsHyperion::GPS_FIX_CHANGE, gpsSet.fixMode.value, newFixMode);
}
gpsSet.fixMode.value = newFixMode;
if (gps->fix.mode == 0 or gps->fix.mode == 1) { if (gps->fix.mode == 0 or gps->fix.mode == 1) {
if (modeCommanded and maxTimeToReachFix.hasTimedOut()) { if (modeCommanded and maxTimeToReachFix.hasTimedOut()) {
// We are supposed to be on and functioning, but not fix was found // We are supposed to be on and functioning, but not fix was found
@ -172,6 +184,34 @@ void GPSHyperionLinuxController::readGpsDataFromGpsd() {
timeval time = {}; timeval time = {};
time.tv_sec = gpsSet.unixSeconds.value; time.tv_sec = gpsSet.unixSeconds.value;
time.tv_usec = gps->fix.time.tv_nsec / 1000; time.tv_usec = gps->fix.time.tv_nsec / 1000;
std::time_t t = std::time(nullptr);
if (time.tv_sec == t) {
timeIsConstantCounter++;
} else {
timeIsConstantCounter = 0;
}
if (timeInit and validFix) {
if (not utility::timeSanityCheck()) {
#if OBSW_VERBOSE_LEVEL >= 1
time_t timeRaw = time.tv_sec;
std::tm *timeTm = std::gmtime(&timeRaw);
sif::info << "Setting invalid system time from GPS data directly: "
<< std::put_time(timeTm, "%c %Z") << std::endl;
#endif
// For some reason, the clock needs to be somewhat correct for NTP to work. Really dumb..
Clock::setClock(&time);
}
timeInit = false;
}
// If the received time does not change anymore for whatever reason, do not set it here
// to avoid stale times. Also, don't do it too often often to avoid jumping times
if (timeIsConstantCounter < 20 and timeUpdateCd.hasTimedOut()) {
// Update the system time here for now. NTP seems to be unable to do so for whatever reason.
// Further tests have shown that the time seems to be set by NTPD after some time..
// Clock::setClock(&time);
timeUpdateCd.resetTimer();
}
Clock::TimeOfDay_t timeOfDay = {}; Clock::TimeOfDay_t timeOfDay = {};
Clock::convertTimevalToTimeOfDay(&time, &timeOfDay); Clock::convertTimevalToTimeOfDay(&time, &timeOfDay);
gpsSet.year = timeOfDay.year; gpsSet.year = timeOfDay.year;
@ -192,6 +232,9 @@ void GPSHyperionLinuxController::readGpsDataFromGpsd() {
std::cout << "Longitude: " << gps->fix.longitude << std::endl; std::cout << "Longitude: " << gps->fix.longitude << std::endl;
std::cout << "Altitude(MSL): " << gps->fix.altMSL << std::endl; std::cout << "Altitude(MSL): " << gps->fix.altMSL << std::endl;
std::cout << "Speed(m/s): " << gps->fix.speed << std::endl; std::cout << "Speed(m/s): " << gps->fix.speed << std::endl;
std::time_t t = std::time(nullptr);
std::tm tm = *std::gmtime(&t);
std::cout << "C Time: " << std::put_time(&tm, "%c") << std::endl;
} }
} }
#endif #endif

View File

@ -1,6 +1,7 @@
#ifndef MISSION_DEVICES_GPSHYPERIONHANDLER_H_ #ifndef MISSION_DEVICES_GPSHYPERIONHANDLER_H_
#define MISSION_DEVICES_GPSHYPERIONHANDLER_H_ #define MISSION_DEVICES_GPSHYPERIONHANDLER_H_
#include "commonSubsystemIds.h"
#include "fsfw/FSFW.h" #include "fsfw/FSFW.h"
#include "fsfw/controller/ExtendedControllerBase.h" #include "fsfw/controller/ExtendedControllerBase.h"
#include "fsfw/devicehandlers/DeviceHandlerBase.h" #include "fsfw/devicehandlers/DeviceHandlerBase.h"
@ -22,6 +23,7 @@
class GPSHyperionLinuxController : public ExtendedControllerBase { class GPSHyperionLinuxController : public ExtendedControllerBase {
public: public:
static constexpr uint32_t MAX_SECONDS_TO_REACH_FIX = 60 * 60 * 5; static constexpr uint32_t MAX_SECONDS_TO_REACH_FIX = 60 * 60 * 5;
GPSHyperionLinuxController(object_id_t objectId, object_id_t parentId, GPSHyperionLinuxController(object_id_t objectId, object_id_t parentId,
bool debugHyperionGps = false); bool debugHyperionGps = false);
virtual ~GPSHyperionLinuxController(); virtual ~GPSHyperionLinuxController();
@ -49,8 +51,11 @@ class GPSHyperionLinuxController : public ExtendedControllerBase {
GpsPrimaryDataset gpsSet; GpsPrimaryDataset gpsSet;
Countdown maxTimeToReachFix = Countdown(MAX_SECONDS_TO_REACH_FIX * 1000); Countdown maxTimeToReachFix = Countdown(MAX_SECONDS_TO_REACH_FIX * 1000);
bool modeCommanded = true; bool modeCommanded = true;
bool timeInit = true;
gpsmm myGpsmm; gpsmm myGpsmm;
bool debugHyperionGps = false; bool debugHyperionGps = false;
uint32_t timeIsConstantCounter = 0;
Countdown timeUpdateCd = Countdown(60);
void readGpsDataFromGpsd(); void readGpsDataFromGpsd();
}; };

View File

@ -0,0 +1,32 @@
#ifndef MPSOC_RETURN_VALUES_IF_H_
#define MPSOC_RETURN_VALUES_IF_H_
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
class MPSoCReturnValuesIF {
public:
static const uint8_t INTERFACE_ID = CLASS_ID::MPSOC_RETURN_VALUES_IF;
//! [EXPORT] : [COMMENT] Space Packet received from PLOC has invalid CRC
static const ReturnValue_t CRC_FAILURE = MAKE_RETURN_CODE(0xA0);
//! [EXPORT] : [COMMENT] Received ACK failure reply from PLOC
static const ReturnValue_t RECEIVED_ACK_FAILURE = MAKE_RETURN_CODE(0xA1);
//! [EXPORT] : [COMMENT] Received execution failure reply from PLOC
static const ReturnValue_t RECEIVED_EXE_FAILURE = MAKE_RETURN_CODE(0xA2);
//! [EXPORT] : [COMMENT] Received space packet with invalid APID from PLOC
static const ReturnValue_t INVALID_APID = MAKE_RETURN_CODE(0xA3);
//! [EXPORT] : [COMMENT] Received command with invalid length
static const ReturnValue_t INVALID_LENGTH = MAKE_RETURN_CODE(0xA4);
//! [EXPORT] : [COMMENT] Filename of file in OBC filesystem is too long
static const ReturnValue_t FILENAME_TOO_LONG = MAKE_RETURN_CODE(0xA5);
//! [EXPORT] : [COMMENT] MPSoC helper is currently executing a command
static const ReturnValue_t MPSOC_HELPER_EXECUTING = MAKE_RETURN_CODE(0xA6);
//! [EXPORT] : [COMMENT] Filename of MPSoC file is to long (max. 256 bytes)
static const ReturnValue_t MPSOC_FILENAME_TOO_LONG = MAKE_RETURN_CODE(0xA7);
//! [EXPORT] : [COMMENT] Command has invalid parameter
static const ReturnValue_t INVALID_PARAMETER = MAKE_RETURN_CODE(0xA8);
//! [EXPORT] : [COMMENT] Received command has file string with invalid length
static const ReturnValue_t NAME_TOO_LONG = MAKE_RETURN_CODE(0xA9);
};
#endif /* MPSOC_RETURN_VALUES_IF_H_ */

View File

@ -0,0 +1,620 @@
#ifndef MISSION_DEVICES_DEVICEDEFINITIONS_PLOCMPSOCDEFINITIONS_H_
#define MISSION_DEVICES_DEVICEDEFINITIONS_PLOCMPSOCDEFINITIONS_H_
#include "MPSoCReturnValuesIF.h"
#include "OBSWConfig.h"
#include "eive/definitions.h"
#include "fsfw/globalfunctions/CRC.h"
#include "fsfw/serialize/SerializeAdapter.h"
#include "fsfw/tmtcpacket/SpacePacket.h"
namespace mpsoc {
static const DeviceCommandId_t NONE = 0;
static const DeviceCommandId_t TC_MEM_WRITE = 1;
static const DeviceCommandId_t TC_MEM_READ = 2;
static const DeviceCommandId_t ACK_REPORT = 3;
static const DeviceCommandId_t EXE_REPORT = 5;
static const DeviceCommandId_t TM_MEMORY_READ_REPORT = 6;
static const DeviceCommandId_t TC_FLASHFOPEN = 7;
static const DeviceCommandId_t TC_FLASHFCLOSE = 8;
static const DeviceCommandId_t TC_FLASHWRITE = 9;
static const DeviceCommandId_t TC_FLASHDELETE = 10;
static const DeviceCommandId_t TC_REPLAY_START = 11;
static const DeviceCommandId_t TC_REPLAY_STOP = 12;
static const DeviceCommandId_t TC_REPLAY_WRITE_SEQUENCE = 13;
static const DeviceCommandId_t TC_DOWNLINK_PWR_ON = 14;
static const DeviceCommandId_t TC_DOWNLINK_PWR_OFF = 15;
static const DeviceCommandId_t TC_MODE_REPLAY = 16;
// Will reset the sequence count of the OBSW
static const DeviceCommandId_t OBSW_RESET_SEQ_COUNT = 50;
static const uint16_t SIZE_ACK_REPORT = 14;
static const uint16_t SIZE_EXE_REPORT = 14;
static const uint16_t SIZE_TM_MEM_READ_REPORT = 18;
/**
* SpacePacket apids of PLOC telecommands and telemetry.
*/
namespace apid {
static const uint16_t TC_REPLAY_START = 0x110;
static const uint16_t TC_REPLAY_STOP = 0x111;
static const uint16_t TC_REPLAY_WRITE_SEQUENCE = 0x112;
static const uint16_t TC_DOWNLINK_PWR_ON = 0x113;
static const uint16_t TC_MEM_WRITE = 0x114;
static const uint16_t TC_MEM_READ = 0x115;
static const uint16_t TC_FLASHWRITE = 0x117;
static const uint16_t TC_FLASHFOPEN = 0x119;
static const uint16_t TC_FLASHFCLOSE = 0x11A;
static const uint16_t TC_FLASHDELETE = 0x11C;
static const uint16_t TC_MODE_REPLAY = 0x11F;
static const uint16_t TC_DOWNLINK_PWR_OFF = 0x124;
static const uint16_t TM_MEMORY_READ_REPORT = 0x404;
static const uint16_t ACK_SUCCESS = 0x400;
static const uint16_t ACK_FAILURE = 0x401;
static const uint16_t EXE_SUCCESS = 0x402;
static const uint16_t EXE_FAILURE = 0x403;
} // namespace apid
/** Offset from first byte in space packet to first byte of data field */
static const uint8_t DATA_FIELD_OFFSET = 6;
static const size_t MEM_READ_RPT_LEN_OFFSET = 10;
static const char NULL_TERMINATOR = '\0';
/**
* The size of payload data which will be forwarded to the requesting object. e.g. PUS Service
* 8.
*/
static const uint8_t SIZE_MEM_READ_RPT_FIX = 6;
static const size_t MAX_FILENAME_SIZE = 256;
/**
* PLOC space packet length for fixed size packets. This is the size of the whole packet data
* field. For the length field in the space packet this size will be substracted by one.
*/
static const uint16_t LENGTH_TC_MEM_WRITE = 12;
static const uint16_t LENGTH_TC_MEM_READ = 8;
static const size_t MAX_REPLY_SIZE = SpacePacket::PACKET_MAX_SIZE * 3;
static const size_t MAX_COMMAND_SIZE = SpacePacket::PACKET_MAX_SIZE;
static const size_t MAX_DATA_SIZE = 1016;
/**
* The replay write sequence command has a maximum delay for the execution report which amounts to
* 30 seconds. (80 cycles * 0.5 seconds = 40 seconds).
*/
static const uint16_t TC_WRITE_SEQ_EXECUTION_DELAY = 80;
// Requires approx. 2 seconds for execution. 8 => 4 seconds
static const uint16_t TC_DOWNLINK_PWR_ON_EXECUTION_DELAY = 8;
/**
* @brief Abstract base class for TC space packet of MPSoC.
*/
class TcBase : public SpacePacket, public MPSoCReturnValuesIF {
public:
// Initial length field of space packet. Will always be updated when packet is created.
static const uint16_t INIT_LENGTH = 1;
/**
* @brief Constructor
*
* @param sequenceCount Sequence count of space packet which will be incremented with each
* sent and received packets.
*/
TcBase(uint16_t apid, uint16_t sequenceCount)
: SpacePacket(INIT_LENGTH, true, apid, sequenceCount) {}
/**
* @brief Function to initialize the space packet
*
* @param commandData Pointer to command specific data
* @param commandDataLen Length of command data
*
* @return RETURN_OK if packet creation was successful, otherwise error return value
*/
virtual ReturnValue_t createPacket(const uint8_t* commandData, size_t commandDataLen) {
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
result = initPacket(commandData, commandDataLen);
if (result != HasReturnvaluesIF::HasReturnvaluesIF::RETURN_OK) {
return result;
}
result = addCrc();
if (result != HasReturnvaluesIF::HasReturnvaluesIF::RETURN_OK) {
return result;
}
return result;
}
protected:
/**
* @brief Must be overwritten by the child class to define the command specific parameters
*
* @param commandData Pointer to received command data
* @param commandDataLen Length of received command data
*/
virtual ReturnValue_t initPacket(const uint8_t* commandData, size_t commandDataLen) {
return HasReturnvaluesIF::RETURN_OK;
}
/**
* @brief Calculates and adds the CRC
*/
ReturnValue_t addCrc() {
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
size_t serializedSize = 0;
uint32_t full_size = getFullSize();
uint16_t crc = CRC::crc16ccitt(getWholeData(), full_size - CRC_SIZE);
result = SerializeAdapter::serialize<uint16_t>(
&crc, this->localData.byteStream + full_size - CRC_SIZE, &serializedSize, sizeof(crc),
SerializeIF::Endianness::BIG);
if (result != HasReturnvaluesIF::RETURN_OK) {
sif::debug << "TcBase::addCrc: Failed to serialize crc field" << std::endl;
}
return result;
}
};
/**
* @brief Class for handling tm replies of the PLOC MPSoC.
*/
class TmPacket : public SpacePacket, public MPSoCReturnValuesIF {
public:
/**
* @brief Constructor creates idle packet and sets length field to maximum allowed size.
*/
TmPacket() : SpacePacket(PACKET_MAX_SIZE) {}
ReturnValue_t checkCrc() {
uint8_t* crcPtr = this->getPacketData() + this->getPacketDataLength() - 1;
uint16_t receivedCrc = *(crcPtr) << 8 | *(crcPtr + 1);
uint16_t recalculatedCrc =
CRC::crc16ccitt(this->localData.byteStream, this->getFullSize() - CRC_SIZE);
if (recalculatedCrc != receivedCrc) {
return CRC_FAILURE;
}
return HasReturnvaluesIF::RETURN_OK;
}
};
/**
* @brief This class helps to build the memory read command for the PLOC.
*/
class TcMemRead : public TcBase {
public:
/**
* @brief Constructor
*/
TcMemRead(uint16_t sequenceCount) : TcBase(apid::TC_MEM_READ, sequenceCount) {
this->setPacketDataLength(PACKET_LENGTH);
}
uint16_t getMemLen() const { return memLen; }
protected:
ReturnValue_t initPacket(const uint8_t* commandData, size_t commandDataLen) {
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
result = lengthCheck(commandDataLen);
if (result != HasReturnvaluesIF::RETURN_OK) {
return result;
}
std::memcpy(this->localData.fields.buffer, commandData, MEM_ADDRESS_SIZE);
std::memcpy(this->localData.fields.buffer + MEM_ADDRESS_SIZE, commandData + MEM_ADDRESS_SIZE,
MEM_LEN_SIZE);
size_t size = sizeof(memLen);
const uint8_t* memLenPtr = commandData + MEM_ADDRESS_SIZE;
result =
SerializeAdapter::deSerialize(&memLen, &memLenPtr, &size, SerializeIF::Endianness::BIG);
if (result != HasReturnvaluesIF::RETURN_OK) {
return result;
}
return result;
}
private:
static const size_t COMMAND_LENGTH = 6;
static const size_t MEM_ADDRESS_SIZE = 4;
static const size_t MEM_LEN_SIZE = 2;
static const uint16_t PACKET_LENGTH = 7;
uint16_t memLen = 0;
ReturnValue_t lengthCheck(size_t commandDataLen) {
if (commandDataLen != COMMAND_LENGTH) {
return INVALID_LENGTH;
}
return HasReturnvaluesIF::RETURN_OK;
}
};
/**
* @brief This class helps to generate the space packet to write data to a memory address within
* the PLOC.
*/
class TcMemWrite : public TcBase {
public:
/**
* @brief Constructor
*/
TcMemWrite(uint16_t sequenceCount) : TcBase(apid::TC_MEM_WRITE, sequenceCount) {}
protected:
ReturnValue_t initPacket(const uint8_t* commandData, size_t commandDataLen) {
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
result = lengthCheck(commandDataLen);
if (result != HasReturnvaluesIF::RETURN_OK) {
return result;
}
std::memcpy(this->localData.fields.buffer, commandData, commandDataLen);
uint16_t memLen =
*(commandData + MEM_ADDRESS_SIZE) << 8 | *(commandData + MEM_ADDRESS_SIZE + 1);
this->setPacketDataLength(memLen * 4 + FIX_LENGTH - 1);
return result;
}
private:
// Min length consists of 4 byte address, 2 byte mem length field, 4 byte data (1 word)
static const size_t MIN_COMMAND_DATA_LENGTH = 10;
static const size_t MEM_ADDRESS_SIZE = 4;
static const size_t FIX_LENGTH = 8;
ReturnValue_t lengthCheck(size_t commandDataLen) {
if (commandDataLen < MIN_COMMAND_DATA_LENGTH) {
sif::warning << "TcMemWrite: Command has invalid length " << commandDataLen << std::endl;
return INVALID_LENGTH;
}
return HasReturnvaluesIF::RETURN_OK;
}
};
/**
* @brief Class to help creation of flash fopen command.
*/
class FlashFopen : public TcBase {
public:
FlashFopen(uint16_t sequenceCount) : TcBase(apid::TC_FLASHFOPEN, sequenceCount) {}
static const char APPEND = 'a';
static const char WRITE = 'w';
static const char READ = 'r';
ReturnValue_t createPacket(std::string filename, char accessMode_) {
accessMode = accessMode_;
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
size_t nameSize = filename.size();
std::memcpy(this->getPacketData(), filename.c_str(), nameSize);
*(this->getPacketData() + nameSize) = NULL_TERMINATOR;
std::memcpy(this->getPacketData() + nameSize + sizeof(NULL_TERMINATOR), &accessMode,
sizeof(accessMode));
this->setPacketDataLength(nameSize + sizeof(NULL_TERMINATOR) + sizeof(accessMode) + CRC_SIZE -
1);
result = addCrc();
if (result != HasReturnvaluesIF::RETURN_OK) {
return result;
}
return result;
}
private:
char accessMode = APPEND;
};
/**
* @brief Class to help creation of flash fclose command.
*/
class FlashFclose : public TcBase {
public:
FlashFclose(uint16_t sequenceCount) : TcBase(apid::TC_FLASHFCLOSE, sequenceCount) {}
ReturnValue_t createPacket(std::string filename) {
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
size_t nameSize = filename.size();
std::memcpy(this->getPacketData(), filename.c_str(), nameSize);
*(this->getPacketData() + nameSize) = NULL_TERMINATOR;
this->setPacketDataLength(nameSize + sizeof(NULL_TERMINATOR) + CRC_SIZE - 1);
result = addCrc();
if (result != HasReturnvaluesIF::RETURN_OK) {
return result;
}
return result;
}
};
/**
* @brief Class to build flash write space packet.
*/
class TcFlashWrite : public TcBase {
public:
TcFlashWrite(uint16_t sequenceCount) : TcBase(apid::TC_FLASHWRITE, sequenceCount) {}
ReturnValue_t createPacket(const uint8_t* writeData, uint32_t writeLen_) {
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
writeLen = writeLen_;
if (writeLen > MAX_DATA_SIZE) {
sif::debug << "FlashWrite::createPacket: Command data too big" << std::endl;
return HasReturnvaluesIF::RETURN_FAILED;
}
size_t serializedSize = 0;
result =
SerializeAdapter::serialize<uint32_t>(&writeLen, this->getPacketData(), &serializedSize,
sizeof(writeLen), SerializeIF::Endianness::BIG);
if (result != HasReturnvaluesIF::RETURN_OK) {
return result;
}
std::memcpy(this->getPacketData() + sizeof(writeLen), writeData, writeLen);
this->setPacketDataLength(static_cast<uint16_t>(writeLen + CRC_SIZE - 1));
result = addCrc();
if (result != HasReturnvaluesIF::RETURN_OK) {
return result;
}
return HasReturnvaluesIF::RETURN_OK;
}
private:
uint32_t writeLen = 0;
};
/**
* @brief Class to help creation of flash delete command.
*/
class TcFlashDelete : public TcBase {
public:
TcFlashDelete(uint16_t sequenceCount) : TcBase(apid::TC_FLASHDELETE, sequenceCount) {}
ReturnValue_t createPacket(std::string filename) {
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
size_t nameSize = filename.size();
std::memcpy(this->getPacketData(), filename.c_str(), nameSize);
*(this->getPacketData() + nameSize) = NULL_TERMINATOR;
this->setPacketDataLength(nameSize + sizeof(NULL_TERMINATOR) + CRC_SIZE - 1);
result = addCrc();
if (result != HasReturnvaluesIF::RETURN_OK) {
return result;
}
return result;
}
};
/**
* @brief Class to build replay stop space packet.
*/
class TcReplayStop : public TcBase {
public:
TcReplayStop(uint16_t sequenceCount) : TcBase(apid::TC_REPLAY_STOP, sequenceCount) {}
ReturnValue_t createPacket() {
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
result = addCrc();
if (result != HasReturnvaluesIF::RETURN_OK) {
return result;
}
this->setPacketDataLength(static_cast<uint16_t>(CRC_SIZE - 1));
return HasReturnvaluesIF::RETURN_OK;
}
};
/**
* @brief This class helps to build the replay start command.
*/
class TcReplayStart : public TcBase {
public:
/**
* @brief Constructor
*/
TcReplayStart(uint16_t sequenceCount) : TcBase(apid::TC_REPLAY_START, sequenceCount) {}
protected:
ReturnValue_t initPacket(const uint8_t* commandData, size_t commandDataLen) {
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
result = lengthCheck(commandDataLen);
if (result != HasReturnvaluesIF::RETURN_OK) {
return result;
}
result = checkData(*commandData);
if (result != HasReturnvaluesIF::RETURN_OK) {
return result;
}
std::memcpy(this->localData.fields.buffer, commandData, commandDataLen);
this->setPacketDataLength(commandDataLen + CRC_SIZE - 1);
return result;
}
private:
static const size_t COMMAND_DATA_LENGTH = 1;
static const uint8_t REPEATING = 0;
static const uint8_t ONCE = 1;
ReturnValue_t lengthCheck(size_t commandDataLen) {
if (commandDataLen != COMMAND_DATA_LENGTH) {
sif::warning << "TcReplayStart: Command has invalid length " << commandDataLen << std::endl;
return INVALID_LENGTH;
}
return HasReturnvaluesIF::RETURN_OK;
}
ReturnValue_t checkData(uint8_t replay) {
if (replay != REPEATING && replay != ONCE) {
sif::warning << "TcReplayStart::checkData: Invalid replay value" << std::endl;
return INVALID_PARAMETER;
}
return HasReturnvaluesIF::RETURN_OK;
}
};
/**
* @brief This class helps to build downlink power on command.
*/
class TcDownlinkPwrOn : public TcBase {
public:
/**
* @brief Constructor
*/
TcDownlinkPwrOn(uint16_t sequenceCount) : TcBase(apid::TC_DOWNLINK_PWR_ON, sequenceCount) {}
protected:
ReturnValue_t initPacket(const uint8_t* commandData, size_t commandDataLen) {
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
result = lengthCheck(commandDataLen);
if (result != HasReturnvaluesIF::RETURN_OK) {
return result;
}
result = modeCheck(*commandData);
if (result != HasReturnvaluesIF::RETURN_OK) {
return result;
}
result = laneRateCheck(*(commandData + 1));
if (result != HasReturnvaluesIF::RETURN_OK) {
return result;
}
std::memcpy(this->localData.fields.buffer, commandData, commandDataLen);
std::memcpy(this->localData.fields.buffer + commandDataLen, &MAX_AMPLITUDE,
sizeof(MAX_AMPLITUDE));
this->setPacketDataLength(commandDataLen + sizeof(MAX_AMPLITUDE) + CRC_SIZE - 1);
return result;
}
private:
static const uint8_t INTERFACE_ID = CLASS_ID::DWLPWRON_CMD;
//! [EXPORT] : [COMMENT] Received command has invalid JESD mode (valid modes are 0 - 5)
static const ReturnValue_t INVALID_MODE = MAKE_RETURN_CODE(0xE0);
//! [EXPORT] : [COMMENT] Received command has invalid lane rate (valid lane rate are 0 - 9)
static const ReturnValue_t INVALID_LANE_RATE = MAKE_RETURN_CODE(0xE1);
static const size_t COMMAND_DATA_LENGTH = 2;
static const uint8_t MAX_MODE = 5;
static const uint8_t MAX_LANE_RATE = 9;
static const uint16_t MAX_AMPLITUDE = 0;
ReturnValue_t lengthCheck(size_t commandDataLen) {
if (commandDataLen != COMMAND_DATA_LENGTH) {
sif::warning << "TcDownlinkPwrOn: Command has invalid length " << commandDataLen << std::endl;
return INVALID_LENGTH;
}
return HasReturnvaluesIF::RETURN_OK;
}
ReturnValue_t modeCheck(uint8_t mode) {
if (mode > MAX_MODE) {
sif::warning << "TcDwonlinkPwrOn::modeCheck: Invalid JESD mode" << std::endl;
return INVALID_MODE;
}
return HasReturnvaluesIF::RETURN_OK;
}
ReturnValue_t laneRateCheck(uint8_t laneRate) {
if (laneRate > MAX_LANE_RATE) {
sif::warning << "TcReplayStart::laneRateCheck: Invalid lane rate" << std::endl;
return INVALID_LANE_RATE;
}
return HasReturnvaluesIF::RETURN_OK;
}
};
/**
* @brief Class to build replay stop space packet.
*/
class TcDownlinkPwrOff : public TcBase {
public:
TcDownlinkPwrOff(uint16_t sequenceCount) : TcBase(apid::TC_DOWNLINK_PWR_OFF, sequenceCount) {}
ReturnValue_t createPacket() {
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
result = addCrc();
if (result != HasReturnvaluesIF::RETURN_OK) {
return result;
}
this->setPacketDataLength(static_cast<uint16_t>(CRC_SIZE - 1));
return HasReturnvaluesIF::RETURN_OK;
}
};
/**
* @brief This class helps to build the replay start command.
*/
class TcReplayWriteSeq : public TcBase {
public:
/**
* @brief Constructor
*/
TcReplayWriteSeq(uint16_t sequenceCount)
: TcBase(apid::TC_REPLAY_WRITE_SEQUENCE, sequenceCount) {}
protected:
ReturnValue_t initPacket(const uint8_t* commandData, size_t commandDataLen) {
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
result = lengthCheck(commandDataLen);
if (result != HasReturnvaluesIF::RETURN_OK) {
return result;
}
std::memcpy(this->localData.fields.buffer, commandData, commandDataLen);
*(this->localData.fields.buffer + commandDataLen) = NULL_TERMINATOR;
this->setPacketDataLength(commandDataLen + sizeof(NULL_TERMINATOR) + CRC_SIZE - 1);
return result;
}
private:
static const size_t USE_DECODING_LENGTH = 1;
ReturnValue_t lengthCheck(size_t commandDataLen) {
if (commandDataLen > USE_DECODING_LENGTH + MAX_FILENAME_SIZE) {
sif::warning << "TcReplayWriteSeq: Command has invalid length " << commandDataLen
<< std::endl;
return INVALID_LENGTH;
}
return HasReturnvaluesIF::RETURN_OK;
}
};
class FlashWritePusCmd : public MPSoCReturnValuesIF {
public:
FlashWritePusCmd(){};
ReturnValue_t extractFields(const uint8_t* commandData, size_t commandDataLen) {
if (commandDataLen > (config::MAX_PATH_SIZE + config::MAX_FILENAME_SIZE + MAX_FILENAME_SIZE)) {
return INVALID_LENGTH;
}
obcFile = std::string(reinterpret_cast<const char*>(commandData));
if (obcFile.size() > (config::MAX_PATH_SIZE + config::MAX_FILENAME_SIZE)) {
return FILENAME_TOO_LONG;
}
mpsocFile = std::string(
reinterpret_cast<const char*>(commandData + obcFile.size() + SIZE_NULL_TERMINATOR));
if (mpsocFile.size() > MAX_FILENAME_SIZE) {
return MPSOC_FILENAME_TOO_LONG;
}
return HasReturnvaluesIF::RETURN_OK;
}
std::string getObcFile() { return obcFile; }
std::string getMPSoCFile() { return mpsocFile; }
private:
static const size_t SIZE_NULL_TERMINATOR = 1;
std::string obcFile = "";
std::string mpsocFile = "";
};
/**
* @brief Class to build replay stop space packet.
*/
class TcModeReplay : public TcBase {
public:
TcModeReplay(uint16_t sequenceCount) : TcBase(apid::TC_MODE_REPLAY, sequenceCount) {}
ReturnValue_t createPacket() {
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
result = addCrc();
if (result != HasReturnvaluesIF::RETURN_OK) {
return result;
}
this->setPacketDataLength(static_cast<uint16_t>(CRC_SIZE - 1));
return HasReturnvaluesIF::RETURN_OK;
}
};
} // namespace mpsoc
#endif /* MISSION_DEVICES_DEVICEDEFINITIONS_PLOCMPSOCDEFINITIONS_H_ */

View File

@ -8,7 +8,7 @@
#include <fsfw/timemanager/Clock.h> #include <fsfw/timemanager/Clock.h>
#include <fsfw/tmtcpacket/SpacePacket.h> #include <fsfw/tmtcpacket/SpacePacket.h>
namespace PLOC_SPV { namespace supv {
/** Command IDs */ /** Command IDs */
static const DeviceCommandId_t NONE = 0; static const DeviceCommandId_t NONE = 0;
@ -1541,6 +1541,6 @@ class LatchupStatusReport : public StaticLocalDataSet<LATCHUP_RPT_SET_ENTRIES> {
lp_var_t<uint32_t> isSet = lp_var_t<uint32_t> isSet =
lp_var_t<uint32_t>(sid.objectId, PoolIds::LATCHUP_RPT_TIME_IS_SET, this); lp_var_t<uint32_t>(sid.objectId, PoolIds::LATCHUP_RPT_TIME_IS_SET, this);
}; };
} // namespace PLOC_SPV } // namespace supv
#endif /* MISSION_DEVICES_DEVICEDEFINITIONS_PLOCSVPDEFINITIONS_H_ */ #endif /* MISSION_DEVICES_DEVICEDEFINITIONS_PLOCSVPDEFINITIONS_H_ */

View File

@ -2,4 +2,6 @@ target_sources(${OBSW_NAME} PRIVATE
PlocSupervisorHandler.cpp PlocSupervisorHandler.cpp
PlocUpdater.cpp PlocUpdater.cpp
PlocMemoryDumper.cpp PlocMemoryDumper.cpp
PlocMPSoCHandler.cpp
PlocMPSoCHelper.cpp
) )

View File

@ -0,0 +1,881 @@
#include "PlocMPSoCHandler.h"
#include "OBSWConfig.h"
#include "fsfw/datapool/PoolReadGuard.h"
#include "fsfw/globalfunctions/CRC.h"
#include "linux/devices/devicedefinitions/PlocSupervisorDefinitions.h"
PlocMPSoCHandler::PlocMPSoCHandler(object_id_t objectId, object_id_t uartComIFid,
CookieIF* comCookie, PlocMPSoCHelper* plocMPSoCHelper,
Gpio uartIsolatorSwitch, object_id_t supervisorHandler)
: DeviceHandlerBase(objectId, uartComIFid, comCookie),
plocMPSoCHelper(plocMPSoCHelper),
uartIsolatorSwitch(uartIsolatorSwitch),
supervisorHandler(supervisorHandler),
commandActionHelper(this) {
if (comCookie == nullptr) {
sif::error << "PlocMPSoCHandler: Invalid communication cookie" << std::endl;
}
eventQueue = QueueFactory::instance()->createMessageQueue(EventMessage::EVENT_MESSAGE_SIZE * 5);
commandActionHelperQueue =
QueueFactory::instance()->createMessageQueue(EventMessage::EVENT_MESSAGE_SIZE * 5);
}
PlocMPSoCHandler::~PlocMPSoCHandler() {}
ReturnValue_t PlocMPSoCHandler::initialize() {
ReturnValue_t result = RETURN_OK;
result = DeviceHandlerBase::initialize();
if (result != RETURN_OK) {
return result;
}
uartComIf = dynamic_cast<UartComIF*>(communicationInterface);
if (uartComIf == nullptr) {
sif::warning << "PlocMPSoCHandler::initialize: Invalid uart com if" << std::endl;
return ObjectManagerIF::CHILD_INIT_FAILED;
}
EventManagerIF* manager = ObjectManager::instance()->get<EventManagerIF>(objects::EVENT_MANAGER);
if (manager == nullptr) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "PlocMPSoCHandler::initialize: Invalid event manager" << std::endl;
#endif
return ObjectManagerIF::CHILD_INIT_FAILED;
;
}
result = manager->registerListener(eventQueue->getId());
if (result != RETURN_OK) {
return result;
}
result = manager->subscribeToEventRange(
eventQueue->getId(), event::getEventId(PlocMPSoCHelper::MPSOC_FLASH_WRITE_FAILED),
event::getEventId(PlocMPSoCHelper::MPSOC_FLASH_WRITE_SUCCESSFUL));
if (result != RETURN_OK) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "PlocMPSoCHandler::initialize: Failed to subscribe to events from "
" ploc mpsoc helper"
<< std::endl;
#endif
return ObjectManagerIF::CHILD_INIT_FAILED;
}
result = plocMPSoCHelper->setComIF(communicationInterface);
if (result != RETURN_OK) {
return ObjectManagerIF::CHILD_INIT_FAILED;
}
plocMPSoCHelper->setComCookie(comCookie);
plocMPSoCHelper->setSequenceCount(&sequenceCount);
result = commandActionHelper.initialize();
if (result != HasReturnvaluesIF::RETURN_OK) {
return ObjectManagerIF::CHILD_INIT_FAILED;
}
return result;
}
void PlocMPSoCHandler::performOperationHook() {
EventMessage event;
for (ReturnValue_t result = eventQueue->receiveMessage(&event); result == RETURN_OK;
result = eventQueue->receiveMessage(&event)) {
switch (event.getMessageId()) {
case EventMessage::EVENT_MESSAGE:
handleEvent(&event);
break;
default:
sif::debug << "PlocMPSoCHandler::performOperationHook: Did not subscribe to this event"
<< " message" << std::endl;
break;
}
}
CommandMessage message;
for (ReturnValue_t result = commandActionHelperQueue->receiveMessage(&message);
result == RETURN_OK; result = commandActionHelperQueue->receiveMessage(&message)) {
result = commandActionHelper.handleReply(&message);
if (result == RETURN_OK) {
continue;
}
}
}
ReturnValue_t PlocMPSoCHandler::executeAction(ActionId_t actionId, MessageQueueId_t commandedBy,
const uint8_t* data, size_t size) {
ReturnValue_t result = RETURN_OK;
if (plocMPSoCHelperExecuting) {
return MPSoCReturnValuesIF::MPSOC_HELPER_EXECUTING;
}
switch (actionId) {
case mpsoc::TC_FLASHWRITE: {
if (size > config::MAX_PATH_SIZE + config::MAX_FILENAME_SIZE) {
return MPSoCReturnValuesIF::FILENAME_TOO_LONG;
}
mpsoc::FlashWritePusCmd flashWritePusCmd;
result = flashWritePusCmd.extractFields(data, size);
if (result != RETURN_OK) {
return result;
}
result = plocMPSoCHelper->startFlashWrite(flashWritePusCmd.getObcFile(),
flashWritePusCmd.getMPSoCFile());
if (result != RETURN_OK) {
return result;
}
plocMPSoCHelperExecuting = true;
return EXECUTION_FINISHED;
}
case (mpsoc::OBSW_RESET_SEQ_COUNT): {
sequenceCount = 0;
return EXECUTION_FINISHED;
}
default:
break;
}
return DeviceHandlerBase::executeAction(actionId, commandedBy, data, size);
}
void PlocMPSoCHandler::doStartUp() {
switch (powerState) {
case PowerState::OFF:
commandActionHelper.commandAction(supervisorHandler, supv::START_MPSOC);
powerState = PowerState::BOOTING;
break;
case PowerState::ON:
setMode(_MODE_TO_ON);
uartIsolatorSwitch.pullHigh();
break;
default:
break;
}
}
void PlocMPSoCHandler::doShutDown() {
switch (powerState) {
case PowerState::ON:
uartIsolatorSwitch.pullLow();
commandActionHelper.commandAction(supervisorHandler, supv::SHUTDOWN_MPSOC);
powerState = PowerState::SHUTDOWN;
break;
case PowerState::OFF:
setMode(_MODE_POWER_DOWN);
break;
default:
break;
}
}
ReturnValue_t PlocMPSoCHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) {
return NOTHING_TO_SEND;
}
ReturnValue_t PlocMPSoCHandler::buildTransitionDeviceCommand(DeviceCommandId_t* id) {
return NOTHING_TO_SEND;
}
ReturnValue_t PlocMPSoCHandler::buildCommandFromCommand(DeviceCommandId_t deviceCommand,
const uint8_t* commandData,
size_t commandDataLen) {
ReturnValue_t result = RETURN_OK;
switch (deviceCommand) {
case (mpsoc::TC_MEM_WRITE): {
result = prepareTcMemWrite(commandData, commandDataLen);
break;
}
case (mpsoc::TC_MEM_READ): {
result = prepareTcMemRead(commandData, commandDataLen);
break;
}
case (mpsoc::TC_FLASHDELETE): {
result = prepareTcFlashDelete(commandData, commandDataLen);
break;
}
case (mpsoc::TC_REPLAY_START): {
result = prepareTcReplayStart(commandData, commandDataLen);
break;
}
case (mpsoc::TC_REPLAY_STOP): {
result = prepareTcReplayStop();
break;
}
case (mpsoc::TC_DOWNLINK_PWR_ON): {
result = prepareTcDownlinkPwrOn(commandData, commandDataLen);
break;
}
case (mpsoc::TC_DOWNLINK_PWR_OFF): {
result = prepareTcDownlinkPwrOff();
break;
}
case (mpsoc::TC_REPLAY_WRITE_SEQUENCE): {
result = prepareTcReplayWriteSequence(commandData, commandDataLen);
break;
}
case (mpsoc::TC_MODE_REPLAY): {
result = prepareTcModeReplay();
break;
}
default:
sif::debug << "PlocMPSoCHandler::buildCommandFromCommand: Command not implemented"
<< std::endl;
result = DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED;
break;
}
if (result == RETURN_OK) {
/**
* Flushing the receive buffer to make sure there are no data left from a faulty reply.
*/
uartComIf->flushUartRxBuffer(comCookie);
}
return result;
}
void PlocMPSoCHandler::fillCommandAndReplyMap() {
this->insertInCommandMap(mpsoc::TC_MEM_WRITE);
this->insertInCommandMap(mpsoc::TC_MEM_READ);
this->insertInCommandMap(mpsoc::TC_FLASHDELETE);
this->insertInCommandMap(mpsoc::TC_REPLAY_START);
this->insertInCommandMap(mpsoc::TC_REPLAY_STOP);
this->insertInCommandMap(mpsoc::TC_DOWNLINK_PWR_ON);
this->insertInCommandMap(mpsoc::TC_DOWNLINK_PWR_OFF);
this->insertInCommandMap(mpsoc::TC_REPLAY_WRITE_SEQUENCE);
this->insertInCommandMap(mpsoc::TC_MODE_REPLAY);
this->insertInReplyMap(mpsoc::ACK_REPORT, 1, nullptr, mpsoc::SIZE_ACK_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);
}
ReturnValue_t PlocMPSoCHandler::scanForReply(const uint8_t* start, size_t remainingSize,
DeviceCommandId_t* foundId, size_t* foundLen) {
ReturnValue_t result = RETURN_OK;
uint16_t apid = (*(start) << 8 | *(start + 1)) & APID_MASK;
switch (apid) {
case (mpsoc::apid::ACK_SUCCESS):
*foundLen = mpsoc::SIZE_ACK_REPORT;
*foundId = mpsoc::ACK_REPORT;
break;
case (mpsoc::apid::ACK_FAILURE):
*foundLen = mpsoc::SIZE_ACK_REPORT;
*foundId = mpsoc::ACK_REPORT;
break;
case (mpsoc::apid::TM_MEMORY_READ_REPORT):
*foundLen = tmMemReadReport.rememberRequestedSize;
*foundId = mpsoc::TM_MEMORY_READ_REPORT;
break;
case (mpsoc::apid::EXE_SUCCESS):
*foundLen = mpsoc::SIZE_EXE_REPORT;
*foundId = mpsoc::EXE_REPORT;
break;
case (mpsoc::apid::EXE_FAILURE):
*foundLen = mpsoc::SIZE_EXE_REPORT;
*foundId = mpsoc::EXE_REPORT;
break;
default: {
sif::debug << "PlocMPSoCHandler::scanForReply: Reply has invalid apid" << std::endl;
*foundLen = remainingSize;
return MPSoCReturnValuesIF::INVALID_APID;
}
}
sequenceCount++;
uint16_t recvSeqCnt = (*(start + 2) << 8 | *(start + 3)) & PACKET_SEQUENCE_COUNT_MASK;
if (recvSeqCnt != sequenceCount) {
triggerEvent(MPSOC_HANDLER_SEQ_CNT_MISMATCH, sequenceCount, recvSeqCnt);
sequenceCount = recvSeqCnt;
}
return result;
}
ReturnValue_t PlocMPSoCHandler::interpretDeviceReply(DeviceCommandId_t id, const uint8_t* packet) {
ReturnValue_t result = RETURN_OK;
switch (id) {
case mpsoc::ACK_REPORT: {
result = handleAckReport(packet);
break;
}
case (mpsoc::TM_MEMORY_READ_REPORT): {
result = handleMemoryReadReport(packet);
break;
}
case (mpsoc::EXE_REPORT): {
result = handleExecutionReport(packet);
break;
}
default: {
sif::debug << "PlocMPSoCHandler::interpretDeviceReply: Unknown device reply id" << std::endl;
return DeviceHandlerIF::UNKNOWN_DEVICE_REPLY;
}
}
return result;
}
void PlocMPSoCHandler::setNormalDatapoolEntriesInvalid() {}
uint32_t PlocMPSoCHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 5000; }
ReturnValue_t PlocMPSoCHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
LocalDataPoolManager& poolManager) {
return HasReturnvaluesIF::RETURN_OK;
}
void PlocMPSoCHandler::handleEvent(EventMessage* eventMessage) {
object_id_t objectId = eventMessage->getReporter();
switch (objectId) {
case objects::PLOC_MPSOC_HELPER: {
plocMPSoCHelperExecuting = false;
break;
}
default:
sif::debug << "PlocMPSoCHandler::handleEvent: Did not subscribe to this event" << std::endl;
break;
}
}
ReturnValue_t PlocMPSoCHandler::prepareTcMemWrite(const uint8_t* commandData,
size_t commandDataLen) {
ReturnValue_t result = RETURN_OK;
sequenceCount++;
mpsoc::TcMemWrite tcMemWrite(sequenceCount);
result = tcMemWrite.createPacket(commandData, commandDataLen);
if (result != RETURN_OK) {
sequenceCount--;
return result;
}
copyToCommandBuffer(&tcMemWrite);
return RETURN_OK;
}
ReturnValue_t PlocMPSoCHandler::prepareTcMemRead(const uint8_t* commandData,
size_t commandDataLen) {
ReturnValue_t result = RETURN_OK;
sequenceCount++;
mpsoc::TcMemRead tcMemRead(sequenceCount);
result = tcMemRead.createPacket(commandData, commandDataLen);
if (result != RETURN_OK) {
sequenceCount--;
return result;
}
copyToCommandBuffer(&tcMemRead);
tmMemReadReport.rememberRequestedSize = tcMemRead.getMemLen() * 4 + TmMemReadReport::FIX_SIZE;
return RETURN_OK;
}
ReturnValue_t PlocMPSoCHandler::prepareTcFlashDelete(const uint8_t* commandData,
size_t commandDataLen) {
if (commandDataLen > config::MAX_PATH_SIZE + config::MAX_FILENAME_SIZE) {
return MPSoCReturnValuesIF::NAME_TOO_LONG;
}
ReturnValue_t result = RETURN_OK;
sequenceCount++;
mpsoc::TcFlashDelete tcFlashDelete(sequenceCount);
result = tcFlashDelete.createPacket(
std::string(reinterpret_cast<const char*>(commandData), commandDataLen));
if (result != RETURN_OK) {
sequenceCount--;
return result;
}
copyToCommandBuffer(&tcFlashDelete);
return RETURN_OK;
}
ReturnValue_t PlocMPSoCHandler::prepareTcReplayStart(const uint8_t* commandData,
size_t commandDataLen) {
ReturnValue_t result = RETURN_OK;
sequenceCount++;
mpsoc::TcReplayStart tcReplayStart(sequenceCount);
result = tcReplayStart.createPacket(commandData, commandDataLen);
if (result != RETURN_OK) {
sequenceCount--;
return result;
}
copyToCommandBuffer(&tcReplayStart);
return RETURN_OK;
}
ReturnValue_t PlocMPSoCHandler::prepareTcReplayStop() {
ReturnValue_t result = RETURN_OK;
sequenceCount++;
mpsoc::TcReplayStop tcReplayStop(sequenceCount);
result = tcReplayStop.createPacket();
if (result != RETURN_OK) {
sequenceCount--;
return result;
}
copyToCommandBuffer(&tcReplayStop);
return RETURN_OK;
}
ReturnValue_t PlocMPSoCHandler::prepareTcDownlinkPwrOn(const uint8_t* commandData,
size_t commandDataLen) {
ReturnValue_t result = RETURN_OK;
sequenceCount++;
mpsoc::TcDownlinkPwrOn tcDownlinkPwrOn(sequenceCount);
result = tcDownlinkPwrOn.createPacket(commandData, commandDataLen);
if (result != RETURN_OK) {
sequenceCount--;
return result;
}
copyToCommandBuffer(&tcDownlinkPwrOn);
return RETURN_OK;
}
ReturnValue_t PlocMPSoCHandler::prepareTcDownlinkPwrOff() {
ReturnValue_t result = RETURN_OK;
sequenceCount++;
mpsoc::TcDownlinkPwrOff tcDownlinkPwrOff(sequenceCount);
result = tcDownlinkPwrOff.createPacket();
if (result != RETURN_OK) {
sequenceCount--;
return result;
}
copyToCommandBuffer(&tcDownlinkPwrOff);
return RETURN_OK;
}
ReturnValue_t PlocMPSoCHandler::prepareTcReplayWriteSequence(const uint8_t* commandData,
size_t commandDataLen) {
ReturnValue_t result = RETURN_OK;
sequenceCount++;
mpsoc::TcReplayWriteSeq tcReplayWriteSeq(sequenceCount);
result = tcReplayWriteSeq.createPacket(commandData, commandDataLen);
if (result != RETURN_OK) {
sequenceCount--;
return result;
}
copyToCommandBuffer(&tcReplayWriteSeq);
return RETURN_OK;
}
ReturnValue_t PlocMPSoCHandler::prepareTcModeReplay() {
ReturnValue_t result = RETURN_OK;
sequenceCount++;
mpsoc::TcModeReplay tcModeReplay(sequenceCount);
result = tcModeReplay.createPacket();
if (result != RETURN_OK) {
sequenceCount--;
return result;
}
memcpy(commandBuffer, tcModeReplay.getWholeData(), tcModeReplay.getFullSize());
rawPacket = commandBuffer;
rawPacketLen = tcModeReplay.getFullSize();
nextReplyId = mpsoc::ACK_REPORT;
return RETURN_OK;
}
void PlocMPSoCHandler::copyToCommandBuffer(mpsoc::TcBase* tc) {
if (tc == nullptr) {
sif::debug << "PlocMPSoCHandler::copyToCommandBuffer: Invalid TC" << std::endl;
}
memcpy(commandBuffer, tc->getWholeData(), tc->getFullSize());
rawPacket = commandBuffer;
rawPacketLen = tc->getFullSize();
nextReplyId = mpsoc::ACK_REPORT;
}
ReturnValue_t PlocMPSoCHandler::verifyPacket(const uint8_t* start, size_t foundLen) {
uint16_t receivedCrc = *(start + foundLen - 2) << 8 | *(start + foundLen - 1);
uint16_t recalculatedCrc = CRC::crc16ccitt(start, foundLen - 2);
if (receivedCrc != recalculatedCrc) {
return MPSoCReturnValuesIF::CRC_FAILURE;
}
return RETURN_OK;
}
ReturnValue_t PlocMPSoCHandler::handleAckReport(const uint8_t* data) {
ReturnValue_t result = RETURN_OK;
result = verifyPacket(data, mpsoc::SIZE_ACK_REPORT);
if (result == MPSoCReturnValuesIF::CRC_FAILURE) {
sif::warning << "PlocMPSoCHandler::handleAckReport: CRC failure" << std::endl;
nextReplyId = mpsoc::NONE;
replyRawReplyIfnotWiretapped(data, mpsoc::SIZE_ACK_REPORT);
triggerEvent(MPSOC_HANDLER_CRC_FAILURE);
sendFailureReport(mpsoc::ACK_REPORT, MPSoCReturnValuesIF::CRC_FAILURE);
disableAllReplies();
return IGNORE_REPLY_DATA;
}
uint16_t apid = (*(data) << 8 | *(data + 1)) & APID_MASK;
switch (apid) {
case mpsoc::apid::ACK_FAILURE: {
// TODO: Interpretation of status field in acknowledgment report
sif::debug << "PlocMPSoCHandler::handleAckReport: Received Ack failure report" << std::endl;
DeviceCommandId_t commandId = getPendingCommand();
uint16_t status = getStatus(data);
if (commandId != DeviceHandlerIF::NO_COMMAND_ID) {
triggerEvent(ACK_FAILURE, commandId, status);
}
sendFailureReport(mpsoc::ACK_REPORT, MPSoCReturnValuesIF::RECEIVED_ACK_FAILURE);
disableAllReplies();
nextReplyId = mpsoc::NONE;
result = IGNORE_REPLY_DATA;
break;
}
case mpsoc::apid::ACK_SUCCESS: {
setNextReplyId();
break;
}
default: {
sif::debug << "PlocMPSoCHandler::handleAckReport: Invalid APID in Ack report" << std::endl;
result = RETURN_FAILED;
break;
}
}
return result;
}
ReturnValue_t PlocMPSoCHandler::handleExecutionReport(const uint8_t* data) {
ReturnValue_t result = RETURN_OK;
result = verifyPacket(data, mpsoc::SIZE_EXE_REPORT);
if (result == MPSoCReturnValuesIF::CRC_FAILURE) {
sif::warning << "PlocMPSoCHandler::handleExecutionReport: CRC failure" << std::endl;
nextReplyId = mpsoc::NONE;
return result;
}
uint16_t apid = (*(data) << 8 | *(data + 1)) & APID_MASK;
switch (apid) {
case (mpsoc::apid::EXE_SUCCESS): {
break;
}
case (mpsoc::apid::EXE_FAILURE): {
// TODO: Interpretation of status field in execution report
sif::warning << "PlocMPSoCHandler::handleExecutionReport: Received execution failure report"
<< std::endl;
DeviceCommandId_t commandId = getPendingCommand();
if (commandId != DeviceHandlerIF::NO_COMMAND_ID) {
uint16_t status = getStatus(data);
triggerEvent(EXE_FAILURE, commandId, status);
} else {
sif::debug << "PlocMPSoCHandler::handleExecutionReport: Unknown command id" << std::endl;
}
printStatus(data);
sendFailureReport(mpsoc::EXE_REPORT, MPSoCReturnValuesIF::RECEIVED_EXE_FAILURE);
disableExeReportReply();
result = IGNORE_REPLY_DATA;
break;
}
default: {
sif::warning << "PlocMPSoCHandler::handleExecutionReport: Unknown APID" << std::endl;
result = RETURN_FAILED;
break;
}
}
nextReplyId = mpsoc::NONE;
return result;
}
ReturnValue_t PlocMPSoCHandler::handleMemoryReadReport(const uint8_t* data) {
ReturnValue_t result = RETURN_OK;
result = verifyPacket(data, tmMemReadReport.rememberRequestedSize);
if (result == MPSoCReturnValuesIF::CRC_FAILURE) {
sif::warning << "PlocMPSoCHandler::handleMemoryReadReport: Memory read report has invalid crc"
<< std::endl;
}
uint16_t memLen =
*(data + mpsoc::MEM_READ_RPT_LEN_OFFSET) << 8 | *(data + mpsoc::MEM_READ_RPT_LEN_OFFSET + 1);
/** Send data to commanding queue */
handleDeviceTM(data + mpsoc::DATA_FIELD_OFFSET, mpsoc::SIZE_MEM_READ_RPT_FIX + memLen * 4,
mpsoc::TM_MEMORY_READ_REPORT);
nextReplyId = mpsoc::EXE_REPORT;
return result;
}
ReturnValue_t PlocMPSoCHandler::enableReplyInReplyMap(DeviceCommandMap::iterator command,
uint8_t expectedReplies, bool useAlternateId,
DeviceCommandId_t alternateReplyID) {
ReturnValue_t result = RETURN_OK;
uint8_t enabledReplies = 0;
switch (command->first) {
case mpsoc::TC_MEM_WRITE:
case mpsoc::TC_FLASHDELETE:
case mpsoc::TC_REPLAY_START:
case mpsoc::TC_REPLAY_STOP:
case mpsoc::TC_DOWNLINK_PWR_ON:
case mpsoc::TC_DOWNLINK_PWR_OFF:
case mpsoc::TC_REPLAY_WRITE_SEQUENCE:
case mpsoc::TC_MODE_REPLAY:
enabledReplies = 2;
break;
case mpsoc::TC_MEM_READ: {
enabledReplies = 3;
result = DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true,
mpsoc::TM_MEMORY_READ_REPORT);
if (result != RETURN_OK) {
sif::debug << "PlocMPSoCHandler::enableReplyInReplyMap: Reply with id "
<< mpsoc::TM_MEMORY_READ_REPORT << " not in replyMap" << std::endl;
}
break;
}
case mpsoc::OBSW_RESET_SEQ_COUNT:
break;
default:
sif::debug << "PlocMPSoCHandler::enableReplyInReplyMap: Unknown command id" << std::endl;
break;
}
/**
* Every command causes at least one acknowledgment and one execution report. Therefore both
* replies will be enabled here.
*/
result =
DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, mpsoc::ACK_REPORT);
if (result != RETURN_OK) {
sif::debug << "PlocMPSoCHandler::enableReplyInReplyMap: Reply with id " << mpsoc::ACK_REPORT
<< " not in replyMap" << std::endl;
}
result =
DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, mpsoc::EXE_REPORT);
if (result != RETURN_OK) {
sif::debug << "PlocMPSoCHandler::enableReplyInReplyMap: Reply with id " << mpsoc::EXE_REPORT
<< " not in replyMap" << std::endl;
}
switch (command->first) {
case mpsoc::TC_REPLAY_WRITE_SEQUENCE: {
DeviceReplyIter iter = deviceReplyMap.find(mpsoc::EXE_REPORT);
// Overwrite delay cycles because replay write sequence command can required up to
// 30 seconds for execution
iter->second.delayCycles = mpsoc::TC_WRITE_SEQ_EXECUTION_DELAY;
break;
}
case mpsoc::TC_DOWNLINK_PWR_ON: {
DeviceReplyIter iter = deviceReplyMap.find(mpsoc::EXE_REPORT);
//
iter->second.delayCycles = mpsoc::TC_DOWNLINK_PWR_ON;
break;
}
default:
break;
}
return RETURN_OK;
}
void PlocMPSoCHandler::setNextReplyId() {
switch (getPendingCommand()) {
case mpsoc::TC_MEM_READ:
nextReplyId = mpsoc::TM_MEMORY_READ_REPORT;
break;
default:
/* If no telemetry is expected the next reply is always the execution report */
nextReplyId = mpsoc::EXE_REPORT;
break;
}
}
size_t PlocMPSoCHandler::getNextReplyLength(DeviceCommandId_t commandId) {
size_t replyLen = 0;
if (nextReplyId == mpsoc::NONE) {
return replyLen;
}
DeviceReplyIter iter = deviceReplyMap.find(nextReplyId);
if (iter != deviceReplyMap.end()) {
if (iter->second.delayCycles == 0) {
/* Reply inactive */
return replyLen;
}
switch (nextReplyId) {
case mpsoc::TM_MEMORY_READ_REPORT: {
replyLen = tmMemReadReport.rememberRequestedSize;
break;
}
default: {
replyLen = iter->second.replyLen;
break;
}
}
} else {
sif::debug << "PlocMPSoCHandler::getNextReplyLength: No entry for reply with reply id "
<< std::hex << nextReplyId << " in deviceReplyMap" << std::endl;
}
return replyLen;
}
MessageQueueIF* PlocMPSoCHandler::getCommandQueuePtr() { return commandActionHelperQueue; }
void PlocMPSoCHandler::stepSuccessfulReceived(ActionId_t actionId, uint8_t step) { return; }
void PlocMPSoCHandler::stepFailedReceived(ActionId_t actionId, uint8_t step,
ReturnValue_t returnCode) {
switch (actionId) {
case supv::START_MPSOC:
sif::warning << "PlocMPSoCHandler::stepFailedReceived: Failed to start MPSoC" << std::endl;
powerState = PowerState::OFF;
break;
case supv::SHUTDOWN_MPSOC:
triggerEvent(MPSOC_SHUTDOWN_FAILED);
sif::warning << "PlocMPSoCHandler::stepFailedReceived: Failed to shutdown MPSoC" << std::endl;
// TODO: Setting state to on or off here?
powerState = PowerState::ON;
break;
default:
sif::debug << "PlocMPSoCHandler::stepFailedReceived: Received unexpected action reply"
<< std::endl;
break;
}
}
void PlocMPSoCHandler::dataReceived(ActionId_t actionId, const uint8_t* data, uint32_t size) {
return;
}
void PlocMPSoCHandler::completionSuccessfulReceived(ActionId_t actionId) {
if (actionId != supv::EXE_REPORT) {
sif::debug << "PlocMPSoCHandler::completionSuccessfulReceived: Did not expect this action "
<< "ID" << std::endl;
return;
}
switch (powerState) {
case PowerState::BOOTING: {
powerState = PowerState::ON;
break;
}
case PowerState::SHUTDOWN: {
powerState = PowerState::OFF;
break;
}
default: {
break;
}
}
}
void PlocMPSoCHandler::completionFailedReceived(ActionId_t actionId, ReturnValue_t returnCode) {
handleActionCommandFailure(actionId);
}
void PlocMPSoCHandler::handleDeviceTM(const uint8_t* data, size_t dataSize,
DeviceCommandId_t replyId) {
ReturnValue_t result = RETURN_OK;
if (wiretappingMode == RAW) {
/* Data already sent in doGetRead() */
return;
}
DeviceReplyMap::iterator iter = deviceReplyMap.find(replyId);
if (iter == deviceReplyMap.end()) {
sif::debug << "PlocMPSoCHandler::handleDeviceTM: Unknown reply id" << std::endl;
return;
}
MessageQueueId_t queueId = iter->second.command->second.sendReplyTo;
if (queueId == NO_COMMANDER) {
return;
}
result = actionHelper.reportData(queueId, replyId, data, dataSize);
if (result != RETURN_OK) {
sif::debug << "PlocMPSoCHandler::handleDeviceTM: Failed to report data" << std::endl;
}
}
void PlocMPSoCHandler::disableAllReplies() {
DeviceReplyMap::iterator iter;
/* Disable ack reply */
iter = deviceReplyMap.find(mpsoc::ACK_REPORT);
DeviceReplyInfo* info = &(iter->second);
info->delayCycles = 0;
info->command = deviceCommandMap.end();
DeviceCommandId_t commandId = getPendingCommand();
/* If the command expects a telemetry packet the appropriate tm reply will be disabled here */
switch (commandId) {
case mpsoc::TC_MEM_WRITE:
break;
case mpsoc::TC_MEM_READ: {
iter = deviceReplyMap.find(mpsoc::TM_MEMORY_READ_REPORT);
info = &(iter->second);
info->delayCycles = 0;
info->command = deviceCommandMap.end();
break;
}
default: {
sif::debug << "PlocMPSoCHandler::disableAllReplies: Unknown command id" << commandId
<< std::endl;
break;
}
}
/* We always need to disable the execution report reply here */
disableExeReportReply();
nextReplyId = mpsoc::NONE;
}
void PlocMPSoCHandler::sendFailureReport(DeviceCommandId_t replyId, ReturnValue_t status) {
DeviceReplyIter iter = deviceReplyMap.find(replyId);
if (iter == deviceReplyMap.end()) {
sif::debug << "PlocMPSoCHandler::sendFailureReport: Reply not in reply map" << std::endl;
return;
}
DeviceCommandInfo* info = &(iter->second.command->second);
if (info == nullptr) {
sif::debug << "PlocMPSoCHandler::sendFailureReport: Reply has no active command" << std::endl;
return;
}
if (info->sendReplyTo != NO_COMMANDER) {
actionHelper.finish(false, info->sendReplyTo, iter->first, status);
}
info->isExecuting = false;
}
void PlocMPSoCHandler::disableExeReportReply() {
DeviceReplyIter iter = deviceReplyMap.find(mpsoc::EXE_REPORT);
DeviceReplyInfo* info = &(iter->second);
info->delayCycles = 0;
info->command = deviceCommandMap.end();
/* Expected replies is set to one here. The value will be set to 0 in replyToReply() */
info->command->second.expectedReplies = 0;
}
void PlocMPSoCHandler::printStatus(const uint8_t* data) {
uint16_t status = *(data + STATUS_OFFSET) << 8 | *(data + STATUS_OFFSET + 1);
sif::info << "Verification report status: 0x" << std::hex << status << std::endl;
}
uint16_t PlocMPSoCHandler::getStatus(const uint8_t* data) {
return *(data + STATUS_OFFSET) << 8 | *(data + STATUS_OFFSET + 1);
}
void PlocMPSoCHandler::handleActionCommandFailure(ActionId_t actionId) {
switch (actionId) {
case supv::ACK_REPORT:
case supv::EXE_REPORT:
break;
default:
sif::debug << "PlocMPSoCHandler::handleActionCommandFailure: Did not expect this action ID "
<< std::endl;
return;
}
switch (powerState) {
case PowerState::BOOTING: {
sif::warning << "PlocMPSoCHandler::handleActionCommandFailure: Failed to boot MPSoC"
<< std::endl;
powerState = PowerState::OFF;
break;
}
case PowerState::SHUTDOWN: {
sif::warning << "PlocMPSoCHandler::handleActionCommandFailure: Failed to shutdown MPSoC"
<< std::endl;
powerState = PowerState::ON;
break;
}
default:
break;
}
return;
}

View File

@ -0,0 +1,246 @@
#ifndef BSP_Q7S_DEVICES_PLOC_PLOCMPSOCHANDLER_H_
#define BSP_Q7S_DEVICES_PLOC_PLOCMPSOCHANDLER_H_
#include <string>
#include "PlocMPSoCHelper.h"
#include "fsfw/action/CommandActionHelper.h"
#include "fsfw/action/CommandsActionsIF.h"
#include "fsfw/devicehandlers/DeviceHandlerBase.h"
#include "fsfw/ipc/QueueFactory.h"
#include "fsfw/tmtcservices/SourceSequenceCounter.h"
#include "fsfw_hal/linux/gpio/Gpio.h"
#include "fsfw_hal/linux/uart/UartComIF.h"
#include "linux/devices/devicedefinitions/MPSoCReturnValuesIF.h"
#include "linux/devices/devicedefinitions/PlocMPSoCDefinitions.h"
/**
* @brief This is the device handler for the MPSoC of the payload computer.
*
* @details The PLOC uses the space packet protocol for communication. Each command will be
* answered with at least one acknowledgment and one execution report.
* Flight manual:
* https://egit.irs.uni-stuttgart.de/redmine/projects/eive-flight-manual/wiki/PLOC_MPSoC ICD:
* https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files/?dir=/EIVE_TAS-ILH-IRS/ICD-PLOC/ILH&fileid=1030263
*
* @note The sequence count in the space packets must be incremented with each received and sent
* packet otherwise the MPSoC will reply with an acknowledgment failure report.
*
* @author J. Meier
*/
class PlocMPSoCHandler : public DeviceHandlerBase, public CommandsActionsIF {
public:
/**
* @brief Constructor
*
* @param ojectId Object ID of the MPSoC handler
* @param uartcomIFid Object ID of the UART communication interface
* @param comCookie UART communication cookie
* @param plocMPSoCHelper Pointer to MPSoC helper object
* @param uartIsolatorSwitch Gpio object representing the GPIO connected to the UART isolator
* module in the programmable logic
* @param supervisorHandler Object ID of the supervisor handler
*/
PlocMPSoCHandler(object_id_t objectId, object_id_t uartComIFid, CookieIF* comCookie,
PlocMPSoCHelper* plocMPSoCHelper, Gpio uartIsolatorSwitch,
object_id_t supervisorHandler);
virtual ~PlocMPSoCHandler();
virtual ReturnValue_t initialize() override;
ReturnValue_t executeAction(ActionId_t actionId, MessageQueueId_t commandedBy,
const uint8_t* data, size_t size) override;
void performOperationHook() 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;
protected:
void doStartUp() override;
void doShutDown() override;
ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t* id) override;
ReturnValue_t buildTransitionDeviceCommand(DeviceCommandId_t* id) override;
void fillCommandAndReplyMap() override;
ReturnValue_t buildCommandFromCommand(DeviceCommandId_t deviceCommand, const uint8_t* commandData,
size_t commandDataLen) override;
ReturnValue_t scanForReply(const uint8_t* start, size_t remainingSize, DeviceCommandId_t* foundId,
size_t* foundLen) override;
ReturnValue_t interpretDeviceReply(DeviceCommandId_t id, const uint8_t* packet) override;
void setNormalDatapoolEntriesInvalid() override;
uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override;
ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
LocalDataPoolManager& poolManager) override;
ReturnValue_t enableReplyInReplyMap(DeviceCommandMap::iterator command,
uint8_t expectedReplies = 1, bool useAlternateId = false,
DeviceCommandId_t alternateReplyID = 0) override;
size_t getNextReplyLength(DeviceCommandId_t deviceCommand) override;
private:
static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::PLOC_MPSOC_HANDLER;
//! [EXPORT] : [COMMENT] PLOC crc failure in telemetry packet
static const Event MEMORY_READ_RPT_CRC_FAILURE = MAKE_EVENT(1, severity::LOW);
//! [EXPORT] : [COMMENT] 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
static const Event ACK_FAILURE = MAKE_EVENT(2, severity::LOW);
//! [EXPORT] : [COMMENT] 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
static const Event EXE_FAILURE = MAKE_EVENT(3, severity::LOW);
//! [EXPORT] : [COMMENT] PLOC reply has invalid crc
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
//! count P1: Expected sequence count P2: Received sequence count
static const Event MPSOC_HANDLER_SEQ_CNT_MISMATCH = MAKE_EVENT(5, severity::LOW);
//! [EXPORT] : [COMMENT] Supervisor fails to shutdown MPSoC. Requires to power off the PLOC and
//! thus also to shutdown the supervisor.
static const Event MPSOC_SHUTDOWN_FAILED = MAKE_EVENT(6, severity::HIGH);
static const uint16_t APID_MASK = 0x7FF;
static const uint16_t PACKET_SEQUENCE_COUNT_MASK = 0x3FFF;
static const uint8_t STATUS_OFFSET = 10;
MessageQueueIF* eventQueue = nullptr;
MessageQueueIF* commandActionHelperQueue = nullptr;
SourceSequenceCounter sequenceCount;
uint8_t commandBuffer[mpsoc::MAX_COMMAND_SIZE];
/**
* This variable is used to store the id of the next reply to receive. This is necessary
* because the PLOC sends as reply to each command at least one acknowledgment and execution
* report.
*/
DeviceCommandId_t nextReplyId = mpsoc::NONE;
UartComIF* uartComIf = nullptr;
PlocMPSoCHelper* plocMPSoCHelper = nullptr;
Gpio uartIsolatorSwitch;
object_id_t supervisorHandler = 0;
CommandActionHelper commandActionHelper;
// Used to block incoming commands when MPSoC helper class is currently executing a command
bool plocMPSoCHelperExecuting = false;
class TmMemReadReport {
public:
static const uint8_t FIX_SIZE = 14;
size_t rememberRequestedSize = 0;
};
TmMemReadReport tmMemReadReport;
enum class PowerState { OFF, BOOTING, SHUTDOWN, ON };
PowerState powerState = PowerState::OFF;
/**
* @brief Handles events received from the PLOC MPSoC helper
*/
void handleEvent(EventMessage* eventMessage);
ReturnValue_t prepareTcMemWrite(const uint8_t* commandData, size_t commandDataLen);
ReturnValue_t prepareTcMemRead(const uint8_t* commandData, size_t commandDataLen);
ReturnValue_t prepareTcFlashDelete(const uint8_t* commandData, size_t commandDataLen);
ReturnValue_t prepareTcReplayStart(const uint8_t* commandData, size_t commandDataLen);
ReturnValue_t prepareTcReplayStop();
ReturnValue_t prepareTcDownlinkPwrOn(const uint8_t* commandData, size_t commandDataLen);
ReturnValue_t prepareTcDownlinkPwrOff();
ReturnValue_t prepareTcReplayWriteSequence(const uint8_t* commandData, size_t commandDataLen);
/**
* @brief Copies space packet into command buffer
*/
void copyToCommandBuffer(mpsoc::TcBase* tc);
/**
* @brief This function checks the crc of the received PLOC reply.
*
* @param start Pointer to the first byte of the reply.
* @param foundLen Pointer to the length of the whole packet.
*
* @return RETURN_OK if CRC is ok, otherwise CRC_FAILURE.
*/
ReturnValue_t verifyPacket(const uint8_t* start, size_t foundLen);
/**
* @brief This function handles the acknowledgment report.
*
* @param data Pointer to the data holding the acknowledgment report.
*
* @return RETURN_OK if successful, otherwise an error code.
*/
ReturnValue_t handleAckReport(const uint8_t* data);
/**
* @brief This function handles the data of a execution report.
*
* @param data Pointer to the received data packet.
*
* @return RETURN_OK if successful, otherwise an error code.
*/
ReturnValue_t handleExecutionReport(const uint8_t* data);
/**
* @brief This function handles the memory read report.
*
* @param data Pointer to the data buffer holding the memory read report.
*
* @return RETURN_OK if successful, otherwise an error code.
*/
ReturnValue_t handleMemoryReadReport(const uint8_t* data);
/**
* @brief Depending on the current active command, this function sets the reply id of the
* next reply after a successful acknowledgment report has been received. This is
* required by the function getNextReplyLength() to identify the length of the next
* reply to read.
*/
void setNextReplyId();
/**
* @brief This function handles action message replies in case the telemetry has been
* requested by another object.
*
* @param data Pointer to the telemetry data.
* @param dataSize Size of telemetry in bytes.
* @param replyId Id of the reply. This will be added to the ActionMessage.
*/
void handleDeviceTM(const uint8_t* data, size_t dataSize, DeviceCommandId_t replyId);
/**
* @brief In case an acknowledgment failure reply has been received this function disables
* all previously enabled commands and resets the exepected replies variable of an
* active command.
*/
void disableAllReplies();
/**
* @brief This function sends a failure report if the active action was commanded by an other
* object.
*
* @param replyId The id of the reply which signals a failure.
* @param status A status byte which gives information about the failure type.
*/
void sendFailureReport(DeviceCommandId_t replyId, ReturnValue_t status);
/**
* @brief This function disables the execution report reply. Within this function also the
* the variable expectedReplies of an active command will be set to 0.
*/
void disableExeReportReply();
void printStatus(const uint8_t* data);
ReturnValue_t prepareTcModeReplay();
uint16_t getStatus(const uint8_t* data);
void handleActionCommandFailure(ActionId_t actionId);
};
#endif /* BSP_Q7S_DEVICES_PLOC_PLOCMPSOCHANDLER_H_ */

View File

@ -0,0 +1,321 @@
#include "PlocMPSoCHelper.h"
#include <filesystem>
#include <fstream>
#include "OBSWConfig.h"
#ifdef XIPHOS_Q7S
#include "bsp_q7s/memory/FilesystemHelper.h"
#endif
#include "mission/utility/Timestamp.h"
PlocMPSoCHelper::PlocMPSoCHelper(object_id_t objectId) : SystemObject(objectId) {}
PlocMPSoCHelper::~PlocMPSoCHelper() {}
ReturnValue_t PlocMPSoCHelper::initialize() {
#ifdef XIPHOS_Q7S
sdcMan = SdCardManager::instance();
if (sdcMan == nullptr) {
sif::warning << "PlocMPSoCHelper::initialize: Invalid SD Card Manager" << std::endl;
return RETURN_FAILED;
}
#endif
return RETURN_OK;
}
ReturnValue_t PlocMPSoCHelper::performOperation(uint8_t operationCode) {
ReturnValue_t result = RETURN_OK;
semaphore.acquire();
while (true) {
switch (internalState) {
case InternalState::IDLE: {
semaphore.acquire();
break;
}
case InternalState::FLASH_WRITE: {
result = performFlashWrite();
if (result == RETURN_OK) {
triggerEvent(MPSOC_FLASH_WRITE_SUCCESSFUL);
} else {
triggerEvent(MPSOC_FLASH_WRITE_FAILED);
}
internalState = InternalState::IDLE;
break;
}
default:
sif::debug << "PlocMPSoCHelper::performOperation: Invalid state" << std::endl;
break;
}
}
}
ReturnValue_t PlocMPSoCHelper::setComIF(DeviceCommunicationIF* communicationInterface_) {
uartComIF = dynamic_cast<UartComIF*>(communicationInterface_);
if (uartComIF == nullptr) {
sif::warning << "PlocMPSoCHelper::initialize: Invalid uart com if" << std::endl;
return RETURN_FAILED;
}
return RETURN_OK;
}
void PlocMPSoCHelper::setComCookie(CookieIF* comCookie_) { comCookie = comCookie_; }
void PlocMPSoCHelper::setSequenceCount(SourceSequenceCounter* sequenceCount_) {
sequenceCount = sequenceCount_;
}
ReturnValue_t PlocMPSoCHelper::startFlashWrite(std::string obcFile, std::string mpsocFile) {
ReturnValue_t result = RETURN_OK;
#ifdef XIPHOS_Q7S
result = FilesystemHelper::checkPath(obcFile);
if (result != RETURN_OK) {
return result;
}
result = FilesystemHelper::fileExists(mpsocFile);
if (result != RETURN_OK) {
return result;
}
#endif
#ifdef TE0720_1CFA
if (not std::filesystem::exists(obcFile)) {
sif::warning << "PlocMPSoCHelper::startFlashWrite: File " << obcFile << "does not exist"
<< std::endl;
return RETURN_FAILED;
}
#endif
flashWrite.obcFile = obcFile;
flashWrite.mpsocFile = mpsocFile;
internalState = InternalState::FLASH_WRITE;
result = resetHelper();
if (result != RETURN_OK) {
return result;
}
return result;
}
ReturnValue_t PlocMPSoCHelper::resetHelper() {
ReturnValue_t result = RETURN_OK;
semaphore.release();
terminate = false;
result = uartComIF->flushUartRxBuffer(comCookie);
return result;
}
void PlocMPSoCHelper::stopProcess() { terminate = true; }
ReturnValue_t PlocMPSoCHelper::performFlashWrite() {
ReturnValue_t result = RETURN_OK;
result = flashfopen();
if (result != RETURN_OK) {
return result;
}
uint8_t tempData[mpsoc::MAX_DATA_SIZE];
std::ifstream file(flashWrite.obcFile, std::ifstream::binary);
// Set position of next character to end of file input stream
file.seekg(0, file.end);
// tellg returns position of character in input stream
size_t remainingSize = file.tellg();
size_t dataLength = 0;
size_t bytesRead = 0;
while (remainingSize > 0) {
if (terminate) {
return RETURN_OK;
}
if (remainingSize > mpsoc::MAX_DATA_SIZE) {
dataLength = mpsoc::MAX_DATA_SIZE;
} else {
dataLength = remainingSize;
}
if (file.is_open()) {
file.seekg(bytesRead, file.beg);
file.read(reinterpret_cast<char*>(tempData), dataLength);
bytesRead += dataLength;
remainingSize -= dataLength;
} else {
return FILE_CLOSED_ACCIDENTALLY;
}
(*sequenceCount)++;
mpsoc::TcFlashWrite tc(*sequenceCount);
tc.createPacket(tempData, dataLength);
result = handlePacketTransmission(tc);
if (result != RETURN_OK) {
return result;
}
}
result = flashfclose();
if (result != RETURN_OK) {
return result;
}
return result;
}
ReturnValue_t PlocMPSoCHelper::flashfopen() {
ReturnValue_t result = RETURN_OK;
(*sequenceCount)++;
mpsoc::FlashFopen flashFopen(*sequenceCount);
result = flashFopen.createPacket(flashWrite.mpsocFile, mpsoc::FlashFopen::APPEND);
if (result != RETURN_OK) {
return result;
}
result = handlePacketTransmission(flashFopen);
if (result != RETURN_OK) {
return result;
}
return RETURN_OK;
}
ReturnValue_t PlocMPSoCHelper::flashfclose() {
ReturnValue_t result = RETURN_OK;
(*sequenceCount)++;
mpsoc::FlashFclose flashFclose(*sequenceCount);
result = flashFclose.createPacket(flashWrite.mpsocFile);
if (result != RETURN_OK) {
return result;
}
result = handlePacketTransmission(flashFclose);
if (result != RETURN_OK) {
return result;
}
return RETURN_OK;
}
ReturnValue_t PlocMPSoCHelper::handlePacketTransmission(mpsoc::TcBase& tc) {
ReturnValue_t result = RETURN_OK;
result = sendCommand(tc);
if (result != RETURN_OK) {
return result;
}
result = handleAck();
if (result != RETURN_OK) {
return result;
}
result = handleExe();
if (result != RETURN_OK) {
return result;
}
return RETURN_OK;
}
ReturnValue_t PlocMPSoCHelper::sendCommand(mpsoc::TcBase& tc) {
ReturnValue_t result = RETURN_OK;
result = uartComIF->sendMessage(comCookie, tc.getWholeData(), tc.getFullSize());
if (result != RETURN_OK) {
sif::warning << "PlocMPSoCHelper::sendCommand: Failed to send command" << std::endl;
triggerEvent(SENDING_COMMAND_FAILED, result, static_cast<uint32_t>(internalState));
return result;
}
return result;
}
ReturnValue_t PlocMPSoCHelper::handleAck() {
ReturnValue_t result = RETURN_OK;
mpsoc::TmPacket tmPacket;
result = handleTmReception(&tmPacket, mpsoc::SIZE_ACK_REPORT);
if (result != RETURN_OK) {
return result;
}
uint16_t apid = tmPacket.getAPID();
if (apid != mpsoc::apid::ACK_SUCCESS) {
handleAckApidFailure(apid);
return RETURN_FAILED;
}
return RETURN_OK;
}
void PlocMPSoCHelper::handleAckApidFailure(uint16_t apid) {
if (apid == mpsoc::apid::ACK_FAILURE) {
triggerEvent(ACK_FAILURE_REPORT, static_cast<uint32_t>(internalState));
sif::warning << "PlocMPSoCHelper::handleAckApidFailure: Received acknowledgement failure "
<< "report" << std::endl;
} else {
triggerEvent(ACK_INVALID_APID, apid, static_cast<uint32_t>(internalState));
sif::warning << "PlocMPSoCHelper::handleAckApidFailure: Expected acknowledgement report "
<< "but received space packet with apid " << std::hex << apid << std::endl;
}
}
ReturnValue_t PlocMPSoCHelper::handleExe() {
ReturnValue_t result = RETURN_OK;
mpsoc::TmPacket tmPacket;
result = handleTmReception(&tmPacket, mpsoc::SIZE_EXE_REPORT);
if (result != RETURN_OK) {
return result;
}
uint16_t apid = tmPacket.getAPID();
if (apid != mpsoc::apid::EXE_SUCCESS) {
handleExeApidFailure(apid);
return RETURN_FAILED;
}
return RETURN_OK;
}
void PlocMPSoCHelper::handleExeApidFailure(uint16_t apid) {
if (apid == mpsoc::apid::EXE_FAILURE) {
triggerEvent(EXE_FAILURE_REPORT, static_cast<uint32_t>(internalState));
sif::warning << "PlocMPSoCHelper::handleExeApidFailure: Received execution failure "
<< "report" << std::endl;
} else {
triggerEvent(EXE_INVALID_APID, apid, static_cast<uint32_t>(internalState));
sif::warning << "PlocMPSoCHelper::handleExeApidFailure: Expected execution report "
<< "but received space packet with apid " << std::hex << apid << std::endl;
}
}
ReturnValue_t PlocMPSoCHelper::handleTmReception(mpsoc::TmPacket* tmPacket, size_t remainingBytes) {
ReturnValue_t result = RETURN_OK;
size_t readBytes = 0;
size_t currentBytes = 0;
for (int retries = 0; retries < RETRIES; retries++) {
result = receive(tmPacket->getWholeData() + readBytes, &currentBytes, remainingBytes);
if (result != RETURN_OK) {
return result;
}
readBytes += currentBytes;
remainingBytes = remainingBytes - currentBytes;
if (remainingBytes == 0) {
break;
}
}
if (remainingBytes != 0) {
sif::warning << "PlocMPSoCHelper::handleTmReception: Failed to receive reply" << std::endl;
triggerEvent(MISSING_EXE, remainingBytes, static_cast<uint32_t>(internalState));
return RETURN_FAILED;
}
result = tmPacket->checkCrc();
if (result != RETURN_OK) {
sif::warning << "PlocMPSoCHelper::handleTmReception: CRC check failed" << std::endl;
return result;
}
(*sequenceCount)++;
uint16_t recvSeqCnt = tmPacket->getPacketSequenceCount();
if (recvSeqCnt != *sequenceCount) {
triggerEvent(MPSOC_HELPER_SEQ_CNT_MISMATCH, *sequenceCount, recvSeqCnt);
*sequenceCount = recvSeqCnt;
}
return result;
}
ReturnValue_t PlocMPSoCHelper::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 << "PlocMPSoCHelper::receive: Failed to request reply" << std::endl;
triggerEvent(MPSOC_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 << "PlocMPSoCHelper::receive: Failed to read received message" << std::endl;
triggerEvent(MPSOC_HELPER_READING_REPLY_FAILED, result, static_cast<uint32_t>(internalState));
return RETURN_FAILED;
}
if (*readBytes > 0) {
std::memcpy(data, buffer, *readBytes);
}
return result;
}

View File

@ -0,0 +1,153 @@
#ifndef BSP_Q7S_DEVICES_PLOCMPSOCHELPER_H_
#define BSP_Q7S_DEVICES_PLOCMPSOCHELPER_H_
#include <string>
#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/tmtcservices/SourceSequenceCounter.h"
#include "fsfw_hal/linux/uart/UartComIF.h"
#include "linux/devices/devicedefinitions/PlocMPSoCDefinitions.h"
#ifdef XIPHOS_Q7S
#include "bsp_q7s/memory/SdCardManager.h"
#endif
/**
* @brief Helper class for MPSoC of PLOC intended to accelerate large data transfers between
* MPSoC and OBC.
* @author J. Meier
*/
class PlocMPSoCHelper : public SystemObject, public ExecutableObjectIF, public HasReturnvaluesIF {
public:
static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::PLOC_MPSOC_HELPER;
//! [EXPORT] : [COMMENT] Flash write fails
static const Event MPSOC_FLASH_WRITE_FAILED = MAKE_EVENT(0, severity::LOW);
//! [EXPORT] : [COMMENT] Flash write successful
static const Event MPSOC_FLASH_WRITE_SUCCESSFUL = MAKE_EVENT(1, severity::LOW);
//! [EXPORT] : [COMMENT] Communication interface returned failure when trying to send the command
//! ot the PLOC
//! P1: Return value returned by the communication interface sendMessage function
//! P2: Internal state of MPSoC helper
static const Event SENDING_COMMAND_FAILED = MAKE_EVENT(2, 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 MPSoC helper
static const Event MPSOC_HELPER_REQUESTING_REPLY_FAILED = MAKE_EVENT(3, 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 MPSoC helper
static const Event MPSOC_HELPER_READING_REPLY_FAILED = MAKE_EVENT(4, severity::LOW);
//! [EXPORT] : [COMMENT] Did not receive acknowledgement report
//! P1: Number of bytes missing
//! P2: Internal state of MPSoC helper
static const Event MISSING_ACK = MAKE_EVENT(5, severity::LOW);
//! [EXPORT] : [COMMENT] Did not receive execution report
//! P1: Number of bytes missing
//! P2: Internal state of MPSoC helper
static const Event MISSING_EXE = MAKE_EVENT(6, severity::LOW);
//! [EXPORT] : [COMMENT] Received acknowledgement failure report
//! P1: Internal state of MPSoC
static const Event ACK_FAILURE_REPORT = MAKE_EVENT(7, severity::LOW);
//! [EXPORT] : [COMMENT] Received execution failure report
//! P1: Internal state of MPSoC
static const Event EXE_FAILURE_REPORT = MAKE_EVENT(8, severity::LOW);
//! [EXPORT] : [COMMENT] Expected acknowledgement report but received space packet with other apid
//! P1: Apid of received space packet
//! P2: Internal state of MPSoC
static const Event ACK_INVALID_APID = MAKE_EVENT(9, severity::LOW);
//! [EXPORT] : [COMMENT] Expected execution report but received space packet with other apid
//! P1: Apid of received space packet
//! P2: Internal state of MPSoC
static const Event EXE_INVALID_APID = MAKE_EVENT(10, severity::LOW);
//! [EXPORT] : [COMMENT] Received sequence count does not match expected sequence count
//! P1: Expected sequence count
//! P2: Received sequence count
static const Event MPSOC_HELPER_SEQ_CNT_MISMATCH = MAKE_EVENT(11, severity::LOW);
PlocMPSoCHelper(object_id_t objectId);
virtual ~PlocMPSoCHelper();
ReturnValue_t initialize() override;
ReturnValue_t performOperation(uint8_t operationCode = 0) override;
ReturnValue_t setComIF(DeviceCommunicationIF* communicationInterface_);
void setComCookie(CookieIF* comCookie_);
/**
* @brief Starts flash write sequence
*
* @param obcFile File where to read from the data
* @param mpsocFile The file of the MPSoC where should be written to
*
* @return RETURN_OK if successful, otherwise error return value
*/
ReturnValue_t startFlashWrite(std::string obcFile, std::string mpsocFile);
/**
* @brief Can be used to interrupt a running data transfer.
*/
void stopProcess();
/**
* @brief Sets the sequence count object responsible for the sequence count handling
*/
void setSequenceCount(SourceSequenceCounter* sequenceCount_);
private:
static const uint8_t INTERFACE_ID = CLASS_ID::PLOC_MPSOC_HELPER;
//! [EXPORT] : [COMMENT] File accidentally close
static const ReturnValue_t FILE_CLOSED_ACCIDENTALLY = MAKE_RETURN_CODE(0xA0);
// Maximum number of times the communication interface retries polling data from the reply
// buffer
static const int RETRIES = 10000;
struct FlashWrite {
std::string obcFile;
std::string mpsocFile;
};
struct FlashWrite flashWrite;
enum class InternalState { IDLE, FLASH_WRITE, FLASH_READ };
InternalState internalState = InternalState::IDLE;
BinarySemaphore semaphore;
#ifdef XIPHOS_Q7S
SdCardManager* sdcMan = nullptr;
#endif
uint8_t commandBuffer[mpsoc::MAX_COMMAND_SIZE];
bool terminate = false;
/**
* Communication interface of MPSoC responsible for low level access. Must be set by the
* MPSoC Handler.
*/
UartComIF* uartComIF = nullptr;
// Communication cookie. Must be set by the MPSoC Handler
CookieIF* comCookie = nullptr;
// Sequence count, must be set by Ploc MPSoC Handler
SourceSequenceCounter* sequenceCount;
ReturnValue_t resetHelper();
ReturnValue_t performFlashWrite();
ReturnValue_t flashfopen();
ReturnValue_t flashfclose();
ReturnValue_t handlePacketTransmission(mpsoc::TcBase& tc);
ReturnValue_t sendCommand(mpsoc::TcBase& tc);
ReturnValue_t receive(uint8_t* data, size_t* readBytes, size_t requestBytes);
ReturnValue_t handleAck();
ReturnValue_t handleExe();
void handleAckApidFailure(uint16_t apid);
void handleExeApidFailure(uint16_t apid);
ReturnValue_t handleTmReception(mpsoc::TmPacket* tmPacket, size_t remainingBytes);
};
#endif /* BSP_Q7S_DEVICES_PLOCMPSOCHELPER_H_ */

View File

@ -105,10 +105,10 @@ void PlocMemoryDumper::doStateMachine() {
case State::IDLE: case State::IDLE:
break; break;
case State::COMMAND_FIRST_MRAM_DUMP: case State::COMMAND_FIRST_MRAM_DUMP:
commandNextMramDump(PLOC_SPV::FIRST_MRAM_DUMP); commandNextMramDump(supv::FIRST_MRAM_DUMP);
break; break;
case State::COMMAND_CONSECUTIVE_MRAM_DUMP: case State::COMMAND_CONSECUTIVE_MRAM_DUMP:
commandNextMramDump(PLOC_SPV::CONSECUTIVE_MRAM_DUMP); commandNextMramDump(supv::CONSECUTIVE_MRAM_DUMP);
break; break;
case State::EXECUTING_MRAM_DUMP: case State::EXECUTING_MRAM_DUMP:
break; break;
@ -127,8 +127,8 @@ void PlocMemoryDumper::dataReceived(ActionId_t actionId, const uint8_t* data, ui
void PlocMemoryDumper::completionSuccessfulReceived(ActionId_t actionId) { void PlocMemoryDumper::completionSuccessfulReceived(ActionId_t actionId) {
switch (pendingCommand) { switch (pendingCommand) {
case (PLOC_SPV::FIRST_MRAM_DUMP): case (supv::FIRST_MRAM_DUMP):
case (PLOC_SPV::CONSECUTIVE_MRAM_DUMP): case (supv::CONSECUTIVE_MRAM_DUMP):
if (mram.endAddress == mram.startAddress) { if (mram.endAddress == mram.startAddress) {
triggerEvent(MRAM_DUMP_FINISHED); triggerEvent(MRAM_DUMP_FINISHED);
state = State::IDLE; state = State::IDLE;
@ -146,8 +146,8 @@ void PlocMemoryDumper::completionSuccessfulReceived(ActionId_t actionId) {
void PlocMemoryDumper::completionFailedReceived(ActionId_t actionId, ReturnValue_t returnCode) { void PlocMemoryDumper::completionFailedReceived(ActionId_t actionId, ReturnValue_t returnCode) {
switch (pendingCommand) { switch (pendingCommand) {
case (PLOC_SPV::FIRST_MRAM_DUMP): case (supv::FIRST_MRAM_DUMP):
case (PLOC_SPV::CONSECUTIVE_MRAM_DUMP): case (supv::CONSECUTIVE_MRAM_DUMP):
triggerEvent(MRAM_DUMP_FAILED, mram.lastStartAddress); triggerEvent(MRAM_DUMP_FAILED, mram.lastStartAddress);
break; break;
default: default:

View File

@ -1,8 +1,8 @@
#ifndef MISSION_DEVICES_PLOCMEMORYDUMPER_H_ #ifndef MISSION_DEVICES_PLOCMEMORYDUMPER_H_
#define MISSION_DEVICES_PLOCMEMORYDUMPER_H_ #define MISSION_DEVICES_PLOCMEMORYDUMPER_H_
#include <bsp_q7s/devices/devicedefinitions/PlocMemDumpDefinitions.h> #include <linux/devices/devicedefinitions/PlocMemDumpDefinitions.h>
#include <bsp_q7s/devices/devicedefinitions/PlocSupervisorDefinitions.h> #include <linux/devices/devicedefinitions/PlocSupervisorDefinitions.h>
#include "OBSWConfig.h" #include "OBSWConfig.h"
#include "bsp_q7s/memory/SdCardManager.h" #include "bsp_q7s/memory/SdCardManager.h"

View File

@ -1,12 +1,14 @@
#ifndef MISSION_DEVICES_PLOCSUPERVISORHANDLER_H_ #ifndef MISSION_DEVICES_PLOCSUPERVISORHANDLER_H_
#define MISSION_DEVICES_PLOCSUPERVISORHANDLER_H_ #define MISSION_DEVICES_PLOCSUPERVISORHANDLER_H_
#include <bsp_q7s/memory/SdCardManager.h>
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
#include <fsfw_hal/linux/uart/UartComIF.h>
#include "OBSWConfig.h" #include "OBSWConfig.h"
#include "devicedefinitions/PlocSupervisorDefinitions.h" #include "bsp_q7s/memory/SdCardManager.h"
#include "devices/powerSwitcherList.h"
#include "fsfw/devicehandlers/DeviceHandlerBase.h"
#include "fsfw_hal/linux/gpio/Gpio.h"
#include "fsfw_hal/linux/gpio/LinuxLibgpioIF.h"
#include "fsfw_hal/linux/uart/UartComIF.h"
#include "linux/devices/devicedefinitions/PlocSupervisorDefinitions.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
@ -22,7 +24,8 @@
*/ */
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);
virtual ~PlocSupervisorHandler(); virtual ~PlocSupervisorHandler();
virtual ReturnValue_t initialize() override; virtual ReturnValue_t initialize() override;
@ -60,35 +63,33 @@ class PlocSupervisorHandler : public DeviceHandlerBase {
static const ReturnValue_t INVALID_APID = MAKE_RETURN_CODE(0xA3); static const ReturnValue_t INVALID_APID = MAKE_RETURN_CODE(0xA3);
//! [EXPORT] : [COMMENT] Failed to read current system time //! [EXPORT] : [COMMENT] Failed to read current system time
static const ReturnValue_t GET_TIME_FAILURE = MAKE_RETURN_CODE(0xA4); static const ReturnValue_t GET_TIME_FAILURE = MAKE_RETURN_CODE(0xA4);
//! [EXPORT] : [COMMENT] Invalid communication interface specified
static const ReturnValue_t INVALID_UART_COM_IF = MAKE_RETURN_CODE(0xA5);
//! [EXPORT] : [COMMENT] Received command with invalid watchdog parameter. Valid watchdogs are 0 //! [EXPORT] : [COMMENT] Received command with invalid watchdog parameter. Valid watchdogs are 0
//! for PS, 1 for PL and 2 for INT //! for PS, 1 for PL and 2 for INT
static const ReturnValue_t INVALID_WATCHDOG = MAKE_RETURN_CODE(0xA6); static const ReturnValue_t INVALID_WATCHDOG = MAKE_RETURN_CODE(0xA5);
//! [EXPORT] : [COMMENT] Received watchdog timeout config command with invalid timeout. Valid //! [EXPORT] : [COMMENT] Received watchdog timeout config command with invalid timeout. Valid
//! timeouts must be in the range between 1000 and 360000 ms. //! timeouts must be in the range between 1000 and 360000 ms.
static const ReturnValue_t INVALID_WATCHDOG_TIMEOUT = MAKE_RETURN_CODE(0xA7); static const ReturnValue_t INVALID_WATCHDOG_TIMEOUT = MAKE_RETURN_CODE(0xA6);
//! [EXPORT] : [COMMENT] Received latchup config command with invalid latchup ID //! [EXPORT] : [COMMENT] Received latchup config command with invalid latchup ID
static const ReturnValue_t INVALID_LATCHUP_ID = MAKE_RETURN_CODE(0xA8); 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 //! [EXPORT] : [COMMENT] Received set adc sweep period command with invalid sweep period. Must be
//! larger than 21. //! larger than 21.
static const ReturnValue_t SWEEP_PERIOD_TOO_SMALL = MAKE_RETURN_CODE(0xA9); 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 //! [EXPORT] : [COMMENT] Receive auto EM test command with invalid test param. Valid params are 1
//! and 2. //! and 2.
static const ReturnValue_t INVALID_TEST_PARAM = MAKE_RETURN_CODE(0xAA); static const ReturnValue_t INVALID_TEST_PARAM = MAKE_RETURN_CODE(0xA9);
//! [EXPORT] : [COMMENT] Returned when scanning for MRAM dump packets failed. //! [EXPORT] : [COMMENT] Returned when scanning for MRAM dump packets failed.
static const ReturnValue_t MRAM_PACKET_PARSING_FAILURE = MAKE_RETURN_CODE(0xAB); 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 //! [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) //! commands are invalid (e.g. start address bigger than stop address)
static const ReturnValue_t INVALID_MRAM_ADDRESSES = MAKE_RETURN_CODE(0xAC); 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 //! [EXPORT] : [COMMENT] Expect reception of an MRAM dump packet but received space packet with
//! other apid. //! other apid.
static const ReturnValue_t NO_MRAM_PACKET = MAKE_RETURN_CODE(0xAD); static const ReturnValue_t NO_MRAM_PACKET = MAKE_RETURN_CODE(0xAC);
//! [EXPORT] : [COMMENT] Path to PLOC directory on SD card does not exist //! [EXPORT] : [COMMENT] Path to PLOC directory on SD card does not exist
static const ReturnValue_t PATH_DOES_NOT_EXIST = MAKE_RETURN_CODE(0xAE); 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 //! [EXPORT] : [COMMENT] MRAM dump file does not exists. The file should actually already have
//! been created with the reception of the first dump packet. //! been created with the reception of the first dump packet.
static const ReturnValue_t MRAM_FILE_NOT_EXISTS = MAKE_RETURN_CODE(0xAF); 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;
@ -104,20 +105,24 @@ class PlocSupervisorHandler : public DeviceHandlerBase {
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;
uint8_t commandBuffer[PLOC_SPV::MAX_COMMAND_SIZE]; uint8_t commandBuffer[supv::MAX_COMMAND_SIZE];
/** /**
* This variable is used to store the id of the next reply to receive. This is necessary * This variable is used to store the id of the next reply to receive. This is necessary
* because the PLOC sends as reply to each command at least one acknowledgment and execution * because the PLOC sends as reply to each command at least one acknowledgment and execution
* report. * report.
*/ */
DeviceCommandId_t nextReplyId = PLOC_SPV::NONE; DeviceCommandId_t nextReplyId = supv::NONE;
UartComIF* uartComIf = nullptr; UartComIF* uartComIf = nullptr;
LinuxLibgpioIF* gpioComIF = nullptr;
Gpio uartIsolatorSwitch;
PLOC_SPV::HkSet hkset; supv::HkSet hkset;
PLOC_SPV::BootStatusReport bootStatusReport; supv::BootStatusReport bootStatusReport;
PLOC_SPV::LatchupStatusReport latchupStatusReport; supv::LatchupStatusReport latchupStatusReport;
const power::Switch_t powerSwitch = power::NO_SWITCH;
/** 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;
@ -128,9 +133,9 @@ class PlocSupervisorHandler : public DeviceHandlerBase {
uint16_t bufferTop = 0; uint16_t bufferTop = 0;
/** 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[PLOC_SPV::MAX_PACKET_SIZE]; uint8_t spacePacketBuffer[supv::MAX_PACKET_SIZE];
#if BOARD_TE0720 == 0 #ifdef TE0720_1CFA
SdCardManager* sdcMan = nullptr; SdCardManager* sdcMan = nullptr;
#endif /* BOARD_TE0720 == 0 */ #endif /* BOARD_TE0720 == 0 */
@ -141,6 +146,8 @@ class PlocSupervisorHandler : public DeviceHandlerBase {
/** Setting this variable to true will enable direct downlink of MRAM packets */ /** Setting this variable to true will enable direct downlink of MRAM packets */
bool downlinkMramDump = false; bool downlinkMramDump = false;
ReturnValue_t getSwitches(const uint8_t** switches, uint8_t* numberOfSwitches);
/** /**
* @brief This function checks the crc of the received PLOC reply. * @brief This function checks the crc of the received PLOC reply.
* *

View File

@ -16,7 +16,7 @@ PlocUpdater::PlocUpdater(object_id_t objectId)
PlocUpdater::~PlocUpdater() {} PlocUpdater::~PlocUpdater() {}
ReturnValue_t PlocUpdater::initialize() { ReturnValue_t PlocUpdater::initialize() {
#if BOARD_TE0720 == 0 #ifdef XIPHOS_Q7S
sdcMan = SdCardManager::instance(); sdcMan = SdCardManager::instance();
#endif #endif
ReturnValue_t result = SystemObject::initialize(); ReturnValue_t result = SystemObject::initialize();
@ -123,9 +123,6 @@ void PlocUpdater::readCommandQueue() {
if (result == HasReturnvaluesIF::RETURN_OK) { if (result == HasReturnvaluesIF::RETURN_OK) {
continue; continue;
} }
sif::debug << "PlocUpdater::readCommandQueue: Received message with invalid format"
<< std::endl;
} }
} }
@ -145,7 +142,6 @@ void PlocUpdater::doStateMachine() {
case State::COMMAND_EXECUTING: case State::COMMAND_EXECUTING:
break; break;
default: default:
sif::debug << "PlocUpdater::doStateMachine: Invalid state" << std::endl;
break; break;
} }
} }
@ -163,7 +159,7 @@ ReturnValue_t PlocUpdater::getImageLocation(const uint8_t* data, size_t size) {
return result; return result;
} }
#if BOARD_TE0720 == 0 #ifdef XIPHOS_Q7S
// Check if file is stored on SD card and if associated SD card is mounted // 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) == if (std::string(reinterpret_cast<const char*>(data), SD_PREFIX_LENGTH) ==
std::string(SdCardManager::SD_0_MOUNT_POINT)) { std::string(SdCardManager::SD_0_MOUNT_POINT)) {
@ -199,10 +195,10 @@ void PlocUpdater::dataReceived(ActionId_t actionId, const uint8_t* data, uint32_
void PlocUpdater::completionSuccessfulReceived(ActionId_t actionId) { void PlocUpdater::completionSuccessfulReceived(ActionId_t actionId) {
switch (pendingCommand) { switch (pendingCommand) {
case (PLOC_SPV::UPDATE_AVAILABLE): case (supv::UPDATE_AVAILABLE):
state = State::UPDATE_TRANSFER; state = State::UPDATE_TRANSFER;
break; break;
case (PLOC_SPV::UPDATE_IMAGE_DATA): case (supv::UPDATE_IMAGE_DATA):
if (remainingPackets == 0) { if (remainingPackets == 0) {
packetsSent = 0; // Reset packets sent variable for next update sequence packetsSent = 0; // Reset packets sent variable for next update sequence
state = State::UPDATE_VERIFY; state = State::UPDATE_VERIFY;
@ -210,14 +206,12 @@ void PlocUpdater::completionSuccessfulReceived(ActionId_t actionId) {
state = State::UPDATE_TRANSFER; state = State::UPDATE_TRANSFER;
} }
break; break;
case (PLOC_SPV::UPDATE_VERIFY): case (supv::UPDATE_VERIFY):
triggerEvent(UPDATE_FINISHED); triggerEvent(UPDATE_FINISHED);
state = State::IDLE; state = State::IDLE;
pendingCommand = PLOC_SPV::NONE; pendingCommand = supv::NONE;
break; break;
default: default:
sif::debug << "PlocUpdater::completionSuccessfulReceived: Invalid pending command"
<< std::endl;
state = State::IDLE; state = State::IDLE;
break; break;
} }
@ -225,20 +219,19 @@ void PlocUpdater::completionSuccessfulReceived(ActionId_t actionId) {
void PlocUpdater::completionFailedReceived(ActionId_t actionId, ReturnValue_t returnCode) { void PlocUpdater::completionFailedReceived(ActionId_t actionId, ReturnValue_t returnCode) {
switch (pendingCommand) { switch (pendingCommand) {
case (PLOC_SPV::UPDATE_AVAILABLE): { case (supv::UPDATE_AVAILABLE): {
triggerEvent(UPDATE_AVAILABLE_FAILED); triggerEvent(UPDATE_AVAILABLE_FAILED);
break; break;
} }
case (PLOC_SPV::UPDATE_IMAGE_DATA): { case (supv::UPDATE_IMAGE_DATA): {
triggerEvent(UPDATE_TRANSFER_FAILED, packetsSent); triggerEvent(UPDATE_TRANSFER_FAILED, packetsSent);
break; break;
} }
case (PLOC_SPV::UPDATE_VERIFY): { case (supv::UPDATE_VERIFY): {
triggerEvent(UPDATE_VERIFY_FAILED); triggerEvent(UPDATE_VERIFY_FAILED);
break; break;
} }
default: default:
sif::debug << "PlocUpdater::completionFailedReceived: Invalid pending command " << std::endl;
break; break;
} }
state = State::IDLE; state = State::IDLE;
@ -268,23 +261,22 @@ void PlocUpdater::commandUpdateAvailable() {
calcImageCrc(); calcImageCrc();
PLOC_SPV::UpdateInfo packet(PLOC_SPV::APID_UPDATE_AVAILABLE, static_cast<uint8_t>(image), supv::UpdateInfo packet(supv::APID_UPDATE_AVAILABLE, static_cast<uint8_t>(image),
static_cast<uint8_t>(partition), imageSize, imageCrc, static_cast<uint8_t>(partition), imageSize, imageCrc, numOfUpdatePackets);
numOfUpdatePackets);
result = commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, result =
PLOC_SPV::UPDATE_AVAILABLE, packet.getWholeData(), commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, supv::UPDATE_AVAILABLE,
packet.getFullSize()); packet.getWholeData(), packet.getFullSize());
if (result != RETURN_OK) { if (result != RETURN_OK) {
sif::warning << "PlocUpdater::commandUpdateAvailable: Failed to send update available" sif::warning << "PlocUpdater::commandUpdateAvailable: Failed to send update available"
<< " packet to supervisor handler" << std::endl; << " packet to supervisor handler" << std::endl;
triggerEvent(ACTION_COMMANDING_FAILED, result, PLOC_SPV::UPDATE_AVAILABLE); triggerEvent(ACTION_COMMANDING_FAILED, result, supv::UPDATE_AVAILABLE);
state = State::IDLE; state = State::IDLE;
pendingCommand = PLOC_SPV::NONE; pendingCommand = supv::NONE;
return; return;
} }
pendingCommand = PLOC_SPV::UPDATE_AVAILABLE; pendingCommand = supv::UPDATE_AVAILABLE;
state = State::COMMAND_EXECUTING; state = State::COMMAND_EXECUTING;
return; return;
} }
@ -308,56 +300,54 @@ void PlocUpdater::commandUpdatePacket() {
payloadLength = MAX_SP_DATA; payloadLength = MAX_SP_DATA;
} }
PLOC_SPV::UpdatePacket packet(payloadLength); supv::UpdatePacket packet(payloadLength);
file.read(reinterpret_cast<char*>(packet.getDataFieldPointer()), payloadLength); file.read(reinterpret_cast<char*>(packet.getDataFieldPointer()), payloadLength);
file.close(); file.close();
// sequence count of first packet is 1 // sequence count of first packet is 1
packet.setPacketSequenceCount((packetsSent + 1) & PLOC_SPV::SEQUENCE_COUNT_MASK); packet.setPacketSequenceCount((packetsSent + 1) & supv::SEQUENCE_COUNT_MASK);
if (numOfUpdatePackets > 1) { if (numOfUpdatePackets > 1) {
adjustSequenceFlags(packet); adjustSequenceFlags(packet);
} }
packet.makeCrc(); packet.makeCrc();
result = commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, result =
PLOC_SPV::UPDATE_IMAGE_DATA, packet.getWholeData(), commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, supv::UPDATE_IMAGE_DATA,
packet.getFullSize()); packet.getWholeData(), packet.getFullSize());
if (result != RETURN_OK) { if (result != RETURN_OK) {
sif::warning << "PlocUpdater::commandUpdateAvailable: Failed to send update" sif::warning << "PlocUpdater::commandUpdateAvailable: Failed to send update"
<< " packet to supervisor handler" << std::endl; << " packet to supervisor handler" << std::endl;
triggerEvent(ACTION_COMMANDING_FAILED, result, PLOC_SPV::UPDATE_IMAGE_DATA); triggerEvent(ACTION_COMMANDING_FAILED, result, supv::UPDATE_IMAGE_DATA);
state = State::IDLE; state = State::IDLE;
pendingCommand = PLOC_SPV::NONE; pendingCommand = supv::NONE;
return; return;
} }
remainingPackets--; remainingPackets--;
packetsSent++; packetsSent++;
pendingCommand = PLOC_SPV::UPDATE_IMAGE_DATA; pendingCommand = supv::UPDATE_IMAGE_DATA;
state = State::COMMAND_EXECUTING; state = State::COMMAND_EXECUTING;
} }
void PlocUpdater::commandUpdateVerify() { void PlocUpdater::commandUpdateVerify() {
ReturnValue_t result = RETURN_OK; ReturnValue_t result = RETURN_OK;
PLOC_SPV::UpdateInfo packet(PLOC_SPV::APID_UPDATE_VERIFY, static_cast<uint8_t>(image), supv::UpdateInfo packet(supv::APID_UPDATE_VERIFY, static_cast<uint8_t>(image),
static_cast<uint8_t>(partition), imageSize, imageCrc, static_cast<uint8_t>(partition), imageSize, imageCrc, numOfUpdatePackets);
numOfUpdatePackets);
result = result = commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, supv::UPDATE_VERIFY,
commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, PLOC_SPV::UPDATE_VERIFY,
packet.getWholeData(), packet.getFullSize()); packet.getWholeData(), packet.getFullSize());
if (result != RETURN_OK) { if (result != RETURN_OK) {
sif::warning << "PlocUpdater::commandUpdateAvailable: Failed to send update available" sif::warning << "PlocUpdater::commandUpdateAvailable: Failed to send update available"
<< " packet to supervisor handler" << std::endl; << " packet to supervisor handler" << std::endl;
triggerEvent(ACTION_COMMANDING_FAILED, result, PLOC_SPV::UPDATE_VERIFY); triggerEvent(ACTION_COMMANDING_FAILED, result, supv::UPDATE_VERIFY);
state = State::IDLE; state = State::IDLE;
pendingCommand = PLOC_SPV::NONE; pendingCommand = supv::NONE;
return; return;
} }
state = State::COMMAND_EXECUTING; state = State::COMMAND_EXECUTING;
pendingCommand = PLOC_SPV::UPDATE_VERIFY; pendingCommand = supv::UPDATE_VERIFY;
return; return;
} }
@ -384,12 +374,12 @@ void PlocUpdater::calcImageCrc() {
imageCrc = (remainder ^ FINAL_XOR_VALUE_32); imageCrc = (remainder ^ FINAL_XOR_VALUE_32);
} }
void PlocUpdater::adjustSequenceFlags(PLOC_SPV::UpdatePacket& packet) { void PlocUpdater::adjustSequenceFlags(supv::UpdatePacket& packet) {
if (packetsSent == 0) { if (packetsSent == 0) {
packet.setSequenceFlags(static_cast<uint8_t>(PLOC_SPV::SequenceFlags::FIRST_PKT)); packet.setSequenceFlags(static_cast<uint8_t>(supv::SequenceFlags::FIRST_PKT));
} else if (remainingPackets == 1) { } else if (remainingPackets == 1) {
packet.setSequenceFlags(static_cast<uint8_t>(PLOC_SPV::SequenceFlags::LAST_PKT)); packet.setSequenceFlags(static_cast<uint8_t>(supv::SequenceFlags::LAST_PKT));
} else { } else {
packet.setSequenceFlags(static_cast<uint8_t>(PLOC_SPV::SequenceFlags::CONTINUED_PKT)); packet.setSequenceFlags(static_cast<uint8_t>(supv::SequenceFlags::CONTINUED_PKT));
} }
} }

View File

@ -1,9 +1,11 @@
#ifndef MISSION_DEVICES_PLOCUPDATER_H_ #ifndef MISSION_DEVICES_PLOCUPDATER_H_
#define MISSION_DEVICES_PLOCUPDATER_H_ #define MISSION_DEVICES_PLOCUPDATER_H_
#include <linux/devices/devicedefinitions/PlocSupervisorDefinitions.h>
#include "OBSWConfig.h" #include "OBSWConfig.h"
#include "bsp_q7s/memory/SdCardManager.h" #include "bsp_q7s/memory/SdCardManager.h"
#include "devicedefinitions/PlocSupervisorDefinitions.h" #include "eive/definitions.h"
#include "fsfw/action/ActionHelper.h" #include "fsfw/action/ActionHelper.h"
#include "fsfw/action/CommandActionHelper.h" #include "fsfw/action/CommandActionHelper.h"
#include "fsfw/action/CommandsActionsIF.h" #include "fsfw/action/CommandsActionsIF.h"
@ -12,6 +14,7 @@
#include "fsfw/returnvalues/HasReturnvaluesIF.h" #include "fsfw/returnvalues/HasReturnvaluesIF.h"
#include "fsfw/tasks/ExecutableObjectIF.h" #include "fsfw/tasks/ExecutableObjectIF.h"
#include "fsfw/tmtcpacket/SpacePacket.h" #include "fsfw/tmtcpacket/SpacePacket.h"
#include "linux/devices/devicedefinitions/PlocSupervisorDefinitions.h"
#include "linux/fsfwconfig/objects/systemObjectList.h" #include "linux/fsfwconfig/objects/systemObjectList.h"
/** /**
@ -102,7 +105,7 @@ class PlocUpdater : public SystemObject,
MessageQueueIF* commandQueue = nullptr; MessageQueueIF* commandQueue = nullptr;
#if BOARD_TE0720 == 0 #ifdef XIPHOS_Q7S
SdCardManager* sdcMan = nullptr; SdCardManager* sdcMan = nullptr;
#endif #endif
CommandActionHelper commandActionHelper; CommandActionHelper commandActionHelper;
@ -119,7 +122,7 @@ class PlocUpdater : public SystemObject,
State state = State::IDLE; State state = State::IDLE;
ActionId_t pendingCommand = PLOC_SPV::NONE; ActionId_t pendingCommand = supv::NONE;
enum class Image : uint8_t { NONE, A, B }; enum class Image : uint8_t { NONE, A, B };
@ -165,7 +168,7 @@ class PlocUpdater : public SystemObject,
void calcImageCrc(); void calcImageCrc();
void adjustSequenceFlags(PLOC_SPV::UpdatePacket& packet); void adjustSequenceFlags(supv::UpdatePacket& packet);
}; };
#endif /* MISSION_DEVICES_PLOCUPDATER_H_ */ #endif /* MISSION_DEVICES_PLOCUPDATER_H_ */

View File

@ -15,7 +15,7 @@ extern "C" {
} }
StarTrackerHandler::StarTrackerHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie, StarTrackerHandler::StarTrackerHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie,
StrHelper* strHelper) StrHelper* strHelper, power::Switch_t powerSwitch)
: DeviceHandlerBase(objectId, comIF, comCookie), : DeviceHandlerBase(objectId, comIF, comCookie),
temperatureSet(this), temperatureSet(this),
versionSet(this), versionSet(this),
@ -39,7 +39,8 @@ StarTrackerHandler::StarTrackerHandler(object_id_t objectId, object_id_t comIF,
subscriptionSet(this), subscriptionSet(this),
logSubscriptionSet(this), logSubscriptionSet(this),
debugCameraSet(this), debugCameraSet(this),
strHelper(strHelper) { strHelper(strHelper),
powerSwitch(powerSwitch) {
if (comCookie == nullptr) { if (comCookie == nullptr) {
sif::error << "StarTrackerHandler: Invalid com cookie" << std::endl; sif::error << "StarTrackerHandler: Invalid com cookie" << std::endl;
} }
@ -1223,6 +1224,15 @@ ReturnValue_t StarTrackerHandler::doSendReadHook() {
return RETURN_OK; return RETURN_OK;
} }
ReturnValue_t StarTrackerHandler::getSwitches(const uint8_t** switches, uint8_t* numberOfSwitches) {
if (powerSwitch == power::NO_SWITCH) {
return DeviceHandlerBase::NO_SWITCH;
}
*numberOfSwitches = 1;
*switches = &powerSwitch;
return RETURN_OK;
}
ReturnValue_t StarTrackerHandler::checkMode(ActionId_t actionId) { ReturnValue_t StarTrackerHandler::checkMode(ActionId_t actionId) {
switch (actionId) { switch (actionId) {
case startracker::UPLOAD_IMAGE: case startracker::UPLOAD_IMAGE:

View File

@ -7,6 +7,7 @@
#include "ArcsecJsonParamBase.h" #include "ArcsecJsonParamBase.h"
#include "OBSWConfig.h" #include "OBSWConfig.h"
#include "StrHelper.h" #include "StrHelper.h"
#include "devices/powerSwitcherList.h"
#include "fsfw/devicehandlers/DeviceHandlerBase.h" #include "fsfw/devicehandlers/DeviceHandlerBase.h"
#include "fsfw/src/fsfw/serialize/SerializeAdapter.h" #include "fsfw/src/fsfw/serialize/SerializeAdapter.h"
#include "fsfw/timemanager/Countdown.h" #include "fsfw/timemanager/Countdown.h"
@ -34,7 +35,7 @@ class StarTrackerHandler : public DeviceHandlerBase {
* to high to enable the device. * to high to enable the device.
*/ */
StarTrackerHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie, StarTrackerHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie,
StrHelper* strHelper); StrHelper* strHelper, power::Switch_t powerSwitch);
virtual ~StarTrackerHandler(); virtual ~StarTrackerHandler();
ReturnValue_t initialize() override; ReturnValue_t initialize() override;
@ -75,6 +76,7 @@ class StarTrackerHandler : public DeviceHandlerBase {
*/ */
virtual size_t getNextReplyLength(DeviceCommandId_t deviceCommand) override; virtual size_t getNextReplyLength(DeviceCommandId_t deviceCommand) override;
virtual ReturnValue_t doSendReadHook() override; virtual ReturnValue_t doSendReadHook() override;
ReturnValue_t getSwitches(const uint8_t** switches, uint8_t* numberOfSwitches) override;
virtual void doTransition(Mode_t modeFrom, Submode_t subModeFrom) override; virtual void doTransition(Mode_t modeFrom, Submode_t subModeFrom) override;
private: private:
@ -161,14 +163,12 @@ class StarTrackerHandler : public DeviceHandlerBase {
static const uint32_t BOOT_TIMEOUT = 1000; static const uint32_t BOOT_TIMEOUT = 1000;
static const uint32_t DEFAULT_TRANSITION_DELAY = 15000; static const uint32_t DEFAULT_TRANSITION_DELAY = 15000;
class FlashReadCmd { struct FlashReadCmd {
public:
// Minimum length of a read command (region, length and filename) // Minimum length of a read command (region, length and filename)
static const size_t MIN_LENGTH = 7; static const size_t MIN_LENGTH = 7;
}; };
class ChecksumCmd { struct ChecksumCmd {
public:
static const uint8_t ADDRESS_OFFSET = 1; static const uint8_t ADDRESS_OFFSET = 1;
static const uint8_t LENGTH_OFFSET = 5; static const uint8_t LENGTH_OFFSET = 5;
// Length of checksum command // Length of checksum command
@ -268,6 +268,8 @@ class StarTrackerHandler : public DeviceHandlerBase {
bool strHelperExecuting = false; bool strHelperExecuting = false;
const power::Switch_t powerSwitch = power::NO_SWITCH;
/** /**
* @brief Handles internal state * @brief Handles internal state
*/ */

View File

@ -10,12 +10,8 @@
#cmakedefine XIPHOS_Q7S #cmakedefine XIPHOS_Q7S
#cmakedefine BEAGLEBONEBLACK #cmakedefine BEAGLEBONEBLACK
#cmakedefine EGSE #cmakedefine EGSE
#cmakedefine TE0720_1CFA
#ifdef RASPBERRY_PI
#include "rpiConfig.h"
#elif defined(XIPHOS_Q7S)
#include "q7sConfig.h"
#endif
#include "commonConfig.h" #include "commonConfig.h"
#include "OBSWVersion.h" #include "OBSWVersion.h"
@ -23,8 +19,7 @@
debugging. */ debugging. */
#define OBSW_VERBOSE_LEVEL 1 #define OBSW_VERBOSE_LEVEL 1
//! Board defines #define Q7S_EM 0
#define BOARD_TE0720 0
/*******************************************************************/ /*******************************************************************/
/** All of the following flags should be enabled for mission code */ /** All of the following flags should be enabled for mission code */
@ -45,21 +40,23 @@ debugging. */
#define OBSW_ENABLE_TIMERS 1 #define OBSW_ENABLE_TIMERS 1
#define OBSW_ADD_MGT 1 #define OBSW_ADD_MGT 1
#define OBSW_ADD_BPX_BATTERY_HANDLER 1 #define OBSW_ADD_BPX_BATTERY_HANDLER 1
#define OBSW_ADD_STAR_TRACKER 0 #define OBSW_ADD_STAR_TRACKER @OBSW_ADD_STAR_TRACKER@
#define OBSW_ADD_PLOC_SUPERVISOR 0 #define OBSW_ADD_PLOC_SUPERVISOR 0
#define OBSW_ADD_PLOC_MPSOC 0 #define OBSW_ADD_PLOC_MPSOC 0
#define OBSW_ADD_SUN_SENSORS 1 #define OBSW_ADD_SUN_SENSORS 1
#define OBSW_ADD_SUS_BOARD_ASS 1
#define OBSW_ADD_ACS_BOARD 1 #define OBSW_ADD_ACS_BOARD 1
#define OBSW_ADD_ACS_HANDLERS 1 #define OBSW_ADD_ACS_HANDLERS 1
#define OBSW_ADD_RW 0 #define OBSW_ADD_RW 0
#define OBSW_ADD_RTD_DEVICES 1 #define OBSW_ADD_RTD_DEVICES 1
#define OBSW_ADD_TMP_DEVICES 0 #define OBSW_ADD_TMP_DEVICES 0
#define OBSW_ADD_RAD_SENSORS 1 #define OBSW_ADD_RAD_SENSORS 1
#define OBSW_ADD_PL_PCDU 0 #define OBSW_ADD_PL_PCDU 1
#define OBSW_ADD_SYRLINKS 0 #define OBSW_ADD_SYRLINKS 0
#define OBSW_ENABLE_SYRLINKS_TRANSMIT_TIMEOUT 0 #define OBSW_ENABLE_SYRLINKS_TRANSMIT_TIMEOUT 0
#define OBSW_STAR_TRACKER_GROUND_CONFIG 1 #define OBSW_STAR_TRACKER_GROUND_CONFIG 1
#define OBSW_ENABLE_PERIODIC_HK 0
#endif // XIPHOS_Q7S
// 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
@ -67,11 +64,37 @@ debugging. */
// something the operators might want to do by giving the software too much intelligence // something the operators might want to do by giving the software too much intelligence
// at the wrong place. The system component might command all the Switches accordingly anyway // at the wrong place. The system component might command all the Switches accordingly anyway
#define OBSW_INITIALIZE_SWITCHES 0 #define OBSW_INITIALIZE_SWITCHES 0
#define OBSW_ENABLE_PERIODIC_HK 0
#endif #ifdef TE0720_1CFA
#define OBSW_USE_CCSDS_IP_CORE 0
// Set to 1 if all telemetry should be sent to the PTME IP Core
#define OBSW_TM_TO_PTME 0
// Set to 1 if telecommands are received via the PDEC IP Core
#define OBSW_TC_FROM_PDEC 0
#define OBSW_ENABLE_TIMERS 1
#define OBSW_ADD_MGT 0
#define OBSW_ADD_BPX_BATTERY_HANDLER 0
#define OBSW_ADD_STAR_TRACKER 0
#define OBSW_ADD_PLOC_SUPERVISOR 0
#define OBSW_ADD_PLOC_MPSOC 1
#define OBSW_ADD_SUN_SENSORS 0
#define OBSW_ADD_ACS_BOARD 1
#define OBSW_ADD_ACS_HANDLERS 0
#define OBSW_ADD_RW 0
#define OBSW_ADD_RTD_DEVICES 0
#define OBSW_ADD_TMP_DEVICES 0
#define OBSW_ADD_RAD_SENSORS 0
#define OBSW_ADD_PL_PCDU 0
#define OBSW_ADD_SYRLINKS 0
#define OBSW_ENABLE_SYRLINKS_TRANSMIT_TIMEOUT 0
#define OBSW_SYRLINKS_SIMULATED 1
#define OBSW_STAR_TRACKER_GROUND_CONFIG 1
#define OBSW_ENABLE_PERIODIC_HK 0
#define OBSW_PRINT_CORE_HK 0
#define OBSW_INITIALIZE_SWITCHES 0
#ifdef EGSE
#define OBSW_ADD_STAR_TRACKER 1
#endif #endif
/*******************************************************************/ /*******************************************************************/
@ -93,7 +116,6 @@ debugging. */
#define OBSW_ADD_UART_TEST_CODE 0 #define OBSW_ADD_UART_TEST_CODE 0
#define OBSW_TEST_ACS 0 #define OBSW_TEST_ACS 0
#define OBSW_TEST_ACS_BOARD_ASS 0
#define OBSW_DEBUG_ACS 0 #define OBSW_DEBUG_ACS 0
#define OBSW_TEST_SUS 0 #define OBSW_TEST_SUS 0
#define OBSW_DEBUG_SUS 0 #define OBSW_DEBUG_SUS 0
@ -123,10 +145,16 @@ debugging. */
#define OBSW_DEBUG_SYRLINKS 0 #define OBSW_DEBUG_SYRLINKS 0
#define OBSW_DEBUG_IMTQ 0 #define OBSW_DEBUG_IMTQ 0
#define OBSW_DEBUG_RW 0 #define OBSW_DEBUG_RW 0
#define OBSW_DEBUG_PLOC_MPSOC 0
#define OBSW_DEBUG_PLOC_SUPERVISOR 0
#define OBSW_DEBUG_PDEC_HANDLER 0 #define OBSW_DEBUG_PDEC_HANDLER 0
#ifdef TE0720_1CFA
#define OBSW_DEBUG_PLOC_SUPERVISOR 1
#define OBSW_DEBUG_PLOC_MPSOC 1
#else
#define OBSW_DEBUG_PLOC_SUPERVISOR 0
#define OBSW_DEBUG_PLOC_MPSOC 0
#endif
#ifdef EGSE #ifdef EGSE
#define OBSW_DEBUG_STARTRACKER 1 #define OBSW_DEBUG_STARTRACKER 1
#else #else
@ -140,23 +168,34 @@ debugging. */
#define OBSW_ADD_PLOC_SUPERVISOR 0 #define OBSW_ADD_PLOC_SUPERVISOR 0
#define OBSW_ADD_PLOC_MPSOC 0 #define OBSW_ADD_PLOC_MPSOC 0
#define OBSW_ADD_SUN_SENSORS 0 #define OBSW_ADD_SUN_SENSORS 0
#define OBSW_ADD_MGT 0
#define OBSW_ADD_ACS_BOARD 0 #define OBSW_ADD_ACS_BOARD 0
#define OBSW_ADD_ACS_HANDLERS 0
#define OBSW_ADD_GPS_0 0 #define OBSW_ADD_GPS_0 0
#define OBSW_ADD_GPS_1 0 #define OBSW_ADD_GPS_1 0
#define OBSW_ADD_RW 0 #define OBSW_ADD_RW 0
#define OBSW_ADD_BPX_BATTERY_HANDLER 0
#define OBSW_ADD_RTD_DEVICES 0 #define OBSW_ADD_RTD_DEVICES 0
#define OBSW_ADD_PL_PCDU 0
#define OBSW_ADD_TMP_DEVICES 0 #define OBSW_ADD_TMP_DEVICES 0
#define OBSW_ADD_RAD_SENSORS 0 #define OBSW_ADD_RAD_SENSORS 0
#define OBSW_ADD_SYRLINKS 0 #define OBSW_ADD_SYRLINKS 0
#define OBSW_STAR_TRACKER_GROUND_CONFIG 1
#endif #endif // RASPBERRY_PI
#define TCP_SERVER_WIRETAPPING 0
/*******************************************************************/ /*******************************************************************/
/** CMake Defines */ /** CMake Defines */
/*******************************************************************/ /*******************************************************************/
#cmakedefine EIVE_BUILD_GPSD_GPS_HANDLER #cmakedefine EIVE_BUILD_GPSD_GPS_HANDLER
#include "OBSWVersion.h" #ifdef RASPBERRY_PI
#include "rpiConfig.h"
#elif defined(XIPHOS_Q7S)
#include "q7sConfig.h"
#endif
#ifdef __cplusplus #ifdef __cplusplus
@ -164,18 +203,6 @@ debugging. */
#include "events/subsystemIdRanges.h" #include "events/subsystemIdRanges.h"
#include "returnvalues/classIds.h" #include "returnvalues/classIds.h"
namespace config {
#endif
/* Add mission configuration flags here */
static constexpr uint32_t OBSW_FILESYSTEM_HANDLER_QUEUE_SIZE = 50;
static constexpr uint32_t PLOC_UPDATER_QUEUE_SIZE = 50;
static constexpr uint32_t STR_IMG_HELPER_QUEUE_SIZE = 50;
static constexpr uint8_t LIVE_TM = 0;
#ifdef __cplusplus
}
#endif #endif
#endif /* FSFWCONFIG_OBSWCONFIG_H_ */ #endif /* FSFWCONFIG_OBSWCONFIG_H_ */

View File

@ -1,7 +1,7 @@
/** /**
* @brief Auto-generated event translation file. Contains 168 translations. * @brief Auto-generated event translation file. Contains 183 translations.
* @details * @details
* Generated on: 2022-03-22 20:43:04 * Generated on: 2022-04-08 11:21:58
*/ */
#include "translateEvents.h" #include "translateEvents.h"
@ -100,7 +100,9 @@ const char *DEPL_SA2_GPIO_SWTICH_ON_FAILED_STRING = "DEPL_SA2_GPIO_SWTICH_ON_FAI
const char *MEMORY_READ_RPT_CRC_FAILURE_STRING = "MEMORY_READ_RPT_CRC_FAILURE"; 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 *CRC_FAILURE_EVENT_STRING = "CRC_FAILURE_EVENT"; 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_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";
const char *SELF_TEST_ADC_FAILURE_STRING = "SELF_TEST_ADC_FAILURE"; const char *SELF_TEST_ADC_FAILURE_STRING = "SELF_TEST_ADC_FAILURE";
@ -148,6 +150,18 @@ const char *POSITION_MISMATCH_STRING = "POSITION_MISMATCH";
const char *STR_HELPER_FILE_NOT_EXISTS_STRING = "STR_HELPER_FILE_NOT_EXISTS"; const char *STR_HELPER_FILE_NOT_EXISTS_STRING = "STR_HELPER_FILE_NOT_EXISTS";
const char *STR_HELPER_SENDING_PACKET_FAILED_STRING = "STR_HELPER_SENDING_PACKET_FAILED"; const char *STR_HELPER_SENDING_PACKET_FAILED_STRING = "STR_HELPER_SENDING_PACKET_FAILED";
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_SUCCESSFUL_STRING = "MPSOC_FLASH_WRITE_SUCCESSFUL";
const char *SENDING_COMMAND_FAILED_STRING = "SENDING_COMMAND_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 *MISSING_ACK_STRING = "MISSING_ACK";
const char *MISSING_EXE_STRING = "MISSING_EXE";
const char *ACK_FAILURE_REPORT_STRING = "ACK_FAILURE_REPORT";
const char *EXE_FAILURE_REPORT_STRING = "EXE_FAILURE_REPORT";
const char *ACK_INVALID_APID_STRING = "ACK_INVALID_APID";
const char *EXE_INVALID_APID_STRING = "EXE_INVALID_APID";
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";
const char *U_DRO_OUT_OF_BOUNDS_STRING = "U_DRO_OUT_OF_BOUNDS"; const char *U_DRO_OUT_OF_BOUNDS_STRING = "U_DRO_OUT_OF_BOUNDS";
@ -165,6 +179,7 @@ const char *NOT_ENOUGH_DEVICES_DUAL_MODE_STRING = "NOT_ENOUGH_DEVICES_DUAL_MODE"
const char *POWER_STATE_MACHINE_TIMEOUT_STRING = "POWER_STATE_MACHINE_TIMEOUT"; const char *POWER_STATE_MACHINE_TIMEOUT_STRING = "POWER_STATE_MACHINE_TIMEOUT";
const char *SIDE_SWITCH_TRANSITION_NOT_ALLOWED_STRING = "SIDE_SWITCH_TRANSITION_NOT_ALLOWED"; const char *SIDE_SWITCH_TRANSITION_NOT_ALLOWED_STRING = "SIDE_SWITCH_TRANSITION_NOT_ALLOWED";
const char *CHILDREN_LOST_MODE_STRING = "CHILDREN_LOST_MODE"; const char *CHILDREN_LOST_MODE_STRING = "CHILDREN_LOST_MODE";
const char *GPS_FIX_CHANGE_STRING = "GPS_FIX_CHANGE";
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";
@ -330,168 +345,198 @@ const char *translateEvents(Event event) {
return TEST_STRING; return TEST_STRING;
case (10600): case (10600):
return CHANGE_OF_SETUP_PARAMETER_STRING; return CHANGE_OF_SETUP_PARAMETER_STRING;
case (10800): case (11300):
return SWITCH_CMD_SENT_STRING; return SWITCH_CMD_SENT_STRING;
case (10801):
return SWITCH_HAS_CHANGED_STRING;
case (10802):
return SWITCHING_Q7S_DENIED_STRING;
case (10900):
return GPIO_PULL_HIGH_FAILED_STRING;
case (10901):
return GPIO_PULL_LOW_FAILED_STRING;
case (10902):
return SWITCH_ALREADY_ON_STRING;
case (10903):
return SWITCH_ALREADY_OFF_STRING;
case (10904):
return MAIN_SWITCH_TIMEOUT_STRING;
case (11000):
return MAIN_SWITCH_ON_TIMEOUT_STRING;
case (11001):
return MAIN_SWITCH_OFF_TIMEOUT_STRING;
case (11002):
return DEPLOYMENT_FAILED_STRING;
case (11003):
return DEPL_SA1_GPIO_SWTICH_ON_FAILED_STRING;
case (11004):
return DEPL_SA2_GPIO_SWTICH_ON_FAILED_STRING;
case (11101):
return MEMORY_READ_RPT_CRC_FAILURE_STRING;
case (11102):
return ACK_FAILURE_STRING;
case (11103):
return EXE_FAILURE_STRING;
case (11104):
return CRC_FAILURE_EVENT_STRING;
case (11201):
return SELF_TEST_I2C_FAILURE_STRING;
case (11202):
return SELF_TEST_SPI_FAILURE_STRING;
case (11203):
return SELF_TEST_ADC_FAILURE_STRING;
case (11204):
return SELF_TEST_PWM_FAILURE_STRING;
case (11205):
return SELF_TEST_TC_FAILURE_STRING;
case (11206):
return SELF_TEST_MTM_RANGE_FAILURE_STRING;
case (11207):
return SELF_TEST_COIL_CURRENT_FAILURE_STRING;
case (11208):
return INVALID_ERROR_BYTE_STRING;
case (11301): case (11301):
return ERROR_STATE_STRING; return SWITCH_HAS_CHANGED_STRING;
case (11302):
return SWITCHING_Q7S_DENIED_STRING;
case (11400):
return GPIO_PULL_HIGH_FAILED_STRING;
case (11401): case (11401):
return BOOTING_FIRMWARE_FAILED_STRING; return GPIO_PULL_LOW_FAILED_STRING;
case (11402): case (11402):
return BOOTING_BOOTLOADER_FAILED_STRING; return SWITCH_ALREADY_ON_STRING;
case (11403):
return SWITCH_ALREADY_OFF_STRING;
case (11404):
return MAIN_SWITCH_TIMEOUT_STRING;
case (11500):
return MAIN_SWITCH_ON_TIMEOUT_STRING;
case (11501): case (11501):
return SUPV_MEMORY_READ_RPT_CRC_FAILURE_STRING; return MAIN_SWITCH_OFF_TIMEOUT_STRING;
case (11502): case (11502):
return SUPV_ACK_FAILURE_STRING; return DEPLOYMENT_FAILED_STRING;
case (11503): case (11503):
return SUPV_EXE_FAILURE_STRING; return DEPL_SA1_GPIO_SWTICH_ON_FAILED_STRING;
case (11504): case (11504):
return SUPV_CRC_FAILURE_EVENT_STRING; return DEPL_SA2_GPIO_SWTICH_ON_FAILED_STRING;
case (11600):
return SANITIZATION_FAILED_STRING;
case (11601): case (11601):
return MOUNTED_SD_CARD_STRING; return MEMORY_READ_RPT_CRC_FAILURE_STRING;
case (11700): case (11602):
return UPDATE_FILE_NOT_EXISTS_STRING; return ACK_FAILURE_STRING;
case (11603):
return EXE_FAILURE_STRING;
case (11604):
return MPSOC_HANDLER_CRC_FAILURE_STRING;
case (11605):
return MPSOC_HANDLER_SEQ_CNT_MISMATCH_STRING;
case (11606):
return MPSOC_SHUTDOWN_FAILED_STRING;
case (11701): case (11701):
return ACTION_COMMANDING_FAILED_STRING; return SELF_TEST_I2C_FAILURE_STRING;
case (11702): case (11702):
return UPDATE_AVAILABLE_FAILED_STRING; return SELF_TEST_SPI_FAILURE_STRING;
case (11703): case (11703):
return UPDATE_TRANSFER_FAILED_STRING; return SELF_TEST_ADC_FAILURE_STRING;
case (11704): case (11704):
return UPDATE_VERIFY_FAILED_STRING; return SELF_TEST_PWM_FAILURE_STRING;
case (11705): case (11705):
return UPDATE_FINISHED_STRING; return SELF_TEST_TC_FAILURE_STRING;
case (11800): case (11706):
return SEND_MRAM_DUMP_FAILED_STRING; return SELF_TEST_MTM_RANGE_FAILURE_STRING;
case (11707):
return SELF_TEST_COIL_CURRENT_FAILURE_STRING;
case (11708):
return INVALID_ERROR_BYTE_STRING;
case (11801): case (11801):
return MRAM_DUMP_FAILED_STRING; return ERROR_STATE_STRING;
case (11802):
return MRAM_DUMP_FINISHED_STRING;
case (11901): case (11901):
return INVALID_TC_FRAME_STRING; return BOOTING_FIRMWARE_FAILED_STRING;
case (11902): case (11902):
return INVALID_FAR_STRING; return BOOTING_BOOTLOADER_FAILED_STRING;
case (11903):
return CARRIER_LOCK_STRING;
case (11904):
return BIT_LOCK_PDEC_STRING;
case (12000):
return IMAGE_UPLOAD_FAILED_STRING;
case (12001): case (12001):
return IMAGE_DOWNLOAD_FAILED_STRING; return SUPV_MEMORY_READ_RPT_CRC_FAILURE_STRING;
case (12002): case (12002):
return IMAGE_UPLOAD_SUCCESSFUL_STRING; return SUPV_ACK_FAILURE_STRING;
case (12003): case (12003):
return IMAGE_DOWNLOAD_SUCCESSFUL_STRING; return SUPV_EXE_FAILURE_STRING;
case (12004): case (12004):
return FLASH_WRITE_SUCCESSFUL_STRING; return SUPV_CRC_FAILURE_EVENT_STRING;
case (12005):
return FLASH_READ_SUCCESSFUL_STRING;
case (12006):
return FLASH_READ_FAILED_STRING;
case (12007):
return FIRMWARE_UPDATE_SUCCESSFUL_STRING;
case (12008):
return FIRMWARE_UPDATE_FAILED_STRING;
case (12009):
return STR_HELPER_READING_REPLY_FAILED_STRING;
case (12010):
return STR_HELPER_COM_ERROR_STRING;
case (12011):
return STR_HELPER_NO_REPLY_STRING;
case (12012):
return STR_HELPER_DEC_ERROR_STRING;
case (12013):
return POSITION_MISMATCH_STRING;
case (12014):
return STR_HELPER_FILE_NOT_EXISTS_STRING;
case (12015):
return STR_HELPER_SENDING_PACKET_FAILED_STRING;
case (12016):
return STR_HELPER_REQUESTING_MSG_FAILED_STRING;
case (12100): case (12100):
return TRANSITION_BACK_TO_OFF_STRING; return SANITIZATION_FAILED_STRING;
case (12101): case (12101):
return NEG_V_OUT_OF_BOUNDS_STRING; return MOUNTED_SD_CARD_STRING;
case (12102):
return U_DRO_OUT_OF_BOUNDS_STRING;
case (12103):
return I_DRO_OUT_OF_BOUNDS_STRING;
case (12104):
return U_X8_OUT_OF_BOUNDS_STRING;
case (12105):
return I_X8_OUT_OF_BOUNDS_STRING;
case (12106):
return U_TX_OUT_OF_BOUNDS_STRING;
case (12107):
return I_TX_OUT_OF_BOUNDS_STRING;
case (12108):
return U_MPA_OUT_OF_BOUNDS_STRING;
case (12109):
return I_MPA_OUT_OF_BOUNDS_STRING;
case (12110):
return U_HPA_OUT_OF_BOUNDS_STRING;
case (12111):
return I_HPA_OUT_OF_BOUNDS_STRING;
case (12200): case (12200):
return TRANSITION_OTHER_SIDE_FAILED_STRING; return UPDATE_FILE_NOT_EXISTS_STRING;
case (12201): case (12201):
return NOT_ENOUGH_DEVICES_DUAL_MODE_STRING; return ACTION_COMMANDING_FAILED_STRING;
case (12202): case (12202):
return POWER_STATE_MACHINE_TIMEOUT_STRING; return UPDATE_AVAILABLE_FAILED_STRING;
case (12203): case (12203):
return UPDATE_TRANSFER_FAILED_STRING;
case (12204):
return UPDATE_VERIFY_FAILED_STRING;
case (12205):
return UPDATE_FINISHED_STRING;
case (12300):
return SEND_MRAM_DUMP_FAILED_STRING;
case (12301):
return MRAM_DUMP_FAILED_STRING;
case (12302):
return MRAM_DUMP_FINISHED_STRING;
case (12401):
return INVALID_TC_FRAME_STRING;
case (12402):
return INVALID_FAR_STRING;
case (12403):
return CARRIER_LOCK_STRING;
case (12404):
return BIT_LOCK_PDEC_STRING;
case (12500):
return IMAGE_UPLOAD_FAILED_STRING;
case (12501):
return IMAGE_DOWNLOAD_FAILED_STRING;
case (12502):
return IMAGE_UPLOAD_SUCCESSFUL_STRING;
case (12503):
return IMAGE_DOWNLOAD_SUCCESSFUL_STRING;
case (12504):
return FLASH_WRITE_SUCCESSFUL_STRING;
case (12505):
return FLASH_READ_SUCCESSFUL_STRING;
case (12506):
return FLASH_READ_FAILED_STRING;
case (12507):
return FIRMWARE_UPDATE_SUCCESSFUL_STRING;
case (12508):
return FIRMWARE_UPDATE_FAILED_STRING;
case (12509):
return STR_HELPER_READING_REPLY_FAILED_STRING;
case (12510):
return STR_HELPER_COM_ERROR_STRING;
case (12511):
return STR_HELPER_NO_REPLY_STRING;
case (12512):
return STR_HELPER_DEC_ERROR_STRING;
case (12513):
return POSITION_MISMATCH_STRING;
case (12514):
return STR_HELPER_FILE_NOT_EXISTS_STRING;
case (12515):
return STR_HELPER_SENDING_PACKET_FAILED_STRING;
case (12516):
return STR_HELPER_REQUESTING_MSG_FAILED_STRING;
case (12600):
return MPSOC_FLASH_WRITE_FAILED_STRING;
case (12601):
return MPSOC_FLASH_WRITE_SUCCESSFUL_STRING;
case (12602):
return SENDING_COMMAND_FAILED_STRING;
case (12603):
return MPSOC_HELPER_REQUESTING_REPLY_FAILED_STRING;
case (12604):
return MPSOC_HELPER_READING_REPLY_FAILED_STRING;
case (12605):
return MISSING_ACK_STRING;
case (12606):
return MISSING_EXE_STRING;
case (12607):
return ACK_FAILURE_REPORT_STRING;
case (12608):
return EXE_FAILURE_REPORT_STRING;
case (12609):
return ACK_INVALID_APID_STRING;
case (12610):
return EXE_INVALID_APID_STRING;
case (12611):
return MPSOC_HELPER_SEQ_CNT_MISMATCH_STRING;
case (12700):
return TRANSITION_BACK_TO_OFF_STRING;
case (12701):
return NEG_V_OUT_OF_BOUNDS_STRING;
case (12702):
return U_DRO_OUT_OF_BOUNDS_STRING;
case (12703):
return I_DRO_OUT_OF_BOUNDS_STRING;
case (12704):
return U_X8_OUT_OF_BOUNDS_STRING;
case (12705):
return I_X8_OUT_OF_BOUNDS_STRING;
case (12706):
return U_TX_OUT_OF_BOUNDS_STRING;
case (12707):
return I_TX_OUT_OF_BOUNDS_STRING;
case (12708):
return U_MPA_OUT_OF_BOUNDS_STRING;
case (12709):
return I_MPA_OUT_OF_BOUNDS_STRING;
case (12710):
return U_HPA_OUT_OF_BOUNDS_STRING;
case (12711):
return I_HPA_OUT_OF_BOUNDS_STRING;
case (12800):
return TRANSITION_OTHER_SIDE_FAILED_STRING;
case (12801):
return NOT_ENOUGH_DEVICES_DUAL_MODE_STRING;
case (12802):
return POWER_STATE_MACHINE_TIMEOUT_STRING;
case (12803):
return SIDE_SWITCH_TRANSITION_NOT_ALLOWED_STRING; return SIDE_SWITCH_TRANSITION_NOT_ALLOWED_STRING;
case (12400): case (13000):
return CHILDREN_LOST_MODE_STRING; return CHILDREN_LOST_MODE_STRING;
case (13100):
return GPS_FIX_CHANGE_STRING;
case (13600): case (13600):
return ALLOC_FAILURE_STRING; return ALLOC_FAILURE_STRING;
case (13601): case (13601):

View File

@ -1,8 +1,8 @@
/** /**
* @brief Auto-generated object translation file. * @brief Auto-generated object translation file.
* @details * @details
* Contains 115 translations. * Contains 117 translations.
* Generated on: 2022-03-22 20:43:04 * Generated on: 2022-04-08 11:21:58
*/ */
#include "translateObjects.h" #include "translateObjects.h"
@ -48,8 +48,10 @@ const char *RAD_SENSOR_STRING = "RAD_SENSOR";
const char *PLOC_UPDATER_STRING = "PLOC_UPDATER"; 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_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 *SOLAR_ARRAY_DEPL_HANDLER_STRING = "SOLAR_ARRAY_DEPL_HANDLER"; 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";
@ -208,10 +210,14 @@ const char *translateObject(object_id_t object) {
return PLOC_MEMORY_DUMPER_STRING; return PLOC_MEMORY_DUMPER_STRING;
case 0x44330002: case 0x44330002:
return STR_HELPER_STRING; return STR_HELPER_STRING;
case 0x44330003:
return PLOC_MPSOC_HELPER_STRING;
case 0x44330015: case 0x44330015:
return PLOC_MPSOC_HANDLER_STRING; return PLOC_MPSOC_HANDLER_STRING;
case 0x44330016: case 0x44330016:
return PLOC_SUPERVISOR_HANDLER_STRING; return PLOC_SUPERVISOR_HANDLER_STRING;
case 0x44330017:
return PLOC_SUPERVISOR_HELPER_STRING;
case 0x444100A2: case 0x444100A2:
return SOLAR_ARRAY_DEPL_HANDLER_STRING; return SOLAR_ARRAY_DEPL_HANDLER_STRING;
case 0x444100A4: case 0x444100A4:

View File

@ -177,14 +177,7 @@ ReturnValue_t pst::pstSpi(FixedTimeslotTaskIF *thisSequence) {
bool addSus9 = true; bool addSus9 = true;
bool addSus10 = true; bool addSus10 = true;
bool addSus11 = true; bool addSus11 = true;
/**
* The sun sensor will be shutdown as soon as the chip select is pulled high. Thus all
* requests to a sun sensor must be performed consecutively. Another reason for calling multiple
* device handler cycles is that the ADC conversions take some time. Thus first the ADC
* conversions are initiated and in a next step the results can be read from the internal FIFO.
* One sun sensor communication sequence also blocks the SPI bus. So other devices can not be
* inserted between the device handler cycles of one SUS.
*/
if (addSus0) { if (addSus0) {
/* Write setup */ /* Write setup */
thisSequence->addSlot(objects::SUS_0, length * 0, DeviceHandlerIF::PERFORM_OPERATION); thisSequence->addSlot(objects::SUS_0, length * 0, DeviceHandlerIF::PERFORM_OPERATION);
@ -517,6 +510,7 @@ ReturnValue_t pst::pstUart(FixedTimeslotTaskIF *thisSequence) {
ReturnValue_t pst::pstGompaceCan(FixedTimeslotTaskIF *thisSequence) { ReturnValue_t pst::pstGompaceCan(FixedTimeslotTaskIF *thisSequence) {
uint32_t length = thisSequence->getPeriodMs(); uint32_t length = thisSequence->getPeriodMs();
#ifndef TE0720_1CFA
#if Q7S_EM != 1 #if Q7S_EM != 1
// PCDU handlers receives two messages and both must be handled // PCDU handlers receives two messages and both must be handled
thisSequence->addSlot(objects::PCDU_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); thisSequence->addSlot(objects::PCDU_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION);
@ -551,6 +545,7 @@ ReturnValue_t pst::pstGompaceCan(FixedTimeslotTaskIF *thisSequence) {
return HasReturnvaluesIF::RETURN_FAILED; return HasReturnvaluesIF::RETURN_FAILED;
} }
#endif /* Q7S_EM == 0 */ #endif /* Q7S_EM == 0 */
#endif
static_cast<void>(length); static_cast<void>(length);
return HasReturnvaluesIF::RETURN_OK; return HasReturnvaluesIF::RETURN_OK;
} }
@ -590,69 +585,3 @@ ReturnValue_t pst::pstTest(FixedTimeslotTaskIF *thisSequence) {
} }
return HasReturnvaluesIF::RETURN_OK; return HasReturnvaluesIF::RETURN_OK;
} }
#if BOARD_TE0720 == 1
ReturnValue_t pst::pollingSequenceTE0720(FixedTimeslotTaskIF *thisSequence) {
uint32_t length = thisSequence->getPeriodMs();
#if TEST_PLOC_MPSOC_HANDLER == 1
thisSequence->addSlot(objects::PLOC_MPSOC_HANDLER, length * 0,
DeviceHandlerIF::PERFORM_OPERATION);
thisSequence->addSlot(objects::PLOC_MPSOC_HANDLER, length * 0.2, DeviceHandlerIF::SEND_WRITE);
thisSequence->addSlot(objects::PLOC_MPSOC_HANDLER, length * 0.4, DeviceHandlerIF::GET_WRITE);
thisSequence->addSlot(objects::PLOC_MPSOC_HANDLER, length * 0.6, DeviceHandlerIF::SEND_READ);
thisSequence->addSlot(objects::PLOC_MPSOC_HANDLER, length * 0.8, DeviceHandlerIF::GET_READ);
#endif
#if OBSW_TEST_RAD_SENSOR == 1
thisSequence->addSlot(objects::RAD_SENSOR, length * 0, DeviceHandlerIF::PERFORM_OPERATION);
thisSequence->addSlot(objects::RAD_SENSOR, length * 0.2, DeviceHandlerIF::SEND_WRITE);
thisSequence->addSlot(objects::RAD_SENSOR, length * 0.4, DeviceHandlerIF::GET_WRITE);
thisSequence->addSlot(objects::RAD_SENSOR, length * 0.6, DeviceHandlerIF::SEND_READ);
thisSequence->addSlot(objects::RAD_SENSOR, length * 0.8, DeviceHandlerIF::GET_READ);
#endif
#if OBSW_TEST_SUS == 1
/* Write setup */
thisSequence->addSlot(objects::SUS_1, length * 0.901, DeviceHandlerIF::PERFORM_OPERATION);
thisSequence->addSlot(objects::SUS_1, length * 0.902, SusHandler::FIRST_WRITE);
thisSequence->addSlot(objects::SUS_1, length * 0.903, DeviceHandlerIF::GET_WRITE);
thisSequence->addSlot(objects::SUS_1, length * 0.904, DeviceHandlerIF::SEND_READ);
thisSequence->addSlot(objects::SUS_1, length * 0.905, DeviceHandlerIF::GET_READ);
/* Start conversion*/
thisSequence->addSlot(objects::SUS_1, length * 0.906, DeviceHandlerIF::PERFORM_OPERATION);
thisSequence->addSlot(objects::SUS_1, length * 0.907, DeviceHandlerIF::SEND_WRITE);
thisSequence->addSlot(objects::SUS_1, length * 0.908, DeviceHandlerIF::GET_WRITE);
thisSequence->addSlot(objects::SUS_1, length * 0.909, DeviceHandlerIF::SEND_READ);
thisSequence->addSlot(objects::SUS_1, length * 0.91, DeviceHandlerIF::GET_READ);
/* Read conversions */
thisSequence->addSlot(objects::SUS_1, length * 0.911, DeviceHandlerIF::PERFORM_OPERATION);
thisSequence->addSlot(objects::SUS_1, length * 0.912, DeviceHandlerIF::SEND_WRITE);
thisSequence->addSlot(objects::SUS_1, length * 0.913, DeviceHandlerIF::GET_WRITE);
thisSequence->addSlot(objects::SUS_1, length * 0.914, DeviceHandlerIF::SEND_READ);
thisSequence->addSlot(objects::SUS_1, length * 0.915, DeviceHandlerIF::GET_READ);
#endif
#if OBSW_ADD_PLOC_SUPERVISOR == 1
thisSequence->addSlot(objects::PLOC_SUPERVISOR_HANDLER, length * 0,
DeviceHandlerIF::PERFORM_OPERATION);
thisSequence->addSlot(objects::PLOC_SUPERVISOR_HANDLER, length * 0.2,
DeviceHandlerIF::SEND_WRITE);
thisSequence->addSlot(objects::PLOC_SUPERVISOR_HANDLER, length * 0.4, DeviceHandlerIF::GET_WRITE);
thisSequence->addSlot(objects::PLOC_SUPERVISOR_HANDLER, length * 0.7, DeviceHandlerIF::SEND_READ);
thisSequence->addSlot(objects::PLOC_SUPERVISOR_HANDLER, length * 0.8, DeviceHandlerIF::GET_READ);
#endif
thisSequence->addSlot(objects::PLOC_UPDATER, length * 0, DeviceHandlerIF::PERFORM_OPERATION);
thisSequence->addSlot(objects::PLOC_MEMORY_DUMPER, length * 0,
DeviceHandlerIF::PERFORM_OPERATION);
if (thisSequence->checkSequence() != HasReturnvaluesIF::RETURN_OK) {
sif::error << "Initialization of TE0720 PST failed" << std::endl;
return HasReturnvaluesIF::RETURN_FAILED;
}
return HasReturnvaluesIF::RETURN_OK;
}
#endif /* BOARD_TE0720 == 1 */

View File

@ -54,14 +54,6 @@ ReturnValue_t pstI2c(FixedTimeslotTaskIF* thisSequence);
* @return * @return
*/ */
ReturnValue_t pstTest(FixedTimeslotTaskIF* thisSequence); ReturnValue_t pstTest(FixedTimeslotTaskIF* thisSequence);
#if BOARD_TE0720 == 1
/**
* @brief This polling sequence will be created when the software is compiled for the TE0720.
*/
ReturnValue_t pollingSequenceTE0720(FixedTimeslotTaskIF* thisSequence);
#endif
} // namespace pst } // namespace pst
#endif /* POLLINGSEQUENCEINIT_H_ */ #endif /* POLLINGSEQUENCEINIT_H_ */

View File

@ -37,6 +37,8 @@ class AxiPtmeConfig : public SystemObject {
* The default implementation of the PTME generates a clock where the high level is * The default implementation of the PTME generates a clock where the high level is
* only one bit clock period long. This might be too short to match the setup and hold * only one bit clock period long. This might be too short to match the setup and hold
* times of the S-and transceiver. * times of the S-and transceiver.
* Default: Enables TX clock manipulator
*
*/ */
ReturnValue_t enableTxclockManipulator(); ReturnValue_t enableTxclockManipulator();
ReturnValue_t disableTxclockManipulator(); ReturnValue_t disableTxclockManipulator();
@ -47,6 +49,7 @@ class AxiPtmeConfig : public SystemObject {
* Enable inversion will update data on falling edge (not the configuration required by the * Enable inversion will update data on falling edge (not the configuration required by the
* syrlinks) * syrlinks)
* Disable clock inversion. Data updated on rising edge. * Disable clock inversion. Data updated on rising edge.
* Default: Inversion is disabled
*/ */
ReturnValue_t enableTxclockInversion(); ReturnValue_t enableTxclockInversion();
ReturnValue_t disableTxclockInversion(); ReturnValue_t disableTxclockInversion();
@ -54,7 +57,7 @@ class AxiPtmeConfig : public SystemObject {
private: private:
// Address of register storing the bitrate configuration parameter // Address of register storing the bitrate configuration parameter
static const uint32_t CADU_BITRATE_REG = 0x0; static const uint32_t CADU_BITRATE_REG = 0x0;
// Address to register storing common configuration parameters // Address of register storing common configuration parameters
static const uint32_t COMMON_CONFIG_REG = 0x4; static const uint32_t COMMON_CONFIG_REG = 0x4;
static const uint32_t ADRESS_DIVIDER = 4; static const uint32_t ADRESS_DIVIDER = 4;

View File

@ -326,6 +326,7 @@ void PdecHandler::handleNewTc() {
printTC(tcLength); printTC(tcLength);
#endif /* OBSW_DEBUG_PDEC_HANDLER */ #endif /* OBSW_DEBUG_PDEC_HANDLER */
#if OBSW_TC_FROM_PDEC == 1
store_address_t storeId; store_address_t storeId;
result = tcStore->addData(&storeId, tcSegment + 1, tcLength - 1); result = tcStore->addData(&storeId, tcSegment + 1, tcLength - 1);
if (result != RETURN_OK) { if (result != RETURN_OK) {
@ -343,6 +344,7 @@ void PdecHandler::handleNewTc() {
tcStore->deleteData(storeId); tcStore->deleteData(storeId);
return; return;
} }
#endif /* OBSW_TC_FROM_PDEC == 1 */
return; return;
} }

Some files were not shown because too many files have changed in this diff Show More