updating READMEs for bbb and rpi

This commit is contained in:
2021-05-02 14:53:02 +02:00
parent a3fb7974ba
commit c6c75c92dc
2 changed files with 63 additions and 28 deletions

View File

@ -280,7 +280,7 @@ and running it on the BBB via command line. Navigate into the `fsfw_example` fol
```sh ```sh
cmake -G "Unix Makefiles" -DOS_FSFW=linux -DTGT_BSP=arm/beagleboneblack -DLINUX_CROSS_COMPILE=ON -DCMAKE_BUILD_TYPE=Debug .. cmake -G "Unix Makefiles" -DOS_FSFW=linux -DTGT_BSP=arm/beagleboneblack -DLINUX_CROSS_COMPILE=ON -DCMAKE_BUILD_TYPE=Debug ..
``` ```
On Windows, replace `-G "Unix Makefiles"` with `-G "MinGW Makefiles"`. On Windows, replace `-G "Unix Makefiles"` with `-G "MinGW Makefiles"`.
Alternatively, you can use the helper shell scripts located inside `cmake/scripts/BBB/crosscompile` Alternatively, you can use the helper shell scripts located inside `cmake/scripts/BBB/crosscompile`
@ -310,7 +310,6 @@ The toolchain path needs to be corrected, for example like shown in the followin
<img align="center" src="./images/eclipse/eclipse-cross-compile-win.png" width="50%"> <img align="center" src="./images/eclipse/eclipse-cross-compile-win.png" width="50%">
## Setting up the TCF agent on the BBB ## Setting up the TCF agent on the BBB
It is recommended to set up a [TCF agent](https://wiki.eclipse.org/TCF) for comfortable It is recommended to set up a [TCF agent](https://wiki.eclipse.org/TCF) for comfortable
@ -365,11 +364,11 @@ Navigate to the folder containing the symlinks
cd <rootfs_path>/usr/lib/arm-linux-gnueabihf cd <rootfs_path>/usr/lib/arm-linux-gnueabihf
``` ```
Type `more libpthread`, press `TAB` and check whether the symbolic Type `more libpthread`, press `TAB` and check whether the symbolic
link `libpthread.so` is shown. If it is not, we are going to set it up link `libpthread.so` is shown. If it is not, we are going to set it up
manually to avoid issues when linking against `pthread` later. manually to avoid issues when linking against `pthread` later.
Now you can find out where `libpthread.so` points with `readlink libpthread.so`. Now you can find out where `libpthread.so` points with `readlink libpthread.so`.
This information is used to convert the absolute symlink to relative ones, for example with: This information is used to convert the absolute symlink to relative ones, for example with:
Run the following command to copy the symlink `libpthread.so.0` if it does not exist yet: Run the following command to copy the symlink `libpthread.so.0` if it does not exist yet:
@ -383,15 +382,15 @@ Alternatively, you can correct the symlinks to use relative paths, for example w
ln -s ../../../lib/arm-linux-gnueabihf/libpthread.so.0 libpthread.so ln -s ../../../lib/arm-linux-gnueabihf/libpthread.so.0 libpthread.so
ln -s ../../../lib/arm-linux-gnueabihf/librt.so.1 librt.so ln -s ../../../lib/arm-linux-gnueabihf/librt.so.1 librt.so
``` ```
Please note that there might also be issues with some symlinks or libraries not being copied Please note that there might also be issues with some symlinks or libraries not being copied
properly, especially on Windows. This has occured with files like `libc.so.6`. properly, especially on Windows. This has occured with files like `libc.so.6`.
If there are linker issues at a later stage, you can try to copy the symlinks manually from the If there are linker issues at a later stage, you can try to copy the symlinks manually from the
Linux board to the sysroot with `scp`. Linux board to the sysroot with `scp`.
For example, you can copy `libc.so.6` from the Linux board to the sysroot with For example, you can copy `libc.so.6` from the Linux board to the sysroot with
the following command the following command
If there are issues with the cross-compilation process, manually copying the following If there are issues with the cross-compilation process, manually copying the following
symlinks can help: symlinks can help:

View File

@ -125,18 +125,35 @@ toolchain binaries are added to the path accordingly.
```sh ```sh
rsync -avHAXR --numeric-ids --info=progress2 <username>@<ip-address>:/{lib,usr} <rootfs-path> rsync -avHAXR --numeric-ids --info=progress2 <username>@<ip-address>:/{lib,usr} <rootfs-path>
``` ```
Please note that `rsync` sometimes does not copy shared libraries or symlinks properly, On Linux, it is recommended to repair some symlinks which can be problematic:
which might result in errors when cross-compiling and cross-linking. It is recommended to run Navigate to the folder containing the symlinks first:
the following commands in addition to the `rsync` command:
```sh ```sh
scp <user_name>@<ip-address>:/lib/arm-linux-gnueabihf/{libc.so.6,ld-linux-armhf.so.3,libm.so.6} <rootfs_path>/lib/arm-linux-gnueabihf cd <rootfs_path>/usr/lib/arm-linux-gnueabihf
scp <user_name>@<ip-address>:/usr/lib/arm-linux-gnueabihf/{libpthread.so,libc.so,librt.so} <rootfs_path>/usr/lib/arm-linux-gnueabihf
``` ```
See the [troubleshooting](#troubleshooting) section for more details if the compilation process You can now use
is problematic.
```sh
readlink libpthread.so
```
which will show an absolute location of a shared library the symlinks points to. This location
needs to be converted into a relative path.
Run the following command to create a relative symlinks instead of an absolute ones. The pointed
to location might change to check it with `readlink` first before removing the symlinks:
```sh
rm libpthread.so
rm librt.so
ln -s ../../../lib/arm-linux-gnueabihf/libpthread.so.0 libpthread.so
ln -s ../../../lib/arm-linux-gnueabihf/librt.so.1 librt.so
```
For more information on issues which can occur when cloning the root filesystem,
see the [troubleshooting](#troubleshooting) section.
3. It is recommended to install `gdb-multiarch`. This tool will allow remote debugging 3. It is recommended to install `gdb-multiarch`. This tool will allow remote debugging
on the host computer. This step is not required if the `tcf-agent` is used. on the host computer. This step is not required if the `tcf-agent` is used.
@ -202,15 +219,23 @@ toolchain binaries are added to the path accordingly.
```sh ```sh
rsync -vR --progress -rl --delete-after --safe-links pi@<ip-address>:/{lib,usr,opt/vc/lib} <rootfs-path> rsync -vR --progress -rl --delete-after --safe-links pi@<ip-address>:/{lib,usr,opt/vc/lib} <rootfs-path>
``` ```
Please note that `rsync` sometimes does not copy shared libraries or symlinks properly, Please note that `rsync` sometimes does not copy shared libraries or symlinks properly,
which might result in errors when cross-compiling and cross-linking. See the which might result in errors when cross-compiling and cross-linking. It is recommended to run
[troubleshooting](#troubleshooting) section for more details. the following commands in addition to the `rsync` command on Windows:
```sh
scp <user_name>@<ip-address>:/lib/arm-linux-gnueabihf/{libc.so.6,ld-linux-armhf.so.3,libm.so.6} <rootfs_path>/lib/arm-linux-gnueabihf
scp <user_name>@<ip-address>:/usr/lib/arm-linux-gnueabihf/{libpthread.so,libc.so,librt.so} <rootfs_path>/usr/lib/arm-linux-gnueabihf
```
For more information on issues which can occur when cloning the root filesystem,
see the [troubleshooting](#troubleshooting) section.
5. It is recommended to install `gdb-multiarch`. This tool will allow remote debugging on the host 5. It is recommended to install `gdb-multiarch`. This tool will allow remote debugging on the host
computer. Replace `x86_64` with the correct processor architecture for other architectures. computer. Replace `x86_64` with the correct processor architecture for other architectures.
This is not required if the `tcf-agent` is used. This is not required if the `tcf-agent` is used.
```sh ```sh
pacman -S mingw-w64-x86_64-gdb-multiarch pacman -S mingw-w64-x86_64-gdb-multiarch
``` ```
@ -356,25 +381,36 @@ There might be some issues with the pthread symbolic links.
Navigate to the folder containing the symlinks Navigate to the folder containing the symlinks
```sh ```sh
cd /c/User/<UserName>/beaglebone/rootfs/usr/lib/arm-linux-gnueabihf cd <rootfs_path>/usr/lib/arm-linux-gnueabihf
``` ```
Type `more libpthread`, press `TAB` and check whether the symbolic Type `more libpthread`, press `TAB` and check whether the symbolic
link `libpthread.so` is shown. If it is not, we are going to set it up link `libpthread.so` is shown. If it is not, we are going to set it up
manually to avoid issues when linking against `pthread` later. manually to avoid issues when linking against `pthread` later.
Now you can find out where `libpthread.so` points with `readlink libpthread.so`.
This information is used to convert the absolute symlink to relative ones, for example with:
Run the following command to create a symlink to `libpthread.so.0` Run the following command to copy the symlink `libpthread.so.0` if it does not exist yet:
```sh ```sh
scp <user_name>@<ip-address>:/usr/lib/arm-linux-gnueabihf/libpthread.so . scp <user_name>@<ip-address>:/usr/lib/arm-linux-gnueabihf/libpthread.so .
``` ```
Alternatively, you can also create the symlink pointing to the correct library with Alternatively, you can correct the symlinks to use relative paths, for example with:
```sh ```sh
ln -s ../../../lib/arm-linux-gnueabihf/libpthread.so.0 libpthread.so ln -s ../../../lib/arm-linux-gnueabihf/libpthread.so.0 libpthread.so
ln -s ../../../lib/arm-linux-gnueabihf/librt.so.1 librt.so
``` ```
Please note that there might also be issues with some symlinks or libraries not being copied
properly, especially on Windows. This has occured with files like `libc.so.6`.
If there are linker issues at a later stage, you can try to copy the symlinks manually from the
Linux board to the sysroot with `scp`.
For example, you can copy `libc.so.6` from the Linux board to the sysroot with
the following command
If there are issues with the cross-compilation process, manually copying the following If there are issues with the cross-compilation process, manually copying the following
symlinks can help: symlinks can help: