Contact IAR Systems
Home Products Support Resources Downloads About us Contact My Pages
Developer's Toolbox Webinars IAR Solution Selector Viewpoints Video Presentations Further reading LEGO MINDSTORMS NXT
 
Resources   >   Developer's Toolbox   >  

Customizing your workspace

by Thomas Sporrong, IAR Systems

 
By using features available in IAR Embedded Workbench in a creative way, you can form a workspace that suits your work. In addition to keeping track of all your projects, build configurations and hundreds of source files, the workspace can also include your library of project-related documents and links to the other tools that you may need.

In this developer’s toolbox article I would like to promote creative ways of using workspaces in IAR Embedded Workbench. I hope this will give you some ideas of how you can adapt the workspace to your needs.

Multiple projects

Even in small scale embedded software projects, you need tool support to keep track of all the files related to the project or particular build configurations of a project. In larger projects, where several engineers are involved in one project, the question of having tool support for handling this complexity is stressed even more.

IAR Embedded Workbench supports you in this task by providing a workspace platform to manage multiple projects in the same workspace. Here we see an example with five projects in a workspace called My_Workspace:
 
Click to enlarge image
 
By opening one single workspace file, you can now manage different projects—perhaps even for different target hardware—or projects for different subparts of the final application. To add source files to a project, simply drag and drop them from the Windows file explorer on to the project nodes.

Switching between different projects in the workspace is very easy – either by right-clicking on one of them in the Overview tab of the workspace and choosing ‘Set as Active’ , or by clicking the appropriate tab in the bottom of the workspace window. By clicking on the appropriate tab you get a single project view and hide the information about the other projects in the workspace.
 
Click to enlarge image
 

Configurations

Instead of creating new projects for every build configuration you need, you can use the configurations feature in IAR Embedded Workbench. It allows you to add different sets of build options such as optimization level and output format on a project and its source files and easily switch between them.

By default when creating a new project, you automatically get two configurations: Release and Debug. In short, the only differences are the options used for optimization, debug information, and output format. You can use these as starting points, or delete them and create your own configurations. There is plenty of room for being creative here.

To activate a specific build configuration of a project, simply choose a build configuration from the drop-down list at the top of the Workspace window.
 
Click to enlarge image
 
To add new configurations, choose Project -> Edit Configurations… in the menu.

By default, each source file in the project is present in all build configurations of the project, but you can also specify a file to be excluded from a particular build configuration by highlighting the file in the workspace window and choosing Project -> Options… in the menu and ticking the box ‘Exclude from build’. An excluded file will appear with its icon in white in the Workspace window.

To even further increase the flexibility with configurations, you can by choosing Project -> Batch build… from the menu choose a batch of configurations to be built at once.

Groups

Each project can contain a hierarchy of groups in which you can collect and organize your source files. By right clicking on a project node and choosing Add -> Add Group… we can create groups (which you can think of as folders in a file explorer) to hold related files together and help us keep track of all source files.

One example is creating a group to hold source files that is common between projects, and you only want one unique copy of these files.
 
Click to enlarge image
 
Again, we can choose to exclude a group from the build just as we can do with a single source file. By excluding a group, we can for instance drag and drop source files between the excluded folder and an included folder to do fast switches of single source files in the build.

Just as it is possible to set options such as optimization level on a single source file that differs from the project setting, we can set options that apply to all source files within a group. This is achieved by highlighting a group, choosing Project -> Options… and ticking the box ‘Override inherited settings’. This can be useful, for example, if you have source files that you do not want to optimize due to that optimizations might cause unwanted side effects.
 
Click to enlarge image
 
There is also a special group created after a successful build of a project, the Output group. Here you find the object files created during the build, and if you have enabled output of map files from the compiler, assembler and/or linker, these will also show up here.

More detailed information about the workspace features mentioned above is of course found in the user guide found under the Help menu in IAR Embedded Workbench.

Powerful additions to the workspace

Next step is to look at even more creative ways of using the Workspace window – we also would like to have all other information and tools related to our project at our finger tip.

If you switch between engineers in the project, or if you need to pick up the project doing maintenance in the future, it would be neat and time saving to have more information than just the source files available in the workspace. For instance having the data sheets, errata documents and application notes for the particular microcontroller easily accessible from within the workspace would be a good start.

By using the workspace more creatively in IAR Embedded Workbench we can achieve this.

Here is what you can do. Create a new group called, for example, ‘Docs - external’. Then drag and drop from your file explorer to the group any document that you would like to access through the workspace such as data sheets, errata documents, white papers and application notes. This operation will create links to the documents so that when you double click one of the documents in the group, it will open up in the Windows default viewer for that type of document.
 
Click to enlarge image
 
What else do you want to have access to from within a workspace to work efficiently? Well, the project documentation is another type of documents that can be subject to this way of working. We can create a new group called ‘Docs - internal’, and again, drag and drop from a file explorer any project related document that you would like to access through the workspace like requirement specifications, test specifications, schematics etc.

The physical location of the file can be anywhere on your computer or network - perhaps stored on your version-controlled document server.
 
Click to enlarge image
 
If you want a specific file extension to open with an application of your choice, and not the default choice in Windows, you can choose Tools -> Configure Viewers… in IAR Embedded Workbench and set up file your preferred viewer.

This way we have all documents available and anyone else taking over the project will get a kickstart just by opening the workspace.

Other than documents, we can keep links to other applications. This can be, for instance, flash programming software, hyperterminal, a third-party debugger, bat files, etc.
 
Click to enlarge image
 
Further on, links to project-related web sites such as discussion forums, FAQs and device information is always good to collect.
 
Click to enlarge image
 
As this developer’s toolbox article shows, IAR Embedded Workbench provides a very flexible workspace platform and promotes a structured way of working in both small and very large scale software projects. I am sure you can find even more smart ways of utilizing the workspace!
 
Click to enlarge image
This article was published in e-News from IAR Systems.

SUBSCRIBE to free, monthly newsletter.