Introduction to the IAR Embedded Workbench IDE
Briefly about the IDE and the build toolchain
The IDE is the environment where all tools needed to build your application—the build toolchain—are integrated: a C/C++ compiler, C/C++ libraries, an assembler, a linker, library tools, an editor, a project manager with Make utility, and the IAR C-SPY® Debugger. The tools used specifically for building your source code are referred to as the build tools.
The toolchain that comes with your product package supports a specific microcontroller. However, the IDE can simultaneously contain multiple toolchains for various microcontrollers. This means that if you have IAR Embedded Workbench installed for several microcontrollers, you can choose which microcontroller to develop for.
Tools for analyzing and checking your application
IAR Embedded Workbench comes with various types of support for analyzing and finding errors in your application, such as:
Compiler and linker errors, warnings, and remarks
All diagnostic messages are issued as complete, self-explanatory messages. Errors reveal syntax or semantic errors, warnings indicate potential problems, and remarks (default off) indicate deviations from the standard. Double-click a message and the corresponding source code construction is highlighted in the editor window. For more information, see the IAR C/C++ Development documentation.
Stack usage analysis during linking
Under the right circumstances, the linker can accurately calculate the maximum stack usage for each call tree, such as
cstartup, interrupt functions, RTOS tasks, etc. For more information, see Stack usage analysis..C-STAT for static analysis
C-STAT is a static analysis tool that tries to find deviations from specific sets of rules, where each rule specifies an unsafe source construct. The rules come from various institutes, like MISRA (MISRA C:2004, MISRA C++:2008, MISRA C:2012, and MISRA C:2023), CWE, and CERT. For information about how to use C-STAT and the rules, see the C-STAT® Static Analysis Guide.
C-SPY debugging features such as, Profiling, Code Coverage, Trace, and Power debugging. For more information, see the C-SPY Debugging documentation.
C-RUN for runtime error checking
Runtime error checking is a way of detecting erroneous code constructions when your application is running. This is done by instrumenting the code in the application, or by replacing C/C++ library functionality with a dedicated library that contains support for runtime error checking. C-RUN supports three types of runtime error checking—arithmetic checking, bounds checking, and heap checking using a checked heap. For more information, see C-RUN runtime error checking.
An extensible and modular environment
Although the IDE provides all the features required for your project, you can also integrate other tools. For example, you can:
Use the Custom Build mechanism to add other tools to the toolchain, see Extending the toolchain.
Add IAR Visual State to the toolchain, which means that you can add state machine diagrams directly to your project in the IDE.
Use the Subversion version control system to keep track of different versions of your source code. The IDE can attach to files in a Subversion working copy.
Add an external analyzer, for example a lint tool, of your choice to be used on whole projects, groups of files, or an individual file of your project. Typically, you might want to perform a static code analysis on your source code, using the same settings and set of source code files as when you compile. See Getting started using external analyzers.
Add external tools to the Tools menu, for convenient access from within the IDE. For this reason, the menu might look different depending on which tools you have preconfigured to appear as menu commands.
Configure custom argument variables, which typically can be useful if you install a third-party product and want to specify its include directory. Custom argument variables can also be used for simplifying references to files that you want to be part of your project.