592 Vol 04, Article 08146; September 2013
http://ijves.com
International Journal of VLSI and Embedded Systems-IJVES
ISSN: 2249 – 6556
Porting of Android OS with BSP Customization on NXP2120 Application Processor Platform V. HARI PRASAD1, ASHOK KUMAR YADAV2, K. RADHA3 1 2
Department of ECE, Gudlavalleru Engineering College, Andhra Pradesh, India Technical Manager, Electronics Corporation of India Limited, Hyderabad, India 3 Assistant Professor, Gudlavalleru Engineering College, Andhra Pradesh, India 1
[email protected],
[email protected],
[email protected]
ABSTRACT In the last few years, the need for compact and embedded systems has expanded incredibly in all fields. For this ARM development platform is the ideal and practical answer for planning a new product design. ARM platforms carry a generally positive result regarding speed, accuracy, adaptability, size and cost. In the present situation the embedded systems are doing a number of odd employments however not bounded for a specific assignment, for this the system must require an operating system. Every new embedded design, at the back an operating system must be modified appropriately for the specifications of the embedded target. In particular, this paper underlines the BSP (Board Support Package) customization of the Android operating system and porting mechanism of OS to NXP2120 Application Processor platform and at last exhibited an application on the ported Android operating system. Keywords: Embedded Systems, Android OS, ARM, Linux kernel, BSP Customization, Porting OS [1] INTRODUCTION The embedded systems become more popular in every field due to various features such as multiprocessing, multitasking and the special attributes which are inherited by the embedded technology as flexibility, reliability, cost, time, low power dissipation, software up gradation capability and speed. Various sectors like mobile communication, biomedical, automation, networking, aeronautics has increased the need of embedded systems. A variety of architectures are used for embedded systems according to the need such as ARM (Advanced RISC Machine) which is RISC (Reduced Instruction Set Computer) architecture. The combination of FPGA and ASIC in ARM architecture [1] delivers a flexible and optimal solution in terms of cost, time and speed. 2. TIMES DONE BY ANDROID The operating system designed for more specialized applications that demand response as close to real time as possible is called embedded operating system. One of the most commonly used embedded OS these days is Android [2]. Android is a software group, comprising not only OS but also key applications and middleware. Android Inc was founded in Palo Alto of California, U.S. by Andy Rubin, Rich miner, Nick sears and Chris White in 2003. Later on Android Inc. was acquired by Google in 2005. There are number of updates are released from the original version of Android. The next version of OS is Android 5.0 and it is named as Key Lime Pie. From a developer's point of view, Android is a Linux-based OS for smart phones and tablets and it includes a touch screen user interface, network data monitoring, camera, widgets and all the other features for the embedded device. Hardware that supports Android is mostly based on ARM architecture platform. Android is a powerful OS supporting a large number of applications by giving the extra favorable circumstances like sandbox, full memory protection and multi process operating system. There are some mobile platforms available today, incorporating iPhone, Blackberry, Symbian, Windows Mobile, Blackberry, and that's just the beginning. Despite the fact that a couple of its characteristics have shown up some time recently, Android is the starting environment that consolidates the following features: A truly open, free development platform: Developers like it since they can use and modify the platform without any paying. A component-based construction: Part of one application might be utilized as a part of another application, in ways aren't originally visualizing by the developer. We can even change incorporated parts with our own particular improved versions [3]. Automatic organization of the application life cycle: There is confinement given between the projects by different layers of security, by this a level of dependability was furnished not seen awhile ago in smart phones. The client will no more extended must be worried about what applications are enthusiastic or closing a few applications so others can run. Android is improved for low-memory, low-power devices in an essential manner that no prior platform has endeavored.
2013 – IJVES Indexing in Process - EMBASE, EmCARE, Electronics & Communication Abstracts, SCIRUS, SPARC, GOOGLE Database, EBSCO, NewJour, Worldcat, DOAJ, and other major databases etc.,
593 Vol 04, Article 08146; September 2013
http://ijves.com
International Journal of VLSI and Embedded Systems-IJVES
ISSN: 2249 – 6556
Portability over a huge range of present and future hardware: All our projects are in Java and executed by Android's DVM (Dalvik Virtual Machine), so our code will be compact crosswise over x86, ARM, and other architectures. 3. BOARD SUPPORT PACKAGE BSP (Board Support Package) is a specific support code (software) for a given target platform that conforms to a given operating system. It provides an abstraction layer between the OS and generic device drivers. BSP permits an OS to be easily ported to another target platform, in light of the fact that it enactments as a combination spot in the system of hardware dependent source code. A BSP furnishes subroutines to higher layers of software that can customize the hardware, and afford flexibility at compile time [4]. A BSP provides architecture specific configuration, device driver code, APIs to access standard device drivers. Some suppliers also provide a tool chain, a root file system for making programs to run on the embedded system, and configurations for the devices. BSP development and customization is a specialized job that requires in-depth understanding of a careful understanding of hardware, and bottomless knowledge of the OS internals. Android BSP includes the boot loader (U-Boot), kernel (Linux Kernel-2.6.32), Root file system (Android 2.3.4) and various tools which are supported by the operating system. 4. NXP2120 PROCESSOR PLATFORM NXP2120 is ARM11 architecture based application processor with 32 bit embedded CPU, 16 KBytes I-Cache, 16 KBytes D-Cache with VFP (Vector Floating-point Processor) and the operating frequency of 555/700 MHz [11], the block diagram is shown in figure 1. The application board has the following specifications: Core processor: NXP2120, 7-inch TFT-LCD module (800x480), Resistive touch panel, DDR2-SDRAM 128MB x 2 (256MB), SD/MMC, USB support, 512MB NAND Flash, 2-megapixel camera, I2S Audio OUT, I2S Line IN, Ethernet 10/100 base, Standard JTAG interface, Power adapter-12V
Fig.1. Hardware specifications 5. DEVELOPMENT SETUP The general setup for the project contains a host system, target board, serial cable (RS 232), and Ethernet hub as shown in figure 2.
Fig.2. General Setup of project Our essential connection to the embedded platform is by means of the RS-232 connection. A serial terminal program is utilized to correspond with the target board. Minicom is a standout amongst the most generally utilized serial terminal applications and is accessible on basically all desktop Linux distributions [5]. Ethernet cable is used to transfer the OS images by establishing the communication (TFTP) between host and the target. 6. PROJECT DESIGN PROCEDURE Mainly the project is divided into three stages as shown in below figure 3.
2013 – IJVES Indexing in Process - EMBASE, EmCARE, Electronics & Communication Abstracts, SCIRUS, SPARC, GOOGLE Database, EBSCO, NewJour, Worldcat, DOAJ, and other major databases etc.,
594 Vol 04, Article 08146; September 2013
http://ijves.com
International Journal of VLSI and Embedded Systems-IJVES
ISSN: 2249 – 6556
Fig.3. Project flow diagram The project includes the stages like, setting of BSP environment in the host, building the images (boot loader, kernel, and root file system) by making the changes to the files according to the required application this is the main stage in the project and the last step is to port the Images to the target board with a specific booting technique. 6.1 Setting the BSP Environment The project is developed in the host PC with the following configuration, CPU: Intel®Core™2Duo E6400 @ 2.13GHz, RAM: 2GB OS: Ubuntu version: Ubuntu-10.04.4-alternate-amd64.iso. Before proceeding to start BSP development and customization one should have in-depth understanding of Linux commands, file systems, cross compilers i.e. setting tool chain etc. Now for setting the BSP environment on the host PC, the packages like basic building tools, NFS server tools, TFTP server tools, Terminal tools, GNU tools for text, JDK tool etc. Are to be installed and after installing the required packages we have to set the Tool chain, TFTP, NFS, Minicom to interact with the target board. The main task is setting off a cross tool chain (arm-eabi-4.4.0), which is used for compilation and development of the Linux kernel. To set up the cross compiler on the host, I took up the way of downloading the binaries of the tool chain and located the path in .bashrc file. export PATH=$PATH:/opt/crosstools/arm-eabi-4.4.0/bin/ To make configuration changes in the kernel some configuration editors are at hand, like config, menuconfig, xconfig, gconfig, oldconfig etc. In those we generally have a GUI based editor menuconfig. I used the menuconfig and for it to be functional libncurses-dev package needs to be installed on the host. For Android BSP, Java libraries are very essential in building the root file system so I used JDK tool openjdk-6-source in the host. 6.2. Making BSP Customization This is the main module of the project i.e. Android BSP customization. In this module we deal with the boot loader, kernel and the root file system of the Android OS i.e. individually we can deal with the three Images by making configuration and programming changes according to the target platform. As shown in figure 4, we have to choose the required drivers, libraries specific to our application.
Fig.4. Block diagram of Android customization 2013 – IJVES Indexing in Process - EMBASE, EmCARE, Electronics & Communication Abstracts, SCIRUS, SPARC, GOOGLE Database, EBSCO, NewJour, Worldcat, DOAJ, and other major databases etc.,
595 Vol 04, Article 08146; September 2013
http://ijves.com
International Journal of VLSI and Embedded Systems-IJVES
ISSN: 2249 – 6556
Boot Loader: When the power is first applied, a boot loader takes immediate control of the processor. It performs the basic hardware initialization of the board and it is responsible for the locating, loading and passing execution to the primary operating system. Here I used U-Boot (Universal Boot loader) i.e. u-boot-2010.06. Because its support for multiple architectures like PPC, ARM, MIPS, X86 etc. and has a huge following of developers and hardware manufacturers who have taken it for use in their projects and have contributed to its development. In order to build the u-boot image we have to set the configuration file. In this I set the configurations for the following: -Ethernet information -DM9000 Ethernet chip driver -Boot cmd “tftp 81000000 uImage; bootm 81000000” -Nand boot mode -SD card boot mode -Setting for the access from u-boot to SD card -Setting for the access form u-boot to USB disk Now I set the cross compiler (arm-eabi-4.4.0) by editing the Makefile of the u-boot-2010.06 and then build the u-boot.bin Image by using the Make utility. Kernel: Android consists of a kernel based on the Linux kernel 2.6, with libraries, middleware and application software running on an application frame which contains Java-compatible libraries and APIs written in C [6]. The main hardware platform for Android is the ARM architecture. ARM machine dependent code is placed in the kernel/arch/arm directory. The contents in the subdirectories of the kernel source tree are defined as follows: boot: Contains specific booting process code. kernel: Consists architecture dependent kernel files. configs: Default configuration for specific platform. common: Consists common file for the ARM architecture. mach-*: Consists platform and processor specific files. mach-nxp2120: Contains platform and processor specific files for the NXP2120 application board. The kernel configuration and build system are based on multiple Makefiles. But we basically interact with the main Makefile, present at the top directory of the kernel source tree. The essential thing to build the Kernel source is make utility which is installed onto the host helps to build every file and its dependencies as per the directions in the main Makefile which the relating instructions has written to bind all other Makefiles and dependencies under the hierarchy. The best part of this make is to ease building the files that the developer is fascinating in and reducing a lot of time by excluding unemployed files and its dependencies in the course of building.
Fig.5. Menuconfig setting window In order to build the kernel we have to set the configuration file according to the requirement. So, first I copied the default config file to the nxp2120_dtk_default_config file which is located at kernel/arch/arm/configs/. Now we have to make changes to the configuration file by configuration editor menuconfig. The menuconfig allows enabling or disabling the module support i.e. if we don’t need a particular driver we can disable it, by this it saves a significant amount of size of Image. As shown in figure 5, set the ARM system type of NXP2120 and drivers included are Serial, I2C, Keypad, Touch, RTC, EHIC, OHIC, FB, Boot logo, Display, LCD, OGL, Vmem, NAND, SDHC, and Sound etc. Next important parameter is set of kernel boot options. The kernel acquires boot parameters as it began the system to boot. This is used to tell kernel about a mixture of software and hardware parameters. For example I
2013 – IJVES Indexing in Process - EMBASE, EmCARE, Electronics & Communication Abstracts, SCIRUS, SPARC, GOOGLE Database, EBSCO, NewJour, Worldcat, DOAJ, and other major databases etc.,
596 Vol 04, Article 08146; September 2013
http://ijves.com
International Journal of VLSI and Embedded Systems-IJVES
ISSN: 2249 – 6556
have set the boot options as “console=ttyS0, 115200n8 androidboot.console=ttyS0 androidboot.hardware=nexell init=/init root=/dev/ mtdblock1 rw rootfstype=yaffs2”. Each argument is explained as: console=ttyS0,115200n8=>where to output kernel log androidboot.console=ttyS0=>Shell where to put log androidboot.hardware=nexell=>hardware name init=/init=>tell kernel where is the init file root=/dev/mtdblock1=>indicate where is root file system rootfstype=yaffs2=>indicate root file system type Then the kernel uImage is build using the make utility and the final uImage created is shown in figure 6 below which is of size 2.73 MB. Root File System: Android architecture has the facility to insert a new platform in the source code. Any platform detailed configuration can be added in the ~/android-2.3.4/device/ directory. Under device directory device names are mentioned and each device can have different types of platforms. The platform is defined at ~/android2.3.4/device/nexell/nxp2120 directory and this nxp2120 directory contains the directories like products, project, tools etc. and Makefiles related to the platform. Every platform is considered as a product in Android’s terminology. Nexell has multiple products like nxp3200, nxp2120. The ~/android-2.3.4/build/target/ product directory contains AndroidProducts.mk file specifies the products which are included in the final executable and there are default product packages which are defined in the Makefiles like generic.mk, core.mk, sdk.mk etc. For building the Android we have to execute the main script file (build_android.sh) which will guide the system to build the Image. The following command is the main command to build the image [7]. $ ./build_android.sh -target=nand –job=1 –clean The command arguments explained as: -target=nand is the instruction to build to NAND -job=1 is the number of cup’s working –Clean is the option that deletes the existing file In this process we had to make some patches for the root file system according to the errors generated at the time of building. After successful completion of the build we will get a folder “full_nxp2120_evboard-img” is created in the main directory. In that full_nxp2120_evboard-yaffs-img.YYYYMMDDHHMM SS, uImagenand.bin, u-boot-nand.bin images are created. The successful build is shown in figure 7. It is yaffs2 flash file system Image that is mounted as / and thus contains the entire system binaries and consists the core of the Android system. After the completion of building images we have to copy them to TFTP folder created at /home/share/tftpboot in order to port them to the target platform.
Fig.6. Build kernel image
Fig.7. Build root file system
6.3. Porting of OS Images After successful compilation of kernel (uImage) and android images we have to burn them at the respective offset in NAND Flash. For burning the executables on board, have the following procedure. When reference board is powered on, go into boot mode by pressing “Enter key”. Type the ‘print’ command to get basic information for booting. Then type, #tftp 81000000 uImage #nand erase 100000 #nand write 81000000 100000 kernel size #tftp 81000000 yaffs2.img #nand write.yaffs2 81000000 800000 root file size #set “bootcmd nand read 81000000 100000 kernel size\; bootm 81000000” 2013 – IJVES Indexing in Process - EMBASE, EmCARE, Electronics & Communication Abstracts, SCIRUS, SPARC, GOOGLE Database, EBSCO, NewJour, Worldcat, DOAJ, and other major databases etc.,
597 Vol 04, Article 08146; September 2013
http://ijves.com
International Journal of VLSI and Embedded Systems-IJVES
ISSN: 2249 – 6556
The first command which instructs U-boot to load kernel image (uImage) over the tftp protocol into the memory, where 81000000 is the physical address in the target board’s memory where the kernel image will be loaded. Then we write the image to NAND and same procedure for file system image. Lastly the ‘bootm’ command instructs u-boot to boot the kernel we just loaded from the address and transfers control to the Linux kernel. This command is the death knell for U-boot. Once resetting “NXP2120 reference board”, booting from NAND will be operated. In the process of kernel booting, Linux kernel mounts Android root file system. The only way to pass control back to the boot loader is to reboot the board. This is the procedure of porting the Android OS to target platforms [8]. 7. APPLICATION DEVELOPMENT In order to conform the Android OS is successfully running or not on the platform I installed an Android application. The application is developed on the Android SDK, which is freely available at the Android site (http://developer.android.com/sdk/index.html). We have to download the SDK in order to develop the Android applications. The installation procedure is provided on the same site and after successful install Android SDK is created in our system with the Eclipse platform [9]. Android application development requires some knowledge of Java and XML languages because logic is implemented using Java and the GUI is designed with XML. I have developed a simple application with some basics. After the completion of the application the SDK will generate a file with .apk extension. This is the executable file of a specific Android application. Then copied the file to an MMC card and inserted into the board then installed and is successfully running on the board as shown in figure 8.
Fig.8. Application runs on board 8. CONCLUSION We examined the importance of Android OS, specialties and functionalities in embedded systems. According to the fact the Linux OS and Android OS are practically one and the same. Not totally the same, however the Android kernel is straightforwardly inferred from the Linux. The main distinction is GNU/Linux distributions utilize the GNU tool chain and Android includes Java and identified things to Linux and does not utilize the GNU tool chain. The OS ported on Arm11 based CPU building design. The OS porting is carried out in three steps: configuring, cross compiling and finally burnt onto the target platform. After successful porting, an application is produced with the assistance of Android SDK (Software Development Kit). We can proclaim the successful porting of OS by installing developed application on to the target. ACKNOWLEDGEMENTS I would like to express my special thanks of gratitude to my guides Ashok Kumar Yadav sir and Radha madam who helped me to write this important paper on- Porting of Android OS with BSP customization onto NXP2120 application processor board, which also helped me in doing a lot of research work and I came to know about so many new things. REFERENCES [1] Morgan, A.A.; Allam, M.E.; Salama, M.A.; Mansour, H.A.K. "Implementation of an Arm Compatible Processor Core for SOC Designs", Information and Communications Technology, 2005. Enabling Technologies for the New Knowledge Society: ITI 3rd International Conference on, On page(s): 851–859. [2] S. Maoqiang, X. Wenkuo, F. Xiangling, "Research on Architecture of Multimedia and Its Design Based on Android",2010 Int. Conf. Internet Technology and Applications, pp.1-4, Wuhan, China. [3] D. Gavalas, D. Economou, "Development Platform for Mobile Application: Status and Trends", Software IEEE, vol.28, issue 1, pp.77-86, Jan.-Feb. 2011. [4] Chen, Tianzhou; Yin, Yan; Dai, Hongjun; Hu, Wei "An agile BSP modeling methodology: Cross Platform BSP Framework”, Proceedings of the International Workshop on Rapid System Prototyping, v 2006,
2013 – IJVES Indexing in Process - EMBASE, EmCARE, Electronics & Communication Abstracts, SCIRUS, SPARC, GOOGLE Database, EBSCO, NewJour, Worldcat, DOAJ, and other major databases etc.,
598 Vol 04, Article 08146; September 2013
http://ijves.com
International Journal of VLSI and Embedded Systems-IJVES
ISSN: 2249 – 6556
Proceedings - Seventeenth IEEE International Workshop on Rapid System Prototyping, RSP 2006, 2006, p 126132. [5] “Embedded Linux Primer: A Practical, Real-World Approach” By Christopher Hallinan, Publisher: Prentice Hall, September 18, 2006, Print ISBN-10: 0-13-167984-8. [6] Pratyusha. Gandham, Ramesh N.V.K, “Porting the linux kernel to an arm based development board”, IJERA, Vol. 2, Issue 2, Mar-Apr 2012, pp.1614-1618. [7] DongSeok Cho; DooHwan Bae, “Case Study on Installing a Porting Process for Embedded Operating System in a Small Team”, Secure Software Integration & Reliability Improvement Companion (SSIRI-C), 2011 5th International Conference, 27-29 June 2011, E-ISBN : 978-0-7695-4454-0. [8] Abhyudai Shanker, Somya Lal, “Android Porting Concepts” Electronics Computer Technology (ICECT), 2011 3rd International Conference, Volume: 5, 2011, pp.129-133. [9] R. Rogers, J. Lombardo, “Android Application Development: Programming with the Google SDK”, Zigurd Mednieks. [10] “Beginning Android” by Mark L. Murphy ISBN-13 (pbk): 978-1-4302-2419-8 [11] http://mentodesign.files.wordpress.com/2011/10/nxp2120datasheetver0-90_work111.pdf [12] A Spectrum White Paper: “Thoughts on Google Android”. [13] Paolo Meroni, Elena Pagani and Gian Paolo Rossi, “An Opportunistic Platform for Android-based Mobile Devices”. AUTHORS BIOGRAPHY
V. Hari Prasad has received the B.Tech degree from Sri Vasavi Eng. College, A.P, India in 2011, presently preserving his M.Tech in Embedded Systems from Gudlavalleru Eng. College, JNTUK, A.P, India. His main area of interest are embedded systems, Linux based systems and VLSI design.
Ashok Kumar Yadav is working as Technical Manager at Electronics Corporation of India Limited (ECIL), Hyderabad, since July 2000. He has over 11 years of experience in embedded system design and development. His main areas of interest are digital signal processing, FPGA, RTOS, and biometric applications. He has master degree in Digital Signal Processing from Osmania University, Hyderabad, India and Master of Business Administration (MBA) from IGNOU.
K. Radha is working as Assistant Professor in ECE department, Gudlavalleru Engineering College, Gudlavalleru, A.P, India. She has master degree in Digital Electronics and Communication Systems. Her main area of interest is VLSI design.
2013 – IJVES Indexing in Process - EMBASE, EmCARE, Electronics & Communication Abstracts, SCIRUS, SPARC, GOOGLE Database, EBSCO, NewJour, Worldcat, DOAJ, and other major databases etc.,