Linking hardware to OS functionality to speed development of GUI-based apps
This "Product How-To" article focuses how to use a certain product in an embedded system and is written by a company representative.
From industrial control to home appliances and handheld devices, there is a continuing trend towards embedding increasing degrees of both intelligence and connectivity into all kinds of end products.
This growing computing power and ability to communicate, of course, produces more feature-rich products; more than that, it has produced a dramatic uplift in the variety and complexity of the interactions between products and their human users.
At the same time, users' expectations have themselves increased dramatically. Simple textual displays appear old-fashioned and 'non-intuitive'. And products ranging from kitchen appliances to motor vehicles " that only five or ten years ago were routinely operated via dials, push-buttons and electromechanical controls " are now graphics-equipped. As a result, increasing numbers of embedded designers are required to design relatively complex graphical user interfaces (GUIs).Software content and OSs
This move to more intelligence, more interconnectivity and more graphics has in turn encouraged engineers to approach their designs at a higher level. Software content has become as important as hardware design, and increasing numbers of designs contain not just significant amounts of application code, but also a compact embedded operating system.
If the deployment of an operating system in a product such as a kitchen appliance seems excessive, it is worth remembering the benefits that such an approach can deliver. These primarily centre on increased productivity in the development cycle, the availability and re-usability of device drivers and other commonly-used code blocks, and the removal from the design team's shoulders of many of the low level details of the design.
As a consequence, operating systems such as embedded Linux are increasing in popularity, in particular for GUI-driven applications. Because it is free of licence fees and royalties, Linux itself is particularly attractive in cost-sensitive applications; many developers also appreciate its naturally robust nature, derived from the open source nature of the software.
For the embedded designer tasked with building a connected, GUI-driven product, Linux also offers some specific advantages. Firstly, the operating system can be relied upon to handle the details of internetworking, at a level that is familiar to most programmers. The design team also gets access to a wide range of open source graphics libraries such as GTK, as well as commercial products that commonly include GUI builder and font rendering tools, and higher-level functionality such as OpenGL.
By removing the hardware dependencies from the application, Linux provides a standard development environment for the design team. All of the interaction and testing takes place on a standard PC, and the final step in the project is to recompile the source code for the appropriate target platform.Hardware requirements
Of course, electing to pursue development at a high level of abstraction is dependent not only on the availability of the high level tools, but also on underlying hardware that can cost-effectively deliver the required processing power and peripheral features. In this regard, microcontroller manufacturers are rising to the challenge of GUI-equipped embedded designs with devices that include not only LCD and touch screen interfaces, but also hardware to accelerate specific image processing operations.
Toshiba's TMPA910CRAXBG microcontroller (Figure 1, below) is an example of such a device. Based on a low-power ARM926EJ-S CPU core, the device uses a seven layer multibus architecture to achieve significantly better performance than other devices operating at comparable speeds at up to 200MHz. For the designer of GUI-based systems, the chip also includes a built-in LCD controller that supports TFT and STN display sizes up to 800 x 480 pixels. A touchscreen interface further reduces the need for external components in such designs.
|Figure 1: Toshiba's ARM based TMPA910CRAXBG provides hardware support for TFT and STN touchscreens|
In addition to the required peripheral set, the device also includes a hardware-based LCD data processor that accelerates image processing functions such as scaling, filtering and blending, and offers real-time processing for movies at speeds up to 30 frames per second. A CMOS image sensor interface simplifies the implementation of applications requiring image capture.
Just as important is the controller's connectivity-based feature set, which includes SPI, UART, I2C, I2S, and a high-speed USB device (480Mbit/s). An SD host controller supports high-speed mode SD cards with capacities up to 32GByte. The specification is rounded out with 56KByte built-in embedded RAM for program, data and display memory, boot ROM, and a memory controller that supports SDR and DDR SDRAM. Up to 2.5GBytes of linear access space can be addressed.Linux development platforms
Creating an effective link between powerful hardware features and a high-level, OS-based environment relies on a fully featured hardware development platform and supporting software. To support applications based on its TMPA910CRAXBG, for example, Toshiba provides a Starter Kit and Reference board (Figure 2, below) that combines the processor itself with a touchscreen display, Ethernet port, 480Mbit/s USB 2.0 interface and RS232 connector.
In addition, an audio DAC is connected via the processor I2S bus. On-board memory comprises 512Mbit SDRAM, 256Mbit NOR Flash and 2Gbit NAND flash. An SD card socket facilitates the use of portable storage.
|Figure 2. The development board is supported by a Linux development system from Bplan GmbH.|
The board is supported by a third-party Linux development system designed by Bplan GmbH (and available through online registration) to create a complete turnkey Linux development and target system. Using a powerful underlying virtualisation technology called Aura, the environment allows designers to instantly start writing Linux-based applications.
Aura provides the key link between the operating system and the hardware level, ensuring that developers can make full use of the features of the TMPA910CRAXBG, while working at a higher level of abstraction. Aura provides a virtualisation layer which offers a clean hardware abstraction from the operating system.
This approach allows hardware and software development to proceed largely independently, while adding no run-time latency or other performance penalty. In the event of a kernel change, it is possible to install a revised kernel that does not need to 'know' about hardware specifically developed for the project.
This concept is powerful enough to allow design changes at a very late stage of development, offering designers great flexibility in the event of, for instance, pricing on performance issues as the project progresses.
This is achieved by implementing the Aura abstraction layer as a dynamic link library that loads on system start-up, and at run-time is executed within the context of the kernel. Processes such as enabling interrupts are handled as function calls to the link library, providing a context-free entry point to the abstraction layer with effectively the same calling overhead as making a simple function call within the kernel itself.
The Aura abstraction itself includes all of - and only - the functions required to bring up the basic Linux operating system itself. This keeps code size small, while still providing complete independent operating system support.
In addition to the abstraction layer, the Linux support package is delivered with a complete set of device drivers, and gcc cross-compiler designed to run on a standard PC.
Also included is the complete root file system needed to boot the development board: this is hosted within the development system on an NFS volume, allowing the developer to make changes only within the local system and finally to convert to a binary format for export to the target board. This approach allows minor changes to be made locally without the need to re-download the entire system to the board on each revision.
The resulting system creates an environment that can be run 'out-of-the-box', and ensures that there is genuinely no difference between application programming on an x86-type, desktop-hosted Linux, and a Linux kernel hosted on the ARM core within the Toshiba platform.
Comprehensive support platforms that bring together hardware and operating system functionality allow developers to speed the development of interconnected, GUI-based applications. In particular, by using these platforms developers can focus on adding value to their products, rather than dealing with the low-level details of implementations and hardware/software interactions. In low-cost products such facilities, coupled with the licence- and royalty-free nature of Linux itself, allow the designer to implement rich, innovative human-machine interface systems without significant cost or time overheads.