From 8832d06d03060ef0d211834a7de82759cac5a3d5 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Thu, 5 May 2022 08:55:45 +0200 Subject: [PATCH] improvements for mram dump --- bsp_te0720_1cfa/ObjectFactory.cpp | 3 +++ linux/devices/ploc/PlocMemoryDumper.cpp | 3 +-- linux/devices/ploc/PlocSupervisorHandler.cpp | 16 +++++++++++++--- linux/devices/ploc/PlocSupervisorHandler.h | 4 ++-- .../pollingsequence/pollingSequenceFactory.cpp | 2 -- 5 files changed, 19 insertions(+), 9 deletions(-) diff --git a/bsp_te0720_1cfa/ObjectFactory.cpp b/bsp_te0720_1cfa/ObjectFactory.cpp index e2df1a26..c09b818e 100644 --- a/bsp_te0720_1cfa/ObjectFactory.cpp +++ b/bsp_te0720_1cfa/ObjectFactory.cpp @@ -17,6 +17,7 @@ #include "fsfw_hal/linux/uart/UartCookie.h" #include "linux/devices/ploc/PlocMPSoCHandler.h" #include "linux/devices/ploc/PlocMPSoCHelper.h" +#include "linux/devices/ploc/PlocMemoryDumper.h" #include "linux/devices/ploc/PlocSupervisorHandler.h" #include "linux/devices/ploc/PlocSupvHelper.h" #include "mission/core/GenericFactory.h" @@ -70,6 +71,8 @@ new UartComIF(objects::UART_COM_IF); supervisorCookie, Gpio(gpioIds::ENABLE_SUPV_UART, supvGpioIF), pcdu::PDU1_CH6_PLOC_12V, supvHelper); plocSupervisor->setStartUpImmediately(); + + new PlocMemoryDumper(objects::PLOC_MEMORY_DUMPER); #endif #if OBSW_TEST_LIBGPIOD == 1 diff --git a/linux/devices/ploc/PlocMemoryDumper.cpp b/linux/devices/ploc/PlocMemoryDumper.cpp index 871c69a8..a771e0fe 100644 --- a/linux/devices/ploc/PlocMemoryDumper.cpp +++ b/linux/devices/ploc/PlocMemoryDumper.cpp @@ -149,10 +149,9 @@ void PlocMemoryDumper::completionFailedReceived(ActionId_t actionId, ReturnValue case (supv::FIRST_MRAM_DUMP): case (supv::CONSECUTIVE_MRAM_DUMP): triggerEvent(MRAM_DUMP_FAILED, mram.lastStartAddress); + pendingCommand = NONE; break; default: - sif::debug << "PlocMemoryDumper::completionFailedReceived: Invalid pending command " - << std::endl; break; } state = State::IDLE; diff --git a/linux/devices/ploc/PlocSupervisorHandler.cpp b/linux/devices/ploc/PlocSupervisorHandler.cpp index 460b1840..3ea11f91 100644 --- a/linux/devices/ploc/PlocSupervisorHandler.cpp +++ b/linux/devices/ploc/PlocSupervisorHandler.cpp @@ -1549,6 +1549,16 @@ void PlocSupervisorHandler::disableAllReplies() { iter = deviceReplyMap.find(supv::GET_HK_REPORT); info = &(iter->second); info->delayCycles = 0; + info->active = false; + info->command = deviceCommandMap.end(); + break; + } + case supv::FIRST_MRAM_DUMP: + case supv::CONSECUTIVE_MRAM_DUMP: { + iter = deviceReplyMap.find(commandId); + info = &(iter->second); + info->delayCycles = 0; + info->active = false; info->command = deviceCommandMap.end(); break; } @@ -1761,12 +1771,12 @@ ReturnValue_t PlocSupervisorHandler::createMramDumpFile() { #endif /* BOARD_TE0720 == 0 */ // Check if path to PLOC directory exists - if (not std::filesystem::exists(std::string(currentMountPrefix + "/" + plocFilePath))) { - sif::warning << "PlocSupervisorHandler::createMramDumpFile: Ploc path does not exist" + if (not std::filesystem::exists(std::string(currentMountPrefix + "/" + supervisorFilePath))) { + sif::warning << "PlocSupervisorHandler::createMramDumpFile: Supervisor path does not exist" << std::endl; return SupvReturnValuesIF::PATH_DOES_NOT_EXIST; } - activeMramFile = currentMountPrefix + "/" + plocFilePath + "/" + filename; + activeMramFile = currentMountPrefix + "/" + supervisorFilePath + "/" + filename; // Create new file std::ofstream file(activeMramFile, std::ios_base::out); file.close(); diff --git a/linux/devices/ploc/PlocSupervisorHandler.h b/linux/devices/ploc/PlocSupervisorHandler.h index 80f36b5d..625e2810 100644 --- a/linux/devices/ploc/PlocSupervisorHandler.h +++ b/linux/devices/ploc/PlocSupervisorHandler.h @@ -137,8 +137,8 @@ class PlocSupervisorHandler : public DeviceHandlerBase { SdCardManager* sdcMan = nullptr; #endif /* BOARD_TE0720 == 0 */ - // Path to PLOC specific files on SD card - std::string plocFilePath = "ploc"; + // Path to supervisor specific files on SD card + std::string supervisorFilePath = "ploc/supervisor"; std::string activeMramFile; // Setting this variable to true will enable direct downlink of MRAM packets diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp index 4a15e197..4b0263d4 100644 --- a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp @@ -464,10 +464,8 @@ ReturnValue_t pst::pstUart(FixedTimeslotTaskIF *thisSequence) { thisSequence->addSlot(objects::PLOC_MPSOC_HANDLER, length * 0.8, DeviceHandlerIF::GET_READ); #endif -#ifdef XIPHOS_Q7S thisSequence->addSlot(objects::PLOC_MEMORY_DUMPER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); -#endif #if OBSW_ADD_PLOC_SUPERVISOR == 1 thisSequence->addSlot(objects::PLOC_SUPERVISOR_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION);