From 7e6c25901bb8d73cb23d74a13fe03d4eafeb6b8d Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 12 May 2023 09:13:02 +0200 Subject: [PATCH 1/6] Squashed commit of the following: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit c137df64ab43e5b20fcf26c8821982fa71e43cff Merge: a919b3d1 4179e8e1 Author: Robin Mueller Date: Fri Apr 28 15:38:52 2023 +0200 Merge remote-tracking branch 'origin/main' into update_ptme_code commit 4179e8e124b3f9f425ac64b7df8b7e7395982dbf Merge: 26f5eff6 51f9d5e1 Author: Robin Müller Date: Fri Apr 28 15:35:54 2023 +0200 Merge pull request 'This bugfix might be super important' (#621) from possible_bugfix_dual_lane_assy into main Reviewed-on: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/621 Reviewed-by: Marius Eggert Reviewed-by: Steffen Gaisser commit 51f9d5e1fe8e71445ec15b833020c4e30b254e72 Merge: a17f57cb 26f5eff6 Author: Robin Müller Date: Fri Apr 28 15:35:10 2023 +0200 Merge branch 'main' into possible_bugfix_dual_lane_assy commit a17f57cbb587f960366baae7059309d18619cdc4 Author: Robin Mueller Date: Fri Apr 28 15:34:45 2023 +0200 changelog commit 26f5eff6d5957e4898f6d5a84200e77b1bd6250c Merge: 4074e084 8a0f13ba Author: Robin Müller Date: Fri Apr 28 15:32:03 2023 +0200 Merge pull request 'More System Modes' (#612) from more-system-modes into main Reviewed-on: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/612 commit 8a0f13bafbb995b724321a3936a674078d01882f Merge: 14baa356 4074e084 Author: Robin Müller Date: Fri Apr 28 15:31:51 2023 +0200 Merge branch 'main' into more-system-modes commit 14baa3563c3dc6499bac49bb83c08ba98bfad171 Author: Robin Mueller Date: Fri Apr 28 15:30:09 2023 +0200 hello commit 7045b6034afdb819f4978f91f697d7f23806ab89 Author: Robin Mueller Date: Fri Apr 28 15:18:47 2023 +0200 changelog commit 37b9615525637294118266910979236127f8a8ce Author: Robin Mueller Date: Fri Apr 28 15:18:16 2023 +0200 changelog commit 4074e0848012042565047726b8c526c6b5809a2c Merge: 862a4f26 38686ac3 Author: Robin Müller Date: Fri Apr 28 15:12:46 2023 +0200 Merge pull request 'Adaption for EM: Add P60 dock without ACU' (#620) from adaption_em_p60_dock_without_acu into main Reviewed-on: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/620 Reviewed-by: Marius Eggert commit 23796345d966787f6f43c1d89b9555413bfe583a Author: Robin Mueller Date: Fri Apr 28 15:04:30 2023 +0200 changelog and stop payload tracking commit b10275ca43f13ee68be013c7ece3b63acf762130 Author: Robin Mueller Date: Fri Apr 28 14:28:05 2023 +0200 changelog commit 383849c5cb62b1543037ab07c904b2725c91be13 Author: Robin Mueller Date: Fri Apr 28 14:25:14 2023 +0200 that is more robust commit c66cef9129586e8708a8f2679ff86b3c9977c5f5 Author: Robin Mueller Date: Fri Apr 28 14:23:21 2023 +0200 changelog commit 02ea8a7298ff14c8acab55b2f693e8593c277624 Author: Robin Mueller Date: Fri Apr 28 14:22:21 2023 +0200 changelog commit 38686ac3f621e50ea76be023520167841d2e2c19 Merge: 189a3126 74d5d709 Author: Robin Mueller Date: Fri Apr 28 14:04:03 2023 +0200 Merge branch 'possible_bugfix_dual_lane_assy' into adaption_em_p60_dock_without_acu commit 74d5d70973b46c70d1483077e71e2820d3ca4ad6 Author: Robin Mueller Date: Fri Apr 28 13:58:08 2023 +0200 this bugfix might be super important commit 48355e82635b071b9347b62f2bd1da636bf4eae5 Merge: 5691fe8e 862a4f26 Author: Robin Müller Date: Fri Apr 28 10:25:50 2023 +0200 Merge branch 'main' into more-system-modes commit 189a312628e561f54491ec238a2d2d5e2f211b57 Merge: a1279428 862a4f26 Author: Robin Mueller Date: Fri Apr 28 10:23:46 2023 +0200 Merge remote-tracking branch 'origin/main' into adaption_em_p60_dock_without_acu commit a12794281bfc2ebb27a02bbc151696023e69a9f0 Author: Robin Mueller Date: Fri Apr 28 10:20:31 2023 +0200 changelog commit fcaabb4e421b5f792ede490b6dd135ce661c9db5 Merge: 6c326489 4aafca64 Author: Robin Mueller Date: Fri Apr 28 10:20:02 2023 +0200 Merge remote-tracking branch 'origin/main' into adaption_em_p60_dock_without_acu commit 6c326489cbc59f2d70993542f05676472ca0102f Author: Robin Mueller Date: Fri Apr 28 10:18:46 2023 +0200 adapt EM SW: GS PCDU added, but use dummy for ACU commit 862a4f268510e04fc3cfb878b5eed9f0f9d62f05 Merge: 4aafca64 2daca272 Author: Robin Müller Date: Fri Apr 28 09:37:55 2023 +0200 Merge pull request 'Host SW bugfixes' (#618) from try_fix_host_obsw into main Reviewed-on: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/618 Reviewed-by: Marius Eggert commit 5691fe8e72a2e3b008d6130f31be32d9d7aee9b7 Merge: 097be17a 4aafca64 Author: meggert Date: Thu Apr 27 15:40:31 2023 +0200 Merge branch 'main' into more-system-modes commit 2daca272f8f0397125349c0f6c193e22d0a26383 Author: Robin Mueller Date: Thu Apr 27 11:29:18 2023 +0200 changelog commit 03762f962020b55188d445ee3dd429b6e1a32135 Author: Robin Mueller Date: Wed Apr 26 17:38:06 2023 +0200 lower live TM handler frequency commit a296f16e5ce9d803ce5db54d9602e396dad7ebce Author: Robin Mueller Date: Wed Apr 26 17:36:38 2023 +0200 host SW works properly again commit 83f07a6e16cbbf5fc4a9ccb2e7d92c3fdffb172b Author: Robin Mueller Date: Wed Apr 26 17:26:32 2023 +0200 configurable event manager queue depth commit 00dab64628a53d2109fceb5f9a4ffc765a72fab6 Merge: 641b8e84 4aafca64 Author: Robin Mueller Date: Wed Apr 26 17:03:35 2023 +0200 Merge remote-tracking branch 'origin/main' into try_fix_host_obsw commit 4aafca64a67589826f1578865c92fa76141e8531 Merge: f271242d 6901eae8 Author: Robin Müller Date: Wed Apr 26 17:03:01 2023 +0200 Merge pull request 'EM adaptions' (#619) from em_adaptions into main Reviewed-on: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/619 commit 6901eae81689981937e7eb49b98886f8c78b727b Merge: 7d630ebc f271242d Author: Robin Mueller Date: Wed Apr 26 17:02:24 2023 +0200 Merge remote-tracking branch 'origin/main' into em_adaptions commit 7d630ebcf3894a9a9896d1c3f05548d5ef230333 Author: Robin Mueller Date: Wed Apr 26 17:00:04 2023 +0200 EM adaptions commit 641b8e847d2b63ad11f28c4a37434a6161443690 Author: Robin Mueller Date: Wed Apr 26 16:41:40 2023 +0200 add back tm funnel handler for hosted build commit 13142686823bedee1a79ae5f851f124968822a54 Author: Robin Mueller Date: Wed Apr 26 16:23:50 2023 +0200 host build requires dedicated live TM task.. commit 4040304ef09a172f9d2bef42547d6b1effb8ca76 Author: Robin Mueller Date: Wed Apr 26 13:15:42 2023 +0200 this is annoying commit a919b3d1645d5c4a6e20903d973ce96424508cae Merge: e22f2a53 9672d6d6 Author: Robin Mueller Date: Wed Apr 26 11:11:30 2023 +0200 Merge remote-tracking branch 'origin/develop' into update_ptme_code commit 9672d6d6cca3ad7369bb4b06fd91a7f17a0f9db9 Author: Robin Mueller Date: Wed Apr 26 11:11:09 2023 +0200 changelog commit e22f2a53ea7388cc5c75c2024953aab293c8d277 Merge: b076e80b 0eb6b7cc Author: Robin Mueller Date: Wed Apr 26 11:05:58 2023 +0200 Merge remote-tracking branch 'origin/develop' into update_ptme_code commit b076e80b44e7ef2b2417def66ec1f1a684cfb228 Author: Robin Mueller Date: Wed Apr 26 11:04:10 2023 +0200 changelog commit 269aa6f7b0006125e9a516f8ecb6cdc32c91cbe5 Author: Robin Mueller Date: Wed Apr 26 11:03:42 2023 +0200 changelog commit caae2b4ba925747aa0ed1e2112582c6deff39d77 Author: Robin Mueller Date: Wed Apr 26 11:02:24 2023 +0200 update PTME code commit 097be17a2900e64021fcbb457c89d6d4756ab697 Author: meggert Date: Wed Apr 19 15:07:21 2023 +0200 added remaining acs modes as system modes --- CHANGELOG.md | 11 +++++++++ bsp_q7s/boardconfig/busConf.h | 6 ++--- bsp_q7s/core/ObjectFactory.cpp | 28 +++++++---------------- common/config/devices/gpioIds.h | 5 ---- linux/ipcore/PapbVcInterface.cpp | 39 +++++++++++++++----------------- linux/ipcore/PapbVcInterface.h | 11 ++++----- 6 files changed, 43 insertions(+), 57 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dc320982..45bddbd4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,16 @@ will consitute of a breaking change warranting a new major release: # [v2.2.0] to be released +TODO: New firmware package version. + +## Changed + +- Removed PTME busy/ready signals. Those were not used anyway because register reads are used now. + +## Fixed + +- Important bugfixes for PTME. See `q7s-package` CHANGELOG. + # [v2.1.0] to be released ## Changed @@ -49,6 +59,7 @@ will consitute of a breaking change warranting a new major release: # [v2.0.5] 2023-05-11 + - The dual lane assembly transition failed handler started new transitions towards the current mode instead of the target mode. This means that if the dual lane assembly never reached the initial submode (e.g. mode normal and submode dual side), it will transition back to the current mode, diff --git a/bsp_q7s/boardconfig/busConf.h b/bsp_q7s/boardconfig/busConf.h index 4fd15258..304113d2 100644 --- a/bsp_q7s/boardconfig/busConf.h +++ b/bsp_q7s/boardconfig/busConf.h @@ -82,14 +82,12 @@ static constexpr char EN_RW_4[] = "enable_rw_4"; static constexpr char RAD_SENSOR_CHIP_SELECT[] = "rad_sensor_chip_select"; static constexpr char ENABLE_RADFET[] = "enable_radfet"; -static constexpr char PAPB_BUSY_SIGNAL_VC0[] = "papb_busy_signal_vc0"; + static constexpr char PAPB_EMPTY_SIGNAL_VC0[] = "papb_empty_signal_vc0"; -static constexpr char PAPB_BUSY_SIGNAL_VC1[] = "papb_busy_signal_vc1"; static constexpr char PAPB_EMPTY_SIGNAL_VC1[] = "papb_empty_signal_vc1"; -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"; diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 12e9177f..24ea22f8 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -729,20 +729,12 @@ ReturnValue_t ObjectFactory::createCcsdsComponents(CcsdsComponentArgs& args) { // GPIO definitions of signals connected to the virtual channel interfaces of the PTME IP Core GpioCookie* gpioCookiePtmeIp = new GpioCookie; GpiodRegularByLineName* gpio = nullptr; - gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_BUSY_SIGNAL_VC0, "PAPB VC0"); - gpioCookiePtmeIp->addGpio(gpioIds::VC0_PAPB_BUSY, gpio); gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_EMPTY_SIGNAL_VC0, "PAPB VC0"); gpioCookiePtmeIp->addGpio(gpioIds::VC0_PAPB_EMPTY, gpio); - gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_BUSY_SIGNAL_VC1, "PAPB VC1"); - gpioCookiePtmeIp->addGpio(gpioIds::VC1_PAPB_BUSY, gpio); gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_EMPTY_SIGNAL_VC1, "PAPB VC1"); gpioCookiePtmeIp->addGpio(gpioIds::VC1_PAPB_EMPTY, gpio); - gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_BUSY_SIGNAL_VC2, "PAPB VC2"); - gpioCookiePtmeIp->addGpio(gpioIds::VC2_PAPB_BUSY, gpio); gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_EMPTY_SIGNAL_VC2, "PAPB VC2"); gpioCookiePtmeIp->addGpio(gpioIds::VC2_PAPB_EMPTY, gpio); - gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_BUSY_SIGNAL_VC3, "PAPB VC3"); - 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", @@ -751,18 +743,14 @@ ReturnValue_t ObjectFactory::createCcsdsComponents(CcsdsComponentArgs& args) { 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, - q7s::UIO_PTME, q7s::uiomapids::PTME_VC0); - VirtualChannelIF* vc1 = - new PapbVcInterface(&args.gpioComIF, gpioIds::VC1_PAPB_BUSY, gpioIds::VC1_PAPB_EMPTY, - q7s::UIO_PTME, q7s::uiomapids::PTME_VC1); - VirtualChannelIF* vc2 = - new PapbVcInterface(&args.gpioComIF, gpioIds::VC2_PAPB_BUSY, gpioIds::VC2_PAPB_EMPTY, - q7s::UIO_PTME, q7s::uiomapids::PTME_VC2); - VirtualChannelIF* vc3 = - new PapbVcInterface(&args.gpioComIF, gpioIds::VC3_PAPB_BUSY, gpioIds::VC3_PAPB_EMPTY, - q7s::UIO_PTME, q7s::uiomapids::PTME_VC3); + VirtualChannelIF* vc0 = new PapbVcInterface(&args.gpioComIF, gpioIds::VC0_PAPB_EMPTY, + q7s::UIO_PTME, q7s::uiomapids::PTME_VC0); + VirtualChannelIF* vc1 = new PapbVcInterface(&args.gpioComIF, gpioIds::VC1_PAPB_EMPTY, + q7s::UIO_PTME, q7s::uiomapids::PTME_VC1); + VirtualChannelIF* vc2 = new PapbVcInterface(&args.gpioComIF, gpioIds::VC2_PAPB_EMPTY, + q7s::UIO_PTME, q7s::uiomapids::PTME_VC2); + VirtualChannelIF* vc3 = new PapbVcInterface(&args.gpioComIF, gpioIds::VC3_PAPB_EMPTY, + q7s::UIO_PTME, q7s::uiomapids::PTME_VC3); // Creating ptme object and adding virtual channel interfaces Ptme* ptme = new Ptme(objects::PTME); ptme->addVcInterface(ccsds::VC0, vc0); diff --git a/common/config/devices/gpioIds.h b/common/config/devices/gpioIds.h index 640f4ead..573327fa 100644 --- a/common/config/devices/gpioIds.h +++ b/common/config/devices/gpioIds.h @@ -93,15 +93,10 @@ enum gpioId_t { EN_RW_CS, SPI_MUX, - VC0_PAPB_EMPTY, - VC0_PAPB_BUSY, VC1_PAPB_EMPTY, - VC1_PAPB_BUSY, VC2_PAPB_EMPTY, - VC2_PAPB_BUSY, VC3_PAPB_EMPTY, - VC3_PAPB_BUSY, PTME_RESETN, PDEC_RESET, diff --git a/linux/ipcore/PapbVcInterface.cpp b/linux/ipcore/PapbVcInterface.cpp index 60968cc6..7a1a89e4 100644 --- a/linux/ipcore/PapbVcInterface.cpp +++ b/linux/ipcore/PapbVcInterface.cpp @@ -7,13 +7,9 @@ #include "fsfw/serviceinterface/ServiceInterface.h" -PapbVcInterface::PapbVcInterface(LinuxLibgpioIF* gpioComIF, gpioId_t papbBusyId, - gpioId_t papbEmptyId, std::string uioFile, int mapNum) - : gpioComIF(gpioComIF), - papbBusyId(papbBusyId), - papbEmptyId(papbEmptyId), - uioFile(std::move(uioFile)), - mapNum(mapNum) {} +PapbVcInterface::PapbVcInterface(LinuxLibgpioIF* gpioComIF, gpioId_t papbEmptyId, + std::string uioFile, int mapNum) + : gpioComIF(gpioComIF), papbEmptyId(papbEmptyId), uioFile(std::move(uioFile)), mapNum(mapNum) {} PapbVcInterface::~PapbVcInterface() {} @@ -99,7 +95,7 @@ void PapbVcInterface::startPacketTransfer(ByteWidthCfg initWidth) { void PapbVcInterface::completePacketTransfer() { *vcBaseReg = CONFIG_END; } ReturnValue_t PapbVcInterface::pollInterfaceReadiness(uint32_t maxPollRetries, - bool checkReadyState) const { + bool checkReadyForPacketState) const { uint32_t busyIdx = 0; nextDelay.tv_nsec = FIRST_DELAY_PAPB_POLLING_NS; @@ -108,13 +104,16 @@ ReturnValue_t PapbVcInterface::pollInterfaceReadiness(uint32_t maxPollRetries, // Bit 5, see PTME ptme_001_01-0-7-r2 Table 31. uint32_t reg = *vcBaseReg; bool busy = (reg >> 5) & 0b1; - bool ready = (reg >> 6) & 0b1; - if (not busy) { + bool readyForPacket = (reg >> 6) & 0b1; + if (checkReadyForPacketState) { + if (not busy and readyForPacket) { + return returnvalue::OK; + } else if (not busy and not readyForPacket) { + return PAPB_BUSY; + } + } else if (not busy) { return returnvalue::OK; } - if (checkReadyState and not ready) { - return PAPB_BUSY; - } busyIdx++; if (busyIdx >= maxPollRetries) { @@ -131,24 +130,22 @@ ReturnValue_t PapbVcInterface::pollInterfaceReadiness(uint32_t maxPollRetries, return returnvalue::OK; } -void PapbVcInterface::isVcInterfaceBufferEmpty() { +bool PapbVcInterface::isVcInterfaceBufferEmpty() { ReturnValue_t result = returnvalue::OK; gpio::Levels papbEmptyState = gpio::Levels::HIGH; result = gpioComIF->readGpio(papbEmptyId, papbEmptyState); if (result != returnvalue::OK) { - sif::warning << "PapbVcInterface::isVcInterfaceBufferEmpty: Failed to read papb empty signal" - << std::endl; - return; + sif::error << "PapbVcInterface::isVcInterfaceBufferEmpty: Failed to read papb empty signal" + << std::endl; + return true; } if (papbEmptyState == gpio::Levels::HIGH) { - sif::debug << "PapbVcInterface::isVcInterfaceBufferEmpty: Buffer is empty" << std::endl; - } else { - sif::debug << "PapbVcInterface::isVcInterfaceBufferEmpty: Buffer is not empty" << std::endl; + return true; } - return; + return false; } bool PapbVcInterface::isBusy() const { return pollInterfaceReadiness(0, true) == PAPB_BUSY; } diff --git a/linux/ipcore/PapbVcInterface.h b/linux/ipcore/PapbVcInterface.h index e54def5d..71dd143b 100644 --- a/linux/ipcore/PapbVcInterface.h +++ b/linux/ipcore/PapbVcInterface.h @@ -30,8 +30,7 @@ class PapbVcInterface : public VirtualChannelIF { * @param uioFile UIO file providing access to the PAPB bus * @param mapNum Map number of UIO map associated with this virtual channel */ - PapbVcInterface(LinuxLibgpioIF* gpioComIF, gpioId_t papbBusyId, gpioId_t papbEmptyId, - std::string uioFile, int mapNum); + PapbVcInterface(LinuxLibgpioIF* gpioComIF, gpioId_t papbEmptyId, std::string uioFile, int mapNum); virtual ~PapbVcInterface(); bool isBusy() const override; @@ -83,9 +82,6 @@ class PapbVcInterface : public VirtualChannelIF { static constexpr long int MAX_DELAY_PAPB_POLLING_NS = 40; LinuxLibgpioIF* gpioComIF = nullptr; - - /** Pulled to low when virtual channel not ready to receive data */ - gpioId_t papbBusyId = gpio::NO_GPIO; /** High when external buffer memory of virtual channel is empty */ gpioId_t papbEmptyId = gpio::NO_GPIO; @@ -120,13 +116,14 @@ class PapbVcInterface : public VirtualChannelIF { * * @return returnvalue::OK when ready to receive data else PAPB_BUSY. */ - inline ReturnValue_t pollInterfaceReadiness(uint32_t maxPollRetries, bool checkReadyState) const; + inline ReturnValue_t pollInterfaceReadiness(uint32_t maxPollRetries, + bool checkReadyForPacketState) const; /** * @brief This function can be used for debugging to check whether there are packets in * the packet buffer of the virtual channel or not. */ - void isVcInterfaceBufferEmpty(); + bool isVcInterfaceBufferEmpty(); /** * @brief This function sends a complete telemetry transfer frame data field (1105 bytes) -- 2.43.0 From 722247598598a1cdb3a7ee2e8607009ab5c43202 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 23 May 2023 19:18:42 +0200 Subject: [PATCH 2/6] changelog, remove unnecessary logic --- CHANGELOG.md | 3 +++ mission/com/TmStoreTaskBase.cpp | 8 +------- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f36fc3aa..4073d7fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,6 +55,9 @@ TODO: New firmware package version. - Disable missed deadlines per default. Not useful in orbit, and triggers all the time on the EM build after a number of subsequent runs, without any apparent reason (deadlines are not actually missed, thread usage displayed is nominal) +- TM store dumpes will not be cancelled anymore if the transmitter is off. The dump can be cancelled + with an OFF command, and the PTME is perfectly capable of dumping without the transmitter being + on. ## Added diff --git a/mission/com/TmStoreTaskBase.cpp b/mission/com/TmStoreTaskBase.cpp index 6598225d..5efb40bf 100644 --- a/mission/com/TmStoreTaskBase.cpp +++ b/mission/com/TmStoreTaskBase.cpp @@ -39,6 +39,7 @@ bool TmStoreTaskBase::handleOneStore(PersistentTmStoreWithTmQueue& store, } // Dump TMs if (store.getState() == PersistentTmStore::State::DUMPING) { + sif::debug << "handling dump" << std::endl; if (handleOneDump(store, dumpContext, dumpPerformed) != returnvalue::OK) { return result; } @@ -94,13 +95,6 @@ void TmStoreTaskBase::cancelDump(DumpContext& ctx, PersistentTmStore& store, boo ReturnValue_t TmStoreTaskBase::handleOneDump(PersistentTmStoreWithTmQueue& store, DumpContext& dumpContext, bool& dumpPerformed) { ReturnValue_t result = returnvalue::OK; - // The PTME might have been reset an transmitter state change, so there is no point in continuing - // the dump. - // TODO: Will be solved in a cleaner way, this is kind of a hack. - if (not channel.isTxOn()) { - cancelDump(dumpContext, store, false); - return returnvalue::FAILED; - } // It is assumed that the PTME will only be locked for a short period (e.g. to change datarate). if (not channel.isBusy() and not ptmeLocked) { performDump(store, dumpContext, dumpPerformed); -- 2.43.0 From 50327fb6148d25b1e8fb28a692a3cc5e72767b0d Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 23 May 2023 19:44:06 +0200 Subject: [PATCH 3/6] get rid of the printouts and of the delay --- mission/com/PersistentLogTmStoreTask.cpp | 2 +- mission/com/PersistentSingleTmStoreTask.cpp | 2 +- mission/com/TmStoreTaskBase.cpp | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/mission/com/PersistentLogTmStoreTask.cpp b/mission/com/PersistentLogTmStoreTask.cpp index 77f2bb7d..0d47e50f 100644 --- a/mission/com/PersistentLogTmStoreTask.cpp +++ b/mission/com/PersistentLogTmStoreTask.cpp @@ -48,7 +48,7 @@ ReturnValue_t PersistentLogTmStoreTask::performOperation(uint8_t opCode) { } else { // TODO: Would be best to remove this, but not delaying here can lead to evil issues. // Polling the PAPB of the PTME core too often leads to scheuduling issues. - TaskFactory::delayTask(2); + // TaskFactory::delayTask(2); } } } diff --git a/mission/com/PersistentSingleTmStoreTask.cpp b/mission/com/PersistentSingleTmStoreTask.cpp index 1b77365b..2afc8e31 100644 --- a/mission/com/PersistentSingleTmStoreTask.cpp +++ b/mission/com/PersistentSingleTmStoreTask.cpp @@ -30,7 +30,7 @@ ReturnValue_t PersistentSingleTmStoreTask::performOperation(uint8_t opCode) { } else { // TODO: Would be best to remove this, but not delaying here can lead to evil issues. // Polling the PAPB of the PTME core too often leads to scheuduling issues. - TaskFactory::delayTask(2); + // TaskFactory::delayTask(2); } } } diff --git a/mission/com/TmStoreTaskBase.cpp b/mission/com/TmStoreTaskBase.cpp index f7257f23..2158cf2a 100644 --- a/mission/com/TmStoreTaskBase.cpp +++ b/mission/com/TmStoreTaskBase.cpp @@ -39,7 +39,6 @@ bool TmStoreTaskBase::handleOneStore(PersistentTmStoreWithTmQueue& store, } // Dump TMs if (store.getState() == PersistentTmStore::State::DUMPING) { - sif::debug << "handling dump" << std::endl; if (handleOneDump(store, dumpContext, dumpPerformed) != returnvalue::OK) { return result; } -- 2.43.0 From 9c78362ac534b8f665c72b97f4a64a29b5368553 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 27 May 2023 17:00:41 +0200 Subject: [PATCH 4/6] use read write permissions for uio --- linux/ipcore/PapbVcInterface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/ipcore/PapbVcInterface.cpp b/linux/ipcore/PapbVcInterface.cpp index 7a1a89e4..bf1f48bb 100644 --- a/linux/ipcore/PapbVcInterface.cpp +++ b/linux/ipcore/PapbVcInterface.cpp @@ -16,7 +16,7 @@ PapbVcInterface::~PapbVcInterface() {} ReturnValue_t PapbVcInterface::initialize() { UioMapper uioMapper(uioFile, mapNum); ReturnValue_t result = uioMapper.getMappedAdress(const_cast(&vcBaseReg), - UioMapper::Permissions::WRITE_ONLY); + UioMapper::Permissions::READ_WRITE); if (result != returnvalue::OK) { return result; } -- 2.43.0 From 9921522ce0c1ec36e2faea7e9584cd7c7390b61b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 30 May 2023 19:06:59 +0200 Subject: [PATCH 5/6] working, remove some old unrequired code --- mission/com/PersistentLogTmStoreTask.cpp | 6 ------ mission/com/PersistentSingleTmStoreTask.cpp | 6 ------ 2 files changed, 12 deletions(-) diff --git a/mission/com/PersistentLogTmStoreTask.cpp b/mission/com/PersistentLogTmStoreTask.cpp index 0d47e50f..28545457 100644 --- a/mission/com/PersistentLogTmStoreTask.cpp +++ b/mission/com/PersistentLogTmStoreTask.cpp @@ -42,13 +42,7 @@ ReturnValue_t PersistentLogTmStoreTask::performOperation(uint8_t opCode) { if (not someonesBusy) { TaskFactory::delayTask(100); } else if (vcBusyDuringDump) { - // TODO: Might not be necessary - sif::debug << "VC busy, delaying" << std::endl; TaskFactory::delayTask(10); - } else { - // TODO: Would be best to remove this, but not delaying here can lead to evil issues. - // Polling the PAPB of the PTME core too often leads to scheuduling issues. - // TaskFactory::delayTask(2); } } } diff --git a/mission/com/PersistentSingleTmStoreTask.cpp b/mission/com/PersistentSingleTmStoreTask.cpp index 2afc8e31..d6f43289 100644 --- a/mission/com/PersistentSingleTmStoreTask.cpp +++ b/mission/com/PersistentSingleTmStoreTask.cpp @@ -24,13 +24,7 @@ ReturnValue_t PersistentSingleTmStoreTask::performOperation(uint8_t opCode) { if (not busy) { TaskFactory::delayTask(100); } else if (dumpContext.vcBusyDuringDump) { - sif::debug << "VC busy, delaying" << std::endl; - // TODO: Might not be necessary TaskFactory::delayTask(10); - } else { - // TODO: Would be best to remove this, but not delaying here can lead to evil issues. - // Polling the PAPB of the PTME core too often leads to scheuduling issues. - // TaskFactory::delayTask(2); } } } -- 2.43.0 From ddcdc38310b1ea0a2f247cb3472f8a29bf0ec0bc Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 30 May 2023 19:22:23 +0200 Subject: [PATCH 6/6] try to get rid of the nanosleep --- linux/ipcore/PapbVcInterface.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/linux/ipcore/PapbVcInterface.cpp b/linux/ipcore/PapbVcInterface.cpp index bf1f48bb..97eb9954 100644 --- a/linux/ipcore/PapbVcInterface.cpp +++ b/linux/ipcore/PapbVcInterface.cpp @@ -65,12 +65,6 @@ ReturnValue_t PapbVcInterface::write(const uint8_t* data, size_t size) { // idx += 4; // } for (size_t idx = 0; idx < size; idx++) { - // This delay is super-important, DO NOT REMOVE! - // Polling the GPIO or the config register too often messes up the scheduler. - // TODO: Maybe this should not be done like this. It would be better if there was a custom - // FPGA module which can accept packets and then takes care of dumping that packet into - // the PTME. DMA would be an ideal solution for this. - nanosleep(&BETWEEN_POLL_DELAY, &remDelay); if (pollInterfaceReadiness(2, false) == returnvalue::OK) { *(vcBaseReg + DATA_REG_OFFSET) = static_cast(data[idx]); } else { @@ -78,7 +72,6 @@ ReturnValue_t PapbVcInterface::write(const uint8_t* data, size_t size) { return returnvalue::FAILED; } } - nanosleep(&BETWEEN_POLL_DELAY, &remDelay); if (pollInterfaceReadiness(2, false) == returnvalue::OK) { completePacketTransfer(); } else { -- 2.43.0