Skip to content

Commit

Permalink
Fix nasa#2447, updating cFE to use new versioning system.
Browse files Browse the repository at this point in the history
  • Loading branch information
dzbaker committed Dec 27, 2023
1 parent 0316672 commit 7ccee61
Show file tree
Hide file tree
Showing 81 changed files with 1,715 additions and 681 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,18 @@ jobs:
- name: Test
run: |
lcov --capture --initial --directory build --output-file coverage_base.info
make -C build/native/default_cpu1/config test
make -C build/native/default_cpu1/core_api test
make -C build/native/default_cpu1/core_private test
make -C build/native/default_cpu1/es test
make -C build/native/default_cpu1/evs test
make -C build/native/default_cpu1/fs test
make -C build/native/default_cpu1/msg test
make -C build/native/default_cpu1/resourceid test
make -C build/native/default_cpu1/sb test
make -C build/native/default_cpu1/sbr test
make -C build/native/default_cpu1/tbl test
make -C build/native/default_cpu1/time test
(cd build/native/default_cpu1/config && ctest --output-on-failure)
(cd build/native/default_cpu1/core_api && ctest --output-on-failure)
(cd build/native/default_cpu1/core_private && ctest --output-on-failure)
(cd build/native/default_cpu1/es && ctest --output-on-failure)
(cd build/native/default_cpu1/evs && ctest --output-on-failure)
(cd build/native/default_cpu1/fs && ctest --output-on-failure)
(cd build/native/default_cpu1/msg && ctest --output-on-failure)
(cd build/native/default_cpu1/resourceid && ctest --output-on-failure)
(cd build/native/default_cpu1/sb && ctest --output-on-failure)
(cd build/native/default_cpu1/sbr && ctest --output-on-failure)
(cd build/native/default_cpu1/tbl && ctest --output-on-failure)
(cd build/native/default_cpu1/time && ctest --output-on-failure)
- name: Calculate Coverage
run: |
Expand Down
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Changelog

## Development Build: v7.0.0-rc4+dev434
- Update docs and UT to use CFE_MSG_PTR
- document ES Perf enums
- document and use topicid numbers for cfe
- See <https://github.com/nasa/cFE/pull/2472>, <https://github.com/nasa/cFE/pull/2411>, and <https://github.com/nasa/cFE/pull/2474>

## Development Build: v7.0.0-rc4+dev424
- Add perfid limit info to ES docstring
- TBL UT update for OSAL/CFE path length mismatch
- add multi threaded SB perf tests
- message integrity API
- change workflow to use output on failure option
- See <https://github.com/nasa/cFE/pull/2409>, <https://github.com/nasa/cFE/pull/2373>, <https://github.com/nasa/cFE/pull/2466>, <https://github.com/nasa/cFE/pull/2468>, and <https://github.com/nasa/cFE/pull/2470>

## Development Build: v7.0.0-rc4+dev411
- rename reference table
- Remove nonexist reference for perf tool
- See <https://github.com/nasa/cFE/pull/2462> and <https://github.com/nasa/cFE/pull/2408>

## Development Build: v7.0.0-rc4+dev405
- add code coverage for null check
- See <https://github.com/nasa/cFE/pull/2377>
Expand Down
79 changes: 78 additions & 1 deletion cmake/arch_build.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,81 @@ function(cfs_app_check_intf MODULE_NAME)
endfunction(cfs_app_check_intf)


##################################################################
#
# FUNCTION: setup_platform_msgids
#
# This is intended to support cases where MsgIDs for all apps
# and modules are assigned in a single/unified header file
#
function(setup_platform_msgids)

set(PLATFORM_MSGID_HEADERFILE)

# In an EDS build, the msg IDs always come from EDS, there should not be a local msgids.h file
if (NOT CFE_EDS_ENABLED_BUILD)

