Weighing the options
4 mins read
As complexity and diversification increases, OEMs can no longer rely on internal staff having the necessary skills. Instead, they increasingly use independent consultants, who can provide the right software skills.
In the current economic climate, OEMs are also turning to consultants to help them improve their embedded software, at costs an order of magnitude lower than developing a new product.
An example is a recent project undertaken by a supplier of weighing equipment to design a new range of retail weighing machines featuring a controller based on the Freescale i.MX27 processor running embedded Linux. Although the company's software engineers were familiar with developing embedded software using commercial real time operating systems, they had neither worked with, nor deployed, embedded Linux. Pebble Bay was called in to define the foundation software for the controller.
The initial phase of the project researched the availability of suitable foundation software, including the Linux kernel, development tools, board support package (BSP) and device drivers, along with some 'middleware' components such as internet browsers and databases.
In each case, the aim was to identify the most suitable components available 'off the shelf' and the modifications required, if any. In some cases, no off the shelf components were available and bespoke development was required.
Foundation software choices
Since the customer's application did not have stringent real time requirements, but required a range of device and 'middleware' support, the Linux 2.6.x kernel was suitable. No proprietary kernel extensions were required to meet functional and performance requirements.
The glib C library was chosen. This is commonly used in embedded and desktop Linux systems, not least due to the range of features supported and low risk. However, uClibc, a C library designed specifically for use in embedded systems, uses much less memory and could be considered if this factor became significant.
The root file system chosen was BusyBox, so BSPs and tool chains that support BusyBox were preferred. The system needed to include a boot loader that would be responsible for loading and executing the Linux kernel and RedBoot was recommended, since it is the standard boot loader provided with the i.MX27 ADS evaluation board, thus reducing development effort required and risk.
System requirements
The weighscale required a flash file system that included drivers for the Samsung NAND flash devices used on the hardware. The Linux kernel includes support for the JFFS2 flash file system, which supports NAND flash devices. The memory technology drivers for the Samsung NAND flash devices used on the hardware were also provided by the kernel. Alternatively, the YAFFS flash file system could have been used; this is specifically designed to support NAND flash devices and may offer some benefits with large flash arrays. YAFFS is not included in the standard Linux kernel, but is straightforward to add.
Secondly, a host controller driver was required for the i.MX27's High Speed On-The-Go USB controller, in conjunction with an external NXP1504 ULPI USB transceiver. The USB interface was required to communicate with a number of devices. The Linux kernel includes support and drivers for mass storage on a memory stick, the ZyDAS ZD1201 USB Wi-Fi chipset, and the FTDI FT232 'bridge' device used for communication with the load cell.
Specific interfaces for this project that did not conform to a standard USB class definition – and which thus required bespoke drivers – included a cash drawer interface, a self service keyboard and a label printer. A barcode scanner conformed to the USB Human Interface Device class specification and either the Linux kernel or the device vendor would therefore provide a suitable driver.
The weighing machine also required a Secure Digital memory card, 10/100BaseT Ethernet and a TCP/IP stack. It includes two 7in wvga (800 x 480) tft lcd panels and a touchscreen. Since the i.MX27 lcd controller is designed to support only one display, any existing driver for this hardware would need to be modified. Interfaces were also required for a keyboard, audio circuitry and a serial peripheral interface. The weighscale also needed to include features to notify the application software of imminent power failure.
Board support packages
Pebble Bay researched open source and commercially supported BSPs, as well as tool chains suitable for the customer's foundation software development. Pebble Bay identified the device drivers and other low level software required to support the controller hardware and to meet the stated requirements; this comprised both 'off the shelf' and bespoke software components.
The BSPs considered in detail where from Freescale, Pengutronix and TimeSys. As each is packaged with appropriate development tools, there was no need to build a matrix of BSPs versus development tools and to investigate each combination.
Other options that could have been considered included Linux products from Wind River and Montavista, both of which provide a supported version of Linux for embedded systems. For this project, the customer was aware of both, but decided not to use them due to licensing costs.
Recommendations
The standard Linux 2.6.x kernel was considered to be a suitable basis for the foundation software and, based on the strengths, weaknesses and risks shown in Table 1, Pebble Bay recommended the Freescale Linux BSP and tool chain.
In particular, the Freescale software had the following benefits:
* More extensive availability of device drivers
* YAFFS2 support
* Wide usage on the i.MX27, so likely to be well debugged
* Body of knowledge in the embedded community
* No initial or recurring costs
* No 'lock in' to a particular vendor for support
These points meant the Freescale option was likely to result in the lowest lifetime costs and that risk would be reduced due to the wider availability of support and expertise in the market over the medium term.
The main technical weakness of the Freescale BSP is that it does not include a graphical IDE to configure and build the kernel. However, the Linux Target Image Builder (LTIB) tool bundled with the BSP has proved to be fairly easy to use and will quickly become familiar to a kernel developer.
While the lack of commercial support for the Freescale BSP and reliance on the open source community does present some risk, this might be mitigated by taking out a subscription to the standard TimeSys LinuxLink program, which would provide additional support if necessary at relatively low cost.
* This article is an abridged version of a white paper. The full version is available for free download here.