TBL verify check for CFE_PLATFORM_TBL_MAX_SNGL_TABLE_SIZE does not match documented description
Describe the bug
According to the desciption in the platform config header, the value for CFE_PLATFORM_TBL_MAX_SNGL_TABLE_SIZE) must be "small enough to allow for #CFE_PLATFORM_TBL_MAX_SIMULTANEOUS_LOADS number of tables to fit into #CFE_PLATFORM_TBL_BUF_MEMORY_BYTES." (see https://github.com/nasa/cFE/blob/d6e610756cc8f2caddf465a92dff92fcd26d8e33/cmake/sample_defs/example_platform_cfg.h#L1369).
However, in modules/tbl/fsw/src/cfe_tbl_verify.h , the logic for checking this appears to be off by one:
#if ((CFE_PLATFORM_TBL_MAX_SIMULTANEOUS_LOADS + 1) * CFE_PLATFORM_TBL_MAX_SNGL_TABLE_SIZE) > \
CFE_PLATFORM_TBL_BUF_MEMORY_BYTES
#error Shared buffers and table of size CFE_PLATFORM_TBL_MAX_SNGL_TABLE_SIZE cannot be greater than memory pool size of CFE_PLATFORM_TBL_BUF_MEMORY_BYTES!
#endif
This leads to compliant configuration values failing to compile.
To Reproduce Steps to reproduce the behavior:
- Edit
CFE_PLATFORM_TBL_MAX_SNGL_TABLE_SIZEandCFE_PLATFORM_ES_MAX_BLOCK_SIZEto be a large value, such as196608 - Edit
CFE_PLATFORM_TBL_BUF_MEMORY_BYTESto be equal toCFE_PLATFORM_TBL_MAX_SNGL_TABLE_SIZE * CFE_PLATFORM_TBL_MAX_SIMULTANEOUS_LOADS(in this case 786432, for the default simultaneous load value of 4). - Try to compile
- See error
[15%] Building C object tbl/CMakeFiles/tbl.dir/fsw/src/cfe_tbl_task.c.o
In file included from cfe/modules/tbl/fsw/src/cfe_tbl_task.c:35:
cfe/modules/tbl/fsw/src/cfe_tbl_verify.h:39:2: error: #error Shared buffers and table of size CFE_PLATFORM_TBL_MAX_SNGL_TABLE_SIZE cannot be greater than memory pool size of CFE_PLATFORM_TBL_BUF_MEMORY_BYTES!
Expected behavior Successful compilation
System observed on:
- Hardware: x86_64
- OS: Rocky Linux 8
- Versions
draco-rc4tag
Reporter Info Isaac Rowe, NASA JSC/Jacobs Technology
may i work on this issue?
@jkeo180 I have a fix at #2632, but the repo maintainers have not responded.