Skip to content

Commit

Permalink
Merge pull request #1150 from nasa/integration-candidate
Browse files Browse the repository at this point in the history
cFE  Integration candidate: 2021-02-02
  • Loading branch information
astrogeco authored Feb 16, 2021
2 parents fcaa1d0 + 557d92b commit 6b9c267
Show file tree
Hide file tree
Showing 99 changed files with 4,552 additions and 3,898 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/codeql-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: "CodeQL Analysis"

on:
push:
pull_request:

env:
SIMULATION: native
ENABLE_UNIT_TESTS: true
OMIT_DEPRECATED: true
BUILDTYPE: release

jobs:

CodeQL-Build:
runs-on: ubuntu-18.04
timeout-minutes: 15

steps:
# Checks out a copy of your repository on the ubuntu-latest machine
- name: Checkout bundle
uses: actions/checkout@v2
with:
repository: nasa/cFS
submodules: true

- name: Checkout submodule
uses: actions/checkout@v2
with:
path: cfe

- name: Check versions
run: git submodule

- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: c
queries: +security-extended, security-and-quality

# Setup the build system
- name: Set up for build
run: |
cp ./cfe/cmake/Makefile.sample Makefile
cp -r ./cfe/cmake/sample_defs sample_defs
make prep
# Build the code
- name: Build
run: |
make cfe-core
make native/default_cpu1/cfe-core/unit-test/
make native/default_cpu1/cfe-core/ut-stubs/
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
1 change: 1 addition & 0 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
static-analysis:
name: Run cppcheck
runs-on: ubuntu-18.04
timeout-minutes: 15

