Compare commits

...

23 Commits

Author SHA1 Message Date
5af43ca29b Merge pull request 'prep v8.0.0' (#895) from prep_v8.0.0 into main
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
Reviewed-on: #895
2024-05-13 14:19:59 +02:00
822df9658f prep v8.0.0
Some checks are pending
EIVE/eive-obsw/pipeline/head Build queued...
EIVE/eive-obsw/pipeline/pr-main Build started...
2024-05-13 14:08:35 +02:00
765e3d6b5b Merge pull request 'MPSoC Fixes' (#894) from mpsoc-fixes into main
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
Reviewed-on: #894
Reviewed-by: Marius Eggert <eggertm@irs.uni-stuttgart.de>
2024-05-13 14:03:11 +02:00
0b3c928886 combining those is acutally problematic..
Some checks are pending
EIVE/eive-obsw/pipeline/head Build started...
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-05-08 11:11:21 +02:00
73279a0bf3 minor fix for periodic HK generation
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
2024-05-08 10:54:24 +02:00
4559d24c62 changelog
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
2024-05-08 10:04:34 +02:00
b54f8e7738 some fixes for MPSoC 2024-05-08 10:03:32 +02:00
6bb12f28a1 Merge pull request 'MPSoC Overhaul' (#892) from mpsoc-overhaul into main
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
Reviewed-on: #892
Reviewed-by: Marius Eggert <eggertm@irs.uni-stuttgart.de>
2024-05-06 14:20:46 +02:00
7e8d995b52 changelog and tmtc 2024-05-06 14:20:13 +02:00
215f2189a6 better name for split file command
Some checks are pending
EIVE/eive-obsw/pipeline/pr-main Build queued...
2024-05-06 14:17:25 +02:00
8103b2fa0d events
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-05-06 13:48:32 +02:00
b579cd86c1 make marius extremely happy
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-05-06 13:30:28 +02:00
4fdec7a74c impl proper NORMAL mode for MPSoC
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-05-06 13:19:15 +02:00
744a94704c removed TODOs which are done
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-05-02 15:42:14 +02:00
f7f14ff021 Merge branch 'main' into mpsoc-overhaul
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-04-30 15:57:34 +02:00
fe729f1df0 Merge pull request 'Fix Target Rotation Rate' (#893) from tgt-rot-rate-fix into main
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
Reviewed-on: #893
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2024-04-30 15:52:05 +02:00
7734d1066a Merge branch 'main' into tgt-rot-rate-fix 2024-04-30 15:51:39 +02:00
4a0acbf158 further reduce printout
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-04-30 15:37:53 +02:00
65476f4c98 reduce printouts
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-04-30 15:18:15 +02:00
a6ce06e3f5 Merge branch 'main' into tgt-rot-rate-fix
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-04-29 11:47:07 +02:00
75070b5e66 i am smart
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-04-29 10:42:52 +02:00
26341743a8 changelog
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-04-29 10:26:12 +02:00
7c10f4b1cd fix calculation of target rotation 2024-04-29 10:24:53 +02:00
17 changed files with 128 additions and 63 deletions

View File

@ -16,9 +16,18 @@ will consitute of a breaking change warranting a new major release:
# [unreleased]
# [v8.0.0] 2024-05-13
- `eive-tmtc` v7.0.0
## Fixed
- Fixed calculation for target rotation rate during pointing modes.
- Possible fix for MPSoC file read algorithm.
## Changed
- Reworked MPSoC handler to be compatible to new MPSoC software image and use
- Reworked MPSoC handler to be compatible to new MPSoC software image and use
new device handler base class. This should increase the reliability of the communication
significantly.
- MPSoC device modes IDLE, SNAPSHOT and REPLAY are now modelled using submodes.
@ -32,6 +41,8 @@ will consitute of a breaking change warranting a new major release:
# [v7.8.1] 2024-04-11
## Fixed
- Reverted fix for wrong order in quaternion multiplication for computation of the error quaternion.
# [v7.8.0] 2024-04-10
@ -42,7 +53,7 @@ will consitute of a breaking change warranting a new major release:
- All pointing laws are now allowed to use the `MEKF` per default.
- Changed limits in `PWR Controller`.
- PUS time service: Now dumps the time before and after relative timeshift or setting absolute time
- The `GPS Controller` does not set itself to `OFF` anymore, if it has not detected a valid fix for
- The `GPS Controller` does not set itself to `OFF` anymore, if it has not detected a valid fix for
some time. Instead it attempts to reset both GNSS devices once.
- The maximum time to reach a fix is shortened from 30min to 15min.
- The time the reset pin of the GNSS devices is pulled is prolonged from 5ms to 10s.
@ -51,7 +62,7 @@ will consitute of a breaking change warranting a new major release:
of the controller is changed. As arguments it now displays the new fix and the numer of fix changes
missed.
- The number of satellites seen and used is reset to 0, in case they are set to invalid.
- Altitude, latitude and longitude messages are not checked anymore, in case the mode message was
- Altitude, latitude and longitude messages are not checked anymore, in case the mode message was
already invalid.
## Added
@ -265,7 +276,7 @@ will consitute of a breaking change warranting a new major release:
- `ACS Controller` now has the function `performAttitudeControl` which is called prior to passing
on to the relevant mode functions. It handles all telemetry relevant functions, which were
always called, regardless of the mode.
## Added
- Higher ACS modes can now be entered without a running `MEKF`. Higher modes will collect their

View File

@ -1,7 +1,7 @@
/**
* @brief Auto-generated event translation file. Contains 324 translations.
* @brief Auto-generated event translation file. Contains 325 translations.
* @details
* Generated on: 2024-04-17 11:22:10
* Generated on: 2024-05-06 13:47:38
*/
#include "translateEvents.h"
@ -142,6 +142,7 @@ const char *MPSOC_HANDLER_SEQUENCE_COUNT_MISMATCH_STRING = "MPSOC_HANDLER_SEQUEN
const char *MPSOC_SHUTDOWN_FAILED_STRING = "MPSOC_SHUTDOWN_FAILED";
const char *SUPV_NOT_ON_STRING = "SUPV_NOT_ON";
const char *SUPV_REPLY_TIMEOUT_STRING = "SUPV_REPLY_TIMEOUT";
const char *CAM_MUST_BE_ON_FOR_SNAPSHOT_MODE_STRING = "CAM_MUST_BE_ON_FOR_SNAPSHOT_MODE";
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_ADC_FAILURE_STRING = "SELF_TEST_ADC_FAILURE";
@ -606,6 +607,8 @@ const char *translateEvents(Event event) {
return SUPV_NOT_ON_STRING;
case (11608):
return SUPV_REPLY_TIMEOUT_STRING;
case (11609):
return CAM_MUST_BE_ON_FOR_SNAPSHOT_MODE_STRING;
case (11701):
return SELF_TEST_I2C_FAILURE_STRING;
case (11702):

View File

@ -2,7 +2,7 @@
* @brief Auto-generated object translation file.
* @details
* Contains 176 translations.
* Generated on: 2024-04-17 11:22:10
* Generated on: 2024-05-06 13:47:38
*/
#include "translateObjects.h"

View File

@ -65,6 +65,7 @@
#include "linux/payload/PlocMpsocSpecialComHelper.h"
#include "linux/payload/SerialConfig.h"
#include "mission/config/configfile.h"
#include "mission/power/defs.h"
#include "mission/system/acs/AcsBoardFdir.h"
#include "mission/system/acs/AcsSubsystem.h"
#include "mission/system/acs/RwAssembly.h"
@ -635,9 +636,9 @@ void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF, PowerSwit
auto specialComHelper =
new PlocMpsocSpecialComHelper(objects::PLOC_MPSOC_HELPER, *mpsocCommunication);
DhbConfig dhbConf(objects::PLOC_MPSOC_HANDLER);
auto* mpsocHandler = new FreshMpsocHandler(dhbConf, *mpsocCommunication, *specialComHelper,
Gpio(gpioIds::ENABLE_MPSOC_UART, gpioComIF),
objects::PLOC_SUPERVISOR_HANDLER);
auto* mpsocHandler = new FreshMpsocHandler(
dhbConf, *mpsocCommunication, *specialComHelper, Gpio(gpioIds::ENABLE_MPSOC_UART, gpioComIF),
objects::PLOC_SUPERVISOR_HANDLER, pwrSwitcher, power::PDU2_CH8_PAYLOAD_CAMERA);
mpsocHandler->connectModeTreeParent(satsystem::payload::SUBSYSTEM);
#endif /* OBSW_ADD_PLOC_MPSOC == 1 */
#if OBSW_ADD_PLOC_SUPERVISOR == 1

View File

@ -135,7 +135,8 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path
11605;0x2d55;MPSOC_HANDLER_SEQUENCE_COUNT_MISMATCH;LOW;Packet sequence count in received space packet does not match expected count P1: Expected sequence count P2: Received sequence count;linux/payload/plocMpsocHelpers.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/payload/plocMpsocHelpers.h
11607;0x2d57;SUPV_NOT_ON;LOW;SUPV not on for boot or shutdown process. P1: 0 for OFF transition, 1 for ON transition.;linux/payload/plocMpsocHelpers.h
11608;0x2d58;SUPV_REPLY_TIMEOUT;LOW;No description;linux/payload/plocMpsocHelpers.h
11608;0x2d58;SUPV_REPLY_TIMEOUT;LOW;SUPV reply timeout.;linux/payload/plocMpsocHelpers.h
11609;0x2d59;CAM_MUST_BE_ON_FOR_SNAPSHOT_MODE;LOW;Camera must be commanded on first.;linux/payload/plocMpsocHelpers.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/acs/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/acs/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/acs/ImtqHandler.h

1 Event ID (dec) Event ID (hex) Name Severity Description File Path
135 11605 0x2d55 MPSOC_HANDLER_SEQUENCE_COUNT_MISMATCH LOW Packet sequence count in received space packet does not match expected count P1: Expected sequence count P2: Received sequence count linux/payload/plocMpsocHelpers.h
136 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/payload/plocMpsocHelpers.h
137 11607 0x2d57 SUPV_NOT_ON LOW SUPV not on for boot or shutdown process. P1: 0 for OFF transition, 1 for ON transition. linux/payload/plocMpsocHelpers.h
138 11608 0x2d58 SUPV_REPLY_TIMEOUT LOW No description SUPV reply timeout. linux/payload/plocMpsocHelpers.h
139 11609 0x2d59 CAM_MUST_BE_ON_FOR_SNAPSHOT_MODE LOW Camera must be commanded on first. linux/payload/plocMpsocHelpers.h
140 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/acs/ImtqHandler.h
141 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/acs/ImtqHandler.h
142 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/acs/ImtqHandler.h

View File

@ -135,7 +135,8 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path
11605;0x2d55;MPSOC_HANDLER_SEQUENCE_COUNT_MISMATCH;LOW;Packet sequence count in received space packet does not match expected count P1: Expected sequence count P2: Received sequence count;linux/payload/plocMpsocHelpers.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/payload/plocMpsocHelpers.h
11607;0x2d57;SUPV_NOT_ON;LOW;SUPV not on for boot or shutdown process. P1: 0 for OFF transition, 1 for ON transition.;linux/payload/plocMpsocHelpers.h
11608;0x2d58;SUPV_REPLY_TIMEOUT;LOW;No description;linux/payload/plocMpsocHelpers.h
11608;0x2d58;SUPV_REPLY_TIMEOUT;LOW;SUPV reply timeout.;linux/payload/plocMpsocHelpers.h
11609;0x2d59;CAM_MUST_BE_ON_FOR_SNAPSHOT_MODE;LOW;Camera must be commanded on first.;linux/payload/plocMpsocHelpers.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/acs/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/acs/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/acs/ImtqHandler.h

1 Event ID (dec) Event ID (hex) Name Severity Description File Path
135 11605 0x2d55 MPSOC_HANDLER_SEQUENCE_COUNT_MISMATCH LOW Packet sequence count in received space packet does not match expected count P1: Expected sequence count P2: Received sequence count linux/payload/plocMpsocHelpers.h
136 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/payload/plocMpsocHelpers.h
137 11607 0x2d57 SUPV_NOT_ON LOW SUPV not on for boot or shutdown process. P1: 0 for OFF transition, 1 for ON transition. linux/payload/plocMpsocHelpers.h
138 11608 0x2d58 SUPV_REPLY_TIMEOUT LOW No description SUPV reply timeout. linux/payload/plocMpsocHelpers.h
139 11609 0x2d59 CAM_MUST_BE_ON_FOR_SNAPSHOT_MODE LOW Camera must be commanded on first. linux/payload/plocMpsocHelpers.h
140 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/acs/ImtqHandler.h
141 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/acs/ImtqHandler.h
142 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/acs/ImtqHandler.h

View File

@ -1,7 +1,7 @@
/**
* @brief Auto-generated event translation file. Contains 324 translations.
* @brief Auto-generated event translation file. Contains 325 translations.
* @details
* Generated on: 2024-04-17 11:22:10
* Generated on: 2024-05-06 13:47:38
*/
#include "translateEvents.h"
@ -142,6 +142,7 @@ const char *MPSOC_HANDLER_SEQUENCE_COUNT_MISMATCH_STRING = "MPSOC_HANDLER_SEQUEN
const char *MPSOC_SHUTDOWN_FAILED_STRING = "MPSOC_SHUTDOWN_FAILED";
const char *SUPV_NOT_ON_STRING = "SUPV_NOT_ON";
const char *SUPV_REPLY_TIMEOUT_STRING = "SUPV_REPLY_TIMEOUT";
const char *CAM_MUST_BE_ON_FOR_SNAPSHOT_MODE_STRING = "CAM_MUST_BE_ON_FOR_SNAPSHOT_MODE";
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_ADC_FAILURE_STRING = "SELF_TEST_ADC_FAILURE";
@ -606,6 +607,8 @@ const char *translateEvents(Event event) {
return SUPV_NOT_ON_STRING;
case (11608):
return SUPV_REPLY_TIMEOUT_STRING;
case (11609):
return CAM_MUST_BE_ON_FOR_SNAPSHOT_MODE_STRING;
case (11701):
return SELF_TEST_I2C_FAILURE_STRING;
case (11702):

View File

@ -2,7 +2,7 @@
* @brief Auto-generated object translation file.
* @details
* Contains 180 translations.
* Generated on: 2024-04-17 11:22:10
* Generated on: 2024-05-06 13:47:38
*/
#include "translateObjects.h"

View File

@ -1,7 +1,7 @@
/**
* @brief Auto-generated event translation file. Contains 324 translations.
* @brief Auto-generated event translation file. Contains 325 translations.
* @details
* Generated on: 2024-04-17 11:22:10
* Generated on: 2024-05-06 13:47:38
*/
#include "translateEvents.h"
@ -142,6 +142,7 @@ const char *MPSOC_HANDLER_SEQUENCE_COUNT_MISMATCH_STRING = "MPSOC_HANDLER_SEQUEN
const char *MPSOC_SHUTDOWN_FAILED_STRING = "MPSOC_SHUTDOWN_FAILED";
const char *SUPV_NOT_ON_STRING = "SUPV_NOT_ON";
const char *SUPV_REPLY_TIMEOUT_STRING = "SUPV_REPLY_TIMEOUT";
const char *CAM_MUST_BE_ON_FOR_SNAPSHOT_MODE_STRING = "CAM_MUST_BE_ON_FOR_SNAPSHOT_MODE";
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_ADC_FAILURE_STRING = "SELF_TEST_ADC_FAILURE";
@ -606,6 +607,8 @@ const char *translateEvents(Event event) {
return SUPV_NOT_ON_STRING;
case (11608):
return SUPV_REPLY_TIMEOUT_STRING;
case (11609):
return CAM_MUST_BE_ON_FOR_SNAPSHOT_MODE_STRING;
case (11701):
return SELF_TEST_I2C_FAILURE_STRING;
case (11702):

View File

@ -2,7 +2,7 @@
* @brief Auto-generated object translation file.
* @details
* Contains 180 translations.
* Generated on: 2024-04-17 11:22:10
* Generated on: 2024-05-06 13:47:38
*/
#include "translateObjects.h"

View File

@ -8,22 +8,29 @@
#include "fsfw/devicehandlers/FreshDeviceHandlerBase.h"
#include "fsfw/ipc/MessageQueueIF.h"
#include "fsfw/ipc/QueueFactory.h"
#include "fsfw/ipc/messageQueueDefinitions.h"
#include "fsfw/power/PowerSwitchIF.h"
#include "fsfw/power/definitions.h"
#include "fsfw/returnvalues/returnvalue.h"
#include "fsfw/serialize/SerializeAdapter.h"
#include "linux/payload/MpsocCommunication.h"
#include "linux/payload/plocMpsocHelpers.h"
#include "linux/payload/plocSupvDefs.h"
#include "mission/power/gsDefs.h"
FreshMpsocHandler::FreshMpsocHandler(DhbConfig cfg, MpsocCommunication& comInterface,
PlocMpsocSpecialComHelper& specialComHelper,
Gpio uartIsolatorSwitch, object_id_t supervisorHandler)
Gpio uartIsolatorSwitch, object_id_t supervisorHandler,
PowerSwitchIF& powerSwitcher, power::Switch_t camSwitchId)
: FreshDeviceHandlerBase(cfg),
comInterface(comInterface),
specialComHelper(specialComHelper),
commandActionHelper(this),
uartIsolatorSwitch(uartIsolatorSwitch),
hkReport(this),
supervisorHandler(supervisorHandler) {
supervisorHandler(supervisorHandler),
powerSwitcher(powerSwitcher),
camSwitchId(camSwitchId) {
commandActionHelperQueue = QueueFactory::instance()->createMessageQueue(10);
eventQueue = QueueFactory::instance()->createMessageQueue(10);
spParams.maxSize = sizeof(commandBuffer);
@ -77,8 +84,13 @@ void FreshMpsocHandler::performDefaultDeviceOperation() {
}
}
if (mode == MODE_NORMAL and not activeCmdInfo.pending) {
// TODO: Take care of regular periodic commanding here.
// We checked the action queue beforehand, so action commands should always be performed
// before normal commands.
if (mode == MODE_NORMAL and not activeCmdInfo.pending and not specialComHelperExecuting) {
ReturnValue_t result = commandTcGetHkReport();
if (result == returnvalue::OK) {
commandInitHandling(mpsoc::TC_GET_HK_REPORT, MessageQueueIF::NO_QUEUE);
}
}
if (activeCmdInfo.pending and activeCmdInfo.cmdCountdown.hasTimedOut()) {
@ -224,6 +236,11 @@ ReturnValue_t FreshMpsocHandler::checkModeCommand(Mode_t mode, Submode_t submode
return HasModesIF::INVALID_SUBMODE;
}
}
if (submode == mpsoc::Submode::SNAPSHOT and
powerSwitcher.getSwitchState(camSwitchId) != PowerSwitchIF::SWITCH_ON) {
triggerEvent(mpsoc::CAM_MUST_BE_ON_FOR_SNAPSHOT_MODE);
return HasModesIF::TRANS_NOT_ALLOWED;
}
*msToReachTheMode = MPSOC_MODE_CMD_TIMEOUT_MS;
return returnvalue::OK;
}
@ -296,8 +313,6 @@ ReturnValue_t FreshMpsocHandler::executeAction(ActionId_t actionId, MessageQueue
default:
break;
}
// For longer commands, do not set these.
// TODO: Do all the stuff the form buildDeviceFromDevice blah did.
executeRegularCmd(actionId, commandedBy, data, size);
return returnvalue::OK;
}
@ -322,6 +337,10 @@ void FreshMpsocHandler::startTransition(Mode_t newMode, Submode_t submode) {
} else if ((newMode == MODE_ON or newMode == MODE_NORMAL) &&
((mode == MODE_OFF) or (mode == MODE_UNDEFINED))) {
transitionState = TransitionState::TO_ON;
} else if (mode == MODE_ON && newMode == MODE_NORMAL) {
hkReport.setReportingEnabled(true);
} else if (mode == MODE_NORMAL && newMode == MODE_ON) {
hkReport.setReportingEnabled(false);
} else if (newMode == MODE_OFF) {
transitionState = TransitionState::TO_OFF;
}
@ -357,7 +376,9 @@ void FreshMpsocHandler::handleTransitionToOn() {
if (startupState == StartupState::DONE) {
setMode(targetMode, targetSubmode);
transitionState = TransitionState::NONE;
hkReport.setReportingEnabled(true);
if (targetMode == MODE_NORMAL) {
hkReport.setReportingEnabled(true);
}
powerState = PowerState::IDLE;
startupState = StartupState::IDLE;
}
@ -569,8 +590,8 @@ ReturnValue_t FreshMpsocHandler::executeRegularCmd(ActionId_t actionId,
result = commandTcSimplexStreamFile(commandData, commandDataLen);
break;
}
case (mpsoc::TC_SIMPLEX_STORE_FILE): {
result = commandTcSimplexStoreFile(commandData, commandDataLen);
case (mpsoc::TC_SPLIT_FILE): {
result = commandTcSplitFile(commandData, commandDataLen);
break;
}
case (mpsoc::TC_DOWNLINK_DATA_MODULATE): {
@ -585,16 +606,20 @@ ReturnValue_t FreshMpsocHandler::executeRegularCmd(ActionId_t actionId,
}
if (result == returnvalue::OK) {
activeCmdInfo.start(actionId, commandedBy);
/**
* Flushing the receive buffer to make sure there are no data left from a faulty reply.
*/
comInterface.getComHelper().flushUartRxBuffer();
commandInitHandling(actionId, commandedBy);
}
return result;
}
void FreshMpsocHandler::commandInitHandling(ActionId_t actionId, MessageQueueId_t commandedBy) {
activeCmdInfo.start(actionId, commandedBy);
/**
* Flushing the receive buffer to make sure there are no data left from a faulty reply.
*/
comInterface.getComHelper().flushUartRxBuffer();
}
ReturnValue_t FreshMpsocHandler::commandTcMemWrite(const uint8_t* commandData,
size_t commandDataLen) {
ReturnValue_t result = returnvalue::OK;
@ -743,14 +768,14 @@ ReturnValue_t FreshMpsocHandler::commandTcSimplexStreamFile(const uint8_t* comma
return returnvalue::OK;
}
ReturnValue_t FreshMpsocHandler::commandTcSimplexStoreFile(const uint8_t* commandData,
size_t commandDataLen) {
mpsoc::TcSimplexStoreFile tcSimplexStoreFile(spParams, commandSequenceCount);
ReturnValue_t result = tcSimplexStoreFile.setPayload(commandData, commandDataLen);
ReturnValue_t FreshMpsocHandler::commandTcSplitFile(const uint8_t* commandData,
size_t commandDataLen) {
mpsoc::TcSplitFile tcSplitFile(spParams, commandSequenceCount);
ReturnValue_t result = tcSplitFile.setPayload(commandData, commandDataLen);
if (result != returnvalue::OK) {
return result;
}
finishAndSendTc(mpsoc::TC_SIMPLEX_STORE_FILE, tcSimplexStoreFile);
finishAndSendTc(mpsoc::TC_SPLIT_FILE, tcSplitFile);
return returnvalue::OK;
}
@ -784,11 +809,15 @@ ReturnValue_t FreshMpsocHandler::commandTcModeSnapshot() {
ReturnValue_t FreshMpsocHandler::finishAndSendTc(DeviceCommandId_t cmdId, mpsoc::TcBase& tcBase,
uint32_t cmdCountdownMs) {
// Emit warning but still send command.
if (specialComHelperExecuting) {
sif::warning << "PLOC MPSoC: Sending command even though special COM helper is executing"
<< std::endl;
}
ReturnValue_t result = tcBase.finishPacket();
if (result != returnvalue::OK) {
return result;
}
// TODO: We should find a way so this works with the old implementation.
commandSequenceCount++;
mpsoc::printTxPacket(tcBase);
@ -836,8 +865,6 @@ void FreshMpsocHandler::cmdDoneHandler(bool success, ReturnValue_t result) {
ReturnValue_t FreshMpsocHandler::handleDeviceReply() {
ReturnValue_t result = returnvalue::OK;
// SpacePacketReader spacePacket;
// spacePacket.setReadOnlyData(start, remainingSize);
const auto& replyReader = comInterface.getSpReader();
if (replyReader.isNull()) {
return returnvalue::FAILED;
@ -889,15 +916,14 @@ ReturnValue_t FreshMpsocHandler::handleDeviceReply() {
default: {
sif::debug << "FreshMpsocHandler:: Reply has invalid APID 0x" << std::hex << std::setfill('0')
<< std::setw(2) << apid << std::dec << std::endl;
//*foundLen = remainingSize;
return mpsoc::INVALID_APID;
}
}
// TODO: We should implement some way so this can also be used with the former implementation.
uint16_t sequenceCount = replyReader.getSequenceCount();
if (sequenceCount != lastReplySequenceCount + 1) {
// TODO: Trigger event for possible missing reply packet to inform operator.
// We could trigger event for possible missing reply packet to inform operator, but I don't
// think this is properly implemented and used on the MPSoC side anymore.
}
lastReplySequenceCount = sequenceCount;
@ -952,7 +978,6 @@ ReturnValue_t FreshMpsocHandler::handleAckReport() {
switch (replyReader.getApid()) {
case mpsoc::apid::ACK_FAILURE: {
// DeviceCommandId_t commandId = getPendingCommand();
uint16_t status = mpsoc::getStatusFromRawData(replyReader.getFullData());
sif::warning << "MPSoC ACK Failure: " << mpsoc::getStatusString(status) << std::endl;
triggerEvent(mpsoc::ACK_FAILURE, activeCmdInfo.pendingCmd, status);
@ -1236,7 +1261,9 @@ bool FreshMpsocHandler::handleHwShutdown() {
supvTransitionCd.resetTimer();
powerState = PowerState::PENDING_SHUTDOWN;
} else {
triggerEvent(mpsoc::SUPV_NOT_ON, 0);
if ((this->mode != MODE_OFF) and (this->mode != MODE_UNDEFINED)) {
triggerEvent(mpsoc::SUPV_NOT_ON, 0);
}
powerState = PowerState::DONE;
}
}

View File

@ -1,3 +1,4 @@
#include "fsfw/action/ActionMessage.h"
#include "fsfw/action/CommandsActionsIF.h"
#include "fsfw/devicehandlers/DeviceHandlerIF.h"
#include "fsfw/devicehandlers/FreshDeviceHandlerBase.h"
@ -5,6 +6,8 @@
#include "fsfw/ipc/messageQueueDefinitions.h"
#include "fsfw/modes/ModeMessage.h"
#include "fsfw/objectmanager/SystemObjectIF.h"
#include "fsfw/power/PowerSwitchIF.h"
#include "fsfw/power/definitions.h"
#include "fsfw/returnvalues/returnvalue.h"
#include "fsfw_hal/linux/gpio/Gpio.h"
#include "linux/payload/MpsocCommunication.h"
@ -18,7 +21,8 @@ class FreshMpsocHandler : public FreshDeviceHandlerBase, public CommandsActionsI
FreshMpsocHandler(DhbConfig cfg, MpsocCommunication& comInterface,
PlocMpsocSpecialComHelper& specialComHelper, Gpio uartIsolatorSwitch,
object_id_t supervisorHandler);
object_id_t supervisorHandler, PowerSwitchIF& powerSwitcher,
power::Switch_t camSwitchId);
/**
* Periodic helper executed function, implemented by child class.
@ -128,6 +132,8 @@ class FreshMpsocHandler : public FreshDeviceHandlerBase, public CommandsActionsI
TmMemReadReport tmMemReadReport;
uint32_t lastReplySequenceCount = 0;
uint8_t skipSupvCommandingToOn = false;
PowerSwitchIF& powerSwitcher;
power::Switch_t camSwitchId;
// HK manager abstract functions.
LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override;
@ -181,7 +187,7 @@ class FreshMpsocHandler : public FreshDeviceHandlerBase, public CommandsActionsI
ReturnValue_t commandTcModeIdle();
ReturnValue_t commandTcCamTakePic(const uint8_t* commandData, size_t commandDataLen);
ReturnValue_t commandTcSimplexStreamFile(const uint8_t* commandData, size_t commandDataLen);
ReturnValue_t commandTcSimplexStoreFile(const uint8_t* commandData, size_t commandDataLen);
ReturnValue_t commandTcSplitFile(const uint8_t* commandData, size_t commandDataLen);
ReturnValue_t commandTcDownlinkDataModulate(const uint8_t* commandData, size_t commandDataLen);
ReturnValue_t commandTcModeSnapshot();
@ -202,4 +208,5 @@ class FreshMpsocHandler : public FreshDeviceHandlerBase, public CommandsActionsI
void commandSubmodeTransition();
void commonSpecialComInit();
void commonSpecialComStop();
void commandInitHandling(ActionId_t actionId, MessageQueueId_t commandedBy);
};

View File

@ -9,8 +9,8 @@
#include "fsfw/tmtcpacket/ccsds/SpacePacketReader.h"
#include "linux/payload/SerialCommunicationHelper.h"
static constexpr bool MPSOC_LOW_LEVEL_TX_WIRETAPPING = true;
static constexpr bool MPSOC_LOW_LEVEL_RX_WIRETAPPING = true;
static constexpr bool MPSOC_LOW_LEVEL_TX_WIRETAPPING = false;
static constexpr bool MPSOC_LOW_LEVEL_RX_WIRETAPPING = false;
class MpsocCommunication : public SystemObject {
public:

View File

@ -179,8 +179,12 @@ ReturnValue_t PlocMpsocSpecialComHelper::performFlashWrite() {
ReturnValue_t PlocMpsocSpecialComHelper::performFlashRead() {
std::error_code e;
std::ofstream ofile(flashReadAndWrite.obcFile, std::ios::trunc | std::ios::binary);
if (ofile.bad()) {
if (std::filesystem::exists(flashReadAndWrite.obcFile)) {
// Truncate the file first.
std::ofstream ofile(flashReadAndWrite.obcFile, std::ios::binary | std::ios::trunc);
}
std::ofstream ofile(flashReadAndWrite.obcFile, std::ios::binary | std::ios::app);
if (ofile.bad() or not ofile.is_open()) {
return returnvalue::FAILED;
}
ReturnValue_t result = flashfopen(mpsoc::FileAccessModes::READ);

View File

@ -8,12 +8,16 @@
#include "eive/eventSubsystemIds.h"
#include "eive/resultClassIds.h"
#include "fsfw/action/HasActionsIF.h"
#include "fsfw/events/Event.h"
#include "fsfw/returnvalues/returnvalue.h"
#include "fsfw/serialize/SerializeAdapter.h"
#include "fsfw/serialize/SerializeIF.h"
namespace mpsoc {
static constexpr bool MPSOC_TX_WIRETAPPING = false;
static constexpr bool MPSOC_RX_WIRETAPPING = false;
static constexpr size_t CRC_SIZE = 2;
/**
@ -56,9 +60,6 @@ class TcBase : public ploc::SpTcBase {
void printRxPacket(const SpacePacketReader& spReader);
void printTxPacket(const ploc::SpTcBase& tcBase);
static constexpr bool MPSOC_TX_WIRETAPPING = true;
static constexpr bool MPSOC_RX_WIRETAPPING = true;
static constexpr uint32_t DEFAULT_CMD_TIMEOUT_MS = 5000;
static constexpr uint32_t CMD_TIMEOUT_MKFS = 15000;
@ -112,7 +113,11 @@ static const Event MPSOC_SHUTDOWN_FAILED = MAKE_EVENT(6, severity::HIGH);
//! [EXPORT] : [COMMENT] SUPV not on for boot or shutdown process. P1: 0 for OFF transition, 1 for
//! ON transition.
static constexpr Event SUPV_NOT_ON = event::makeEvent(SUBSYSTEM_ID, 7, severity::LOW);
//! [EXPORT] : [COMMENT] SUPV reply timeout.
static constexpr Event SUPV_REPLY_TIMEOUT = event::makeEvent(SUBSYSTEM_ID, 8, severity::LOW);
//! [EXPORT] : [COMMENT] Camera must be commanded on first.
static constexpr Event CAM_MUST_BE_ON_FOR_SNAPSHOT_MODE =
event::makeEvent(SUBSYSTEM_ID, 9, severity::LOW);
enum ParamId : uint8_t { SKIP_SUPV_ON_COMMANDING = 0x01 };
@ -205,7 +210,7 @@ static const DeviceCommandId_t TC_FLASH_GET_DIRECTORY_CONTENT = 28;
static const DeviceCommandId_t TM_FLASH_DIRECTORY_CONTENT = 29;
static constexpr DeviceCommandId_t TC_FLASH_READ_FULL_FILE = 30;
// Store file on MPSoC.
static const DeviceCommandId_t TC_SIMPLEX_STORE_FILE = 31;
static const DeviceCommandId_t TC_SPLIT_FILE = 31;
static const DeviceCommandId_t TC_VERIFY_BOOT = 32;
static const DeviceCommandId_t TC_ENABLE_TC_EXECTION = 33;
static const DeviceCommandId_t TC_FLASH_MKFS = 34;
@ -215,8 +220,6 @@ static const DeviceCommandId_t OBSW_RESET_SEQ_COUNT_LEGACY = 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;
// static const uint16_t SIZE_TM_CAM_CMD_RPT = 18;
static constexpr size_t SIZE_TM_HK_REPORT = 369;
enum Submode : uint8_t { IDLE_OR_NONE = 0, REPLAY = 1, SNAPSHOT = 2 };
@ -1053,9 +1056,9 @@ class TcSimplexStreamFile : public TcBase {
/**
* @brief Class to build simplex send file command
*/
class TcSimplexStoreFile : public TcBase {
class TcSplitFile : public TcBase {
public:
TcSimplexStoreFile(ploc::SpTcParams params, uint16_t sequenceCount)
TcSplitFile(ploc::SpTcParams params, uint16_t sequenceCount)
: TcBase(params, apid::TC_SIMPLEX_SEND_FILE, sequenceCount) {}
ReturnValue_t setPayload(const uint8_t* commandData, size_t commandDataLen) {

View File

@ -232,6 +232,7 @@ void Guidance::targetRotationRate(const double timeDelta, double quatIX[4], doub
}
if (timeDelta != 0.0) {
QuaternionOperations::rotationFromQuaternions(quatIX, quatIXprev, timeDelta, refSatRate);
VectorOperations<double>::mulScalar(refSatRate, -1, refSatRate, 3);
} else {
std::memcpy(refSatRate, ZERO_VEC3, 3 * sizeof(double));
}
@ -315,9 +316,9 @@ void Guidance::comparePtg(double currentQuat[4], double currentSatRotRate[3], do
// Calculate error satellite rotational rate
// Convert target rotational rate into body RF
double errorQuatInv[4] = {0, 0, 0, 0}, targetSatRotRateB[3] = {0, 0, 0};
QuaternionOperations::inverse(errorQuat, errorQuatInv);
QuaternionOperations::multiplyVector(errorQuatInv, targetSatRotRate, targetSatRotRateB);
double targetSatRotRateB[3] = {0, 0, 0};
QuaternionOperations::multiplyVector(currentQuat, targetSatRotRate, targetSatRotRateB);
VectorOperations<double>::copy(targetSatRotRateB, targetSatRotRate, 3);
// Combine the target and reference satellite rotational rates
double combinedRefSatRotRate[3] = {0, 0, 0};
VectorOperations<double>::add(targetSatRotRate, refSatRotRate, combinedRefSatRotRate, 3);

2
tmtc

Submodule tmtc updated: 5e1b12fa52...9a06c64dfa