From 340c6990e307e12802ef1730b3f42255d8a190d5 Mon Sep 17 00:00:00 2001 From: Kirill Kotyagin Date: Sat, 7 Oct 2023 13:35:57 +0300 Subject: [PATCH 1/3] stm32: common: Fix STM32_TARGET_TRIPLET --- cmake/stm32/common.cmake | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cmake/stm32/common.cmake b/cmake/stm32/common.cmake index 8c60fc16..4fbd1e0c 100644 --- a/cmake/stm32/common.cmake +++ b/cmake/stm32/common.cmake @@ -34,8 +34,14 @@ if(NOT STM32_TOOLCHAIN_PATH) endif() if(NOT STM32_TARGET_TRIPLET) - set(STM32_TARGET_TRIPLET "arm-none-eabi") - message(STATUS "No STM32_TARGET_TRIPLET specified, using default: " ${STM32_TARGET_TRIPLET}) + if(DEFINED ENV{STM32_TARGET_TRIPLET}) + message(STATUS "Detected toolchain path STM32_TARGET_TRIPLET in environmental variables: ") + message(STATUS "$ENV{STM32_TARGET_TRIPLET}") + set(STM32_TARGET_TRIPLET $ENV{STM32_TARGET_TRIPLET}) + else() + set(STM32_TARGET_TRIPLET "arm-none-eabi") + message(STATUS "No STM32_TARGET_TRIPLET specified, using default: " ${STM32_TARGET_TRIPLET}) + endif() endif() set(CMAKE_SYSTEM_NAME Generic) From 684e5a046d7f1f868219a624f2f62adfa57fd0d2 Mon Sep 17 00:00:00 2001 From: Kirill Kotyagin Date: Sat, 7 Oct 2023 13:36:58 +0300 Subject: [PATCH 2/3] Fix README.md (TARGET_TRIPLET) --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 58b16d5a..bf4342d6 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ These configuration variables are optional: * `STM32_TOOLCHAIN_PATH` - where toolchain is located, **default**: `/usr`. Alternatively you can add the folder containing the toolchain binaries to the system path. If both are given, the `STM32_TOOLCHAIN_PATH` setting takes precedence -* `TARGET_TRIPLET` - toolchain target triplet, **default**: `arm-none-eabi` +* `STM32_TARGET_TRIPLET` - toolchain target triplet, **default**: `arm-none-eabi` * `FREERTOS_PATH` - Path to the FreeRTOS kernel when compiling with a RTOS. Does not need to be specified when using CMSIS @@ -74,7 +74,7 @@ If you have access to a Unix shell, which is the default terminal on Linux, or t ```sh export STM32_TOOLCHAIN_PATH="" -export TARGET_TRIPLET=arm-none-eabi +export STM32_TARGET_TRIPLET=arm-none-eabi export STM32_CUBE__PATH="" ``` @@ -86,7 +86,7 @@ On Windows, you can use a Powershell script `path_helper.ps1`to set up the envir ```sh $env:STM32_TOOLCHAIN_PATH = "" -$env:TARGET_TRIPLET = arm-none-eabi +$env:STM32_TARGET_TRIPLET = arm-none-eabi $env:STM32_CUBE__PATH="" ``` From ff41f63aca4fd78f702c2fc48d28881e069e249a Mon Sep 17 00:00:00 2001 From: Kirill Kotyagin Date: Sat, 7 Oct 2023 13:39:10 +0300 Subject: [PATCH 3/3] stm32: common: Fix target triplet status message --- cmake/stm32/common.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/stm32/common.cmake b/cmake/stm32/common.cmake index 4fbd1e0c..ef94372b 100644 --- a/cmake/stm32/common.cmake +++ b/cmake/stm32/common.cmake @@ -35,7 +35,7 @@ endif() if(NOT STM32_TARGET_TRIPLET) if(DEFINED ENV{STM32_TARGET_TRIPLET}) - message(STATUS "Detected toolchain path STM32_TARGET_TRIPLET in environmental variables: ") + message(STATUS "Detected target triplet STM32_TARGET_TRIPLET in environmental variables: ") message(STATUS "$ENV{STM32_TARGET_TRIPLET}") set(STM32_TARGET_TRIPLET $ENV{STM32_TARGET_TRIPLET}) else()