Skip to content

Commit

Permalink
Merge pull request nasa#1492 from nasa/integration-candidate
Browse files Browse the repository at this point in the history
cFE Integration candidate: 2021-05-11
  • Loading branch information
astrogeco authored May 12, 2021
2 parents 82c1bd4 + babfaad commit 84ba9a9
Show file tree
Hide file tree
Showing 53 changed files with 6,471 additions and 4,661 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

- name: Run bundle cppcheck
if: ${{matrix.cppcheck =='all'}}
run: cppcheck --force --inline-suppr --quiet . 2> ${{matrix.cppcheck}}_cppcheck_err.txt
run: cppcheck --force --inline-suppr . 2> ${{matrix.cppcheck}}_cppcheck_err.txt

# Run strict static analysis for embedded portions of cfe
- name: cfe strict cppcheck
Expand Down
29 changes: 0 additions & 29 deletions .travis.yml

This file was deleted.

13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@ The detailed cFE user's guide can be viewed at <https://github.com/nasa/cFS/blob

## Version History

### Development Build: v6.8.0-rc1+dev575

- Removes broken travis-ci script
- Updates CFE core stub libraries to use stubs generated from new UT Assert script. Converts existing stub logic to
a default handler routine.
- Moves all of the internal API prototypes from "core_api" to the "core_private" interface lib.
- Moves `CFE_FS_RunBackgroundFileDump` to internal API
- Renames hook files to handler
- [docs] Adds documentation and comments about how the configuration facility works and where to find information on the complete set of options available
- Updates the configuration files in "sample_defs" to reflect only those parameters that are set to a non-default value along with information about why the configurable item is changed.
- Removes --quiet option so files checked go to stdout


### Development Build: v6.8.0-rc1+dev559

- Adds tests for nominal use cases of the ES Critical Data Store API.
Expand Down
10 changes: 5 additions & 5 deletions cmake/arch_build.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,6 @@ function(add_cfe_tables APP_NAME TBL_SRC_FILES)
add_library(${TGT}_${TBLWE}-obj STATIC ${TBL_SRC})
target_link_libraries(${TGT}_${TBLWE}-obj PRIVATE core_api)

get_filename_component(TBLOBJ ${TBL} NAME)
string(APPEND TBLOBJ ${CMAKE_C_OUTPUT_EXTENSION})

# IMPORTANT: This rule assumes that the output filename of elf2cfetbl matches
# the input file name but with a different extension (.o -> .tbl)
# The actual output filename is embedded in the source file (.c), however
Expand All @@ -208,8 +205,11 @@ function(add_cfe_tables APP_NAME TBL_SRC_FILES)
# current content of a dependency (rightfully so).
add_custom_command(
OUTPUT "${TABLE_DESTDIR}/${TBLWE}.tbl"
COMMAND ${CMAKE_AR} x $<TARGET_FILE:${TGT}_${TBLWE}-obj>
COMMAND ${MISSION_BINARY_DIR}/tools/elf2cfetbl/elf2cfetbl "${TBLOBJ}"
COMMAND ${CMAKE_COMMAND}
-DCMAKE_AR=${CMAKE_AR}
-DTBLTOOL=${MISSION_BINARY_DIR}/tools/elf2cfetbl/elf2cfetbl
-DLIB=$<TARGET_FILE:${TGT}_${TBLWE}-obj>
-P ${CFE_SOURCE_DIR}/cmake/generate_table.cmake
DEPENDS ${MISSION_BINARY_DIR}/tools/elf2cfetbl/elf2cfetbl ${TGT}_${TBLWE}-obj
WORKING_DIRECTORY ${TABLE_DESTDIR}
)
Expand Down
48 changes: 48 additions & 0 deletions cmake/generate_table.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
##################################################################
#
# Sub-script to generate a table file via elf2cfetbl
#
# This small script runs at build time (as opposed to prep time)
# which converts a static library (.a) with a single object into a
# table (.tbl) file
#
##################################################################

#
# Required passed in values:
# CMAKE_AR => path to "ar" utility for working with static lib files
# TBLTOOL => path to "elf2cfetbl" utility
# LIB => name of library file to convert
#
# This assumes/requires that the static library has a single object in it.
# Note, In newer versions of CMake an object library can be used. This workaround
# is intended to also be compatible with older CMake versions.
#