strategy:
fail-fast: false
Expand Down
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Travis-CI: [![Build Status](https://travis-ci.com/nasa/cFE.svg)](https://travis-ci.com/nasa/cFE)
![Static Analysis](https://github.com/nasa/cfe/workflows/Static%20Analysis/badge.svg)

# Core Flight System : Framework : Core Flight Executive

Expand All @@ -10,6 +10,34 @@ The detailed cFE user's guide can be viewed at <https://github.com/nasa/cFS/blob

## Version History

### Development Build: 6.8.0-rc1+dev348

- Corrects reference to PSP header file location. Build now succesfully completes the build succeeds again when using `add_psp_module()` in custom CMakeLists file.
- Replace "send" with "write" in names for commands that write files. For example, `CFE_SB_**SEND**_ROUTING_INFO_CC` is now `CFE_SB_**WRITE**_ROUTING_INFO_CC`. Updates function names, command code names and comments.
- Removes incorrectly implemented deferred return code of `-1` for `CFE_SB_ReceiveBuffer` from software bus setup in `UT_InitData`.
- Implements more informative **assert messages** by making `SETUP, TEARDOWN, ASSERT` print `0x%lx` while `ASSERT_EQ` now prints both `%lf` and `0x%lx` format for the inputs
- Updates continuous-integration badges in `ReadMe.md`. The badges now reflect the success status of different runs.
- Remove `Test_SB_Cmds_SubRptUnexpCmdCode` which was a duplicate of `Test_SB_Cmds_CmdUnexpCmdCode` and did not implement any new tests.
- Initializes status in `CFE_ES_WaitForSystemState` and adds missing success test case so the function doesn't return an uninitialized `Status`.
- Removes the `HkPacket` and `TblRegPacket` message initializations from `CFE_TBL_EarlyInit` since they are initialized in `CFE_TBL_InitData`. Moves the `NotifyMsg` message initialization to `CFE_TBL_InitData` and sets the message ID each time it's sent from `CFE_TBL_SendNotificationMsg`. Possibly results in small performance improvement since the message isn't initialized every call.
- Removes unimplemented `CFE_ES_AppGetList` and `CFE_ES_AppDumpAllInfo` prototypes.
- Adds a 15-minute timeout to continuous integration workflows to prevent excess resource utilization.
- Makes debug subscription events only print the Pipe ID, not a name, in the debug events.
- Updates the documentation and verification for `CFE_PLATFORM_SB_HIGHEST_VALID_MSGID` to allows the full range of values.
- Clarifies the difference between "restart" and "reload" in API/cmd and user's guide documentation for `CFE_ES_RESTART_APP_CC`.
- Switches throttle indexes to use `CFE_SB_RouteId_Atom_t` and combines helper function given that msgid was removed due to being a resource hog. Resolves static analysis warning.
- `CFE_ES_RestartApp` now checks for file existence as part of command processing and does not remove the app if the file doesn't exist (just avoids one error case). it also rejects the command and increments command error counter if file is missing.
- Removes `CFE_PLATFORM_SB_MAX_PIPE_DEPTH` in favor of `OS_QUEUE_MAX_DEPTH`. This depth parameter in command is now checked prior to attempting OSAL call.
- Filters pointer now `const` in API and reports truncation when registering filters with `CFE_EVS_Register`.
- Removes the ability to disable the log by not defining `CFE_PLATFORM_EVS_LOG_ON` so users are no longer able to disable log completely. For minimum memory use define `CFE_PLATFORM_EVS_LOG_MAX = 1`. Note: This could remove control based on LogEnabled, panic on reset area fail and limp along if "sem create" fails.
- Removes the remnants of the table service exclusion logic and documentation: `EXCLUDE_CFE_TBL` no longer available, even if defined, table services will still start.
- Set ES and EVS pipe message limit to defaults as opposed to the custom, unjustified, `CFE_SB_SubscribeEx`. This change might queue additional HK messages, but SCH loads after ES anyways.
- Replaces `CFE_SB_Default_Qos` with `CFE_SB_DEFAULT_QOS` macro that avoids global variable exposure. Removes SB-internal defines that are not implemented nor used.
- Explicity `memset` the task data to zero at the start of EarlyInit. Standardize the global typdef/variable names.
- Moves all functions, macros, types, and other definitions related to resource IDs and generic resource management into a separate module, like `CFE MSG`, `SBR`, etc. This allows a mission to elect "strict" implementations of these objects, where every ID type is unique, and assigning between them or `uint32` results in a compiler error. **API now has separate types for each resource type (Apps, Tasks, Libs, Counters, etc).** The user can elect at the mission level whether this is a simple typedef (all uint32, all interchangeable) or a wrapper type (separate/strict type, cannot be interchanged). The former is backward compatible but the latter is not - must use proper types.
- Adds Code QL analysis to continuous integration workflow.
- See <https://github.com/nasa/cFE/pull/1150>

### Development Build: 6.8.0-rc1+dev290

- Documentation: Add Security.md with instructions to report vulnerability
Expand Down
2 changes: 1 addition & 1 deletion cmake/arch_build.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ endfunction(initialize_globals)
function(add_psp_module MOD_NAME MOD_SRC_FILES)

# Include the PSP shared directory so it can get to cfe_psp_module.h
include_directories(${MISSION_SOURCE_DIR}/psp/fsw/shared)
include_directories(${MISSION_SOURCE_DIR}/psp/fsw/shared/inc)
add_definitions(-D_CFE_PSP_MODULE_)

# Create the module
Expand Down
1 change: 1 addition & 0 deletions cmake/mission_defaults.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ set(MISSION_CORE_MODULES
"psp"
"msg"
"sbr"
"resourceid"
)

# The "MISSION_GLOBAL_APPLIST" is a set of apps/libs that will be built
Expand Down
66 changes: 16 additions & 50 deletions cmake/sample_defs/cpu1_platform_cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,49 +130,29 @@
*/
#define CFE_PLATFORM_SB_BUF_MEMORY_BYTES 524288


/**
** \cfesbcfg Maximum depth allowed when creating an SB pipe
**
** \par Description:
** The value of this constant dictates the maximum pipe depth that an
** application may request. The pipe depth is given as a paramter in the
** #CFE_SB_CreatePipe API.
**
** \par Limits
** This parameter has a lower limit of 1. There are no restrictions on the
** upper limit however, the maximum pipe depth is system dependent and should
** be verified. Pipe Depth values that are checked against this configuration
** are defined by a 16 bit data word.
*/
#define CFE_PLATFORM_SB_MAX_PIPE_DEPTH 256


/**
** \cfesbcfg Highest Valid Message Id
**
** \par Description:
** The value of this constant dictates the size of the SB message map. The SB
** message map is a lookup table that provides the routing table index for
** fast access into the routing table. The default setting of 0x1FFF was chosen
** to save memory. This reduces the message map from 128Kbytes to 16Kbytes.
** See CFE_FSW_DCR 504 for more details.
**
** If this value is different in a distributed architecture some platforms may not
** be able to subscribe to messages generated on other platforms since the message id
** would exceed the mapping table's highest index. Care would have to be taken to ensure the
** constrained platform did not subscribe to message Ids that exceed
** CFE_PLATFORM_SB_HIGHEST_VALID_MSGID
** The value of this constant dictates the range of valid message ID's, from 0
** to CFE_PLATFORM_SB_HIGHEST_VALID_MSGID (inclusive).
**
** The recommended case to to have this value the same across all mission platforms
** Altough this can be defined differently across platforms, each platform can
** only publish/subscribe to message ids within their allowable range. Typically
** this value is set the same across all mission platforms to avoid this complexity.
**
** \par Limits
** This parameter has a lower limit of 1 and an upper limit of 0xFFFF. Note
** for current implementations, V2/Extended headers assign 0xFFFFFFFF as the invalid
** message ID value, and default headers assigns 0xFFFF as the invalid value. This
** means for default headers, 0xFFFF is invalid even if you set the value
** below to it's maximum of 0xFFFF.
** The allocated message table is this size + 1 (could change based on implementaiton).
** CFE_SB_INVALID_MSG is set to the maxumum representable number of type CFE_SB_MsgId_t.
** CFE_PLATFORM_SB_HIGHEST_VALID_MSGID lower limit is 1, up to CFE_SB_INVALID_MSG_ID - 1.
**
** When using the direct message map implementation for software bus routing, this
** value is used to size the map where a value of 0x1FFF results in a 16 KBytes map
** and 0xFFFF is 128 KBytes.
**
** When using the hash implementation for software bus routing, a multiple of the
** CFE_PLATFORM_SB_MAX_MSG_IDS is used to size the message map. In that case
** the range selected here does not impact message map memory use, so it's
** resonable to use up to the full range supported by the message ID implementation.
*/
#define CFE_PLATFORM_SB_HIGHEST_VALID_MSGID 0x1FFF

Expand Down Expand Up @@ -1455,20 +1435,6 @@
#define CFE_PLATFORM_EVS_MAX_EVENT_FILTERS 8


/**
** \cfeevscfg Enable or Disable EVS Local Event Log
**
** \par Description:
** The CFE_PLATFORM_EVS_LOG_ON configuration parameter must be defined to enable EVS
** event logging. In order to disable the local event log this definition needs
** to be commented out.
**
** \par Limits
** Not Applicable
*/
#define CFE_PLATFORM_EVS_LOG_ON


/**
** \cfeevscfg Default Event Log Filename
**
Expand Down
24 changes: 15 additions & 9 deletions docs/src/cfe_es.dox
Original file line number Diff line number Diff line change
Expand Up @@ -366,9 +366,16 @@
/**
\page cfeesugapprestart Restarting an Application

The #CFE_ES_RESTART_APP_CC command is used to restart an application.
This command stops and restarts an application using the parameters
defined when the application was originally started, either through
The #CFE_ES_RESTART_APP_CC command is used to restart an application
using the same file name as the last start.

This command checks for file existence, the application is running,
and the application is not a core app. If valid, the application restart
is requested.

When requested, ES stops the application, unloads the object file, loads the object file
using the previous file name, and restarts an application using the parameters
defined when the application was previously started, either through
the startup script or by way of the #CFE_ES_START_APP_CC command.

Next: \ref cfeesugappreload <BR>
Expand All @@ -379,12 +386,11 @@
/**
\page cfeesugappreload Reloading an Application

The #CFE_ES_RELOAD_APP_CC command is used to reload an application.
This command stops the application, unloads the object file, loads
the new object file specified in the command and starts the application
again using the parameters defined when the application was originally
started, either through the startup script or by way of the
#CFE_ES_START_APP_CC command.
The #CFE_ES_RELOAD_APP_CC command is used to reload an application
using a new file name.

This command performes
the same actions as #CFE_ES_RESTART_APP_CC only using the new file.

Next: \ref cfeesugapplist <BR>
Prev: \ref cfeesugapprestart <BR>
Expand Down
17 changes: 7 additions & 10 deletions docs/src/cfe_sb.dox
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
The Pipe IDs are specific to a particular processor (that is, the same ID number
may refer to a different pipe on each processor). The pipe information for all
pipes that have been created, may be requested at anytime by sending the
\link #CFE_SB_SEND_PIPE_INFO_CC 'Send Pipe Info' SB command \endlink. The software
\link #CFE_SB_WRITE_PIPE_INFO_CC 'Write Pipe Info' SB command \endlink. The software
bus also provides a set of figures regarding capacity, current utilization and high
water marks relevant to pipes. This information may be requested by sending the
command to \link #CFE_SB_SEND_SB_STATS_CC dump the SB statistics packet \endlink.
Expand Down Expand Up @@ -445,12 +445,10 @@
Quality of Service (QOS) for off-board routing and is of the type #CFE_SB_Qos_t. This structure
has two members named priority and reliability. The Quality parameter is currently unused by
the software bus. It is a placeholder to be used with the future software bus capability of
inter-processor communication. Although currently the software bus does not read the Quality
values, it would be best to set this parameter to the value defined as #CFE_SB_Default_Qos.
This value is set internally by the software bus with values of zero for priority and
reliability. The values of zero will correspond to low priority and low reliability. Setting
the QOS value to the #CFE_SB_Default_Qos will ensure seamless integration when the software
bus is expanded to support inter-processor communication.
inter-processor communication. Although currently the software bus does not implement quality
of service.

A default quality of services is provided via the #CFE_SB_DEFAULT_QOS macro.

Next: \ref cfesbugknwnprob <BR>
Prev: \ref cfesbugroutcntrl <BR>
Expand Down Expand Up @@ -569,9 +567,8 @@
</B><TR><TD WIDTH="5%"> &nbsp; <TD WIDTH="95%">
The QOS parameter is currently unused by the software bus. It is a placeholder to be
used with the future software bus capability of inter-processor communication. Setting
the QOS value to the SB defined #CFE_SB_Default_Qos (QOS.Priority=0,QOS.Reliability=0)
will ensure seamless integration when the software bus is expanded to support
inter-processor communication.
the QOS as #CFE_SB_DEFAULT_QOS will ensure seamless integration when the software bus
is expanded to support inter-processor communication.
<TR><TD COLSPAN=2 WIDTH="100%"> <B>(Q)
Can I confirm my software bus buffer was delivered?
</B><TR><TD WIDTH="5%"> &nbsp; <TD WIDTH="95%">
Expand Down
38 changes: 2 additions & 36 deletions docs/src/cfe_tbl.dox
Original file line number Diff line number Diff line change
Expand Up @@ -22,45 +22,11 @@
<LI> \subpage cfetblugregistry <BR>
<LI> \subpage cfetblugtelemetry <BR>
<LI> \subpage cfetblugprocreset <BR>
<LI> \subpage cfetblugdecouple <BR>
<LI> \subpage cfetblugfaq <BR>
</UL>

**/

/**
\page cfetblugdecouple How To Remove cFE Table Services

It is possible to build the CFE without including Table Services. This is only applicable if
the mission does not intend to use any CFS applications that require CFE type table services, or
if the mission intends to provide custom table services. If CFE Table Services are removed, the
CFE makefile will no longer try to make the Table Services application and the link makefile will
no longer include the Table Services object module in the CFE-CORE. Even if excluded from the build,
the Table Services source and header files will remain in the CFE source tree.

If EXCLUDE_CFE_TBL is defined (typically in the applicable *_platform_config.h file) Executive
services will not load or shut down table services. Note this option does not effect the build
and link of table services.

To remove table services from the build completely, remove "tbl" from the CFE_CORE_MODULES
in the cfe/fsw/cfe-core CMakeLists.txt directory (note this option also needs EXCLUDE_CFE_TBL defined
or executive services will try to load it).

Removing Table Services reduces the size of the CFE-CORE load file and also reduces the amount
of RAM memory required to load the cFE. Each development environment will have unique savings.
The numbers from an example default linux build are as follows:

Size of core cFE binary load file with Table Services: 963K
Size of core cFE binary load file w/o building Table services: 871K

RAM used after loading cFE with Table Services: 153K
RAM used after loading cFE w/o loading Table Services: 144M

Next: \ref cfetblugfaq <BR>
Prev: \ref cfetblugprocreset <BR>
Up To: \ref cfetblovr
**/

/**
\page cfetblugmanage Managing Tables

Expand Down Expand Up @@ -344,7 +310,7 @@
contents of the table are automatically loaded into the table and the Application is notified that the
table does not require additional initialization.

Next: \ref cfetblugdecouple <BR>
Next: \ref cfetblugfaq <BR>
Prev: \ref cfetblugtelemetry <BR>
Up To: \ref cfetblovr
**/
Expand Down Expand Up @@ -441,7 +407,7 @@

</TABLE>

Prev: \ref cfetblugdecouple <BR>
Prev: \ref cfetblugprocreset <BR>
Up To: \ref cfetblovr
**/

Expand Down
Loading

0 comments on commit 6b9c267

Please sign in to comment.