The Design and Implementation of Embedded Configuration Software Based on Embedded-Linux
The Design and Implementation of Embedded Configuration Software Based on Embedded-Linux
Min Jin1, Xiang Zhou2, Peng Duan1, Zefeng Tian 1 and Jihui Zhou1, 2
1
Software College, Hunan University, Changsha, P.R.China
Rj_jinmin@hnu.cn
2
Intelligent Engineer Institution, Sany Heavy Industry CO., LTD, Changsha, P.R.China
zhx@sany.com.cn
Abstract—With the ever-increasing application of embedded large number of peripheral devices by providing abundant
systems in the field of industrial control, the demand for driver programs; and finally, the capability of customization
embedded configuration software becomes inevitable. This paper for both code size and function, which meets the limitation of
presents a general method of developing embedded configuration resources on embedded devices. The rapid development and
software based on embedded Linux operation system. The popularization of embedded Linux operating system in the
software architecture consisting of host and target is given out. embedded device has provided a broad prospect for the
The relationship between graphic-element classes and its research and development configuration software platform
implementation are described. The animation implementation based on embedded Linux. In this paper, an embedded
technology of dynamic graphic-elements and data
configuration software based on embedded Linux is studied
communication mechanism based on signal and slot are
discussed in detail. Furthermore, aimed at the poor processing
and implemented.
power of embedded microprocessors and the limited storage
resources on embedded platforms, the paper proposes a multi- II. OVERALL DESIGN
level strategy for the performance optimization of embedded The architecture of embedded configuration software
configuration software. The experiment result shows that this
consists of host and target, which is shown in Fig. 1. The host
embedded configuration software can meet user’s requirements
on real-time performance and resource consumption, and thus
is usually based on PC and Linux platform and acts as the
has application prospect and popularization value. configuration environment, which provides interface
development tools such as visual graphics library and device
Keywords-embedded configuration software; embedded Linux; library. After users fulfill defining the scheme of acquisition
Q/T; graphic-element; signal/slot; performance optimization and supervision and developing the monitoring interfaces in
the configuration environment, a series of project
configuration files are generated and finally downloaded into
I. INTRODUCTION
the running environment. The target, based on the embedded
Configuration software is an important platform tool for hardware platform of ARM and the software platform of
SCADA (Supervisory Control and Data Acquisition), which embedded Linux, servers as the running environment, which
provides the user with a friendly developing interface and easy finishes the data acquisition and processing, the execution of
usage by the means of flexible block-building rather than monitoring and control scheme, and the display of interfaces
programming [1]. With the ever-increasing application of according to project configuration files.
embedded systems in the field of industrial control, the
technology of traditional configuration software is applied to Concretely speaking, the development of graphical
embedded control system. Currently, there are some influential configuration environment is based on QT/E for embedded
embedded configuration software, including embedded Linux [3], which is an embedded GUI developed by TrollTech
HMI/SCADA of InduSfot Web Studio, WinCC of Siemens corporation in Norway. QT/E is object-oriented and easily
Corporation, embedded configuration king of Asia Control portable. The advantage of encapsulation and inheritance in the
Technology Corporation, and MCGS of Kunlun Tongtai object-oriented method of QT/E can be taken to build graphics
Automation Software Technology Corporation. These library. Embedded ARM platform adopts Samsung2410
embedded configuration software are mostly based on microprocessor, 64M RAM and 32M Flash. Obviously, this
WindowsCE operating system [2]. kind of embedded platform has put forward strict resource
constraints to the configuration software running on it,
However, the appearance of embedded Linux has brought including slow calculation and processing speed of CPU, weak
new vigor to the development of the embedded products. It is function of floating-point operation or even lack of this
because embedded Linux has many characteristics suitable for function, and small memories etc. These resource constraints
embedded system development: first, open source and rich are the difficult points in developing embedded configuration
software resources; second, the robust and real-time kernel; software, which could be satisfied by adopting some effective
third, support for a variety of hardware architectures and a optimization methods [4].
99
Authorized licensed use limited to: PRASHANT DHEER. Downloaded on August 29,2023 at 16:17:25 UTC from IEEE Xplore. Restrictions apply.
class clockNo :public QWidget { comparatively slow, and screen will badly flicker. In order to
Q_OBJECT solve this problem, the system adopts a buffer mechanism.
public: First, before graphics is displayed in the screen’s painting
clockNo (QWidget *parent=0, const char *name =0 ); region, a buffer consistent with this region is created in internal
int angle() const { return ang;}; memory and graphics is painted in this buffer. Then graphics
QSizePolicy sizePolicy() const; in the buffer is copied to the current painting region of the
public slots: //slot to receive signal screen only once. Finally, the buffer in internal memory is
void setAngle( int degress ); released. In this way, painting speed is promoted and flicker is
signals: avoided. QPixmap is accordingly created in class clockNo. It is
void angleChanged( int ); //signal a painting device based on pixel. All dynamic painting
protected: operations are finished by OPixmap. After function
void paintEvent( QPaintEvent * ); paintEvent() is executed, this device is called to perform
private: // painting screen painting.
int ang;
… B. Usage of Register Variable
} When a local variable is declared as a register variable by
using the key word of “register”, compiler put this local
IV. DESIGN AND IMPLEMENTATION OF DATA variable into a multi-purpose register instead of the stack.
COMMUNICATION Because the speed of access to register is higher than that to
stack, which follows the principle of FILO(First In Last Out),
The mechanism of signal/slot is adopted for data the appropriate usage of the register variable will speed up the
communication, as is shown in Fig. 3. Signal/slot is a kernel execution of the function. Furthermore, the more frequently
feature of QT/E [5]. Comparing with the common the function is called, the more prominently the execution of
communication mode of function callback, signal/slot the function is speed up by this method [6]. For example,
mechanism has some advantages. On one hand, signal and slot because class clockNo needs to perform counting operation on
are loosely connected to each other. In other words, a class, the data collected from data sources every time, variable
which sends out signals, has no need to know which slot will countNUM is operated frequently. In this case, the variable
receive these signals. The signal/slot mechanism of Qt/E countNUM is optimized to a register variable.
ensures that, if a signal is connected to a slot, the slot will be
called at the right time by using the parameter of signal. On the
C. Floating-Point Operation
other hand, signal/slot is completely type-safe, in which any
numerical value and any type of parameter can be used without Most embedded platforms don’t provide relevant hardware
the problem of core dump in callback. that supports floating-point operation. For example, the
microprocessor S3C2410 used in the system hasn’t Vector
Floating-Point (VFP) unit. In this case, the floating-point
library provided by the compiler could be used. This library
comprises a set of subroutine, which adopts integral operation
to simulate the instruction set of co-processor for floating-
point operation, and it is coded by highly optimized assembler.
Even thought, these functions of floating-point operation take
much longer execution time than corresponding integral
operation, and they are not reentrant [6]. Under the situation of
a small amount of floating-point operations, this embedded
configuration software adopts fixed-point operation to improve
the execution efficiency, for it is not necessary to completely
Figure 3. Signal/slot mechanism realize the whole standard of IEEE754 just for a few of
floating-point operations.
There are many pre-defined signals and slots in QT/E. Self-
defined signals and slots could also be added by the means of D. Division operation
inheritance. Many signals could be connected to one slot by
There are a plenty of division operations in the calculation
function connect(). Meanwhile one signal could be connected
and processing on a large number of acquisition data. In fact,
to many slots. The class clockNo described above receives
many embedded processor don’t provide relevant hardware
data changes through the slot setAngle and send its own
that supports division operation, such as the series of ARM
change to the other objects by the signal angleChanged.
microprocessor. In this case, compiler calls the C library-
function to implement the division operation. However,
V. PERFORMANCE OPTIMIZATION standard integer division in the C library-function shows slow
performance. Considering different operation environment and
A. Painting Buffer the range of operands, it usually needs 20 to 100 instruction
When there are much more objects in the painting region of execution cycles. Therefore, division operation should be
the screen, the process of re-painting this region is avoided as much as possible. In other words, other operations
100
Authorized licensed use limited to: PRASHANT DHEER. Downloaded on August 29,2023 at 16:17:25 UTC from IEEE Xplore. Restrictions apply.
could be used to take the place of division operation so as to Table II presents the resource consumption of project files
optimize the software performance [6]. For example, the and class library etc. after the user configuration in the
operation of division by 2N is optimized to the right shift of N experiment is compiled, which indicates that the embedded
bit. For another example, the division operation is usually configuration software can meet the constraint of limited
utilized in the operation of the double-ring buffer. Assume storage resource in the embedded system.
there is a double-ring buffer with a size of buff_size, and its
access position at the present is pointed by pLoc, which value Speed Residual fuel
is increased by QtIncrement bytes. The traditional mode of
access to this buffer is shown as follows.
pLoc= (pLoc + QtIncrement) % buff size; Engine speed
In order to avoid the decline of operation performance
caused by the division operation, the codes presented above
can be optimized to the following codes.
pLoc += QtIncrement;
if (pLoc >= buff_size)
{ pLoc -= buff_size;
} Figure 4. User configuration interface for test
101
Authorized licensed use limited to: PRASHANT DHEER. Downloaded on August 29,2023 at 16:17:25 UTC from IEEE Xplore. Restrictions apply.