Skip to content

Commit

Permalink
Sample app runs now
Browse files Browse the repository at this point in the history
  • Loading branch information
Joseph Martin committed Nov 20, 2024
1 parent fcdb59f commit d6b7277
Show file tree
Hide file tree
Showing 16 changed files with 65 additions and 87 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/codeql-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ jobs:
name: Codeql Analysis
uses: nasa/cFS/.github/workflows/codeql-reusable.yml@main
with:
component-path: apps/sample_app
component-path: apps/bpacc_fun
prep: 'make prep; make -C build/tools/elf2cfetbl'
make: 'make -C build/native/default_cpu1/apps/sample_app'
make: 'make -C build/native/default_cpu1/apps/bpacc_fun'
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ endif()
add_cfe_app(bpacc_fun ${APP_SRC_FILES})

target_include_directories(bpacc_fun PUBLIC fsw/inc)
# Include the public API from sample_lib to demonstrate how
# Include the public API from BPAccel to demonstrate how
# to call library-provided functions
add_cfe_app_dependency(bpacc_fun sample_lib)
#add_cfe_app_dependency(bpacc_fun bpaccel)

# Add table
add_cfe_tables(bpacc_fun fsw/tables/bpacc_fun_tbl.c)
Expand Down
22 changes: 5 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
![Static Analysis](https://github.com/nasa/sample_app/workflows/Static%20Analysis/badge.svg)
![Format Check](https://github.com/nasa/sample_app/workflows/Format%20Check/badge.svg)
![Static Analysis](https://github.com/nasa/bpacc_fun/workflows/Static%20Analysis/badge.svg)
![Format Check](https://github.com/nasa/bpacc_fun/workflows/Format%20Check/badge.svg)

# Core Flight System : Framework : App : Sample
# Core Flight System : Framework : App : BPACC Functional

This repository contains a sample application (sample_app), which is a framework component of the Core Flight System.
This repository contains the BPAccel Functional Test App

This sample application is a non-flight example application implementation for the cFS Bundle. It is intended to be located in the `apps/sample_app` subdirectory of a cFS Mission Tree. The Core Flight System is bundled at <https://github.com/nasa/cFS> (which includes sample_app as a submodule), which includes build and execution instructions.

sample_app is an example for how to build and link an application in cFS. See also the skeleton_app (<https://github.com/nasa/skeleton_app>) if you are looking for a bare-bones application to which to add your business logic.

## Known issues

As a sample application, extensive testing is not performed prior to release and only minimal functionality is included. Note discrepancies likely exist between this application and the example detailed in the application developer guide.

## Getting Help

For best results, submit issues:questions or issues:help wanted requests at <https://github.com/nasa/cFS>.

Official cFS page: <http://cfs.gsfc.nasa.gov>
This application is a non-flight example application implementation used for exercising BPAccel and BP7 HW Acceleration efforts in a cFS context.
14 changes: 7 additions & 7 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,33 @@

## Reporting a Vulnerability

To report a vulnerability for the sample_app subsystem please [submit an issue](https://github.com/nasa/sample_app/issues/new/choose).
To report a vulnerability for the bpacc_fun subsystem please [submit an issue](https://github.com/nasa/bpacc_fun/issues/new/choose).

For general cFS vulnerabilities please [open a cFS framework issue](https://github.com/nasa/cfs/issues/new/choose) and see our [top-level security policy](https://github.com/nasa/cFS/security/policy) for additional information.

In either case please use the "Bug Report" template and provide as much information as possible. Apply appropriate labels for each report. For security related reports, tag the issue with the "security" label.

## Testing

**Disclaimer: nasa/sample_app is not responsible for any liability incurred under the [Apache License 2.0](https://github.com/nasa/sample_app/blob/main/LICENSE).**
**Disclaimer: nasa/bpacc_fun is not responsible for any liability incurred under the [Apache License 2.0](https://github.com/nasa/bpacc_fun/blob/main/LICENSE).**

Testing is an important aspect our team values to improve sample_app.
Testing is an important aspect our team values to improve bpacc_fun.

To view tools used for the cFS bundle, see our [top-level security policy](https://github.com/nasa/cFS/security/policy).

### CodeQL

The [sample_app CodeQL GitHub Actions workflow](https://github.com/nasa/sample_app/actions/workflows/codeql-build.yml) is available to the public. To review the results, fork the sample_app repository and run the CodeQL workflow.
The [bpacc_fun CodeQL GitHub Actions workflow](https://github.com/nasa/bpacc_fun/actions/workflows/codeql-build.yml) is available to the public. To review the results, fork the bpacc_fun repository and run the CodeQL workflow.

CodeQL is ran for every push and pull-request on all branches of sample_app in GitHub Actions.
CodeQL is ran for every push and pull-request on all branches of bpacc_fun in GitHub Actions.

For the CodeQL GitHub Actions setup, visit https://github.com/github/codeql-action.

### Cppcheck

The [sample_app Cppcheck GitHub Actions workflow and results](https://github.com/nasa/sample_app/actions/workflows/static-analysis.yml) are available to the public. To view the results, select a workflow and download the artifacts.
The [bpacc_fun Cppcheck GitHub Actions workflow and results](https://github.com/nasa/bpacc_fun/actions/workflows/static-analysis.yml) are available to the public. To view the results, select a workflow and download the artifacts.

Cppcheck is ran for every push on the main branch and every pull request on all branches of sample_app in Github Actions.
Cppcheck is ran for every push on the main branch and every pull request on all branches of bpacc_fun in Github Actions.

For more information about Cppcheck, visit http://cppcheck.sourceforge.net/.

Expand Down
26 changes: 13 additions & 13 deletions arch_build.cmake
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
###########################################################
#
# SAMPLE_APP platform build setup
# BPACC_FUN platform build setup
#
# This file is evaluated as part of the "prepare" stage
# and can be used to set up prerequisites for the build,
# such as generating header files
#
###########################################################

# The list of header files that control the SAMPLE_APP configuration
set(SAMPLE_APP_PLATFORM_CONFIG_FILE_LIST
sample_app_internal_cfg.h
sample_app_platform_cfg.h
sample_app_perfids.h
sample_app_msgids.h
# The list of header files that control the BPACC_FUN configuration
set(BPACC_FUN_PLATFORM_CONFIG_FILE_LIST
bpacc_fun_internal_cfg.h
bpacc_fun_platform_cfg.h
bpacc_fun_perfids.h
bpacc_fun_msgids.h
)

# Create wrappers around the all the config header files
# This makes them individually overridable by the missions, without modifying
# the distribution default copies
foreach(SAMPLE_APP_CFGFILE ${SAMPLE_APP_PLATFORM_CONFIG_FILE_LIST})
get_filename_component(CFGKEY "${SAMPLE_APP_CFGFILE}" NAME_WE)
if (DEFINED SAMPLE_APP_CFGFILE_SRC_${CFGKEY})
set(DEFAULT_SOURCE GENERATED_FILE "${SAMPLE_APP_CFGFILE_SRC_${CFGKEY}}")
foreach(BPACC_FUN_CFGFILE ${BPACC_FUN_PLATFORM_CONFIG_FILE_LIST})
get_filename_component(CFGKEY "${BPACC_FUN_CFGFILE}" NAME_WE)
if (DEFINED BPACC_FUN_CFGFILE_SRC_${CFGKEY})
set(DEFAULT_SOURCE GENERATED_FILE "${BPACC_FUN_CFGFILE_SRC_${CFGKEY}}")
else()
set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${SAMPLE_APP_CFGFILE}")
set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${BPACC_FUN_CFGFILE}")
endif()
generate_config_includefile(
FILE_NAME "${SAMPLE_APP_CFGFILE}"
FILE_NAME "${BPACC_FUN_CFGFILE}"
${DEFAULT_SOURCE}
)
endforeach()
2 changes: 1 addition & 1 deletion config/default_bpacc_fun_msgdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#define BPACC_FUN_MSGDEFS_H

#include "common_types.h"
#include "bpacc_fun_app_fcncodes.h"
#include "default_bpacc_fun_fcncodes.h"

typedef struct BPACC_FUN_DisplayParam_Payload
{
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions fsw/src/bpacc_fun_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ void BPACC_FUN_Main(void)
CFE_ES_PerfLogExit(BPACC_FUN_PERF_ID);

/* Pend on receipt of command packet */
printf("CFE_SB_ReceiveBuffer PEND FOREVER\n");
status = CFE_SB_ReceiveBuffer(&SBBufPtr, BPACC_FUN_Data.CommandPipe, CFE_SB_PEND_FOREVER);

/*
Expand Down
6 changes: 2 additions & 4 deletions fsw/src/bpacc_fun_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
#include "bpacc_fun_utils.h"
#include "bpacc_fun_msg.h"

// /* The bpaccel_lib module provides the BPACC_FUN_Function() prototype */
// #include "bpaccel_lib.h"
//#include bpaccel.h

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * **/
/* */
Expand Down Expand Up @@ -138,8 +137,7 @@ CFE_Status_t BPACC_FUN_ProcessCmd(const BPACC_FUN_ProcessCmd_t *Msg)
return status;
}

/* Invoke a function provided by BPACC_FUN_LIB */
BPACC_FUN_LIB_Function();
/* Call BPAccel Here */

return CFE_SUCCESS;
}
Expand Down
52 changes: 26 additions & 26 deletions mission_build.cmake
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
###########################################################
#
# SAMPLE_APP mission build setup
# BPACC_FUN_APP mission build setup
#
# This file is evaluated as part of the "prepare" stage
# and can be used to set up prerequisites for the build,
# such as generating header files
#
###########################################################

# The list of header files that control the SAMPLE_APP configuration
set(SAMPLE_APP_MISSION_CONFIG_FILE_LIST
sample_app_fcncodes.h
sample_app_interface_cfg.h
sample_app_mission_cfg.h
sample_app_perfids.h
sample_app_msg.h
sample_app_msgdefs.h
sample_app_msgstruct.h
sample_app_tbl.h
sample_app_tbldefs.h
sample_app_tblstruct.h
sample_app_topicids.h
# The list of header files that control the BPACC_FUN_APP configuration
set(BPACC_FUN_APP_MISSION_CONFIG_FILE_LIST
bpacc_fun_fcncodes.h
bpacc_fun_interface_cfg.h
bpacc_fun_mission_cfg.h
bpacc_fun_perfids.h
bpacc_fun_msg.h
bpacc_fun_msgdefs.h
bpacc_fun_msgstruct.h
bpacc_fun_tbl.h
bpacc_fun_tbldefs.h
bpacc_fun_tblstruct.h
bpacc_fun_topicids.h
)

if (CFE_EDS_ENABLED_BUILD)

# In an EDS-based build, these files come generated from the EDS tool
set(SAMPLE_APP_CFGFILE_SRC_sample_app_interface_cfg "sample_app_eds_designparameters.h")
set(SAMPLE_APP_CFGFILE_SRC_sample_app_tbldefs "sample_app_eds_typedefs.h")
set(SAMPLE_APP_CFGFILE_SRC_sample_app_tblstruct "sample_app_eds_typedefs.h")
set(SAMPLE_APP_CFGFILE_SRC_sample_app_msgdefs "sample_app_eds_typedefs.h")
set(SAMPLE_APP_CFGFILE_SRC_sample_app_msgstruct "sample_app_eds_typedefs.h")
set(SAMPLE_APP_CFGFILE_SRC_sample_app_fcncodes "sample_app_eds_cc.h")
set(BPACC_FUN_APP_CFGFILE_SRC_bpacc_fun_interface_cfg "bpacc_fun_eds_designparameters.h")
set(BPACC_FUN_APP_CFGFILE_SRC_bpacc_fun_tbldefs "bpacc_fun_eds_typedefs.h")
set(BPACC_FUN_APP_CFGFILE_SRC_bpacc_fun_tblstruct "bpacc_fun_eds_typedefs.h")
set(BPACC_FUN_APP_CFGFILE_SRC_bpacc_fun_msgdefs "bpacc_fun_eds_typedefs.h")
set(BPACC_FUN_APP_CFGFILE_SRC_bpacc_fun_msgstruct "bpacc_fun_eds_typedefs.h")
set(BPACC_FUN_APP_CFGFILE_SRC_bpacc_fun_fcncodes "bpacc_fun_eds_cc.h")

endif(CFE_EDS_ENABLED_BUILD)

# Create wrappers around the all the config header files
# This makes them individually overridable by the missions, without modifying
# the distribution default copies
foreach(SAMPLE_APP_CFGFILE ${SAMPLE_APP_MISSION_CONFIG_FILE_LIST})
get_filename_component(CFGKEY "${SAMPLE_APP_CFGFILE}" NAME_WE)
if (DEFINED SAMPLE_APP_CFGFILE_SRC_${CFGKEY})
set(DEFAULT_SOURCE GENERATED_FILE "${SAMPLE_APP_CFGFILE_SRC_${CFGKEY}}")
foreach(BPACC_FUN_APP_CFGFILE ${BPACC_FUN_APP_MISSION_CONFIG_FILE_LIST})
get_filename_component(CFGKEY "${BPACC_FUN_APP_CFGFILE}" NAME_WE)
if (DEFINED BPACC_FUN_APP_CFGFILE_SRC_${CFGKEY})
set(DEFAULT_SOURCE GENERATED_FILE "${BPACC_FUN_APP_CFGFILE_SRC_${CFGKEY}}")
else()
set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${SAMPLE_APP_CFGFILE}")
set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${BPACC_FUN_APP_CFGFILE}")
endif()
generate_config_includefile(
FILE_NAME "${SAMPLE_APP_CFGFILE}"
FILE_NAME "${BPACC_FUN_APP_CFGFILE}"
${DEFAULT_SOURCE}
)
endforeach()
2 changes: 1 addition & 1 deletion unit-test/coveragetest/bpacc_fun_coveragetest_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/**
* @file
*
* Common definitions for all sample_app coverage tests
* Common definitions for all bpacc_fun coverage tests
*/

#ifndef BPACC_FUN_COVERAGETEST_COMMON_H
Expand Down
3 changes: 1 addition & 2 deletions unit-test/coveragetest/coveragetest_bpacc_fun_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
************************************************************************/

/*
** File: coveragetest_sample_app.c
** File: coveragetest_bpacc_fun_app.c
**
** Purpose:
** Coverage Unit Test cases for the BPACC_FUN Application
Expand All @@ -35,7 +35,6 @@
/*
* Includes
*/
#include "sample_lib.h" /* For BPACC_FUN_LIB_Function */
#include "bpacc_fun_coveragetest_common.h"

/*
Expand Down
7 changes: 0 additions & 7 deletions unit-test/coveragetest/coveragetest_bpacc_fun_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
* Includes
*/

//#include "sample_lib.h" /* For BPACC_FUN_LIB_Function */
#include "bpacc_fun_coveragetest_common.h"
#include "bpacc_fun.h"
#include "bpacc_fun_dispatch.h"
Expand Down Expand Up @@ -154,12 +153,6 @@ void Test_BPACC_FUN_APP_ProcessCmd(void)
*/
UtAssert_STUB_COUNT(CFE_TBL_GetAddress, 1);

/*
* Confirm that the BPACC_FUN_LIB_Function() call was done
* NOTE: This stub is provided by the sample_lib library
*/
UtAssert_STUB_COUNT(BPACC_FUN_LIB_Function, 1);

/*
* Configure the CFE_TBL_GetAddress function to return an error.
* Exercise the error return path.
Expand Down
1 change: 0 additions & 1 deletion unit-test/coveragetest/coveragetest_bpacc_fun_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
/*
* Includes
*/
#include "sample_lib.h" /* For SAMPLE_LIB_Function */
#include "bpacc_fun_coveragetest_common.h"

/*
Expand Down
4 changes: 2 additions & 2 deletions unit-test/stubs/bpacc_fun_dispatch_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
/**
* @file
*
* Auto-Generated stub implementations for functions defined in sample_app_dispatch header
* Auto-Generated stub implementations for functions defined in bpacc_fun_dispatch header
*/

#include "sample_app_dispatch.h"
#include "bpacc_fun_dispatch.h"
#include "utgenstub.h"

/*
Expand Down
4 changes: 2 additions & 2 deletions unit-test/stubs/bpacc_fun_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
/**
* @file
*
* Auto-Generated stub implementations for functions defined in sample_app header
* Auto-Generated stub implementations for functions defined in bpacc_fun header
*/

#include "bpacc_fun_app.h"
#include "bpacc_fun.h"
#include "utgenstub.h"

/*
Expand Down

0 comments on commit d6b7277

Please sign in to comment.