From fe4315666bc97cd18ea15f1a89f9abdae8891834 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 6 May 2022 15:27:56 +0200 Subject: [PATCH 01/15] added helper script for yocto installation - Installs compiled binaries into yocto repo for rootfs rebuild --- cmake/HardwareOsPostConfig.cmake | 2 +- scripts/install-obsw-yocto.sh | 62 ++++++++++++++++++++++++++++++++ scripts/q7s-env.sh | 1 + tmtc | 2 +- 4 files changed, 65 insertions(+), 2 deletions(-) create mode 100755 scripts/install-obsw-yocto.sh diff --git a/cmake/HardwareOsPostConfig.cmake b/cmake/HardwareOsPostConfig.cmake index 5146de98..cfa7a178 100644 --- a/cmake/HardwareOsPostConfig.cmake +++ b/cmake/HardwareOsPostConfig.cmake @@ -30,7 +30,7 @@ add_compile_options( $<$:${ASM_FLAGS}> ) -set(STRIPPED_OBSW_NAME ${OBSW_BIN_NAME}-stripped) +set(STRIPPED_OBSW_NAME ${CMAKE_PROJECT_NAME}-stripped) set(STRIPPED_WATCHDOG_NAME eive-watchdog-stripped) add_custom_command( diff --git a/scripts/install-obsw-yocto.sh b/scripts/install-obsw-yocto.sh new file mode 100755 index 00000000..9298cb32 --- /dev/null +++ b/scripts/install-obsw-yocto.sh @@ -0,0 +1,62 @@ +#!/bin/bash + +build_dir=cmake-build-release-q7s +obsw_root="" +q7s_yocto_dir="q7s-yocto" +q7s_package_path="q7s-package/${q7s_yocto_dir}" + +yocto_obsw_path="yocto/meta-eive/recipes-core/eive-obsw/files" +yocto_watchdog_path="yocto/meta-eive/recipes-support/eive-obsw-watchdog/files" +obsw_bin_name="eive-obsw-stripped" +watchdog_bin_name="eive-watchdog-stripped" + +if [ ! -z ${EIVE_OBSW_ROOT} ]; then + cd ${EIVE_OBSW_ROOT} +elif [ -d ${build_dir} ]; then + obsw_root=${build_dir} + : +elif [ -d ../${build_dir} ]; then + cd .. + obsw_root=$(pwd) +else + echo "No way into the EIVE OBSW Root folder found. Exiting" + exit 1 +fi + +yocto_root="" +if [ -d ../${q7s_package_path} ]; then + cd ../${q7s_package_path} + yocto_root=$(pwd) +elif [ -d ../${q7s_yocto_dir} ] + cd ../${q7s_yocto_dir} + yocto_root=$(pwd) +fi +if [ -z ${yocto_root} ]; then + echo "No yocto directory found. Exiting" + exit 1 +fi + +cd ${obsw_root} + +if [ ! -d ${build_dir} ]; then + echo "No Q7S Release binary folder ${build_dir} found. Exiting" + exit 1 +fi + +if [ ! -f ${obsw_bin_name} ]; then + echo "No EIVE OBSW binary found to intall to yocto" +else + cp_cmd="cp $(pwd)/${obsw_bin_name} ${yocto_root}/${yocto_obsw_path}/eive-obsw" + echo "Executing ${cp_cmd}" + eval ${cp_cmd} + echo "Installed EIVE OBSW into yocto repository successfully" +fi + +if [ ! -f ${watchdog_bin_name} ]; then + echo "No EIVE Watchdog found to intall to yocto" +else + cp_cmd="cp $(pwd)/${watchdog_bin_name} ${yocto_root}/${yocto_obsw_path}/eive-obsw" + echo "Executing ${cp_cmd}" + eval ${cp_cmd} + echo "Installed EIVE watchdog into yocto repository successfully" +fi diff --git a/scripts/q7s-env.sh b/scripts/q7s-env.sh index 2b455f6c..c5638323 100755 --- a/scripts/q7s-env.sh +++ b/scripts/q7s-env.sh @@ -16,6 +16,7 @@ if [[ -d "eive-obsw" ]]; then export EIVE_OBSW_ROOT="$(pwd)/eive-obsw" echo "Adding $(pwd)/eive-obsw/cmake/scripts/q7s helper script path to PATH" export PATH=$PATH:"$(pwd)/eive-obsw/cmake/scripts/q7s" + export PATH=$PATH:"$(pwd)/eive-obsw/scripts" cd "eive-obsw" fi export CONSOLE_PREFIX="[Q7S ENV]" diff --git a/tmtc b/tmtc index 5e9f83cd..c5862579 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 5e9f83cd68c307617b2b05ccc0f9902f5795f8cf +Subproject commit c5862579348974882e23d39d0a6d9b2844159b99 From 9383a6088bc81f56724a185d8c20b9e50bbf361c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 6 May 2022 15:33:05 +0200 Subject: [PATCH 02/15] build script bugfixes --- cmake/scripts/q7s/q7s-make-release.sh | 2 +- cmake/scripts/q7s/q7s-ninja-debug.sh | 2 +- cmake/scripts/q7s/q7s-ninja-release.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/scripts/q7s/q7s-make-release.sh b/cmake/scripts/q7s/q7s-make-release.sh index d9b74bc3..b86ca873 100755 --- a/cmake/scripts/q7s/q7s-make-release.sh +++ b/cmake/scripts/q7s/q7s-make-release.sh @@ -20,7 +20,7 @@ else cfg_script_name="${EIVE_OBSW_ROOT}/cmake/scripts/${cfg_script_name}" fi -if [[ -z "${EIVE_Q7S_EM}" ]]; then +if [ ! -z "${EIVE_Q7S_EM}" ]; then build_defs="EIVE_Q7S_EM=ON" fi diff --git a/cmake/scripts/q7s/q7s-ninja-debug.sh b/cmake/scripts/q7s/q7s-ninja-debug.sh index bf880a28..ad50b6a6 100755 --- a/cmake/scripts/q7s/q7s-ninja-debug.sh +++ b/cmake/scripts/q7s/q7s-ninja-debug.sh @@ -20,7 +20,7 @@ else cfg_script_name="${EIVE_OBSW_ROOT}/cmake/scripts/${cfg_script_name}" fi -if [[ -z "${EIVE_Q7S_EM}" ]]; then +if [ ! -z "${EIVE_Q7S_EM}" ]; then build_defs="EIVE_Q7S_EM=ON" fi diff --git a/cmake/scripts/q7s/q7s-ninja-release.sh b/cmake/scripts/q7s/q7s-ninja-release.sh index 4dfaa210..f0587f5c 100755 --- a/cmake/scripts/q7s/q7s-ninja-release.sh +++ b/cmake/scripts/q7s/q7s-ninja-release.sh @@ -20,7 +20,7 @@ else cfg_script_name="${EIVE_OBSW_ROOT}/cmake/scripts/${cfg_script_name}" fi -if [[ -z "${EIVE_Q7S_EM}" ]]; then +if [ ! -z "${EIVE_Q7S_EM}" ]; then build_defs="EIVE_Q7S_EM=ON" fi From bacce958811bbdb796a2573e14f16dd5b1e4cfc0 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 6 May 2022 15:38:50 +0200 Subject: [PATCH 03/15] corrections for install script --- scripts/install-obsw-yocto.sh | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/scripts/install-obsw-yocto.sh b/scripts/install-obsw-yocto.sh index 9298cb32..d7354f27 100755 --- a/scripts/install-obsw-yocto.sh +++ b/scripts/install-obsw-yocto.sh @@ -1,5 +1,6 @@ #!/bin/bash +init_dir=$(pwd) build_dir=cmake-build-release-q7s obsw_root="" q7s_yocto_dir="q7s-yocto" @@ -9,9 +10,12 @@ yocto_obsw_path="yocto/meta-eive/recipes-core/eive-obsw/files" yocto_watchdog_path="yocto/meta-eive/recipes-support/eive-obsw-watchdog/files" obsw_bin_name="eive-obsw-stripped" watchdog_bin_name="eive-watchdog-stripped" +obsw_target_name="eive-obsw" +watchdog_target_name="eive-watchdog" if [ ! -z ${EIVE_OBSW_ROOT} ]; then cd ${EIVE_OBSW_ROOT} + obsw_root=$(pwd) elif [ -d ${build_dir} ]; then obsw_root=${build_dir} : @@ -27,7 +31,7 @@ yocto_root="" if [ -d ../${q7s_package_path} ]; then cd ../${q7s_package_path} yocto_root=$(pwd) -elif [ -d ../${q7s_yocto_dir} ] +elif [ -d ../${q7s_yocto_dir} ]; then cd ../${q7s_yocto_dir} yocto_root=$(pwd) fi @@ -37,26 +41,27 @@ if [ -z ${yocto_root} ]; then fi cd ${obsw_root} - if [ ! -d ${build_dir} ]; then echo "No Q7S Release binary folder ${build_dir} found. Exiting" exit 1 fi -if [ ! -f ${obsw_bin_name} ]; then +if [ ! -f ${build_dir}/${obsw_bin_name} ]; then echo "No EIVE OBSW binary found to intall to yocto" else - cp_cmd="cp $(pwd)/${obsw_bin_name} ${yocto_root}/${yocto_obsw_path}/eive-obsw" - echo "Executing ${cp_cmd}" + cp_cmd="cp $(pwd)/${build_dir}/${obsw_bin_name} ${yocto_root}/${yocto_obsw_path}/${obsw_target_name}" + echo "Executing: ${cp_cmd}" eval ${cp_cmd} echo "Installed EIVE OBSW into yocto repository successfully" fi -if [ ! -f ${watchdog_bin_name} ]; then +if [ ! -f ${build_dir}/${watchdog_bin_name} ]; then echo "No EIVE Watchdog found to intall to yocto" else - cp_cmd="cp $(pwd)/${watchdog_bin_name} ${yocto_root}/${yocto_obsw_path}/eive-obsw" - echo "Executing ${cp_cmd}" + cp_cmd="cp $(pwd)/${build_dir}/${watchdog_bin_name} ${yocto_root}/${yocto_obsw_path}/${watchdog_target_name}" + echo "Executing: ${cp_cmd}" eval ${cp_cmd} echo "Installed EIVE watchdog into yocto repository successfully" fi + +cd ${init_dir} From 2f182a5e2185e2f564b1a03f42a6ecdbd4f1c0e1 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 6 May 2022 15:41:29 +0200 Subject: [PATCH 04/15] docs --- scripts/install-obsw-yocto.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/install-obsw-yocto.sh b/scripts/install-obsw-yocto.sh index d7354f27..1e112a3d 100755 --- a/scripts/install-obsw-yocto.sh +++ b/scripts/install-obsw-yocto.sh @@ -1,4 +1,6 @@ #!/bin/bash +# This is a helper script to install the compiles EIVE OBSW files +# into the yocto repository to re-generate the mission root filesystem init_dir=$(pwd) build_dir=cmake-build-release-q7s @@ -58,7 +60,7 @@ fi if [ ! -f ${build_dir}/${watchdog_bin_name} ]; then echo "No EIVE Watchdog found to intall to yocto" else - cp_cmd="cp $(pwd)/${build_dir}/${watchdog_bin_name} ${yocto_root}/${yocto_obsw_path}/${watchdog_target_name}" + cp_cmd="cp $(pwd)/${build_dir}/${watchdog_bin_name} ${yocto_root}/${yocto_watchdog_path}/${watchdog_target_name}" echo "Executing: ${cp_cmd}" eval ${cp_cmd} echo "Installed EIVE watchdog into yocto repository successfully" From e4bbdbc5321512205017d1ddb60923782e1828cb Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 6 May 2022 15:53:16 +0200 Subject: [PATCH 05/15] copy version file as well --- scripts/install-obsw-yocto.sh | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/scripts/install-obsw-yocto.sh b/scripts/install-obsw-yocto.sh index 1e112a3d..cb8f3283 100755 --- a/scripts/install-obsw-yocto.sh +++ b/scripts/install-obsw-yocto.sh @@ -8,6 +8,7 @@ obsw_root="" q7s_yocto_dir="q7s-yocto" q7s_package_path="q7s-package/${q7s_yocto_dir}" +obsw_version_filename="obsw_version.txt" yocto_obsw_path="yocto/meta-eive/recipes-core/eive-obsw/files" yocto_watchdog_path="yocto/meta-eive/recipes-support/eive-obsw-watchdog/files" obsw_bin_name="eive-obsw-stripped" @@ -25,7 +26,7 @@ elif [ -d ../${build_dir} ]; then cd .. obsw_root=$(pwd) else - echo "No way into the EIVE OBSW Root folder found. Exiting" + echo "-E- No way into the EIVE OBSW Root folder found. Exiting" exit 1 fi @@ -38,32 +39,49 @@ elif [ -d ../${q7s_yocto_dir} ]; then yocto_root=$(pwd) fi if [ -z ${yocto_root} ]; then - echo "No yocto directory found. Exiting" + echo "-E- No yocto directory found. Exiting" exit 1 fi cd ${obsw_root} + +version_cmd="git describe --tags --always --exclude docker_*" +echo "-I- Running ${version_cmd} to retrieve OBSW version and store it into ${obsw_version_filename}" +version_tag=$(${version_cmd}) +echo "-I- Detected version tag ${version_tag}" +echo ${version_tag} > ${obsw_version_filename} + if [ ! -d ${build_dir} ]; then echo "No Q7S Release binary folder ${build_dir} found. Exiting" exit 1 fi if [ ! -f ${build_dir}/${obsw_bin_name} ]; then - echo "No EIVE OBSW binary found to intall to yocto" + echo "-W- No EIVE OBSW binary found to intall to yocto" else cp_cmd="cp $(pwd)/${build_dir}/${obsw_bin_name} ${yocto_root}/${yocto_obsw_path}/${obsw_target_name}" - echo "Executing: ${cp_cmd}" + echo "-I- Executing: ${cp_cmd}" eval ${cp_cmd} - echo "Installed EIVE OBSW into yocto repository successfully" + cp_ver_cmd="cp $(pwd)/${obsw_version_filename} ${yocto_root}/${yocto_obsw_path}/${obsw_target_name}" + echo "-I- Executing: ${cp_ver_cmd}" + eval ${cp_ver_cmd} + echo "-I- Installed EIVE OBSW into yocto repository successfully" fi if [ ! -f ${build_dir}/${watchdog_bin_name} ]; then - echo "No EIVE Watchdog found to intall to yocto" + echo "-W- No EIVE Watchdog found to intall to yocto" else cp_cmd="cp $(pwd)/${build_dir}/${watchdog_bin_name} ${yocto_root}/${yocto_watchdog_path}/${watchdog_target_name}" - echo "Executing: ${cp_cmd}" + echo "-I- Executing: ${cp_cmd}" eval ${cp_cmd} - echo "Installed EIVE watchdog into yocto repository successfully" + cp_ver_cmd="cp $(pwd)/${obsw_version_filename} ${yocto_root}/${yocto_watchdog_path}/${watchdog_target_name}" + echo "-I- Executing: ${cp_ver_cmd}" + eval ${cp_ver_cmd} + echo "-I- Installed EIVE watchdog into yocto repository successfully" +fi + +if [ -f $(pwd)/${obsw_version_filename} ]; then + rm $(pwd)/${obsw_version_filename} fi cd ${init_dir} From cc25489e75d64ab3b1557beef262eab59d0a4034 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 6 May 2022 15:54:45 +0200 Subject: [PATCH 06/15] important bugfix --- scripts/install-obsw-yocto.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install-obsw-yocto.sh b/scripts/install-obsw-yocto.sh index cb8f3283..faace97d 100755 --- a/scripts/install-obsw-yocto.sh +++ b/scripts/install-obsw-yocto.sh @@ -62,7 +62,7 @@ else cp_cmd="cp $(pwd)/${build_dir}/${obsw_bin_name} ${yocto_root}/${yocto_obsw_path}/${obsw_target_name}" echo "-I- Executing: ${cp_cmd}" eval ${cp_cmd} - cp_ver_cmd="cp $(pwd)/${obsw_version_filename} ${yocto_root}/${yocto_obsw_path}/${obsw_target_name}" + cp_ver_cmd="cp $(pwd)/${obsw_version_filename} ${yocto_root}/${yocto_obsw_path}" echo "-I- Executing: ${cp_ver_cmd}" eval ${cp_ver_cmd} echo "-I- Installed EIVE OBSW into yocto repository successfully" @@ -74,7 +74,7 @@ else cp_cmd="cp $(pwd)/${build_dir}/${watchdog_bin_name} ${yocto_root}/${yocto_watchdog_path}/${watchdog_target_name}" echo "-I- Executing: ${cp_cmd}" eval ${cp_cmd} - cp_ver_cmd="cp $(pwd)/${obsw_version_filename} ${yocto_root}/${yocto_watchdog_path}/${watchdog_target_name}" + cp_ver_cmd="cp $(pwd)/${obsw_version_filename} ${yocto_root}/${yocto_watchdog_path}" echo "-I- Executing: ${cp_ver_cmd}" eval ${cp_ver_cmd} echo "-I- Installed EIVE watchdog into yocto repository successfully" From 08dc8630d6acced74b4be491ccced5346271ecc6 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 6 May 2022 16:43:12 +0200 Subject: [PATCH 07/15] create generic OBSW by default and copy to unique --- CMakeLists.txt | 7 ++----- cmake/HardwareOsPostConfig.cmake | 11 +++++++++++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c96070b3..e2901caa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -275,11 +275,8 @@ add_library(${LIB_EIVE_MISSION}) # Add main executable add_executable(${OBSW_NAME}) -if(EIVE_CREATE_UNIQUE_OBSW_BIN) - set(OBSW_BIN_NAME ${CMAKE_PROJECT_NAME}-$ENV{USERNAME}) -else() - set(OBSW_BIN_NAME ${CMAKE_PROJECT_NAME}) -endif() +set(OBSW_BIN_NAME ${CMAKE_PROJECT_NAME}) + set_target_properties(${OBSW_NAME} PROPERTIES OUTPUT_NAME ${OBSW_BIN_NAME}) # Watchdog diff --git a/cmake/HardwareOsPostConfig.cmake b/cmake/HardwareOsPostConfig.cmake index cfa7a178..aa9e810e 100644 --- a/cmake/HardwareOsPostConfig.cmake +++ b/cmake/HardwareOsPostConfig.cmake @@ -33,6 +33,10 @@ add_compile_options( set(STRIPPED_OBSW_NAME ${CMAKE_PROJECT_NAME}-stripped) set(STRIPPED_WATCHDOG_NAME eive-watchdog-stripped) +if(EIVE_CREATE_UNIQUE_OBSW_BIN) + set(UNIQUE_OBSW_BIN_NAME ${OBSW_BIN_NAME}-$ENV{USERNAME}) +endif() + add_custom_command( TARGET ${OBSW_NAME} POST_BUILD @@ -41,6 +45,13 @@ add_custom_command( COMMENT "Generating stripped executable ${STRIPPED_OBSW_NAME}.." ) +add_custom_command( + TARGET ${OBSW_NAME} + POST_BUILD + COMMAND ${CMAKE_COMMAND} copy + ${CMAKE_CURRENT_BINARY_DIR}/${OBSW_BIN_NAME} + ${CMAKE_CURRENT_BINARY_DIR}/${UNIQUE_OBSW_BIN_NAME}) + add_custom_command( TARGET ${WATCHDOG_NAME} POST_BUILD From 7ab0a3683cf11bfa8cd92e236c8b0fbce8dfd9f7 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 6 May 2022 16:46:22 +0200 Subject: [PATCH 08/15] this works better --- cmake/HardwareOsPostConfig.cmake | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/cmake/HardwareOsPostConfig.cmake b/cmake/HardwareOsPostConfig.cmake index aa9e810e..111e859a 100644 --- a/cmake/HardwareOsPostConfig.cmake +++ b/cmake/HardwareOsPostConfig.cmake @@ -30,7 +30,7 @@ add_compile_options( $<$:${ASM_FLAGS}> ) -set(STRIPPED_OBSW_NAME ${CMAKE_PROJECT_NAME}-stripped) +set(STRIPPED_OBSW_NAME ${OBSW_BIN_NAME}-stripped) set(STRIPPED_WATCHDOG_NAME eive-watchdog-stripped) if(EIVE_CREATE_UNIQUE_OBSW_BIN) @@ -45,12 +45,15 @@ add_custom_command( COMMENT "Generating stripped executable ${STRIPPED_OBSW_NAME}.." ) -add_custom_command( - TARGET ${OBSW_NAME} - POST_BUILD - COMMAND ${CMAKE_COMMAND} copy - ${CMAKE_CURRENT_BINARY_DIR}/${OBSW_BIN_NAME} - ${CMAKE_CURRENT_BINARY_DIR}/${UNIQUE_OBSW_BIN_NAME}) +if(UNIQUE_OBSW_BIN_NAME) + add_custom_command( + TARGET ${OBSW_NAME} + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy + ${CMAKE_CURRENT_BINARY_DIR}/${OBSW_BIN_NAME} + ${CMAKE_CURRENT_BINARY_DIR}/${UNIQUE_OBSW_BIN_NAME} + COMMENT "Generating unique EIVE OBSW binary ${UNIQUE_OBSW_BIN_NAME}") +endif() add_custom_command( TARGET ${WATCHDOG_NAME} From a5a79da7230bf8491e72809cbf55c72b16cba71c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 6 May 2022 16:47:09 +0200 Subject: [PATCH 09/15] install non-stripped files now --- scripts/install-obsw-yocto.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install-obsw-yocto.sh b/scripts/install-obsw-yocto.sh index faace97d..1dd02016 100755 --- a/scripts/install-obsw-yocto.sh +++ b/scripts/install-obsw-yocto.sh @@ -11,8 +11,8 @@ q7s_package_path="q7s-package/${q7s_yocto_dir}" obsw_version_filename="obsw_version.txt" yocto_obsw_path="yocto/meta-eive/recipes-core/eive-obsw/files" yocto_watchdog_path="yocto/meta-eive/recipes-support/eive-obsw-watchdog/files" -obsw_bin_name="eive-obsw-stripped" -watchdog_bin_name="eive-watchdog-stripped" +obsw_bin_name="eive-obsw" +watchdog_bin_name="eive-watchdog" obsw_target_name="eive-obsw" watchdog_target_name="eive-watchdog" From 3cca73ae9f86a3c8170d14c7b4d6f0841aac5704 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 7 May 2022 12:51:47 +0200 Subject: [PATCH 10/15] update other helper scripts as well --- scripts/q7s-env-em.sh | 1 + scripts/win-q7s-env-em.sh | 1 + scripts/win-q7s-env.sh | 1 + 3 files changed, 3 insertions(+) diff --git a/scripts/q7s-env-em.sh b/scripts/q7s-env-em.sh index 11f9987a..895648a2 100755 --- a/scripts/q7s-env-em.sh +++ b/scripts/q7s-env-em.sh @@ -16,6 +16,7 @@ if [[ -d "eive-obsw" ]]; then export EIVE_OBSW_ROOT="$(pwd)/eive-obsw" echo "Adding $(pwd)/eive-obsw/cmake/scripts/q7s helper script path to PATH" export PATH=$PATH:"$(pwd)/eive-obsw/cmake/scripts/q7s" + export PATH=$PATH:"$(pwd)/eive-obsw/scripts" cd "eive-obsw" fi export CONSOLE_PREFIX="[Q7S ENV]" diff --git a/scripts/win-q7s-env-em.sh b/scripts/win-q7s-env-em.sh index 8c15f2c9..5ff9bcf4 100644 --- a/scripts/win-q7s-env-em.sh +++ b/scripts/win-q7s-env-em.sh @@ -54,5 +54,6 @@ if [ -d "eive-obsw" ]; then export EIVE_OBSW_ROOT="$(pwd)/eive-obsw" echo "Adding $(pwd)/eive-obsw/cmake/scripts/q7s helper script path to PATH" export PATH=$PATH:"$(pwd)/eive-obsw/cmake/scripts/q7s" + export PATH=$PATH:"$(pwd)/eive-obsw/scripts" cd "eive-obsw" fi diff --git a/scripts/win-q7s-env.sh b/scripts/win-q7s-env.sh index 292b09c9..243ea311 100644 --- a/scripts/win-q7s-env.sh +++ b/scripts/win-q7s-env.sh @@ -54,5 +54,6 @@ if [ -d "eive-obsw" ]; then export EIVE_OBSW_ROOT="$(pwd)/eive-obsw" echo "Adding $(pwd)/eive-obsw/cmake/scripts/q7s helper script path to PATH" export PATH=$PATH:"$(pwd)/eive-obsw/cmake/scripts/q7s" + export PATH=$PATH:"$(pwd)/eive-obsw/scripts" cd "eive-obsw" fi From 9884ea225e00935399ec418d5350621291111663 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 7 May 2022 12:54:25 +0200 Subject: [PATCH 11/15] update CHANGELOG --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c7fce0a5..9c785d02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,15 @@ list yields a list of all related PRs for each release. # [v1.12.0] +## Added + +- Adds a yocto helper script which is able to install the release build binaries + (OBSW and Watchdog) into the `q7s-yocto` repository as long as the `q7s-package` + or `q7s-yocto` repo was cloned in the same directory the EIVE OBSW repo. + This makes updating the root filesystem a lot easier. It also creates and installs a + version file. + PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/248 + ## Changed - Build unittest as default side product of hosted builds From a4e36ebdb664216a4d61f6fcd161193008ad534e Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 7 May 2022 12:55:48 +0200 Subject: [PATCH 12/15] update changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c785d02..3cb04011 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,9 @@ list yields a list of all related PRs for each release. This makes updating the root filesystem a lot easier. It also creates and installs a version file. PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/248 +- Create the generic image by default for the Q7S build. The unique binary with the + username appended at the end is created as a side-product now + PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/248 ## Changed From 7de968937e1b86286153e3dba66c3be40bf7a065 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sun, 8 May 2022 12:33:49 +0200 Subject: [PATCH 13/15] repoint tmtc --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index 1e25b08e..c5862579 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 1e25b08e40db28103b91814f7de5a47dae5b9e76 +Subproject commit c5862579348974882e23d39d0a6d9b2844159b99 From e59026d87c71fdeb1f8ec1061b66abd28e917050 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sun, 8 May 2022 12:55:17 +0200 Subject: [PATCH 14/15] update README --- README.md | 88 ++++++++++++++++++++++++++++++++----------------------- 1 file changed, 51 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index 97fe4056..5ef964eb 100644 --- a/README.md +++ b/README.md @@ -70,8 +70,9 @@ prerequisites. ## Building the OBSW and flashing it on the Q7S 1. ARM cross-compiler installed, either as part of [Vivado 2018.2 installation](#vivado) or - as a [separate download](#arm-toolchain) -2. [Q7S sysroot](#sysroot) on local development machine + as a [separate download](#arm-toolchain). The Xiphos SDK also installs a cross-compiler, + but its version is currently too old to compile the OBSW (7.3.0). +2. [Q7S sysroot](#sysroot) on local development machine. It is installed by the Xiphos SDK 3. Recommended: Eclipse or [Vivado 2018.2 SDK](#vivado) for OBSW development 3. [TCF agent](https://wiki.eclipse.org/TCF) running on Q7S @@ -88,7 +89,7 @@ When using Windows, run theses steps in MSYS2. 1. Clone the repository with ```sh - git clone https://egit.irs.uni-stuttgart.de/eive/eive_obsw.git + git clone https://egit.irs.uni-stuttgart.de/eive/eive-obsw.git ``` 2. Update all the submodules @@ -144,13 +145,53 @@ When using Windows, run theses steps in MSYS2. There are also different values for `-DTGT_BSP` to build for the Raspberry Pi or the Beagle Bone Black: `arm/raspberrypi` and `arm/beagleboneblack`. -5. Build the software with +## Build for the Q7S target root filesystem with `yocto` + +The EIVE root filesystem will contain the EIVE OBSW and the Watchdog component. +It is currently generated with `yocto`, but the tool can not compile the primary +OBSW due to toolchain version incompatibility. Therefore, the OBSW components +are currently compiled using the toolchain specified in this README (e.g. installed by Vivado). + +However, it is still possible to install the two components using yocto. A few helper files were +provided to make this process easier. The following steps can be used to install the OBSW +components and a version file to the yocto sources for the generation of the complete EIVE root +file system image. The steps here are shown for Ubuntu, you can use the according Windows +helper scripts as well. + +1. Copy the `q7s-env.sh` script to the same layer as the `eive-obsw`. + + ```sh + cp scripts/q7s-env.sh .. + cd .. + ./q7s-env.sh + q7s-make-release.sh + ``` + +2. Compile the OBSW components in release mode ```sh - cd cmake-build-debug-q7s + cd cmake-build-release-q7s cmake --build . -j ``` +3. Make sure the [`q7s-yocto`](https://egit.irs.uni-stuttgart.de/eive/q7s-yocto) + repository or the [`q7s-package`](https://egit.irs.uni-stuttgart.de/eive/q7s-package.git) + repository and its `q7s-yocto` submodule were cloned in the same directory layer as + the `eive-obsw`. + +4. Run the install script to install the files into `q7s-yocto`. + + ```sh + install-obsw-yocto.sh + ``` + +5. Navigate into the `q7s-yocto` repo and review the changes. You can then add and push those + changes. + +6. You can now rebuild the root filesystem with the updated OBSW using `yocto`. This probably needs + to be done on another machine or in a VM. The [`q7s-yocto`](https://egit.irs.uni-stuttgart.de/eive/q7s-yocto) + repository contains details on how to best do this. + ## Building in Xilinx SDK 2018.2 1. Open Xilinx SDK 2018.2 @@ -661,35 +702,7 @@ Thus the replies are received with a larger delay compared to a direct TCP conne 3. Make sure the netmask of the ehternet interface of the workstation matches the netmask of the Q7S * When IP address is set to 192.168.133.10 and the netmask is 255.255.255.0, an example IP address for the workstation is 192.168.133.2 - -4. Run tcf-agent on Q7S - - * Tcf-agent is not yet integrated in the rootfs of the Q7S. Therefore build tcf-agent manually - - ```sh - git clone git://git.eclipse.org/gitroot/tcf/org.eclipse.tcf.agent.git - cd org.eclipse.tcf.agent/agent - make CC=arm-linux-gnueabihf-gcc LD=arm-linux-gnueabihf-ld MACHINE=arm NO_SSL=1 NO_UUID=1 - ``` - - * Transfer executable agent from org.eclipse.tcf.agent/agent/obj/GNU/Linux/arm/Debug to /tmp of Q7S - - ```sh - cd obj/GNU/Linux/arm/Debug - scp agent root@192.168.133.10:/tmp - ``` - - * On Q7S - ```sh - cd /tmp - chmod +x agent - ``` - - * Run agent - ```sh - ./agent - ``` - +4. Make sure th `tcf-agent` is running by checking `systemctl status tcf-agent` 5. In Xilinx SDK 2018.2 right click on project → Debug As → Debug Configurations 6. Right click Xilinx C/C++ applicaton (System Debugger) → New → 7. Set Debug Type to Linux Application Debug and Connectin to Linux Agent @@ -699,8 +712,8 @@ Thus the replies are received with a larger delay compared to a direct TCP conne 11. Test connection (This ensures the TCF Agent is running on the Q7S) 12. Select Application tab * Project Name: eive_obsw - * Local File Path: Path to eiveobsw-linux.elf (in `_bin\linux\devel`) - * Remote File Path: `/tmp/eive_obsw.elf` + * Local File Path: Path to OBSW application image with debug symbols (non-stripped) + * Remote File Path: `/tmp/` # Transfering Files to the Q7S @@ -726,7 +739,8 @@ From a windows machine files can be copied with putty tools (note: use IPv4 addr pscp -scp -P 22 eive@192.168.199.227:/example-file ```` -More detailed information about the used q7s commands can be found in the Q7S user manual. +A helper script named `q7s-cp.py` can be used together with the `q7s-port.sh` +script to make this process easier. # Q7S OBC From 54a36ac275cace4d27c23799c97f12f149ce1215 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sun, 8 May 2022 12:57:24 +0200 Subject: [PATCH 15/15] added back deleted part --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5ef964eb..cefb1046 100644 --- a/README.md +++ b/README.md @@ -144,7 +144,14 @@ When using Windows, run theses steps in MSYS2. There are also different values for `-DTGT_BSP` to build for the Raspberry Pi or the Beagle Bone Black: `arm/raspberrypi` and `arm/beagleboneblack`. - + +5. Build the software with + + ```sh + cd cmake-build-debug-q7s + cmake --build . -j + ``` + ## Build for the Q7S target root filesystem with `yocto` The EIVE root filesystem will contain the EIVE OBSW and the Watchdog component.