This commit is contained in:
Robin Müller 2021-07-14 16:35:19 +02:00
parent fda1462b70
commit 421b36b64b
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
5 changed files with 19 additions and 28 deletions

View File

@ -1,19 +1,19 @@
# BBB_ROOTFS should point to the local directory which contains all the
# LINUX_ROOTFS should point to the local directory which contains all the
# libraries and includes from the target raspi.
# The following command can be used to do this, replace <ip-address> and the
# local <rootfs-path> accordingly:
# rsync -vR --progress -rl --delete-after --safe-links pi@<ip-address>:/{lib,usr,opt/vc/lib} <rootfs-path>
# RASPBIAN_ROOTFS needs to be passed to the CMake command or defined in the
# LINUX_ROOTFS needs to be passed to the CMake command or defined in the
# application CMakeLists.txt before loading the toolchain file.
# CROSS_COMPILE also needs to be set accordingly or passed to the CMake command
if(NOT DEFINED ENV{BBB_ROOTFS})
if(NOT DEFINED ENV{LINUX_ROOTFS})
message(FATAL_ERROR
"Define the BBB_ROOTFS variable to point to the Beagle Bone Black rootfs."
"Define the LINUX_ROOTFS variable to point to the Beagle Bone Black rootfs."
)
else()
set(SYSROOT_PATH "$ENV{BBB_ROOTFS}" CACHE PATH "BBB root filesystem path")
set(SYSROOT_PATH "$ENV{LINUX_ROOTFS}" CACHE PATH "Local Linux root filesystem path")
message(STATUS "Beagle Bone Black sysroot: ${SYSROOT_PATH}")
endif()

View File

@ -6,31 +6,22 @@ if(DEFINED TGT_BSP)
message(STATUS "FSFW OSAL invalid for specified target BSP ${TGT_BSP}!")
message(STATUS "Setting valid OS_FSFW: linux")
set(OS_FSFW "linux")
if(${TGT_BSP} MATCHES "arm/stm32h743zi-nucleo")
if(NOT ${OS_FSFW} MATCHES freertos)
message(STATUS
"FSFW OSAL invalid for specified target BSP ${TGT_BSP}!"
)
message(STATUS "Setting valid OS_FSFW: freertos")
set(OS_FSFW "freertos")
endif()
endif()
endif()
endif()
if(${OS_FSFW} STREQUAL linux AND TGT_BSP)
if(${TGT_BSP} MATCHES "host/none")
elseif(${TGT_BSP} MATCHES "arm/raspberrypi")
if(NOT DEFINED ENV{RASPBIAN_ROOTFS})
if(NOT DEFINED ENV{LINUX_ROOTFS})
if(NOT RASPBIAN_ROOTFS)
set(ENV{RASPBIAN_ROOTFS} "$ENV{HOME}/raspberrypi/rootfs")
message(FATAL_ERROR "LINUX_ROOTFS must be set to Raspberry Pi rootfs location")
else()
set(ENV{RASPBIAN_ROOTFS} "${RASPBIAN_ROOTFS}")
set(ENV{LINUX_ROOTFS} "${LINUX_ROOTFS}")
endif()
else()
message(STATUS
"RASPBIAN_ROOTFS from environmental variables used: "
"$ENV{RASPBIAN_ROOTFS}"
"LINUX_ROOTFS from environmental variables used: "
"$ENV{LINUX_ROOTFS}"
)
endif()

View File

@ -9,22 +9,22 @@ else()
endif()
# RASPBIAN_ROOTFS should point to the local directory which contains all the
# LINUX_ROOTFS should point to the local directory which contains all the
# libraries and includes from the target raspi.
# The following command can be used to do this, replace <ip-address> and the
# local <rootfs-path> accordingly:
# rsync -vR --progress -rl --delete-after --safe-links pi@<ip-address>:/{lib,usr,opt/vc/lib} <rootfs-path>
# RASPBIAN_ROOTFS needs to be passed to the CMake command or defined in the
# LINUX_ROOTFS needs to be passed to the CMake command or defined in the
# application CMakeLists.txt before loading the toolchain file.
# CROSS_COMPILE also needs to be set accordingly or passed to the CMake command
if(NOT DEFINED ENV{RASPBIAN_ROOTFS})
if(NOT DEFINED ENV{LINUX_ROOTFS})
message(FATAL_ERROR
"Define the RASPBIAN_ROOTFS variable to point to the Raspberry Pi rootfs."
"Define the LINUX_ROOTFS variable to point to the Raspberry Pi rootfs."
)
else()
set(SYSROOT_PATH "$ENV{RASPBIAN_ROOTFS}" CACHE PATH "Raspbian root filesystem path")
set(SYSROOT_PATH "$ENV{LINUX_ROOTFS}" CACHE PATH "Local linux root filesystem path")
message(STATUS "Raspberry Pi sysroot: ${SYSROOT_PATH}")
endif()

View File

@ -232,7 +232,7 @@ These prerequisites are valid for Linux as well as Windows hosts.
It is recommended to set the following environmental variables for the CMake build:
- `CROSS_COMPILE`: Explicitely specify the name of the cross compiler
- `BBB_ROOTFS`: Explicitely set the path to the local BBB rootfs
- `LINUX_ROOTFS`: Explicitely set the path to the local BBB rootfs
For example with the following commands
@ -244,7 +244,7 @@ It is recommended to test whether the environmental variables were set correctly
for example by running
```sh
echo $BBB_ROOTFS
echo $LINUX_ROOTFS
```
These variables can either be set every time before a debugging session to

View File

@ -258,14 +258,14 @@ cross-compile a toolchain yourself by following the steps in the
It is recommended to set the following environmental variables for the CMake build:
- `CROSS_COMPILE`: Explicitely specify the name of the cross compiler
- `RASPBERRY_VERSION`: Explicitely specify the version of the Raspberry Pi
- `RASPBIAN_ROOTFS`: Explicitely set the path to the local RPi rootfs
- `LINUX_ROOTFS`: Explicitely set the path to the local RPi rootfs
For example with the following commands
```sh
export CROSS_COMPILE="arm-linux-gnueabihf"
export RASPBERRY_VERSION="4"
export RASPBIAN_ROOTFS="<pathToRootFS>"
export LINUX_ROOTFS="<pathToRootFS>"
```
It is recommended to test whether the environmental variables were set correctly,