Selecting tools, development environments, and operating systems for embedded systems’ development Craig DUFFY Bristol UWE, UK.

Slides:



Advertisements
Similar presentations
UEE072HM Linking HLL and ALP An example on ARM. Embedded and Real-Time Systems We will mainly look at embedded systems –Systems which have the computer.
Advertisements

1 CS101 Introduction to Computing Lecture 17 Algorithms II.
Program Development Tools The GNU (GNU’s Not Unix) Toolchain The GNU toolchain has played a vital role in the development of the Linux kernel, BSD, and.
Systems Software.
May 7, A Real Problem  What if you wanted to run a program that needs more memory than you have?
1 A Real Problem  What if you wanted to run a program that needs more memory than you have?
Java.  Java is an object-oriented programming language.  Java is important to us because Android programming uses Java.  However, Java is much more.
CSC1016 Coursework Clarification Derek Mortimer March 2010.
Inline Assembly Section 1: Recitation 7. In the early days of computing, most programs were written in assembly code. –Unmanageable because No type checking,
CS-3013 & CS-502, Summer 2006 Virtual Machine Systems1 CS-502 Operating Systems Slides excerpted from Silbershatz, Ch. 2.
Embedded Systems Programming Writing Device Drivers.
Embedded Systems Programming Introduction to cross development techniques.
1 UQC122S3 Real-Time and Embedded Systems GCC as a cross compiler.
1 Lecture 1  Getting ready to program  Hardware Model  Software Model  Programming Languages  The C Language  Software Engineering  Programming.
Selecting a Cross Development Environment. Why do you need to select a CDE? Through out your career the target systems will change rapidly –Both the h/w.
Memory Management 2010.
Embedded Real-time Systems The Linux kernel. The Operating System Kernel Resident in memory, privileged mode System calls offer general purpose services.
1 Real-Time System Design Developing a Cross Compiler and libraries for a target system.
Portability CPSC 315 – Programming Studio Spring 2008 Material from The Practice of Programming, by Pike and Kernighan.
Embedded Real time System Design Introduction to the course.
Embedded Systems Programming Introduction to the course.
Introduction To C++ Programming 1.0 Basic C++ Program Structure 2.0 Program Control 3.0 Array And Structures 4.0 Function 5.0 Pointer 6.0 Secure Programming.
Introduction to The Linaro Toolchain Embedded Processors Training Multicore Software Applications Literature Number: SPRPXXX 1.
1 Introduction to Tool chains. 2 Tool chain for the Sitara Family (but it is true for other ARM based devices as well) A tool chain is a collection of.
Spring 2014 SILICON VALLEY UNIVERSITY CONFIDENTIAL 1 Introduction to Embedded Systems Dr. Jerry Shiao, Silicon Valley University.
1 uClinux course. 2 Author: D L Johnson Overview u Day 1 +Survey of embedded operating systems - why uclinux? +The uclinux environment - the directory.
OBJECT MODULE FORMATS. The object module format we have employed as an educational device is called OMF (relocatable object format). It’s one of the earliest.
ITEC 352 Lecture 11 ISA - CPU. ISA (2) Review Questions? HW 2 due on Friday ISA –Machine language –Buses –Memory.
1 I-Logix Professional Services Specialist Rhapsody IDF (Interrupt Driven Framework) CPU External Code RTOS OXF Framework Rhapsody Generated.
1 A Simple but Realistic Assembly Language for a Course in Computer Organization Eric Larson Moon Ok Kim Seattle University October 25, 2008.
Installing a BSP. Software tool chain As with any cross development the cross tool chain is important On Windows it is enormous - you need –Developer.
Roopa.T PESIT, Bangalore. Source and Credits Dalvik VM, Dan Bornstein Google IO 2008 The Dalvik virtual machine Architecture by David Ehringer.
OPERATING SYSTEMS Goals of the course Definitions of operating systems Operating system goals What is not an operating system Computer architecture O/S.
Topic 2d High-Level languages and Systems Software
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Memory: Relocation.
240-Current Research Easily Extensible Systems, Octave, Input Formats, SOA.
Porting Linux Linux onto the Puppeteer SA1110. The Puppeteer board –SA1110 CPU –SMSC LAN91C96I ethernet –8 Mb Flash Intel 28F320C3 Boot block flash –32.
Moving Arrays -- 1 Completion of ideas needed for a general and complete program Final concepts needed for Final Review for Final – Loop efficiency.
1 4-Development Environment Development processor  The processor on which we write and debug our programs Usually a PC Target processor  The processor.
Renesas Electronics America Inc. © 2012 Renesas Electronics America Inc. All rights reserved. Advanced Debugging on the RX600.
Chapter 7 Object Code Generation. Chapter 7 -- Object Code Generation2  Statements in 3AC are simple enough that it is usually no great problem to map.
Renesas Electronics America Inc. © 2012 Renesas Electronics America Inc. All rights reserved. Class ID: 3L05I Advanced Debugging on the RX600 Fatih Peksenar.
Nachos Overview Lecturer: Hao-Hua Chu TA: Chun-Po Wang (Artoo) Date: 2008/09/18 Material Provided by Yuan-Hao Chang, Yung-Feng Lu.
Implementation of Embedded OS Lab3 Porting μC/OS-II.
Getting ready. Why C? Design Features – Efficiency (C programs tend to be compact and to run quickly.) – Portability (C programs written on one system.
QEMU, a Fast and Portable Dynamic Translator Fabrice Bellard (affiliation?) CMSC 691 talk by Charles Nicholas.
Chapter 11  Getting ready to program  Hardware Model  Software Model  Programming Languages  Facts about C++  Program Development Process  The Hello-world.
LECTURE 3 Translation. PROCESS MEMORY There are four general areas of memory in a process. The text area contains the instructions for the application.
OCR A Level F453: The function and purpose of translators Translators a. describe the need for, and use of, translators to convert source code.
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
OPERATING SYSTEMS (OS) By the end of this lesson you will be able to explain: 1. What an OS is 2. The relationship between the OS & application programs.
The World Leader in High Performance Signal Processing Solutions Toolchain Basics.
Lecture 1 Page 1 CS 111 Summer 2013 Important OS Properties For real operating systems built and used by real people Differs depending on who you are talking.
7-Nov Fall 2001: copyright ©T. Pearce, D. Hutchinson, L. Marshall Oct lecture23-24-hll-interrupts 1 High Level Language vs. Assembly.
Building programs LinuxChix-KE. What happens in your CPU? ● It executes a small set of instructions called "machine code" ● Each instruction is just a.
Linux on ARM7TDMI or Nothing is as easy as it looks Helicon technologies Ltd. How to run uClinux on NXP LPC22xx.
Computer Basics.
Shellcode COSC 480 Presentation Alison Buben.
The compilation process
Separate Assembly allows a program to be built from modules rather than a single source file assembler linker source file.
An Embedded Software Primer
Handling Arrays Completion of ideas needed for a general and complete program Final concepts needed for Final.
Memory Management Tasks
Lecture Topics: 11/1 General Operating System Concepts Processes
Handling Arrays Completion of ideas needed for a general and complete program Final concepts needed for Final.
Embedded System Development Lecture 13 4/11/2007
Mastering Memory Modes
Handling Arrays Completion of ideas needed for a general and complete program Final concepts needed for Final.
System calls….. C-program->POSIX call
Cache writes and examples
Presentation transcript:

Selecting tools, development environments, and operating systems for embedded systems’ development Craig DUFFY Bristol UWE, UK.

Overview of talk This talk will have 3 sections – Firstly we will look at the options with regard to targets/boards. – Then we will consider the selection of host development tools and environments – Finally, I will conclude with some tests for cross development tools, along with a brief discussion of those tests.

Target options There are broadly 3 main options with a new target board –Go with the existing vendor’s system This may also have lots of unpleasant side effects – Build your own system Has a lot of positives and negatives –Port an existing OS onto the board This requires some careful thought and planning

Vendor’s Systems You may be convinced by the fact that the vendor built the board * then they therefore should be the most suitable people to supply the operating system and development tools –This is less true than some of you may think You often end up with buggy, un-documented and un- supported systems The choice may force you to use a poor quality compiler/host development environment. The libraries and start-up code may be difficult to port to a better system (e.g. gcc) You could end up with difficult/expensive licensing problems * Quite often the vendor may not have designed or built the board

Vendor’s Systems - questions There are some very important questions to ask before going with a vendor solution –Is it open source/GPL? If it isn’t life is going to be tough –Is there a support community? If they don’t understand the question, then that (no!) is your answer! –Do you have to rely on one, vendor specific, compiler/libraries? You may end up fighting against a very bad compiler. –Who else uses it? New releases? Other architectures? You could end up learning a lot of redundant, non-portable skills. –Relationship to/links with a BSP/BIOS? Can you use other BSPs? How easy is it to change/interrupt the machine start-up sequence? –Use of specialist tools – i.e. for debugging the system Do you really want to buy an ICE?

Going alone! You may have a very specific requirement that doesn’t really require a large amount of, or even any, OS support. If you already have your own application code then implementing a small executive to support this code may be an option. This options requires some thought…

Going Alone – Pros and Cons Positive –You are in control Don’t have to worry about 3 rd party code –Debugging your own code is (often) simpler –No licensing problems –Can focus on application problems Negative –You are in control Now you can really screw things up –May end up re- inventing a lot of wheels –Tends to be one-off, bespoke development –Will either re-write or have to interact with the native OS

Porting an existing OS #1 This requires some specific planning –What is on the board? CPU, Memory, MMU, install method, –Porting to a new architecture is a large job – board ports are more straight forward –Memory requirements for Linux/NETBSD could be a problem – can get onto < 4MB, but is it worth it? »Do you really need/want a file system? –Does the target have a MMU, MPU? »May require extra porting –Relationship to existing BSP and installation method can be a tough cookie. JTAG, BDM support? How does it boot? Can you recover your system? –Debugging the system – what debug support do you have?

Porting an existing OS #2 –Which OS? This is obviously related to the previous question –What do you require from the OS? Scheduling? TCP/IP? Web services? Windowing? Users? –If a larger system (i.e. Linux) doesn’t fit You could try ECOS or RTEMS –For MMUless systems you can chose uClinux.

Porting an existing OS #2.2 If you go for Linux, which one? –A standard distribution Debian, RedHat –Can be large –A embedded specific one? MonteVista, BlueCat, –Good support and documentation at a cost –Build your own Get the kernel, library and applications that you need –Make take more time, but you will better understand the system.

Porting an existing OS #3 –What application area? Does the application require an element of real- time response –You may have select an r-t extension to Linux. Do you require certain features? –TCP/IP, security, Will you require specific device drivers? –Can find existing ones or port them.

Option 3.5! A mid way There is an alternative to resting with a vendor’s system and a full blown port. This is to port a compiler and library system for your board –Using gcc and Newlib could be a good choice This is a good choice for a smaller system or one that it is difficult/impossible to replace the existing OS. This approach allows you to use good open source development tools hosted on Linux/Unix.

Option 3.5 This approach requires –Porting gcc for your host Not too big a job for existing architectures. Requires the writing of some compiler’s library start-up and crt0.s code. End up with great compiler and tools. –Porting a library Need to carefully select the library – Newlib is a good choice for many boards Port a number of stubs to the native OS – if the feature is not OS supported then you won’t get that feature

Selection of X-development tools This selection will be influenced by your choice of target OS –With Linux/NetBSD/Ecos life will be much simpler –For all the other options Vendor OS Home made executive gcc/newlib/vendor OS –You may have to chose you tools with care and test them.

Selection criteria A fair amount has been written about the criteria required for embedded and real-time language selection, however compiler rather than language choice is an important issue. In many ways, if one has chosen C (or even C++), then the gcc suite fulfils most needs and can be a good standard by which to judge other candidate compilers. The criteria are given, in no particular order to the following slide

Criteria Good linker control – linker language Assembler linkage – a bit OTT in gcc Good machine specific coverage Variety of tools – objdump, ar etc Debugger interface Good library support – small sized libraries e.g. uClibc Assembler output- standard assembler? Optimisation levels Conformance to standards Documentation Support community Compiler maturity Portability Variety of output formats – elf, srecord, binary Open source – at least the crt0.o should be available!

Why test the compiler/OS? As stated previously these tests are mainly of use to those working with standalone or vendor OS code. The compiler or OS manual may make claims that code is position independent and ROMable, but it is worth being suspicious of such claims. Small, test programs may run, but you could end up in trouble when trying out larger, more realistic applications.

Tests for compilers Four tests are given, all of which are very simple. They are –Initialised data –Large arrays –Long jumps –Downloadable library code

Initialised data #1 Initialised data –Will require linker/Operating System involvement –Is easy to test Simply create an initialised global data item. //test initialised data int test = 8; void main() { }

Initialised data #2 Unlike uninitialised data, which only requires an empty block of memory, initialised data requires the memory and also for it to be filled with the data. This must be done correctly so that later references to the data will point to the correct locations This frequently requires both linker operations and operating system code. –If you don’t have the OS you may have to write these routines and this can lead into complex problems. Can be avoided by creating all data as uninitialised and write initialisation routines at start-up.

Large arrays #1 It is worth simulating the use of very large data areas with your compiler to see what happens. You can get surprising results void main() { char big_array[0x32000], *ptr; //200k array ptr = &big_array[017000]; *ptr = 0xaa; *ptr++;; big_array[0]=0xbb;//first element big_array[0x2a2000] = 0xcc; //32k from end big_array[0x ]= 0xdd; //end }

Large arrays #2 The previous program caused errors with a number of compilers –One created the code, but only allocated a 32k stack based array, but it did not report an error This was because it used register indirect with an offset that was too small The code seemed to work but actually just wrapped around –Another created assembler instructions that were illegal –Many required there to be changes to an initialisation file (cstart, crt0…)

Long jumps #1 Attempt to simulate what a large development will look like by creating a routine call over a large address range You may need to insert the assembler manually into the code / test a long jump void faraway(void ); void main() { faraway(); } _asm {.rept 0x10000 nop } void faraway(void) { }

Long jumps #2 The code creates a non-local jump Often short jumps are just PC relative offsets - +/-127 bytes When they get larger they may be placed into jump tables and require initialised data as in the previous problem Some compiler can put all jumps into jump tables – and thus create initialised data

Library Support Some code will obviously require OS support – ie open(), signal() Some may be easily ported – ie printf() Some should work without OS support – ie sprintf() Check libraries like the string and maths ones as they may require OS support – for example calls to malloc().