Quick viewing(Text Mode)

A Component-Based Software Development Platform for Rapid Prototyping of Embedded Software

A Component-Based Software Development Platform for Rapid Prototyping of Embedded Software

A Component-Based Development Platform for Rapid Prototyping of

Advisor: Prof. Jun Wu

Student: Chong-Fa Hsu

A thesis submitted to the

Department of Science and Information

of the National Pingtung Institute of Commerce

in partial fulfillment of the requirements

for the Degree of Master of Information Engineer

Pingtung, Taiwan, R.O..

July 2009

Acknowledgements

During these two years, I received a lot of assistance and encouragement from many people.

First of all, I must thank my supervisor Prof. Jun Wu. During the composition of the thesis, he provided me with great suggestions and enlightening viewpoints. Although I met with many setbacks which made me dejected in the of writing this thesis, he always en- couraged me to complete my work. so, without his patient guidance, timely correction, and excellent training, I could not finish the thesis. In particular, I wish to thank my committee members, Dr. Chi-Chou Kao and Dr. Lung-Jen Wang. Their professional corrections and suggestions made the thesis better. Additionally, I would like express my sincere gratitude to

Chia-Kang Lin, Chia-Wei Ko, and all real-time system laboratory members in the National

Pingtung Institute of Commerce. They always help me whenever I had problems or diffi- culties. Finally, I wish to give my deep apprecitation to my family for their endless support and encouragement during these two years.

Chong-Fa Hsu

Taiwan

July 2009

I

摘要

嵌入式軟體的開發與硬體平台有著高度的關聯性,由於嵌入式硬體

的種類逐日成長以及必須縮短上市時間的需求,嵌入式軟體的開發工作 也愈形複雜。為了能縮短嵌入式軟體的上市時間,採用快速應用程式開 發(Rapid Application Development, RAD)工具來進行嵌入式軟體開發的 需求日益增加。本論文將以元件式軟體開發(component-based )為基礎,提出一個嵌入式軟體開發工具(稱為 Builder for Embedded SofTware, BEST)。此工具包含軟體元件庫、應用程式樣板以 及一個視覺化的 RAD 工具。BEST 將提供開發者利用軟體元件以及應用 程式樣板的選擇以得到一個嵌入式軟體的雛型。此 外透過視覺化的 RAD 工具開發者亦能夠以 WYSIWYG 的方法來設計使用者圖形介面。利用 BEST 來開發嵌入式軟體將能大幅度的減少產品上市時間及開發成本。 本論文中,我們將詳細介紹 BEST 實作內容,並提供兩個 BEST 的應用 實例(使用者圖形介面的設計以及數位相框)來說明如何有效率且簡單的 開發嵌入式軟體。

關鍵字:嵌入式軟體開發、元件式軟體開發、快速軟體雛型。

II Abstract

The development of embedded software is getting more complicated and costly due to the proliferation of various hardware platforms and a shorter time-to-market requirement. It provides a strong driving force in rapid application development (RAD) tools for embedded software. In this thesis, a component-based development tool, called Builder for Embed- ded SofTware (BEST), is presented to provide an efficient and easy way to build embedded software. BEST consists of a component repository, application templates, and a visualized

RAD tool. In particular, developers can select and configure an application template and a set of components to obtain a prototype of the embedded software by using BEST. Further- more, developers can also design graphic interface in a WYSIWYG way by using our visualized RAD tool. As a result, BEST can help developers to reduce time-to-market and costs for developing embedded software. In this thesis, we will introduce the detail of the of BEST and provide example applications, such as a guide for demonstrat- ing the usage of our proposed development tools, MP3 player and digital photo frame, which were developed by BEST to illustrate the efficiency of the development of embedded software.

Keywords: Embedded Software Development,Component-Based Software Development,

Rapid

III Contents

1 Introduction 1

2 Related Work 4

2.1 Embedded Microprocessors and Real-Time Operating Systems ...... 4

2.2 Embedded Software Development Tools ...... 7

2.2.1 Integrated Development Environment (IDE) Tools ...... 7

2.2.2 Component-Based Software Development (CBSD) Tools ...... 8

2.2.3 Model-Driven Development Tools ...... 11

2.3 Motivations ...... 12

3 BEST Framework and System Design 15

3.1 Overview ...... 15

3.2 Software Paradigm ...... 17

3.3 Component and Component Repository ...... 20

3.4 Embedded Software Template and Its Layout ...... 20

3.5 User Interface Description Language ...... 24

IV 4 BEST Development Environment and Its Implementation 25

4.1 Platform Architecture ...... 25

4.2 Visualized Development Tool ...... 27

4.2.1 Component Repository ...... 28

4.2.2 Editor ...... 28

4.2.3 Code Generation ...... 29

4.2.4 and Deployment ...... 30

5 Case Studies 32

5.1 Case 1: Guide Example ...... 32

5.2 Case Study 2: Digital Photo Frame ...... 38

5.3 Case Study 3: MP3 Player ...... 43

6 Conclusion and Future Work 47

V List of Figures

1.1 A typical cross development environment for embedded software...... 2

2.1 PXA27x processor diagram...... 5

2.2 Multi 2000 integrated development environment...... 8

2.3 Embest integrated development environment...... 9

2.4 Domingo integrated development environment...... 10

2.5 The architecture of microCommander...... 11

2.6 The architecture of SLIME...... 11

3.1 Software development procedures of BEST (1) ...... 16

3.2 Software development procedures of BEST (2) ...... 17

4.1 The architecture of BEST ...... 26

4.2 Rapid application development (RAD) tool ...... 27

4.3 A typical architecture of component...... 29

4.4 Code editor ...... 30

4.5 Compiling and its results...... 31

VI 5.1 The initial screen of RAD tool...... 33

5.2 Change the background color and the caption of the working panel...... 33

5.3 Select software components into the working panel...... 34

5.4 Change attributes of a selected component...... 34

5.5 The dialog for naming the embedded software...... 35

5.6 The code translation and generation results...... 35

5.7 Coding the software in the code editor...... 36

5.8 The compilation success dialog...... 37

5.9 The execution result of the software...... 38

5.10 Design user interfaces of the digital photo frame...... 39

5.11 The navigation button for the photo-displayer...... 39

5.12 Select photos for the photo-displayer component...... 40

5.13 The code translation and generation of the digital photo frame...... 40

5.14 The compilation of the digital photo frame...... 41

5.15 Execution of the digital photo frame software...... 41

5.16 The execution result of the digital photo frame...... 42

5.17 The manipulation of the digital photo frame...... 42

5.18 Design the user interfaces of the MP3 player...... 43

5.19 Select songs for the MP3 playlist component...... 44

5.20 MP3 playlist component shows the selected songs...... 44

VII 5.21 The code translation and generation of the MP3 player...... 45

5.22 The compilation of the MP3 player...... 45

5.23 The execution result of the MP3 player...... 46

VIII Chapter 1

Introduction

The fast growing market for has large implications for software develop- ers. The development of embedded software is getting more complicated and costly due to the proliferation of various hardware platforms and a shorter time-to-market requirement.

Typically, a cross development environment, as shown in Figure 1.1, is needed for developing embedded software. Cross development environment consists of cross development software tools running on a general-purpose computer, called host, and debug channel from host to the embedded device, called target. In particular, cross development means editing and com- piling software on the host and then downloading the software to the target, and it on both host and target. In comparison with traditional software development on PCs, it creates difficulties and inconveniences to the embedded software developers.

Many excellent development tools for developing embedded software have been proposed

[2, 34, 40, 24, 28] to help developers to design and build embedded software without frequently switching the host and the target for editing, compiling, and debugging codes. However, it is still not an easy job for developing embedded software. Embedded software developers need to study the basic knowledge related to the microprocessor organization and interfacing

1 Edit and Compile

Download

Development software tool Target board

Host PC

Debug channel

Figure 1.1: A typical cross development environment for embedded software.

(e.g., Flash/SRAM/SDRAM/Catch, UART, Timer, GPIO, USB, etc.), understand the CPU architecture, instruction set, programming modes, and of operating systems (e.g., interrupt, priority, memory management, inter-task communication and synchronization, etc.). Developers also need to be familiar with C, C++ and programming.

It provides a strong driving force in rapid application development (RAD) tools for developing of embedded software. It also motivates us to work towards this direction. In this thesis, we will present an embedded software development tool, called Builder for Embedded

SofTware (BEST), to help developers to reduce the difficulties, inconveniences, costs, and the development time for developing embedded software. BEST consists of a component repository, application templates, and a visualized RAD tool. In particular, developers can select and configure an application template and a set of components to obtain a prototype of the embedded software by using BEST. Furthermore, developers can also design graphic

2 user interface in a WYSIWYG way by using our visualized RAD tool. As a result, BEST can help developers to reduce time-to-market and costs for developing embedded software. In this thesis, we will introduce the detail of the implementation of BEST and provide example applications, such as design of graphic user interface and a digital photo frame, which were developed by BEST to illustrate the efficiency of the development of embedded software.

The major contributions of this research are three folds: (1) We propose a visualized

RAD tool, called Builder for Embedded SofTware (BEST), to help developers for building applications with graphic user interface in a WYSIWYG way. (2) We also propose a set of application templates for providing rapid software prototypes to developers. As a result, the development time of embedded software could be reduced significantly. (3) Our proposed development tools provides an integrated development environment (IDE) to help developers to edit and build software in a convenient way without switching between the host and the target frequently.

The rest of this thesis is organized as follows: Chapter 2 summarizes related work con- cerning techniques of software development and discusses embedded software development costs. Such a problem motivates this research work. Chapter 3 presents a embedded soft- ware development tool, called BEST. System architecture and design will be introduced.

Chapter 4 will introduce the implementation of BEST in detail. Chapter 5 provides two example applications to illustrate how to develop embedded software efficient and easily by

BEST. Chapter 6 is the conclusion.

3 Chapter 2

Related Work

Although a number of excellent embedded software development tools have been proposed

[2, 34, 40, 24, 28], previous work mainly focuses on providing an integration environment for editing, compiling, and debugging codes, e.g., [2, 34, 40]. Little work has been done in ex- ploring the high level abstraction of the development process for embedded software. In this thesis, we will propose a component-based [9] and template-based [7] software development approach for rapid prototyping of embedded software.

In the rest of this chapter, we will summarize related work in software development tools and methodologies for developing embedded software. Embedded operating systems and graphical user interfaces will be also introduced.

2.1 Embedded Microprocessors and Real-Time Oper- ating Systems

Embedded systems based on 8-bits single-chip microcontroller/microprocessors, such as intel

8051, Zilog Z80 and Motorola 6800, have been used in many application domains. However,

4 LCD

RTC

OS Timers

4 x PWM

Interrupt Controller Memory s Control u 3 x SSP Quick B Internal LCD a Capture at SRAM Controller D Interface d USIM Address and n a Data s re d 2 d I S A

AC 97 Variable ASIC

DMA Latency I/O Standard G Control UART Controller e n s and Bridge re Full- u a B System Bus -l l P a u UART er Socket 0 pr h o p es Bluetooth ri e /I UART P PC O XCVR

Card/Compact Fast Socket 1 Flash Infrared

I2C

USB nI et Client ®r Intel Xscale ® SDRAM/ Controller W Dynamic i Core Boot er Memory MSL l USB Host e ROM Interface s Control M Controller

M Keypad X

Interface T M

MMC/SD Debug

/SDIO Controller

Interface ROM/Fla Memory Static Memory sh/SRAM Static Control Interface Power USB On- 13 32.768 The-GO Management/C MHz kHz lock Control Osc Osc

Primary GPIO

JTAG

Figure 2.1: PXA27x processor block diagram. these 8-bits microcontroller/microprocessors can not meet the requirements of the current trend of embedded systems due to its limited functions. In the recent decade, embedded systems face to the requirements of many complex high-end applications (such as telecommu- nication, wired/wireless networking, multimedia, etc. ). The demand of high performance and more functionalities of embedded systems have been increased rapidly. As a result, many embedded systems are now equipped with modern 32-bits microprocessors, such as

ARM 7/9/10 [3] and XScale [22].