# First run "ar t" to get the object file name, there should be only 1 file.
execute_process(COMMAND ${CMAKE_AR} t "${LIB}"
OUTPUT_VARIABLE OBJNAME
RESULT_VARIABLE RESULT
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if (NOT RESULT EQUAL 0)
message(FATAL_ERROR "Failure running ${CMAKE_AR} t ${LIB}")
endif()

# Next run "ar x" to extract that file.
execute_process(COMMAND ${CMAKE_AR} x "${LIB}" "${OBJNAME}"
RESULT_VARIABLE RESULT
)
if (NOT RESULT EQUAL 0)
message(FATAL_ERROR "Failure running ${CMAKE_AR} x ${LIB} ${OBJNAME}")
endif()

# Finally invoke the table tool (elf2cfetbl) on the object
execute_process(COMMAND ${TBLTOOL} "${OBJNAME}"
RESULT_VARIABLE RESULT
)
if (NOT RESULT EQUAL 0)
message(FATAL_ERROR "Failure running ${TBLTOOL}")
endif()

message("Successfully converted ${LIB} to a CFE table")
215 changes: 20 additions & 195 deletions cmake/sample_defs/default_osconfig.cmake
Original file line number Diff line number Diff line change
@@ -1,210 +1,35 @@
##########################################################################
#
# CFE configuration options for OSAL
# CFE-specific configuration options for OSAL
#
# This file specifies the default values for various compile-time options
# supported by OSAL. These options can be further tuned by the specific
# OSAL and BSP selection, as well as the user application.
# This file specifies the CFE-specific values for various compile options
# supported by OSAL.
#
##########################################################################


##############################################################
# Code/Feature Selection Options for the OSAL implementation
##############################################################


# OSAL_CONFIG_INCLUDE_NETWORK
# ----------------------------------
#
# Whether to include the Network API
#
# If set TRUE, the the socket abstraction (if applicable on the platform)
# will be included. If set FALSE, then all calls to the network API will
# return OS_ERR_NOT_IMPLEMENTED.
#
# This can be set FALSE for platforms which do not have a network or
# IP stack available, or to save code space if the application does
# not use network resources.
#
set(OSAL_CONFIG_INCLUDE_NETWORK TRUE)


#
# OSAL_CONFIG_INCLUDE_DYNAMIC_LOADER
# ----------------------------------
#
# Whether to include the capability of loading dynamic code objects
#
# This is normally set TRUE to support modularized applications on
# platforms which have this capability.
#
# For deployments which are always statically linked, this may be set
# FALSE for a smaller library size and reduced linking requirements.
#
set(OSAL_CONFIG_INCLUDE_DYNAMIC_LOADER TRUE)


#
# OSAL_CONFIG_INCLUDE_STATIC_LOADER
# ----------------------------------
#
# Whether to include a compatibility "loader" for statically-linked objects
#
# This feature allows applications normally written for dynamic module loading
# operate transparently in a static link environment. If this is set TRUE,
# then the application must supply an object named "OS_STATIC_SYMBOL_TABLE" that
# contains the names and addresses of statically-linked symbols that should
# be known to the lookup/load functions.
#
# Note that modules "loaded" using this abstraction are still assigned a
# module ID and still require a slot in the module table even though
# no actual runtime loading is performed (see OSAL_CONFIG_MAX_MODULES).
#
set(OSAL_CONFIG_INCLUDE_STATIC_LOADER TRUE)

#
# OSAL_CONFIG_INCLUDE_SHELL
# ----------------------------------
#
# Whether to include features which utilize the operating system shell.
#
# Remote Shell commands can be very powerful tool for remotely diagnosing
# and mitigating runtime issues in the field, but also have significant
# security implications. If this is set to "false" then shell functionality
# is disabled and OSAL functions which invoke the shell will return
# OS_ERR_NOT_IMPLEMENTED.
#
set(OSAL_CONFIG_INCLUDE_SHELL FALSE)


# OSAL has many configuration options, which may vary depending on the
# specific version of OSAL in use. The complete list of OSAL options,
# along with a description of each, can be found OSAL source in the file:
#
# OSAL_CONFIG_DEBUG_PERMISSIVE_MODE
# ----------------------------------
# osal/default_config.cmake
#
# The OSAL_CONFIG_DEBUG_PERMISSIVE_MODE option controls how privileged operations
# are handled by the OSAL in the event that the user does not have sufficient permission.
# In particular this applies to task priorities and message queues.
# A CFE framework build utilizes mostly the OSAL default configuration.
# This file only contains a few specific overrides that tune for a debug
# environment, rather than a deployment environment.
#
# If set FALSE, then all permissions are enforced, and a failure due to lack of permission
# will cause a failure of the overall operation, which is passed back to the application.
# ALSO NOTE: There is also an arch-specific addendum to this file
# to allow further tuning on a per-arch basis, in the form of:
#
# If set to TRUE, this will treat some errors non-fatal and enable a graceful fallback,
# allowing the overall operation to complete in a reduced form. This makes the
# OSAL library compatible with a non-root (normal user mode) environment.
# ${TOOLCHAIN_NAME}_osconfig.cmake
#
# In the PC-Linux/Posix build, this means:
# - A message queue deeper than the maximum system limit will be silently truncated
# to the maximum system limit (no error).
# - If the user does not have permission to create elevated priority tasks, then the tasks will
# be created at the default priority (no error).
# See "native_osconfig.cmake" for options which apply only to "native" builds.
#
set(OSAL_CONFIG_DEBUG_PERMISSIVE_MODE FALSE)
##########################################################################

#
# OSAL_CONFIG_DEBUG_PRINTF
# ----------------------------------
#
# Controls inclusion of OS_DEBUG statements in the code
#
# If set FALSE, all OS_DEBUG statements are compiled out.
#
# If set TRUE, all the "OS_DEBUG" statements will be compiled in and displayed
# on the debug console. The statements may still be suppressed at runtime.
#
set(OSAL_CONFIG_DEBUG_PRINTF TRUE)


#############################################
# Resource Limits for the OS API
#############################################

# The maximum number of concurrently-running tasks to support
set(OSAL_CONFIG_MAX_TASKS 64)

# The maximum number of queues to support
set(OSAL_CONFIG_MAX_QUEUES 64)

# The maximum number of counting semaphores to support
set(OSAL_CONFIG_MAX_COUNT_SEMAPHORES 20)

# The maximum number of binary semaphores to support
set(OSAL_CONFIG_MAX_BIN_SEMAPHORES 20)

# The maximum number of mutexes to support
set(OSAL_CONFIG_MAX_MUTEXES 20)

# The maximum number of loadable modules to support
# Note that emulating module loading for statically-linked objects also
# requires a slot in this table, as it still assigns an OSAL ID.
set(OSAL_CONFIG_MAX_MODULES 20)

# The maximum number of time base objects (reference for timers)
set(OSAL_CONFIG_MAX_TIMEBASES 5)

# The maximum number of user timers / app callbacks that can be registered
set(OSAL_CONFIG_MAX_TIMERS 10)

# The maximum number of concurrently open file descriptors to support
set(OSAL_CONFIG_MAX_NUM_OPEN_FILES 50)

# The maximum number of concurrently open directory descriptors to support
set(OSAL_CONFIG_MAX_NUM_OPEN_DIRS 4)

# The maximum number of file systems that can be managed by OSAL
set(OSAL_CONFIG_MAX_FILE_SYSTEMS 14)

# The maximum length for a file name, including any extension
# (This does not include the directory part)
# This length must include an extra character for NULL termination.
set(OSAL_CONFIG_MAX_FILE_NAME 20)

# Maximum length for an virtual path name (virtual directory + file)
# This length must include an extra character for NULL termination.
set(OSAL_CONFIG_MAX_PATH_LEN 64)

# Maximum length allowed for a object (task,queue....) name
# This length must include an extra character for NULL termination.
set(OSAL_CONFIG_MAX_API_NAME 20)

# Maximum length of a symbol name for OS_SymbolLookup()
# This length must include an extra character for NULL termination.
set(OSAL_CONFIG_MAX_SYM_LEN 64)

# Maximum length of a network socket address
# This is only relevant if network support is included, and the
# required length depends on the address families in use
set(OSAL_CONFIG_SOCKADDR_MAX_LEN 28)

# Maximum length of a single message produced by OS_printf()
set(OSAL_CONFIG_PRINTF_BUFFER_SIZE 172)

# Maximum number of OS_printf() messages that will be buffered
set(OSAL_CONFIG_PRINTF_BUFFER_DEPTH 100)

# Priority level of a console output helper task
# ------------------------
#
# Set logically low (high number) to maximize performance.
# - Messages from OS_printf() may show on the console with some delay
# but should have minimal impact to real time tasks.
# For CFE builds this can be helpful during debugging as it will display more
# specific error messages for various OSAL error/warning events, such as if a
# module cannot be loaded or a file cannot be opened for some reason.
#
# Set logically high (low number) for debugging
# - Messages from OS_printf() will have more timely output, but may
# adversely impact real time tasks.
set(OSAL_CONFIG_UTILITYTASK_PRIORITY 245)

# Stack size of console output task.
#
# This applies to RTOS layers with precise stack control,
# normally not necessary to change this unless the task implementation
# changes.
set(OSAL_CONFIG_UTILITYTASK_STACK_SIZE 2048)

# The size of a command that can be passed to the underlying OS
# This length must include an extra character for NULL termination.
set(OSAL_CONFIG_MAX_CMD_LEN 1000)

# The maximum depth of an OSAL message queue.
# On some implementations this may affect the overall OSAL memory footprint
# so it may be beneficial to set this limit accordingly.
set(OSAL_CONFIG_QUEUE_MAX_DEPTH 50)
set(OSAL_CONFIG_DEBUG_PRINTF TRUE)
Loading

0 comments on commit 84ba9a9

Please sign in to comment.