Professional Documents
Culture Documents
EMBEDDED DESIGN
W H I T E P A P E R
E M B E D D E D S O F T W A R E
w w w.m e n t o r.c o m
How to Simplify your Next Embedded Design
INTRODUCTION
With today’s SoCs increasing in complexity, it’s no wonder the software needed to run on these devices is
taking longer to create, adapt, and optimize for a given application on a given piece of hardware. No question
practices and methodologies behind system design needs to change.
Each SoC is designed for a specific set of applications that is in its core target market. The same is true
of operating systems. The combination of choices can be daunting. The system integrator typically handles
the task of creating the hardware/software platform for the application team and therefore, must select
the correct hardware and software combination to ensure that the application will perform adequately and
meet the design goals as specified.
Often this approach is insufficient for a complete application. As a result, the system integrator must then add
in different sets of middleware provided by the OS vendor, or different third-party providers in order to meet
the platform design goals. If no third-party solution exists, or the current approach is cost prohibitive,
the system integrator must specify what functionality needs to be present for the application to perform its
duties and how to achieve the design goals.
As the depth of application complexity and feature set increase, there needs to be a better way to work with
these systems. From the myriad of protocols in which to choose what is optimal for the system? How will the
end-user interact with the finished product? Are there accelerators present that must be interfaced from the
application or middleware?
This leads to the first assessment that the same hardware may or may not meet the needs of the device.
Functionality is a primary concern when selecting a piece of hardware. This same concern persists with
selecting the software. But how do you put it all together?
If the hardware is adequately defined to the operating system in a way that allows trade-offs to be made, the
system integrator has the flexibility to create an optimal configuration versus selecting an operating solution that
doesn’t sufficiently support the selected hardware resulting in a suboptimal configuration. This includes routing of
interrupts, DMA channels, and advanced processing cores such as DSPs.
So, indeed the operating system needs to be configured to match the hardware selection and be adapted
to optimize the functionality necessary for a given application. If 3rd party software is to be used, it must be
integrated to fill in the gaps, or if a development program specified for in-house development is initiated, it must
bring the complete application to bear. This involves a buy versus build assessment for the given functionality.
w w w. m e nto r. co m
2
How to Simplify your Next Embedded Design
The BSP provided will include the common functions that may be necessary for the OS to operate such as a timer
and console and some basic interfaces. While this is a good starting point, it’s not the entire configuration
necessary to bring the platform to its full capabilities.
The answer lies in a configurable build system that allows the BSP and OS to be designed to exploit the hardware’s
capabilities. This accomplishes two goals: 1) The ability to try different combinations to create the platform on
which to build your application; and 2) The ability to work at a level above the manual – which can sometimes
be confusing.
DEVICE DRIVERS
Each device on an SoC has a set of registers that need to be set in order to perform the necessary operations.
A device driver is required to interact with these registers and select the appropriate settings. But how far the
device driver goes in the system is dependent upon the layering involved in a BSP. For instance, the setting up of
the baud rate for a standard serial UART is dependent on the clock source, and frequency. Many times the clock
source is shared between devices on SoC. Therefore, the clock does not belong to a specific serial port even
though the serial port is dependent on the clock. Modern SoC peripherals have an added complexity in
power management. Being able to gate the clock or reduce the clock frequency will save power by changing the
clock at runtime which has an added complexity of having to adjust the serial port registers in order to maintain
the correct baud rate.
Devices must be associated either with their protocol stacks or presented to the developer in a standard API.
Without a device manager, the APIs for a particular class of device may be custom for each device, which makes
controlling them difficult. What’s needed is a device manager that abstracts the device from the middleware and
application, so no matter what devices are available they can be discovered and mounted. This includes power
management as well, where each device may implement a different type of power management and the power
controlling software commands the device into certain predefined modes.
w w w. m e nto r. co m
3
How to Simplify your Next Embedded Design
An ideal system would describe the hardware and software to the build system, allowing the system integrator to
make choices as to what protocols are needed to support the system and what devices are available. If any 3rd
party content is to be integrated, the build system should be extendable to configure that IP as well, and allow it
to either bind under existing protocol stacks or be presented to the application with additional APIs.
For example, let’s say a particular system is designed to support a FAT filesystem across a USB peripheral interface.
Access to this FAT filesystem must be present, both from a host computer, as well as by the peripheral itself.
Looking back at the PMP application, the ability to upload and download files to a host is imperative, but when the
device is not hooked to a host computer, the system must also work in standalone mode to process those same
files in either saving or playing multimedia files or playlists.
Likewise, a USB host controller may be used to host a disk-on-key to either store or retrieve multimedia files.
Additionally, the USB host controller might be used to interface USB speakers or a microphone for greater
functionality.
A device manager abstracts away the specifics in the hardware and provides a common interface for middleware,
applications and power management. This makes it easy to change from one device to another.
This scenario depicts the many forms of an end product and the need for flexible hardware/software to address
the spectrum of the market, from the low end to the high end. It’s important to capture all the necessary requirements,
and heavily weigh the configurability in both the hardware and software selected for the solution.
The need for integration extends all the way up to the application. The middleware present needs to be configured
to match the desired functionality. But with multiple sources of middleware, the system integrator is faced with the
task of integrating a great variety of components. The solution of course, is to use pre-integrated 3rd party com-
ponents. A key piece of this solution is the ability to configure for a particular application, regardless of using
tightly-integrated operating system parts or 3rd party add-on parts.
Another example is the audio interface. Whether it is used over USB, or directly connected to a built-in speaker makes no
difference to the application. It can configure the proper interface to use or present the developer with a list of devices.
w w w. m e nto r. co m
4
How to Simplify your Next Embedded Design
future products out faster. Taking advantage of a complete platform that includes the necessary hardware
components in the SoC, to the configurable por tions of the device drivers, middleware IP, and sample
applications results in a faster time to market.
CONCLUSION
As systems become more capable, SoCs are designed to have more options. The ability to completely describe the
hardware and software, configure both for a particular application, and then apply trade-offs is critically important
to maximizing the utility provided in the SoC.
The Mentor Embedded™ ReadyStart™ platform for the Nucleus® RTOS is an example of such a solution. It
provides complete BSP packages along with metadata that describes the hardware and the software
solutions, including some 3rd party software that integrates seamlessly on top. This gives developers the
freedom to maximize the potential of the platform – starting with compelling user interface demonstrations for
medical, industrial, automotive, and consumer devices, to providing all the necessary protocols along with the
configurability to give developers and architects alike a formidable tool for embedded design.