From 6cd4f6cfe3cae85854b0b1535f977c2e22938f6f Mon Sep 17 00:00:00 2001 From: "Jakob.Meier" <–meierj@irs.uni-stuttgart.de> Date: Thu, 29 Jul 2021 09:21:33 +0200 Subject: [PATCH] ploc supervisor mram dump --- mission/devices/PlocSupervisorHandler.cpp | 16 ++++++++++++++++ mission/devices/PlocSupervisorHandler.h | 1 + tmtc | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/mission/devices/PlocSupervisorHandler.cpp b/mission/devices/PlocSupervisorHandler.cpp index a86993b0..cfb9ef3a 100644 --- a/mission/devices/PlocSupervisorHandler.cpp +++ b/mission/devices/PlocSupervisorHandler.cpp @@ -194,6 +194,11 @@ ReturnValue_t PlocSupervisorHandler::buildCommandFromCommand( prepareWipeMramCmd(commandData); result = RETURN_OK; break; + } + case(PLOC_SPV::DUMP_MRAM): { + prepareDumpMramCmd(commandData); + result = RETURN_OK; + break; } default: sif::debug << "PlocSupervisorHandler::buildCommandFromCommand: Command not implemented" @@ -242,6 +247,7 @@ void PlocSupervisorHandler::fillCommandAndReplyMap() { this->insertInCommandMap(PLOC_SPV::SELECT_NVM); this->insertInCommandMap(PLOC_SPV::RUN_AUTO_EM_TESTS); this->insertInCommandMap(PLOC_SPV::WIPE_MRAM); + this->insertInCommandMap(PLOC_SPV::DUMP_MRAM); 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); @@ -1099,6 +1105,16 @@ void PlocSupervisorHandler::prepareWipeMramCmd(const uint8_t* commandData) { packetToOutBuffer(packet.getWholeData(), packet.getFullSize()); } +void PlocSupervisorHandler::prepareDumpMramCmd(const uint8_t* commandData) { + uint32_t start = 0; + uint32_t stop = 0; + size_t size = sizeof(start) + sizeof(stop); + SerializeAdapter::deSerialize(&start, &commandData, &size, SerializeIF::Endianness::BIG); + SerializeAdapter::deSerialize(&stop, &commandData, &size, SerializeIF::Endianness::BIG); + PLOC_SPV::MramCmd packet(start, stop, PLOC_SPV::MramCmd::MramAction::DUMP); + packetToOutBuffer(packet.getWholeData(), packet.getFullSize()); +} + void PlocSupervisorHandler::packetToOutBuffer(uint8_t* packetData, size_t fullSize) { memcpy(commandBuffer, packetData, fullSize); rawPacket = commandBuffer; diff --git a/mission/devices/PlocSupervisorHandler.h b/mission/devices/PlocSupervisorHandler.h index 723f8cfe..9736d1a2 100644 --- a/mission/devices/PlocSupervisorHandler.h +++ b/mission/devices/PlocSupervisorHandler.h @@ -237,6 +237,7 @@ private: void prepareSelectNvmCmd(const uint8_t* commandData); ReturnValue_t prepareRunAutoEmTest(const uint8_t* commandData); void prepareWipeMramCmd(const uint8_t* commandData); + void prepareDumpMramCmd(const uint8_t* commandData); /** diff --git a/tmtc b/tmtc index 6601233f..1b1f26ac 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 6601233f419fd395111c9f98043f3e687ee23dc3 +Subproject commit 1b1f26ac3a948a320a29a16083613ea29789a378