Software Tools Advance Embedded Control This article contains online extra material.

Although the development of application software for any environment has similar traits, software for embedded control imposes more stringent requirements and limits. Execution speed, timing issues, memory size, extent of testing and safety partitions—depending on the criticality of the application—all have higher requirements than in general PC-based software.

By Frank J. Bartos April 1, 2004

AT A GLANCE

Stringent development requirements

Visualize on a host

Execute on target hardware

More capable development tools

Timing-dependent methods

Sidebars: Software tool shortens design cycle for embedded motion control

Although the development of application software for any environment has similar traits, software for embedded control imposes more stringent requirements and limits. Execution speed, timing issues, memory size, extent of testing and safety partitions—depending on the criticality of the application—all have higher requirements than in general PC-based software.

A further distinction for embedded or dedicated software is direct interaction with ‘target hardware’ rather than lines of program code. Simulation and emulation are firmly part of the development process to obtain expected performance from target controllers and chips embedded into machines. And the software must be immune from frequent version changes.

Code size, execution speed,….

Whether developing general-purpose software or embedded-control software, designers must wrestle with code size, execution speed, and development time, notes Nathan John, director of strategic marketing at Cypress MicroSystems, a subsidiary of Cypress Semiconductor Corp. However, it’s the relative importance of these factors that differentiates the two arenas.

‘Code size, for example, is almost always critical for an embedded program,’ John says. ‘Most embedded applications are starved for code space, and inefficient space usage is just not acceptable.’ In contrast, general-purpose software designers seldom suffer from code space limits. As for execution speed, ’embedded software designers must meet end-application speed requirements, but further speed optimization does not gain any advantage.’ For example, in trying to make a robot motion faster than needed (if it’s feasible), ‘nobody would cheer when the robot arrives early then waits’ on another assembly sequence, John adds. Yet, wishing for your PC to run faster is a different matter.

David Barnett, director of product management at Green Hills Software Inc., views embedded application software as requiring much stricter real-time (or deterministic) performance than normal software to ensure it can ‘keep up’ with the process or system being controlled. Moreover, memory, processor speed, and other resources must be minimized to optimize application resources, including reliability. Barnett cites different reasons for this minimalist philosophy depending on specific needs: minimize cost for high-volume applications, minimize power consumption for battery operation, and minimize heat dissipation where environmental or form factor limits are involved.

He also mentions the need for higher reliability where embedded software controls mission-critical industrial, medical, automotive, and aircraft applications. Higher security is needed for embedded software to protect against external attacks and also to allow partitioning of safety-critical applications so that more stringent quality assurance can be applied to parts of the software requiring highest reliability (that is, control functions vs. user interfaces), explains Barnett.

Benefits of software tools

An intergrated development environment (IDE) for Cypress MicroSystems’ programmable system on chip (PSoC) devices contains a novel front-end Device Editor, said to simplify users’ experience with application development flow.

Wind River believes that the development of embedded control software relies on ‘a multitude of tools with specialized functions,’ ranging from application design to traditional tools, such as compilers, debuggers, and test tools. One distinguishing characteristic of this software type, explains Marc Serughetti, director of marketing at Wind River, is that users develop their applications on a standard host (PC or Unix station, for example), but the software is not intended to run on that host. ‘Application software for embedded application is designed to work on a specified target hardware and with a specified function,’ he says. ‘[And] all these tools can be used to visualize, on the host, the execution of software on the target hardware.’

Ability to debug is particularly important for embedded software development, according to Serughetti. Among Wind River products, he mentions the visionTrace family that can monitor integrated program-flow to debug code faster. It provides trace solutions for reconstructing execution of software, using information from the CPU obtained during execution to access code and data from internal cache and external bus cycles. Compilers also play a key role in software development by optimizing code generation and size and execution speed to maximize performance of target hardware. More compact code means less memory needed, which directly impacts the cost of an embedded device. Especially useful in control applications, compilers add another level of optimization to code-generation-tool technology. ‘Compilers employing the latest optimization technology routinely produce code 20% to 30% faster than standard compilers, and in some cases, two to three times faster,’ states Serughetti.

Other development tools cited by Wind River include those for real-time visualization of software behavior. StethoScope , a real-time graphical monitor, allows users to view any variable or memory location in their system—while the code runs uninterrupted. Peak values and code anomalies can be observed, analyzed, and saved. CoverageScope , another analysis tool, shows which parts of the code actually execute during a test case. Thorough code testing can detect and fix more latent bugs before the software is downloaded. Corrections earlier in the design process obviously save time, effort, and money.