In this thesis, we will focus on one of the industry-leading embedded microprocessors

- Marvell XScale PXA27x [26] which is an implementation of the ARMv5TE architecture

5 without the floating point instructions. The PXA27x processor is an integrated system-

on-a-chip microprocessor for high-performance, low-power, portable, handheld and handset

devices. The PXA27x processor also supports Intel Wireless MMX integer instructions for

providing acceleration to audio and video processing. Figure 2.1 shows the block diagram

of a typical PXA27x processor. The diagram shows a primary system bus with the XScale

core attached, along with an LCD controller, USB host controller, and 256KB of internal

memory. The system bus is connected to a memory controller to allow communication with

external memory or other companion-chip devices. The PXA27x processor is also connected

to a DMA controller/bridge to allow communications with the on-chip . It also

supports many IDE interface devices, such as touch screen, 4X4 matrix Keypad, 10/100

Ethernet, Audio Line in/out, Mic in, Camera input, WLAN, SD/MMC card, and Bluetooth,

etc.

On the other hand, real time (RTOS) also plays a key role of embed- ded systems. An RTOS provides task scheduling/management, memory management, re- source management, and driver interfaces for I/O in addition to boot or BSP (board support package) firmware. Popular RTOSs for embedded systems include VxWorks [39],

Windows CE/Mobile [31], QNX [38], uC/OS [27], and Linux. By using RTOS, it is provides time-to-market acceleration compared to designing and coding a real-time executive from scratch, yet provides very direct and efficient interfacing between software applications and hardware platforms. Some RTOSs require licensing whereas Linux is freely available in a number of distributions and it can be tailored for developing embedded products. Hence, embedded real-time Linux becomes the most popular operating system for embedded sys- tems. In this thesis, we are also interested in developing embedded software by adopting

6 Linux as operating system.

2.2 Embedded Software Development Tools

The development of embedded software needs a cross development environment (CDE) to

edit, compile and debug code so that dedicated services can be provided in an embedded

system. A typical CDE was shown in Figure 1.1. Editing and compiling code on the host (i.e.,

a general-purpose computer ) and debugging embedded software both on the host and the

target (i.e., the embedded device). In comparison with traditional software development on

PCs, many difficulties and inconveniences will be created for developing embedded software in

a CDE. In the rest of this section, we will summarize related embedded software development

tools such as integrated development environment (IDE) tools, component-based software

development (CBSD) tools, and model-driven development tools.

2.2.1 Integrated Development Environment (IDE) Tools

There were many integrated development environments (IDEs) for developing or debug- ging embedded software have been proposed, such as ARM SDT [5], ARM ADS [2], Multi

2000 [20], Embest IDE for ARM [12], OPENice32-A900 [36], Multi-ICE [4], and Domingo [34].

Figures 2.2, 2.3, and 2.4 show the snapshots of Multi 2000, Embest IDE, and Domingo, re- spectively.

These tools provide integration environments to help developers build embedded software without frequently switching the host and the target for editing, compiling, and debugging code. However, the basic knowledge of microprocessor, real-time operating system, pro- gramming languages (e.g., assembly, C, and C++) still required for developing embedded

7 Figure 2.2: Multi 2000 integrated development environment. software. It creates difficulties for developing embedded software so that the development time and cost will be increased. Little work has been done in exploring the high level ab- straction of the development process for embedded software. In the following subsections, we will summarize some high level abstraction methods for developing embedded software.

2.2.2 Component-Based Software Development (CBSD) Tools

By adopting high level abstraction methods in developing embedded software, important goals such as and reliability could be gained, and it will provide more efficient and convenient, and the same time, the costs and time-to-market can be reduced greatly. In the recent years, several researchers have done excellent work for developing embedded soft- ware based on high level abstraction development methods. In particular, microCommander

(mCommander) [29] and SCREAM Linux for embedded systems (SLIME) [16] are tools for developing embedded software which are based on component-based software development.

8 Figure 2.3: Embest integrated development environment.

Intec proposed microCommander (mCommander) [29] to develop embed- ded control software for network-centric systems. The mCommander consists of two major parts which are microVisual (mVisual) and microTarget(mTarget), as shown in Figure 2.5.

The mVisual and mTarget are executed on a PC and an embedded single board computer

(SBC), respectively. Embedded software can be built by mVisual on a PC and be executed by mTarget on an embedded SBC. The communications between the PC and the embed- ded SBC are also handled automatically by mCommander via TCP/IP or serial port. In addition, mCommander supports various sensors and relays to monitor and to control other system. Typical examples of mCommander include home automation, data acquisition, ir- rigation control, municipal control and monitoring systems, lighting control, manufacturing automation, HVAC control, and process monitoring and control.

Unlike mCommander only focus on network-centric embedded control software, SCREAM linux middleware for embedded systems (SLIME) [16] supports the development of multi-

9 Figure 2.4: Domingo integrated development environment. media embedded software which are executed on embedded systems with embedded Linux operating system. SLIME was proposed by SCREAM laboratory at National Cheng Kung

University. SLIME is a component-based platform and middleware for building and running embedded software applications. Developers can use SLIME development tool to design ap- plications by choosing and configuring proper components. The generated applications can be executed by SLIME middleware on a Linux-based embedded hardware platform. Fig- ure 2.6 shows the architecture of SLIME. Although mCommander and SLIME both provide efficient and convenient way for developing embedded software, they still need a middleware for executing the developed embedded software on the embedded hardware platform. Fur- thermore, the applications of mCommander and SLIME are limited in embedded control software and embedded multimedia software, respectively.

10 Applications mVisual microCommander Software mTarget

Sensors

Communication Internet / LAN / Serial Relays

Integrated by Integrated by other microCommander

Figure 2.5: The architecture of microCommander.

Component Used Repository Components Binding Output SCREAM linux middleware

selection

Multimedia SLIM Development Application Tool

Figure 2.6: The architecture of SLIME.

2.2.3 Model-Driven Development Tools