# Check for the presence of a platform-specific msgid file
# This uses cfe_locate_implementation_file() as this returns whether or not it found one
cfe_locate_implementation_file(PLATFORM_MSGID_HEADERFILE "msgids.h"
PREFIX ${BUILD_CONFIG} cfs
SUBDIR config
)

# If a top level file was found, then create a wrapper around it called "cfs_msgids.h"
# Note that at this point it could be a list
if (PLATFORM_MSGID_HEADERFILE)

set(TEMP_WRAPPER_FILE_CONTENT)
foreach(SELECTED_FILE ${PLATFORM_MSGID_HEADERFILE})
file(TO_NATIVE_PATH "${SELECTED_FILE}" SRC_NATIVE_PATH)
list(APPEND TEMP_WRAPPER_FILE_CONTENT "#include \"${SRC_NATIVE_PATH}\"\n")
endforeach()

# Generate a header file
generate_c_headerfile("${CMAKE_BINARY_DIR}/inc/cfs_msgids.h" ${TEMP_WRAPPER_FILE_CONTENT})
unset(TEMP_WRAPPER_FILE_CONTENT)

# From here on use the wrapper file
set(PLATFORM_MSGID_HEADERFILE "cfs_msgids.h")

endif(PLATFORM_MSGID_HEADERFILE)

endif(NOT CFE_EDS_ENABLED_BUILD)

# Finally, export a CFGFILE_SRC variable for each of the deps
# This should make each respective "mission_build" create a wrapper
# that points directly at this global file, ignoring the default
if (PLATFORM_MSGID_HEADERFILE)

# Historically there has been a cfe_msgids.h defined at the core api level
# be sure to include this in the export list
set (OUTPUT_VAR_LIST
CORE_API_CFGFILE_SRC_cfe_msgids
)

# Slight inconsistency: for CFE core components, the cfe_ prefix is omitted in DEP_NAME
# To make this work without major impact, add it back in here
foreach(DEP_NAME ${MISSION_CORE_MODULES})
string(TOUPPER "${DEP_NAME}_CFGFILE_SRC" CFGSRC)
list(APPEND OUTPUT_VAR_LIST ${CFGSRC}_cfe_${DEP_NAME}_msgids)
endforeach(DEP_NAME ${MISSION_CORE_MODULES})

foreach(DEP_NAME ${MISSION_APPS})
string(TOUPPER "${DEP_NAME}_CFGFILE_SRC" CFGSRC)
list(APPEND OUTPUT_VAR_LIST ${CFGSRC}_${DEP_NAME}_msgids)
endforeach(DEP_NAME ${MISSION_APPS})

# This is the actual export to parent scope
foreach(VAR_NAME ${OUTPUT_VAR_LIST})
message("${VAR_NAME}=${PLATFORM_MSGID_HEADERFILE}")
set(${VAR_NAME} ${PLATFORM_MSGID_HEADERFILE} PARENT_SCOPE)
endforeach(VAR_NAME ${OUTPUT_VAR_LIST})

endif (PLATFORM_MSGID_HEADERFILE)

endfunction(setup_platform_msgids)



##################################################################
Expand Down Expand Up @@ -658,6 +733,9 @@ function(prepare)
list(REMOVE_AT BUILD_CONFIG 0)
set(BUILD_CONFIG ${BUILD_CONFIG} PARENT_SCOPE)

# Check if the user has provided a platform-specific "msgids.h" file and set up a wrapper to it
setup_platform_msgids()

# Pull in any application-specific platform-scope configuration
# This may include user configuration files such as cfe_platform_cfg.h,
# or any other configuration/preparation that needs to happen at
Expand Down Expand Up @@ -746,7 +824,6 @@ function(process_arch SYSVAR)
endif()
endforeach()


# Add all core modules
# The osal is handled explicitly (above) since this has special extra config
foreach(DEP ${MISSION_CORE_INTERFACES} ${MISSION_CORE_MODULES})
Expand Down
75 changes: 75 additions & 0 deletions cmake/mission_build.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,78 @@ function(generate_build_version_templates)

