Looking for a Tutor Near You?

Post Learning Requirement »
x

Choose Country Code

x

Direction

x

Ask a Question

x

x
x
x
Hire a Tutor

Development Tools For An Embedded System

Loading...

Published in: Embedded Systems
4,491 Views

Introduction to different tools like compilers, interpreters, linker, loader and debugger

Rujuta M / Pune

2 years of teaching experience

Qualification: M.Tech (Sinhgad College - 2014)

Teaches: Mathematics, Physics, Electronics

Contact this Tutor
  1. Development tools
  2. Embedded Software Development Process •Software Development is perfonnecl on a Host colnputer —Compiler, Assembler, Linker, Locator, Debugger Produces executable binary image that will tun on Target Embedded System Host •Development Platform •General Pillpose •More capable processor •More memoiY •Different L/C) •Capable OS •Development Tools -Editor -Compiler -Debugger omm Ln Target •Embedded Hardware Platfomu •Special purpose •Limited processor, memory, I/O •Stnpped down OS/kema1 •No develo ent tools
  3. Programming Embedded Systems • Embedded Systems Programming requires a more complex software build process Target hardware platform consists of Target hardware (processor, memory, I/O) Runtime environment (Operating System/Kemel) deployment Target hardware platfonn does not contain development tools (editor, compiler, debugger) Target hardware platfonn is different from development platfomu pupose computer image that will lun on the Target embedded system
  4. Process for Developing Embedded Software To develop software for a General Pillpose Computer Create source file Type in C code Build: compile and link To develop software for an embedded system Create source file (on Host) Type in C code (on Host) Compile/Assemble: translate into machine code (on Host) Link: combine all object files and libraries, resolve all symbols (on Host) Locate: assign memory addresses to code and data (on Host) Download: copy executable image into Target processor memory Execute: reset Target processor
  5. Compiling Embedded Systems Compiler translates program written in human-readable language into machme language Source Code --> Object file Object file is bma1Y file that contains set of machine-language Instmctions (opcodes) and data resulting from language translation process Machine-language mstmctions are specific to a panicular processor Can the host computer's compiler be used to compile a program to mn on the target computer? A Native-compiler Inns on a computer platfonn and produces code for that same computer platfolm A Cross-colnpiler luns on one computer platfonn and produces code for another computer platfonn
  6. Assemblers/lntemreters for Embedded Systems • In some cases, a compiler IS not used Assembler perfomus one-to-one translation from human-readable assembly language mnemonics to equivalent machine-language opcodes Intelpreter constantly luns and intelprets source code as a set of directives » Perfonns syntax checking as program is typed in Result is slow perfonnance - can be —1000x slower than an equivalent compiled language » Interactive capability provides Inore feedback easier to leam
  7. Interpreters An interpreter is also a program that translates a high- level language into a low-level one, but it does it at the moment the program is run. You write the program using a text editor or something similar, and then instruct the interpreter to run the program. It takes the program, one line at a time, and translates each line before running it: It translates the first line and runs it, then translates the second line and runs it etc. The interpreter has no "memory" for the translated lines, so if it comes across lines of the program within a loop, it must translate them afresh every time that particular line runs.
  8. Linking Embedded Systems The Linker combines object files (from compiler) and resolves variable and function references Source code may be contained in >l file, which must be combined Resolve 'variables which may be referenced in one file and defined in another file Resolve calls to library functions, like sqrt May include operatmg systeln Linker creates a ' relocatable" version of the program Program is complete, except no mem01Y addresses assigned
  9. Locating Embedded Systems A Locator is the tool that performs the conversion from relocatable program to executable binary image The Locator assigns phy sical memory addresses to code and data sections within the relocatable program The Locator produces a binary memory image that can be loaded into the target ROM In contrast, On General Purpose Computers, the operating system assigns the addresses at load time
  10. Downloading and Executing Your Program Once a program has been successfully compiled, linked, and located, it must be moved to the target platform Download the binary Image to the embedded system Executable bina1Y image is tmnsfened and loaded into a memory device on target board Can be loaded into ROM via a device programmer, which "bums" a chip that is then re-inseltecl into the embedded system Your program will then execute when you reset the processor, or apply power to the embedded system
  11. Review Process for Developing Embedded Software To develop software for an embedded system Create source file (on Host) Type in C code (on Host) Compile/Assemble: translate into machine code (on Host) Link: combine all object files and libraries, resolve all symbols (on Host) Locate: assign mem01Y addresses to code and data (on Host) Download: copy executable image into Target processor memory Execute: reset Target processor
  12. Debuggmg Embedded Software Now that the software has been downloaded to the target processor, how do we know if it IS working? Run-time errors are not as obvious Most embedded systems do not have a "screen" When a program fails, usually causes the processor to crash or lock-up Logic errors If program .1uns, IS It perfomnng the conect steps?
  13. Debugging Tools Remote Debugger Host Computer Front end •Development Tools -Editor Compiler -Debugger Comm Lmk Comm Link Comm Link Simulator (Running on Host or other workstation) Target Processor Remote Debugger Backend Target Processor In-Circuit Emulator
  14. Debugging with Simulators Simulator IS host-based program that simulates functionality and instruction set of target processor Front-end has text or GUI-based wmdows for source code, register contents, etc Valuable during early stages of development Disadvantage: only simulates processor, not peripherals
  15. Debugging with Remote Debuggers Remote Debuggers used to monitor control embedded SW Used to download, execute and debug embedded software over communications link (e.g., selial poft) Front-end has text or GUI-based wmdows for source code, register contents, etc Backend provides low-level control of target processor, runs on target processor and communicates to front-end over comm-link Debugger and software being debugged are executing on two different computer systems Suppolts higher level of Interaction between host and target » Allows staff/restalt/kill, and stepping through program » Software breakpoints ("stop execution if instmction X is fetched") » Read/write registers or data at specified address software package
  16. Debuggmg with In-Circuit Emulators • In-Circuit Emulators (ICE) Take the place of (i.e., emulates) target processor Contains copy of target processor, plus RANI, ROM, and its own embedded software Allows you to examme state of processor while program is lunning Uses Remote debugger for human interface Has more capability than target processor » Suppotts software and hardware breakpoints (stop execution on memory and I/O read/write, intenupts) "Stop on write to variable num Real-time tracing Stores infonnation about each processor cycle that is executed Allows you to see what order things happened Disadvantage: Expensive!