High-level specification language, such as SDL [35], state charts [17], Petri nets [42], UML collaboration diagrams [1], and UML sequence diagrams [25] have proven useful abstrac- tions for analyzing requirements and designing software. However, there is still a significant chasm between such high-level formalisms and actual implementation in terms of low-level programming languages, when an embedded software is developing. Hence, we need a tool to help developers to translating high-level specifications (represented by diagrams) into low-level code. As astute readers may point out that a similar gap in the devel- opment process existed for general , and it has been narrowed with the

11 introduction of higher-level component-based language platforms (e.g., Microsoft .Net [30]

and Enterprise Java Bean (EJB) [32]) and the development of model-driven code gener-

ation mechanisms [11]. Analogous approaches for narrowing the gap between design and

implementation of embedded software were proposed for developing embedded software. In

particular, Childs et al. [8, 18] have propose a model-driven approach, called Cadena, to

support the definition, validation and synthesis of component-based, distributed, real-time,

embedded software from high-level structural and behavioral models. Intec Automation

also proposed a model-driven approach, called microSynergy (mSynergy) [23], to help de- velopers design and implement embedded software. mSynergy is based on the model driven architecture (MDA) [21] paradigm for developing distributed embedded control systems.

2.3 Motivations

Traditionally, the primary concerns while developing software for embedded systems have been maximizing run-time and memory efficiency in order to minimize hardware costs. Due to continuously decreasing hardware costs and the increasing complexity of applications ex- ecuted by embedded systems, other goals like maintainability, reliability, and how to reduce the time-to-market gained great importance. Unfortunately, current industrial development practices for embedded software lag behind the state-of-the-art in other software engineering areas. Despite all the progress made in the general software engineering arena, much embed- ded software is still being developed at a low level of abstraction, using primitive program- ming languages like assembler and C. This development practice is inefficient for complex systems because it impedes software reuse and maintenance. Moreover, it is human-intense, requires a significant amount of experience, and is prone to error. Hence, well-deigned soft-

12 ware development tools are needed for developing modern embedded software for providing multimedia, networking, and others services. Such observations motivate this research to propose an efficient, low-cost, and easy-to-use development tool for developing embedded software.

To cope with the objective of this research, software development practices for tradi- tional software, component-based software development (CBSD) [9], object-oriented lifecycle model [19], rapid software prototyping [6], contract-based development (CBD) [10] and agent- oriented software development [37], etc. , could be adopt for applying to the development of embedded software. Particularly, Kuo [41] suggested that CBSD is very suitable for develop- ing embedded software because it provides flexibility, , and ease of composition or reuse. Previous work, such as mCommander and SLIME, provide solutions to this chal- lenging research topics. However, mCommander and SLIME both need a middleware kernel to execute software on the embedded target board, and it will increase the footprint of the embedded software. Furthermore, mCommander and SLIME are designed mainly for embedded control systems and embedded multimedia software, respectively.

In this thesis, we will propose a novel component-based and template-based [7] software development approach for rapid prototyping of embedded software. Instead of providing a middleware to execute embedded software, we will generate an prototype of embedded software that can be executed on the target (i.e., embedded single board computer) directly. The executable prototype is generated by an embedded software template which is a predefined software sketch. We will present an embedded software development tool, called Builder for Embedded SofTware (BEST), which consists of a component repository, application templates, and a visualized RAD tool. Developers can select and configure an

13 application template and a set of components to obtain a prototype of the embedded software by using BEST. As a result, the development time and costs could be reduced and a smaller footprint could be obtained.

14 Chapter 3

BEST Framework and System Design

In this chapter, we describe the system architecture with component-based and rapid pro- totyping methodologies. We also present the embedded software paradigm and embedded software template of BEST. Then, user interface description language is also introduced.

3.1 Overview

This thesis combines component-based software development (CBSD) [9] and rapid software prototype (RSP) [6] to build software component specifications architecture and component repository to reducing development time of embedded software. Figure 3.1 shows the proce- dure of developing embedded software by BEST. We use Java program language to design a visualized rapid application development (RAD) tool. This RAD tool includes software component repository, attribute list of software component and an integrate development environment(IDE). We propose a simple embedded software development method, we de- sign and build a minimal core system (based-on Linux Kernel 2.6.15), component repository

15 Component Repository Visual RAD Tool Application Template

Combination Output

Minimal Core System (Linux kernel 2.6 and Configure device drivers) Software Prototype

Compiler/Execution

Hardware Platform

Figure 3.1: Software development procedures of BEST (1)

and application template for developers. According to RAD tool, developers can design embedded software with graphic user interface fast and simply by selecting and combining used software component only if make hardware/software configuration.

Figure 3.2 shows the generation of embedded software program. When developers com- plete the design of embedded software at visualized RAD tool, the BEST will generate a user interface description file. This file saves attributes of software component that designed by developers. Then, BEST reads the user interface description file, and according to compo- nent specifications to inserting related program code of embedded software component into application template. Last, this template is a complete embedded software program code.

16 RAD Tool Embedded Software User Interface Code Description File Component Used Repository Components

selection Write Generate

Compile/Download

Target Board

Figure 3.2: Software development procedures of BEST (2)

3.2 Software Paradigm

In this thesis, we use Minigui [14] as primary to developing embed- ded software. MiniGUI is a cross-operation-system Graphic User Interface (GUI) support system for embedded system. There are three runtime environment supported in MiniGUI,

MiniGUI-Threads, MiniGUI-Processes and MiniGUI-Standalone. The program architecture of MiniGUI is shown as below:

MiniGUI is a one- program system, it have a main widget and this main widget is a while loop to waiting for message to process. The function MiniGUIMain is the of program, this function declare attributes of primary widget, and it create function HelloWinProc to processing all kinds of event. The function HelloWinProc can create software component and process component events, it is the mainly function to process all kinds of event. The component creating and component event is locate at function

HelloWinProc, switch case, case MSG PAINT and case MSG COMMAND, respectively.

17 That’s mean, BEST will insert software component into this position at template.

