Merge remote-tracking branch 'origin/develop' into bugfix_shadowed_variables_dual_assys
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good

This commit is contained in:
Robin Müller 2023-02-23 15:27:15 +01:00
commit 0ee7bdad0a
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
36 changed files with 348 additions and 217 deletions

View File

@ -16,10 +16,30 @@ will consitute of a breaking change warranting a new major release:
# [unreleased]
eive-tmtc: v2.15.1
## Fixed
- Usage of floats as iterators and using them to calculate a uint8_t index in `SusConverter`
- Removed unused variables in the `AcsController`
- Remove shadowing variables inside ACS assembly classes.
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/issues/385
## Changed
COM PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/364
* Moved transmitter timer and handling of carrier and bitlock event from CCSDS handler to COM
subsystem
* Added parameter command to be able to change the transmitter timeout
* Solves [#362](https://egit.irs.uni-stuttgart.de/eive/eive-obsw/issues/362)
* Solves [#360](https://egit.irs.uni-stuttgart.de/eive/eive-obsw/issues/360)
* Solves [#361](https://egit.irs.uni-stuttgart.de/eive/eive-obsw/issues/361)
* Solves [#386](https://egit.irs.uni-stuttgart.de/eive/eive-obsw/issues/386)
- All `targetQuat` functions in `Guidance` now return the target quaternion (target
in ECI frame), which is passed on to `CtrlValData`.
- Moved polling sequence table definitions and source code to `mission/core` folder.
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/395
## Added
@ -35,13 +55,6 @@ will consitute of a breaking change warranting a new major release:
- `MekfData` now includes `mekfStatus`
- `CtrlValData` now includes `tgtRotRate`
## Fixed
- Usage of floats as iterators and using them to calculate a uint8_t index in `SusConverter`
- Removed unused variables in the `AcsController`
- Remove shadowing variables inside ACS assembly classes.
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/issues/385
# [v1.30.0]
eive-tmtc: v2.14.0

View File

@ -1,7 +1,7 @@
/**
* @brief Auto-generated event translation file. Contains 258 translations.
* @brief Auto-generated event translation file. Contains 260 translations.
* @details
* Generated on: 2023-02-22 15:00:34
* Generated on: 2023-02-23 15:20:41
*/
#include "translateEvents.h"
@ -93,6 +93,8 @@ const char *SERIALIZATION_ERROR_STRING = "SERIALIZATION_ERROR";
const char *SAFE_RATE_VIOLATION_STRING = "SAFE_RATE_VIOLATION";
const char *SAFE_RATE_RECOVERY_STRING = "SAFE_RATE_RECOVERY";
const char *MULTIPLE_RW_INVALID_STRING = "MULTIPLE_RW_INVALID";
const char *MEKF_INVALID_INFO_STRING = "MEKF_INVALID_INFO";
const char *MEKF_INVALID_MODE_VIOLATION_STRING = "MEKF_INVALID_MODE_VIOLATION";
const char *SWITCH_CMD_SENT_STRING = "SWITCH_CMD_SENT";
const char *SWITCH_HAS_CHANGED_STRING = "SWITCH_HAS_CHANGED";
const char *SWITCHING_Q7S_DENIED_STRING = "SWITCHING_Q7S_DENIED";
@ -437,6 +439,10 @@ const char *translateEvents(Event event) {
return SAFE_RATE_RECOVERY_STRING;
case (11202):
return MULTIPLE_RW_INVALID_STRING;
case (11203):
return MEKF_INVALID_INFO_STRING;
case (11204):
return MEKF_INVALID_MODE_VIOLATION_STRING;
case (11300):
return SWITCH_CMD_SENT_STRING;
case (11301):

View File

@ -2,7 +2,7 @@
* @brief Auto-generated object translation file.
* @details
* Contains 148 translations.
* Generated on: 2023-02-22 15:00:34
* Generated on: 2023-02-23 15:20:41
*/
#include "translateObjects.h"

View File

@ -573,7 +573,6 @@ void ObjectFactory::createSyrlinksComponents(PowerSwitchIF* pwrSwitcher) {
new SyrlinksHandler(objects::SYRLINKS_HANDLER, objects::UART_COM_IF, syrlinksUartCookie,
pcdu::PDU1_CH1_SYRLINKS_12V, syrlinksFdir);
syrlinksHandler->setPowerSwitcher(pwrSwitcher);
syrlinksHandler->setStartUpImmediately();
syrlinksHandler->connectModeTreeParent(satsystem::com::SUBSYSTEM);
#if OBSW_DEBUG_SYRLINKS == 1
syrlinksHandler->setDebugMode(true);
@ -756,15 +755,10 @@ ReturnValue_t ObjectFactory::createCcsdsComponents(LinuxLibgpioIF* gpioComIF,
AxiPtmeConfig* axiPtmeConfig =
new AxiPtmeConfig(objects::AXI_PTME_CONFIG, q7s::UIO_PTME, q7s::uiomapids::PTME_CONFIG);
PtmeConfig* ptmeConfig = new PtmeConfig(objects::PTME_CONFIG, axiPtmeConfig);
#if OBSW_ENABLE_SYRLINKS_TRANSMIT_TIMEOUT == 1
// Set to high value when not sending via syrlinks
static const uint32_t TRANSMITTER_TIMEOUT = 86400000; // 1 day
#else
static const uint32_t TRANSMITTER_TIMEOUT = 900000; // 15 minutes
#endif
*ipCoreHandler = new CcsdsIpCoreHandler(
objects::CCSDS_HANDLER, objects::PTME, objects::CCSDS_PACKET_DISTRIBUTOR, ptmeConfig,
gpioComIF, gpioIds::RS485_EN_TX_CLOCK, gpioIds::RS485_EN_TX_DATA, TRANSMITTER_TIMEOUT);
*ipCoreHandler = new CcsdsIpCoreHandler(objects::CCSDS_HANDLER, objects::PTME,
objects::CCSDS_PACKET_DISTRIBUTOR, ptmeConfig, gpioComIF,
gpioIds::RS485_EN_TX_CLOCK, gpioIds::RS485_EN_TX_DATA);
VirtualChannel* vc = nullptr;
vc = new VirtualChannel(ccsds::VC0, config::VC0_QUEUE_SIZE, objects::CCSDS_HANDLER);
(*ipCoreHandler)->addVirtualChannel(ccsds::VC0, vc);

View File

@ -17,10 +17,10 @@
#include "fsfw/tasks/FixedTimeslotTaskIF.h"
#include "fsfw/tasks/PeriodicTaskIF.h"
#include "fsfw/tasks/TaskFactory.h"
#include "mission/core/pollingSeqTables.h"
#include "mission/core/scheduling.h"
#include "mission/devices/devicedefinitions/Max31865Definitions.h"
#include "mission/utility/InitMission.h"
#include "pollingsequence/pollingSequenceFactory.h"
/* This is configured for linux without CR */
#ifdef PLATFORM_UNIX
@ -404,7 +404,7 @@ void scheduling::createPstTasks(TaskFactory& factory, TaskDeadlineMissedFunction
#ifdef RELEASE_BUILD
static constexpr float acsPstPeriod = 0.4;
#else
static constexpr float acsPstPeriod = 0.8;
static constexpr float acsPstPeriod = 0.4;
#endif
FixedTimeslotTaskIF* acsTcsPst = factory.createFixedTimeslotTask(
"ACS_TCS_PST", 80, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, acsPstPeriod, missedDeadlineFunc);

View File

@ -1,11 +1,10 @@
#ifndef BSP_Q7S_INITMISSION_H_
#define BSP_Q7S_INITMISSION_H_
#include <pollingsequence/pollingSequenceFactory.h>
#include <vector>
#include "fsfw/tasks/definitions.h"
#include "mission/core/pollingSeqTables.h"
using pst::AcsPstCfg;

View File

@ -62,7 +62,8 @@ static constexpr uint32_t SCHED_BLOCK_2_SENSOR_READ_MS = 30;
static constexpr uint32_t SCHED_BLOCK_3_READ_IMTQ_MGM_MS = 42;
static constexpr uint32_t SCHED_BLOCK_4_ACS_CTRL_MS = 45;
static constexpr uint32_t SCHED_BLOCK_5_ACTUATOR_MS = 50;
static constexpr uint32_t SCHED_BLOCK_6_IMTQ_BLOCK_2_MS = 75;
static constexpr uint32_t SCHED_BLOCK_6_IMTQ_BLOCK_2_MS = 90;
static constexpr uint32_t SCHED_BLOCK_RTD = 150;
static constexpr uint32_t SCHED_BLOCK_7_RW_READ_MS = 300;
// 15 ms for FM
@ -76,6 +77,7 @@ static constexpr float SCHED_BLOCK_5_PERIOD = static_cast<float>(SCHED_BLOCK_5_A
static constexpr float SCHED_BLOCK_6_PERIOD =
static_cast<float>(SCHED_BLOCK_6_IMTQ_BLOCK_2_MS) / 400.0;
static constexpr float SCHED_BLOCK_7_PERIOD = static_cast<float>(SCHED_BLOCK_7_RW_READ_MS) / 400.0;
static constexpr float SCHED_BLOCK_RTD_PERIOD = static_cast<float>(SCHED_BLOCK_RTD) / 400.0;
} // namespace acs

View File

@ -87,6 +87,8 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path
11200;0x2bc0;SAFE_RATE_VIOLATION;MEDIUM;No description;mission/acsDefs.h
11201;0x2bc1;SAFE_RATE_RECOVERY;MEDIUM;No description;mission/acsDefs.h
11202;0x2bc2;MULTIPLE_RW_INVALID;HIGH;No description;mission/acsDefs.h
11203;0x2bc3;MEKF_INVALID_INFO;INFO;No description;mission/acsDefs.h
11204;0x2bc4;MEKF_INVALID_MODE_VIOLATION;HIGH;No description;mission/acsDefs.h
11300;0x2c24;SWITCH_CMD_SENT;INFO;Indicates that a FSFW object requested setting a switch P1: 1 if on was requested, 0 for off | P2: Switch Index;mission/devices/devicedefinitions/powerDefinitions.h
11301;0x2c25;SWITCH_HAS_CHANGED;INFO;Indicated that a switch state has changed P1: New switch state, 1 for on, 0 for off | P2: Switch Index;mission/devices/devicedefinitions/powerDefinitions.h
11302;0x2c26;SWITCHING_Q7S_DENIED;MEDIUM;No description;mission/devices/devicedefinitions/powerDefinitions.h

1 Event ID (dec) Event ID (hex) Name Severity Description File Path
87 11200 0x2bc0 SAFE_RATE_VIOLATION MEDIUM No description mission/acsDefs.h
88 11201 0x2bc1 SAFE_RATE_RECOVERY MEDIUM No description mission/acsDefs.h
89 11202 0x2bc2 MULTIPLE_RW_INVALID HIGH No description mission/acsDefs.h
90 11203 0x2bc3 MEKF_INVALID_INFO INFO No description mission/acsDefs.h
91 11204 0x2bc4 MEKF_INVALID_MODE_VIOLATION HIGH No description mission/acsDefs.h
92 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
93 11301 0x2c25 SWITCH_HAS_CHANGED INFO Indicated that a switch state has changed P1: New switch state, 1 for on, 0 for off | P2: Switch Index mission/devices/devicedefinitions/powerDefinitions.h
94 11302 0x2c26 SWITCHING_Q7S_DENIED MEDIUM No description mission/devices/devicedefinitions/powerDefinitions.h

View File

@ -53,9 +53,13 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path
0x6a01;ACSSAF_SafectrlMekfInputInvalid;No description;1;ACS_SAFE;mission/controller/acs/control/SafeCtrl.h
0x6b01;ACSPTG_PtgctrlMekfInputInvalid;No description;1;ACS_PTG;mission/controller/acs/control/PtgCtrl.h
0x6c01;ACSDTB_DetumbleNoSensordata;No description;1;ACS_DETUMBLE;mission/controller/acs/control/Detumble.h
0x6901;ACSKAL_KalmanNoGyrMeas;No description;1;ACS_KALMAN;mission/controller/acs/MultiplicativeKalmanFilter.h
0x6902;ACSKAL_KalmanNoModel;No description;2;ACS_KALMAN;mission/controller/acs/MultiplicativeKalmanFilter.h
0x6903;ACSKAL_KalmanInversionFailed;No description;3;ACS_KALMAN;mission/controller/acs/MultiplicativeKalmanFilter.h
0x6902;ACSKAL_KalmanUninitialized;No description;2;ACS_KALMAN;mission/controller/acs/MultiplicativeKalmanFilter.h
0x6903;ACSKAL_KalmanNoGyrData;No description;3;ACS_KALMAN;mission/controller/acs/MultiplicativeKalmanFilter.h
0x6904;ACSKAL_KalmanNoModelVectors;No description;4;ACS_KALMAN;mission/controller/acs/MultiplicativeKalmanFilter.h
0x6905;ACSKAL_KalmanNoSusMgmStrData;No description;5;ACS_KALMAN;mission/controller/acs/MultiplicativeKalmanFilter.h
0x6906;ACSKAL_KalmanCovarianceInversionFailed;No description;6;ACS_KALMAN;mission/controller/acs/MultiplicativeKalmanFilter.h
0x6907;ACSKAL_KalmanInitialized;No description;7;ACS_KALMAN;mission/controller/acs/MultiplicativeKalmanFilter.h
0x6908;ACSKAL_KalmanRunning;No description;8;ACS_KALMAN;mission/controller/acs/MultiplicativeKalmanFilter.h
0x4500;HSPI_OpeningFileFailed;No description;0;HAL_SPI;fsfw/src/fsfw_hal/linux/spi/SpiComIF.h
0x4501;HSPI_FullDuplexTransferFailed;No description;1;HAL_SPI;fsfw/src/fsfw_hal/linux/spi/SpiComIF.h
0x4502;HSPI_HalfDuplexTransferFailed;No description;2;HAL_SPI;fsfw/src/fsfw_hal/linux/spi/SpiComIF.h

1 Full ID (hex) Name Description Unique ID Subsytem Name File Path
53 0x6a01 ACSSAF_SafectrlMekfInputInvalid No description 1 ACS_SAFE mission/controller/acs/control/SafeCtrl.h
54 0x6b01 ACSPTG_PtgctrlMekfInputInvalid No description 1 ACS_PTG mission/controller/acs/control/PtgCtrl.h
55 0x6c01 ACSDTB_DetumbleNoSensordata No description 1 ACS_DETUMBLE mission/controller/acs/control/Detumble.h
56 0x6901 0x6902 ACSKAL_KalmanNoGyrMeas ACSKAL_KalmanUninitialized No description 1 2 ACS_KALMAN mission/controller/acs/MultiplicativeKalmanFilter.h
57 0x6902 0x6903 ACSKAL_KalmanNoModel ACSKAL_KalmanNoGyrData No description 2 3 ACS_KALMAN mission/controller/acs/MultiplicativeKalmanFilter.h
58 0x6903 0x6904 ACSKAL_KalmanInversionFailed ACSKAL_KalmanNoModelVectors No description 3 4 ACS_KALMAN mission/controller/acs/MultiplicativeKalmanFilter.h
59 0x6905 ACSKAL_KalmanNoSusMgmStrData No description 5 ACS_KALMAN mission/controller/acs/MultiplicativeKalmanFilter.h
60 0x6906 ACSKAL_KalmanCovarianceInversionFailed No description 6 ACS_KALMAN mission/controller/acs/MultiplicativeKalmanFilter.h
61 0x6907 ACSKAL_KalmanInitialized No description 7 ACS_KALMAN mission/controller/acs/MultiplicativeKalmanFilter.h
62 0x6908 ACSKAL_KalmanRunning No description 8 ACS_KALMAN mission/controller/acs/MultiplicativeKalmanFilter.h
63 0x4500 HSPI_OpeningFileFailed No description 0 HAL_SPI fsfw/src/fsfw_hal/linux/spi/SpiComIF.h
64 0x4501 HSPI_FullDuplexTransferFailed No description 1 HAL_SPI fsfw/src/fsfw_hal/linux/spi/SpiComIF.h
65 0x4502 HSPI_HalfDuplexTransferFailed No description 2 HAL_SPI fsfw/src/fsfw_hal/linux/spi/SpiComIF.h

View File

@ -87,6 +87,8 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path
11200;0x2bc0;SAFE_RATE_VIOLATION;MEDIUM;No description;mission/acsDefs.h
11201;0x2bc1;SAFE_RATE_RECOVERY;MEDIUM;No description;mission/acsDefs.h
11202;0x2bc2;MULTIPLE_RW_INVALID;HIGH;No description;mission/acsDefs.h
11203;0x2bc3;MEKF_INVALID_INFO;INFO;No description;mission/acsDefs.h
11204;0x2bc4;MEKF_INVALID_MODE_VIOLATION;HIGH;No description;mission/acsDefs.h
11300;0x2c24;SWITCH_CMD_SENT;INFO;Indicates that a FSFW object requested setting a switch P1: 1 if on was requested, 0 for off | P2: Switch Index;mission/devices/devicedefinitions/powerDefinitions.h
11301;0x2c25;SWITCH_HAS_CHANGED;INFO;Indicated that a switch state has changed P1: New switch state, 1 for on, 0 for off | P2: Switch Index;mission/devices/devicedefinitions/powerDefinitions.h
11302;0x2c26;SWITCHING_Q7S_DENIED;MEDIUM;No description;mission/devices/devicedefinitions/powerDefinitions.h

1 Event ID (dec) Event ID (hex) Name Severity Description File Path
87 11200 0x2bc0 SAFE_RATE_VIOLATION MEDIUM No description mission/acsDefs.h
88 11201 0x2bc1 SAFE_RATE_RECOVERY MEDIUM No description mission/acsDefs.h
89 11202 0x2bc2 MULTIPLE_RW_INVALID HIGH No description mission/acsDefs.h
90 11203 0x2bc3 MEKF_INVALID_INFO INFO No description mission/acsDefs.h
91 11204 0x2bc4 MEKF_INVALID_MODE_VIOLATION HIGH No description mission/acsDefs.h
92 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
93 11301 0x2c25 SWITCH_HAS_CHANGED INFO Indicated that a switch state has changed P1: New switch state, 1 for on, 0 for off | P2: Switch Index mission/devices/devicedefinitions/powerDefinitions.h
94 11302 0x2c26 SWITCHING_Q7S_DENIED MEDIUM No description mission/devices/devicedefinitions/powerDefinitions.h

View File

@ -53,9 +53,13 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path
0x6a01;ACSSAF_SafectrlMekfInputInvalid;No description;1;ACS_SAFE;mission/controller/acs/control/SafeCtrl.h
0x6b01;ACSPTG_PtgctrlMekfInputInvalid;No description;1;ACS_PTG;mission/controller/acs/control/PtgCtrl.h
0x6c01;ACSDTB_DetumbleNoSensordata;No description;1;ACS_DETUMBLE;mission/controller/acs/control/Detumble.h
0x6901;ACSKAL_KalmanNoGyrMeas;No description;1;ACS_KALMAN;mission/controller/acs/MultiplicativeKalmanFilter.h
0x6902;ACSKAL_KalmanNoModel;No description;2;ACS_KALMAN;mission/controller/acs/MultiplicativeKalmanFilter.h
0x6903;ACSKAL_KalmanInversionFailed;No description;3;ACS_KALMAN;mission/controller/acs/MultiplicativeKalmanFilter.h
0x6902;ACSKAL_KalmanUninitialized;No description;2;ACS_KALMAN;mission/controller/acs/MultiplicativeKalmanFilter.h
0x6903;ACSKAL_KalmanNoGyrData;No description;3;ACS_KALMAN;mission/controller/acs/MultiplicativeKalmanFilter.h
0x6904;ACSKAL_KalmanNoModelVectors;No description;4;ACS_KALMAN;mission/controller/acs/MultiplicativeKalmanFilter.h
0x6905;ACSKAL_KalmanNoSusMgmStrData;No description;5;ACS_KALMAN;mission/controller/acs/MultiplicativeKalmanFilter.h
0x6906;ACSKAL_KalmanCovarianceInversionFailed;No description;6;ACS_KALMAN;mission/controller/acs/MultiplicativeKalmanFilter.h
0x6907;ACSKAL_KalmanInitialized;No description;7;ACS_KALMAN;mission/controller/acs/MultiplicativeKalmanFilter.h
0x6908;ACSKAL_KalmanRunning;No description;8;ACS_KALMAN;mission/controller/acs/MultiplicativeKalmanFilter.h
0x4500;HSPI_OpeningFileFailed;No description;0;HAL_SPI;fsfw/src/fsfw_hal/linux/spi/SpiComIF.h
0x4501;HSPI_FullDuplexTransferFailed;No description;1;HAL_SPI;fsfw/src/fsfw_hal/linux/spi/SpiComIF.h
0x4502;HSPI_HalfDuplexTransferFailed;No description;2;HAL_SPI;fsfw/src/fsfw_hal/linux/spi/SpiComIF.h

1 Full ID (hex) Name Description Unique ID Subsytem Name File Path
53 0x6a01 ACSSAF_SafectrlMekfInputInvalid No description 1 ACS_SAFE mission/controller/acs/control/SafeCtrl.h
54 0x6b01 ACSPTG_PtgctrlMekfInputInvalid No description 1 ACS_PTG mission/controller/acs/control/PtgCtrl.h
55 0x6c01 ACSDTB_DetumbleNoSensordata No description 1 ACS_DETUMBLE mission/controller/acs/control/Detumble.h
56 0x6901 0x6902 ACSKAL_KalmanNoGyrMeas ACSKAL_KalmanUninitialized No description 1 2 ACS_KALMAN mission/controller/acs/MultiplicativeKalmanFilter.h
57 0x6902 0x6903 ACSKAL_KalmanNoModel ACSKAL_KalmanNoGyrData No description 2 3 ACS_KALMAN mission/controller/acs/MultiplicativeKalmanFilter.h
58 0x6903 0x6904 ACSKAL_KalmanInversionFailed ACSKAL_KalmanNoModelVectors No description 3 4 ACS_KALMAN mission/controller/acs/MultiplicativeKalmanFilter.h
59 0x6905 ACSKAL_KalmanNoSusMgmStrData No description 5 ACS_KALMAN mission/controller/acs/MultiplicativeKalmanFilter.h
60 0x6906 ACSKAL_KalmanCovarianceInversionFailed No description 6 ACS_KALMAN mission/controller/acs/MultiplicativeKalmanFilter.h
61 0x6907 ACSKAL_KalmanInitialized No description 7 ACS_KALMAN mission/controller/acs/MultiplicativeKalmanFilter.h
62 0x6908 ACSKAL_KalmanRunning No description 8 ACS_KALMAN mission/controller/acs/MultiplicativeKalmanFilter.h
63 0x4500 HSPI_OpeningFileFailed No description 0 HAL_SPI fsfw/src/fsfw_hal/linux/spi/SpiComIF.h
64 0x4501 HSPI_FullDuplexTransferFailed No description 1 HAL_SPI fsfw/src/fsfw_hal/linux/spi/SpiComIF.h
65 0x4502 HSPI_HalfDuplexTransferFailed No description 2 HAL_SPI fsfw/src/fsfw_hal/linux/spi/SpiComIF.h

View File

@ -1,7 +1,7 @@
/**
* @brief Auto-generated event translation file. Contains 258 translations.
* @brief Auto-generated event translation file. Contains 260 translations.
* @details
* Generated on: 2023-02-22 15:00:34
* Generated on: 2023-02-23 15:20:41
*/
#include "translateEvents.h"
@ -93,6 +93,8 @@ const char *SERIALIZATION_ERROR_STRING = "SERIALIZATION_ERROR";
const char *SAFE_RATE_VIOLATION_STRING = "SAFE_RATE_VIOLATION";
const char *SAFE_RATE_RECOVERY_STRING = "SAFE_RATE_RECOVERY";
const char *MULTIPLE_RW_INVALID_STRING = "MULTIPLE_RW_INVALID";
const char *MEKF_INVALID_INFO_STRING = "MEKF_INVALID_INFO";
const char *MEKF_INVALID_MODE_VIOLATION_STRING = "MEKF_INVALID_MODE_VIOLATION";
const char *SWITCH_CMD_SENT_STRING = "SWITCH_CMD_SENT";
const char *SWITCH_HAS_CHANGED_STRING = "SWITCH_HAS_CHANGED";
const char *SWITCHING_Q7S_DENIED_STRING = "SWITCHING_Q7S_DENIED";
@ -437,6 +439,10 @@ const char *translateEvents(Event event) {
return SAFE_RATE_RECOVERY_STRING;
case (11202):
return MULTIPLE_RW_INVALID_STRING;
case (11203):
return MEKF_INVALID_INFO_STRING;
case (11204):
return MEKF_INVALID_MODE_VIOLATION_STRING;
case (11300):
return SWITCH_CMD_SENT_STRING;
case (11301):

View File

@ -2,7 +2,7 @@
* @brief Auto-generated object translation file.
* @details
* Contains 153 translations.
* Generated on: 2023-02-22 15:00:34
* Generated on: 2023-02-23 15:20:41
*/
#include "translateObjects.h"

View File

@ -3,8 +3,9 @@ if(EIVE_BUILD_GPSD_GPS_HANDLER)
endif()
target_sources(
${OBSW_NAME} PRIVATE Max31865RtdPolling.cpp ScexUartReader.cpp ImtqPollingTask.cpp
ScexDleParser.cpp ScexHelper.cpp RwPollingTask.cpp)
${OBSW_NAME}
PRIVATE Max31865RtdPolling.cpp ScexUartReader.cpp ImtqPollingTask.cpp
ScexDleParser.cpp ScexHelper.cpp RwPollingTask.cpp)
add_subdirectory(ploc)

View File

@ -1,5 +1,4 @@
target_sources(${OBSW_NAME} PRIVATE ipc/MissionMessageTypes.cpp
pollingsequence/pollingSequenceFactory.cpp)
target_sources(${OBSW_NAME} PRIVATE ipc/MissionMessageTypes.cpp)
target_include_directories(${OBSW_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

View File

@ -1,7 +1,7 @@
/**
* @brief Auto-generated event translation file. Contains 258 translations.
* @brief Auto-generated event translation file. Contains 260 translations.
* @details
* Generated on: 2023-02-22 15:00:34
* Generated on: 2023-02-23 15:20:41
*/
#include "translateEvents.h"
@ -93,6 +93,8 @@ const char *SERIALIZATION_ERROR_STRING = "SERIALIZATION_ERROR";
const char *SAFE_RATE_VIOLATION_STRING = "SAFE_RATE_VIOLATION";
const char *SAFE_RATE_RECOVERY_STRING = "SAFE_RATE_RECOVERY";
const char *MULTIPLE_RW_INVALID_STRING = "MULTIPLE_RW_INVALID";
const char *MEKF_INVALID_INFO_STRING = "MEKF_INVALID_INFO";
const char *MEKF_INVALID_MODE_VIOLATION_STRING = "MEKF_INVALID_MODE_VIOLATION";
const char *SWITCH_CMD_SENT_STRING = "SWITCH_CMD_SENT";
const char *SWITCH_HAS_CHANGED_STRING = "SWITCH_HAS_CHANGED";
const char *SWITCHING_Q7S_DENIED_STRING = "SWITCHING_Q7S_DENIED";
@ -437,6 +439,10 @@ const char *translateEvents(Event event) {
return SAFE_RATE_RECOVERY_STRING;
case (11202):
return MULTIPLE_RW_INVALID_STRING;
case (11203):
return MEKF_INVALID_INFO_STRING;
case (11204):
return MEKF_INVALID_MODE_VIOLATION_STRING;
case (11300):
return SWITCH_CMD_SENT_STRING;
case (11301):

View File

@ -2,7 +2,7 @@
* @brief Auto-generated object translation file.
* @details
* Contains 153 translations.
* Generated on: 2023-02-22 15:00:34
* Generated on: 2023-02-23 15:20:41
*/
#include "translateObjects.h"

View File

@ -167,6 +167,7 @@ ReturnValue_t PdecHandler::irqOperation() {
return result;
}
state = State::RUNNING;
checkLocks();
break;
case State::RUNNING: {
checkAndHandleIrqs(fd, info);

View File

@ -24,7 +24,7 @@ enum class CcsdsSubmode : uint8_t {
DATARATE_HIGH = 2,
DATARATE_DEFAULT = 3
};
enum class ParameterId : uint8_t { DATARATE = 0 };
enum class ParameterId : uint8_t { DATARATE = 0, TRANSMITTER_TIMEOUT = 1 };
} // namespace com

View File

@ -111,8 +111,7 @@ void Guidance::targetQuatPtgSingleAxis(timeval now, double posSatE[3], double ve
if (sightAngleSun < critSightAngle) {
strBlindAvoidFlag = true;
}
}
else {
} else {
if (sightAngleSun < blindEnd * exclAngle) {
double normBlindRefRate = acsParameters.targetModeControllerParameters.blindRotRate;
double blindRefRate[3] = {0, 0, 0};

View File

@ -1098,7 +1098,7 @@ void MultiplicativeKalmanFilter::reset(acsctrl::MekfData *mekfData) {
}
void MultiplicativeKalmanFilter::updateDataSetWithoutData(acsctrl::MekfData *mekfData,
MekfStatus mekfStatus) {
MekfStatus mekfStatus) {
{
PoolReadGuard pg(mekfData);
if (pg.getReadResult() == returnvalue::OK) {
@ -1114,9 +1114,8 @@ void MultiplicativeKalmanFilter::updateDataSetWithoutData(acsctrl::MekfData *mek
}
}
void MultiplicativeKalmanFilter::updateDataSet(acsctrl::MekfData *mekfData,
MekfStatus mekfStatus, double quat[4],
double satRotRate[3]) {
void MultiplicativeKalmanFilter::updateDataSet(acsctrl::MekfData *mekfData, MekfStatus mekfStatus,
double quat[4], double satRotRate[3]) {
{
PoolReadGuard pg(mekfData);
if (pg.getReadResult() == returnvalue::OK) {

View File

@ -1 +1,2 @@
target_sources(${LIB_EIVE_MISSION} PRIVATE GenericFactory.cpp scheduling.cpp)
target_sources(${LIB_EIVE_MISSION} PRIVATE GenericFactory.cpp scheduling.cpp
pollingSeqTables.cpp)

View File

@ -1,4 +1,4 @@
#include "pollingSequenceFactory.h"
#include "pollingSeqTables.h"
#include <fsfw/devicehandlers/DeviceHandlerIF.h>
#include <fsfw/objectmanager/ObjectManagerIF.h>
@ -659,7 +659,7 @@ ReturnValue_t pst::pstTcsAndAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg
DeviceHandlerIF::GET_READ);
}
thisSequence->addSlot(objects::SPI_RTD_COM_IF, length * 0.5, 0);
thisSequence->addSlot(objects::SPI_RTD_COM_IF, length * config::acs::SCHED_BLOCK_RTD_PERIOD, 0);
return returnvalue::OK;
}

View File

@ -256,7 +256,7 @@ ReturnValue_t ImtqHandler::scanForReply(const uint8_t* start, size_t remainingSi
ReturnValue_t ImtqHandler::interpretDeviceReply(DeviceCommandId_t id, const uint8_t* packet) {
ReturnValue_t result;
ReturnValue_t status = returnvalue::OK;
if(getMode() != MODE_NORMAL) {
if (getMode() != MODE_NORMAL) {
// Ignore replies during transitions.
return returnvalue::OK;
}

View File

@ -1,13 +1,36 @@
#include "ComSubsystem.h"
#include <fsfw/events/EventManagerIF.h>
#include <fsfw/ipc/MutexGuard.h>
#include <fsfw/ipc/QueueFactory.h>
#include <fsfw/serviceinterface/ServiceInterface.h>
#include <linux/ipcore/PdecHandler.h>
#include <mission/comDefs.h>
#include <mission/config/comCfg.h>
#include "mission/config/comCfg.h"
#include <utility>
ComSubsystem::ComSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequences,
uint32_t maxNumberOfTables)
uint32_t maxNumberOfTables, uint32_t transmitterTimeout)
: Subsystem(setObjectId, maxNumberOfSequences, maxNumberOfTables), paramHelper(this) {
com::setCurrentDatarate(com::Datarate::LOW_RATE_MODULATION_BPSK);
auto mqArgs = MqArgs(setObjectId, static_cast<void *>(this));
eventQueue =
QueueFactory::instance()->createMessageQueue(10, EventMessage::EVENT_MESSAGE_SIZE, &mqArgs);
transmitterCountdown.setTimeout(transmitterTimeout);
}
void ComSubsystem::performChildOperation() {
readEventQueue();
// Execute default rate sequence after transition has been completed
if (rememberBitLock and not isInTransition) {
startRxAndTxLowRateSeq();
rememberBitLock = false;
}
if (countdownActive) {
checkTransmitterCountdown();
}
Subsystem::performChildOperation();
}
MessageQueueId_t ComSubsystem::getCommandQueue() const { return Subsystem::getCommandQueue(); }
@ -27,6 +50,17 @@ ReturnValue_t ComSubsystem::getParameter(uint8_t domainId, uint8_t uniqueIdentif
parameterWrapper->set(datarateCfg);
com::setCurrentDatarate(static_cast<com::Datarate>(newVal));
return returnvalue::OK;
} else if ((domainId == 0) and
(uniqueIdentifier == static_cast<uint8_t>(com::ParameterId::TRANSMITTER_TIMEOUT))) {
uint32_t newVal = 0;
ReturnValue_t result = newValues->getElement(&newVal);
if (result != returnvalue::OK) {
return result;
}
parameterWrapper->set(transmitterTimeout);
transmitterTimeout = newVal;
transmitterCountdown.setTimeout(transmitterTimeout);
return returnvalue::OK;
}
return returnvalue::OK;
}
@ -44,5 +78,121 @@ ReturnValue_t ComSubsystem::initialize() {
if (result != returnvalue::OK) {
return result;
}
EventManagerIF *manager = ObjectManager::instance()->get<EventManagerIF>(objects::EVENT_MANAGER);
if (manager == nullptr) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "ComSubsystem::initialize: Invalid event manager" << std::endl;
#endif
return ObjectManagerIF::CHILD_INIT_FAILED;
}
result = manager->registerListener(eventQueue->getId());
if (result != returnvalue::OK) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "ComSubsystem::initialize: Failed to register Com Subsystem as event "
"listener"
<< std::endl;
#endif
return ObjectManagerIF::CHILD_INIT_FAILED;
}
result = manager->subscribeToEventRange(eventQueue->getId(),
event::getEventId(PdecHandler::CARRIER_LOCK),
event::getEventId(PdecHandler::BIT_LOCK_PDEC));
if (result != returnvalue::OK) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "ComSubsystem::initialize: Failed to subscribe to events from PDEC "
"handler"
<< std::endl;
#endif
return result;
}
return Subsystem::initialize();
}
void ComSubsystem::startTransition(Mode_t mode, Submode_t submode) {
// Depending on the submode the transmitter timeout is enabled or
// disabled here
if (mode == com::Submode::RX_ONLY) {
transmitterCountdown.timeOut();
countdownActive = false;
} else if (isTxMode(mode)) {
// Only start transmitter countdown if transmitter is not already on
if (not isTxMode(this->mode)) {
transmitterCountdown.resetTimer();
countdownActive = true;
}
}
Subsystem::startTransition(mode, submode);
}
void ComSubsystem::readEventQueue() {
EventMessage event;
for (ReturnValue_t result = eventQueue->receiveMessage(&event); result == returnvalue::OK;
result = eventQueue->receiveMessage(&event)) {
switch (event.getMessageId()) {
case EventMessage::EVENT_MESSAGE:
handleEventMessage(&event);
break;
default:
sif::debug << "CcsdsHandler::checkEvents: Did not subscribe to this event message"
<< std::endl;
break;
}
}
}
void ComSubsystem::handleEventMessage(EventMessage *eventMessage) {
Event event = eventMessage->getEvent();
switch (event) {
case PdecHandler::BIT_LOCK_PDEC: {
handleBitLockEvent();
break;
}
case PdecHandler::CARRIER_LOCK: {
handleCarrierLockEvent();
break;
}
default:
sif::debug << "ComSubsystem::handleEvent: Did not subscribe to this event" << std::endl;
break;
}
}
void ComSubsystem::handleBitLockEvent() {
if (isTxMode(mode)) {
// Tx already on
return;
}
if (isInTransition) {
rememberBitLock = true;
return;
}
startRxAndTxLowRateSeq();
}
void ComSubsystem::handleCarrierLockEvent() {
if (!enableTxWhenCarrierLock) {
return;
}
startRxAndTxLowRateSeq();
}
void ComSubsystem::startRxAndTxLowRateSeq() {
// Turns transmitter on
startTransition(com::Submode::RX_AND_TX_LOW_DATARATE, SUBMODE_NONE);
}
void ComSubsystem::checkTransmitterCountdown() {
if (transmitterCountdown.hasTimedOut()) {
startTransition(com::Submode::RX_ONLY, SUBMODE_NONE);
countdownActive = false;
}
}
bool ComSubsystem::isTxMode(Mode_t mode) {
if ((mode == com::Submode::RX_AND_TX_DEFAULT_DATARATE) ||
(mode == com::Submode::RX_AND_TX_LOW_DATARATE) ||
(mode == com::Submode::RX_AND_TX_HIGH_DATARATE)) {
return true;
}
return false;
}

View File

@ -1,6 +1,7 @@
#ifndef MISSION_SYSTEM_COMSUBSYSTEM_H_
#define MISSION_SYSTEM_COMSUBSYSTEM_H_
#include <fsfw/events/EventMessage.h>
#include <fsfw/parameters/HasParametersIF.h>
#include <fsfw/parameters/ParameterHelper.h>
#include <fsfw/subsystem/Subsystem.h>
@ -9,21 +10,71 @@
class ComSubsystem : public Subsystem, public ReceivesParameterMessagesIF {
public:
ComSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables);
/**
* @brief Constructor
*
* @param setObjectId
* @param maxNumberOfSequences
* @param maxNumberOfTables
* @param transmitterTimeout Maximum time the transmitter of the syrlinks
* will be
* enabled
*/
ComSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables,
uint32_t transmitterTimeout);
virtual ~ComSubsystem() = default;
MessageQueueId_t getCommandQueue() const override;
ReturnValue_t getParameter(uint8_t domainId, uint8_t uniqueIdentifier,
ParameterWrapper *parameterWrapper, const ParameterWrapper *newValues,
uint16_t startAtIndex) override;
virtual void performChildOperation() override;
private:
static const Mode_t INITIAL_MODE = 0;
ReturnValue_t handleCommandMessage(CommandMessage *message) override;
ReturnValue_t initialize() override;
void startTransition(Mode_t mode, Submode_t submode) override;
void readEventQueue();
void handleEventMessage(EventMessage *eventMessage);
void handleBitLockEvent();
void handleCarrierLockEvent();
void checkTransmitterCountdown();
/**
* @brief Enables transmitter in low rate mode
*/
void startRxAndTxLowRateSeq();
/**
* @brief Returns true if mode is a mode where the transmitter is on
*/
bool isTxMode(Mode_t mode);
uint8_t datarateCfg = static_cast<uint8_t>(com::Datarate::LOW_RATE_MODULATION_BPSK);
// Maximum time after which the transmitter will be turned of. This is a
// protection mechanism due prevent the syrlinks from overheating
uint32_t transmitterTimeout = 0;
ParameterHelper paramHelper;
MessageQueueIF *eventQueue = nullptr;
bool enableTxWhenCarrierLock = false;
// Countdown will be started as soon as the transmitter was enabled
Countdown transmitterCountdown;
// Transmitter countdown only active when sysrlinks transmitter is on (modes:
// rx and tx low rate, rx and tx high rate, rx and tx default rate)
bool countdownActive = false;
// True when bit lock occurred while COM subsystem is in a transition. This
// variable is used to remember the bit lock and execute the default rate
// sequence after the active transition has been completed
bool rememberBitLock = false;
};
#endif /* MISSION_SYSTEM_COMSUBSYSTEM_H_ */

View File

@ -1,6 +1,5 @@
#include "comModeTree.h"
#include <fsfw/devicehandlers/DeviceHandlerIF.h>
#include <fsfw/modes/HasModesIF.h>
#include <fsfw/returnvalues/returnvalue.h>
#include <fsfw/subsystem/Subsystem.h>
@ -11,7 +10,8 @@
const auto check = subsystem::checkInsert;
ComSubsystem satsystem::com::SUBSYSTEM = ComSubsystem(objects::COM_SUBSYSTEM, 12, 24);
ComSubsystem satsystem::com::SUBSYSTEM =
ComSubsystem(objects::COM_SUBSYSTEM, 12, 24, TRANSMITTER_TIMEOUT);
static const auto OFF = HasModesIF::MODE_OFF;
static const auto ON = HasModesIF::MODE_ON;
@ -19,39 +19,48 @@ static const auto NML = DeviceHandlerIF::MODE_NORMAL;
auto COM_SEQUENCE_RX_ONLY =
std::make_pair(::com::Submode::RX_ONLY, FixedArrayList<ModeListEntry, 3>());
auto COM_TABLE_RX_ONLY_TGT =
std::make_pair((::com::Submode::RX_ONLY << 24) | 1, FixedArrayList<ModeListEntry, 3>());
auto COM_TABLE_RX_ONLY_TRANS_0 =
std::make_pair((::com::Submode::RX_ONLY << 24) | 2, FixedArrayList<ModeListEntry, 3>());
auto COM_TABLE_RX_ONLY_TRANS_1 =
std::make_pair((::com::Submode::RX_ONLY << 24) | 3, FixedArrayList<ModeListEntry, 3>());
auto COM_TABLE_RX_ONLY_TGT = std::make_pair(
static_cast<uint32_t>(::com::Submode::RX_ONLY << 24) | 1, FixedArrayList<ModeListEntry, 3>());
auto COM_TABLE_RX_ONLY_TRANS_0 = std::make_pair(
static_cast<uint32_t>(::com::Submode::RX_ONLY << 24) | 2, FixedArrayList<ModeListEntry, 3>());
auto COM_TABLE_RX_ONLY_TRANS_1 = std::make_pair(
static_cast<uint32_t>(::com::Submode::RX_ONLY << 24) | 3, FixedArrayList<ModeListEntry, 3>());
auto COM_SEQUENCE_RX_AND_TX_LOW_RATE =
std::make_pair(::com::Submode::RX_AND_TX_LOW_DATARATE, FixedArrayList<ModeListEntry, 3>());
auto COM_TABLE_RX_AND_TX_LOW_RATE_TGT = std::make_pair(
(::com::Submode::RX_AND_TX_LOW_DATARATE << 24) | 1, FixedArrayList<ModeListEntry, 3>());
auto COM_TABLE_RX_AND_TX_LOW_RATE_TRANS_0 = std::make_pair(
(::com::Submode::RX_AND_TX_LOW_DATARATE << 24) | 2, FixedArrayList<ModeListEntry, 3>());
auto COM_TABLE_RX_AND_TX_LOW_RATE_TRANS_1 = std::make_pair(
(::com::Submode::RX_AND_TX_LOW_DATARATE << 24) | 3, FixedArrayList<ModeListEntry, 3>());
auto COM_TABLE_RX_AND_TX_LOW_RATE_TGT =
std::make_pair(static_cast<uint32_t>(::com::Submode::RX_AND_TX_LOW_DATARATE << 24) | 1,
FixedArrayList<ModeListEntry, 3>());
auto COM_TABLE_RX_AND_TX_LOW_RATE_TRANS_0 =
std::make_pair(static_cast<uint32_t>(::com::Submode::RX_AND_TX_LOW_DATARATE << 24) | 2,
FixedArrayList<ModeListEntry, 3>());
auto COM_TABLE_RX_AND_TX_LOW_RATE_TRANS_1 =
std::make_pair(static_cast<uint32_t>(::com::Submode::RX_AND_TX_LOW_DATARATE << 24) | 3,
FixedArrayList<ModeListEntry, 3>());
auto COM_SEQUENCE_RX_AND_TX_HIGH_RATE =
std::make_pair(::com::Submode::RX_AND_TX_HIGH_DATARATE, FixedArrayList<ModeListEntry, 3>());
auto COM_TABLE_RX_AND_TX_HIGH_RATE_TGT = std::make_pair(
(::com::Submode::RX_AND_TX_HIGH_DATARATE << 24) | 1, FixedArrayList<ModeListEntry, 3>());
auto COM_TABLE_RX_AND_TX_HIGH_RATE_TRANS_0 = std::make_pair(
(::com::Submode::RX_AND_TX_HIGH_DATARATE << 24) | 2, FixedArrayList<ModeListEntry, 3>());
auto COM_TABLE_RX_AND_TX_HIGH_RATE_TRANS_1 = std::make_pair(
(::com::Submode::RX_AND_TX_HIGH_DATARATE << 24) | 3, FixedArrayList<ModeListEntry, 3>());
auto COM_TABLE_RX_AND_TX_HIGH_RATE_TGT =
std::make_pair(static_cast<uint32_t>(::com::Submode::RX_AND_TX_HIGH_DATARATE << 24) | 1,
FixedArrayList<ModeListEntry, 3>());
auto COM_TABLE_RX_AND_TX_HIGH_RATE_TRANS_0 =
std::make_pair(static_cast<uint32_t>(::com::Submode::RX_AND_TX_HIGH_DATARATE << 24) | 2,
FixedArrayList<ModeListEntry, 3>());
auto COM_TABLE_RX_AND_TX_HIGH_RATE_TRANS_1 =
std::make_pair(static_cast<uint32_t>(::com::Submode::RX_AND_TX_HIGH_DATARATE << 24) | 3,
FixedArrayList<ModeListEntry, 3>());
auto COM_SEQUENCE_RX_AND_TX_DEFAULT_RATE =
std::make_pair(::com::Submode::RX_AND_TX_DEFAULT_DATARATE, FixedArrayList<ModeListEntry, 3>());
auto COM_TABLE_RX_AND_TX_DEFAULT_RATE_TGT = std::make_pair(
(::com::Submode::RX_AND_TX_DEFAULT_DATARATE << 24) | 1, FixedArrayList<ModeListEntry, 3>());
auto COM_TABLE_RX_AND_TX_DEFAULT_RATE_TRANS_0 = std::make_pair(
(::com::Submode::RX_AND_TX_DEFAULT_DATARATE << 24) | 2, FixedArrayList<ModeListEntry, 3>());
auto COM_TABLE_RX_AND_TX_DEFAULT_RATE_TRANS_1 = std::make_pair(
(::com::Submode::RX_AND_TX_DEFAULT_DATARATE << 24) | 3, FixedArrayList<ModeListEntry, 3>());
auto COM_TABLE_RX_AND_TX_DEFAULT_RATE_TGT =
std::make_pair(static_cast<uint32_t>(::com::Submode::RX_AND_TX_DEFAULT_DATARATE << 24) | 1,
FixedArrayList<ModeListEntry, 3>());
auto COM_TABLE_RX_AND_TX_DEFAULT_RATE_TRANS_0 =
std::make_pair(static_cast<uint32_t>(::com::Submode::RX_AND_TX_DEFAULT_DATARATE << 24) | 2,
FixedArrayList<ModeListEntry, 3>());
auto COM_TABLE_RX_AND_TX_DEFAULT_RATE_TRANS_1 =
std::make_pair(static_cast<uint32_t>(::com::Submode::RX_AND_TX_DEFAULT_DATARATE << 24) | 3,
FixedArrayList<ModeListEntry, 3>());
namespace {
@ -68,7 +77,7 @@ Subsystem& satsystem::com::init() {
buildTxAndRxLowRateSequence(SUBSYSTEM, entry);
buildTxAndRxHighRateSequence(SUBSYSTEM, entry);
buildTxAndRxDefaultRateSequence(SUBSYSTEM, entry);
SUBSYSTEM.setInitialMode(NML, ::com::Submode::RX_ONLY);
SUBSYSTEM.setInitialMode(COM_SEQUENCE_RX_ONLY.first);
return SUBSYSTEM;
}
@ -95,7 +104,7 @@ void buildRxOnlySequence(Subsystem& ss, ModeListEntry& eh) {
// Build RX Only table. We could track the state of the CCSDS IP core handler
// as well but I do not think this is necessary because enabling that should
// not intefere with the Syrlinks Handler.
// not interfere with the Syrlinks Handler.
iht(objects::SYRLINKS_HANDLER, NML, ::com::Submode::RX_ONLY, COM_TABLE_RX_ONLY_TGT.second);
check(ss.addTable(TableEntry(COM_TABLE_RX_ONLY_TGT.first, &COM_TABLE_RX_ONLY_TGT.second)), ctxc);

View File

@ -1,6 +1,7 @@
#ifndef MISSION_SYSTEM_TREE_COMMODETREE_H_
#define MISSION_SYSTEM_TREE_COMMODETREE_H_
#include <fsfw/devicehandlers/DeviceHandlerIF.h>
#include <mission/system/objects/ComSubsystem.h>
namespace satsystem {
@ -8,6 +9,11 @@ namespace satsystem {
namespace com {
extern ComSubsystem SUBSYSTEM;
// The syrlinks must not transmitting longer then 15 minutes otherwise the
// transceiver might be damaged due to overheating
// 15 minutes in milliseconds
static const uint32_t TRANSMITTER_TIMEOUT = 900000;
Subsystem& init();
} // namespace com

View File

@ -7,6 +7,7 @@
#include "acsModeTree.h"
#include "comModeTree.h"
#include "eive/objects.h"
#include "mission/comDefs.h"
#include "payloadModeTree.h"
#include "tcsModeTree.h"
#include "util.h"
@ -85,6 +86,7 @@ void buildSafeSequence(Subsystem& ss, ModeListEntry& eh) {
// Build SAFE transition 0. Two transitions to reduce number of consecutive events and because
// consecutive commanding of TCS and ACS can lead to SPI issues.
iht(objects::TCS_SUBSYSTEM, NML, 0, EIVE_TABLE_SAFE_TRANS_0.second);
iht(objects::COM_SUBSYSTEM, com::RX_ONLY, 0, EIVE_TABLE_SAFE_TRANS_0.second);
check(ss.addTable(TableEntry(EIVE_TABLE_SAFE_TRANS_0.first, &EIVE_TABLE_SAFE_TRANS_0.second)),
ctxc);

View File

@ -1,12 +1,10 @@
#include "CcsdsIpCoreHandler.h"
#include <fsfw/subsystem/helper.h>
#include <linux/ipcore/PdecHandler.h>
#include <linux/ipcore/PtmeConfig.h>
#include <mission/config/comCfg.h>
#include "eive/definitions.h"
#include "fsfw/events/EventManagerIF.h"
#include "fsfw/ipc/QueueFactory.h"
#include "fsfw/objectmanager/ObjectManager.h"
#include "fsfw/serialize/SerializeAdapter.h"
@ -16,8 +14,7 @@
CcsdsIpCoreHandler::CcsdsIpCoreHandler(object_id_t objectId, object_id_t ptmeId,
object_id_t tcDestination, PtmeConfig* ptmeConfig,
GpioIF* gpioIF, gpioId_t enTxClock, gpioId_t enTxData,
uint32_t transmitterTimeout)
GpioIF* gpioIF, gpioId_t enTxClock, gpioId_t enTxData)
: SystemObject(objectId),
ptmeId(ptmeId),
tcDestination(tcDestination),
@ -27,8 +24,7 @@ CcsdsIpCoreHandler::CcsdsIpCoreHandler(object_id_t objectId, object_id_t ptmeId,
ptmeConfig(ptmeConfig),
gpioIF(gpioIF),
enTxClock(enTxClock),
enTxData(enTxData),
transmitterTimeout(transmitterTimeout) {
enTxData(enTxData) {
commandQueue = QueueFactory::instance()->createMessageQueue(QUEUE_SIZE);
auto mqArgs = MqArgs(objectId, static_cast<void*>(this));
eventQueue =
@ -38,11 +34,9 @@ CcsdsIpCoreHandler::CcsdsIpCoreHandler(object_id_t objectId, object_id_t ptmeId,
CcsdsIpCoreHandler::~CcsdsIpCoreHandler() {}
ReturnValue_t CcsdsIpCoreHandler::performOperation(uint8_t operationCode) {
checkEvents();
readCommandQueue();
handleTelemetry();
handleTelecommands();
checkTxTimer();
return returnvalue::OK;
}
@ -98,46 +92,11 @@ ReturnValue_t CcsdsIpCoreHandler::initialize() {
iter->second->setPtmeObject(ptme);
}
EventManagerIF* manager = ObjectManager::instance()->get<EventManagerIF>(objects::EVENT_MANAGER);
if (manager == nullptr) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "CcsdsHandler::initialize: Invalid event manager" << std::endl;
#endif
return ObjectManagerIF::CHILD_INIT_FAILED;
}
result = manager->registerListener(eventQueue->getId());
if (result != returnvalue::OK) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "CcsdsHandler::initialize: Failed to register CCSDS handler as event "
"listener"
<< std::endl;
#endif
return ObjectManagerIF::CHILD_INIT_FAILED;
;
}
result = manager->subscribeToEventRange(eventQueue->getId(),
event::getEventId(PdecHandler::CARRIER_LOCK),
event::getEventId(PdecHandler::BIT_LOCK_PDEC));
if (result != returnvalue::OK) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "CcsdsHandler::initialize: Failed to subscribe to events from PDEC "
"handler"
<< std::endl;
#endif
return result;
}
result = ptmeConfig->initialize();
if (result != returnvalue::OK) {
return ObjectManagerIF::CHILD_INIT_FAILED;
}
if (result != returnvalue::OK) {
return ObjectManagerIF::CHILD_INIT_FAILED;
}
transmitterCountdown.setTimeout(transmitterTimeout);
transmitterCountdown.timeOut();
#if OBSW_SYRLINKS_SIMULATED == 1
// Update data on rising edge
ptmeConfig->invertTxClock(false);
@ -286,54 +245,6 @@ ReturnValue_t CcsdsIpCoreHandler::executeAction(ActionId_t actionId, MessageQueu
return EXECUTION_FINISHED;
}
void CcsdsIpCoreHandler::checkEvents() {
EventMessage event;
for (ReturnValue_t result = eventQueue->receiveMessage(&event); result == returnvalue::OK;
result = eventQueue->receiveMessage(&event)) {
switch (event.getMessageId()) {
case EventMessage::EVENT_MESSAGE:
handleEvent(&event);
break;
default:
sif::debug << "CcsdsHandler::checkEvents: Did not subscribe to this event message"
<< std::endl;
break;
}
}
}
void CcsdsIpCoreHandler::handleEvent(EventMessage* eventMessage) {
Event event = eventMessage->getEvent();
switch (event) {
case PdecHandler::BIT_LOCK_PDEC: {
handleBitLockEvent();
break;
}
case PdecHandler::CARRIER_LOCK: {
handleCarrierLockEvent();
break;
}
default:
sif::debug << "CcsdsHandler::handleEvent: Did not subscribe to this event" << std::endl;
break;
}
}
void CcsdsIpCoreHandler::handleBitLockEvent() {
if (transmitterCountdown.isBusy()) {
// Transmitter already enabled
return;
}
enableTransmit();
}
void CcsdsIpCoreHandler::handleCarrierLockEvent() {
if (!enableTxWhenCarrierLock) {
return;
}
enableTransmit();
}
void CcsdsIpCoreHandler::forwardLinkstate() {
VirtualChannelMapIter iter;
for (iter = virtualChannelMap.begin(); iter != virtualChannelMap.end(); iter++) {
@ -342,27 +253,12 @@ void CcsdsIpCoreHandler::forwardLinkstate() {
}
void CcsdsIpCoreHandler::enableTransmit() {
if (transmitterCountdown.isBusy()) {
// Transmitter already enabled
return;
}
#ifndef TE0720_1CFA
gpioIF->pullHigh(enTxClock);
gpioIF->pullHigh(enTxData);
#endif
linkState = UP;
forwardLinkstate();
transmitterCountdown.resetTimer();
}
void CcsdsIpCoreHandler::checkTxTimer() {
if (linkState == DOWN) {
return;
}
if (transmitterCountdown.hasTimedOut()) {
disableTransmit();
// TODO: set mode to off (move timer to subsystem)
}
}
void CcsdsIpCoreHandler::getMode(Mode_t* mode, Submode_t* submode) {
@ -431,7 +327,6 @@ void CcsdsIpCoreHandler::disableTransmit() {
#endif
linkState = DOWN;
forwardLinkstate();
transmitterCountdown.timeOut();
}
const char* CcsdsIpCoreHandler::getName() const { return "CCSDS Handler"; }

View File

@ -59,8 +59,7 @@ class CcsdsIpCoreHandler : public SystemObject,
* @param enTxData GPIO ID of RS485 tx data enable
*/
CcsdsIpCoreHandler(object_id_t objectId, object_id_t ptmeId, object_id_t tcDestination,
PtmeConfig* ptmeConfig, GpioIF* gpioIF, gpioId_t enTxClock, gpioId_t enTxData,
uint32_t transmitterTimeout = 900000);
PtmeConfig* ptmeConfig, GpioIF* gpioIF, gpioId_t enTxClock, gpioId_t enTxData);
~CcsdsIpCoreHandler();
@ -154,29 +153,16 @@ class CcsdsIpCoreHandler : public SystemObject,
PtmeConfig* ptmeConfig = nullptr;
GpioIF* gpioIF = nullptr;
// GPIO to enable RS485 transceiver for TX clock
gpioId_t enTxClock = gpio::NO_GPIO;
// GPIO to enable RS485 transceiver for TX data signal
gpioId_t enTxData = gpio::NO_GPIO;
// Syrlinks must not be transmitting more than 15 minutes (according to datasheet)
// Value initialized by constructor argument
const uint32_t transmitterTimeout = 0;
// Countdown to disable transmitter after 15 minutes
Countdown transmitterCountdown;
// When true transmitting is started as soon as carrier lock has been detected
bool enableTxWhenCarrierLock = false;
bool linkState = DOWN;
void readCommandQueue(void);
void handleTelemetry();
void handleTelecommands();
void checkEvents();
void handleEvent(EventMessage* eventMessage);
void handleBitLockEvent();
void handleCarrierLockEvent();
/**
* @brief Forward link state to virtual channels.
@ -188,12 +174,6 @@ class CcsdsIpCoreHandler : public SystemObject,
*/
void enableTransmit();
/**
* @brief Checks Tx timer for timeout and disables RS485 tx clock and tx data in case
* timer has expired.
*/
void checkTxTimer();
/**
* @brief Disables the transmitter by pulling the enable tx clock and tx data pin of the
* RS485 transceiver chips to high.

View File

@ -21,7 +21,7 @@ ReturnValue_t CfdpTmFunnel::performOperation(uint8_t) {
break;
}
count++;
if(count == 500) {
if (count == 500) {
sif::error << "CfdpTmFunnel: Possible message storm detected" << std::endl;
break;
}

View File

@ -21,7 +21,7 @@ ReturnValue_t PusTmFunnel::performOperation(uint8_t) {
break;
}
count++;
if(count == 500) {
if (count == 500) {
sif::error << "PusTmFunnel: Possible message storm detected" << std::endl;
break;
}

View File

@ -50,7 +50,7 @@ ReturnValue_t VirtualChannel::performOperation() {
}
count++;
if(count == 500) {
if (count == 500) {
sif::error << "VirtualChannel: Possible message storm detected" << std::endl;
break;
}

2
tmtc

@ -1 +1 @@
Subproject commit be032ab925cab58bc443dd877b8260d291894802
Subproject commit a04bd8aa738ca14cb3d5badffd00e91047730d5e