From 968093c2f55eef921291712e9ce805f9d8e5e162 Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 10 May 2023 11:24:12 +0200 Subject: [PATCH 1/3] stuff --- bsp_q7s/em/emObjectFactory.cpp | 2 +- cmake/Zynq7020CrossCompileConfig.cmake | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bsp_q7s/em/emObjectFactory.cpp b/bsp_q7s/em/emObjectFactory.cpp index 67dec96d..81771a79 100644 --- a/bsp_q7s/em/emObjectFactory.cpp +++ b/bsp_q7s/em/emObjectFactory.cpp @@ -140,7 +140,7 @@ void ObjectFactory::produce(void* args) { #endif /* OBSW_ADD_TEST_CODE == 1 */ #if OBSW_ADD_SCEX_DEVICE == 1 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 createAcsController(true, enableHkSets); HeaterHandler* heaterHandler; diff --git a/cmake/Zynq7020CrossCompileConfig.cmake b/cmake/Zynq7020CrossCompileConfig.cmake index be6702a1..e6e762ad 100644 --- a/cmake/Zynq7020CrossCompileConfig.cmake +++ b/cmake/Zynq7020CrossCompileConfig.cmake @@ -40,8 +40,8 @@ set(CROSS_COMPILE_OBJCOPY "${CROSS_COMPILE}-objcopy") set(CROSS_COMPILE_SIZE "${CROSS_COMPILE}-size") # 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_CXX_COMPILER ${CROSS_COMPILE_CXX} 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} HINTS $ENV{CROSS_COMPILE_BIN_PATH} NO_DEFAULT_PATH REQUIRED) # Useful utilities, not strictly necessary find_program(CMAKE_SIZE ${CROSS_COMPILE_SIZE}) find_program(CMAKE_OBJCOPY ${CROSS_COMPILE_OBJCOPY}) -- 2.43.0 From 44081df34adfede1f5013ef2b5978e31f6606981 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 10 May 2023 11:33:34 +0200 Subject: [PATCH 2/3] changelog readme etc. --- CHANGELOG.md | 4 ++++ README.md | 18 ++++++++++++++---- q7s-env-em.sh | 2 +- q7s-env.sh | 2 +- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index db78de99..d06bc4d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,10 @@ 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. - The dual lane custom recovery handling was adapted to always perform proper power switch handling 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. # [v2.0.4] 2023-04-19 diff --git a/README.md b/README.md index cd350386..6b06283c 100644 --- a/README.md +++ b/README.md @@ -99,11 +99,21 @@ When using Windows, run theses steps in MSYS2. 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= + export ZYNQ_7020_SYSROOT= + ``` + +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 [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. ```sh @@ -112,7 +122,7 @@ When using Windows, run theses steps in MSYS2. 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 cp scripts/q7s-env.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 or the Beagle Bone Black: `arm/raspberrypi` and `arm/beagleboneblack`. -5. Build the software with +6. Build the software with ```sh cd cmake-build-debug-q7s diff --git a/q7s-env-em.sh b/q7s-env-em.sh index 86737627..969d9ec0 100755 --- a/q7s-env-em.sh +++ b/q7s-env-em.sh @@ -4,7 +4,7 @@ # custom cross-compiler and sysroot path setups # 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 PATH=$PATH:${CROSS_COMPILE_BIN_PATH} diff --git a/q7s-env.sh b/q7s-env.sh index 5cf608a0..4dea9154 100755 --- a/q7s-env.sh +++ b/q7s-env.sh @@ -4,7 +4,7 @@ # custom cross-compiler and sysroot path setups # 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 PATH=$PATH:${CROSS_COMPILE_BIN_PATH} -- 2.43.0 From 448d462bee5ebbf0cfadd2e617f94223cb2cb517 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 10 May 2023 11:35:15 +0200 Subject: [PATCH 3/3] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d06bc4d7..5bbebedc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,6 +51,7 @@ will consitute of a breaking change warranting a new major release: 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 -- 2.43.0