1 . #i n c l u d e 2 . #i n c l u d e 3 . #i n c l u d e 4 . #i n c l u d e 5 . #i n c l u d e 6 . #i n c l u d e 7. #define IDC BUTTON 100 8. #define IDC RADIOBUTTON 200 9. #define IDC CHECKBOX 300 10. #define IDC LISTBOX 400 11. #define IDC EDIT 500 12. static int HelloWinProc (HWND hWnd, int message , 13. WPARAM wParam , LPARAM lParam ) 14. { 15. switch ( message ) 16. { 17. case MSG PAINT: 18. //object create 19. return 0 ; 20. case MSGCOMMAND: 21. switch (wParam) 22. { 23. //object event 24. } 25. case MSG CLOSE: 26. DestroyMainWindow (hWnd); 27. PostQuitMessage (hWnd);

18 28. return 0 ; 29. } 30. return DefaultMainWinProc(hWnd, message , wParam, lParam); 31. } 32. int MiniGUIMain ( int argc , const char∗ argv [ ] ) 33. { 34. MSG Msg ; 35. HWND hMainWnd ; 36. MAINWINCREATE CreateInfo ; 37. CreateInfo.dwStyle = WS VISIBLE | WS BORDER | WS CAPTION; 38. CreateInfo.dwExStyle = WS EX NONE; 39. CreateInfo.spCaption = ”MiniGUI architecture”; 40. CreateInfo.hCursor = GetSystemCursor(0); 41. CreateInfo.hIcon = 0; 42. CreateInfo.MainWindowProc = HelloWinProc; 43. CreateInfo.lx = 0; 44. CreateInfo.ty = 0; 45. CreateInfo.rx = 640; 46. CreateInfo.by = 480; 47. CreateInfo.iBkColor = COLOR green ; 48. CreateInfo.hHosting =HWND DESKTOP; 49. hMainWnd = CreateMainWindow (&CreateInfo); 50. i f (hMainWnd = = HWND INVALID) 51. return −1; 52. ShowWindow(hMainWnd, SWSHOWNORMAL) ; 53. while ( GetMessage(&Msg , hMainWnd) ) 54. { 55. TranslateMessage(&Msg); 56. DispatchMessage(&Msg); 57. }

19 58. MainWindowThreadCleanup (hMainWnd); 59. return 0 ; 60. } 61. #i f n d e f LITE VERSION 62. #include 63. #e n d i f

3.3 Component and Component Repository

BEST provides software component repository for developers to developing embedded soft- ware. Developers can select and combine used software components to build embedded soft- ware. A software component is a graphic user interface object of embedded software, such as button, list, check box, radiobutton, label, textfield and etc. We also build some software applications as software components, such as picture-frame, mp3-list, mp3 play-button, pic- ture play-button. When developers complete design of embedded software, BEST will write the attributes of used software component into the user interface description file. Then,

BEST read the information of used software component at user interface description file to generating embedded software program code.

3.4 Embedded Software Template and Its Layout

In BEST environment, developing of embedded software is based on embedded software template. The embedded software template has basic program code architecture of embedded software. When developers complete the design of embedded software at RAD tool, BEST will insert the embedded software program code of used software component into software

20 template at related position and generate the complete embedded software program code.

The BEST embedded software template is shown as below:

The embedded software template is coding at MiniGUI, and it has the basic program architecture of embedded software, we will fill with embedded software program code to complete embedded software (i.e. the template just has main widget and we will insert program code of software component into related position). We make the special mark in related position at template, such as //digital photo, //mp3, //photo file, //digital photo component, //new component, //component color, //component event, //Caption and etc.

When BEST reads information of software component from user interface description file to generating embedded software program code, these positions of special mark is the re- lated position that BEST will insert embedded program code of used embedded software component.

1 . #i n c l u d e 2 . #i n c l u d e 3 . #i n c l u d e 4 . #i n c l u d e 5 . #i n c l u d e 6 . #i n c l u d e 7. #define IDC BUTTON 100 8. #define IDC RADIOBUTTON 200 9. #define IDC CHECKBOX 300 10. #define IDC LISTBOX 400 11. #define IDC EDIT 500 12. //digital photo 13. //mp3

21 14. //photo file 15. //mp3 f i l e 16. static int HelloWinProc (HWND hWnd, int message , 17. WPARAM wParam , LPARAM lParam ) 18. { 19. switch ( message ) 20. { 21. case MSG PAINT: 22. //digital photo component 23. //mp3 component 24. //new component 25. //component color 26. return 0 ; 27. case MSGCOMMAND: 28. switch (wParam) 29. { 30. //component event 31. //digital photo event 32. //mp3 event 33. } 34. case MSG CLOSE: 35. DestroyMainWindow (hWnd); 36. PostQuitMessage (hWnd); 37. return 0 ; 38. } 39. return DefaultMainWinProc(hWnd, message , wParam, lParam); 40. } 41. int MiniGUIMain ( int argc , const char∗ argv [ ] ) 42. { 43. MSG Msg ;

22 44. HWND hMainWnd ; 45. MAINWINCREATE CreateInfo ; 46. CreateInfo.dwStyle = WS VISIBLE | WS BORDER | WS CAPTION; 47. CreateInfo.dwExStyle = WS EX NONE; 48. //window caption 49. CreateInfo.hCursor = GetSystemCursor(0); 50. CreateInfo.hIcon = 0; 51. CreateInfo.MainWindowProc = HelloWinProc; 52. CreateInfo.lx = 0; 53. CreateInfo.ty = 0; 54. CreateInfo.rx = 640; 55. CreateInfo.by = 480; 56. //window bkColor 57. CreateInfo.hHosting =HWND DESKTOP; 58. hMainWnd = CreateMainWindow (&CreateInfo); 59. i f (hMainWnd = = HWND INVALID) 60. return −1; 61. ShowWindow(hMainWnd, SWSHOWNORMAL) ; 62. while ( GetMessage(&Msg , hMainWnd) ) 63. { 64. TranslateMessage(&Msg); 65. DispatchMessage(&Msg); 66. } 67. MainWindowThreadCleanup (hMainWnd); 68. return 0 ; 69. } 70. #i f n d e f LITE VERSION 71. #include 72. #e n d i f

23 3.5 User Interface Description Language

An User Interface Description Language (UID) is a computer language used to describe a software component’s interface. In BEST, the UID is adapted to describe the component’s attributes. We define some specifications to specify the UIDs for components. An example of our abstract UID file is shown as below:

