-
|
Hello, While looking to implement system time on a raspberry pi as the timestamp source for messages (based on this discussion #446) I've been trying to figure out the right way to set CFE_PLATFORM_TIME_CFG_SOURCE and CFE_PLATFORM_TIME_CFG_SRC_TIME to true. I did find those settings under default_cfe_time_internal_cfg.h ... but those are supposed to be defaults. After some digging I realized that CMake generates headers that include these defaults, by default, and that I should provide a separate header file somewhere to override these defaults. The old way of doing this is by writing a single cfe_mission_cfg.h or cfe_platform_cfg.h file, somewhere, to override any setting. But this is not recommended anymore, and I should override individual configuration headers manually now. What's not clear to me is how do I go about this. I need to write a header and override those defines, that much I know, but where should it go, and how does it get included in the build process? Should I include anything in my header? Should I use #undef before using #define? In general, I've been having trouble understanding the build system used in cFS and how a developer would use it, and I couldn't find any guide walking through how it works apart from READMEs and little bits of information here and there. Is there a guide that I should be following? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
I believe the conventional location is in And yes , unfortunately, the build system is not well-documented. In my opinion, your best bet is the README under
export MISSIONCONFIG=<my_mission> # optional if there is only one mission configuration at `mission_defs`
# Assuming you start from the top-level folder containing cFE and your `apps` folder
mkdir build
cd build
cmake -S ../cfe # Configures and generates build system using the CMakeLists.txt in cFE
cmake --build -- mission-all # Can also just run `make mission-all`
cmake --build -- mission-install # Can also just run `make mission-install`Other targets you can use: To see all the targets, run You can pass variables to CMake to change how the build is configured. For example, You'll see in some of the docs like the cFS README and cFE CMake README that there is a top-level Makefile you can use (copied from cfe/cmake/Makefile.sample). This is really just a wrapper for calling CMake and I personally don't recommend using it since that is a very unconventional way to invoke CMake. |
Beta Was this translation helpful? Give feedback.
I believe the conventional location is in
<arch>_platform_cfg.h, which goes in a directory called<MISSIONCONFIG>_defsat the same level as cFE in your project tree. For an example, seecfe/cmake/sample_defs/example_platform_cfg.h. This folder is typically where you will want to put any of your override headers.And yes , unfortunately, the build system is not well-documented. In my opinion, your best bet is the README under
cfe/cmake(although this hasn't been updated in some time) and the headers of the CMake files themselves, especiallyarch_build.cmake.mission_defsfolder. You can get an example atcfe/cmake/sample_defs/. There are comments in some of the files indicating w…