endfunction(generate_build_version_templates)

##################################################################
#
# FUNCTION: setup_global_topicids
#
# This is intended to support cases where topic IDs for all apps
# and modules are assigned in a single/unified header file
#
function(setup_global_topicids)

if (CFE_EDS_ENABLED_BUILD)

# In an EDS build, the topic IDs always come from EDS
set(MISSION_GLOBAL_TOPICID_HEADERFILE "cfe_mission_eds_designparameters.h")

else(CFE_EDS_ENABLED_BUILD)

# Check for the presence of a mission-wide/global topic ID file
# This uses cfe_locate_implementation_file() as this returns whether or not it found one
cfe_locate_implementation_file(MISSION_GLOBAL_TOPICID_HEADERFILE "global_topicids.h"
PREFIX ${MISSIONCONFIG} cfs
SUBDIR config
)

# If a top level file was found, then create a wrapper around it called "cfs_global_topicids.h"
# Note that at this point it could be a list
if (MISSION_GLOBAL_TOPICID_HEADERFILE)

set(TEMP_WRAPPER_FILE_CONTENT)
foreach(SELECTED_FILE ${MISSION_GLOBAL_TOPICID_HEADERFILE})
file(TO_NATIVE_PATH "${SELECTED_FILE}" SRC_NATIVE_PATH)
list(APPEND TEMP_WRAPPER_FILE_CONTENT "#include \"${SRC_NATIVE_PATH}\"\n")
endforeach()

# Generate a header file
generate_c_headerfile("${CMAKE_BINARY_DIR}/inc/cfs_global_topicids.h" ${TEMP_WRAPPER_FILE_CONTENT})
unset(TEMP_WRAPPER_FILE_CONTENT)

# From here on use the wrapper file
set(MISSION_GLOBAL_TOPICID_HEADERFILE "cfs_global_topicids.h")

endif(MISSION_GLOBAL_TOPICID_HEADERFILE)

endif(CFE_EDS_ENABLED_BUILD)

# Finally, export a CFGFILE_SRC variable for each of the deps
# This should make each respective "mission_build" create a wrapper
# that points directly at this global file, ignoring the default
if (MISSION_GLOBAL_TOPICID_HEADERFILE)

set (OUTPUT_VAR_LIST)

# Slight inconsistency: for CFE core components, the cfe_ prefix is omitted in DEP_NAME
# To make this work without major impact, add it back in here
foreach(DEP_NAME ${MISSION_CORE_MODULES})
string(TOUPPER "${DEP_NAME}_CFGFILE_SRC" CFGSRC)
list(APPEND OUTPUT_VAR_LIST ${CFGSRC}_cfe_${DEP_NAME}_topicids)
endforeach(DEP_NAME ${MISSION_CORE_MODULES})

foreach(DEP_NAME ${MISSION_APPS})
string(TOUPPER "${DEP_NAME}_CFGFILE_SRC" CFGSRC)
list(APPEND OUTPUT_VAR_LIST ${CFGSRC}_${DEP_NAME}_topicids)
endforeach(DEP_NAME ${MISSION_APPS})

# This is the actual export to parent scope
foreach(VAR_NAME ${OUTPUT_VAR_LIST})
set(${VAR_NAME} ${MISSION_GLOBAL_TOPICID_HEADERFILE} PARENT_SCOPE)
endforeach(VAR_NAME ${OUTPUT_VAR_LIST})

endif (MISSION_GLOBAL_TOPICID_HEADERFILE)

endfunction(setup_global_topicids)

##################################################################
#
# FUNCTION: prepare
Expand Down Expand Up @@ -348,6 +420,9 @@ function(prepare)
add_dependencies(cfe-usersguide doc-prebuild)
add_dependencies(mission-doc doc-prebuild)

# Set up the global topicid header file, if present
setup_global_topicids()

