1.. _toolchain_iar_arm:
2
3IAR Arm Toolchain
4#################
5
6#. Download and install a release v9.70 or newer of `IAR Arm Toolchain`_ on your host (IAR Embedded Workbench or IAR Build Tools, perpetual or subscription licensing)
7
8#. Make sure you have :ref:`Zephyr SDK <toolchain_zephyr_sdk>` installed on your host.
9
10#. :ref:`Set these environment variables <env_vars>`:
11
12    - Set :envvar:`ZEPHYR_TOOLCHAIN_VARIANT` to ``iar``.
13    - Set :envvar:`IAR_TOOLCHAIN_PATH` to the toolchain installation directory.
14
15#. The cloud licensed variant of the IAR Toolchain needs the :envvar:`IAR_LMS_BEARER_TOKEN` environment
16   variable to be set to a valid ``license bearer token`` (subscription licensing).
17
18For example:
19
20.. code-block:: bash
21
22    # Linux (default installation path):
23    export IAR_TOOLCHAIN_PATH=/opt/iar/cxarm-<version>/arm
24    export ZEPHYR_TOOLCHAIN_VARIANT=iar
25    export IAR_LMS_BEARER_TOKEN="<BEARER-TOKEN>"
26
27.. code-block:: batch
28
29    # Windows:
30    set IAR_TOOLCHAIN_PATH=c:\<path>\cxarm-<version>\arm
31    set ZEPHYR_TOOLCHAIN_VARIANT=iar
32    set IAR_LMS_BEARER_TOKEN="<BEARER-TOKEN>"
33
34.. note::
35
36    Known limitations:
37
38    - The IAR Toolchain uses ``ilink`` for linking and depends on Zephyr’s CMAKE_LINKER_GENERATOR. ``ilink`` is incompatible with Zephyr’s linker script template, which works with GNU ld.
39
40    - The GNU Assembler distributed with the Zephyr SDK is used for ``.S-files``.
41
42    - C library support for ``Minimal libc`` only. C++ is not supported.
43
44    - Some Zephyr subsystems or modules may contain C or assembly code that relies on GNU intrinsics and have not yet been updated to work fully with ``iar``.
45
46    - TrustedFirmware is not supported
47
48.. _IAR Arm Toolchain: https://www.iar.com/products/architectures/arm/
49