From 3f2d83d95c714ae466b6566d2356ff4e11515275 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Fri, 1 Mar 2024 10:50:55 +0100 Subject: [PATCH 1/7] added debug print out --- src/fsfw/container/SharedRingBuffer.h | 4 ++-- src/fsfw/controller/ExtendedControllerBase.cpp | 3 ++- src/fsfw/devicehandlers/FreshDeviceHandlerBase.h | 2 +- src/fsfw/objectmanager/ObjectManager.cpp | 2 ++ 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/fsfw/container/SharedRingBuffer.h b/src/fsfw/container/SharedRingBuffer.h index 6ae36432..dab28d92 100644 --- a/src/fsfw/container/SharedRingBuffer.h +++ b/src/fsfw/container/SharedRingBuffer.h @@ -20,7 +20,7 @@ class SharedRingBuffer : public SystemObject, public SimpleRingBuffer { * This constructor allocates a new internal buffer with the supplied size. * @param size * @param overwriteOld - * If the ring buffer is overflowing at a write operartion, the oldest data + * If the ring buffer is overflowing at a write operation, the oldest data * will be overwritten. */ SharedRingBuffer(object_id_t objectId, const size_t size, bool overwriteOld, @@ -30,7 +30,7 @@ class SharedRingBuffer : public SystemObject, public SimpleRingBuffer { * @param buffer * @param size * @param overwriteOld - * If the ring buffer is overflowing at a write operartion, the oldest data + * If the ring buffer is overflowing at a write operation, the oldest data * will be overwritten. */ SharedRingBuffer(object_id_t objectId, uint8_t* buffer, const size_t size, bool overwriteOld, diff --git a/src/fsfw/controller/ExtendedControllerBase.cpp b/src/fsfw/controller/ExtendedControllerBase.cpp index 63b21ba1..8bde6310 100644 --- a/src/fsfw/controller/ExtendedControllerBase.cpp +++ b/src/fsfw/controller/ExtendedControllerBase.cpp @@ -3,7 +3,8 @@ ExtendedControllerBase::ExtendedControllerBase(object_id_t objectId, size_t commandQueueDepth) : ControllerBase(objectId, commandQueueDepth), poolManager(this, commandQueue), - actionHelper(this, commandQueue) {} + actionHelper(this, commandQueue) { +} ExtendedControllerBase::~ExtendedControllerBase() = default; diff --git a/src/fsfw/devicehandlers/FreshDeviceHandlerBase.h b/src/fsfw/devicehandlers/FreshDeviceHandlerBase.h index c911c1dd..21135ab7 100644 --- a/src/fsfw/devicehandlers/FreshDeviceHandlerBase.h +++ b/src/fsfw/devicehandlers/FreshDeviceHandlerBase.h @@ -94,7 +94,7 @@ class FreshDeviceHandlerBase : public SystemObject, virtual void modeChanged(Mode_t mode, Submode_t submode); /** * The default implementation sets the new mode immediately. If this is not applicable for - * certain modes, the user should provide a custom implementation, which performs rougly + * certain modes, the user should provide a custom implementation, which performs roughly * the same functionality of this function, when all the steps have been taken to reach the * new mode. */ diff --git a/src/fsfw/objectmanager/ObjectManager.cpp b/src/fsfw/objectmanager/ObjectManager.cpp index 2de36050..248716c2 100644 --- a/src/fsfw/objectmanager/ObjectManager.cpp +++ b/src/fsfw/objectmanager/ObjectManager.cpp @@ -122,6 +122,8 @@ void ObjectManager::initialize() { it.first, result); #endif errorCount++; + } else { + sif::printDebug("ObjectManager::initialize: Initialized onject with ID 0x%x\n", it.first); } } if (errorCount > 0) { From 63a00b8b4fffeff299778806653ca3a271c236a3 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Thu, 14 Mar 2024 16:19:44 +0100 Subject: [PATCH 2/7] initialize fdir instance in constructor of FreshDeviceHandlerBase --- misc/defaultcfg/fsfwconfig/FSFWConfig.h | 2 +- src/fsfw/devicehandlers/FreshDeviceHandlerBase.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/misc/defaultcfg/fsfwconfig/FSFWConfig.h b/misc/defaultcfg/fsfwconfig/FSFWConfig.h index e80abf24..290904e7 100644 --- a/misc/defaultcfg/fsfwconfig/FSFWConfig.h +++ b/misc/defaultcfg/fsfwconfig/FSFWConfig.h @@ -11,7 +11,7 @@ //! Used to determine whether C++ ostreams are used which can increase //! the binary size significantly. If this is disabled, //! the C stdio functions can be used alternatively -#define FSFW_CPP_OSTREAM_ENABLED 1 +#define FSFW_CPP_OSTREAM_ENABLED 0 //! More FSFW related printouts depending on level. Useful for development. #define FSFW_VERBOSE_LEVEL 1 diff --git a/src/fsfw/devicehandlers/FreshDeviceHandlerBase.cpp b/src/fsfw/devicehandlers/FreshDeviceHandlerBase.cpp index 2b4ab27b..46ae02de 100644 --- a/src/fsfw/devicehandlers/FreshDeviceHandlerBase.cpp +++ b/src/fsfw/devicehandlers/FreshDeviceHandlerBase.cpp @@ -11,6 +11,7 @@ FreshDeviceHandlerBase::FreshDeviceHandlerBase(DhbConfig config) healthHelper(this, getObjectId()), paramHelper(this), poolManager(this, nullptr), + fdirInstance(config.fdirInstance), defaultFdirParent(config.defaultFdirParent) { auto mqArgs = MqArgs(config.objectId, static_cast(this)); messageQueue = QueueFactory::instance()->createMessageQueue( From 8aa539e67fbc52cf401658c0cef5192fc438b225 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Mon, 25 Mar 2024 15:25:18 +0100 Subject: [PATCH 3/7] typo --- src/fsfw/objectmanager/ObjectManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fsfw/objectmanager/ObjectManager.cpp b/src/fsfw/objectmanager/ObjectManager.cpp index 248716c2..9e20c0bf 100644 --- a/src/fsfw/objectmanager/ObjectManager.cpp +++ b/src/fsfw/objectmanager/ObjectManager.cpp @@ -123,7 +123,7 @@ void ObjectManager::initialize() { #endif errorCount++; } else { - sif::printDebug("ObjectManager::initialize: Initialized onject with ID 0x%x\n", it.first); + sif::printDebug("ObjectManager::initialize: Initialized object with ID 0x%x\n", it.first); } } if (errorCount > 0) { From 383995939ceb186a08178ae627c6b0dd8e57d16b Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Wed, 27 Mar 2024 12:11:42 +0100 Subject: [PATCH 4/7] disabled fsfw cpp ostream again --- misc/defaultcfg/fsfwconfig/FSFWConfig.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/defaultcfg/fsfwconfig/FSFWConfig.h b/misc/defaultcfg/fsfwconfig/FSFWConfig.h index 290904e7..e80abf24 100644 --- a/misc/defaultcfg/fsfwconfig/FSFWConfig.h +++ b/misc/defaultcfg/fsfwconfig/FSFWConfig.h @@ -11,7 +11,7 @@ //! Used to determine whether C++ ostreams are used which can increase //! the binary size significantly. If this is disabled, //! the C stdio functions can be used alternatively -#define FSFW_CPP_OSTREAM_ENABLED 0 +#define FSFW_CPP_OSTREAM_ENABLED 1 //! More FSFW related printouts depending on level. Useful for development. #define FSFW_VERBOSE_LEVEL 1 From 41cdf3c1e89524fff60e06de45c803a6c8c977c4 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Wed, 27 Mar 2024 12:12:36 +0100 Subject: [PATCH 5/7] removed debug message from object manager again --- src/fsfw/objectmanager/ObjectManager.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/fsfw/objectmanager/ObjectManager.cpp b/src/fsfw/objectmanager/ObjectManager.cpp index 9e20c0bf..2de36050 100644 --- a/src/fsfw/objectmanager/ObjectManager.cpp +++ b/src/fsfw/objectmanager/ObjectManager.cpp @@ -122,8 +122,6 @@ void ObjectManager::initialize() { it.first, result); #endif errorCount++; - } else { - sif::printDebug("ObjectManager::initialize: Initialized object with ID 0x%x\n", it.first); } } if (errorCount > 0) { From babb02ebb601ecba112b69c1a3d1ae36bc82ad2e Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Wed, 27 Mar 2024 12:13:01 +0100 Subject: [PATCH 6/7] run auto formatter --- src/fsfw/container/SharedRingBuffer.cpp | 23 ++++++++++--------- .../controller/ExtendedControllerBase.cpp | 3 +-- .../devicehandlers/FreshDeviceHandlerBase.cpp | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/fsfw/container/SharedRingBuffer.cpp b/src/fsfw/container/SharedRingBuffer.cpp index 4be9c09f..88003e2e 100644 --- a/src/fsfw/container/SharedRingBuffer.cpp +++ b/src/fsfw/container/SharedRingBuffer.cpp @@ -52,14 +52,15 @@ DynamicFIFO* SharedRingBuffer::getReceiveSizesFifo() { return receiveSizesFifo; } - ReturnValue_t SharedRingBuffer::fifoEmpty(bool& empty, MutexIF::TimeoutType timeoutType, uint32_t timeoutMs) { - if(receiveSizesFifo == nullptr) { - return returnvalue::FAILED; - } - MutexGuard mg(mutex, timeoutType, timeoutMs); - if(mg.getLockResult() != returnvalue::OK) { - return mg.getLockResult(); - } - empty = receiveSizesFifo->empty(); - return returnvalue::OK; - } \ No newline at end of file +ReturnValue_t SharedRingBuffer::fifoEmpty(bool& empty, MutexIF::TimeoutType timeoutType, + uint32_t timeoutMs) { + if (receiveSizesFifo == nullptr) { + return returnvalue::FAILED; + } + MutexGuard mg(mutex, timeoutType, timeoutMs); + if (mg.getLockResult() != returnvalue::OK) { + return mg.getLockResult(); + } + empty = receiveSizesFifo->empty(); + return returnvalue::OK; +} \ No newline at end of file diff --git a/src/fsfw/controller/ExtendedControllerBase.cpp b/src/fsfw/controller/ExtendedControllerBase.cpp index 8bde6310..63b21ba1 100644 --- a/src/fsfw/controller/ExtendedControllerBase.cpp +++ b/src/fsfw/controller/ExtendedControllerBase.cpp @@ -3,8 +3,7 @@ ExtendedControllerBase::ExtendedControllerBase(object_id_t objectId, size_t commandQueueDepth) : ControllerBase(objectId, commandQueueDepth), poolManager(this, commandQueue), - actionHelper(this, commandQueue) { -} + actionHelper(this, commandQueue) {} ExtendedControllerBase::~ExtendedControllerBase() = default; diff --git a/src/fsfw/devicehandlers/FreshDeviceHandlerBase.cpp b/src/fsfw/devicehandlers/FreshDeviceHandlerBase.cpp index 46ae02de..1b463a37 100644 --- a/src/fsfw/devicehandlers/FreshDeviceHandlerBase.cpp +++ b/src/fsfw/devicehandlers/FreshDeviceHandlerBase.cpp @@ -11,7 +11,7 @@ FreshDeviceHandlerBase::FreshDeviceHandlerBase(DhbConfig config) healthHelper(this, getObjectId()), paramHelper(this), poolManager(this, nullptr), - fdirInstance(config.fdirInstance), + fdirInstance(config.fdirInstance), defaultFdirParent(config.defaultFdirParent) { auto mqArgs = MqArgs(config.objectId, static_cast(this)); messageQueue = QueueFactory::instance()->createMessageQueue( From cc99d987a7039e540c0df4df26242b12a6fbe07a Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Wed, 27 Mar 2024 12:14:19 +0100 Subject: [PATCH 7/7] updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 968608a2..7360d8a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## Fixes +- FreshDeviceHandlerBase did not initialize the fdirInstance - The `PusTmCreator` API only accepted 255 bytes of source data. It can now accept source data with a size limited only by the size of `size_t`. - Important bugfix in CFDP PDU header format: The entity length field and the transaction sequence