1.. _toolchain_gnuarmemb:
2
3GNU Arm Embedded
4################
5
6#. Download and install a `GNU Arm Embedded`_ build for your operating system
7   and extract it on your file system.
8
9   .. note::
10
11      On Windows, we'll assume for this guide that you install into the directory
12      :file:`C:\\gnu_arm_embedded`. You can also choose the default installation
13      path used by the ARM GCC installer, in which case you will need to adjust the path
14      accordingly in the guide below.
15
16   .. warning::
17
18      On macOS Catalina or later you might need to :ref:`change a security
19      policy <mac-gatekeeper>` for the toolchain to be able to run from the
20      terminal.
21
22#. :ref:`Set these environment variables <env_vars>`:
23
24   - Set :envvar:`ZEPHYR_TOOLCHAIN_VARIANT` to ``gnuarmemb``.
25   - Set :envvar:`GNUARMEMB_TOOLCHAIN_PATH` to the toolchain installation
26     directory.
27
28#. To check that you have set these variables correctly in your current
29   environment, follow these example shell sessions (the
30   :envvar:`GNUARMEMB_TOOLCHAIN_PATH` values may be different on your system):
31
32   .. code-block:: console
33
34      # Linux, macOS:
35      $ echo $ZEPHYR_TOOLCHAIN_VARIANT
36      gnuarmemb
37      $ echo $GNUARMEMB_TOOLCHAIN_PATH
38      /home/you/Downloads/gnu_arm_embedded
39
40      # Windows:
41      > echo %ZEPHYR_TOOLCHAIN_VARIANT%
42      gnuarmemb
43      > echo %GNUARMEMB_TOOLCHAIN_PATH%
44      C:\gnu_arm_embedded
45
46   .. warning::
47
48      On macOS, if you are having trouble with the suggested procedure, there is an unofficial package on brew that might help you.
49      Run ``brew install gcc-arm-embedded`` and configure the variables
50
51      - Set :envvar:`ZEPHYR_TOOLCHAIN_VARIANT` to ``gnuarmemb``.
52      - Set :envvar:`GNUARMEMB_TOOLCHAIN_PATH` to the brew installation directory (something like ``/usr/local``)
53
54.. _GNU Arm Embedded: https://developer.arm.com/open-source/gnu-toolchain/gnu-rm
55