From 0543f6b4250e0f67391844edb75d98a6e9ca150b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 3 May 2022 12:44:15 +0200 Subject: [PATCH] update README and helper scripts --- README.md | 41 ++++++++++++++++++++++++++++++----------- scripts/q7s-env-em.sh | 10 ++++++++-- scripts/q7s-env.sh | 10 ++++++++-- 3 files changed, 46 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 32670771..ec2d74c2 100644 --- a/README.md +++ b/README.md @@ -107,28 +107,47 @@ When using Windows, run theses steps in MSYS2. Add `-G "MinGW Makefiles` in MinGW64 on Windows. ```sh - mkdir build-Debug-Q7S && cd build-Debug-Q7S + mkdir cmake-build-debug-q7s && cd cmake-build-debug-q7s cmake -DTGT_BSP="arm/q7s" -DCMAKE_BUILD_TYPE=Debug .. cmake --build . -j ``` - You can also use provided shell scripts to perform these commands - + You can also use provided shell scripts to perform these commands. ```sh - cd cmake/scripts/Q7S - ./make_debug_cfg.sh - cd ../../.. + cp scripts/q7s-env.sh .. + cp scripts/q7s-env-em.sh .. ``` - This will invoke a Python script which in turn invokes CMake with the correct - arguments to configure CMake for Q7S cross-compilation. + Adapt these scripts for your needs by editing the `CROSS_COMPILE_BIN_PATH` + and `ZYNQ_7020_SYSROOT`. After that, you can run the following commands to set up + the FM build + + ```sh + cd .. + ./q7s-env.sh + q7s-make-debug.sh + ``` + + You can build the EM setup by running + + ```sh + export EIVE_Q7S_EM=1 + ``` + + or by running the `q7s-env-em.sh` script instead before setting up the build + configuration. + + The shell scripts will invoke a Python script which in turn invokes CMake with the correct + arguments to configure CMake for Q7S cross-compilation. You can look into the command + output to see which commands were run exactly. 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 build-Debug-Q7S + cd cmake-build-debug-q7s cmake --build . -j ``` @@ -167,7 +186,7 @@ The EIVE OBSW is the default target if no target is specified. **Debug** ```sh -mkdir build-Debug-Q7S && cd build-Debug-Q7S +mkdir cmake-build-debug-q7s && cd cmake-build-debug-q7s cmake -DTGT_BSP=arm/q7s -DCMAKE_BUILD_TYPE=Debug .. cmake --build . -j ``` @@ -175,7 +194,7 @@ cmake --build . -j **Release** ```sh -mkdir build-Release-Q7S && cd build-Release-Q7S +mkdir cmake-build-release-q7s && cd cmake-build-release-q7s cmake -DTGT_BSP=arm/q7s -DCMAKE_BUILD_TYPE=Release .. cmake --build . -j ``` diff --git a/scripts/q7s-env-em.sh b/scripts/q7s-env-em.sh index 915b2f97..11f9987a 100755 --- a/scripts/q7s-env-em.sh +++ b/scripts/q7s-env-em.sh @@ -1,8 +1,14 @@ #!/bin/bash -i -export PATH=$PATH:"$HOME/EIVE/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin" -export CROSS_COMPILE="arm-linux-gnueabihf" +# This script is intended to be copied outside of the source directory on the +# same folder level as the eive-obsw folder. This allows to tweak it to +# custom cross-compiler and sysroot path setups +# Adapt the following two entries to your need +CROSS_COMPILE_BIN_PATH="$HOME/EIVE/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin" export ZYNQ_7020_SYSROOT="/opt/xiphos/sdk/ark/sysroots/cortexa9hf-neon-xiphos-linux-gnueabi" + +export PATH=$PATH:${CROSS_COMPILE_BIN_PATH} +export CROSS_COMPILE="arm-linux-gnueabihf" export EIVE_Q7S_EM=1 if [[ -d "eive-obsw" ]]; then diff --git a/scripts/q7s-env.sh b/scripts/q7s-env.sh index 261731a0..2b455f6c 100755 --- a/scripts/q7s-env.sh +++ b/scripts/q7s-env.sh @@ -1,8 +1,14 @@ #!/bin/bash -i -export PATH=$PATH:"$HOME/EIVE/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin" -export CROSS_COMPILE="arm-linux-gnueabihf" +# This script is intended to be copied outside of the source directory on the +# same folder level as the eive-obsw folder. This allows to tweak it to +# custom cross-compiler and sysroot path setups +# Adapt the following two entries to your need +CROSS_COMPILE_BIN_PATH="$HOME/EIVE/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin" export ZYNQ_7020_SYSROOT="/opt/xiphos/sdk/ark/sysroots/cortexa9hf-neon-xiphos-linux-gnueabi" + +export PATH=$PATH:${CROSS_COMPILE_BIN_PATH} +export CROSS_COMPILE="arm-linux-gnueabihf" # export EIVE_Q7S_EM=1 if [[ -d "eive-obsw" ]]; then