Skip to content

Commit

Permalink
Merge branch 'nos3#84-fprime-checkout' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
jlucas9 committed Oct 17, 2024
2 parents e5c9d78 + e4ad6cc commit de3488f
Show file tree
Hide file tree
Showing 46 changed files with 662 additions and 54 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
fsw:
runs-on: ubuntu-latest
container:
image: ivvitc/nos3-64:20240618
image: ivvitc/nos3-64:20241010
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -29,7 +29,7 @@ jobs:
sim:
runs-on: ubuntu-latest
container:
image: ivvitc/nos3-64:20240618
image: ivvitc/nos3-64:20241010
steps:
- uses: actions/checkout@v2
with:
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,6 @@
[submodule "components/generic_thruster"]
path = components/generic_thruster
url = https://github.com/nasa-itc/generic_thruster.git
[submodule "fsw/fprime/fprime-nos3"]
path = fsw/fprime/fprime-nos3
url = https://github.com/nasa-itc/fprime-nos3.git
19 changes: 18 additions & 1 deletion Makefile
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ endif

# The "LOCALTGTS" defines the top-level targets that are implemented in this makefile
# Any other target may also be given, in that case it will simply be passed through.
LOCALTGTS := all checkout clean clean-fsw clean-sim clean-gsw config debug fsw gsw launch log prep real-clean sim stop stop-gsw
LOCALTGTS := all checkout clean clean-fsw clean-sim clean-gsw config debug fprime fsw gsw launch log prep real-clean sim stop stop-gsw
OTHERTGTS := $(filter-out $(LOCALTGTS),$(MAKECMDGOALS))

# As this makefile does not build any real files, treat everything as a PHONY target
Expand All @@ -52,9 +52,20 @@ build-cryptolib:
$(MAKE) --no-print-directory -C $(GSWBUILDDIR)

build-fsw:


ifeq ($(FLIGHT_SOFTWARE), fprime)
cd fsw/fprime/fprime-nos3 && fprime-util generate && fprime-util build

endif

ifeq ($(FLIGHT_SOFTWARE), cfs)
mkdir -p $(FSWBUILDDIR)
cd $(FSWBUILDDIR) && cmake $(PREP_OPTS) ../cfe
$(MAKE) --no-print-directory -C $(FSWBUILDDIR) mission-install
else
pwd
endif

build-sim:
mkdir -p $(SIMBUILDDIR)
Expand All @@ -78,6 +89,9 @@ clean:
clean-fsw:
rm -rf cfg/build/nos3_defs
rm -rf fsw/build
rm -rf fsw/fprime/fprime-nos3/build-artifacts
rm -rf fsw/fprime/fprime-nos3/build-fprime-automatic-native
rm -rf fsw/fprime/fprime-nos3/fprime-venv

clean-sim:
rm -rf sims/build
Expand All @@ -93,6 +107,9 @@ config:
debug:
./scripts/docker_debug.sh

fprime:
./scripts/fprime.sh

fsw:
./scripts/docker_build_fsw.sh

Expand Down
23 changes: 18 additions & 5 deletions cfg/nos3-mission.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
<nos3-mission-cfg>
<start-time>814048200.0</start-time>
<gsw>cosmos</gsw>
<!-- Note fprime gsw and fsw only operational in sc-minimal-config.xml -->

<!-- Ground Software -->
<!-- cosmos, openc3, or fprime -->
<gsw>cosmos</gsw>

<!-- Flight Software -->
<!-- cfs or fprime -->
<fsw>cfs</fsw>

<!-- Number of spacecraft -->
<number-spacecraft>1</number-spacecraft>

<!-- Spacecraft 1 Configuration -->
<!-- sc-full-config.xml or sc-minimal-config.xml -->
<sc-1-cfg>sc-full-config.xml</sc-1-cfg>
<!--
<sc-2-cfg>sc-minimal-config.xml</sc-2-cfg>
-->
</nos3-mission-cfg>

<!-- Spacecraft N Configuration -->
<!-- <sc-N-cfg>sc-minimal-config.xml</sc-N-cfg> -->
</nos3-mission-cfg>
40 changes: 24 additions & 16 deletions cfg/nos3_defs/targets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -103,35 +103,43 @@ list(APPEND MISSION_GLOBAL_APPLIST
#
# Components
#
arducam/fsw
generic_adcs/fsw
generic_css/fsw
generic_eps/fsw
generic_fss/fsw
generic_imu/fsw
generic_mag/fsw
generic_reaction_wheel/fsw
generic_radio/fsw
generic_star_tracker/fsw
generic_thruster/fsw
generic_torquer/fsw
novatel_oem615/fsw
sample/fsw
syn/fsw
arducam/fsw/cfs
generic_adcs/fsw/cfs
generic_css/fsw/cfs
generic_eps/fsw/cfs
generic_fss/fsw/cfs
generic_imu/fsw/cfs
generic_mag/fsw/cfs
generic_reaction_wheel/fsw/cfs
generic_radio/fsw/cfs
generic_star_tracker/fsw/cfs
generic_thruster/fsw/cfs
generic_torquer/fsw/cfs
novatel_oem615/fsw/cfs
sample/fsw/cfs
syn/fsw/cfs
)

