From 89b68940bede3cecdb3958dec149211fb454fd47 Mon Sep 17 00:00:00 2001 From: "Jakob.Meier" <–meierj@irs.uni-stuttgart.de> Date: Sun, 29 Aug 2021 07:31:34 +0200 Subject: [PATCH 1/2] ploc memory dumper wip --- bsp_q7s/devices/PlocMemoryDumper.cpp | 203 ++++++++++++++++++ bsp_q7s/devices/PlocMemoryDumper.h | 113 ++++++++++ .../PlocMemDumpDefinitions.h | 31 +++ .../PlocSupervisorDefinitions.h | 3 +- common/config/commonClassIds.h | 1 + common/config/commonSubsystemIds.h | 1 + 6 files changed, 351 insertions(+), 1 deletion(-) create mode 100644 bsp_q7s/devices/PlocMemoryDumper.cpp create mode 100644 bsp_q7s/devices/PlocMemoryDumper.h create mode 100644 bsp_q7s/devices/devicedefinitions/PlocMemDumpDefinitions.h diff --git a/bsp_q7s/devices/PlocMemoryDumper.cpp b/bsp_q7s/devices/PlocMemoryDumper.cpp new file mode 100644 index 00000000..34d94186 --- /dev/null +++ b/bsp_q7s/devices/PlocMemoryDumper.cpp @@ -0,0 +1,203 @@ +#include "fsfw/ipc/QueueFactory.h" +#include "PlocMemoryDumper.h" + +#include +#include +#include + +PlocMemoryDumper::PlocMemoryDumper(object_id_t objectId) : + SystemObject(objectId), commandActionHelper(this), actionHelper(this, nullptr) { + commandQueue = QueueFactory::instance()->createMessageQueue(QUEUE_SIZE); +} + +PlocMemoryDumper::~PlocMemoryDumper() { +} + +ReturnValue_t PlocMemoryDumper::initialize() { + + ReturnValue_t result = SystemObject::initialize(); + if (result != HasReturnvaluesIF::RETURN_OK) { + return result; + } + result = commandActionHelper.initialize(); + if (result != HasReturnvaluesIF::RETURN_OK) { + return result; + } + result = actionHelper.initialize(commandQueue); + if (result != HasReturnvaluesIF::RETURN_OK) { + return result; + } + + return HasReturnvaluesIF::RETURN_OK; +} + +ReturnValue_t PlocMemoryDumper::performOperation(uint8_t operationCode) { + readCommandQueue(); + doStateMachine(); + return HasReturnvaluesIF::RETURN_OK; +} + +ReturnValue_t PlocMemoryDumper::executeAction(ActionId_t actionId, + MessageQueueId_t commandedBy, const uint8_t* data, size_t size) { + ReturnValue_t result = RETURN_FAILED; + + if (state != State::IDLE) { + return IS_BUSY; + } + + switch (actionId) { + case DUMP_MRAM: + SerializeAdapter::deSerialize(&mram.startAddress, &data, sizeof(mramStartAdress), + SerializeIF::Endianness::BIG); + SerializeAdapter::deSerialize(&mram.endAddress, &data, sizeof(mramStartAdress), + SerializeIF::Endianness::BIG); + if (mram.endAddress > MAX_MRAM_ADDRESS) { + return MRAM_ADDRESS_TOO_HIGH; + } + if (mram.endAddress <= mram.startAddress) { + return MRAM_INVALID_ADDRESS_COMBINATION; + } + state = State::COMMAND_FIRST_MRAM_DUMP; + break; + default: + sif::warning << "PlocMemoryDumper::executeAction: Received command with invalid action id" + << std::endl; + return INVALID_ACTION_ID; + } + + return RETURN_OK; +} + +MessageQueueId_t PlocMemoryDumper::getCommandQueue() const { + return commandQueue->getId(); +} + +MessageQueueIF* PlocMemoryDumper::getCommandQueuePtr() { + return commandQueue; +} + +void PlocMemoryDumper::readCommandQueue() { + CommandMessage message; + ReturnValue_t result; + + for (result = commandQueue->receiveMessage(&message); result == HasReturnvaluesIF::RETURN_OK; + result = commandQueue->receiveMessage(&message)) { + if (result != RETURN_OK) { + continue; + } + result = actionHelper.handleActionMessage(&message); + if (result == HasReturnvaluesIF::RETURN_OK) { + continue; + } + + result = commandActionHelper.handleReply(&message); + if (result == HasReturnvaluesIF::RETURN_OK) { + continue; + } + + sif::debug << "PlocMemoryDumper::readCommandQueue: Received message with invalid format" + << std::endl; + } +} + +void PlocMemoryDumper::doStateMachine() { + switch (state) { + case State::IDLE: + break; + case State::COMMAND_FIRST_MRAM_DUMP: + commandNextMramDump(PLOC_SPV::FIRST_MRAM_DUMP); + break; + case State::COMMAND_CONSECUTIVE_MRAM_DUMP: + commandNextMramDump(PLOC_SPV::CONSECUTIVE_MRAM_DUMP); + break; + case State::EXECUTING_MRAM_DUMP: + break; + default: + sif::debug << "PlocMemoryDumper::doStateMachine: Invalid state" << std::endl; + break; + } +} + +void PlocMemoryDumper::stepSuccessfulReceived(ActionId_t actionId, + uint8_t step) { +} + +void PlocMemoryDumper::stepFailedReceived(ActionId_t actionId, uint8_t step, + ReturnValue_t returnCode) { +} + +void PlocMemoryDumper::dataReceived(ActionId_t actionId, const uint8_t* data, uint32_t size) { + +} + +void PlocMemoryDumper::completionSuccessfulReceived(ActionId_t actionId) { + switch (pendingCommand) { + case (PLOC_SPV::FIRST_MRAM_DUMP): + case (PLOC_SPV::CONSECUTIVE_MRAM_DUMP): + if (mram.endAddress == mram.startAddress) { + triggerEvent(MRAM_DUMP_FINISHED); + state = State::IDLE; + } + else { + state = State::COMMAND_MRAM_DUMP; + } + break; + default: + sif::debug << "PlocMemoryDumper::completionSuccessfulReceived: Invalid pending command" + << std::endl; + state = State::IDLE; + break; + } +} + +void PlocMemoryDumper::completionFailedReceived(ActionId_t actionId, + ReturnValue_t returnCode) { + switch(pendingCommand) { + case(PLOC_SPV::FIRST_MRAM_DUMP): + case(PLOC_SPV::CONSECUTIVE_MRAM_DUMP): + triggerEvent(MRAM_DUMP_FAILED, mram.lastStartAddress); + break; + default: + sif::debug << "PlocMemoryDumper::completionFailedReceived: Invalid pending command " + << std::endl; + break; + } + state = State::IDLE; +} + +void PlocMemoryDumper::commandNextMramDump(ActionId_t dumpCommand) { + ReturnValue_t result = RETURN_OK; + + uint32_t tempStartAddress = 0; + uint32_t tempEndAddress = 0; + + if (mram.endAddress - mram.startAddress > MAX_MRAM_DUMP_SIZE) { + tempStartAddress = mram.startAddress; + tempEndAddress = mram.startAddress + MAX_MRAM_DUMP_SIZE; + mram.startAddress += MAX_MRAM_DUMP_SIZE; + mram.lastStartAddress = tempStartAddress; + } + else { + tempStartAddress = mram.startAddress; + tempEndAddress = mram.endAddress; + mram.startAddress = mram.endAddress; + } + + MemoryParams params(tempStartAddress, tempEndAddress); + + result = commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, + dumpCommand, ¶ms); + if (result != RETURN_OK) { + sif::warning << "PlocMemoryDumper::commandNextMramDump: Failed to send mram dump command " + << "with start address " << tempStartAddress << " and end address " + << tempEndAddress << std::endl; + triggerEvent(SEND_MRAM_DUMP_FAILED, result, tempStartAddress); + state = State::IDLE; + pendingCommand = NONE; + return; + } + state = State::EXECUTING_MRAM_DUMP; + pendingCommand = dumpCommand; + return; +} + diff --git a/bsp_q7s/devices/PlocMemoryDumper.h b/bsp_q7s/devices/PlocMemoryDumper.h new file mode 100644 index 00000000..ef3a9212 --- /dev/null +++ b/bsp_q7s/devices/PlocMemoryDumper.h @@ -0,0 +1,113 @@ +#ifndef MISSION_DEVICES_PLOCMEMORYDUMPER_H_ +#define MISSION_DEVICES_PLOCMEMORYDUMPER_H_ + +#include +#include +#include "OBSWConfig.h" +#include "fsfw/action/CommandActionHelper.h" +#include "fsfw/action/ActionHelper.h" +#include "fsfw/action/HasActionsIF.h" +#include "fsfw/action/CommandsActionsIF.h" +#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/tasks/ExecutableObjectIF.h" +#include "fsfw/objectmanager/SystemObject.h" +#include "bsp_q7s/memory/SdCardManager.h" +#include "linux/fsfwconfig/objects/systemObjectList.h" +#include "fsfw/tmtcpacket/SpacePacket.h" + + +/** + * @brief Because the buffer of the linux tty driver is limited to 2 x 65535 bytes, this class is + * created to perform large dumps of PLOC memories. + * + * @details Currently the PLOC supervisor only implements the functionality to dump the MRAM. + * + * @author J. Meier + */ +class PlocMemoryDumper : public SystemObject, + public HasActionsIF, + public ExecutableObjectIF, + public HasReturnvaluesIF, + public CommandsActionsIF { +public: + + static const ActionId_t NONE = 0; + static const ActionId_t DUMP_MRAM = 1; + + PlocMemoryDumper(object_id_t objectId); + virtual ~PlocMemoryDumper(); + + ReturnValue_t performOperation(uint8_t operationCode = 0) override; + ReturnValue_t executeAction(ActionId_t actionId, MessageQueueId_t commandedBy, + const uint8_t* data, size_t size); + MessageQueueId_t getCommandQueue() const; + ReturnValue_t initialize() override; + MessageQueueIF* getCommandQueuePtr() override; + void stepSuccessfulReceived(ActionId_t actionId, uint8_t step) override; + void stepFailedReceived(ActionId_t actionId, uint8_t step, ReturnValue_t returnCode) override; + void dataReceived(ActionId_t actionId, const uint8_t* data, uint32_t size) override; + void completionSuccessfulReceived(ActionId_t actionId) override; + void completionFailedReceived(ActionId_t actionId, ReturnValue_t returnCode) override; + +private: + + static const uint8_t INTERFACE_ID = CLASS_ID::PLOC_MEMORY_DUMPER; + + //! [EXPORT] : [COMMENT] The capacity of the MRAM amounts to 512 kB. Thus the maximum address must not be higher than 0x7d000. + static const ReturnValue_t MRAM_ADDRESS_TOO_HIGH = MAKE_RETURN_CODE(0xA0); + //! [EXPORT] : [COMMENT] The specified end address is lower than the start address + static const ReturnValue_t MRAM_INVALID_ADDRESS_COMBINATION = MAKE_RETURN_CODE(0xA1); + + static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::PLOC_MEMORY_DUMPER; + + //! [EXPORT] : [COMMENT] Failed to send mram dump command to supervisor handler + //! P1: Return value of commandAction function + //! P2: Start address of MRAM to dump with this command + static const Event SEND_MRAM_DUMP_FAILED = MAKE_EVENT(0, severity::LOW); + //! [EXPORT] : [COMMENT] Received completion failure report form PLOC supervisor handler + //! P1: MRAM start address of failing dump command + static const Event MRAM_DUMP_FAILED = MAKE_EVENT(1, severity::LOW); + //! [EXPORT] : [COMMENT] MRAM dump finished successfully + static const Event MRAM_DUMP_FINISHED = MAKE_EVENT(2, severity::LOW); + + // Maximum size of mram dump which can be retrieved with one command + static const uint32_t MAX_MRAM_DUMP_SIZE = 100000; + static const uint32_t MAX_MRAM_ADDRESS = 0x7d000; + + MessageQueueIF* commandQueue = nullptr; + + CommandActionHelper commandActionHelper; + + ActionHelper actionHelper; + + enum class State: uint8_t { + IDLE, + COMMAND_FIRST_MRAM_DUMP, + COMMAND_CONSECUTIVE_MRAM_DUMP, + EXECUTING_MRAM_DUMP + }; + + State state = State::IDLE; + + ActionId_t pendingCommand = NONE; + + typedef struct MemoryRange { + // Stores the start address of the next memory range to dump + uint32_t startAddress; + uint32_t endAddress; + // Stores the start address of the last sent dump command + uint32_t lastStartAddress; + } MemoryRange_t; + + MemoryRange_t mram = {0, 0, 0}; + + void readCommandQueue(); + void doStateMachine(); + + /** + * @brief Sends the next mram dump command to the PLOC supervisor handler. + */ + void commandNextMramDump(); +}; + +#endif /* MISSION_DEVICES_PLOCMEMORYDUMPER_H_ */ diff --git a/bsp_q7s/devices/devicedefinitions/PlocMemDumpDefinitions.h b/bsp_q7s/devices/devicedefinitions/PlocMemDumpDefinitions.h new file mode 100644 index 00000000..e221ac1e --- /dev/null +++ b/bsp_q7s/devices/devicedefinitions/PlocMemDumpDefinitions.h @@ -0,0 +1,31 @@ +#ifndef BSP_Q7S_DEVICES_DEVICEDEFINITIONS_PLOCMEMDUMPDEFINITIONS_H_ +#define BSP_Q7S_DEVICES_DEVICEDEFINITIONS_PLOCMEMDUMPDEFINITIONS_H_ + +class MemoryParams: public SerialLinkedListAdapter { +public: + + /** + * @brief Constructor + * @param startAddress Start of address range to dump + * @param endAddress End of address range to dump + */ + MemoryParams(uint32_t startAddress, uint32_t endAddress) : + startAddress(startAddress), endAddress(endAddress) { + setLinks(); + } +private: + + void setLinks() { + setStart(&startAddress); + startAddress.setNext(&endAddress); + } + + SerializeElement startAddress; + SerializeElement endAddress; + +}; + + + + +#endif /* BSP_Q7S_DEVICES_DEVICEDEFINITIONS_PLOCMEMDUMPDEFINITIONS_H_ */ diff --git a/bsp_q7s/devices/devicedefinitions/PlocSupervisorDefinitions.h b/bsp_q7s/devices/devicedefinitions/PlocSupervisorDefinitions.h index a28418e7..87cf0cb2 100644 --- a/bsp_q7s/devices/devicedefinitions/PlocSupervisorDefinitions.h +++ b/bsp_q7s/devices/devicedefinitions/PlocSupervisorDefinitions.h @@ -42,7 +42,7 @@ static const DeviceCommandId_t ENABLE_NVMS = 26; static const DeviceCommandId_t SELECT_NVM = 27; static const DeviceCommandId_t RUN_AUTO_EM_TESTS = 28; static const DeviceCommandId_t WIPE_MRAM = 29; -static const DeviceCommandId_t DUMP_MRAM = 30; +static const DeviceCommandId_t FIRST_MRAM_DUMP = 30; static const DeviceCommandId_t SET_DBG_VERBOSITY = 31; static const DeviceCommandId_t CAN_LOOPBACK_TEST = 32; static const DeviceCommandId_t PRINT_CPU_STATS = 33; @@ -55,6 +55,7 @@ static const DeviceCommandId_t UPDATE_IMAGE_DATA = 39; static const DeviceCommandId_t FACTORY_RESET_CLEAR_MIRROR = 40; static const DeviceCommandId_t FACTORY_RESET_CLEAR_CIRCULAR = 41; static const DeviceCommandId_t UPDATE_VERIFY = 42; +static const DeviceCommandId_t CONSECUTIVE_MRAM_DUMP = 41; /** Reply IDs */ static const DeviceCommandId_t ACK_REPORT = 50; diff --git a/common/config/commonClassIds.h b/common/config/commonClassIds.h index 8f751df1..793cb1ba 100644 --- a/common/config/commonClassIds.h +++ b/common/config/commonClassIds.h @@ -21,6 +21,7 @@ enum commonClassIds: uint8_t { CCSDS_IP_CORE_BRIDGE, //IPCI PLOC_UPDATER, //PLUD GOM_SPACE_HANDLER, //GOMS + PLOC_MEMORY_DUMPER, //PLMEMDUMP COMMON_CLASS_ID_END // [EXPORT] : [END] }; diff --git a/common/config/commonSubsystemIds.h b/common/config/commonSubsystemIds.h index ab87d119..58ebac66 100644 --- a/common/config/commonSubsystemIds.h +++ b/common/config/commonSubsystemIds.h @@ -18,6 +18,7 @@ enum: uint8_t { PLOC_SUPERVISOR_HANDLER = 115, FILE_SYSTEM = 116, PLOC_UPDATER = 117, + PLOC_MEMORY_DUMPER = 118, COMMON_SUBSYSTEM_ID_END }; } -- 2.43.0 From 0f7986444600d67e15b91abe2f9b154dd81d8d18 Mon Sep 17 00:00:00 2001 From: "Jakob.Meier" <–meierj@irs.uni-stuttgart.de> Date: Tue, 31 Aug 2021 11:20:21 +0200 Subject: [PATCH 2/2] ploc memory dumper complete --- bsp_q7s/core/InitMission.cpp | 8 -- bsp_q7s/core/ObjectFactory.cpp | 2 + bsp_q7s/devices/CMakeLists.txt | 1 + bsp_q7s/devices/PlocMemoryDumper.cpp | 17 +++-- bsp_q7s/devices/PlocMemoryDumper.h | 10 ++- bsp_q7s/devices/PlocSupervisorHandler.cpp | 73 ++++++++++++------- bsp_q7s/devices/PlocSupervisorHandler.h | 6 +- .../PlocMemDumpDefinitions.h | 2 + .../PlocSupervisorDefinitions.h | 2 +- common/config/commonObjects.h | 3 +- generators/bsp_q7s_events.csv | 24 +++--- generators/bsp_q7s_objects.csv | 9 ++- generators/events/event_parser.py | 2 +- generators/events/translateEvents.cpp | 16 +++- generators/objects/translateObjects.cpp | 31 ++++---- linux/fsfwconfig/events/translateEvents.cpp | 16 +++- linux/fsfwconfig/objects/translateObjects.cpp | 31 ++++---- .../pollingSequenceFactory.cpp | 7 ++ tmtc | 2 +- 19 files changed, 164 insertions(+), 98 deletions(-) diff --git a/bsp_q7s/core/InitMission.cpp b/bsp_q7s/core/InitMission.cpp index 0f4bc038..1b5f10fd 100644 --- a/bsp_q7s/core/InitMission.cpp +++ b/bsp_q7s/core/InitMission.cpp @@ -96,13 +96,6 @@ void initmission::initTasks() { initmission::printAddObjectError("UDP_POLLING", objects::TMTC_POLLING_TASK); } - PeriodicTaskIF* plocUpdaterTask = factory->createPeriodicTask( - "PLOC_UPDATER_TASK", 30, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.5, missedDeadlineFunc); - result = plocUpdaterTask->addComponent(objects::PLOC_UPDATER); - if(result != HasReturnvaluesIF::RETURN_OK) { - initmission::printAddObjectError("PLOC_UPDATER_TASK", objects::PLOC_UPDATER); - } - # if BOARD_TE0720 == 0 // FS task, task interval does not matter because it runs in permanent loop, priority low // because it is a non-essential background task @@ -151,7 +144,6 @@ void initmission::initTasks() { #if BOARD_TE0720 == 0 coreController->startTask(); #endif - plocUpdaterTask->startTask(); taskStarter(pstTasks, "PST task vector"); taskStarter(pusTasks, "PUS task vector"); diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 60206e8f..9f6f6cd4 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -14,6 +14,7 @@ #include "bsp_q7s/memory/FileSystemHandler.h" #include "bsp_q7s/devices/PlocSupervisorHandler.h" #include "bsp_q7s/devices/PlocUpdater.h" +#include "bsp_q7s/devices/PlocMemoryDumper.h" #include "linux/devices/HeaterHandler.h" #include "linux/devices/SolarArrayDeploymentHandler.h" @@ -180,6 +181,7 @@ void ObjectFactory::produce(void* args){ #endif /* OBSW_ADD_TEST_CODE == 1 */ new PlocUpdater(objects::PLOC_UPDATER); + new PlocMemoryDumper(objects::PLOC_MEMORY_DUMPER); } void ObjectFactory::createTmpComponents() { diff --git a/bsp_q7s/devices/CMakeLists.txt b/bsp_q7s/devices/CMakeLists.txt index 80e1b1e5..6347b5f8 100644 --- a/bsp_q7s/devices/CMakeLists.txt +++ b/bsp_q7s/devices/CMakeLists.txt @@ -1,4 +1,5 @@ target_sources(${TARGET_NAME} PRIVATE PlocSupervisorHandler.cpp PlocUpdater.cpp + PlocMemoryDumper.cpp ) \ No newline at end of file diff --git a/bsp_q7s/devices/PlocMemoryDumper.cpp b/bsp_q7s/devices/PlocMemoryDumper.cpp index 34d94186..cc4361bb 100644 --- a/bsp_q7s/devices/PlocMemoryDumper.cpp +++ b/bsp_q7s/devices/PlocMemoryDumper.cpp @@ -1,3 +1,4 @@ +#include #include "fsfw/ipc/QueueFactory.h" #include "PlocMemoryDumper.h" @@ -39,17 +40,17 @@ ReturnValue_t PlocMemoryDumper::performOperation(uint8_t operationCode) { ReturnValue_t PlocMemoryDumper::executeAction(ActionId_t actionId, MessageQueueId_t commandedBy, const uint8_t* data, size_t size) { - ReturnValue_t result = RETURN_FAILED; if (state != State::IDLE) { return IS_BUSY; } switch (actionId) { - case DUMP_MRAM: - SerializeAdapter::deSerialize(&mram.startAddress, &data, sizeof(mramStartAdress), + case DUMP_MRAM: { + size_t deserializeSize = sizeof(mram.startAddress) + sizeof(mram.endAddress); + SerializeAdapter::deSerialize(&mram.startAddress, &data, &deserializeSize, SerializeIF::Endianness::BIG); - SerializeAdapter::deSerialize(&mram.endAddress, &data, sizeof(mramStartAdress), + SerializeAdapter::deSerialize(&mram.endAddress, &data, &deserializeSize, SerializeIF::Endianness::BIG); if (mram.endAddress > MAX_MRAM_ADDRESS) { return MRAM_ADDRESS_TOO_HIGH; @@ -59,13 +60,15 @@ ReturnValue_t PlocMemoryDumper::executeAction(ActionId_t actionId, } state = State::COMMAND_FIRST_MRAM_DUMP; break; - default: + } + default: { sif::warning << "PlocMemoryDumper::executeAction: Received command with invalid action id" << std::endl; return INVALID_ACTION_ID; } + } - return RETURN_OK; + return EXECUTION_FINISHED; } MessageQueueId_t PlocMemoryDumper::getCommandQueue() const { @@ -139,7 +142,7 @@ void PlocMemoryDumper::completionSuccessfulReceived(ActionId_t actionId) { state = State::IDLE; } else { - state = State::COMMAND_MRAM_DUMP; + state = State::COMMAND_CONSECUTIVE_MRAM_DUMP; } break; default: diff --git a/bsp_q7s/devices/PlocMemoryDumper.h b/bsp_q7s/devices/PlocMemoryDumper.h index ef3a9212..72b031ae 100644 --- a/bsp_q7s/devices/PlocMemoryDumper.h +++ b/bsp_q7s/devices/PlocMemoryDumper.h @@ -51,6 +51,8 @@ public: private: + static const uint32_t QUEUE_SIZE = 10; + static const uint8_t INTERFACE_ID = CLASS_ID::PLOC_MEMORY_DUMPER; //! [EXPORT] : [COMMENT] The capacity of the MRAM amounts to 512 kB. Thus the maximum address must not be higher than 0x7d000. @@ -91,15 +93,15 @@ private: ActionId_t pendingCommand = NONE; - typedef struct MemoryRange { + typedef struct MemoryInfo { // Stores the start address of the next memory range to dump uint32_t startAddress; uint32_t endAddress; // Stores the start address of the last sent dump command uint32_t lastStartAddress; - } MemoryRange_t; + } MemoryInfo_t; - MemoryRange_t mram = {0, 0, 0}; + MemoryInfo_t mram = {0, 0, 0}; void readCommandQueue(); void doStateMachine(); @@ -107,7 +109,7 @@ private: /** * @brief Sends the next mram dump command to the PLOC supervisor handler. */ - void commandNextMramDump(); + void commandNextMramDump(ActionId_t dumpCommand); }; #endif /* MISSION_DEVICES_PLOCMEMORYDUMPER_H_ */ diff --git a/bsp_q7s/devices/PlocSupervisorHandler.cpp b/bsp_q7s/devices/PlocSupervisorHandler.cpp index f8566244..30ea9572 100644 --- a/bsp_q7s/devices/PlocSupervisorHandler.cpp +++ b/bsp_q7s/devices/PlocSupervisorHandler.cpp @@ -199,10 +199,10 @@ ReturnValue_t PlocSupervisorHandler::buildCommandFromCommand( result = prepareWipeMramCmd(commandData); break; } - case(PLOC_SPV::DUMP_MRAM): { + case(PLOC_SPV::FIRST_MRAM_DUMP): + case(PLOC_SPV::CONSECUTIVE_MRAM_DUMP): result = prepareDumpMramCmd(commandData); break; - } case(PLOC_SPV::PRINT_CPU_STATS): { preparePrintCpuStatsCmd(commandData); result = RETURN_OK; @@ -319,7 +319,8 @@ void PlocSupervisorHandler::fillCommandAndReplyMap() { this->insertInCommandMap(PLOC_SPV::FACTORY_RESET_CLEAR_MIRROR); this->insertInCommandMap(PLOC_SPV::FACTORY_RESET_CLEAR_CIRCULAR); this->insertInCommandMap(PLOC_SPV::CAN_LOOPBACK_TEST); - this->insertInCommandAndReplyMap(PLOC_SPV::DUMP_MRAM, 3); + this->insertInCommandAndReplyMap(PLOC_SPV::FIRST_MRAM_DUMP, 3); + this->insertInCommandAndReplyMap(PLOC_SPV::CONSECUTIVE_MRAM_DUMP, 3); this->insertInReplyMap(PLOC_SPV::ACK_REPORT, 3, nullptr, PLOC_SPV::SIZE_ACK_REPORT); this->insertInReplyMap(PLOC_SPV::EXE_REPORT, 3, nullptr, PLOC_SPV::SIZE_EXE_REPORT); this->insertInReplyMap(PLOC_SPV::HK_REPORT, 3, &hkset, PLOC_SPV::SIZE_HK_REPORT); @@ -332,8 +333,12 @@ void PlocSupervisorHandler::fillCommandAndReplyMap() { ReturnValue_t PlocSupervisorHandler::scanForReply(const uint8_t *start, size_t remainingSize, DeviceCommandId_t *foundId, size_t *foundLen) { - if (nextReplyId == PLOC_SPV::DUMP_MRAM) { - *foundId = PLOC_SPV::DUMP_MRAM; + if (nextReplyId == PLOC_SPV::FIRST_MRAM_DUMP) { + *foundId = PLOC_SPV::FIRST_MRAM_DUMP; + return parseMramPackets(start, remainingSize, foundLen); + } + else if (nextReplyId == PLOC_SPV::CONSECUTIVE_MRAM_DUMP) { + *foundId = PLOC_SPV::CONSECUTIVE_MRAM_DUMP; return parseMramPackets(start, remainingSize, foundLen); } @@ -402,10 +407,10 @@ ReturnValue_t PlocSupervisorHandler::interpretDeviceReply(DeviceCommandId_t id, result = handleLatchupStatusReport(packet); break; } - case (PLOC_SPV::DUMP_MRAM): { - result = handleMramDumpPacket(); + case (PLOC_SPV::FIRST_MRAM_DUMP): + case (PLOC_SPV::CONSECUTIVE_MRAM_DUMP): + result = handleMramDumpPacket(id); break; - } case (PLOC_SPV::EXE_REPORT): { result = handleExecutionReport(packet); break; @@ -511,13 +516,23 @@ ReturnValue_t PlocSupervisorHandler::enableReplyInReplyMap(DeviceCommandMap::ite } break; } - case PLOC_SPV::DUMP_MRAM: { + case PLOC_SPV::FIRST_MRAM_DUMP: { enabledReplies = 2; // expected replies will be increased in handleMramDumpPacket result = DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, - PLOC_SPV::DUMP_MRAM); + PLOC_SPV::FIRST_MRAM_DUMP); if (result != RETURN_OK) { sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id " - << PLOC_SPV::LATCHUP_REPORT << " not in replyMap" << std::endl; + << PLOC_SPV::FIRST_MRAM_DUMP << " not in replyMap" << std::endl; + } + break; + } + case PLOC_SPV::CONSECUTIVE_MRAM_DUMP: { + enabledReplies = 2; // expected replies will be increased in handleMramDumpPacket + result = DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, + PLOC_SPV::CONSECUTIVE_MRAM_DUMP); + if (result != RETURN_OK) { + sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id " + << PLOC_SPV::CONSECUTIVE_MRAM_DUMP << " not in replyMap" << std::endl; } break; } @@ -924,8 +939,11 @@ void PlocSupervisorHandler::setNextReplyId() { case PLOC_SPV::GET_LATCHUP_STATUS_REPORT: nextReplyId = PLOC_SPV::LATCHUP_REPORT; break; - case PLOC_SPV::DUMP_MRAM: - nextReplyId = PLOC_SPV::DUMP_MRAM; + case PLOC_SPV::FIRST_MRAM_DUMP: + nextReplyId = PLOC_SPV::FIRST_MRAM_DUMP; + break; + case PLOC_SPV::CONSECUTIVE_MRAM_DUMP: + nextReplyId = PLOC_SPV::CONSECUTIVE_MRAM_DUMP; break; default: /* If no telemetry is expected the next reply is always the execution report */ @@ -942,7 +960,8 @@ size_t PlocSupervisorHandler::getNextReplyLength(DeviceCommandId_t commandId){ return replyLen; } - if (nextReplyId == PLOC_SPV::DUMP_MRAM) { + if (nextReplyId == PLOC_SPV::FIRST_MRAM_DUMP + || nextReplyId == PLOC_SPV::CONSECUTIVE_MRAM_DUMP) { /** * Try to read 20 MRAM packets. If reply is larger, the packets will be read with the * next doSendRead call. The command will be as long active as the packet with the sequence @@ -1347,7 +1366,7 @@ ReturnValue_t PlocSupervisorHandler::parseMramPackets(const uint8_t *packet, siz return result; } -ReturnValue_t PlocSupervisorHandler::handleMramDumpPacket() { +ReturnValue_t PlocSupervisorHandler::handleMramDumpPacket(DeviceCommandId_t id) { ReturnValue_t result = RETURN_FAILED; @@ -1359,24 +1378,24 @@ ReturnValue_t PlocSupervisorHandler::handleMramDumpPacket() { sif::warning << "PlocSupervisorHandler::handleMramDumpPacket: CRC failure" << std::endl; return result; } - handleMramDumpFile(); + handleMramDumpFile(id); if (downlinkMramDump == true) { handleDeviceTM(spacePacketBuffer + PLOC_SPV::SPACE_PACKET_HEADER_LENGTH, packetLen - 1, - PLOC_SPV::DUMP_MRAM); + id); } packetInBuffer = false; receivedMramDumpPackets++; if (expectedMramDumpPackets == receivedMramDumpPackets) { nextReplyId = PLOC_SPV::EXE_REPORT; } - increaseExpectedMramReplies(); + increaseExpectedMramReplies(id); return RETURN_OK; } return result; } -void PlocSupervisorHandler::increaseExpectedMramReplies() { - DeviceReplyMap::iterator mramDumpIter = deviceReplyMap.find(PLOC_SPV::DUMP_MRAM); +void PlocSupervisorHandler::increaseExpectedMramReplies(DeviceCommandId_t id) { + DeviceReplyMap::iterator mramDumpIter = deviceReplyMap.find(id); DeviceReplyMap::iterator exeReportIter = deviceReplyMap.find(PLOC_SPV::EXE_REPORT); if (mramDumpIter == deviceReplyMap.end()) { sif::debug << "PlocSupervisorHandler::increaseExpectedMramReplies: Dump MRAM reply not " @@ -1432,15 +1451,17 @@ ReturnValue_t PlocSupervisorHandler::checkMramPacketApid() { return APERIODIC_REPLY; } -ReturnValue_t PlocSupervisorHandler::handleMramDumpFile() { +ReturnValue_t PlocSupervisorHandler::handleMramDumpFile(DeviceCommandId_t id) { ReturnValue_t result = RETURN_OK; uint16_t packetLen = readSpacePacketLength(spacePacketBuffer); uint8_t sequenceFlags = readSequenceFlags(spacePacketBuffer); - if (sequenceFlags == static_cast(PLOC_SPV::SequenceFlags::FIRST_PKT) - || (sequenceFlags == static_cast(PLOC_SPV::SequenceFlags::STANDALONE_PKT))) { - result = createMramDumpFile(); - if (result != RETURN_OK) { - return result; + if (id == PLOC_SPV::FIRST_MRAM_DUMP) { + if (sequenceFlags == static_cast(PLOC_SPV::SequenceFlags::FIRST_PKT) + || (sequenceFlags == static_cast(PLOC_SPV::SequenceFlags::STANDALONE_PKT))) { + result = createMramDumpFile(); + if (result != RETURN_OK) { + return result; + } } } if (not std::filesystem::exists(activeMramFile)) { diff --git a/bsp_q7s/devices/PlocSupervisorHandler.h b/bsp_q7s/devices/PlocSupervisorHandler.h index c0c09eae..f22c86b1 100644 --- a/bsp_q7s/devices/PlocSupervisorHandler.h +++ b/bsp_q7s/devices/PlocSupervisorHandler.h @@ -295,14 +295,14 @@ private: /** * @brief This function generates the Service 8 packets for the MRAM dump data. */ - ReturnValue_t handleMramDumpPacket(); + ReturnValue_t handleMramDumpPacket(DeviceCommandId_t id); /** * @brief With this function the number of expected replies following an MRAM dump command * will be increased. This is necessary to release the command in case not all replies * have been received. */ - void increaseExpectedMramReplies(); + void increaseExpectedMramReplies(DeviceCommandId_t id); /** * @brief Function checks if the packet written to the space packet buffer is really a @@ -314,7 +314,7 @@ private: * @brief Writes the data of the MRAM dump to a file. The file will be created when receiving * the first packet. */ - ReturnValue_t handleMramDumpFile(); + ReturnValue_t handleMramDumpFile(DeviceCommandId_t id); /** * @brief Extracts the length field of a spacePacket referenced by the spacePacket pointer. diff --git a/bsp_q7s/devices/devicedefinitions/PlocMemDumpDefinitions.h b/bsp_q7s/devices/devicedefinitions/PlocMemDumpDefinitions.h index e221ac1e..6e44cf35 100644 --- a/bsp_q7s/devices/devicedefinitions/PlocMemDumpDefinitions.h +++ b/bsp_q7s/devices/devicedefinitions/PlocMemDumpDefinitions.h @@ -1,6 +1,8 @@ #ifndef BSP_Q7S_DEVICES_DEVICEDEFINITIONS_PLOCMEMDUMPDEFINITIONS_H_ #define BSP_Q7S_DEVICES_DEVICEDEFINITIONS_PLOCMEMDUMPDEFINITIONS_H_ +#include + class MemoryParams: public SerialLinkedListAdapter { public: diff --git a/bsp_q7s/devices/devicedefinitions/PlocSupervisorDefinitions.h b/bsp_q7s/devices/devicedefinitions/PlocSupervisorDefinitions.h index 87cf0cb2..0235d281 100644 --- a/bsp_q7s/devices/devicedefinitions/PlocSupervisorDefinitions.h +++ b/bsp_q7s/devices/devicedefinitions/PlocSupervisorDefinitions.h @@ -55,7 +55,7 @@ static const DeviceCommandId_t UPDATE_IMAGE_DATA = 39; static const DeviceCommandId_t FACTORY_RESET_CLEAR_MIRROR = 40; static const DeviceCommandId_t FACTORY_RESET_CLEAR_CIRCULAR = 41; static const DeviceCommandId_t UPDATE_VERIFY = 42; -static const DeviceCommandId_t CONSECUTIVE_MRAM_DUMP = 41; +static const DeviceCommandId_t CONSECUTIVE_MRAM_DUMP = 43; /** Reply IDs */ static const DeviceCommandId_t ACK_REPORT = 50; diff --git a/common/config/commonObjects.h b/common/config/commonObjects.h index 6b987a32..e44e0a1a 100644 --- a/common/config/commonObjects.h +++ b/common/config/commonObjects.h @@ -82,7 +82,8 @@ enum commonObjects: uint32_t { START_TRACKER = 0x44130001, - PLOC_UPDATER = 0x44330000 + PLOC_UPDATER = 0x44330000, + PLOC_MEMORY_DUMPER = 0x44330001 }; } diff --git a/generators/bsp_q7s_events.csv b/generators/bsp_q7s_events.csv index 0174a9ee..a5bbcde4 100644 --- a/generators/bsp_q7s_events.csv +++ b/generators/bsp_q7s_events.csv @@ -90,13 +90,17 @@ 11207;SELF_TEST_COIL_CURRENT_FAILURE;LOW;Get self test result returns failure indicating that the coil current was outside of the expected range P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;C:\Users\jakob\Work\EIVE\Q7S\Software\eive_obsw/mission/devices/IMTQHandler.h 11208;INVALID_ERROR_BYTE;LOW;Received invalid error byte. This indicates an error of the communication link between IMTQ and OBC.;C:\Users\jakob\Work\EIVE\Q7S\Software\eive_obsw/mission/devices/IMTQHandler.h 11301;ERROR_STATE;HIGH;Reaction wheel signals an error state;C:\Users\jakob\Work\EIVE\Q7S\Software\eive_obsw/mission/devices/RwHandler.h -11501;SUPV_MEMORY_READ_RPT_CRC_FAILURE;LOW;PLOC supervisor crc failure in telemetry packet;C:\Users\jakob\Work\EIVE\Q7S\Software\eive_obsw/mission/devices/PlocSupervisorHandler.h -11502;SUPV_ACK_FAILURE;LOW;PLOC supervisor received acknowledgment failure report;C:\Users\jakob\Work\EIVE\Q7S\Software\eive_obsw/mission/devices/PlocSupervisorHandler.h -11503;SUPV_EXE_FAILURE;LOW;PLOC received execution failure report;C:\Users\jakob\Work\EIVE\Q7S\Software\eive_obsw/mission/devices/PlocSupervisorHandler.h -11504;SUPV_CRC_FAILURE_EVENT;LOW;PLOC supervisor reply has invalid crc;C:\Users\jakob\Work\EIVE\Q7S\Software\eive_obsw/mission/devices/PlocSupervisorHandler.h -11700;UPDATE_FILE_NOT_EXISTS;LOW;;C:\Users\jakob\Work\EIVE\Q7S\Software\eive_obsw/mission/devices/PlocUpdater.h -11701;ACTION_COMMANDING_FAILED;LOW;;C:\Users\jakob\Work\EIVE\Q7S\Software\eive_obsw/mission/devices/PlocUpdater.h -11702;UPDATE_AVAILABLE_FAILED;LOW;Supervisor handler replied action message indicating a command execution failure of the update available command;C:\Users\jakob\Work\EIVE\Q7S\Software\eive_obsw/mission/devices/PlocUpdater.h -11703;UPDATE_TRANSFER_FAILED;LOW;Supervisor handler failed to transfer an update space packet. P1: Parameter holds the number of update packets already sent.;C:\Users\jakob\Work\EIVE\Q7S\Software\eive_obsw/mission/devices/PlocUpdater.h -11704;UPDATE_VERIFY_FAILED;LOW;Supervisor failed to execute the update verify command.;C:\Users\jakob\Work\EIVE\Q7S\Software\eive_obsw/mission/devices/PlocUpdater.h -11705;UPDATE_FINISHED;INFO;MPSoC update successful completed;C:\Users\jakob\Work\EIVE\Q7S\Software\eive_obsw/mission/devices/PlocUpdater.h +11501;SUPV_MEMORY_READ_RPT_CRC_FAILURE;LOW;PLOC supervisor crc failure in telemetry packet;C:\Users\jakob\Work\EIVE\Q7S\Software\eive_obsw/bsp_q7s/devices/PlocSupervisorHandler.h +11502;SUPV_ACK_FAILURE;LOW;PLOC supervisor received acknowledgment failure report;C:\Users\jakob\Work\EIVE\Q7S\Software\eive_obsw/bsp_q7s/devices/PlocSupervisorHandler.h +11503;SUPV_EXE_FAILURE;LOW;PLOC received execution failure report;C:\Users\jakob\Work\EIVE\Q7S\Software\eive_obsw/bsp_q7s/devices/PlocSupervisorHandler.h +11504;SUPV_CRC_FAILURE_EVENT;LOW;PLOC supervisor reply has invalid crc;C:\Users\jakob\Work\EIVE\Q7S\Software\eive_obsw/bsp_q7s/devices/PlocSupervisorHandler.h +11600;SANITIZATION_FAILED;LOW;;C:\Users\jakob\Work\EIVE\Q7S\Software\eive_obsw/bsp_q7s/memory/SdCardManager.h +11700;UPDATE_FILE_NOT_EXISTS;LOW;;C:\Users\jakob\Work\EIVE\Q7S\Software\eive_obsw/bsp_q7s/devices/PlocUpdater.h +11701;ACTION_COMMANDING_FAILED;LOW;;C:\Users\jakob\Work\EIVE\Q7S\Software\eive_obsw/bsp_q7s/devices/PlocUpdater.h +11702;UPDATE_AVAILABLE_FAILED;LOW;Supervisor handler replied action message indicating a command execution failure of the update available command;C:\Users\jakob\Work\EIVE\Q7S\Software\eive_obsw/bsp_q7s/devices/PlocUpdater.h +11703;UPDATE_TRANSFER_FAILED;LOW;Supervisor handler failed to transfer an update space packet. P1: Parameter holds the number of update packets already sent (inclusive the failed packet);C:\Users\jakob\Work\EIVE\Q7S\Software\eive_obsw/bsp_q7s/devices/PlocUpdater.h +11704;UPDATE_VERIFY_FAILED;LOW;Supervisor failed to execute the update verify command.;C:\Users\jakob\Work\EIVE\Q7S\Software\eive_obsw/bsp_q7s/devices/PlocUpdater.h +11705;UPDATE_FINISHED;INFO;MPSoC update successful completed;C:\Users\jakob\Work\EIVE\Q7S\Software\eive_obsw/bsp_q7s/devices/PlocUpdater.h +11800;SEND_MRAM_DUMP_FAILED;LOW;;C:\Users\jakob\Work\EIVE\Q7S\Software\eive_obsw/bsp_q7s/devices/PlocMemoryDumper.h +11801;MRAM_DUMP_FAILED;LOW;Received completion failure report form PLOC supervisor handler P1: MRAM start address of failing dump command;C:\Users\jakob\Work\EIVE\Q7S\Software\eive_obsw/bsp_q7s/devices/PlocMemoryDumper.h +11802;MRAM_DUMP_FINISHED;LOW;MRAM dump finished successfully;C:\Users\jakob\Work\EIVE\Q7S\Software\eive_obsw/bsp_q7s/devices/PlocMemoryDumper.h diff --git a/generators/bsp_q7s_objects.csv b/generators/bsp_q7s_objects.csv index 84d3db3a..4930f7a0 100644 --- a/generators/bsp_q7s_objects.csv +++ b/generators/bsp_q7s_objects.csv @@ -2,10 +2,6 @@ 0x43000003;CORE_CONTROLLER 0x43100002;ACS_CONTROLLER 0x43400001;THERMAL_CONTROLLER -0x44120001;RW1 -0x44120002;RW2 -0x44120003;RW3 -0x44120004;RW4 0x44120006;MGM_0_LIS3_HANDLER 0x44120010;GYRO_0_ADIS_HANDLER 0x44120032;SUS_1 @@ -21,12 +17,16 @@ 0x44120042;SUS_11 0x44120043;SUS_12 0x44120044;SUS_13 +0x44120047;RW1 0x44120107;MGM_1_RM3100_HANDLER 0x44120111;GYRO_1_L3G_HANDLER +0x44120148;RW2 0x44120208;MGM_2_LIS3_HANDLER 0x44120212;GYRO_2_ADIS_HANDLER +0x44120249;RW3 0x44120309;MGM_3_RM3100_HANDLER 0x44120313;GYRO_3_L3G_HANDLER +0x44120350;RW4 0x44130001;START_TRACKER 0x44130045;GPS0_HANDLER 0x44130146;GPS1_HANDLER @@ -38,6 +38,7 @@ 0x44250003;ACU_HANDLER 0x443200A5;RAD_SENSOR 0x44330000;PLOC_UPDATER +0x44330001;PLOC_MEMORY_DUMPER 0x44330015;PLOC_MPSOC_HANDLER 0x44330016;PLOC_SUPERVISOR_HANDLER 0x444100A2;SOLAR_ARRAY_DEPL_HANDLER diff --git a/generators/events/event_parser.py b/generators/events/event_parser.py index 56cc076f..62b26af4 100644 --- a/generators/events/event_parser.py +++ b/generators/events/event_parser.py @@ -51,7 +51,7 @@ SUBSYSTEM_DEFINITION_DESTINATIONS = [ ] HEADER_DEFINITION_DESTINATIONS = [ f"{OBSW_ROOT_DIR}/mission/", f"{OBSW_ROOT_DIR}/fsfw/", f"{FSFW_CONFIG_ROOT}", - f"{OBSW_ROOT_DIR}/test/" + f"{OBSW_ROOT_DIR}/test/", f"{OBSW_ROOT_DIR}/bsp_q7s" ] diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index 1df1d949..9d817651 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 102 translations. + * @brief Auto-generated event translation file. Contains 106 translations. * @details - * Generated on: 2021-08-07 18:11:16 + * Generated on: 2021-08-31 10:50:10 */ #include "translateEvents.h" @@ -101,12 +101,16 @@ const char *SUPV_MEMORY_READ_RPT_CRC_FAILURE_STRING = "SUPV_MEMORY_READ_RPT_CRC_ const char *SUPV_ACK_FAILURE_STRING = "SUPV_ACK_FAILURE"; const char *SUPV_EXE_FAILURE_STRING = "SUPV_EXE_FAILURE"; const char *SUPV_CRC_FAILURE_EVENT_STRING = "SUPV_CRC_FAILURE_EVENT"; +const char *SANITIZATION_FAILED_STRING = "SANITIZATION_FAILED"; const char *UPDATE_FILE_NOT_EXISTS_STRING = "UPDATE_FILE_NOT_EXISTS"; const char *ACTION_COMMANDING_FAILED_STRING = "ACTION_COMMANDING_FAILED"; const char *UPDATE_AVAILABLE_FAILED_STRING = "UPDATE_AVAILABLE_FAILED"; const char *UPDATE_TRANSFER_FAILED_STRING = "UPDATE_TRANSFER_FAILED"; const char *UPDATE_VERIFY_FAILED_STRING = "UPDATE_VERIFY_FAILED"; const char *UPDATE_FINISHED_STRING = "UPDATE_FINISHED"; +const char *SEND_MRAM_DUMP_FAILED_STRING = "SEND_MRAM_DUMP_FAILED"; +const char *MRAM_DUMP_FAILED_STRING = "MRAM_DUMP_FAILED"; +const char *MRAM_DUMP_FINISHED_STRING = "MRAM_DUMP_FINISHED"; const char * translateEvents(Event event) { switch( (event & 0xffff) ) { @@ -302,6 +306,8 @@ const char * translateEvents(Event event) { return SUPV_EXE_FAILURE_STRING; case(11504): return SUPV_CRC_FAILURE_EVENT_STRING; + case(11600): + return SANITIZATION_FAILED_STRING; case(11700): return UPDATE_FILE_NOT_EXISTS_STRING; case(11701): @@ -314,6 +320,12 @@ const char * translateEvents(Event event) { return UPDATE_VERIFY_FAILED_STRING; case(11705): return UPDATE_FINISHED_STRING; + case(11800): + return SEND_MRAM_DUMP_FAILED_STRING; + case(11801): + return MRAM_DUMP_FAILED_STRING; + case(11802): + return MRAM_DUMP_FINISHED_STRING; default: return "UNKNOWN_EVENT"; } diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index e5cc5b67..23a232c8 100644 --- a/generators/objects/translateObjects.cpp +++ b/generators/objects/translateObjects.cpp @@ -1,8 +1,8 @@ /** * @brief Auto-generated object translation file. * @details - * Contains 104 translations. - * Generated on: 2021-08-07 18:08:35 + * Contains 105 translations. + * Generated on: 2021-08-31 10:31:24 */ #include "translateObjects.h" @@ -10,10 +10,6 @@ const char *P60DOCK_TEST_TASK_STRING = "P60DOCK_TEST_TASK"; const char *CORE_CONTROLLER_STRING = "CORE_CONTROLLER"; const char *ACS_CONTROLLER_STRING = "ACS_CONTROLLER"; const char *THERMAL_CONTROLLER_STRING = "THERMAL_CONTROLLER"; -const char *RW1_STRING = "RW1"; -const char *RW2_STRING = "RW2"; -const char *RW3_STRING = "RW3"; -const char *RW4_STRING = "RW4"; const char *MGM_0_LIS3_HANDLER_STRING = "MGM_0_LIS3_HANDLER"; const char *GYRO_0_ADIS_HANDLER_STRING = "GYRO_0_ADIS_HANDLER"; const char *SUS_1_STRING = "SUS_1"; @@ -29,12 +25,16 @@ const char *SUS_10_STRING = "SUS_10"; const char *SUS_11_STRING = "SUS_11"; const char *SUS_12_STRING = "SUS_12"; const char *SUS_13_STRING = "SUS_13"; +const char *RW1_STRING = "RW1"; const char *MGM_1_RM3100_HANDLER_STRING = "MGM_1_RM3100_HANDLER"; const char *GYRO_1_L3G_HANDLER_STRING = "GYRO_1_L3G_HANDLER"; +const char *RW2_STRING = "RW2"; const char *MGM_2_LIS3_HANDLER_STRING = "MGM_2_LIS3_HANDLER"; const char *GYRO_2_ADIS_HANDLER_STRING = "GYRO_2_ADIS_HANDLER"; +const char *RW3_STRING = "RW3"; const char *MGM_3_RM3100_HANDLER_STRING = "MGM_3_RM3100_HANDLER"; const char *GYRO_3_L3G_HANDLER_STRING = "GYRO_3_L3G_HANDLER"; +const char *RW4_STRING = "RW4"; const char *START_TRACKER_STRING = "START_TRACKER"; const char *GPS0_HANDLER_STRING = "GPS0_HANDLER"; const char *GPS1_HANDLER_STRING = "GPS1_HANDLER"; @@ -46,6 +46,7 @@ const char *PDU2_HANDLER_STRING = "PDU2_HANDLER"; const char *ACU_HANDLER_STRING = "ACU_HANDLER"; const char *RAD_SENSOR_STRING = "RAD_SENSOR"; const char *PLOC_UPDATER_STRING = "PLOC_UPDATER"; +const char *PLOC_MEMORY_DUMPER_STRING = "PLOC_MEMORY_DUMPER"; const char *PLOC_MPSOC_HANDLER_STRING = "PLOC_MPSOC_HANDLER"; const char *PLOC_SUPERVISOR_HANDLER_STRING = "PLOC_SUPERVISOR_HANDLER"; const char *SOLAR_ARRAY_DEPL_HANDLER_STRING = "SOLAR_ARRAY_DEPL_HANDLER"; @@ -121,14 +122,6 @@ const char* translateObject(object_id_t object) { return ACS_CONTROLLER_STRING; case 0x43400001: return THERMAL_CONTROLLER_STRING; - case 0x44120001: - return RW1_STRING; - case 0x44120002: - return RW2_STRING; - case 0x44120003: - return RW3_STRING; - case 0x44120004: - return RW4_STRING; case 0x44120006: return MGM_0_LIS3_HANDLER_STRING; case 0x44120010: @@ -159,18 +152,26 @@ const char* translateObject(object_id_t object) { return SUS_12_STRING; case 0x44120044: return SUS_13_STRING; + case 0x44120047: + return RW1_STRING; case 0x44120107: return MGM_1_RM3100_HANDLER_STRING; case 0x44120111: return GYRO_1_L3G_HANDLER_STRING; + case 0x44120148: + return RW2_STRING; case 0x44120208: return MGM_2_LIS3_HANDLER_STRING; case 0x44120212: return GYRO_2_ADIS_HANDLER_STRING; + case 0x44120249: + return RW3_STRING; case 0x44120309: return MGM_3_RM3100_HANDLER_STRING; case 0x44120313: return GYRO_3_L3G_HANDLER_STRING; + case 0x44120350: + return RW4_STRING; case 0x44130001: return START_TRACKER_STRING; case 0x44130045: @@ -193,6 +194,8 @@ const char* translateObject(object_id_t object) { return RAD_SENSOR_STRING; case 0x44330000: return PLOC_UPDATER_STRING; + case 0x44330001: + return PLOC_MEMORY_DUMPER_STRING; case 0x44330015: return PLOC_MPSOC_HANDLER_STRING; case 0x44330016: diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index 1df1d949..9d817651 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 102 translations. + * @brief Auto-generated event translation file. Contains 106 translations. * @details - * Generated on: 2021-08-07 18:11:16 + * Generated on: 2021-08-31 10:50:10 */ #include "translateEvents.h" @@ -101,12 +101,16 @@ const char *SUPV_MEMORY_READ_RPT_CRC_FAILURE_STRING = "SUPV_MEMORY_READ_RPT_CRC_ const char *SUPV_ACK_FAILURE_STRING = "SUPV_ACK_FAILURE"; const char *SUPV_EXE_FAILURE_STRING = "SUPV_EXE_FAILURE"; const char *SUPV_CRC_FAILURE_EVENT_STRING = "SUPV_CRC_FAILURE_EVENT"; +const char *SANITIZATION_FAILED_STRING = "SANITIZATION_FAILED"; const char *UPDATE_FILE_NOT_EXISTS_STRING = "UPDATE_FILE_NOT_EXISTS"; const char *ACTION_COMMANDING_FAILED_STRING = "ACTION_COMMANDING_FAILED"; const char *UPDATE_AVAILABLE_FAILED_STRING = "UPDATE_AVAILABLE_FAILED"; const char *UPDATE_TRANSFER_FAILED_STRING = "UPDATE_TRANSFER_FAILED"; const char *UPDATE_VERIFY_FAILED_STRING = "UPDATE_VERIFY_FAILED"; const char *UPDATE_FINISHED_STRING = "UPDATE_FINISHED"; +const char *SEND_MRAM_DUMP_FAILED_STRING = "SEND_MRAM_DUMP_FAILED"; +const char *MRAM_DUMP_FAILED_STRING = "MRAM_DUMP_FAILED"; +const char *MRAM_DUMP_FINISHED_STRING = "MRAM_DUMP_FINISHED"; const char * translateEvents(Event event) { switch( (event & 0xffff) ) { @@ -302,6 +306,8 @@ const char * translateEvents(Event event) { return SUPV_EXE_FAILURE_STRING; case(11504): return SUPV_CRC_FAILURE_EVENT_STRING; + case(11600): + return SANITIZATION_FAILED_STRING; case(11700): return UPDATE_FILE_NOT_EXISTS_STRING; case(11701): @@ -314,6 +320,12 @@ const char * translateEvents(Event event) { return UPDATE_VERIFY_FAILED_STRING; case(11705): return UPDATE_FINISHED_STRING; + case(11800): + return SEND_MRAM_DUMP_FAILED_STRING; + case(11801): + return MRAM_DUMP_FAILED_STRING; + case(11802): + return MRAM_DUMP_FINISHED_STRING; default: return "UNKNOWN_EVENT"; } diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index e5cc5b67..23a232c8 100644 --- a/linux/fsfwconfig/objects/translateObjects.cpp +++ b/linux/fsfwconfig/objects/translateObjects.cpp @@ -1,8 +1,8 @@ /** * @brief Auto-generated object translation file. * @details - * Contains 104 translations. - * Generated on: 2021-08-07 18:08:35 + * Contains 105 translations. + * Generated on: 2021-08-31 10:31:24 */ #include "translateObjects.h" @@ -10,10 +10,6 @@ const char *P60DOCK_TEST_TASK_STRING = "P60DOCK_TEST_TASK"; const char *CORE_CONTROLLER_STRING = "CORE_CONTROLLER"; const char *ACS_CONTROLLER_STRING = "ACS_CONTROLLER"; const char *THERMAL_CONTROLLER_STRING = "THERMAL_CONTROLLER"; -const char *RW1_STRING = "RW1"; -const char *RW2_STRING = "RW2"; -const char *RW3_STRING = "RW3"; -const char *RW4_STRING = "RW4"; const char *MGM_0_LIS3_HANDLER_STRING = "MGM_0_LIS3_HANDLER"; const char *GYRO_0_ADIS_HANDLER_STRING = "GYRO_0_ADIS_HANDLER"; const char *SUS_1_STRING = "SUS_1"; @@ -29,12 +25,16 @@ const char *SUS_10_STRING = "SUS_10"; const char *SUS_11_STRING = "SUS_11"; const char *SUS_12_STRING = "SUS_12"; const char *SUS_13_STRING = "SUS_13"; +const char *RW1_STRING = "RW1"; const char *MGM_1_RM3100_HANDLER_STRING = "MGM_1_RM3100_HANDLER"; const char *GYRO_1_L3G_HANDLER_STRING = "GYRO_1_L3G_HANDLER"; +const char *RW2_STRING = "RW2"; const char *MGM_2_LIS3_HANDLER_STRING = "MGM_2_LIS3_HANDLER"; const char *GYRO_2_ADIS_HANDLER_STRING = "GYRO_2_ADIS_HANDLER"; +const char *RW3_STRING = "RW3"; const char *MGM_3_RM3100_HANDLER_STRING = "MGM_3_RM3100_HANDLER"; const char *GYRO_3_L3G_HANDLER_STRING = "GYRO_3_L3G_HANDLER"; +const char *RW4_STRING = "RW4"; const char *START_TRACKER_STRING = "START_TRACKER"; const char *GPS0_HANDLER_STRING = "GPS0_HANDLER"; const char *GPS1_HANDLER_STRING = "GPS1_HANDLER"; @@ -46,6 +46,7 @@ const char *PDU2_HANDLER_STRING = "PDU2_HANDLER"; const char *ACU_HANDLER_STRING = "ACU_HANDLER"; const char *RAD_SENSOR_STRING = "RAD_SENSOR"; const char *PLOC_UPDATER_STRING = "PLOC_UPDATER"; +const char *PLOC_MEMORY_DUMPER_STRING = "PLOC_MEMORY_DUMPER"; const char *PLOC_MPSOC_HANDLER_STRING = "PLOC_MPSOC_HANDLER"; const char *PLOC_SUPERVISOR_HANDLER_STRING = "PLOC_SUPERVISOR_HANDLER"; const char *SOLAR_ARRAY_DEPL_HANDLER_STRING = "SOLAR_ARRAY_DEPL_HANDLER"; @@ -121,14 +122,6 @@ const char* translateObject(object_id_t object) { return ACS_CONTROLLER_STRING; case 0x43400001: return THERMAL_CONTROLLER_STRING; - case 0x44120001: - return RW1_STRING; - case 0x44120002: - return RW2_STRING; - case 0x44120003: - return RW3_STRING; - case 0x44120004: - return RW4_STRING; case 0x44120006: return MGM_0_LIS3_HANDLER_STRING; case 0x44120010: @@ -159,18 +152,26 @@ const char* translateObject(object_id_t object) { return SUS_12_STRING; case 0x44120044: return SUS_13_STRING; + case 0x44120047: + return RW1_STRING; case 0x44120107: return MGM_1_RM3100_HANDLER_STRING; case 0x44120111: return GYRO_1_L3G_HANDLER_STRING; + case 0x44120148: + return RW2_STRING; case 0x44120208: return MGM_2_LIS3_HANDLER_STRING; case 0x44120212: return GYRO_2_ADIS_HANDLER_STRING; + case 0x44120249: + return RW3_STRING; case 0x44120309: return MGM_3_RM3100_HANDLER_STRING; case 0x44120313: return GYRO_3_L3G_HANDLER_STRING; + case 0x44120350: + return RW4_STRING; case 0x44130001: return START_TRACKER_STRING; case 0x44130045: @@ -193,6 +194,8 @@ const char* translateObject(object_id_t object) { return RAD_SENSOR_STRING; case 0x44330000: return PLOC_UPDATER_STRING; + case 0x44330001: + return PLOC_MEMORY_DUMPER_STRING; case 0x44330015: return PLOC_MPSOC_HANDLER_STRING; case 0x44330016: diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp index 932fc845..6315d245 100644 --- a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp @@ -533,6 +533,9 @@ ReturnValue_t pst::pstUart(FixedTimeslotTaskIF *thisSequence) { DeviceHandlerIF::GET_READ); #endif + thisSequence->addSlot(objects::PLOC_UPDATER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::PLOC_MEMORY_DUMPER, length * 0, + DeviceHandlerIF::PERFORM_OPERATION); #if OBSW_ADD_PLOC_SUPERVISOR == 1 thisSequence->addSlot(objects::PLOC_SUPERVISOR_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); @@ -832,6 +835,10 @@ ReturnValue_t pst::pollingSequenceTE0720(FixedTimeslotTaskIF *thisSequence) { thisSequence->addSlot(objects::PLOC_SUPERVISOR_HANDLER, length * 0.8, DeviceHandlerIF::GET_READ); #endif + thisSequence->addSlot(objects::PLOC_UPDATER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::PLOC_MEMORY_DUMPER, length * 0, + DeviceHandlerIF::PERFORM_OPERATION); + if (thisSequence->checkSequence() != HasReturnvaluesIF::RETURN_OK) { sif::error << "Initialization of TE0720 PST failed" << std::endl; return HasReturnvaluesIF::RETURN_FAILED; diff --git a/tmtc b/tmtc index ce5596f5..9b176aeb 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit ce5596f5669b8df44df418da6adff123941a395d +Subproject commit 9b176aebfaba51f4d045881a125d42b123f4eeb3 -- 2.43.0