Skip to content

Commit ab2804b

Browse files
committed
Fix parameters, com aggregation
1 parent 24867f6 commit ab2804b

File tree

13 files changed

+148
-201
lines changed

13 files changed

+148
-201
lines changed

CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,5 @@ fprime_setup_included_code()
3434

3535
# This includes project-wide objects
3636
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/FprimeZephyrReference")
37-
if (FPRIME_USE_POSIX)
38-
set_target_properties(Drv_Ip PROPERTIES EXCLUDE_FROM_ALL TRUE)
39-
set_target_properties(Drv_TcpServer PROPERTIES EXCLUDE_FROM_ALL TRUE)
40-
set_target_properties(Drv_TcpClient PROPERTIES EXCLUDE_FROM_ALL TRUE)
41-
set_target_properties(Drv_Udp PROPERTIES EXCLUDE_FROM_ALL TRUE)
42-
endif()
4337
set_target_properties(Svc_FatalHandler PROPERTIES EXCLUDE_FROM_ALL TRUE)
4438
set_target_properties(fprime-zephyr_Drv_ZephyrSpiDriver PROPERTIES EXCLUDE_FROM_ALL TRUE)

FprimeZephyrReference/Components/Drv/RtcManager/RtcManager.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace Drv {
1111
// Component construction and destruction
1212
// ----------------------------------------------------------------------
1313

14-
RtcManager ::RtcManager(const char* const compName) : RtcManagerComponentBase(compName) {
14+
RtcManager ::RtcManager(const char* const compName) : RtcManagerComponentBase(compName), m_console_throttled(false) {
1515
// Initialize device
1616
this->dev = device_get_binding("RV3028");
1717
}
@@ -27,7 +27,12 @@ void RtcManager ::timeGetPort_handler(FwIndexType portNum, Fw::Time& time) {
2727
if (!device_is_ready(this->dev)) {
2828
// Use logger instead of events since this fn is in a critical path for FPrime
2929
// to get time. Events require time, if this method fails an event will fail.
30-
Fw::Logger::log("RTC not ready");
30+
//
31+
// Throttle this message to prevent console flooding and program delays
32+
if (!this->m_console_throttled) {
33+
this->m_console_throttled = true;
34+
Fw::Logger::log("RTC not ready\n");
35+
}
3136
return;
3237
}
3338

FprimeZephyrReference/Components/Drv/RtcManager/RtcManager.fpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ module Drv {
3131
##############################################################################
3232

3333
@ DeviceNotReady event indicates that the RTC is not ready
34-
event DeviceNotReady() severity warning high id 0 format "RTC not ready" throttle 5
34+
event DeviceNotReady() severity warning high id 0 format "RTC not ready" throttle 1
3535

3636
@ TimeSet event indicates that the time was set successfully
3737
event TimeSet(

FprimeZephyrReference/Components/Drv/RtcManager/RtcManager.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@
88

99
#include "FprimeZephyrReference/Components/Drv/RtcManager/RtcManagerComponentAc.hpp"
1010

11+
#include <atomic>
1112
#include <cerrno>
12-
#include <string>
13-
#include <vector>
1413

1514
#include <Fw/Logger/Logger.hpp>
1615

@@ -64,6 +63,7 @@ class RtcManager final : public RtcManagerComponentBase {
6463
// ----------------------------------------------------------------------
6564
// Private helper methods
6665
// ----------------------------------------------------------------------
66+
std::atomic<bool> m_console_throttled; //!< Counter for console throttle
6767

6868
//! Validate time data
6969
bool timeDataIsValid(Drv::TimeData t);

FprimeZephyrReference/ReferenceDeployment/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,5 @@ if (FPRIME_PLATFORM STREQUAL "Zephyr")
2020
"${CMAKE_CURRENT_LIST_DIR}/Main.cpp"
2121
DEPENDS
2222
${FPRIME_CURRENT_MODULE}_Top
23-
CHOOSES_IMPLEMENTATIONS
24-
# Can remain stubs for now
25-
Os_File_Posix
2623
)
2724
endif()

FprimeZephyrReference/ReferenceDeployment/Top/ReferenceDeploymentTopology.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ void setupTopology(const TopologyState& state) {
7979
configComponents(state);
8080
// Project-specific component configuration. Function provided above. May be inlined, if desired.
8181
configureTopology();
82+
// Read parameters from persistent storage
83+
readParameters();
8284
// Autocoded parameter loading. Function provided by autocoder.
8385
loadParameters();
8486
// Autocoded task kick-off (active components). Function provided by autocoder.

FprimeZephyrReference/project/config/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ register_fprime_config(
1313
"${CMAKE_CURRENT_LIST_DIR}/ComCfg.fpp"
1414
"${CMAKE_CURRENT_LIST_DIR}/CommandDispatcherImplCfg.hpp"
1515
"${CMAKE_CURRENT_LIST_DIR}/FileHandlingConfig.fpp"
16-
"${CMAKE_CURRENT_LIST_DIR}/LoRaCfg.hpp"
1716
"${CMAKE_CURRENT_LIST_DIR}/FpConfig.h"
17+
"${CMAKE_CURRENT_LIST_DIR}/FpConstants.fpp"
18+
"${CMAKE_CURRENT_LIST_DIR}/LoRaCfg.hpp"
19+
"${CMAKE_CURRENT_LIST_DIR}/PlatformCfg.fpp"
1820
"${CMAKE_CURRENT_LIST_DIR}/TlmPacketizerCfg.hpp"
19-
"${CMAKE_CURRENT_LIST_DIR}/AcConstants.fpp"
2021
INTERFACE
2122
)

FprimeZephyrReference/project/config/ComCfg.fpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
@ The width of packet descriptors when they are serialized by the framework
1010
type FwPacketDescriptorType = U16
11+
constant SIZE_OF_FwPacketDescriptorType = 2 @< Size of FwPacketDescriptorType in bytes
1112

1213
module ComCfg {
1314

FprimeZephyrReference/project/config/FpConfig.h

Lines changed: 0 additions & 183 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,10 @@ extern "C" {
1717
#include <Fw/Types/BasicTypes.h>
1818
#include <Platform/PlatformTypes.h>
1919

20-
// ----------------------------------------------------------------------
21-
// Type aliases
22-
// ----------------------------------------------------------------------
23-
#define FW_CONTEXT_DONT_CARE 0xFF //!< Don't care value for time contexts in sequences
24-
2520
// ----------------------------------------------------------------------
2621
// Configuration switches
2722
// ----------------------------------------------------------------------
2823

29-
// Boolean values for serialization
30-
#ifndef FW_SERIALIZE_TRUE_VALUE
31-
#define FW_SERIALIZE_TRUE_VALUE (0xFF) //!< Value encoded during serialization for boolean true
32-
#endif
33-
34-
#ifndef FW_SERIALIZE_FALSE_VALUE
35-
#define FW_SERIALIZE_FALSE_VALUE (0x00) //!< Value encoded during serialization for boolean false
36-
#endif
37-
3824
// Allow objects to have names. Allocates storage for each instance
3925
#ifndef FW_OBJECT_NAMES
4026
#define FW_OBJECT_NAMES \
@@ -135,56 +121,6 @@ extern "C" {
135121
#endif
136122
#endif
137123

138-
#if FW_OBJECT_REGISTRATION
139-
// For the simple object registry provided with the framework, this specifies how many objects the registry will store.
140-
#ifndef FW_OBJ_SIMPLE_REG_ENTRIES
141-
#define FW_OBJ_SIMPLE_REG_ENTRIES 500 //!< Number of objects stored in simple object registry
142-
#endif
143-
// When dumping the contents of the registry, this specifies the size of the buffer used to store object names. Should
144-
// be >= FW_OBJ_NAME_BUFFER_SIZE.
145-
#ifndef FW_OBJ_SIMPLE_REG_BUFF_SIZE
146-
#define FW_OBJ_SIMPLE_REG_BUFF_SIZE 255 //!< Size of object registry dump string
147-
#endif
148-
#endif
149-
150-
#if FW_QUEUE_REGISTRATION
151-
// For the simple queue registry provided with the framework, this specifies how many queues the registry will store.
152-
#ifndef FW_QUEUE_SIMPLE_QUEUE_ENTRIES
153-
#define FW_QUEUE_SIMPLE_QUEUE_ENTRIES 100 //!< Number of queues stored in simple queue registry
154-
#endif
155-
#endif
156-
157-
// Specifies the size of the string holding the queue name for queues
158-
#ifndef FW_QUEUE_NAME_BUFFER_SIZE
159-
#define FW_QUEUE_NAME_BUFFER_SIZE 80 //!< Max size of message queue name
160-
#endif
161-
162-
// Specifies the size of the string holding the task name for active components and tasks
163-
#ifndef FW_TASK_NAME_BUFFER_SIZE
164-
#define FW_TASK_NAME_BUFFER_SIZE 80 //!< Max size of task name
165-
#endif
166-
167-
// Specifies the size of the buffer that contains a communications packet.
168-
#ifndef FW_COM_BUFFER_MAX_SIZE
169-
#define FW_COM_BUFFER_MAX_SIZE 233
170-
#endif
171-
172-
// Specifies the size of the buffer attached to state machine signals.
173-
#ifndef FW_SM_SIGNAL_BUFFER_MAX_SIZE
174-
#define FW_SM_SIGNAL_BUFFER_MAX_SIZE 128 // Not to exceed max value of FwSizeType
175-
#endif
176-
177-
// Specifies the size of the buffer that contains the serialized command arguments.
178-
179-
#ifndef FW_CMD_ARG_BUFFER_MAX_SIZE
180-
#define FW_CMD_ARG_BUFFER_MAX_SIZE (FW_COM_BUFFER_MAX_SIZE - sizeof(FwOpcodeType) - sizeof(FwPacketDescriptorType))
181-
#endif
182-
183-
// Specifies the maximum size of a string in a command argument
184-
#ifndef FW_CMD_STRING_MAX_SIZE
185-
#define FW_CMD_STRING_MAX_SIZE 40 //!< Max character size of command string arguments
186-
#endif
187-
188124
// Normally when a command is deserialized, the handler checks to see if there are any leftover
189125
// bytes in the buffer. If there are, it assumes that the command was corrupted somehow since
190126
// the serialized size should match the serialized size of the argument list. In some cases,
@@ -195,63 +131,12 @@ extern "C" {
195131
#define FW_CMD_CHECK_RESIDUAL 1 //!< Check for leftover command bytes
196132
#endif
197133

198-
// Specifies the size of the buffer that contains the serialized log arguments.
199-
#ifndef FW_LOG_BUFFER_MAX_SIZE
200-
#define FW_LOG_BUFFER_MAX_SIZE (FW_COM_BUFFER_MAX_SIZE - sizeof(FwEventIdType) - sizeof(FwPacketDescriptorType))
201-
#endif
202-
203-
// Specifies the maximum size of a string in a log event
204-
// Note: This constant truncates file names in assertion failure event reports
205-
#ifndef FW_LOG_STRING_MAX_SIZE
206-
#define FW_LOG_STRING_MAX_SIZE 200 //!< Max size of log string parameter type
207-
#endif
208-
209-
// Specifies the size of the buffer that contains the serialized telemetry value.
210-
#ifndef FW_TLM_BUFFER_MAX_SIZE
211-
#define FW_TLM_BUFFER_MAX_SIZE (FW_COM_BUFFER_MAX_SIZE - sizeof(FwChanIdType) - sizeof(FwPacketDescriptorType))
212-
#endif
213-
214-
// Specifies the size of the buffer that contains statement args for the FpySequencer
215-
#ifndef FW_STATEMENT_ARG_BUFFER_MAX_SIZE
216-
#define FW_STATEMENT_ARG_BUFFER_MAX_SIZE (FW_CMD_ARG_BUFFER_MAX_SIZE)
217-
#endif
218-
219-
// Specifies the maximum size of a string in a telemetry channel
220-
#ifndef FW_TLM_STRING_MAX_SIZE
221-
#define FW_TLM_STRING_MAX_SIZE 40 //!< Max size of channelized telemetry string type
222-
#endif
223-
224-
// Specifies the size of the buffer that contains the serialized parameter value.
225-
#ifndef FW_PARAM_BUFFER_MAX_SIZE
226-
#define FW_PARAM_BUFFER_MAX_SIZE (FW_COM_BUFFER_MAX_SIZE - sizeof(FwPrmIdType) - sizeof(FwPacketDescriptorType))
227-
#endif
228-
229-
// Specifies the maximum size of a string in a parameter
230-
#ifndef FW_PARAM_STRING_MAX_SIZE
231-
#define FW_PARAM_STRING_MAX_SIZE 40 //!< Max size of parameter string type
232-
#endif
233-
234-
// Specifies the maximum size of a file upload chunk
235-
#ifndef FW_FILE_BUFFER_MAX_SIZE
236-
#define FW_FILE_BUFFER_MAX_SIZE FW_COM_BUFFER_MAX_SIZE //!< Max size of file buffer (i.e. chunk of file)
237-
#endif
238-
239-
// Specifies the maximum size of a string in an interface call
240-
#ifndef FW_INTERNAL_INTERFACE_STRING_MAX_SIZE
241-
#define FW_INTERNAL_INTERFACE_STRING_MAX_SIZE 256 //!< Max size of interface string parameter type
242-
#endif
243-
244134
// Enables text logging of events as well as data logging. Adds a second logging port for text output.
245135
// In order to set this to 0, FPRIME_ENABLE_TEXT_LOGGERS must be set to OFF.
246136
#ifndef FW_ENABLE_TEXT_LOGGING
247137
#define FW_ENABLE_TEXT_LOGGING 1 //!< Indicates whether text logging is turned on
248138
#endif
249139

250-
// Define the size of the text log string buffer. Should be large enough for format string and arguments
251-
#ifndef FW_LOG_TEXT_BUFFER_SIZE
252-
#define FW_LOG_TEXT_BUFFER_SIZE 256 //!< Max size of string for text log message
253-
#endif
254-
255140
// Define if serializables have toString() method. Turning off will save code space and
256141
// string constants. Must be enabled if text logging enabled
257142
#ifndef FW_SERIALIZABLE_TO_STRING
@@ -263,74 +148,6 @@ extern "C" {
263148
#define FW_AMPCS_COMPATIBLE 0 //!< Whether or not JPL AMPCS ground system support is enabled.
264149
#endif
265150

266-
// Configuration for Fw::String
267-
268-
#ifndef FW_FIXED_LENGTH_STRING_SIZE
269-
#define FW_FIXED_LENGTH_STRING_SIZE 256 //!< Character array size for Fw::String
270-
#endif
271-
272-
// OS configuration
273-
#ifndef FW_CONSOLE_HANDLE_MAX_SIZE
274-
#define FW_CONSOLE_HANDLE_MAX_SIZE 24 //!< Maximum size of a handle for OS queues
275-
#endif
276-
277-
#ifndef FW_TASK_HANDLE_MAX_SIZE
278-
#define FW_TASK_HANDLE_MAX_SIZE 224 //!< Maximum size of a handle for OS queues
279-
#endif
280-
281-
#ifndef FW_FILE_HANDLE_MAX_SIZE
282-
#define FW_FILE_HANDLE_MAX_SIZE 16 //!< Maximum size of a handle for OS queues
283-
#endif
284-
285-
#ifndef FW_MUTEX_HANDLE_MAX_SIZE
286-
#define FW_MUTEX_HANDLE_MAX_SIZE 72 //!< Maximum size of a handle for OS queues
287-
#endif
288-
289-
#ifndef FW_QUEUE_HANDLE_MAX_SIZE
290-
#define FW_QUEUE_HANDLE_MAX_SIZE 352 //!< Maximum size of a handle for OS queues
291-
#endif
292-
293-
#ifndef FW_DIRECTORY_HANDLE_MAX_SIZE
294-
#define FW_DIRECTORY_HANDLE_MAX_SIZE 16 //!< Maximum size of a handle for OS resources (files, queues, locks, etc.)
295-
#endif
296-
297-
#ifndef FW_FILESYSTEM_HANDLE_MAX_SIZE
298-
#define FW_FILESYSTEM_HANDLE_MAX_SIZE 16 //!< Maximum size of a handle for OS resources (files, queues, locks, etc.)
299-
#endif
300-
301-
#ifndef FW_RAW_TIME_HANDLE_MAX_SIZE
302-
#define FW_RAW_TIME_HANDLE_MAX_SIZE 32 //!< Maximum size of a handle for OS::RawTime objects
303-
#endif
304-
305-
#ifndef FW_RAW_TIME_SERIALIZATION_MAX_SIZE
306-
#define FW_RAW_TIME_SERIALIZATION_MAX_SIZE 8 //!< Maximum allowed serialization size for Os::RawTime objects
307-
#endif
308-
309-
#ifndef FW_CONDITION_VARIABLE_HANDLE_MAX_SIZE
310-
#define FW_CONDITION_VARIABLE_HANDLE_MAX_SIZE 56 //!< Maximum size of a handle for OS condition variables
311-
#endif
312-
313-
#ifndef FW_CPU_HANDLE_MAX_SIZE
314-
#define FW_CPU_HANDLE_MAX_SIZE 16 //!< Maximum size of a handle for OS cpu
315-
#endif
316-
317-
#ifndef FW_MEMORY_HANDLE_MAX_SIZE
318-
#define FW_MEMORY_HANDLE_MAX_SIZE 16 //!< Maximum size of a handle for OS memory
319-
#endif
320-
321-
#ifndef FW_HANDLE_ALIGNMENT
322-
#define FW_HANDLE_ALIGNMENT 8 //!< Alignment of handle storage
323-
#endif
324-
325-
// Note: One buffer of this size will be stack-allocated during certain OSAL operations e.g. when copying a file
326-
#ifndef FW_FILE_CHUNK_SIZE
327-
#define FW_FILE_CHUNK_SIZE 512 //!< Chunk size for working with files in the OSAL layer
328-
#endif
329-
330-
#ifndef FW_ASSERT_COUNT_MAX
331-
#define FW_ASSERT_COUNT_MAX 4
332-
#endif
333-
334151
// *** NOTE configuration checks are in Fw/Cfg/ConfigCheck.cpp in order to have
335152
// the type definitions in Fw/Types/BasicTypes available.
336153
#ifdef __cplusplus

0 commit comments

Comments
 (0)