From c4b1703b8e718f886b5becccdc63a9a6ad4b2ce9 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 22 Apr 2022 10:48:31 +0200 Subject: [PATCH 1/4] update README --- README.md | 72 ++++++++++++++++++++++++++++++++----------------------- 1 file changed, 42 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index 7f9e9d72..b83e9498 100644 --- a/README.md +++ b/README.md @@ -39,12 +39,14 @@ Target systems: the [Xiphos Traq Platform](https://trac2.xiphos.ca/eive-q7). Press on index to find all relevant pages. The most recent datasheet can be found [here](https://trac2.xiphos.ca/manual/wiki/Q7RevB/UserManual). - * Linux OS built with Yocto 2.5 + * Linux OS built with Yocto 2.5. SDK and root filesystem can be rebuilt with + [yocto](https://egit.irs.uni-stuttgart.de/eive/q7s-yocto) * [Linux Kernel](https://github.com/XiphosSystemsCorp/linux-xlnx.git) . EIVE version can be found [here](https://github.com/spacefisch/linux-xlnx) . Pre-compiled files can be found [here](https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files/?dir=/EIVE_IRS/Software/q7s-linux-components&fileid=777299). * Q7S base project can be found [here](https://egit.irs.uni-stuttgart.de/eive/q7s-base) - * Minimal base project files can be found [here](https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files/?dir=/EIVE_IRS/Software/xiphos-q7s-sdk&fileid=510908) + * Minimal base project files and Xiphos SDK can be found + [here](https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files/?dir=/EIVE_IRS/Software/xiphos-q7s-sdk&fileid=510908) * Host System * Generic software components which are not dependant on hardware can also be run on a host system. All host code is contained in the `bsp_hosted` folder @@ -55,7 +57,8 @@ Target systems: The steps in the primary README are related to the main OBC target Q7S. The CMake build system can be used to generate build systems as well (see helper scripts in `cmake/scripts`: -- Linux (Raspberry Pi): See special section below. +- Linux Raspberry Pi: See special section below. Uses the `bsp_linux_board` folder +- Linux Trenz TE7020_1CFA: Uses the `bsp_te0720_1cfa` folder - Linux Host: Uses the `bsp_hosted` BSP folder and the CMake Unix Makefiles generator. - Windows Host: Uses the `bsp_hosted` BSP folder, the CMake MinGW Makefiles generator and MSYS2. @@ -68,7 +71,7 @@ prerequisites. 1. ARM cross-compiler installed, either as part of [Vivado 2018.2 installation](#vivado) or as a [separate download](#arm-toolchain) -2. [Q7S sysroot](#q7s-sysroot) on local development machine +2. [Q7S sysroot](#sysroot) on local development machine 3. Recommended: Eclipse or [Vivado 2018.2 SDK](#vivado) for OBSW development 3. [TCF agent](https://wiki.eclipse.org/TCF) running on Q7S @@ -96,11 +99,9 @@ When using Windows, run theses steps in MSYS2. git submodule update ``` -3. Ensure that the cross-compiler is working with `arm-linux-gnueabihf-gcc --version`. - It is recommended to set up a shell script which takes care of setting up the environment - for convenience or to set up the - [PATH and the CROSS_COMPILE variable permanently](https://unix.stackexchange.com/questions/26047/how-to-correctly-add-a-path-to-path) - in the `.profile` file. +3. Ensure that the cross-compiler is working with `arm-linux-gnueabihf-gcc --version` and that + the sysroot environmental variables have been set like specified in the + [root filesystem chapter](#sysroot). 4. Run the CMake configuration to create the build system in a `build-Debug-Q7S` folder. Add `-G "MinGW Makefiles` in MinGW64 on Windows. @@ -261,7 +262,7 @@ Other useful tmux commands: You can use the following command to connect to the Q7S with `ssh`: ```sh -q7s_ssh +q7s-fm-ssh ``` ## Port forwarding for connection to TCF agent @@ -310,6 +311,25 @@ There is also a shell script called `q7s-port.sh` which can be used to achieve t # Setting up prerequisites +## Getting system root for Linux cross-compilation + +Cross-compiling any program for an embedded Linux board generally required parts of the target root +file system on the development/host computer. For the Q7S, you can install the cross-compilation +root file system by simply installing the SDK. You can find the most recent SDK +[here](https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files/?dir=/EIVE_IRS/Software/xiphos-q7s-sdk). + +If you are compiling for the Q7S or the TE7020, the `ZYNQ_7020_SYSROOT` environment variable +must be set to the location of the SDK compile sysroot. Here is an example on how to do this +in Ubuntu, assuming the SDK was installed in the default location + +```sh +export ZYNQ_7020_SYSROOT="/opt/xiphos/sdk/ark/sysroots/cortexa9hf-neon-xiphos-linux-gnueabi" +``` + +If you are comiling for the Raspberry Pi, you have to set the `LINUX_ROOTFS` environmental +variable instead. You can find a base root filesystem for the Raspberry Pi +[here](https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files/?dir=/EIVE_IRS/Software/rootfs). + ## Installing Vivado the the Xilinx development tools It's also possible to perform debugging with a normal Eclipse installation by installing @@ -348,7 +368,9 @@ twice) and generate this list manually with the following commands, according to sudo apt install libncurses5 ``` -2. ```sh +2. Execute the following command + + ```sh sudo /Vivado/2018.2/bin/vivado -nolog -nojournal -mode batch -source /.xinstall/Vivado_2018.2/scripts/xlpartinfo.tcl -tclargs /Vivado/2018.2/data/parts/installed_devices.txt @@ -422,21 +444,6 @@ You can download the toolchains for Windows and Linux ```sh sudo apt-get install cmake ```` - -## Getting the Q7S system root - -It is necessary to copy the Q7S system root to your local development machine for libraries -like `libgpio`. You can find the system root for the Q7S, the Raspberry Pi and the -Beagle Bone Black for download here -[here](https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files/?dir=/EIVE_IRS/Software/rootfs&fileid=831849). -Download it and unzip it somewhere in the Xilinx installation folder. -You can use the following command if `wget` can be used or for CI/CD: - -```sh -wget https://eive-cloud.irs.uni-stuttgart.de/index.php/s/SyXpdBBQX32xPgE/download/cortexa9hf-neon-xiphos-linux-gnueabi.tar.gz -``` - -Then, create a new environmental variables `Q7S_SYSROOT` and set it to the local system root path. ### Updating system root for CI @@ -727,7 +734,10 @@ More detailed information about the used q7s commands can be found in the Q7S us # Q7S OBC -## Launching an application at start-up +## Launching an application at start-up - deprecated + +This way to enable auto-startup is deprecated. It is instead recommended to tweak the yocto +recipes file for the related `systemd` service to enable auto-startup with `SYSTEMD_AUTO_ENABLE`. You can also do the steps performed here on a host computer inside the `q7s-rootfs` directory of the [Q7S base repository](https://egit.irs.uni-stuttgart.de/eive/q7s-base). This might @@ -829,10 +839,9 @@ If a timeout occurs, this special file will be deleted as well. The watchdog and its configuration will be directly integrated into this repostory, which makes adaptions easy. -### `tcfagent` +### `tcf-agent` -This starts the `/usr/bin/agent` program to allows remote debugging. Might not be part of -the mission code +This starts the `/usr/bin/tcf-agent` program to allows remote debugging ### `eive-early-config` @@ -1196,8 +1205,11 @@ Alternatively, changes from other upstreams (forks) and branches can be merged l in the same way. # Coding Style + * the formatting is based on the clang-format tools + ## Setting up eclipse auto-fromatter with clang-format + 1. Help → Install New Software → Add 2. In location insert the link http://www.cppstyle.com/luna 3. The software package CppStyle should now be available for installation From d1814f9a496d87b95313aeb445e298e1d180039d Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 22 Apr 2022 10:50:40 +0200 Subject: [PATCH 2/4] submodule update --- fsfw | 2 +- tmtc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fsfw b/fsfw index 613dbe95..befaca78 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 613dbe9592c30d9acf4cdb95d81d9f216f07374b +Subproject commit befaca78c660f232c312667202f2bbd5da95c235 diff --git a/tmtc b/tmtc index 45470f8c..28983d38 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 45470f8c05ef214eb41940878ef0bfabf36a4891 +Subproject commit 28983d387b82578a73fbfe052cb53dec1910d021 From 1485b14c7d7fe85286068fb84c57a5def1faeda0 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 22 Apr 2022 10:55:52 +0200 Subject: [PATCH 3/4] some more README updates --- README.md | 55 ++++++++++++++++--------------------------------------- 1 file changed, 16 insertions(+), 39 deletions(-) diff --git a/README.md b/README.md index b83e9498..32670771 100644 --- a/README.md +++ b/README.md @@ -231,18 +231,19 @@ A serial console session is up permanently in a `tmux` session ### Serial console -You can check whether the sessions exist with `tmux ls` +You can check whether the sessions exist with `tmux ls`. +This is the command to connect to the serial interface of the FM using the +RS422 interface of the flight preparation panel: ```sh -tmux a -t q7s-serial +tmux a -t q7s-fm-fpp ``` If the session does not exist, you can create it like this ```sh -tmux new -s q7s-serial -/bin/bash -q7s_serial +tmux new -s q7s-fm-fpp -t /bin/bash +launch-q7s-fpp ``` Other useful tmux commands: @@ -265,46 +266,22 @@ You can use the following command to connect to the Q7S with `ssh`: q7s-fm-ssh ``` -## Port forwarding for connection to TCF agent - -This is a required step to connect to the `tcf-agent` on the Q7S, which is required for convenient -remote debugging. Assuming the IPv6 - -```sh -ssh -L 1534:192.168.133.10:1534 eive@2001:7c0:2018:1099:babe:0:e1fe:f1a5 -t /bin/bash -``` - -You then need to connect to `localhost` with port `1534`. - -## Port forwarding for file transfers with `scp` - -```sh -ssh -L 1535:192.168.133.10:22 eive@2001:7c0:2018:1099:babe:0:e1fe:f1a5 -t /bin/bash -``` - -You then need to run `scp` with the `-P 1535` flag with `localhost` as the target IP address. - -## Port forwarding for TMTC commanding - -You can enable port forwarding for TMTC commanding with the following command: - -```sh -ssh -L 1536:192.168.133.10:7301 eive@2001:7c0:2018:1099:babe:0:e1fe:f1a5 -t /bin/bash -``` - -This forwards TMTC packets on port `1536` of localhost to the TMTC reception port of the Q7S. - ## Set up all port forwarding at once +Port forwarding is necessary for remote-debugging using the `tcf-agent`, copying files +with `scp` & `q7s-cp.py` and sending TMTC commands. You can specify the `-L` option multiple times to set up all port forwarding at once. -Example for using the UDP communication interface: ```sh -ssh -L 1534:192.168.133.10:1534 \ - -L 1535:192.168.133.10:22 \ - -L 1536:192.168.133.10:7301 \ +ssh -L 1534:192.168.155.55:1534 \ + -L 1535:192.168.155.55:22 \ + -L 1536:192.168.155.55:7301 \ + -L 1537:127.0.0.1:7100 \ + -L 1538:192.168.133.10:1534 \ + -L 1539:192.168.133.10:22 \ + -L 1540:192.168.133.10:7301 \ eive@2001:7c0:2018:1099:babe:0:e1fe:f1a5 \ - -t 'export CONSOLE_PREFIX="[Q7S Tunnel] /bin/bash' + -t 'CONSOLE_PREFIX="[Q7S Tunnel]" /bin/bash' ``` There is also a shell script called `q7s-port.sh` which can be used to achieve the same. From 9ac5d0da6770e158a586aeb7f3973a951755b4a6 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 23 Apr 2022 12:30:20 +0200 Subject: [PATCH 4/4] submodule updates --- fsfw | 2 +- tmtc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fsfw b/fsfw index 24ef96d1..280b641c 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 24ef96d1b802e768d395f94b69f9f81a3c6d1e66 +Subproject commit 280b641cbc621d0c00c89851aaffbb64d5e5f40b diff --git a/tmtc b/tmtc index 28983d38..b1aaef90 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 28983d387b82578a73fbfe052cb53dec1910d021 +Subproject commit b1aaef90c72874f501c6524ec967827f17e8cedf