CLion 2022.1 Help

IAR toolchain

When setting up a toolchain for your embedded project, you can use the IAR compiler. CLion will detect it as a C/C++ compiler and collect the compiler information. Also, you can open the projects that use the IAR toolchain, and they should load successfully.

Only CMake-based projects are supported at the moment. As a starting point, you can create an STM32CubeMX project and edit the auto-generated CMakeLists.txt. Use our sample project as an example.

Set up the IAR compiler

  1. Download and install the IAR workbench. Open IAR License Manager and make sure that your IAR license is activated. Note that CLion does not provide IAR licenses.

  2. In CLion, navigate to Settings | Build, Execution, Deployment | Toolchains

    On Windows, create a new MinGW toolchain or select an existing one. Note that MinGW environment is required for you to be able to use the IAR compiler on Windows.

    On Linux, use a default local toolchain.

  3. In the C Compiler and C++ Compiler fields, set the path to the IAR compiler:

    Toolchain with the IAR compiler
  4. Select the debugger: you can use the bundled GDB or a custom GDB version, for example, the debugger from GNU ARM Embedded Toolchain.

    GDB debugger for the IAR toolchain
  5. Do one of the following:

    • Set the newly created toolchain as Default by moving it to the top of the list. This way, you will not need to select it manually in the CMake profile.

      IAR toolchain as default
    • Go to Settings | Build, Execution, Deployment | CMake and select the newly created toolchain in the Toolchain field of the current profile:

      IAR toolchain selected for a CMake profile

Last modified: 25 July 2022