some more debugging capabilities
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit

This commit is contained in:
Robin Müller 2024-04-17 11:06:05 +02:00
parent d319fcfa03
commit 7ffba2bbda
Signed by: muellerr
GPG Key ID: A649FB78196E3849
3 changed files with 17 additions and 8 deletions

View File

@ -74,7 +74,6 @@ void FreshMpsocHandler::performDefaultDeviceOperation() {
if (activeCmdInfo.pending and activeCmdInfo.cmdCountdown.hasTimedOut()) { if (activeCmdInfo.pending and activeCmdInfo.cmdCountdown.hasTimedOut()) {
sif::warning << "PlocMpsocHandler: Command " << activeCmdInfo.pendingCmd << " has timed out" sif::warning << "PlocMpsocHandler: Command " << activeCmdInfo.pendingCmd << " has timed out"
<< std::endl; << std::endl;
activeCmdInfo.reset();
cmdDoneHandler(false, mpsoc::COMMAND_TIMEOUT); cmdDoneHandler(false, mpsoc::COMMAND_TIMEOUT);
} }
EventMessage event; EventMessage event;
@ -301,7 +300,7 @@ void FreshMpsocHandler::handleTransitionToOn() {
} }
} }
if (startupState == StartupState::DONE) { if (startupState == StartupState::DONE) {
setMode(MODE_ON); setMode(targetMode, targetSubmode);
transitionActive = false; transitionActive = false;
hkReport.setReportingEnabled(true); hkReport.setReportingEnabled(true);
powerState = PowerState::IDLE; powerState = PowerState::IDLE;
@ -350,6 +349,7 @@ void FreshMpsocHandler::dataReceived(ActionId_t actionId, const uint8_t* data, u
} }
void FreshMpsocHandler::completionSuccessfulReceived(ActionId_t actionId) { void FreshMpsocHandler::completionSuccessfulReceived(ActionId_t actionId) {
sif::debug << "received completion for action ID " << actionId << std::endl;
switch (powerState) { switch (powerState) {
case PowerState::PENDING_STARTUP: { case PowerState::PENDING_STARTUP: {
if (actionId != supv::START_MPSOC) { if (actionId != supv::START_MPSOC) {
@ -373,6 +373,8 @@ void FreshMpsocHandler::completionSuccessfulReceived(ActionId_t actionId) {
} }
void FreshMpsocHandler::completionFailedReceived(ActionId_t actionId, ReturnValue_t returnCode) { void FreshMpsocHandler::completionFailedReceived(ActionId_t actionId, ReturnValue_t returnCode) {
sif::debug << "received completion failure for action ID " << actionId << " with code "
<< returnCode << std::endl;
handleActionCommandFailure(actionId, returnCode); handleActionCommandFailure(actionId, returnCode);
} }
@ -1059,13 +1061,12 @@ bool FreshMpsocHandler::handleHwStartup() {
} }
} }
if (powerState == PowerState::DONE) { if (powerState == PowerState::DONE) {
if (mpsocBootTransitionCd.hasTimedOut()) {
// Wait a bit for the MPSoC to fully boot. // Wait a bit for the MPSoC to fully boot.
uartIsolatorSwitch.pullHigh(); if (!mpsocBootTransitionCd.hasTimedOut()) {
powerState = PowerState::IDLE;
} else {
return false; return false;
} }
uartIsolatorSwitch.pullHigh();
powerState = PowerState::IDLE;
} }
return true; return true;
} }

View File

@ -58,7 +58,13 @@ ReturnValue_t MpsocCommunication::readSerialInterface() {
if (bytesRead < 0) { if (bytesRead < 0) {
return returnvalue::FAILED; return returnvalue::FAILED;
} }
if (bytesRead > 0) {
if (MPSOC_LOW_LEVEL_RX_WIRETAPPING) {
sif::debug << "Read " << bytesRead << " bytes on the MPSoC interface" << std::endl;
}
return readRingBuf.writeData(readBuf, bytesRead); return readRingBuf.writeData(readBuf, bytesRead);
}
return returnvalue::OK;
} }
const SpacePacketReader& MpsocCommunication::getSpReader() const { return spReader; } const SpacePacketReader& MpsocCommunication::getSpReader() const { return spReader; }

View File

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