# Create Application Platform Include List
FOREACH(X ${MISSION_GLOBAL_APPLIST})
LIST(APPEND APPLICATION_PLATFORM_INC_LIST ${${X}_MISSION_DIR}/mission_inc)
LIST(APPEND APPLICATION_PLATFORM_INC_LIST ${${X}_MISSION_DIR}/fsw/cfs/mission_inc)
LIST(APPEND APPLICATION_PLATFORM_INC_LIST ${${X}_MISSION_DIR}/fsw/mission_inc)

LIST(APPEND APPLICATION_PLATFORM_INC_LIST ${${X}_MISSION_DIR}/inc)
LIST(APPEND APPLICATION_PLATFORM_INC_LIST ${${X}_MISSION_DIR}/fsw/cfs/inc)
LIST(APPEND APPLICATION_PLATFORM_INC_LIST ${${X}_MISSION_DIR}/fsw/inc)

LIST(APPEND APPLICATION_PLATFORM_INC_LIST ${${X}_MISSION_DIR}/platform_inc)
LIST(APPEND APPLICATION_PLATFORM_INC_LIST ${${X}_MISSION_DIR}/fsw/cfs/platform_inc)
LIST(APPEND APPLICATION_PLATFORM_INC_LIST ${${X}_MISSION_DIR}/fsw/platform_inc)
LIST(APPEND APPLICATION_PLATFORM_INC_LIST ${${X}_MISSION_DIR}/platform_inc)

LIST(APPEND APPLICATION_PLATFORM_INC_LIST ${${X}_MISSION_DIR}/public_inc)
LIST(APPEND APPLICATION_PLATFORM_INC_LIST ${${X}_MISSION_DIR}/fsw/cfs/public_inc)
LIST(APPEND APPLICATION_PLATFORM_INC_LIST ${${X}_MISSION_DIR}/fsw/public_inc)

LIST(APPEND APPLICATION_PLATFORM_INC_LIST ${${X}_MISSION_DIR}/src)
LIST(APPEND APPLICATION_PLATFORM_INC_LIST ${${X}_MISSION_DIR}/fsw/cfs/src)
LIST(APPEND APPLICATION_PLATFORM_INC_LIST ${${X}_MISSION_DIR}/fsw/src)
ENDFOREACH(X)

Expand Down
2 changes: 1 addition & 1 deletion cfg/sc-minimal-config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<enable>false</enable>
</rw>
<sample>
<enable>false</enable>
<enable>true</enable>
</sample>
<st>
<enable>false</enable>
Expand Down
4 changes: 2 additions & 2 deletions cfg/sims/nos3-simulator.xml
Original file line number Diff line number Diff line change
Expand Up @@ -623,8 +623,8 @@
<node-name>star-tracker-command</node-name>
</connection>
<connection><type>usart</type>
<bus-name>usart_10</bus-name>
<node-port>10</node-port>
<bus-name>usart_29</bus-name>
<node-port>29</node-port>
</connection>
</connections>
<data-provider>
Expand Down
Empty file modified components/ComponentSettings.cmake
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion components/arducam
2 changes: 1 addition & 1 deletion components/generic_adcs
Submodule generic_adcs updated 38 files
+33 −0 fsw/cfs/CMakeLists.txt
+12 −0 fsw/cfs/cfg/Inp_ADAC.txt
+21 −0 fsw/cfs/cfg/Inp_DI.txt
+6 −0 fsw/cfs/cfg/Inp_DO.txt
+18 −0 fsw/cfs/mission_inc/generic_adcs_perfids.h
+34 −0 fsw/cfs/platform_inc/generic_adcs_msgids.h
+279 −0 fsw/cfs/src/generic_adcs_adac.c
+17 −0 fsw/cfs/src/generic_adcs_adac.h
+620 −0 fsw/cfs/src/generic_adcs_app.c
+72 −0 fsw/cfs/src/generic_adcs_app.h
+28 −0 fsw/cfs/src/generic_adcs_events.h
+155 −0 fsw/cfs/src/generic_adcs_ingest.c
+20 −0 fsw/cfs/src/generic_adcs_ingest.h
+274 −0 fsw/cfs/src/generic_adcs_msg.h
+80 −0 fsw/cfs/src/generic_adcs_output.c
+17 −0 fsw/cfs/src/generic_adcs_output.h
+133 −0 fsw/cfs/src/generic_adcs_utilities.c
+21 −0 fsw/cfs/src/generic_adcs_utilities.h
+15 −0 fsw/cfs/src/generic_adcs_version.h
+0 −0 fsw/fprime/CMakeLists.txt
+0 −0 fsw/fprime/cfg/Inp_ADAC.txt
+0 −0 fsw/fprime/cfg/Inp_DI.txt
+0 −0 fsw/fprime/cfg/Inp_DO.txt
+0 −0 fsw/fprime/mission_inc/generic_adcs_perfids.h
+0 −0 fsw/fprime/platform_inc/generic_adcs_msgids.h
+0 −0 fsw/fprime/src/generic_adcs_adac.c
+0 −0 fsw/fprime/src/generic_adcs_adac.h
+0 −0 fsw/fprime/src/generic_adcs_app.c
+0 −0 fsw/fprime/src/generic_adcs_app.h
+0 −0 fsw/fprime/src/generic_adcs_events.h
+0 −0 fsw/fprime/src/generic_adcs_ingest.c
+0 −0 fsw/fprime/src/generic_adcs_ingest.h
+0 −0 fsw/fprime/src/generic_adcs_msg.h
+0 −0 fsw/fprime/src/generic_adcs_output.c
+0 −0 fsw/fprime/src/generic_adcs_output.h
+0 −0 fsw/fprime/src/generic_adcs_utilities.c
+0 −0 fsw/fprime/src/generic_adcs_utilities.h
+0 −0 fsw/fprime/src/generic_adcs_version.h
2 changes: 1 addition & 1 deletion components/novatel_oem615
Submodule novatel_oem615 updated 36 files
+13 −0 fsw/cfs/CMakeLists.txt
+21 −0 fsw/cfs/mission_inc/novatel_oem615_perfids.h
+28 −0 fsw/cfs/platform_inc/novatel_oem615_msgids.h
+30 −0 fsw/cfs/platform_inc/novatel_oem615_platform_cfg.h
+855 −0 fsw/cfs/src/novatel_oem615_app.c
+119 −0 fsw/cfs/src/novatel_oem615_app.h
+55 −0 fsw/cfs/src/novatel_oem615_child.c
+16 −0 fsw/cfs/src/novatel_oem615_child.h
+601 −0 fsw/cfs/src/novatel_oem615_device.c
+98 −0 fsw/cfs/src/novatel_oem615_device.h
+77 −0 fsw/cfs/src/novatel_oem615_events.h
+100 −0 fsw/cfs/src/novatel_oem615_msg.h
+19 −0 fsw/cfs/src/novatel_oem615_version.h
+156 −0 fsw/cfs/unit_test/Makefile
+39 −0 fsw/cfs/unit_test/README.txt
+233 −0 fsw/cfs/unit_test/nav_utest.c
+63 −0 fsw/cfs/unit_test/nav_utest.in
+59 −0 fsw/cfs/unit_test/nav_utest.out
+0 −0 fsw/fprime/CMakeLists.txt
+0 −0 fsw/fprime/mission_inc/novatel_oem615_perfids.h
+0 −0 fsw/fprime/platform_inc/novatel_oem615_msgids.h
+0 −0 fsw/fprime/platform_inc/novatel_oem615_platform_cfg.h
+0 −0 fsw/fprime/src/novatel_oem615_app.c
+0 −0 fsw/fprime/src/novatel_oem615_app.h
+0 −0 fsw/fprime/src/novatel_oem615_child.c
+0 −0 fsw/fprime/src/novatel_oem615_child.h
+0 −0 fsw/fprime/src/novatel_oem615_device.c
+0 −0 fsw/fprime/src/novatel_oem615_device.h
+0 −0 fsw/fprime/src/novatel_oem615_events.h
+0 −0 fsw/fprime/src/novatel_oem615_msg.h
+0 −0 fsw/fprime/src/novatel_oem615_version.h
+0 −0 fsw/fprime/unit_test/Makefile
+0 −0 fsw/fprime/unit_test/README.txt
+0 −0 fsw/fprime/unit_test/nav_utest.c
+0 −0 fsw/fprime/unit_test/nav_utest.in
+0 −0 fsw/fprime/unit_test/nav_utest.out
2 changes: 1 addition & 1 deletion components/sample
2 changes: 1 addition & 1 deletion components/syn
Submodule syn updated 2348 files
2 changes: 1 addition & 1 deletion fsw/apps/lc
Submodule lc updated 0 files
2 changes: 1 addition & 1 deletion fsw/apps/sc
Submodule sc updated 1 files
+309 −309 unit-test/sc_cmds_tests.c
69 changes: 69 additions & 0 deletions fsw/fprime/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
cmake_minimum_required(VERSION 2.6.4)

project (sample_checkout)

if (NOT DEFINED TGTNAME)
message(FATAL_ERROR "TGTNAME must be defined on the cmake command line (e.g. \"-DTGTNAME=cpu1\")")
endif()

# if(${TGTNAME} STREQUAL cpu1)
# SET(CMAKE_C_FLAGS_INIT "-m32" CACHE STRING "C Flags required by platform")
# SET(CMAKE_C_FLAGS "-m32" CACHE STRING "C Flags required by platform")
# endif()

include(../../ComponentSettings.cmake)

if(${TGTNAME} STREQUAL cpu1)
find_path(_ITC_CMAKE_MODULES_
NAMES FindITC_Common.cmake
PATHS ${ITC_CMAKE_MODULES}
${ITC_DEV_ROOT}/cmake/modules
$ENV{ITC_DEV_ROOT}/cmake/modules
/usr/local/cmake/modules
/usr/cmake/modules)
if(NOT _ITC_CMAKE_MODULES_)
message(WARNING "Unable to find ITC CMake Modules")
endif()
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${_ITC_CMAKE_MODULES_})

find_package(NOSENGINE REQUIRED QUIET COMPONENTS common transport client uart can i2c spi)
endif()

include_directories("./")
include_directories("../fsw/platform_inc")
include_directories("../fsw/src")
include_directories("../../../fsw/apps/hwlib/fsw/public_inc")

set(sample_checkout_src
test.cpp
../fsw/src/sample_device.c
)

if(${TGTNAME} STREQUAL cpu1)
include_directories("../../../fsw/apps/hwlib/sim/inc")
set(sample_checkout_src
${sample_checkout_src}
../../../fsw/apps/hwlib/sim/src/libuart.c
../../../fsw/apps/hwlib/sim/src/libcan.c
../../../fsw/apps/hwlib/sim/src/libi2c.c
../../../fsw/apps/hwlib/sim/src/libspi.c
../../../fsw/apps/hwlib/sim/src/nos_link.c
)
set(sample_checkout_libs
${ITC_Common_LIBRARIES}
${NOSENGINE_LIBRARIES}
)
endif()
if(${TGTNAME} STREQUAL cpu2)
set(sample_checkout_src
${sample_checkout_src}
../../../fsw/apps/hwlib/fsw/linux/libuart.c
)
endif()

add_executable(sample_checkout ${sample_checkout_src})
target_link_libraries(sample_checkout ${sample_checkout_libs})

if(${TGTNAME} STREQUAL cpu1)
set_target_properties(sample_checkout PROPERTIES COMPILE_FLAGS " -g" LINK_FLAGS " -g")
endif()
1 change: 1 addition & 0 deletions fsw/fprime/fprime-nos3
Submodule fprime-nos3 added at d10dec
11 changes: 11 additions & 0 deletions scripts/build_fprime.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
#
# Convenience script for NOS3 development
# Use with the Dockerfile in the deployment repository
# https://github.com/nasa-itc/deployment
#

cd fsw/fprime/fprime-nos3
. fprime-venv/bin/activate
fprime-util build

32 changes: 32 additions & 0 deletions scripts/cfs_build_fsw.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash -i
#
# Convenience script for NOS3 development
# Use with the Dockerfile in the deployment repository
# https://github.com/nasa-itc/deployment
#

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
source $SCRIPT_DIR/env.sh


# Check that local NOS3 directory exists
if [ ! -d $USER_NOS3_DIR ]; then
echo ""
echo " Need to run make prep first!"
echo ""
exit 1
fi

# Check that configure build directory exists
if [ ! -d $BASE_DIR/cfg/build ]; then
echo ""
echo " Need to run make config first!"
echo ""
exit 1
fi

# Make flight software build directory
mkdir -p $BASE_DIR/fsw/build

# Build
$DFLAGS_CPUS -v $BASE_DIR:$BASE_DIR --name "nos_build_fsw" -w $BASE_DIR $DBOX make -j$NUM_CPUS -e FLIGHT_SOFTWARE=cfs build-fsw
Loading

0 comments on commit de3488f

Please sign in to comment.