From f271da3b0458d92eb2cfeb086326226588fb989e Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 22 Mar 2023 19:47:28 +0100 Subject: [PATCH 1/3] forgot to delete this --- mission/tmtc/CcsdsIpCoreHandler.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/mission/tmtc/CcsdsIpCoreHandler.cpp b/mission/tmtc/CcsdsIpCoreHandler.cpp index 85dfbbba..20600fdf 100644 --- a/mission/tmtc/CcsdsIpCoreHandler.cpp +++ b/mission/tmtc/CcsdsIpCoreHandler.cpp @@ -266,7 +266,6 @@ void CcsdsIpCoreHandler::startTransition(Mode_t mode, Submode_t submode) { void CcsdsIpCoreHandler::announceMode(bool recursive) { triggerEvent(MODE_INFO, mode, submode); } void CcsdsIpCoreHandler::disableTransmit() { - ptmeConfig.enableBatPriorityBit(false); #ifndef TE0720_1CFA gpioIF->pullLow(ptmeGpios.enableTxClock); gpioIF->pullLow(ptmeGpios.enableTxData); From 16441678c94c06b03be515f606b143d3330cff89 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 22 Mar 2023 19:49:14 +0100 Subject: [PATCH 2/3] CCSDS IP core handler --- mission/tmtc/CcsdsIpCoreHandler.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mission/tmtc/CcsdsIpCoreHandler.cpp b/mission/tmtc/CcsdsIpCoreHandler.cpp index 20600fdf..c0cea5b3 100644 --- a/mission/tmtc/CcsdsIpCoreHandler.cpp +++ b/mission/tmtc/CcsdsIpCoreHandler.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include "eive/definitions.h" #include "fsfw/ipc/QueueFactory.h" @@ -295,6 +296,7 @@ void CcsdsIpCoreHandler::enablePrioritySelectMode() { ptmeConfig.enableBatPriorityBit(true); // Reset the PTME gpioIF->pullLow(ptmeGpios.ptmeResetn); + usleep(10); gpioIF->pullHigh(ptmeGpios.ptmeResetn); } @@ -302,6 +304,7 @@ void CcsdsIpCoreHandler::disablePrioritySelectMode() { ptmeConfig.enableBatPriorityBit(false); // Reset the PTME gpioIF->pullLow(ptmeGpios.ptmeResetn); + usleep(10); gpioIF->pullHigh(ptmeGpios.ptmeResetn); } From 7e675ba35d81de77a9f619d31f98bc36d4bcadfe Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 22 Mar 2023 19:54:04 +0100 Subject: [PATCH 3/3] some additional tweaks --- bsp_q7s/core/ObjectFactory.cpp | 5 ++++- mission/tmtc/CcsdsIpCoreHandler.cpp | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 112b7995..e6ff27fb 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -748,10 +748,13 @@ ReturnValue_t ObjectFactory::createCcsdsComponents(CcsdsComponentArgs& args) { gpioCookiePtmeIp->addGpio(gpioIds::VC3_PAPB_BUSY, gpio); gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_EMPTY_SIGNAL_VC3, "PAPB VC3"); gpioCookiePtmeIp->addGpio(gpioIds::VC3_PAPB_EMPTY, gpio); + // Initialise to low and then pull high to do a PTME reset, which puts the PTME in reset + // state. It will be put out of reset in the CCSDS handler initialize function. gpio = new GpiodRegularByLineName(q7s::gpioNames::PTME_RESETN, "PTME RESETN", - gpio::Direction::OUT, gpio::Levels::HIGH); + gpio::Direction::OUT, gpio::Levels::LOW); gpioCookiePtmeIp->addGpio(gpioIds::PTME_RESETN, gpio); gpioChecker(args.gpioComIF.addGpios(gpioCookiePtmeIp), "PTME PAPB VCs"); + // Creating virtual channel interfaces VirtualChannelIF* vc0 = new PapbVcInterface(&args.gpioComIF, gpioIds::VC0_PAPB_BUSY, gpioIds::VC0_PAPB_EMPTY, diff --git a/mission/tmtc/CcsdsIpCoreHandler.cpp b/mission/tmtc/CcsdsIpCoreHandler.cpp index c0cea5b3..c9493f47 100644 --- a/mission/tmtc/CcsdsIpCoreHandler.cpp +++ b/mission/tmtc/CcsdsIpCoreHandler.cpp @@ -39,7 +39,7 @@ ReturnValue_t CcsdsIpCoreHandler::performOperation(uint8_t operationCode) { } ReturnValue_t CcsdsIpCoreHandler::initialize() { - ReturnValue_t result = returnvalue::OK; + AcceptsTelecommandsIF* tcDistributor = ObjectManager::instance()->get(tcDestination); if (tcDistributor == nullptr) { @@ -51,7 +51,7 @@ ReturnValue_t CcsdsIpCoreHandler::initialize() { tcDistributorQueueId = tcDistributor->getRequestQueue(); - result = parameterHelper.initialize(); + ReturnValue_t result = parameterHelper.initialize(); if (result != returnvalue::OK) { return result; } @@ -71,6 +71,7 @@ ReturnValue_t CcsdsIpCoreHandler::initialize() { return ObjectManagerIF::CHILD_INIT_FAILED; } + // This also pulls the PTME out of reset state. if (batPriorityParam == 0) { disablePrioritySelectMode(); } else {