# Pull in any application-specific mission-scope configuration
# This may include user configuration files such as cfe_mission_cfg.h,
# msgid definitions, or any other configuration/preparation that needs to
Expand Down
4 changes: 2 additions & 2 deletions cmake/sample_defs/cpu1_cfe_es_startup.scr
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
CFE_LIB, cfe_assert, CFE_Assert_LibInit, ASSERT_LIB, 0, 0, 0x0, 0;
CFE_LIB, sample_lib, SAMPLE_LIB_Init, SAMPLE_LIB, 0, 0, 0x0, 0;
CFE_APP, sample_app, SAMPLE_APP_Main, SAMPLE_APP, 50, 16384, 0x0, 0;
CFE_APP, ci_lab, CI_Lab_AppMain, CI_LAB_APP, 60, 16384, 0x0, 0;
CFE_APP, ci_lab, CI_LAB_AppMain, CI_LAB_APP, 60, 16384, 0x0, 0;
CFE_APP, to_lab, TO_LAB_AppMain, TO_LAB_APP, 70, 16384, 0x0, 0;
CFE_APP, sch_lab, SCH_Lab_AppMain, SCH_LAB_APP, 80, 16384, 0x0, 0;
CFE_APP, sch_lab, SCH_LAB_AppMain, SCH_LAB_APP, 80, 16384, 0x0, 0;
!
! Startup script fields:
! 1. Object Type -- CFE_APP for an Application, or CFE_LIB for a library.
Expand Down
20 changes: 9 additions & 11 deletions cmake/sample_defs/example_platform_cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,26 @@
* limitations under the License.
************************************************************************/

/**
/**
* @file
*
* This header file contains the internal configuration parameters and
* typedefs with platform scope.
*
*
* This provides default values for configurable items that do NOT affect
* the interface(s) of this module. This includes internal parameters,
* path names, and limit value(s) that are relevant for a specific platform.
*
*
* @note It is no longer necessary to provide this file directly in the defs
* directory, but if present, this file is still supported/usable for backward
* directory, but if present, this file is still supported/usable for backward
* compatibility. To use this file, is should be called "cfe_platform_cfg.h".
*
*
* Going forward, more fine-grained (module/purposes-specific) header files are
* included with each submodule. These may be overridden as necessary, but only
* if a definition within that file needs to be changed from the default. This
* approach will reduce the amount of duplicate/cloned definitions and better
* approach will reduce the amount of duplicate/cloned definitions and better
* support alternative build configurations in the future.
*
*
* Note that if this file is present, the fine-grained header files noted above
* will _not_ be used.
*/
Expand Down Expand Up @@ -83,7 +83,6 @@
*/
#define CFE_PLATFORM_CORE_MAX_STARTUP_MSEC 30000


/*******************************************************************************/
/*
* CFE Executive Services (CFE_ES) Application Private Config Definitions
Expand Down Expand Up @@ -1726,7 +1725,7 @@
*/
#define CFE_PLATFORM_TIME_START_TASK_PRIORITY 60
#define CFE_PLATFORM_TIME_TONE_TASK_PRIORITY 25
#define CFE_PLATFORM_TIME_1HZ_TASK_PRIORITY 25
#define CFE_PLATFORM_TIME_ONEHZ_TASK_PRIORITY 25

/**
** \cfetimecfg Define TIME Task Stack Sizes
Expand All @@ -1745,7 +1744,6 @@
*/
#define CFE_PLATFORM_TIME_START_TASK_STACK_SIZE CFE_PLATFORM_ES_DEFAULT_STACK_SIZE
#define CFE_PLATFORM_TIME_TONE_TASK_STACK_SIZE 4096
#define CFE_PLATFORM_TIME_1HZ_TASK_STACK_SIZE 8192
#define CFE_PLATFORM_TIME_ONEHZ_TASK_STACK_SIZE 8192

#endif /* EXAMPLE_PLATFORM_CFG_H */

