3rd Party Toolchains¶
A “3rd party toolchain” is an officially supported toolchain provided by an external organization. Several of these are available.
GNU ARM Embedded¶
Warning
Do not install the toolchain into a path with spaces.
Download and install a GNU ARM Embedded build for your operating system and extract it on your file system.
Note
On Windows, we’ll assume you install into the directory
C:\gnu_arm_embedded.Warning
On macOS Catalina or later you might need to change a security policy for the toolchain to be able to run from the terminal.
Set these environment variables:
Set
ZEPHYR_TOOLCHAIN_VARIANTtognuarmemb.Set
GNUARMEMB_TOOLCHAIN_PATHto the toolchain installation directory.
To check that you have set these variables correctly in your current environment, follow these example shell sessions (the
GNUARMEMB_TOOLCHAIN_PATHvalues may be different on your system):# Linux, macOS: $ echo $ZEPHYR_TOOLCHAIN_VARIANT gnuarmemb $ echo $GNUARMEMB_TOOLCHAIN_PATH /home/you/Downloads/gnu_arm_embedded # Windows: > echo %ZEPHYR_TOOLCHAIN_VARIANT% gnuarmemb > echo %GNUARMEMB_TOOLCHAIN_PATH% C:\gnu_arm_embedded
Warning
On macOS, if you are having trouble with the suggested procedure, there is an unofficial package on brew that might help you. Run
brew install gcc-arm-embeddedand configure the variablesSet
ZEPHYR_TOOLCHAIN_VARIANTtognuarmemb.Set
GNUARMEMB_TOOLCHAIN_PATHto the brew installation directory (something like/usr/local)
Intel oneAPI Toolkit¶
Download Intel oneAPI Base Toolkit
Assuming the toolkit is installed in
/opt/intel/oneApi, set environment using:# Linux, macOS: export ONEAPI_TOOLCHAIN_PATH=/opt/intel/oneapi source $ONEAPI_TOOLCHAIN_PATH/compiler/latest/env/vars.sh # Windows: > set ONEAPI_TOOLCHAIN_PATH=C:\Users\Intel\oneapi
To setup the complete oneApi environment, use:
source /opt/intel/oneapi/setvars.sh
The above will also change the python environment to the one used by the toolchain and might conflict with what Zephyr uses.
Set
ZEPHYR_TOOLCHAIN_VARIANTtooneApi.
DesignWare ARC MetaWare Development Toolkit (MWDT)¶
You need to have ARC MWDT installed on your host.
Set these environment variables:
Set
ZEPHYR_TOOLCHAIN_VARIANTtoarcmwdt.Set
ARCMWDT_TOOLCHAIN_PATHto the toolchain installation directory. MWDT installation providesMETAWARE_ROOTso simply setARCMWDT_TOOLCHAIN_PATHto$METAWARE_ROOT/../(Linux) or%METAWARE_ROOT%\..\(Windows)
To check that you have set these variables correctly in your current environment, follow these example shell sessions (the
ARCMWDT_TOOLCHAIN_PATHvalues may be different on your system):# Linux: $ echo $ZEPHYR_TOOLCHAIN_VARIANT arcmwdt $ echo $ARCMWDT_TOOLCHAIN_PATH /home/you/ARC/MWDT_2019.12/ # Windows: > echo %ZEPHYR_TOOLCHAIN_VARIANT% arcmwdt > echo %ARCMWDT_TOOLCHAIN_PATH% C:\ARC\MWDT_2019.12\
Crosstool-NG¶
You can build toolchains from source code using crosstool-NG.
Follow the steps on the crosstool-NG website to prepare your host.
Follow the Zephyr SDK with Crosstool NG instructions to build your toolchain. Repeat as necessary to build toolchains for multiple target architectures.
You will need to clone the
sdk-ngrepo and run the following command:./go.sh <arch>Note
Currently, only i586 and Arm toolchain builds are verified.
Set these environment variables:
Set
ZEPHYR_TOOLCHAIN_VARIANTtoxtools.Set
XTOOLS_TOOLCHAIN_PATHto the toolchain build directory.
To check that you have set these variables correctly in your current environment, follow these example shell sessions (the
XTOOLS_TOOLCHAIN_PATHvalues may be different on your system):# Linux, macOS: $ echo $ZEPHYR_TOOLCHAIN_VARIANT xtools $ echo $XTOOLS_TOOLCHAIN_PATH /Volumes/CrossToolNGNew/build/output/