‘Increase in productivity is the number-one benefit of good software tools for the embedded programmer,’ says Cypress MicroSystems’ John. As project schedules shorten, development tools must provide for this increased level of productivity.

Cypress MicroSystems offers an integrated development environment (IDE) for its Programmable System-on-Chip (PSoC) mixed signal array devices. A graphical ‘Device Editor’ at the front-end of this application software is said to offer unique features. It links designers with logical elements called ‘UserModules’ that provide higher level functions, such as timers, pulse-width modulators, and A/D converters (see ‘PSoC’ diagram). Flexibility in silicon is intermeshed with software to allow users to configure underlying analog and digital hardware via simple register settings. UserModules also include application program interface routines to ‘talk to the function’ from the user’s code. ‘A great deal of an embedded programmer’s time is spent manipulating hardware peripherals, and this software tool will allow for a drastic time reduction in that process,’ says John.

Timing dependency

Green Hills emphasizes the heavily timing-dependent nature of developing and testing real-time software. Working in that environment becomes a challenge that new software tools increasingly need to address. ‘Software bugs often occur very intermittently,’ says Barnett. Complex interactions (threads) and different types of program inputs cause intermittent timing problems that traditional methods—like single-stepping the processor with a traditional debugger and/or instrumenting application code—will not find because they perturb the timing itself, he explains.

Two recent, innovative tools from Green Hills offer a solution. SuperTrace probe can capture in real time up to 1 GB of raw application data from the chip, without need for run-time instrumentation or intrusive debugging. Capture takes place at speeds in excess of 300 MHz, but due to logic compression, this corresponds to up to two-billion processor cycles (at clock rates up to 1.2 GHz). When a bug occurs, TimeMachine debugger analyzes the captured history offline. This allows developers to debug backwards from the occurrence of the bug to its root cause, while viewing source code and data. The tool affords ‘complete visibility into an application’s precise behavior both forward and backward in the time dimension,’ adds Barnett.

Jenifer Loy, LabView Real-Time Product manager at National Instruments, takes a historic view on the two approaches used to develop embedded control applications. ‘Bounded tools that are optimized for specific types of applications’ represent one method, she notes. An example here would be PLCs—ideal for digital logic systems—focused on the application via pre-programmed blocks. ‘The second approach is to give developers unlimited flexibility through real-time components (operating systems and processors) programmed with an ANSI C IDE,’ she says. Each method has added incremental improvements during its evolution, such as analog measurements for PLC devices and integrated libraries for real-time operating systems. Demand for embedded development tools is on the rise, and therein lies a challenge: many new users lack the background and experience required by traditional tools, according to Loy.

A blending of the two embedded control approaches is emerging. The new category of tools is optimized for the target hardware, allowing engineers to focus on specific applications, not on programming details, she explains. ‘With one new type of tool, engineers develop software at a system level and the tool generates C code. However, translation is never perfect so the engineer must hand-tweak the C code to achieve necessary optimizations,’ adds Loy.

Visual programming

With National Instruments’ graphical development software tools, such as LabView Real-Time and LabView FPGA , users can develop embedded applications via visual programming techniques, without further code translation. LabView code is compiled directly to machine code.

Visual programming is one example of greater productivity derived from embedded software tools (see ‘Software tool…’ sidebar). ‘Visual programming is the natural evolution for the embedded software development community … where it’s now firmly entrenched,’ states Cypress MicroSystems’ John. ‘I would estimate that 10 years ago 80% of embedded designs were being done in assembly language, and today I would guess this has reversed to where 80% are being done in C language.’

As software content of embedded devices increases, application development tools, support tools, and other specialized tools need to work cooperatively within an open integrated development environment, suggests Wind River’s Serughetti. The recently reorganized Eclipse Foundation is an example of such an open framework.

Experts concur that as critical control and safety-related applications embed more software, increased attention will be given to testing and reliability.

Online Extra to Control Engineering April 2004 article,‘Embedded Control Software’

IBM Rational also noted differences between general-purpose applications and software written for embedded control. “Embedded control software normally must conform to a higher degree of constraints and requirements for power consumption, timing, recovery, and so on,” says Marc Brown, technical marketing manager, Rational, MDD Products. He further emphasized that software controlling life-critical or safety-critical devices and systems are subject to extensive certification tests by the U.S. FDA or FAA. And not least, defects in embedded software can endanger the business bottom line through costly device recalls.

Brown went on to explain that current news in embedded control application software tools includes increasingly sophisticated “levels of tooling and tool automation” directed at developers and testers.

As for the fit of visual programming into the application software development picture, he states, “Visual programming is a key factor in assisting teams to develop more complex software in shorter timelines with less resources. It allows teams to abstract the complexity to levels of understanding and can be used to automate much of the tedious and manual activities.”

