v1.10.0 #220

Merged
meierj merged 592 commits from develop into main 2022-04-22 07:42:20 +02:00
10 changed files with 133 additions and 140 deletions
Showing only changes of commit 734972af07 - Show all commits

View File

@ -662,8 +662,8 @@ void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF) {
auto supvGpioCookie = new GpioCookie; auto supvGpioCookie = new GpioCookie;
supvGpioCookie->addGpio(gpioIds::ENABLE_SUPV_UART, gpioConfigSupv); supvGpioCookie->addGpio(gpioIds::ENABLE_SUPV_UART, gpioConfigSupv);
gpioComIF->addGpios(supvGpioCookie); gpioComIF->addGpios(supvGpioCookie);
auto supervisorCookie = new UartCookie( auto supervisorCookie = new UartCookie(objects::PLOC_SUPERVISOR_HANDLER,
objects::PLOC_SUPERVISOR_HANDLER, q7s::UART_PLOC_SUPERVSIOR_DEV, UartModes::NON_CANONICAL, q7s::UART_PLOC_SUPERVSIOR_DEV, UartModes::NON_CANONICAL,
uart::PLOC_SUPERVISOR_BAUD, supv::MAX_PACKET_SIZE * 20); uart::PLOC_SUPERVISOR_BAUD, supv::MAX_PACKET_SIZE * 20);
supervisorCookie->setNoFixedSizeReply(); supervisorCookie->setNoFixedSizeReply();
new PlocSupervisorHandler(objects::PLOC_SUPERVISOR_HANDLER, objects::UART_COM_IF, new PlocSupervisorHandler(objects::PLOC_SUPERVISOR_HANDLER, objects::UART_COM_IF,

View File

@ -1541,6 +1541,6 @@ class LatchupStatusReport : public StaticLocalDataSet<LATCHUP_RPT_SET_ENTRIES> {
lp_var_t<uint32_t> isSet = lp_var_t<uint32_t> isSet =
lp_var_t<uint32_t>(sid.objectId, PoolIds::LATCHUP_RPT_TIME_IS_SET, this); lp_var_t<uint32_t>(sid.objectId, PoolIds::LATCHUP_RPT_TIME_IS_SET, this);
}; };
} // namespace PLOC_SPV } // namespace supv
#endif /* MISSION_DEVICES_DEVICEDEFINITIONS_PLOCSVPDEFINITIONS_H_ */ #endif /* MISSION_DEVICES_DEVICEDEFINITIONS_PLOCSVPDEFINITIONS_H_ */

View File

@ -1,9 +1,9 @@
#include "PlocMPSoCHandler.h" #include "PlocMPSoCHandler.h"
#include "linux/devices/devicedefinitions/PlocSupervisorDefinitions.h"
#include "OBSWConfig.h" #include "OBSWConfig.h"
#include "fsfw/datapool/PoolReadGuard.h" #include "fsfw/datapool/PoolReadGuard.h"
#include "fsfw/globalfunctions/CRC.h" #include "fsfw/globalfunctions/CRC.h"
#include "linux/devices/devicedefinitions/PlocSupervisorDefinitions.h"
PlocMPSoCHandler::PlocMPSoCHandler(object_id_t objectId, object_id_t uartComIFid, PlocMPSoCHandler::PlocMPSoCHandler(object_id_t objectId, object_id_t uartComIFid,
CookieIF* comCookie, PlocMPSoCHelper* plocMPSoCHelper, CookieIF* comCookie, PlocMPSoCHelper* plocMPSoCHelper,
@ -87,8 +87,8 @@ void PlocMPSoCHandler::performOperationHook() {
} }
} }
CommandMessage message; CommandMessage message;
for (ReturnValue_t result = commandActionHelperQueue->receiveMessage(&message); result == RETURN_OK; for (ReturnValue_t result = commandActionHelperQueue->receiveMessage(&message);
result = commandActionHelperQueue->receiveMessage(&message)) { result == RETURN_OK; result = commandActionHelperQueue->receiveMessage(&message)) {
result = commandActionHelper.handleReply(&message); result = commandActionHelper.handleReply(&message);
if (result == RETURN_OK) { if (result == RETURN_OK) {
continue; continue;
@ -133,7 +133,7 @@ ReturnValue_t PlocMPSoCHandler::executeAction(ActionId_t actionId, MessageQueueI
} }
void PlocMPSoCHandler::doStartUp() { void PlocMPSoCHandler::doStartUp() {
switch(powerState) { switch (powerState) {
case PowerState::OFF: case PowerState::OFF:
commandActionHelper.commandAction(supervisorHandler, supv::START_MPSOC); commandActionHelper.commandAction(supervisorHandler, supv::START_MPSOC);
powerState = PowerState::BOOTING; powerState = PowerState::BOOTING;
@ -148,7 +148,7 @@ void PlocMPSoCHandler::doStartUp() {
} }
void PlocMPSoCHandler::doShutDown() { void PlocMPSoCHandler::doShutDown() {
switch(powerState) { switch (powerState) {
case PowerState::ON: case PowerState::ON:
uartIsolatorSwitch.pullLow(); uartIsolatorSwitch.pullLow();
commandActionHelper.commandAction(supervisorHandler, supv::SHUTDOWN_MPSOC); commandActionHelper.commandAction(supervisorHandler, supv::SHUTDOWN_MPSOC);
@ -703,32 +703,25 @@ size_t PlocMPSoCHandler::getNextReplyLength(DeviceCommandId_t commandId) {
return replyLen; return replyLen;
} }
MessageQueueIF* PlocMPSoCHandler::getCommandQueuePtr() { MessageQueueIF* PlocMPSoCHandler::getCommandQueuePtr() { return commandActionHelperQueue; }
return commandActionHelperQueue;
}
void PlocMPSoCHandler::stepSuccessfulReceived(ActionId_t actionId, uint8_t step) { void PlocMPSoCHandler::stepSuccessfulReceived(ActionId_t actionId, uint8_t step) { return; }
return;
}
void PlocMPSoCHandler::stepFailedReceived(ActionId_t actionId, uint8_t step, void PlocMPSoCHandler::stepFailedReceived(ActionId_t actionId, uint8_t step,
ReturnValue_t returnCode) { ReturnValue_t returnCode) {
switch (actionId) { switch (actionId) {
case supv::START_MPSOC: case supv::START_MPSOC:
sif::warning << "PlocMPSoCHandler::stepFailedReceived: Failed to start MPSoC" sif::warning << "PlocMPSoCHandler::stepFailedReceived: Failed to start MPSoC" << std::endl;
<< std::endl;
powerState = PowerState::OFF; powerState = PowerState::OFF;
break; break;
case supv::SHUTDOWN_MPSOC: case supv::SHUTDOWN_MPSOC:
triggerEvent(MPSOC_SHUTDOWN_FAILED); triggerEvent(MPSOC_SHUTDOWN_FAILED);
sif::warning << "PlocMPSoCHandler::stepFailedReceived: Failed to shutdown MPSoC" sif::warning << "PlocMPSoCHandler::stepFailedReceived: Failed to shutdown MPSoC" << std::endl;
<< std::endl;
// TODO: Setting state to on or off here? // TODO: Setting state to on or off here?
powerState = PowerState::ON; powerState = PowerState::ON;
break; break;
default: default:
sif::debug sif::debug << "PlocMPSoCHandler::stepFailedReceived: Received unexpected action reply"
<< "PlocMPSoCHandler::stepFailedReceived: Received unexpected action reply"
<< std::endl; << std::endl;
break; break;
} }
@ -744,7 +737,7 @@ void PlocMPSoCHandler::completionSuccessfulReceived(ActionId_t actionId) {
<< "ID" << std::endl; << "ID" << std::endl;
return; return;
} }
switch(powerState) { switch (powerState) {
case PowerState::BOOTING: { case PowerState::BOOTING: {
powerState = PowerState::ON; powerState = PowerState::ON;
break; break;
@ -868,7 +861,7 @@ void PlocMPSoCHandler::handleActionCommandFailure(ActionId_t actionId) {
<< std::endl; << std::endl;
return; return;
} }
switch(powerState) { switch (powerState) {
case PowerState::BOOTING: { case PowerState::BOOTING: {
sif::warning << "PlocMPSoCHandler::handleActionCommandFailure: Failed to boot MPSoC" sif::warning << "PlocMPSoCHandler::handleActionCommandFailure: Failed to boot MPSoC"
<< std::endl; << std::endl;

View File

@ -489,8 +489,8 @@ ReturnValue_t PlocSupervisorHandler::enableReplyInReplyMap(DeviceCommandMap::ite
switch (command->first) { switch (command->first) {
case supv::GET_HK_REPORT: { case supv::GET_HK_REPORT: {
enabledReplies = 3; enabledReplies = 3;
result = DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, result =
supv::HK_REPORT); DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, supv::HK_REPORT);
if (result != RETURN_OK) { if (result != RETURN_OK) {
sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id " sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id "
<< supv::HK_REPORT << " not in replyMap" << std::endl; << supv::HK_REPORT << " not in replyMap" << std::endl;
@ -589,15 +589,15 @@ ReturnValue_t PlocSupervisorHandler::enableReplyInReplyMap(DeviceCommandMap::ite
result = result =
DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, supv::ACK_REPORT); DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, supv::ACK_REPORT);
if (result != RETURN_OK) { if (result != RETURN_OK) {
sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id " sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id " << supv::ACK_REPORT
<< supv::ACK_REPORT << " not in replyMap" << std::endl; << " not in replyMap" << std::endl;
} }
result = result =
DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, supv::EXE_REPORT); DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, supv::EXE_REPORT);
if (result != RETURN_OK) { if (result != RETURN_OK) {
sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id " sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id " << supv::EXE_REPORT
<< supv::EXE_REPORT << " not in replyMap" << std::endl; << " not in replyMap" << std::endl;
} }
return RETURN_OK; return RETURN_OK;
@ -1459,8 +1459,7 @@ ReturnValue_t PlocSupervisorHandler::handleMramDumpFile(DeviceCommandId_t id) {
return MRAM_FILE_NOT_EXISTS; return MRAM_FILE_NOT_EXISTS;
} }
std::ofstream file(activeMramFile, std::ios_base::app | std::ios_base::out); std::ofstream file(activeMramFile, std::ios_base::app | std::ios_base::out);
file.write( file.write(reinterpret_cast<const char*>(spacePacketBuffer + supv::SPACE_PACKET_HEADER_LENGTH),
reinterpret_cast<const char*>(spacePacketBuffer + supv::SPACE_PACKET_HEADER_LENGTH),
packetLen - 1); packetLen - 1);
file.close(); file.close();
return RETURN_OK; return RETURN_OK;

View File

@ -262,12 +262,11 @@ void PlocUpdater::commandUpdateAvailable() {
calcImageCrc(); calcImageCrc();
supv::UpdateInfo packet(supv::APID_UPDATE_AVAILABLE, static_cast<uint8_t>(image), supv::UpdateInfo packet(supv::APID_UPDATE_AVAILABLE, static_cast<uint8_t>(image),
static_cast<uint8_t>(partition), imageSize, imageCrc, static_cast<uint8_t>(partition), imageSize, imageCrc, numOfUpdatePackets);
numOfUpdatePackets);
result = commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, result =
supv::UPDATE_AVAILABLE, packet.getWholeData(), commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, supv::UPDATE_AVAILABLE,
packet.getFullSize()); packet.getWholeData(), packet.getFullSize());
if (result != RETURN_OK) { if (result != RETURN_OK) {
sif::warning << "PlocUpdater::commandUpdateAvailable: Failed to send update available" sif::warning << "PlocUpdater::commandUpdateAvailable: Failed to send update available"
<< " packet to supervisor handler" << std::endl; << " packet to supervisor handler" << std::endl;
@ -311,9 +310,9 @@ void PlocUpdater::commandUpdatePacket() {
} }
packet.makeCrc(); packet.makeCrc();
result = commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, result =
supv::UPDATE_IMAGE_DATA, packet.getWholeData(), commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, supv::UPDATE_IMAGE_DATA,
packet.getFullSize()); packet.getWholeData(), packet.getFullSize());
if (result != RETURN_OK) { if (result != RETURN_OK) {
sif::warning << "PlocUpdater::commandUpdateAvailable: Failed to send update" sif::warning << "PlocUpdater::commandUpdateAvailable: Failed to send update"
@ -335,11 +334,9 @@ void PlocUpdater::commandUpdateVerify() {
ReturnValue_t result = RETURN_OK; ReturnValue_t result = RETURN_OK;
supv::UpdateInfo packet(supv::APID_UPDATE_VERIFY, static_cast<uint8_t>(image), supv::UpdateInfo packet(supv::APID_UPDATE_VERIFY, static_cast<uint8_t>(image),
static_cast<uint8_t>(partition), imageSize, imageCrc, static_cast<uint8_t>(partition), imageSize, imageCrc, numOfUpdatePackets);
numOfUpdatePackets);
result = result = commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, supv::UPDATE_VERIFY,
commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, supv::UPDATE_VERIFY,
packet.getWholeData(), packet.getFullSize()); packet.getWholeData(), packet.getFullSize());
if (result != RETURN_OK) { if (result != RETURN_OK) {
sif::warning << "PlocUpdater::commandUpdateAvailable: Failed to send update available" sif::warning << "PlocUpdater::commandUpdateAvailable: Failed to send update available"

View File

@ -7,12 +7,12 @@
#include "ArcsecJsonParamBase.h" #include "ArcsecJsonParamBase.h"
#include "OBSWConfig.h" #include "OBSWConfig.h"
#include "StrHelper.h" #include "StrHelper.h"
#include "devices/powerSwitcherList.h"
#include "fsfw/devicehandlers/DeviceHandlerBase.h" #include "fsfw/devicehandlers/DeviceHandlerBase.h"
#include "fsfw/src/fsfw/serialize/SerializeAdapter.h" #include "fsfw/src/fsfw/serialize/SerializeAdapter.h"
#include "fsfw/timemanager/Countdown.h" #include "fsfw/timemanager/Countdown.h"
#include "linux/devices/devicedefinitions/StarTrackerDefinitions.h" #include "linux/devices/devicedefinitions/StarTrackerDefinitions.h"
#include "thirdparty/arcsec_star_tracker/common/SLIP.h" #include "thirdparty/arcsec_star_tracker/common/SLIP.h"
#include "devices/powerSwitcherList.h"
/** /**
* @brief This is the device handler for the star tracker from arcsec. * @brief This is the device handler for the star tracker from arcsec.

View File

@ -139,42 +139,45 @@ ReturnValue_t SyrlinksHkHandler::buildCommandFromCommand(DeviceCommandId_t devic
return RETURN_OK; return RETURN_OK;
} }
case (SYRLINKS::READ_TX_AGC_VALUE_HIGH_BYTE): { case (SYRLINKS::READ_TX_AGC_VALUE_HIGH_BYTE): {
readTxAgcValueHighByte.copy(reinterpret_cast<char*>(commandBuffer), readTxAgcValueHighByte.size(), 0); readTxAgcValueHighByte.copy(reinterpret_cast<char*>(commandBuffer),
readTxAgcValueHighByte.size(), 0);
rawPacketLen = readTxAgcValueHighByte.size(); rawPacketLen = readTxAgcValueHighByte.size();
rememberCommandId = SYRLINKS::READ_TX_AGC_VALUE_HIGH_BYTE; rememberCommandId = SYRLINKS::READ_TX_AGC_VALUE_HIGH_BYTE;
rawPacket = commandBuffer; rawPacket = commandBuffer;
return RETURN_OK; return RETURN_OK;
} }
case (SYRLINKS::READ_TX_AGC_VALUE_LOW_BYTE): { case (SYRLINKS::READ_TX_AGC_VALUE_LOW_BYTE): {
readTxAgcValueLowByte.copy(reinterpret_cast<char*>(commandBuffer), readTxAgcValueLowByte.size(), 0); readTxAgcValueLowByte.copy(reinterpret_cast<char*>(commandBuffer),
readTxAgcValueLowByte.size(), 0);
rawPacketLen = readTxAgcValueLowByte.size(); rawPacketLen = readTxAgcValueLowByte.size();
rememberCommandId = SYRLINKS::READ_TX_AGC_VALUE_LOW_BYTE; rememberCommandId = SYRLINKS::READ_TX_AGC_VALUE_LOW_BYTE;
rawPacket = commandBuffer; rawPacket = commandBuffer;
return RETURN_OK; return RETURN_OK;
} }
case (SYRLINKS::TEMP_POWER_AMPLIFIER_HIGH_BYTE): case (SYRLINKS::TEMP_POWER_AMPLIFIER_HIGH_BYTE):
tempPowerAmpBoardHighByte.copy(reinterpret_cast<char*>(commandBuffer), tempPowerAmpBoardHighByte.size(), tempPowerAmpBoardHighByte.copy(reinterpret_cast<char*>(commandBuffer),
0); tempPowerAmpBoardHighByte.size(), 0);
rawPacketLen = tempPowerAmpBoardHighByte.size(); rawPacketLen = tempPowerAmpBoardHighByte.size();
rememberCommandId = SYRLINKS::TEMP_POWER_AMPLIFIER_HIGH_BYTE; rememberCommandId = SYRLINKS::TEMP_POWER_AMPLIFIER_HIGH_BYTE;
rawPacket = commandBuffer; rawPacket = commandBuffer;
return RETURN_OK; return RETURN_OK;
case (SYRLINKS::TEMP_POWER_AMPLIFIER_LOW_BYTE): case (SYRLINKS::TEMP_POWER_AMPLIFIER_LOW_BYTE):
tempPowerAmpBoardLowByte.copy(reinterpret_cast<char*>(commandBuffer), tempPowerAmpBoardLowByte.size(), tempPowerAmpBoardLowByte.copy(reinterpret_cast<char*>(commandBuffer),
0); tempPowerAmpBoardLowByte.size(), 0);
rawPacketLen = tempPowerAmpBoardLowByte.size(); rawPacketLen = tempPowerAmpBoardLowByte.size();
rememberCommandId = SYRLINKS::TEMP_POWER_AMPLIFIER_LOW_BYTE; rememberCommandId = SYRLINKS::TEMP_POWER_AMPLIFIER_LOW_BYTE;
rawPacket = commandBuffer; rawPacket = commandBuffer;
return RETURN_OK; return RETURN_OK;
case (SYRLINKS::TEMP_BASEBAND_BOARD_HIGH_BYTE): case (SYRLINKS::TEMP_BASEBAND_BOARD_HIGH_BYTE):
tempBasebandBoardHighByte.copy(reinterpret_cast<char*>(commandBuffer), tempBasebandBoardHighByte.size(), tempBasebandBoardHighByte.copy(reinterpret_cast<char*>(commandBuffer),
0); tempBasebandBoardHighByte.size(), 0);
rawPacketLen = tempBasebandBoardHighByte.size(); rawPacketLen = tempBasebandBoardHighByte.size();
rememberCommandId = SYRLINKS::TEMP_BASEBAND_BOARD_HIGH_BYTE; rememberCommandId = SYRLINKS::TEMP_BASEBAND_BOARD_HIGH_BYTE;
rawPacket = commandBuffer; rawPacket = commandBuffer;
return RETURN_OK; return RETURN_OK;
case (SYRLINKS::TEMP_BASEBAND_BOARD_LOW_BYTE): case (SYRLINKS::TEMP_BASEBAND_BOARD_LOW_BYTE):
tempBasebandBoardLowByte.copy(reinterpret_cast<char*>(commandBuffer), tempBasebandBoardLowByte.size(), 0); tempBasebandBoardLowByte.copy(reinterpret_cast<char*>(commandBuffer),
tempBasebandBoardLowByte.size(), 0);
rawPacketLen = tempBasebandBoardLowByte.size(); rawPacketLen = tempBasebandBoardLowByte.size();
rememberCommandId = SYRLINKS::TEMP_BASEBAND_BOARD_LOW_BYTE; rememberCommandId = SYRLINKS::TEMP_BASEBAND_BOARD_LOW_BYTE;
rawPacket = commandBuffer; rawPacket = commandBuffer;

View File

@ -1,10 +1,11 @@
#ifndef MISSION_DEVICES_SYRLINKSHKHANDLER_H_ #ifndef MISSION_DEVICES_SYRLINKSHKHANDLER_H_
#define MISSION_DEVICES_SYRLINKSHKHANDLER_H_ #define MISSION_DEVICES_SYRLINKSHKHANDLER_H_
#include <string.h>
#include "devices/powerSwitcherList.h" #include "devices/powerSwitcherList.h"
#include "fsfw/devicehandlers/DeviceHandlerBase.h" #include "fsfw/devicehandlers/DeviceHandlerBase.h"
#include "mission/devices/devicedefinitions/SyrlinksDefinitions.h" #include "mission/devices/devicedefinitions/SyrlinksDefinitions.h"
#include <string.h>
/** /**
* @brief This is the device handler for the syrlinks transceiver. It handles the command * @brief This is the device handler for the syrlinks transceiver. It handles the command

View File

@ -245,7 +245,7 @@ void AcsBoardAssembly::selectGpsInDualMode(duallane::Submodes side) {
void AcsBoardAssembly::gpioHandler(gpioId_t gpio, bool high, std::string error) { void AcsBoardAssembly::gpioHandler(gpioId_t gpio, bool high, std::string error) {
ReturnValue_t result = RETURN_OK; ReturnValue_t result = RETURN_OK;
if(high) { if (high) {
result = gpioIF->pullHigh(gpio); result = gpioIF->pullHigh(gpio);
} else { } else {
result = gpioIF->pullLow(gpio); result = gpioIF->pullLow(gpio);