From 1fd5d065b67e5f3c197fadaa38d5819f85f7757a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 17 Mar 2023 14:51:00 +0100 Subject: [PATCH 1/9] set bat priority bit on transmitter enable --- linux/ipcore/AxiPtmeConfig.cpp | 16 ++++++++++++++++ linux/ipcore/AxiPtmeConfig.h | 5 ++++- linux/ipcore/PtmeConfig.cpp | 8 ++++++++ linux/ipcore/PtmeConfig.h | 2 ++ mission/tmtc/CcsdsIpCoreHandler.cpp | 20 +++++++++----------- mission/tmtc/CcsdsIpCoreHandler.h | 1 + tmtc | 2 +- 7 files changed, 41 insertions(+), 13 deletions(-) diff --git a/linux/ipcore/AxiPtmeConfig.cpp b/linux/ipcore/AxiPtmeConfig.cpp index ead3d691..043fd775 100644 --- a/linux/ipcore/AxiPtmeConfig.cpp +++ b/linux/ipcore/AxiPtmeConfig.cpp @@ -71,6 +71,22 @@ ReturnValue_t AxiPtmeConfig::disableTxclockInversion() { return returnvalue::OK; } +ReturnValue_t AxiPtmeConfig::enableBatPriorityBit() { + ReturnValue_t result = writeBit(COMMON_CONFIG_REG, true, BitPos::EN_BAT_PRIORITY); + if (result != returnvalue::OK) { + return result; + } + return returnvalue::OK; +} + +ReturnValue_t AxiPtmeConfig::disableBatPriorityBit() { + ReturnValue_t result = writeBit(COMMON_CONFIG_REG, false, BitPos::EN_BAT_PRIORITY); + if (result != returnvalue::OK) { + return result; + } + return returnvalue::OK; +} + ReturnValue_t AxiPtmeConfig::writeReg(uint32_t regOffset, uint32_t writeVal) { ReturnValue_t result = returnvalue::OK; result = mutex->lockMutex(timeoutType, mutexTimeout); diff --git a/linux/ipcore/AxiPtmeConfig.h b/linux/ipcore/AxiPtmeConfig.h index 6996988c..420e9a5a 100644 --- a/linux/ipcore/AxiPtmeConfig.h +++ b/linux/ipcore/AxiPtmeConfig.h @@ -54,6 +54,9 @@ class AxiPtmeConfig : public SystemObject { ReturnValue_t enableTxclockInversion(); ReturnValue_t disableTxclockInversion(); + ReturnValue_t enableBatPriorityBit(); + ReturnValue_t disableBatPriorityBit(); + private: // Address of register storing the bitrate configuration parameter static const uint32_t CADU_BITRATE_REG = 0x0; @@ -61,7 +64,7 @@ class AxiPtmeConfig : public SystemObject { static const uint32_t COMMON_CONFIG_REG = 0x4; static const uint32_t ADRESS_DIVIDER = 4; - enum class BitPos : uint32_t { EN_TX_CLK_MANIPULATOR, INVERT_CLOCK }; + enum class BitPos : uint32_t { EN_TX_CLK_MANIPULATOR = 0, INVERT_CLOCK = 1, EN_BAT_PRIORITY = 2 }; std::string axiUio; std::string uioMap; diff --git a/linux/ipcore/PtmeConfig.cpp b/linux/ipcore/PtmeConfig.cpp index 589e5e5f..08f5b979 100644 --- a/linux/ipcore/PtmeConfig.cpp +++ b/linux/ipcore/PtmeConfig.cpp @@ -48,3 +48,11 @@ ReturnValue_t PtmeConfig::configTxManipulator(bool enable) { } return result; } + +ReturnValue_t PtmeConfig::enableBatPriorityBit(bool enable) { + if (enable) { + return axiPtmeConfig->enableBatPriorityBit(); + } else { + return axiPtmeConfig->disableBatPriorityBit(); + } +} diff --git a/linux/ipcore/PtmeConfig.h b/linux/ipcore/PtmeConfig.h index f57f6fb5..446dc95a 100644 --- a/linux/ipcore/PtmeConfig.h +++ b/linux/ipcore/PtmeConfig.h @@ -53,6 +53,8 @@ class PtmeConfig : public SystemObject { */ ReturnValue_t configTxManipulator(bool enable); + ReturnValue_t enableBatPriorityBit(bool enable); + private: static const uint8_t INTERFACE_ID = CLASS_ID::RATE_SETTER; diff --git a/mission/tmtc/CcsdsIpCoreHandler.cpp b/mission/tmtc/CcsdsIpCoreHandler.cpp index 838af4c0..6a3aa329 100644 --- a/mission/tmtc/CcsdsIpCoreHandler.cpp +++ b/mission/tmtc/CcsdsIpCoreHandler.cpp @@ -211,14 +211,11 @@ ReturnValue_t CcsdsIpCoreHandler::checkModeCommand(Mode_t mode, Submode_t submod } void CcsdsIpCoreHandler::startTransition(Mode_t mode, Submode_t submode) { - auto rateHigh = [&]() { - ReturnValue_t result = ptmeConfig.setRate(RATE_500KBPS); - if (result == returnvalue::OK) { - this->mode = HasModesIF::MODE_ON; + auto rateSet = [&](uint32_t rate) { + if (setBatPriorityBitOnTxEnable) { + ptmeConfig.enableBatPriorityBit(true); } - }; - auto rateLow = [&]() { - ReturnValue_t result = ptmeConfig.setRate(RATE_100KBPS); + ReturnValue_t result = ptmeConfig.setRate(rate); if (result == returnvalue::OK) { this->mode = HasModesIF::MODE_ON; } @@ -228,14 +225,14 @@ void CcsdsIpCoreHandler::startTransition(Mode_t mode, Submode_t submode) { if (submode == static_cast(com::CcsdsSubmode::DATARATE_DEFAULT)) { com::Datarate currentDatarate = com::getCurrentDatarate(); if (currentDatarate == com::Datarate::LOW_RATE_MODULATION_BPSK) { - rateLow(); + rateSet(RATE_100KBPS); } else if (currentDatarate == com::Datarate::HIGH_RATE_MODULATION_0QPSK) { - rateHigh(); + rateSet(RATE_500KBPS); } } else if (submode == static_cast(com::CcsdsSubmode::DATARATE_HIGH)) { - rateHigh(); + rateSet(RATE_500KBPS); } else if (submode == static_cast(com::CcsdsSubmode::DATARATE_LOW)) { - rateLow(); + rateSet(RATE_100KBPS); } } else if (mode == HasModesIF::MODE_OFF) { @@ -250,6 +247,7 @@ 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(enTxClock); gpioIF->pullLow(enTxData); diff --git a/mission/tmtc/CcsdsIpCoreHandler.h b/mission/tmtc/CcsdsIpCoreHandler.h index a147a13f..ac6cbb1b 100644 --- a/mission/tmtc/CcsdsIpCoreHandler.h +++ b/mission/tmtc/CcsdsIpCoreHandler.h @@ -138,6 +138,7 @@ class CcsdsIpCoreHandler : public SystemObject, MessageQueueId_t tcDistributorQueueId = MessageQueueIF::NO_QUEUE; PtmeConfig& ptmeConfig; + bool setBatPriorityBitOnTxEnable = true; GpioIF* gpioIF = nullptr; // GPIO to enable RS485 transceiver for TX clock diff --git a/tmtc b/tmtc index 4f48c25b..350e5d77 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 4f48c25bf757b6c056072049fe5965da890b4f5b +Subproject commit 350e5d77b8113cc9e21eb72242fc37536368f541 From 99e6ea60004ca4520e5a1960e6ffc968892ea736 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 18 Mar 2023 14:34:09 +0100 Subject: [PATCH 2/9] that should do the job --- bsp_q7s/boardconfig/busConf.h | 2 + bsp_q7s/core/ObjectFactory.cpp | 14 ++++-- common/config/devices/gpioIds.h | 1 + linux/ipcore/PtmeConfig.h | 2 + mission/tmtc/CcsdsIpCoreHandler.cpp | 69 ++++++++++++++++++++++++----- mission/tmtc/CcsdsIpCoreHandler.h | 37 +++++++++++----- tmtc | 2 +- 7 files changed, 100 insertions(+), 27 deletions(-) diff --git a/bsp_q7s/boardconfig/busConf.h b/bsp_q7s/boardconfig/busConf.h index 4c142644..4fd15258 100644 --- a/bsp_q7s/boardconfig/busConf.h +++ b/bsp_q7s/boardconfig/busConf.h @@ -90,6 +90,8 @@ static constexpr char PAPB_BUSY_SIGNAL_VC2[] = "papb_busy_signal_vc2"; static constexpr char PAPB_EMPTY_SIGNAL_VC2[] = "papb_empty_signal_vc2"; static constexpr char PAPB_BUSY_SIGNAL_VC3[] = "papb_busy_signal_vc3"; static constexpr char PAPB_EMPTY_SIGNAL_VC3[] = "papb_empty_signal_vc3"; +static constexpr char PTME_RESETN[] = "ptme_resetn"; + static constexpr char RS485_EN_TX_CLOCK[] = "tx_clock_enable_ltc2872"; static constexpr char RS485_EN_TX_DATA[] = "tx_data_enable_ltc2872"; static constexpr char RS485_EN_RX_CLOCK[] = "rx_clock_enable_ltc2872"; diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 3afab7cd..8b39b29b 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -747,6 +747,9 @@ 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); + gpio = new GpiodRegularByLineName(q7s::gpioNames::PTME_RESETN, "PTME RESETN", + gpio::Direction::OUT, gpio::Levels::HIGH); + gpioCookiePtmeIp->addGpio(gpioIds::PTME_RESETN, gpio); gpioChecker(args.gpioComIF.addGpios(gpioCookiePtmeIp), "PTME PAPB VCs"); // Creating virtual channel interfaces VirtualChannelIF* vc0 = @@ -771,9 +774,14 @@ ReturnValue_t ObjectFactory::createCcsdsComponents(CcsdsComponentArgs& args) { new AxiPtmeConfig(objects::AXI_PTME_CONFIG, q7s::UIO_PTME, q7s::uiomapids::PTME_CONFIG); PtmeConfig* ptmeConfig = new PtmeConfig(objects::PTME_CONFIG, axiPtmeConfig); - *args.ipCoreHandler = new CcsdsIpCoreHandler( - objects::CCSDS_HANDLER, objects::CCSDS_PACKET_DISTRIBUTOR, *ptmeConfig, LINK_STATE, - &args.gpioComIF, gpioIds::RS485_EN_TX_CLOCK, gpioIds::RS485_EN_TX_DATA); + PtmeGpios gpios; + gpios.enableTxClock = gpioIds::RS485_EN_TX_CLOCK; + gpios.enableTxData = gpioIds::RS485_EN_TX_CLOCK; + gpios.ptmeResetn = gpioIds::PTME_RESETN; + + *args.ipCoreHandler = + new CcsdsIpCoreHandler(objects::CCSDS_HANDLER, objects::CCSDS_PACKET_DISTRIBUTOR, *ptmeConfig, + LINK_STATE, &args.gpioComIF, gpios); // This VC will receive all live TM auto* vcWithQueue = new VirtualChannelWithQueue(objects::PTME_VC0_LIVE_TM, ccsds::VC0, "PTME VC0 LIVE TM", *ptme, diff --git a/common/config/devices/gpioIds.h b/common/config/devices/gpioIds.h index 199439cc..640f4ead 100644 --- a/common/config/devices/gpioIds.h +++ b/common/config/devices/gpioIds.h @@ -102,6 +102,7 @@ enum gpioId_t { VC2_PAPB_BUSY, VC3_PAPB_EMPTY, VC3_PAPB_BUSY, + PTME_RESETN, PDEC_RESET, diff --git a/linux/ipcore/PtmeConfig.h b/linux/ipcore/PtmeConfig.h index 446dc95a..f1730dd3 100644 --- a/linux/ipcore/PtmeConfig.h +++ b/linux/ipcore/PtmeConfig.h @@ -1,6 +1,8 @@ #ifndef LINUX_OBC_PTMECONFIG_H_ #define LINUX_OBC_PTMECONFIG_H_ +#include + #include "AxiPtmeConfig.h" #include "fsfw/objectmanager/SystemObject.h" #include "fsfw/returnvalues/returnvalue.h" diff --git a/mission/tmtc/CcsdsIpCoreHandler.cpp b/mission/tmtc/CcsdsIpCoreHandler.cpp index 6a3aa329..85dfbbba 100644 --- a/mission/tmtc/CcsdsIpCoreHandler.cpp +++ b/mission/tmtc/CcsdsIpCoreHandler.cpp @@ -14,7 +14,7 @@ CcsdsIpCoreHandler::CcsdsIpCoreHandler(object_id_t objectId, object_id_t tcDestination, PtmeConfig& ptmeConfig, std::atomic_bool& linkState, - GpioIF* gpioIF, gpioId_t enTxClock, gpioId_t enTxData) + GpioIF* gpioIF, PtmeGpios gpioIds) : SystemObject(objectId), linkState(linkState), tcDestination(tcDestination), @@ -22,9 +22,8 @@ CcsdsIpCoreHandler::CcsdsIpCoreHandler(object_id_t objectId, object_id_t tcDesti actionHelper(this, nullptr), modeHelper(this), ptmeConfig(ptmeConfig), - gpioIF(gpioIF), - enTxClock(enTxClock), - enTxData(enTxData) { + ptmeGpios(gpioIds), + gpioIF(gpioIF) { commandQueue = QueueFactory::instance()->createMessageQueue(QUEUE_SIZE); auto mqArgs = MqArgs(objectId, static_cast(this)); eventQueue = @@ -71,6 +70,12 @@ ReturnValue_t CcsdsIpCoreHandler::initialize() { return ObjectManagerIF::CHILD_INIT_FAILED; } + if (batPriorityParam == 0) { + disablePrioritySelectMode(); + } else { + enablePrioritySelectMode(); + } + #if OBSW_SYRLINKS_SIMULATED == 1 // Update data on rising edge ptmeConfig.invertTxClock(false); @@ -111,7 +116,24 @@ ReturnValue_t CcsdsIpCoreHandler::getParameter(uint8_t domainId, uint8_t uniqueI ParameterWrapper* parameterWrapper, const ParameterWrapper* newValues, uint16_t startAtIndex) { - return returnvalue::OK; + if ((domainId == 0) and (uniqueIdentifier == ParamId::BAT_PRIORITY)) { + uint8_t newVal = 0; + ReturnValue_t result = newValues->getElement(&newVal); + if (result != returnvalue::OK) { + return result; + } + if (newVal > 1) { + return HasParametersIF::INVALID_VALUE; + } + parameterWrapper->set(batPriorityParam); + if (mode == MODE_ON) { + updateBatPriorityOnTxOff = true; + } else if (mode == MODE_OFF) { + updateBatPriorityFromParam(); + } + return returnvalue::OK; + } + return HasParametersIF::INVALID_IDENTIFIER_ID; } uint32_t CcsdsIpCoreHandler::getIdentifier() const { return 0; } @@ -184,8 +206,8 @@ void CcsdsIpCoreHandler::updateLinkState() { linkState = LINK_UP; } void CcsdsIpCoreHandler::enableTransmit() { #ifndef TE0720_1CFA - gpioIF->pullHigh(enTxClock); - gpioIF->pullHigh(enTxData); + gpioIF->pullHigh(ptmeGpios.enableTxClock); + gpioIF->pullHigh(ptmeGpios.enableTxData); #endif linkState = LINK_UP; } @@ -212,9 +234,6 @@ ReturnValue_t CcsdsIpCoreHandler::checkModeCommand(Mode_t mode, Submode_t submod void CcsdsIpCoreHandler::startTransition(Mode_t mode, Submode_t submode) { auto rateSet = [&](uint32_t rate) { - if (setBatPriorityBitOnTxEnable) { - ptmeConfig.enableBatPriorityBit(true); - } ReturnValue_t result = ptmeConfig.setRate(rate); if (result == returnvalue::OK) { this->mode = HasModesIF::MODE_ON; @@ -249,10 +268,14 @@ void CcsdsIpCoreHandler::announceMode(bool recursive) { triggerEvent(MODE_INFO, void CcsdsIpCoreHandler::disableTransmit() { ptmeConfig.enableBatPriorityBit(false); #ifndef TE0720_1CFA - gpioIF->pullLow(enTxClock); - gpioIF->pullLow(enTxData); + gpioIF->pullLow(ptmeGpios.enableTxClock); + gpioIF->pullLow(ptmeGpios.enableTxData); #endif linkState = LINK_DOWN; + if (updateBatPriorityOnTxOff) { + updateBatPriorityFromParam(); + updateBatPriorityOnTxOff = false; + } } const char* CcsdsIpCoreHandler::getName() const { return "CCSDS Handler"; } @@ -268,3 +291,25 @@ ReturnValue_t CcsdsIpCoreHandler::connectModeTreeParent(HasModeTreeChildrenIF& p ModeTreeChildIF& CcsdsIpCoreHandler::getModeTreeChildIF() { return *this; } object_id_t CcsdsIpCoreHandler::getObjectId() const { return SystemObject::getObjectId(); } + +void CcsdsIpCoreHandler::enablePrioritySelectMode() { + ptmeConfig.enableBatPriorityBit(true); + // Reset the PTME + gpioIF->pullLow(ptmeGpios.ptmeResetn); + gpioIF->pullHigh(ptmeGpios.ptmeResetn); +} + +void CcsdsIpCoreHandler::disablePrioritySelectMode() { + ptmeConfig.enableBatPriorityBit(false); + // Reset the PTME + gpioIF->pullLow(ptmeGpios.ptmeResetn); + gpioIF->pullHigh(ptmeGpios.ptmeResetn); +} + +void CcsdsIpCoreHandler::updateBatPriorityFromParam() { + if (batPriorityParam == 0) { + disablePrioritySelectMode(); + } else { + enablePrioritySelectMode(); + } +} diff --git a/mission/tmtc/CcsdsIpCoreHandler.h b/mission/tmtc/CcsdsIpCoreHandler.h index ac6cbb1b..d0a7d821 100644 --- a/mission/tmtc/CcsdsIpCoreHandler.h +++ b/mission/tmtc/CcsdsIpCoreHandler.h @@ -25,12 +25,25 @@ #include "linux/ipcore/PtmeConfig.h" #include "mission/comDefs.h" +struct PtmeGpios { + gpioId_t enableTxClock = gpio::NO_GPIO; + gpioId_t enableTxData = gpio::NO_GPIO; + gpioId_t ptmeResetn = gpio::NO_GPIO; +}; + /** * @brief This class handles the data exchange with the CCSDS IP cores implemented in the * programmable logic of the Q7S. * - * @details After reboot default CADU bitrate is always set to 100 kbps (results in downlink rate - * of 200 kbps due to convolutional code added by syrlinks transceiver) + * @details + * After reboot default CADU bitrate is always set to 100 kbps (results in downlink rate + * of 200 kbps due to convolutional code added by syrlinks transceiver). The IP core handler exposes + * a parameter to enable the priority selection mode for the PTME core. + * + * If the transmitter is on, the selection mode will be enabled when the transmitter goes off. + * If the transmitter is off, the update of the PTME will be done immediately on a parameter update. + * This is done because changing this parameter requires a reset of the PTME core to avoid bugs + * while the transmitter is enabled. * * @author J. Meier */ @@ -39,11 +52,12 @@ class CcsdsIpCoreHandler : public SystemObject, public ModeTreeChildIF, public ModeTreeConnectionIF, public HasModesIF, - // public AcceptsTelemetryIF, public AcceptsTelecommandsIF, public ReceivesParameterMessagesIF, public HasActionsIF { public: + enum ParamId : uint8_t { BAT_PRIORITY = 0 }; + static const bool LINK_UP = true; static const bool LINK_DOWN = false; using VcId_t = uint8_t; @@ -61,8 +75,7 @@ class CcsdsIpCoreHandler : public SystemObject, * @param enTxData GPIO ID of RS485 tx data enable */ CcsdsIpCoreHandler(object_id_t objectId, object_id_t tcDestination, PtmeConfig& ptmeConfig, - std::atomic_bool& linkState, GpioIF* gpioIF, gpioId_t enTxClock, - gpioId_t enTxData); + std::atomic_bool& linkState, GpioIF* gpioIF, PtmeGpios gpioIds); ~CcsdsIpCoreHandler(); @@ -138,16 +151,14 @@ class CcsdsIpCoreHandler : public SystemObject, MessageQueueId_t tcDistributorQueueId = MessageQueueIF::NO_QUEUE; PtmeConfig& ptmeConfig; - bool setBatPriorityBitOnTxEnable = true; + PtmeGpios ptmeGpios; + // BAT priority bit on by default to enable priority selection mode for the PTME. + uint8_t batPriorityParam = 1; + bool updateBatPriorityOnTxOff = false; GpioIF* gpioIF = nullptr; - // GPIO to enable RS485 transceiver for TX clock - gpioId_t enTxClock = gpio::NO_GPIO; - // GPIO to enable RS485 transceiver for TX data signal - gpioId_t enTxData = gpio::NO_GPIO; void readCommandQueue(void); - void handleTelemetry(); /** * @brief Forward link state to virtual channels. @@ -164,6 +175,10 @@ class CcsdsIpCoreHandler : public SystemObject, * RS485 transceiver chips to high. */ void disableTransmit(); + + void enablePrioritySelectMode(); + void disablePrioritySelectMode(); + void updateBatPriorityFromParam(); }; #endif /* CCSDSHANDLER_H_ */ diff --git a/tmtc b/tmtc index 350e5d77..e5a09e14 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 350e5d77b8113cc9e21eb72242fc37536368f541 +Subproject commit e5a09e148b45d0380dc6d9a1a88002bab4b0376c From ff8ebfe67a4b7973c7ee09c5ea9c67a4af679fdd Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 18 Mar 2023 14:40:07 +0100 Subject: [PATCH 3/9] docs --- linux/ipcore/PtmeConfig.h | 7 +++++++ mission/tmtc/CcsdsIpCoreHandler.h | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/linux/ipcore/PtmeConfig.h b/linux/ipcore/PtmeConfig.h index f1730dd3..c7ae4f5f 100644 --- a/linux/ipcore/PtmeConfig.h +++ b/linux/ipcore/PtmeConfig.h @@ -55,6 +55,13 @@ class PtmeConfig : public SystemObject { */ ReturnValue_t configTxManipulator(bool enable); + /** + * Enable the bat priority bit in the PTME wrapper component. + * Please note that a reset of the PTME is still required as specified in the documentation. + * This is done by a higher level component. + * @param enable + * @return + */ ReturnValue_t enableBatPriorityBit(bool enable); private: diff --git a/mission/tmtc/CcsdsIpCoreHandler.h b/mission/tmtc/CcsdsIpCoreHandler.h index d0a7d821..c7d60dae 100644 --- a/mission/tmtc/CcsdsIpCoreHandler.h +++ b/mission/tmtc/CcsdsIpCoreHandler.h @@ -176,6 +176,12 @@ class CcsdsIpCoreHandler : public SystemObject, */ void disableTransmit(); + /** + * The following set of functions configure the mode of the PTME bandwith allocation table (BAT) module. + * This consists of the following 2 steps: + * 1. Update the BAT priority bit in the PTME wrapper + * 2. Reset the PTME as specified in the datasheet. + */ void enablePrioritySelectMode(); void disablePrioritySelectMode(); void updateBatPriorityFromParam(); From f39d03afc2d9a7ea71b0c58fb66da676f3ca88f0 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 18 Mar 2023 14:50:34 +0100 Subject: [PATCH 4/9] changelog --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f68f5ad..9380297d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,15 @@ will consitute of a breaking change warranting a new major release: # [unreleased] +## Changed + +- The CCSDS IP core handler now exposes a parameter to enable the priority select mode + for the PTME core. This mode prioritizes virtual channels with a lower index, so for example + the virtual channel (VC0) will have the highest priority, while VC3 will have the lowestg + priority. This mode will be enabled by default for now, but can be set via the parameter IF with the unique + parameter ID 0. The update of this mode requires a PTME reset. Therefore, it will only be performed + when the transmitter is off to avoid weird bugs. + # [v1.38.0] 2023-03-17 eive-tmtc: v2.19.2 From 0b81a929418245979e5520a1f1a31bc8d4dcb4a5 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 18 Mar 2023 15:13:02 +0100 Subject: [PATCH 5/9] doc --- mission/tmtc/CcsdsIpCoreHandler.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mission/tmtc/CcsdsIpCoreHandler.h b/mission/tmtc/CcsdsIpCoreHandler.h index c7d60dae..627f357d 100644 --- a/mission/tmtc/CcsdsIpCoreHandler.h +++ b/mission/tmtc/CcsdsIpCoreHandler.h @@ -177,8 +177,8 @@ class CcsdsIpCoreHandler : public SystemObject, void disableTransmit(); /** - * The following set of functions configure the mode of the PTME bandwith allocation table (BAT) module. - * This consists of the following 2 steps: + * The following set of functions configure the mode of the PTME bandwith allocation table (BAT) + * module. This consists of the following 2 steps: * 1. Update the BAT priority bit in the PTME wrapper * 2. Reset the PTME as specified in the datasheet. */ From 7c2755db268b9bafcb86b527d695cde7afd4e839 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 18 Mar 2023 15:30:24 +0100 Subject: [PATCH 6/9] not sure this is correct.. --- linux/ipcore/PapbVcInterface.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/linux/ipcore/PapbVcInterface.cpp b/linux/ipcore/PapbVcInterface.cpp index 51afc15d..faebbae8 100644 --- a/linux/ipcore/PapbVcInterface.cpp +++ b/linux/ipcore/PapbVcInterface.cpp @@ -21,6 +21,8 @@ ReturnValue_t PapbVcInterface::initialize() { ReturnValue_t PapbVcInterface::write(const uint8_t* data, size_t size) { if (pollPapbBusySignal() == returnvalue::OK) { startPacketTransfer(); + } else { + return PAPB_BUSY; } for (size_t idx = 0; idx < size; idx++) { if (pollPapbBusySignal() == returnvalue::OK) { From 6e4d27a454f7d72a6636c1597f6529032a312b60 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 21 Mar 2023 12:55:39 +0100 Subject: [PATCH 7/9] bump tmtc, additonal changelog entry --- CHANGELOG.md | 1 + tmtc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e2cea8fa..1d183dc2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ will consitute of a breaking change warranting a new major release: priority. This mode will be enabled by default for now, but can be set via the parameter IF with the unique parameter ID 0. The update of this mode requires a PTME reset. Therefore, it will only be performed when the transmitter is off to avoid weird bugs. +- Connect and handle reset line for the PTME core in the software now. # [v1.38.0] 2023-03-17 diff --git a/tmtc b/tmtc index e5a09e14..b32a9273 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit e5a09e148b45d0380dc6d9a1a88002bab4b0376c +Subproject commit b32a9273ae4186a440685ffde7618f017cfdb268 From 2694f0cbc82c538bd3c6098b334ec28b664e68d3 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 21 Mar 2023 12:56:22 +0100 Subject: [PATCH 8/9] changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d183dc2..19fc3d9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ will consitute of a breaking change warranting a new major release: # [unreleased] +Requires firmware update for new FPGA design where reset line is routed into the software. + ## Fixed - Fixed transition for dual power lane assemblies: When going from dual side submode to single side From 34cd92840fb069abedfdcf7348a08abf9f57e067 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 21 Mar 2023 15:43:59 +0100 Subject: [PATCH 9/9] belongs in separate PR --- linux/ipcore/PapbVcInterface.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/linux/ipcore/PapbVcInterface.cpp b/linux/ipcore/PapbVcInterface.cpp index faebbae8..51afc15d 100644 --- a/linux/ipcore/PapbVcInterface.cpp +++ b/linux/ipcore/PapbVcInterface.cpp @@ -21,8 +21,6 @@ ReturnValue_t PapbVcInterface::initialize() { ReturnValue_t PapbVcInterface::write(const uint8_t* data, size_t size) { if (pollPapbBusySignal() == returnvalue::OK) { startPacketTransfer(); - } else { - return PAPB_BUSY; } for (size_t idx = 0; idx < size; idx++) { if (pollPapbBusySignal() == returnvalue::OK) {