LinuxDevices.com Archive Index (1999-2012) | 2013-current at LinuxGizmos.com | About  

Application development with Eclipse-based IDEs

Jun 24, 2004 — by LinuxDevices Staff — from the LinuxDevices Archive

Foreword: This whitepaper from esteemed Linux author and TimeSys Product Manager William von Hagen describes the use of Eclipse-based Integrated Development Environments (IDEs), examines specific tasks in the embedded system and application development cycles, and discusses ways in which tools from Linux software vendors such as TimeSys provide powerful, flexible solutions to general problems. Enjoy! . . .


Developing Embedded Applications
Using TimeStorm, or another Eclipse-based IDE

Both applications and the application development process are more complex today than ever before. This is especially true in embedded development environments, where the system on which applications are being developed is different from the system and execution environment in which those applications will be used.

Providing an integrated framework to help simplify and manage the development process helps mask much of this complexity, enabling developers to focus on their applications rather than the internals of the compilation, deployment, and testing processes.

This white paper discusses how an Integrated Development Environment (IDE) can simplify application development, deployment, and testing, increasing developer productivity by providing a consistent, graphical interface that is easy to use and which encapsulates much of the domain knowledge for each phase of the development process.

Advantages of an Integrated Development Environment

From the beginning of symbolic computation to today, producing applications has involved an increasing number of steps. After creating the source code using an editor of some sort, all of the program files related to an application must be compiled into intermediate object files. Once all of these files compile successfully, references to shared and external symbols must be resolved and the object files must be linked together to form a single executable that contains accurate references to external objects such as libraries. Finally, the resulting executable must be tested and debugged with a variety of inputs and under a number of conditions before it can be deployed. The testing phase typically requires multiple iterations of the debugging, code updates and corrections, recompilation, re-deployment, and testing cycle.

Traditionally, each of these steps involves the direct use of different applications, where each application has different syntax, requires different options, and produces different types of output. This process therefore requires substantial knowledge about how to use each application in the development chain.

Applications such as the Unix “make” program provide substantial improvements in developer productivity by encapsulating the relationship between the source files that contribute to a single application. Providing a single control file (the Makefile) that manages each step of the compilation process for each file involved in a project enables developers to focus on their application rather than the internals of the compilation process.

Applications such as “make” help minimize and manage much of the complexity in modern application development by unifying the different software packages required during the compilation phase of the development process. This is progress, but not perfection. Integrated Development Environments (IDEs) are the next leap in simplifying and managing the development process by increasing the extent to which a single application serves as a control center for application development.

IDEs continue the unification and encapsulation of the development process by providing a single framework that supports a wider range of the applications used during the development, deployment, testing, and debugging process. By providing a single, consistent interface for the entire development process, IDEs increase developer productivity by further minimizing the time spent learning different applications, interfaces, and process internals. IDEs such as TimeSys' TimeStorm IDE, shown in Figure 1, provide a single graphical environment for creating, editing, compiling, deploying, executing, and debugging applications.

Figure 1: The TimeStorm IDE from TimeSys

(Click to enlarge)

As a single focal point for application development, the flexibility, extensibility, and openness of an IDE are a critical aspect of selecting an IDE. Thousands of companies are involved in developing software that augments and further extends the development process. No one company can think of everything.

Modern IDEs such as TimeSys's TimeStorm IDE are based on the popular and widely used Eclipse framework. Eclipse is an open source software development project that is dedicated to providing a robust, full-featured, industry platform for the development of highly integrated tools. Written in Java for maximum portability, Eclipse has been adopted as the framework for all future tools development efforts by well-known embedded tools vendors such as TimeSys, Wind River, RTI, and MontaVista.

Eclipse provides a basic framework that can be leveraged by applications known as plugins, which interoperate within an instance of the framework. This enables cooperative application development because tools vendors can focus on their core competencies and be assured that their plugins will integrate seamlessly with other well-designed plugins.

Using the Eclipse framework also makes it easy to integrate plugins that further extend the scope of an IDE by performing administrative or infrastructure-related tasks that are related to, but not necessarily internal to, the development cycle. Good examples of these types of plugins are those for source code control and management that are currently available for Rational Clear Case, Perforce, and even Open Source source code control systems such as CVS.

Creating and Managing Projects

Most modern IDEs view the files that comprise a single application as components of a single project because they share a single compilation environment. Managing multiple files as a single project requires a central repository for the common set of meta-information about all of those files. IDEs such as TimeStorm IDE provide a central location for all IDE-related projects in what is known as a workspace. A workspace is a central directory that contains general information about IDE configuration, and holds the projects that are being developed using the TimeStorm IDE. Individual workspaces can be used for single-developer projects, while shared workspaces can be used to facilitate collaboration and parallel development within local or widely-distributed development groups.