Line1 means the definition of software components, and line2 line4 are the attributes of software components. The first token of line is the number of component. The second token of line is the title of component, third token and fourth token are the x-coordinates and y-coordinates of component, respectively. And fifth token and sixth token represent length and wide of component,respectively. Line5 line7 represent the color of components. Last, line6 and line7 are the caption and background color of main widget.

1. HWND button0 , list0 ,combobox0; 2. button0,play,23,34,54,67 3. list0 ,null,46,79,60,60 4. combobox0,null ,69,120,60,60 5. button0 ,red ,button0 6. list0 ,yellow,list0 7. combobox,green ,combobox 8. window caption ,BEST 9. window bkColor, green

24 Chapter 4

BEST Development Environment and Its Implementation

In this chapter, we will present BEST development environment and its implementation.

We will introduce the hardware architecture of target board, a visualized development tool, and component repository. The code editor, generator, compiler, and how to deploy the generated embedded software on the target board will be illustrated.

4.1 Platform Architecture

In this thesis, we are interested in developing of embedded software on the PXA27x-based embedded target board. An target board, which is released by Microtime Computer Inc[33], consists of a Marvell PXA270 microprocessor, 2MB FlashMemory, 16MB SDARM, EPROM,

UART, Ethernet, USB1.1, I2C, Codec, CMOS Camera, Keypad, LED, 7-Seg, DIP Switch and LCD.

However, embedded system has few resource such as memory can be used, so we only

25 load some necessary drivers and libraries and make configuration the system requires to keep the operating system to be . By the same reason, we also simplify the Root File System enough to run system. We only reserve some files such as /dev, /proc, /bin, /etc, /lib, /usr,

/tmp and etc, and basic tool in shell such as ls, cp, mv, ps and etc. And some configuration

files such as rc, inittab and fstab we reserve too.

Figure 4.1 shows the platform architecture, we use Linux Kernel 2.6.15 as operating system. We prepare hardware drivers that is needed by IDE interface devices. Lower-level software libraries is also needed for compiling embedded software program code. Beside, we use MiniGUI as graphic user interface of embedded software. Before developing embedded software by BEST, IDE interface devices at target board also should be prepared, they are required by embedded software that will be developed by BEST. Then, BEST can use system-calls and process management binds with applications to build an embedded software.

BEST Applications

IDE Interface Devices

MiniGUI

Lower-level Software Libraries Hardware Drivers

Linux Kernel 2.6.15

Embedded Hardware

Figure 4.1: The architecture of BEST

26 4.2 Visualized Development Tool

Typically, the development of embedded software requires low-level knowledge of embedded hardware and low-level skill in assembly programming or C programming language. In this thesis, we will propose a visualized rapid application development (RAD) tool for providing developers an easy way to build embedded software. The proposed tools are developed by a high-level object-oriented programming language, i.e., Java program language. Develop- ers can build GUI for embedded software in a WYSIWYG way, and generates a software prototype based on software templates. It could reduce the development time for rookies of embedded software developers. We also provide the code editing and compiler environment.

Developers can revise the code, which is generated based on software template, for further requirements.

Component Repository

GUI Design Panel

Attribute Table

Figure 4.2: Rapid application development (RAD) tool

27 4.2.1 Component Repository

The component repository in BEST is a collection of software components. Developers can select and configure those components to build an embedded software. Note that a component can be a software function or a graphic user interface. By using BEST, the development of an embedded software can be divided into two phases. First, our proposed visualized RAD tool can help developers to build graphic user interface. And the proposed tool will generate all necessary code for the generated embedded software prototype. On the other hand, a BEST component can be treated as a programing or function. Each component is followed by the model-view-controller (MVC) [13], as shown in Figure 4.3. The model and view are a collection of related data items (i.e., attributes of a component) and the graphic user interface of the component, respectively. The controller is the operations of specific purposes of the component.

The implementation of BEST components is described as follows: each BEST component is a class in Java programming language whose data fields are the , and view is implemented by Java Foundation Classes Swing and MiniGUI on the host and target, respectively. The controller is implemented as methods in the Java codes.

4.2.2 Editor

BEST integrates embedded software development environment and provide a coding environ- ment for developers. Traditional, developers always use an editor to edit embedded software programming code. Figure 4.4 shows the edit environment, developers just need to double click the software component designed by developers at BEST tool to edit software functions rather than use another editor. For developers, it’s more convenient to develop embedded

28 Event

Event is passed to the Controller

Controller

Controller changes View Controller changes Model

View Model View get data from Model Model updates View when data changes

Figure 4.3: A typical architecture of component. software, when they transfer software prototype designed by themselves into embedded soft- ware programming code, and double click software component. The BEST tool will pop out a window including programming code that transferred, and developers can edit on this window that can save some embedded software development time.

4.2.3 Code Generation

The goal of BEST is to generate a object file, and this object file can be executed at embedded target board. Therefore, when developers complete design graphic user interface or embedded software by BEST, BEST will generate a user interface description file, this file have the information of graphic user interface or embedded software designed by developers. Then,

BEST provides the embedded software template, according to the user interface description

file, BEST will read the file information of user interface description and write graphic user

29 Working Panel

Code editor

Figure 4.4: Code editor interface code or embedded software code into embedded software template. By this way,

BEST can generate a embedded software code.

4.2.4 Compiler and Deployment

When developers complete the design of graphic user interface or embedded software. BEST also provides a environment to compiling codes. But the instruction at embedded systems is different to common PC, so we need a cross-compiler tool to compile embedded software program. We install arm-linux-toolchain [15] at host PC and use system-call to compile code. After compiling code we will obtain a object file at file system of embedded target board, this file can be executed at embedded target board. Then, developers can execute this object file to test the graphic user interface or embedded software designed by them.

30 Compiling

Working Panel Compiling and its result

Figure 4.5: Compiling and its results.

31 Chapter 5

Case Studies

In this chapter, three case studies will be proposed to demonstrate how to use our proposed tools to develop embedded software. Case study 1 is a guide for demonstrating the basic usage of our proposed development tools. Case 2 and 3 are two examples of typical embedded software which are digital photo frame and MP3 player, respectively.

5.1 Case 1: Guide Example

