-
Notifications
You must be signed in to change notification settings - Fork 204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhance config module to support lists/arrays generated at compile time #2564
Labels
Comments
jphickey
added a commit
to jphickey/cFE
that referenced
this issue
May 21, 2024
Improve the config module to handle platform-specific definitions from the "cfe_platform_cfg.h" file. Specifically this can generate static tables/lists for items that cannot be simply handled via the C preprocessor. Notable examples are the mem pool size lists and the allowable processor/spacecraft IDs in table services.
2 tasks
jphickey
added a commit
to jphickey/cFE
that referenced
this issue
May 21, 2024
Improve the config module to handle platform-specific definitions from the "cfe_platform_cfg.h" file. Specifically this can generate static tables/lists for items that cannot be simply handled via the C preprocessor. Notable examples are the mem pool size lists and the allowable processor/spacecraft IDs in table services.
jphickey
added a commit
to jphickey/cFE
that referenced
this issue
May 21, 2024
Improve the config module to handle platform-specific definitions from the "cfe_platform_cfg.h" file. Specifically this can generate static tables/lists for items that cannot be simply handled via the C preprocessor. Notable examples are the mem pool size lists and the allowable processor/spacecraft IDs in table services.
jphickey
added a commit
to jphickey/cFE
that referenced
this issue
May 21, 2024
Improve the config module to handle platform-specific definitions from the "cfe_platform_cfg.h" file. Specifically this can generate static tables/lists for items that cannot be simply handled via the C preprocessor. Notable examples are the mem pool size lists and the allowable processor/spacecraft IDs in table services.
dzbaker
added a commit
that referenced
this issue
Aug 2, 2024
Fix #2564, add config tool for platform-specific settings
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
CFE has some features that necessitate a list or array-like structure that is defined by the user. A prime example is the list of block sizes for the mem pools - the sizes are defined in the platform configuration header file as a series of
#define
values:cFE/modules/es/config/default_cfe_es_internal_cfg.h
Lines 731 to 747 in 505baa1
The problem comes in because this is then turned into an array, inside one of the .c source files:
cFE/modules/es/fsw/src/cfe_es_mempool.c
Lines 61 to 67 in 505baa1
As this source file is not easily overridden by a user, the net effect here is that although the list size looks configurable (e.g. there is a
CFE_PLATFORM_ES_POOL_MAX_BUCKETS
item in the configurable header) it cannot actually be changed. The default is 17, and if set lower than 17, this code fails to compile (too many elements in initializer) and if set higher than 17, the addition elements are ignored, even if they are defined in the header.Describe the solution you'd like
The build system can handle this by generating the above array snippet based on the actual configured list size. This will also ensure that the user has defined all the needed macros to fulfill the list size they have specified (that is, if the user sets the number of buckets at 18 instead of 17 but forgets to add an 18th size macro, it can catch this at compile time, rather than silently compiling and running but doing something unexpected)
Describe alternatives you've considered
N/A
Additional context
The "config" module of CFE is the ideal place to put something like this, and it can be bound to the
mission-prebuild
compile step which is the top level target for tasks that should be performed prior to building any target code.Requester Info
Joseph Hickey, Vantage Systems, Inc.
The text was updated successfully, but these errors were encountered: