From cd716bc4654d382bcdef5c3b3b4d94c75428ec05 Mon Sep 17 00:00:00 2001 From: "Lucas, John P" Date: Fri, 15 Mar 2024 09:24:40 -0400 Subject: [PATCH] [nasa/nos3#202] Updates to include CryptoLib in FSW and CryptoLib Standalone for GSW - errors getting data back from FSW; --- Makefile | 8 +++ cfg/nos3_defs/cpu1_cfe_es_startup.scr | 2 +- cfg/nos3_defs/targets.cmake | 2 +- cfg/nos3_defs/toolchain-amd64-linux-gnu.cmake | 4 +- cfg/sims/nos3-simulator.xml | 59 ++++++++++--------- components/cryptolib | 2 +- gsw/cosmos | 2 +- scripts/docker_build_cryptolib.sh | 31 ++++++++++ scripts/docker_launch.sh | 3 +- scripts/env.sh | 2 +- 10 files changed, 77 insertions(+), 38 deletions(-) create mode 100644 scripts/docker_build_cryptolib.sh diff --git a/Makefile b/Makefile index 0852ced2..341c1790 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,7 @@ BUILDTYPE ?= debug INSTALLPREFIX ?= exe FSWBUILDDIR ?= $(CURDIR)/fsw/build +GSWBUILDDIR ?= $(CURDIR)/gsw/build SIMBUILDDIR ?= $(CURDIR)/sims/build export CFS_APP_PATH = ../components @@ -45,6 +46,11 @@ all: $(MAKE) sim $(MAKE) gsw +build-cryptolib: + mkdir -p $(GSWBUILDDIR) + cd $(GSWBUILDDIR) && cmake $(PREP_OPTS) -DSUPPORT=1 ../../components/cryptolib + $(MAKE) --no-print-directory -C $(GSWBUILDDIR) + build-fsw: mkdir -p $(FSWBUILDDIR) cd $(FSWBUILDDIR) && cmake $(PREP_OPTS) ../cfe @@ -72,6 +78,7 @@ clean-sim: rm -rf sims/build clean-gsw: + rm -rf gsw/build rm -rf gsw/cosmos/build config: @@ -84,6 +91,7 @@ fsw: ./scripts/docker_build_fsw.sh gsw: + ./scripts/docker_build_cryptolib.sh ./cfg/build/gsw_build.sh launch: diff --git a/cfg/nos3_defs/cpu1_cfe_es_startup.scr b/cfg/nos3_defs/cpu1_cfe_es_startup.scr index 324d5265..2b1520f7 100644 --- a/cfg/nos3_defs/cpu1_cfe_es_startup.scr +++ b/cfg/nos3_defs/cpu1_cfe_es_startup.scr @@ -1,5 +1,6 @@ CFE_LIB, hwlib, hwlib_Init, HW_LIB, 0, 0, 0x0, 0; CFE_LIB, io_lib, IO_LibInit, IO_LIB, 0, 0, 0x0, 0; +CFE_LIB, crypto, Crypto_TC_Init, CRYPTO, 0, 0, 0x0, 0; CFE_APP, sch, SCH_AppMain, SCH, 40, 16384, 0x0, 0; CFE_APP, ci, CI_AppMain, CI, 41, 16384, 0x0, 0; @@ -33,7 +34,6 @@ CFE_APP, generic_st, ST_AppMain, ST, CFE_APP, syn, SYN_AppMain, SYN, 72, 32768, 0x0, 0; CFE_LIB, cfs_lib, CFS_LibInit, CFS_LIB, 0, 0, 0x0, 0; -CFE_LIB, crypto, Crypto_TC_Init, CRYPTO, 0, 0, 0x0, 0; CFE_APP, cs, CS_AppMain, CS, 55, 16384, 0x0, 0; CFE_APP, hk, HK_AppMain, HK, 63, 16384, 0x0, 0; CFE_APP, hs, HS_AppMain, HS, 56, 16384, 0x0, 0; diff --git a/cfg/nos3_defs/targets.cmake b/cfg/nos3_defs/targets.cmake index ddc442dd..4f4b8e76 100644 --- a/cfg/nos3_defs/targets.cmake +++ b/cfg/nos3_defs/targets.cmake @@ -84,7 +84,7 @@ list(APPEND MISSION_GLOBAL_APPLIST # # Libraries # - #cryptolib + cryptolib hwlib io_lib # diff --git a/cfg/nos3_defs/toolchain-amd64-linux-gnu.cmake b/cfg/nos3_defs/toolchain-amd64-linux-gnu.cmake index a062e7fc..b0656fc0 100644 --- a/cfg/nos3_defs/toolchain-amd64-linux-gnu.cmake +++ b/cfg/nos3_defs/toolchain-amd64-linux-gnu.cmake @@ -30,5 +30,5 @@ add_definitions(-DBYTE_ORDER_LE) add_definitions(-D_LINUX_OS_) set(CMAKE_POSITION_INDEPENDENT_CODE ON) -set(CI_TRANSPORT udp) -set(TO_TRANSPORT udp) +set(CI_TRANSPORT udp_tf) +set(TO_TRANSPORT udp_tf) diff --git a/cfg/sims/nos3-simulator.xml b/cfg/sims/nos3-simulator.xml index 4c0b08dd..2cd2e2f1 100644 --- a/cfg/sims/nos3-simulator.xml +++ b/cfg/sims/nos3-simulator.xml @@ -134,8 +134,8 @@ SAMPLE_42_PROVIDER fortytwo 4242 - 20 - 5 + 30 + 1 0 @@ -158,8 +158,8 @@ GPS42SOCKET fortytwo 4245 - 20 - 5 + 30 + 1 0 0 37 @@ -218,8 +218,8 @@ GENERIC_EPS_42_PROVIDER fortytwo 4283 - 20 - 5 + 30 + 1 0 @@ -299,8 +299,8 @@ fortytwo 4277 4278 - 20 - 5 + 30 + 1 0 0 @@ -325,8 +325,8 @@ fortytwo 4377 4378 - 20 - 5 + 30 + 1 0 1 @@ -351,8 +351,8 @@ fortytwo 4477 4478 - 20 - 5 + 30 + 1 0 2 @@ -376,8 +376,8 @@ GENERIC_CSS_42_PROVIDER fortytwo 4227 - 20 - 5 + 30 + 1 0 <42-css-scale-factor>1.0 @@ -405,8 +405,8 @@ GENERIC_TORQUER_42_PROVIDER fortytwo 4279 - 20 - 5 + 30 + 1 3 @@ -437,8 +437,8 @@ TRUTH42PROVIDER fortytwo 9999 - 20 - 5 + 30 + 1 0 0 @@ -462,8 +462,8 @@ GENERIC_FSS_42_PROVIDER fortytwo 4281 - 20 - 5 + 30 + 1 0 @@ -495,15 +495,16 @@ gsw - cosmos + - prox @@ -540,8 +541,8 @@ GENERIC_IMU_42_PROVIDER fortytwo 4280 - 20 - 5 + 30 + 1 0 @@ -567,8 +568,8 @@ GENERIC_MAG_42_PROVIDER fortytwo 4234 - 20 - 5 + 30 + 1 0 @@ -594,8 +595,8 @@ GENERIC_STAR_TRACKER_42_PROVIDER fortytwo 4282 - 20 - 5 + 30 + 1 0 0 diff --git a/components/cryptolib b/components/cryptolib index 9fe8788c..174e896c 160000 --- a/components/cryptolib +++ b/components/cryptolib @@ -1 +1 @@ -Subproject commit 9fe8788cb487e5d883f4c8db68b607197cdc089f +Subproject commit 174e896c0f1587f4b4a0b0ed21d567a6ba2496d6 diff --git a/gsw/cosmos b/gsw/cosmos index 3b229c95..979bbf4d 160000 --- a/gsw/cosmos +++ b/gsw/cosmos @@ -1 +1 @@ -Subproject commit 3b229c951b122320c7b0ac6618cc9e7c25ba3c07 +Subproject commit 979bbf4d73e60e4a69ef310b6567524bae78d2a7 diff --git a/scripts/docker_build_cryptolib.sh b/scripts/docker_build_cryptolib.sh new file mode 100644 index 00000000..63126da2 --- /dev/null +++ b/scripts/docker_build_cryptolib.sh @@ -0,0 +1,31 @@ +#!/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 ground software build directory +mkdir -p $BASE_DIR/gsw/build + +# Build +$DFLAGS_CPUS -v $BASE_DIR:$BASE_DIR --name "nos_build_cryptolib" -w $BASE_DIR $DBOX make -j$NUM_CPUS build-cryptolib diff --git a/scripts/docker_launch.sh b/scripts/docker_launch.sh index 5243c866..1eb1eb05 100755 --- a/scripts/docker_launch.sh +++ b/scripts/docker_launch.sh @@ -127,8 +127,7 @@ do gnome-terminal --tab --title=$SC_NUM" - StarTrk Sim" -- $DFLAGS -v $SIM_DIR:$SIM_DIR --name $SC_NUM"_startrk_sim" --network=$SC_NETNAME -w $SIM_BIN $DBOX ./nos3-single-simulator $SC_CFG_FILE generic_star_tracker_sim gnome-terminal --tab --title=$SC_NUM" - Torquer Sim" -- $DFLAGS -v $SIM_DIR:$SIM_DIR --name $SC_NUM"_torquer_sim" --network=$SC_NETNAME -w $SIM_BIN $DBOX ./nos3-single-simulator $SC_CFG_FILE generic_torquer_sim - # Note: Can keep open if desired after a new gnome-profile is manually created - #gnome-terminal --window-with-profile=KeepOpen --tab --title=$SC_NUM" - Sample Sim" -- $DFLAGS -v $SIM_DIR:$SIM_DIR --name $SC_NUM"_sample_sim" --network=$SC_NETNAME -w $SIM_BIN $DBOX ./nos3-single-simulator $SC_CFG_FILE sample_sim + gnome-terminal --window-with-profile=KeepOpen --title=$SC_NUM" - CryptoLib" -- $DFLAGS -v $BASE_DIR:$BASE_DIR --name $SC_NUM"_cryptolib" --network=$SC_NETNAME --network-alias=cryptolib -w $BASE_DIR/gsw/build $DBOX ./support/standalone echo "" done diff --git a/scripts/env.sh b/scripts/env.sh index 0fb42b28..6bf3791a 100755 --- a/scripts/env.sh +++ b/scripts/env.sh @@ -40,7 +40,7 @@ OPENC3_PATH=$OPENC3_DIR/openc3.sh DNETWORK="docker network" #fi -DBOX="ivvitc/nos3-64:20240306" +DBOX="ivvitc/nos3-64:dev" # Debugging #echo "Script directory = " $SCRIPT_DIR