Compare commits
11 Commits
v8.0.0
...
acd02376c4
Author | SHA1 | Date | |
---|---|---|---|
acd02376c4 | |||
de75fc5531 | |||
39f0db1db6 | |||
e3dc1c9a74
|
|||
083b4e61ad
|
|||
c3dd2b55ee
|
|||
2431994180
|
|||
b9ad396fb4 | |||
cc863503ac | |||
37211e2c5f | |||
b03e53b6e9
|
19
CHANGELOG.md
19
CHANGELOG.md
@@ -16,18 +16,9 @@ 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.
|
||||
@@ -41,8 +32,6 @@ 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
|
||||
@@ -53,7 +42,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.
|
||||
@@ -62,7 +51,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
|
||||
@@ -276,7 +265,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
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @brief Auto-generated event translation file. Contains 325 translations.
|
||||
* @brief Auto-generated event translation file. Contains 324 translations.
|
||||
* @details
|
||||
* Generated on: 2024-05-06 13:47:38
|
||||
* Generated on: 2024-04-17 11:22:10
|
||||
*/
|
||||
#include "translateEvents.h"
|
||||
|
||||
@@ -142,7 +142,6 @@ 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";
|
||||
@@ -607,8 +606,6 @@ 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):
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* @brief Auto-generated object translation file.
|
||||
* @details
|
||||
* Contains 176 translations.
|
||||
* Generated on: 2024-05-06 13:47:38
|
||||
* Generated on: 2024-04-17 11:22:10
|
||||
*/
|
||||
#include "translateObjects.h"
|
||||
|
||||
|
@@ -65,7 +65,6 @@
|
||||
#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"
|
||||
@@ -636,9 +635,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, pwrSwitcher, power::PDU2_CH8_PAYLOAD_CAMERA);
|
||||
auto* mpsocHandler = new FreshMpsocHandler(dhbConf, *mpsocCommunication, *specialComHelper,
|
||||
Gpio(gpioIds::ENABLE_MPSOC_UART, gpioComIF),
|
||||
objects::PLOC_SUPERVISOR_HANDLER);
|
||||
mpsocHandler->connectModeTreeParent(satsystem::payload::SUBSYSTEM);
|
||||
#endif /* OBSW_ADD_PLOC_MPSOC == 1 */
|
||||
#if OBSW_ADD_PLOC_SUPERVISOR == 1
|
||||
|
@@ -135,8 +135,7 @@ 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;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
|
||||
11608;0x2d58;SUPV_REPLY_TIMEOUT;LOW;No description;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
|
||||
|
|
@@ -135,8 +135,7 @@ 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;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
|
||||
11608;0x2d58;SUPV_REPLY_TIMEOUT;LOW;No description;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,7 +1,7 @@
|
||||
/**
|
||||
* @brief Auto-generated event translation file. Contains 325 translations.
|
||||
* @brief Auto-generated event translation file. Contains 324 translations.
|
||||
* @details
|
||||
* Generated on: 2024-05-06 13:47:38
|
||||
* Generated on: 2024-04-17 11:22:10
|
||||
*/
|
||||
#include "translateEvents.h"
|
||||
|
||||
@@ -142,7 +142,6 @@ 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";
|
||||
@@ -607,8 +606,6 @@ 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):
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* @brief Auto-generated object translation file.
|
||||
* @details
|
||||
* Contains 180 translations.
|
||||
* Generated on: 2024-05-06 13:47:38
|
||||
* Generated on: 2024-04-17 11:22:10
|
||||
*/
|
||||
#include "translateObjects.h"
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @brief Auto-generated event translation file. Contains 325 translations.
|
||||
* @brief Auto-generated event translation file. Contains 324 translations.
|
||||
* @details
|
||||
* Generated on: 2024-05-06 13:47:38
|
||||
* Generated on: 2024-04-17 11:22:10
|
||||
*/
|
||||
#include "translateEvents.h"
|
||||
|
||||
@@ -142,7 +142,6 @@ 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";
|
||||
@@ -607,8 +606,6 @@ 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):
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* @brief Auto-generated object translation file.
|
||||
* @details
|
||||
* Contains 180 translations.
|
||||
* Generated on: 2024-05-06 13:47:38
|
||||
* Generated on: 2024-04-17 11:22:10
|
||||
*/
|
||||
#include "translateObjects.h"
|
||||
|
||||
|
@@ -8,29 +8,22 @@
|
||||
#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,
|
||||
PowerSwitchIF& powerSwitcher, power::Switch_t camSwitchId)
|
||||
Gpio uartIsolatorSwitch, object_id_t supervisorHandler)
|
||||
: FreshDeviceHandlerBase(cfg),
|
||||
comInterface(comInterface),
|
||||
specialComHelper(specialComHelper),
|
||||
commandActionHelper(this),
|
||||
uartIsolatorSwitch(uartIsolatorSwitch),
|
||||
hkReport(this),
|
||||
supervisorHandler(supervisorHandler),
|
||||
powerSwitcher(powerSwitcher),
|
||||
camSwitchId(camSwitchId) {
|
||||
supervisorHandler(supervisorHandler) {
|
||||
commandActionHelperQueue = QueueFactory::instance()->createMessageQueue(10);
|
||||
eventQueue = QueueFactory::instance()->createMessageQueue(10);
|
||||
spParams.maxSize = sizeof(commandBuffer);
|
||||
@@ -84,13 +77,8 @@ void FreshMpsocHandler::performDefaultDeviceOperation() {
|
||||
}
|
||||
}
|
||||
|
||||
// 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 (mode == MODE_NORMAL and not activeCmdInfo.pending) {
|
||||
// TODO: Take care of regular periodic commanding here.
|
||||
}
|
||||
|
||||
if (activeCmdInfo.pending and activeCmdInfo.cmdCountdown.hasTimedOut()) {
|
||||
@@ -236,11 +224,6 @@ 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;
|
||||
}
|
||||
@@ -313,6 +296,8 @@ 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;
|
||||
}
|
||||
@@ -337,10 +322,6 @@ 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;
|
||||
}
|
||||
@@ -376,9 +357,7 @@ void FreshMpsocHandler::handleTransitionToOn() {
|
||||
if (startupState == StartupState::DONE) {
|
||||
setMode(targetMode, targetSubmode);
|
||||
transitionState = TransitionState::NONE;
|
||||
if (targetMode == MODE_NORMAL) {
|
||||
hkReport.setReportingEnabled(true);
|
||||
}
|
||||
hkReport.setReportingEnabled(true);
|
||||
powerState = PowerState::IDLE;
|
||||
startupState = StartupState::IDLE;
|
||||
}
|
||||
@@ -590,8 +569,8 @@ ReturnValue_t FreshMpsocHandler::executeRegularCmd(ActionId_t actionId,
|
||||
result = commandTcSimplexStreamFile(commandData, commandDataLen);
|
||||
break;
|
||||
}
|
||||
case (mpsoc::TC_SPLIT_FILE): {
|
||||
result = commandTcSplitFile(commandData, commandDataLen);
|
||||
case (mpsoc::TC_SIMPLEX_STORE_FILE): {
|
||||
result = commandTcSimplexStoreFile(commandData, commandDataLen);
|
||||
break;
|
||||
}
|
||||
case (mpsoc::TC_DOWNLINK_DATA_MODULATE): {
|
||||
@@ -606,20 +585,16 @@ ReturnValue_t FreshMpsocHandler::executeRegularCmd(ActionId_t actionId,
|
||||
}
|
||||
|
||||
if (result == returnvalue::OK) {
|
||||
commandInitHandling(actionId, commandedBy);
|
||||
activeCmdInfo.start(actionId, commandedBy);
|
||||
/**
|
||||
* Flushing the receive buffer to make sure there are no data left from a faulty reply.
|
||||
*/
|
||||
comInterface.getComHelper().flushUartRxBuffer();
|
||||
}
|
||||
|
||||
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;
|
||||
@@ -768,14 +743,14 @@ ReturnValue_t FreshMpsocHandler::commandTcSimplexStreamFile(const uint8_t* comma
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
ReturnValue_t FreshMpsocHandler::commandTcSplitFile(const uint8_t* commandData,
|
||||
size_t commandDataLen) {
|
||||
mpsoc::TcSplitFile tcSplitFile(spParams, commandSequenceCount);
|
||||
ReturnValue_t result = tcSplitFile.setPayload(commandData, commandDataLen);
|
||||
ReturnValue_t FreshMpsocHandler::commandTcSimplexStoreFile(const uint8_t* commandData,
|
||||
size_t commandDataLen) {
|
||||
mpsoc::TcSimplexStoreFile tcSimplexStoreFile(spParams, commandSequenceCount);
|
||||
ReturnValue_t result = tcSimplexStoreFile.setPayload(commandData, commandDataLen);
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
finishAndSendTc(mpsoc::TC_SPLIT_FILE, tcSplitFile);
|
||||
finishAndSendTc(mpsoc::TC_SIMPLEX_STORE_FILE, tcSimplexStoreFile);
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
@@ -809,15 +784,11 @@ 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);
|
||||
@@ -865,6 +836,8 @@ 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;
|
||||
@@ -916,14 +889,15 @@ 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) {
|
||||
// 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.
|
||||
// TODO: Trigger event for possible missing reply packet to inform operator.
|
||||
}
|
||||
lastReplySequenceCount = sequenceCount;
|
||||
|
||||
@@ -978,6 +952,7 @@ 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);
|
||||
@@ -1261,9 +1236,7 @@ bool FreshMpsocHandler::handleHwShutdown() {
|
||||
supvTransitionCd.resetTimer();
|
||||
powerState = PowerState::PENDING_SHUTDOWN;
|
||||
} else {
|
||||
if ((this->mode != MODE_OFF) and (this->mode != MODE_UNDEFINED)) {
|
||||
triggerEvent(mpsoc::SUPV_NOT_ON, 0);
|
||||
}
|
||||
triggerEvent(mpsoc::SUPV_NOT_ON, 0);
|
||||
powerState = PowerState::DONE;
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,3 @@
|
||||
#include "fsfw/action/ActionMessage.h"
|
||||
#include "fsfw/action/CommandsActionsIF.h"
|
||||
#include "fsfw/devicehandlers/DeviceHandlerIF.h"
|
||||
#include "fsfw/devicehandlers/FreshDeviceHandlerBase.h"
|
||||
@@ -6,8 +5,6 @@
|
||||
#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"
|
||||
@@ -21,8 +18,7 @@ class FreshMpsocHandler : public FreshDeviceHandlerBase, public CommandsActionsI
|
||||
|
||||
FreshMpsocHandler(DhbConfig cfg, MpsocCommunication& comInterface,
|
||||
PlocMpsocSpecialComHelper& specialComHelper, Gpio uartIsolatorSwitch,
|
||||
object_id_t supervisorHandler, PowerSwitchIF& powerSwitcher,
|
||||
power::Switch_t camSwitchId);
|
||||
object_id_t supervisorHandler);
|
||||
|
||||
/**
|
||||
* Periodic helper executed function, implemented by child class.
|
||||
@@ -132,8 +128,6 @@ 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;
|
||||
@@ -187,7 +181,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 commandTcSplitFile(const uint8_t* commandData, size_t commandDataLen);
|
||||
ReturnValue_t commandTcSimplexStoreFile(const uint8_t* commandData, size_t commandDataLen);
|
||||
ReturnValue_t commandTcDownlinkDataModulate(const uint8_t* commandData, size_t commandDataLen);
|
||||
ReturnValue_t commandTcModeSnapshot();
|
||||
|
||||
@@ -208,5 +202,4 @@ class FreshMpsocHandler : public FreshDeviceHandlerBase, public CommandsActionsI
|
||||
void commandSubmodeTransition();
|
||||
void commonSpecialComInit();
|
||||
void commonSpecialComStop();
|
||||
void commandInitHandling(ActionId_t actionId, MessageQueueId_t commandedBy);
|
||||
};
|
||||
|
@@ -9,8 +9,8 @@
|
||||
#include "fsfw/tmtcpacket/ccsds/SpacePacketReader.h"
|
||||
#include "linux/payload/SerialCommunicationHelper.h"
|
||||
|
||||
static constexpr bool MPSOC_LOW_LEVEL_TX_WIRETAPPING = false;
|
||||
static constexpr bool MPSOC_LOW_LEVEL_RX_WIRETAPPING = false;
|
||||
static constexpr bool MPSOC_LOW_LEVEL_TX_WIRETAPPING = true;
|
||||
static constexpr bool MPSOC_LOW_LEVEL_RX_WIRETAPPING = true;
|
||||
|
||||
class MpsocCommunication : public SystemObject {
|
||||
public:
|
||||
|
@@ -179,12 +179,8 @@ ReturnValue_t PlocMpsocSpecialComHelper::performFlashWrite() {
|
||||
|
||||
ReturnValue_t PlocMpsocSpecialComHelper::performFlashRead() {
|
||||
std::error_code e;
|
||||
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()) {
|
||||
std::ofstream ofile(flashReadAndWrite.obcFile, std::ios::trunc | std::ios::binary);
|
||||
if (ofile.bad()) {
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
ReturnValue_t result = flashfopen(mpsoc::FileAccessModes::READ);
|
||||
|
@@ -8,16 +8,12 @@
|
||||
#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;
|
||||
|
||||
/**
|
||||
@@ -60,6 +56,9 @@ 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;
|
||||
|
||||
@@ -113,11 +112,7 @@ 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 };
|
||||
|
||||
@@ -210,7 +205,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_SPLIT_FILE = 31;
|
||||
static const DeviceCommandId_t TC_SIMPLEX_STORE_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;
|
||||
@@ -220,6 +215,8 @@ 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 };
|
||||
@@ -1056,9 +1053,9 @@ class TcSimplexStreamFile : public TcBase {
|
||||
/**
|
||||
* @brief Class to build simplex send file command
|
||||
*/
|
||||
class TcSplitFile : public TcBase {
|
||||
class TcSimplexStoreFile : public TcBase {
|
||||
public:
|
||||
TcSplitFile(ploc::SpTcParams params, uint16_t sequenceCount)
|
||||
TcSimplexStoreFile(ploc::SpTcParams params, uint16_t sequenceCount)
|
||||
: TcBase(params, apid::TC_SIMPLEX_SEND_FILE, sequenceCount) {}
|
||||
|
||||
ReturnValue_t setPayload(const uint8_t* commandData, size_t commandDataLen) {
|
||||
|
@@ -232,7 +232,6 @@ 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));
|
||||
}
|
||||
@@ -316,9 +315,9 @@ void Guidance::comparePtg(double currentQuat[4], double currentSatRotRate[3], do
|
||||
|
||||
// Calculate error satellite rotational rate
|
||||
// Convert target rotational rate into body RF
|
||||
double targetSatRotRateB[3] = {0, 0, 0};
|
||||
QuaternionOperations::multiplyVector(currentQuat, targetSatRotRate, targetSatRotRateB);
|
||||
VectorOperations<double>::copy(targetSatRotRateB, targetSatRotRate, 3);
|
||||
double errorQuatInv[4] = {0, 0, 0, 0}, targetSatRotRateB[3] = {0, 0, 0};
|
||||
QuaternionOperations::inverse(errorQuat, errorQuatInv);
|
||||
QuaternionOperations::multiplyVector(errorQuatInv, targetSatRotRate, targetSatRotRateB);
|
||||
// Combine the target and reference satellite rotational rates
|
||||
double combinedRefSatRotRate[3] = {0, 0, 0};
|
||||
VectorOperations<double>::add(targetSatRotRate, refSatRotRate, combinedRefSatRotRate, 3);
|
||||
|
@@ -9,7 +9,7 @@ export ZYNQ_7020_SYSROOT="/opt/xiphos/sdk/ark/sysroots/cortexa9hf-neon-xiphos-li
|
||||
|
||||
export PATH=${CROSS_COMPILE_BIN_PATH}:$PATH
|
||||
export CROSS_COMPILE="arm-linux-gnueabihf"
|
||||
unset EIVE_Q7S_EM
|
||||
# export EIVE_Q7S_EM=1
|
||||
|
||||
if [[ -d "eive-obsw" ]]; then
|
||||
echo "Detected EIVE OBSW root directory at $(pwd)/eive-obsw. Setting to EIVE_OBSW_ROOT"
|
||||
|
2
tmtc
2
tmtc
Submodule tmtc updated: 9a06c64dfa...5e1b12fa52
Reference in New Issue
Block a user