Eclipse Foundation

As mentioned in the main article, a basic ingredient for successfully integrating diverse high-level software development tools is an open environment. The Eclipse Foundation , recently reorganized into a not-for-profit corporation, is one organization offering this kind of environment.

The Foundation describes itself as “an open platform for tool integration built by an open community of tool providers.” The Eclipse platform operates under an open-source paradigm, with a common public license that provides royalty-free source code and worldwide redistribution rights. This gives tool developers total flexibility and control over their software technology.Eclipse-based tools give developers full choice of languages and platforms in a multi-vendor environment. The framework makes it easier to create, integrate and use software tools, with the ultimate goal of reducing development time and costs. The Eclipse Platform is written in the Java language. It includes extensive plug-in construction toolkits and examples. Eclipse has been applied on such development workstations as Linux, QNX, Osx, and Microsoft Windows-based systems.

More development tools Metrowerks and Encirq Corp. have recently collaborated on a solution to aid developers working in Motorola 16-bit HC(S)12 microcontroller environments. The tool suite—Metrowerks CodeWarrior Development Studio for HC(S)12, Data Expert Edition—combines Encirq’s 3e Data Management Suite for HC(S)12 devices with CodeWarrior integrated development environment (IDE).

This combination of a proven IDE for 16-bit applications and a compact embedded database reportedly allows developers to easily generate compact, reliable applications. Encirq 3e Data Management Suite lets users create custom, application-specific data management components as inline C-language source code, which helps automate embedded development for applications managing real-time data and devices, say the product suppliers.

CodeWarrior Development Studio for HC(S)12, Data Expert Edition uses a simple high-level standard language to generate C code directly into the CodeWarrior project environment. The code can then be merged with other application code and automatically optimized to take full advantage of the HC(S)12 features.

CodeWarrior Development Studio for HC(S)12, Data Expert Edition is available now priced at $7,995(USD). Evaluation CDs can be requested from Metrowerks.

CoWare Inc. recently announced new functionality upgrades for its LisaTek suite of integrated products for embedded processor modeling, design, and software tool generation (based on the Lisa 2.0 language). Embedded device designers can now model their processor using a high-level language; and also automatically generate Instruction Set Simulators plus a complete set of associated software tools, including its C compiler. Custom processors for DSP and control applications are also enabled by automatic generation of Register Transfer Level (RTL) code that can be synthesized. CoWare has patents pending on C compiler generation and RTL generation technologies.

LisaTek suite includes Processor Designer for creating processor IP simulation models and their software development tools; C Compiler Designer for creating custom C compilers; and Processor Generator, which produces RTL implementation code for the processor hardware. With C Compiler Designer, users create a compiler for their embedded processor, using the same Lisa 2.0 processor description and a graphical interface to provide the necessary inputs. The “Designer” significantly cuts C compiler development time.

Use of new and extended C/C++ Graphical Debugger in LisaTek allows quick simulation and debug of models to ensure correct functionality is obtained, reducing time spent to identify software bugs. Further processor optimization is possible via simulation profiling, to understand and remove any performance bottlenecks and achieve optimum architecture, says CoWare.

Software tool shortens design cycle for embedded motion control

Motor and motion control is a growing mainstream embedded application. A recent collaborative move by The MathWorks and Texas Instruments reinforces that image. It takes the form of a new tool from The MathWorks—’Embedded Target for TI C2000’—that lets engineers design, implement, and verify real-time control and signal processing algorithms directly on Texas Instruments TMS320C24x and C28x controllers. And it’s done visually, with no manual coding (see graphic).

Today, motion system designers are resorting to advanced processors that handle more computationally intensive control algorithms to meet customer demand for more precise position, velocity, and torque control. Equally capable software tools are needed to efficiently exploit such processors, for example, the TI C2000, with its increased functionality, several on-chip peripherals, and high processor speeds.

Embedded Target for TI C2000 shortens application design cycles through automatic, efficient code generation, and peripheral programming support from Simulink, explains Arun Mulpur, DSP product manager at The MathWorks. It works seamlessly with TI’s integrated development environment via Matlab Link for Code Composer Studio, allowing execution of CCStudio commands for analysis, debugging, and automated code verification from Matlab. User benefits include ability to:

Design complex algorithms for controlling several motor topologies—ac induction motor sensorless vector control, switched-reluctance motor current-shaped control, and permanent-magnet synchronous motor servo control;

Model and simulate motion control system performance; and

Verify performance of generated code against the specification.

Pricing for Embedded Target for TI C2000 lists at $4,000.