1 / 28

Cross Development

Cross Development. Building & Porting Operating Systems. What is a tool chain?. A set of software utilities used to perform an operation. GNU Toolchain - a blanket term for a collection of programming tools produced by the GNU Project. Used for OS and application development.

lucia
Download Presentation

Cross Development

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Cross Development Building & Porting Operating Systems

  2. What is a tool chain? A set of software utilities used to perform an operation. GNU Toolchain- a blanket term for a collection of programming tools produced by the GNU Project. Used for OS and application development.

  3. For Embedded Systems Usual development tools available on a GNU/Linux workstation is a native toolchain Embedded systems typically run on one platform while building applications for another. Therefore, cross-compiling toolchains are generally used. They run on your workstation but generate code for your target.

  4. Embedded Systems x86 Source code Compilation machine Cross-compiling toolchain Native toolchain x86 ARM x86 binary Execution machine ARM binary

  5. build host target build host target Native build used to build the normal gcc of a workstation Cross build used to build a toolchain that runs on your workstation but generates binaries for the target The most common solution in embedded build host target build host target Canadian build used to build on architecture A atoolchain that runs on architecture B and generates binaries for architecture C Cross-native build used to build a toolchain that runs on your target and generates binaries for the target

  6. What is it composed of? Binutils Kernel headers C/C++ libraries GCC compiler GDB debugger (optional) Source: free-electrons.com

  7. Binutils • Binutils set of tools to generate and manipulate binaries for a given CPU architecture. The main ones are: • ld - the linker. • as - the assembler. • Ar, ranlib - A utility for creating, modifying and extracting from archives. • c++filt - Filter to demangle encoded C++ symbols. • addr2line - Converts addresses into filenames and line numbers. • Others: Gprof,Nlmconv,nm,objcopy,objdump,ranlib, Readelf, Size,Strings, strip,windres

  8. C library • Interface between the applications and the kernel • Provides the well-known standard C API to ease application development • Several C libraries are available:glibc, uClibc, eglibc, dietlibc, newlib, etc. • The choice of the C library must be made at the time of the cross-compiling toolchain generation, as the GCC compiler is compiled against a specific C library. Kernel C Library Applications

  9. Kernel headers • The C library and compiled programs needs to interact with the kernel • Available system calls and their numbers • Constant definitions • Data structures, etc. • Therefore, compiling the C library requires kernel headers, and many applications also require them. Kernel Kernel headers C Library Applications Available in <linux/...> and <asm/...> and a few other directories corresponding to the ones visible in include/ in the kernel sources

  10. GCC compiler • GCC: GNU C Compiler, the famous free software compiler • Can compile C, C++, Ada, Fortran, Java, Objective-C, Objective-C++, and generate code for a large number of CPU architectures, including ARM, AVR, Blackfin, CRIS, FRV, M32, MIPS, MN10300, PowerPC, SH, v850, i386, x86_64, IA64, Xtensa, etc. • Available under the GPL license, libraries under the LGPL.

  11. GDB debugger • The debugger on GNU/Linux,available for most embedded architectures. • Console interface or GUI available, also gdbserver • Can be used to control the execution of a program, set breakpoints or change internal variables. Can also see memory images, useful if system crashes. • Use of terminal emulators – Ensure you can access the serial port (/dev/ttys0) (chmod to change rights of files)– Minicom most commonly used, usually installed in distribution, Others include UUCP cu and C-Kermit

  12. Using ‘make’ Video: Compiling ARM • make – used after every tool if built from scratch • Brings all of the tools together, and makes use of them to build the project • Processes a makefile that dictates the build procedure • Generated files depend on source files, if a source file is updated so is the generated file! • Likewise, if a source is not updated, and the generated file already exists... It isn’t re-built • Pseudo targets, allow for install and clean etc.. Tip: Use SVN/Configuration facility

  13. Where does it fit in? Basic example of a typical self-build GNU toolchain Source: eejournal.com

  14. Cross Development Environment • In today’s embedded development or development as a whole, is rare that developers develop & write code on the devices themselves. • Because of this, it means there is a need for cross development environments which differ dependent on the target hardware. • Mobile Applications – Android, iOS, Windows, all have different cross development environments – which enable programmers to develop for there chosen platform.

  15. Device Development • When developing system software for embedded devices, one of the important facts is figuring out how to the code on the board, and proceeding with the code execution. • The deployment of code on devices can be achieved in many ways which depends on the target product device that the build was built for and its on board features. • With most of ‘OUR’ late embedded development experiences, it was achieved by populating an micro SD card with kernel/boot loader images along with file systems which are recognized by the boards CPU’s and booted accordingly. • Difficulties – Errors downloading from git repositories • Bad or corrupt repos

  16. Data Transfers • Ethernet Cables • Year 2, Configuring Puppeteer boards • COM Ports • Virtual USB COM port • RS-232 • Micro SD Cards & Reader • Loading Kernel Images, boot loaders & File systems

  17. BUILDROOT • Build root is a set of Makefiles and patches which make it easy to generate a complete embedded Linux system. • It is very useful for people working with embedded systems using various CPU architectures: ARM, x86, MIPS, PowerPC and more. • Automating the build process for your chosen embedded system & easing the cross compilation generation.

  18. Major Build root Features

  19. The “Make” Command • The ‘Make’ Utilities purpose is to determine automatically which pieces of a large program need to be recompiled & then issue certain commands to recompile them. • Using makerequires Makefiles to be written, which describes relationships amongst files in your program – stating commands for updating each file. • Once a Makefile exists, each time source files are changed the simple shell command make performs all necessary recompilations, executing commands in the Makefile to update one or more target names. • Few Make Options: ( -b, -C dir, -d, -e, -f file, -j jobs, -k and many more) • The GNU implantation of the make command was written by Richard Stallman and Roland McGrath.

  20. Debugging • Embedded systems development relies on debuggers talking to chips to perform operating like single stepping & break pointing. Debugging stages may be performed at different levels, depending on facilities that are available to the debugger. • It can be achieved in two ways , internallyor externally. • Internal Debugging by Running pieces of software through tools viewing the code running on the processor. Allowing the starting or stopping operations , which can be done using emulators.

  21. Debugging External • Using serial ports (RS232/USB COM PORT) and JTAG(Joint Test Action Group) hardware interfaces. • JTAG adapters uses JTAG as the transport mechanism to access on-chip debug modules inside the CPU. These modules let developers debug the software directly at machine instruction level. • Most Digital electronic products today's such as mobile phonesor a wireless access point generally have no other debug or test interfaces.

  22. SOFTWARE DEVELOPMENT KIT (SDK) •  Set of software development tools that allows for the creation of applications  for a certain software  package, software framework, hardware platform, computer system, video game console, operating system or similar platform • A software engineer typically receives the SDK from the target system developer • Providers of SDKs for specific systems or subsystems may sometimes substitute a more specific term instead of software. For instance, both Microsoft and Apple provide driver development kits (DDK) for developing device drivers

  23. WINDOWS SDK • Microsoft Windows SDK, Platform SDK and .NET Framework SDK • Platform SDK specializes in developing applications for Windows 2000, XP and Windows Server 2003. .NET Framework SDK is dedicated to developing applications for .NET Framework 1.1 and .NET Framework 2.0. Windows SDK is the successor of the two and supports developing applications for Windows XP, Windows Vista, Windows 7, Windows Server 2008, .NET Framework 3.0, .NET Framework 3.5, and .NET Framework 4.0.

  24. THE WINDOWS SDK CONTAINS THE FOLLOWING • For Win32 development: • 1,915 Headers • 348 Libraries • 100 Tools • For .NET (managed code) development: • 14 Reference Assemblies supporting .NET, Tablet PC, Windows PowerShell, MMC, etc. • 33 Intellisense Files • 70 .NET 2.0 Tools + 10 .NET 3.0 Tools + 35 .NET 4.0 Tools • For Visual Studio 2005/2008/2010 integration • Utilities to enable Visual Studio 2005/2008 to easily use Windows SDK headers and libraries • Visual Studio 2005/2008 Wizards for creating Windows Media Player applications

  25. ANDROID SDK AND ECLIPSE • Latest version of JDK ( Java Development Kit) • Eclipse IDE • SDK Starter Package (it includes only the core SDK Tools) • ADT Plugin for Eclipse • Android SDK and AVD Manager (a tool included in the SDK starter package) to download essential SDK components into your development environment.

  26. Android SDK Tools • Android EmulatorA QEMU-based device-emulation tool that you can use to design, debug, and test your applications in an actual Android run-time environment.Hierarchy Viewer (hierarchyviewer)Lets you debug and optimize an Android application's user interface.layoutoptLets you quickly analyse your application's layouts in order to optimize them for efficiency.MksdcardHelps you create a disk image that you can use with the emulator, to simulate the presence of an external storage card (such as an SD card).MonkeyRuns on your emulator or device and generates pseudo-random streams of user events such as clicks, touches, or gestures, as well as a number of system-level events. You can use the Monkey to stress-test applications that you are developing, in a random yet repeatable manner.

  27. Android SDK Tools • Monkey runnerProvides an API for writing programs that control an Android device or emulator from outside of Android code.ProGuardShrinks, optimizes, and obfuscates your code by removing unused code and renaming classes, fields, and methods with semantically obscure names.sqlite3Lets you access the SQL Lite data files created and used by Android applications.traceviewProvides a graphical viewer for execution logs saved by your application.zipalignOptimizes .apk files by ensuring that all uncompressed data starts with a particular alignment relative to the start of the file. This should always be used to align .apk files after they have been signed.

  28. QuESTIONS?

More Related