Merge branch 'main' into str-extensions
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good

This commit is contained in:
Marius Eggert 2023-10-19 09:37:26 +02:00
commit 4295b6b987
4 changed files with 36 additions and 12 deletions

View File

@ -16,6 +16,12 @@ will consitute of a breaking change warranting a new major release:
# [unreleased] # [unreleased]
## Fixed
- PL Enable set of the power controller is now set to invalid properly if the power controller
is not in normal mode.
- MPSoC debug mode.
# [v7.1.0] 2023-10-11 # [v7.1.0] 2023-10-11
- Bumped `eive-tmtc` to v5.8.0. - Bumped `eive-tmtc` to v5.8.0.

View File

@ -91,6 +91,8 @@ ReturnValue_t PlocMpsocHandler::initialize() {
void PlocMpsocHandler::performOperationHook() { void PlocMpsocHandler::performOperationHook() {
if (commandIsPending and cmdCountdown.hasTimedOut()) { if (commandIsPending and cmdCountdown.hasTimedOut()) {
sif::warning << "PlocMpsocHandler: Command " << getPendingCommand() << " has timed out"
<< std::endl;
commandIsPending = false; commandIsPending = false;
// TODO: Better returnvalue? // TODO: Better returnvalue?
cmdDoneHandler(false, returnvalue::FAILED); cmdDoneHandler(false, returnvalue::FAILED);
@ -215,7 +217,6 @@ ReturnValue_t PlocMpsocHandler::buildNormalDeviceCommand(DeviceCommandId_t* id)
if (not commandIsPending and not specialComHelperExecuting) { if (not commandIsPending and not specialComHelperExecuting) {
*id = mpsoc::TC_GET_HK_REPORT; *id = mpsoc::TC_GET_HK_REPORT;
commandIsPending = true; commandIsPending = true;
cmdCountdown.resetTimer();
return buildCommandFromCommand(*id, nullptr, 0); return buildCommandFromCommand(*id, nullptr, 0);
} }
return NOTHING_TO_SEND; return NOTHING_TO_SEND;
@ -352,6 +353,11 @@ ReturnValue_t PlocMpsocHandler::scanForReply(const uint8_t* start, size_t remain
SpacePacketReader spacePacket; SpacePacketReader spacePacket;
spacePacket.setReadOnlyData(start, remainingSize); spacePacket.setReadOnlyData(start, remainingSize);
if (DEBUG_MPSOC_COMMUNICATION) {
sif::debug << "RECV MPSOC packet. APID 0x" << std::hex << std::setw(3) << spacePacket.getApid()
<< std::dec << " Size " << spacePacket.getFullPacketLen() << " SSC "
<< spacePacket.getSequenceCount() << std::endl;
}
if (spacePacket.isNull()) { if (spacePacket.isNull()) {
return returnvalue::FAILED; return returnvalue::FAILED;
} }
@ -467,7 +473,7 @@ void PlocMpsocHandler::setNormalDatapoolEntriesInvalid() {
hkReport.setValidity(false, true); hkReport.setValidity(false, true);
} }
uint32_t PlocMpsocHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 10000; } uint32_t PlocMpsocHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 15000; }
ReturnValue_t PlocMpsocHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap, ReturnValue_t PlocMpsocHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
LocalDataPoolManager& poolManager) { LocalDataPoolManager& poolManager) {
@ -700,6 +706,13 @@ ReturnValue_t PlocMpsocHandler::finishTcPrep(mpsoc::TcBase& tcBase) {
rawPacket = commandBuffer; rawPacket = commandBuffer;
rawPacketLen = tcBase.getFullPacketLen(); rawPacketLen = tcBase.getFullPacketLen();
sequenceCount++; sequenceCount++;
if (DEBUG_MPSOC_COMMUNICATION) {
sif::debug << "SEND MPSOC packet. APID 0x" << std::hex << std::setw(3) << tcBase.getApid()
<< " Size " << std::dec << tcBase.getFullPacketLen() << " SSC "
<< tcBase.getSeqCount() << std::endl;
}
cmdCountdown.resetTimer();
return returnvalue::OK; return returnvalue::OK;
} }
@ -1223,10 +1236,12 @@ void PlocMpsocHandler::dataReceived(ActionId_t actionId, const uint8_t* data, ui
void PlocMpsocHandler::completionSuccessfulReceived(ActionId_t actionId) { void PlocMpsocHandler::completionSuccessfulReceived(ActionId_t actionId) {
if (actionId == supv::ACK_REPORT) { if (actionId == supv::ACK_REPORT) {
sif::warning // I seriously don't know why this happens..
<< "PlocMpsocHandler::completionSuccessfulReceived: Only received ACK report. Consider " // sif::warning
"increasing the MPSoC boot timer." // << "PlocMpsocHandler::completionSuccessfulReceived: Only received ACK report. Consider
<< std::endl; // "
// "increasing the MPSoC boot timer."
// << std::endl;
} else if (actionId != supv::EXE_REPORT) { } else if (actionId != supv::EXE_REPORT) {
sif::warning << "PlocMpsocHandler::completionSuccessfulReceived: Did not expect the action " sif::warning << "PlocMpsocHandler::completionSuccessfulReceived: Did not expect the action "
<< "ID " << actionId << std::endl; << "ID " << actionId << std::endl;
@ -1490,7 +1505,7 @@ LocalPoolDataSetBase* PlocMpsocHandler::getDataSetHandle(sid_t sid) {
bool PlocMpsocHandler::dontCheckQueue() { bool PlocMpsocHandler::dontCheckQueue() {
// The TC and TMs need to be handled strictly sequentially, so while a command is pending, // The TC and TMs need to be handled strictly sequentially, so while a command is pending,
// more specifically while replies are still expected, do not check the queue.s // more specifically while replies are still expected, do not check the queue.
return commandIsPending; return commandIsPending;
} }

View File

@ -17,6 +17,8 @@
#include "fsfw_hal/linux/gpio/Gpio.h" #include "fsfw_hal/linux/gpio/Gpio.h"
#include "fsfw_hal/linux/serial/SerialComIF.h" #include "fsfw_hal/linux/serial/SerialComIF.h"
static constexpr bool DEBUG_MPSOC_COMMUNICATION = false;
/** /**
* @brief This is the device handler for the MPSoC of the payload computer. * @brief This is the device handler for the MPSoC of the payload computer.
* *

View File

@ -100,16 +100,17 @@ void PowerController::performControlOperation() {
return; return;
} }
case InternalState::READY: { case InternalState::READY: {
if (mode != MODE_OFF) { if (mode != MODE_NORMAL) {
calculateStateOfCharge();
if (mode == MODE_NORMAL) {
watchStateOfCharge();
} else {
PoolReadGuard pg(&enablePl); PoolReadGuard pg(&enablePl);
if (pg.getReadResult() == returnvalue::OK) { if (pg.getReadResult() == returnvalue::OK) {
enablePl.setValidity(false, true); enablePl.setValidity(false, true);
} }
} }
if (mode != MODE_OFF) {
calculateStateOfCharge();
if (mode == MODE_NORMAL) {
watchStateOfCharge();
}
} }
break; break;
} }