2 changes: 1 addition & 1 deletion cmake/target/src/target_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include "cfe_es.h"
#include "cfe_time.h"
#include "cfe_es_resetdata_typedef.h"
#include "cfe_version.h" /* for CFE_VERSION_STRING */
#include "cfe_version.h" /* for CFE version information */
#include "osapi-version.h" /* for OS_VERSION_STRING */

#ifndef CFE_CPU_NAME_VALUE
Expand Down
18 changes: 9 additions & 9 deletions docs/cFE Application Developers Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -1916,7 +1916,7 @@ FILE: sample_app.h
*/
typedef struct
{
CFE_MSG_TelemetryHeader_t TlmHeader;
CFE_MSG_TelemetryHeader_t TelemetryHeader;

/*
** Task command interface counters...
Expand Down Expand Up @@ -1949,7 +1949,7 @@ SAMPLE_AppData_t SAMPLE_AppData; /* Instantiate Task Data */
int32 Status;

...
Status = CFE_MSG_Init(&SAMPLE_AppData.HkPacket.TlmHeader.Msg, /* Address of SB Message Data Buffer */
Status = CFE_MSG_Init(CFE_MSG_PTR(SAMPLE_AppData.HkPacket.TelemetryHeader), /* Location of SB Message Data Buffer */
SAMPLE_HK_TLM_MID, /* SB Message ID associated with Data */
sizeof(SAMPLE_AppData.HkPacket)); /* Size of Buffer */
...
Expand Down Expand Up @@ -2107,8 +2107,8 @@ SAMPLE_AppData_t SAMPLE_AppData; /* Instantiate Task Data */
/*
** Send housekeeping telemetry packet...
*/
CFE_SB_TimeStampMsg(&SAMPLE_APP_Data.HkTlm.TlmHeader.Msg);
CFE_SB_TransmitMsg(&SAMPLE_APP_Data.HkTlm.TlmHeader.Msg, true);
CFE_SB_TimeStampMsg(CFE_MSG_PTR(SAMPLE_APP_Data.HkTlm.TelemetryHeader));
CFE_SB_TransmitMsg(CFE_MSG_PTR(SAMPLE_APP_Data.HkTlm.TelemetryHeader), true);
...
}
```
Expand Down Expand Up @@ -2222,7 +2222,7 @@ FILE: sample_app.h
*/
typedef struct
{
CFE_MSG_CommandHeader_t TlmHeader;
CFE_MSG_CommandHeader_t TelemetryHeader;

/*
** Task command interface counters...
Expand Down Expand Up @@ -2255,17 +2255,17 @@ SAMPLE_AppData_t SAMPLE_AppData; /* Instantiate Task Data */
*/
SAMPLE_AppData.BigPktBuf = (SAMPLE_BigPkt_Buffer_t *)CFE_SB_AllocateMessageBuffer(sizeof(SAMPLE_BigPkt_t));

CFE_MSG_Init(SAMPLE_AppData.BigPktBuf->Pkt.TlmHeader.Msg, SAMPLE_BIG_TLM_MID,
sizeof(SAMPLE_AppData.BigPktBuf->Pkt);
CFE_MSG_Init(SAMPLE_AppData.BigPktBuf->Pkt.TelemetryHeader.Msg, SAMPLE_BIG_TLM_MID,
sizeof(SAMPLE_AppData.BigPktBuf->Pkt));

/*
** ...Fill Packet with Data...
*/

/*
/*
** Send Message after time tagging it with current time
*/
CFE_SB_TimeStampMsg(&SAMPLE_AppData.BigPktBuf->Pkt.TlmHeader.Msg);
CFE_SB_TimeStampMsg(&SAMPLE_AppData.BigPktBuf->Pkt.TelemetryHeader.Msg);
CFE_SB_TransmitBuffer(SAMPLE_AppData.BigPktBuf, BufferHandle, true);
/* SAMPLE_AppData.BigPktBuf is no longer a valid pointer */
...
Expand Down
Loading

0 comments on commit 7ccee61

Please sign in to comment.