diff --git a/CHANGELOG.md b/CHANGELOG.md index c7fce0a5..3cb04011 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,18 @@ 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 +- 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 - Build unittest as default side product of hosted builds diff --git a/CMakeLists.txt b/CMakeLists.txt index 814f7f88..2443ec69 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/README.md b/README.md index 97fe4056..cefb1046 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 @@ -143,7 +144,7 @@ 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 @@ -151,6 +152,53 @@ When using Windows, run theses steps in MSYS2. 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. +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-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 +709,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 +719,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 +746,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 diff --git a/cmake/HardwareOsPostConfig.cmake b/cmake/HardwareOsPostConfig.cmake index 5146de98..111e859a 100644 --- a/cmake/HardwareOsPostConfig.cmake +++ b/cmake/HardwareOsPostConfig.cmake @@ -33,6 +33,10 @@ add_compile_options( set(STRIPPED_OBSW_NAME ${OBSW_BIN_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,16 @@ add_custom_command( COMMENT "Generating stripped executable ${STRIPPED_OBSW_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} POST_BUILD 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 diff --git a/misc/eclipse/.cproject b/misc/eclipse/.cproject index 355faa4d..3f612f37 100644 --- a/misc/eclipse/.cproject +++ b/misc/eclipse/.cproject @@ -687,7 +687,8 @@ - + + @@ -699,7 +700,8 @@ - + + @@ -868,6 +871,7 @@ +