Cross-compilaiton process tweak and SCEX bugfix #625

Merged
meggert merged 3 commits from cross_compile_tweak_scex_em_fix into main 2023-05-10 11:36:46 +02:00
6 changed files with 24 additions and 9 deletions

View File

@ -47,6 +47,11 @@ will consitute of a breaking change warranting a new major release:
recovery handling becomes stuck in the custom recovery sequence when swichting power back on. recovery handling becomes stuck in the custom recovery sequence when swichting power back on.
- The dual lane custom recovery handling was adapted to always perform proper power switch handling - The dual lane custom recovery handling was adapted to always perform proper power switch handling
irrespective of current or target modes. irrespective of current or target modes.
- The cross compiler binary path now needs to be set explicitely as an environmental variable
named `CROSS_COMPILE_BIN_PATH` when setting up the build system. This prevents CMake from
selecting wrong cross-compilers. CMake will not seach in the system path for cross-compilers
anymore.
- Compile fix if SCEX is compiled for the EM.
# [v2.0.4] 2023-04-19 # [v2.0.4] 2023-04-19

View File

@ -99,11 +99,21 @@ When using Windows, run theses steps in MSYS2.
git submodule update --init git submodule update --init
``` ```
3. Ensure that the cross-compiler is working with `arm-linux-gnueabihf-gcc --version` and that 3. Create two system variables to pass the system root path and the cross-compiler path to the
build system. You only need to do this once when setting up the build system.
Example for Unix:
```sh
export CROSS_COMPILE_BIN_PATH=<absolutePathToCrossCompilerBinPath>
export ZYNQ_7020_SYSROOT=<absolutePathToSysroot>
```
4. Ensure that the cross-compiler is working with
`${CROSS_COMPILE_BIN_PATH}/arm-linux-gnueabihf-gcc --version` and that
the sysroot environmental variables have been set like specified in the the sysroot environmental variables have been set like specified in the
[root filesystem chapter](#sysroot). [root filesystem chapter](#sysroot).
4. Run the CMake configuration to create the build system in a `build-Debug-Q7S` folder. 5. Run the CMake configuration to create the build system in a `build-Debug-Q7S` folder.
Add `-G "MinGW Makefiles` in MinGW64 on Windows. Add `-G "MinGW Makefiles` in MinGW64 on Windows.
```sh ```sh
@ -112,7 +122,7 @@ When using Windows, run theses steps in MSYS2.
cmake --build . -j cmake --build . -j
``` ```
You can also use provided shell scripts to perform these commands. Please note that you can also use provided shell scripts to perform these commands.
```sh ```sh
cp scripts/q7s-env.sh .. cp scripts/q7s-env.sh ..
cp scripts/q7s-env-em.sh .. cp scripts/q7s-env-em.sh ..
@ -144,7 +154,7 @@ When using Windows, run theses steps in MSYS2.
There are also different values for `-DTGT_BSP` to build for the Raspberry Pi There are also different values for `-DTGT_BSP` to build for the Raspberry Pi
or the Beagle Bone Black: `arm/raspberrypi` and `arm/beagleboneblack`. or the Beagle Bone Black: `arm/raspberrypi` and `arm/beagleboneblack`.
5. Build the software with 6. Build the software with
```sh ```sh
cd cmake-build-debug-q7s cd cmake-build-debug-q7s

View File

@ -140,7 +140,7 @@ void ObjectFactory::produce(void* args) {
#endif /* OBSW_ADD_TEST_CODE == 1 */ #endif /* OBSW_ADD_TEST_CODE == 1 */
#if OBSW_ADD_SCEX_DEVICE == 1 #if OBSW_ADD_SCEX_DEVICE == 1
createScexComponents(q7s::UART_SCEX_DEV, pwrSwitcher, *SdCardManager::instance(), false, createScexComponents(q7s::UART_SCEX_DEV, pwrSwitcher, *SdCardManager::instance(), false,
pcdu::Switches::PDU1_CH5_SOLAR_CELL_EXP_5V); power::Switches::PDU1_CH5_SOLAR_CELL_EXP_5V);
#endif #endif
createAcsController(true, enableHkSets); createAcsController(true, enableHkSets);
HeaterHandler* heaterHandler; HeaterHandler* heaterHandler;

View File

@ -40,8 +40,8 @@ set(CROSS_COMPILE_OBJCOPY "${CROSS_COMPILE}-objcopy")
set(CROSS_COMPILE_SIZE "${CROSS_COMPILE}-size") set(CROSS_COMPILE_SIZE "${CROSS_COMPILE}-size")
# At the very least, cross compile gcc and g++ have to be set! # At the very least, cross compile gcc and g++ have to be set!
find_program (CMAKE_C_COMPILER ${CROSS_COMPILE_CC} REQUIRED) find_program (CMAKE_C_COMPILER ${CROSS_COMPILE_CC} HINTS $ENV{CROSS_COMPILE_BIN_PATH} NO_DEFAULT_PATH REQUIRED)
find_program (CMAKE_CXX_COMPILER ${CROSS_COMPILE_CXX} REQUIRED) find_program (CMAKE_CXX_COMPILER ${CROSS_COMPILE_CXX} HINTS $ENV{CROSS_COMPILE_BIN_PATH} NO_DEFAULT_PATH REQUIRED)
# Useful utilities, not strictly necessary # Useful utilities, not strictly necessary
find_program(CMAKE_SIZE ${CROSS_COMPILE_SIZE}) find_program(CMAKE_SIZE ${CROSS_COMPILE_SIZE})
find_program(CMAKE_OBJCOPY ${CROSS_COMPILE_OBJCOPY}) find_program(CMAKE_OBJCOPY ${CROSS_COMPILE_OBJCOPY})

View File

@ -4,7 +4,7 @@
# custom cross-compiler and sysroot path setups # custom cross-compiler and sysroot path setups
# Adapt the following two entries to your need # Adapt the following two entries to your need
CROSS_COMPILE_BIN_PATH="/opt/q7s-gcc/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin" export CROSS_COMPILE_BIN_PATH="/opt/q7s-gcc/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 ZYNQ_7020_SYSROOT="/opt/xiphos/sdk/ark/sysroots/cortexa9hf-neon-xiphos-linux-gnueabi"
export PATH=$PATH:${CROSS_COMPILE_BIN_PATH} export PATH=$PATH:${CROSS_COMPILE_BIN_PATH}

View File

@ -4,7 +4,7 @@
# custom cross-compiler and sysroot path setups # custom cross-compiler and sysroot path setups
# Adapt the following two entries to your need # Adapt the following two entries to your need
CROSS_COMPILE_BIN_PATH="/opt/q7s-gcc/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin" export CROSS_COMPILE_BIN_PATH="/opt/q7s-gcc/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 ZYNQ_7020_SYSROOT="/opt/xiphos/sdk/ark/sysroots/cortexa9hf-neon-xiphos-linux-gnueabi"
export PATH=$PATH:${CROSS_COMPILE_BIN_PATH} export PATH=$PATH:${CROSS_COMPILE_BIN_PATH}