In this section, a guide example is provided to show how to design a graphic user interface for an embedded software by BEST in a WYSIWYG way. BEST is a java program which can be executed in any operating systems. However, we recommend that to execute BEST in

Linux operating system due to most cross development environment are based on Linux. To develop a new embedded software via BEST, the first step is to start the execution of BEST via the JVM on your operating platform. Figure 5.1 shows the initial screen of the RAD tool of BEST. As you can see that the up-left side and the bottom-left side of the RAD tool is the component repository and the attribute list of the selected component, respectively. In the

32 Figure 5.1: The initial screen of RAD tool.

center of the RAD tool is the working panel which is the main window of the to-be-developed embedded software. The developer can customized the resolutions of the working panel for different hardware environments, i.e., 640x480 for a 10” LCD and 240x320 for a 3.5” LCD.

By manipulating of the attribute list, the context of a selected component, as well as the working panel, can be changed. Figure 5.2 shows the background color and the caption of the working panel are changed by changing the values in the attribute list.

Figure 5.2: Change the background color and the caption of the working panel.

33 Figure 5.3: Select software components into the working panel.

The developer can select components from the component repository and drag them into the working panel to build the user interface. Figures 5.3 and 5.4 show four components which are dragged into the working panel, and change their attributes in the attribute list.

Figure 5.4: Change attributes of a selected component.

34 Figure 5.5: The dialog for naming the embedded software.

When a developer finish the design of the user interface, it can be saved and translated into the corresponding of the embedded software. Figure 5.5 shows a dialog for naming the embedded software and its directory. The successful message will be prompted after the translation is done, as shown in Figure 5.6. Note that this translation is done by our predefined template as mentioned in Chapter 3.

Figure 5.6: The code translation and generation results.

35 Figure 5.7: Coding the software in the code editor.

The generated code is based on the predefined template which may not fit the developer’s requirements. The developer only need to double click the component to edit source code related to the component. For example, editing the event handler of the component, as shown in Figure 5.7.

The embedded software can be compiled in BEST by select the compiler function from the menu bar, after the developer finish his/her editing of the generated source code. Fig- ure 5.8 shows the compile result of the software.

36 Figure 5.8: The compilation success dialog.

By the proper setting of the development environment1, the compiled software can be executed directly on the target board. Figure 5.9 shows the execution result. As you can see that the software running on the target board is exact the same as the developed software in BEST.

1Mount a host directory into the target board as its root directory by NFS.

37 Figure 5.9: The execution result of the software.

5.2 Case Study 2: Digital Photo Frame

In this section, we demonstrate how to develop a prototype of an embedded software easier and conveniently. The demonstrated software is a digital photo frame which can display a collection of photos with navigated buttons.

To build a digital photo frame is quiet easy in BEST. The first step is to select and drag a photo displayer component into the working panel. Note that you can also adjust the size of the component according to original size of photos. Figure 5.10 shows the screen shot in

38 this step.

Figure 5.10: Design user interfaces of the digital photo frame.

We also provide a component, called navigation button, to control the display of the photo displayer component, as shown in Figure 5.11. However, the relationship between these two component must be set in the attribute list. The next step is to select photos which will be displayed in the photo displayer component, as shown in Figure 5.12. This step can be done by double click on the photo displayer component.

Figure 5.11: The navigation button for the photo-displayer.

39 Figure 5.12: Select photos for the photo-displayer component.

Figures 5.13 and 5.14 show the translation and compilation procedures by the same manipulation methods which were mentioned in the previous section.

Figure 5.13: The code translation and generation of the digital photo frame.

40 Figure 5.14: The compilation of the digital photo frame.

Figures 5.15, 5.16 and 5.17 show the execution results of the digital photo frame software.

Note that the manipulation in the Figure 5.15 is done via the terminal windows of the target board.

Figure 5.15: Execution of the digital photo frame software.

41 Figure 5.16: The execution result of the digital photo frame.

Figure 5.17: The manipulation of the digital photo frame.

42 5.3 Case Study 3: MP3 Player

In this section, we demonstrate how to build a MP3 player by using BEST. To build a MP3 player, the first step is to select and drag a MP3 playlist component into the working panel.

Figure 5.18 shows the screen shot in this step. A control component for the MP3 player is also provided which support operations include play, stop and pause.

Figure 5.18: Design the user interfaces of the MP3 player.

The next step is to select songs which will be listed in the MP3 playlist component, as shown in Figure 5.19. This step can be done by double click on the MP3 playlist component.

Figure 5.20 shows a screen shot where the MP3 playlist component has showed the selected songs.

43 Figure 5.19: Select songs for the MP3 playlist component.

Figure 5.20: MP3 playlist component shows the selected songs.

44 Figure 5.21: The code translation and generation of the MP3 player.

Figures 5.21 and 5.22 show the translation and compilation procedures by the same manipulation methods which were mentioned in the previous section.

Figure 5.22: The compilation of the MP3 player.

45 Figure 5.23 shows the execution results of the MP3 player software on the target board.

Figure 5.23: The execution result of the MP3 player.

46 Chapter 6

Conclusion and Future Work

In this thesis, we explored the design and implementation issues for an embedded software

builder, called Builder for Embedded SofTware (BEST), to provide developers an easy-to-use and convenient way to build embedded software. The proposed BEST provides a visualized

RAD tool to help embedded software developers to design graphic user interface by a WYSI-

WYG way. Based on the components we provided, developers can configure and generate source code based on embedded software template, and to editing as their requirements.

BEST also provide an integrated development environment to editing, compiling and exe- cuting in the same environment, so that the frequent switching between the host and the target can be avoided.

For the future research, we shall further explore the possibility in increasing more ap- plication templates and software components. We will try to reducing the pre-work on development platform. In this thesis, BEST is mainly built for PXA27x-based embedded target board, and in the further we will also expect BEST can work on the other embed- ded target boards. Embedded software development is also an important topic for future embedded system. We will work on such a direction.

47 Bibliography

[1] Aynur Abdurazik and Jeff Offutt. Using uml collaboration diagrams for static checking and test generation. page 383. Third International Conference, York, UK, Vol. 1939 / 2000, 2003.

[2] ARM. Arm developer suite. http://www.arm.com/products/DevTools/ADS.html.

[3] ARM. processor overview. http://www.arm.com/products/CPUs/index.html.

[4] ARM. Realview multi-ice. http://www.arm.com/products/DevTools/MultiICE.html.

[5] ARM. Software development toolkit. http://www.arm.com/support/sdt.html.

[6] Lowell Jay Arthur. Rapid Evolutionary Development: Requirements, Prototyping and Software Creation. Wiley, December 1991.

[7] Yunfei Jiang Mingzhi Mao Bin Kong, Xiaonan Luo. Template-based software process improvement. pages 175–180. Journal of Information and Computational Science, July

2004.

[8] Adam Childs, Xianghua Deng, Matthew B. Dwyer, Jesse Greenwald, John Hatcliff, Prashant Kumar, Georg Jung, Venkatesh Ranganath, Robby, and Gurdip Singh. Sup-

porting model-driven development of component-based embedded systems with cadena, 2003.

49 [9] Ivica Crnkovic. Component-based software engineering - new challenges in software

development. pages 9–18. In Proceedings of the 25th International Conference on In- formation Technology Interfaces, June 2003.

[10] Tom Holvoet David Urting, Stefan Van Baelen and Yolande Berbers. Embedded soft-

ware development: Components and contracts. pages 685–690. In Proceedings of the IASTED International Conference Parallel and and Systems,

2001.

[11] U. Eisenecker and K Czarnecki. Generative Programming: Methods, Tools, and

Applications. Addison-Wesley, 2000.

[12] Embest. Embest ide for arm. http://www.armkits.com/Product/idemain.asp.

[13] eNode. Model-view-controller pattern. http://www.enode.com/x/markup/tutorial/mvc.html.

[14] FMSoft. Minigui. http://www.minigui.com/product/cindex.shtml.

[15] gegereka. arm-linux-toolchain-bin. http://www.gegereka.com/?query=arm-linux- toolchain-bin.

[16] Yu-Hung Guo. An embedded middleware for component-based software development

and the development environment. Electronic Theses and Dissertations System, June 2007.

[17] David Harel. Statecharts: a visual formalism for complex systems. pages 231–274. Science of Computer Programming archive. Volume 8 , Issue 3, June 1987.

[18] John Hatcliff, Xinghua Deng, Matthew B. Dwyer, Georg Jung, and Venkatesh Prasad

Ranganath. Cadena: An integrated development, analysis, and verification environment for component-based systems. volume 0, page 160. Software Engineering, International

Conference on, 2003.

50 [19] Brian Henderson-Sellers and Julian M. Edwards. The object-oriented systems life cycle.

pages 142–159. Communications of the ACM, Vol. 33, Issue 9, September 1990.

[20] Green Hills. Green hills software launches second-generation multi 2000 integrated development environment. http://www.ghs.com/news/archive/990928m2k.html.

[21] IBM. An introduction to model driven architecture. http://www.ibm.com/developerworks/rational/library/3100.html.

[22] Intel. Intel xscale technology. http://www.intel.com/design/intelxscale/.

[23] Jens H. Jahnke. Engineering component-based net-centric systems for embedded appli- cations. volume 26, pages 218–228. SIGSOFT Softw. Eng. Notes, 2001.

[24] KEIL. Arm development tools. http://www.keil.com/arm/mdk.asp.

[25] Xuandong Li and J. Lilius. Checking compositions of uml sequence diagrams for timing inconsistency. volume 0, page 154, 2000.

[26] MARVELL. Applications processors. http://www.marvell.com/products/cellular/applications.jsp.

[27] micrium. gc/os-ii view. http://www.micrium.com/products/rtos/kernel/rtos.html.

[28] MICROCHIP. Hi-tech c . http://www.htsoft.com/products/.

[29] microCommander. microcommander tour. http://www.microcommander.com/index.htm.

[30] Microsoft. Microsoft .net. http://www.microsoft.com/NET/.

[31] Microsoft. Windows embedded ce overview. http://www.microsoft.com/windowsembedded/en-

us/products/windowsce/default.mspx.

[32] Sun Microsystems. Enterprise javabeans technology. http://java.sun.com/product/ejb.

[33] Microtime. Development learning platform. http://www.microtime.com.tw/English/english.htm.

51 [34] Microtime. Domingo ide. http://www.microtime.com.tw/product/Domingo.htm.

[35] Farber G Muth, A. Sdl as a system level specification language forapplication-specific hardware in a rapid prototyping environment. pages 157–162. The 13th International Symposium on Volume , Issue, 2000.

[36] OPENice32-A900. Aiji system. http://www.aijisystem.com/english/product/emulator/a900.htm.

[37] Fausto Giunchiglia John Mylopoulos Anna Perini Paolo Bresciani, Paolo Giorgini. Tro-

pos: An agent-oriented software development methodology. pages 203–236. Autonomous Agents and Multi-Agent Systems, Vol. 8, No. 3, 2004.

[38] QNX. Qnx neutrino rtos. http://www.qnx.com/products/.

[39] WIND RIVER. Vxworks. http://www.windriver.com/products/vxworks/.

[40] TASKING. Tasking vx-toolset for arm. http://www.tasking.com/products/.

[41] Wei-Chung Chou Wen-Yu Su Chung-Ping Young Yu-Hung Kuo, Ching-Hsiang Chuang

and Redtom Lin. The embedded middle and development environment using component-based software development approach. 2007 Conference on Innovative Ap- plications of System Prototyping and Circuits Design, 2007.

[42] Belhassen Zouari, Serge Haddad, and Mohamed Taghelit. A protocol specification lan- guage with a high-level petri net semantics. pages 225–241. Proceedings of the IFIP

WG10.3 International Conference on Decentralized and Distributed Systems, 1993.

52 Vita

Chong-Fa Hsu was born in Penghu, Taiwan in 1984. He was graduated from the Kaohsiung Municipal Tsoying Senior High School in Kaohsiung, Taiwan in 2002. He received a B.S. degree in the Department of Computer Science and Information Engineering from the

Leader University in Tainan, Taiwan in 2007. His resarch interests in embedded system applications.

53



© 2022 Docslib.org