CLion 2020.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.

    CLion's support for the IAR compiler has been tested on the ARM architecture. Keep in mind that issues or limited functionality are possible if you are targeting another platform.

  2. In CLion, navigate to Settings | Build, Execution, Deployment | Toolchains and create a new MinGW toolchain or select an existing one.

  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: 26 May 2020