Eclipse-based IDEs such as TimeStorm IDE automatically create a workspace for you the first time that you execute the IDE. Once the workspace is created, TimeStorm IDE makes it easy for you to create new projects by providing software wizards that walk you through the steps of project creation, collecting all mandatory information and then automatically creating the core framework for your project.

Projects for developing different types of applications or for developing applications written in different programming languages each have specific requirements. Figure 2 shows TimeStorm's New Project wizard, which lists the types of projects supported by the current generation of the IDE.

Fiture 2: The New Project Wizard in TimeStorm IDE

(Click to enlarge)

Some of the simpler types of projects shown in Figure 2 are provided by core Eclipse functionality or core plugins that are typically used with Eclipse, such as the C Development Toolkit (CDT). Project types such as the “TimeStorm C Project,” “TimeStorm C++ Project,” “TimeStorm Java Project,” “TimeStorm Kernel Project,” and “LVS Test Suite Project” are special types of projects that are only available within the TimeStorm IDE. These types of projects provide custom capabilities and configuration items that are tailored towards the needs of embedded application developers.

A single compiler and set of the related applications required by the compilation, linking, and loading process are generally referred to as a toolchain. In traditional application development, the system on which you are developing applications is usually the same type as the one on which those application will execute. This is very different for embedded application development, where applications destined for one platform are developed and compiled on another. Embedded application development requires that an IDE supports the ability to associate different toolchains with different projects.

Figure 3 shows one of the screens from the “TimeStorm C project” wizard, which enables you to select a specific toolchain from a drop-down list of available toolchains and associate that toolchain with a particular project.

Figure 3: Selecting a Toolchain for a TimeStorm C Project

(Click to enlarge)

As an example of the flexibility required by embedded application development and provided by the TimeStorm IDE, the toolchain associated with a project can easily be changed at any stage in the development process. This makes it easy to develop applications that will be deployed on multiple embedded systems or to switch target systems at any stage in the development process.

Developing and Building Apps in an Eclipse-Based IDE

The file editor provided by the Eclipse framework used by CDT is a flexible editor that can be configured to follow the command and keyboard conventions used by multiple text editors, so that developers who are comfortable in different development environments can be instantly productive in an Eclipse-based IDE. It provides other advanced capabilities such as automatic source code highlighting, balancing parentheses and other aspects of language-specific syntax. The open framework provided by Eclipse also makes it easy to integrate popular editors from commercial software vendors such as SlickEdit, whose Visual SlickEdit plugin integrates the widely-used SlickEdit editor into the Eclipse environment.

Given that the Eclipse framework and hundreds of plugins can be freely downloaded over the Internet, commercial tools and plugins based on Eclipse must provide unique capabilities that are not found in the generic framework and open source plugins. IDEs such as the TimeStorm IDE extend the capabilities of the core Eclipse framework and common plugins in a variety of different ways.

One of the ways in which the TimeStorm IDE extends the core capabilities of Eclipse and common plugins for C Language development is by automatically generating and maintaining the Makefiles used by TimeStorm-based projects. As mentioned earlier, the make application was an early milestone in the simplification of application development. The make program unifies all of the stages of the compilation process through a central control file known as a Makefile. A Makefile enables you to identify dependencies between the source files and libraries that make up a modern software project, any special processing that each of those files requires, provides ways of invoking specific compilers and related tools, and lets you specify any command-line options that any step in the build process requires.

That said, manually creating and maintaining a Makefile can be a complex task, especially for large projects. One of the enhancements that TimeSys provides in its TimeStorm IDE is automatic Makefile generation. The Makefiles generated and managed by TimeStorm leverage the toolchain and other project-wide information available in TimeStorm to automatically invoke specific toolchains and related applications during the application build process. As new files are added to the project, dependency information for those files is automatically extracted by TimeStorm and added to the Makefiles. TimeStorm IDE gives you the power of a complex Makefile automatically, without requiring that you become a “make wizard”.

In addition to specific features such as automatic Makefile generation and maintenance, IDEs such as TimeStorm provide many other capabilities that simplify and expedite development. For example, TimeStorm leverages the multiple windows and views provided by Eclipse and CDT to display separate windows that contain an outline of your application, display the status of the compilation process, and automatically capture any error messages and warnings that are displayed during compilation. These are recorded in a separate pane of the TimeStorm display, and jumping to the location of any error or warning is as easy as double-clicking on the message.

