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

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

View File

@ -58,7 +58,13 @@ ReturnValue_t MpsocCommunication::readSerialInterface() {
if (bytesRead < 0) {
return returnvalue::FAILED;
}
return readRingBuf.writeData(readBuf, bytesRead);
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 returnvalue::OK;
}
const SpacePacketReader& MpsocCommunication::getSpReader() const { return spReader; }

View File

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