IDEs provide substantial power and are almost a requirement for developers who have always worked in environments such as Microsoft's Visual Studio, Borland's Paradox, or other common IDEs. A common complaint about IDEs is that they do too much for the user, preventing users from working in familiar patterns or from taking advantage of optimizations that they are aware of. Well-designed IDEs such as TimeStorm provide the capability to override default behavior by taking advantage of extension points to integrate custom commands or functionality. As an example, all Makefiles generated by TimeStorm search for several optional, user-created Makefiles during the build process. By creating these files, a user can easily integrate custom commands, initialization variables, cleanup actions, and so on with TimeStorm while still taking advantage of its automatic capabilities.

Running Cross-Compiled Applications

As discussed in the introductory white paper to this series, “Developing Embedded Systems with Graphical Tools: An Overview,” developing on one system while needing to execute an application on another provides some unique challenges for an IDE. Problems associated with the cross-compilation that is a typical requirement for embedded development are solved by making it easy to select and switch between the different toolchains that enable compilation for different platforms.

An easy-to-use and powerful interface for cross-compilation solves a generic problem for embedded developers, but deploying an application on a specific embedded system, executing it there, and viewing the results of program execution are case-specific and board-specific problems. Each target embedded board has a different network address or unique serial connection to a given developer's host. An IDE targeted for embedded developers therefore needs a flexible mechanism for identifying and describing the host on which a developer wants to test a specific application, the way in which a desktop system connects to and interacts with the remote system, and so on.

Without an IDE such as TimeStorm IDE, the typical embedded compile/transfer/test/repair cycle is a manual process involving Linux arcanery such as manually transferring an application to a remote host via FTP or SCP, a manual login to the remote board there via telnet or SSH, and manually running the application. If problems are encountered, you have to return to your development system, correct and rebuild the application, and then repeat the whole process over again as many times as needed until all obvious problems have been resolved.

TimeStorm's focus on embedded host/target development solves remote communication and interaction problems by making it easy to create different “Run/Launch Configurations.” By using these run configurations, file transfer, remote execution, and displaying the results of remote execution can all be done with a mouse click, without leaving the TimeStorm IDE or your development system. These configurations store information about the way in which you connect to a given host, login and password information (in encrypted form, of course), the way in which an application can be transferred to the remote host, and any arguments that should be passed to an application when it is remotely executed.

Figure 4: Creating a Run Configuration for a TimeStorm C Project

(Click to enlarge)

When you are ready to test your application, TimeStorm uses a specific Run/Launch Configuration to automatically transfer your application to a specific remote host, executing it there while supplying any arguments that you have specified, and capturing the results of the program's remote execution so that you can browse them at your convenience. All of this is done automatically, without a developer having to leave his/her desktop development system and the TimeStorm IDE.


About the author


William von Hagen is a Senior Product Manager at TimeSys Corp., has been a Unix devotee for over twenty years, and has been a Linux fanatic since the early 1990s. He has worked as a system administrator, writer, developer, systems programmer, drummer, and product and content manager. Bill is the author of Linux Filesystems, Hacking the TiVo, SGML for Dummies, Installing Red Hat Linux 7, and is the coauthor of The Definitive Guide to GCC (with Kurt Wall) and The Mac OS X Power Users Guide (with Brian Profitt). Linux Filesystems is available in English, Spanish, Polish, and traditional Chinese. Bill has also written for publications including Linux Magazine, Mac Tech, Linux Format, and online sites such as Linux Planet and Linux Today. An avid computer collector specializing in workstations, he owns more than 200 computer systems.


Read the entire series . .


Next: deploying and debugging applications

The Run/Launch configurations described in this paper make it easy to identify and solve coarse problems in your application. More complex problems usually require the use of an interactive debugger in which you can execute and monitor an application. This is simple enough to do on a desktop system, but becomes more complex for embedded developers who want to debug their application from the development system while running it remotely on their embedded target system. TimeStorm leverages its Run/Launch Configurations in order to provide integrated support for remote execution and remote debugging, once again without leaving your desktop system or the TimeStorm IDE.

The next white paper in this series discusses local and remote debugging in detail, using TimeStorm's integrated support for remote execution and debugging as an example of how IDEs can save time and money while generally heightening productivity through a powerful, consistent user interface.

TimeSys will hold Webinars corresponding to von Hagen's whitepapers on embedded Linux development tools.


 
This article was originally published on LinuxDevices.com and has been donated to the open source community by QuinStreet Inc. Please visit LinuxToday.com for up-to-date news and articles about Linux and open source.



Comments are closed.