Spring 2014 SILICON VALLEY UNIVERSITY CONFIDENTIAL 1 Introduction to Embedded Systems Dr. Jerry Shiao, Silicon Valley University.

Slides:



Advertisements
Similar presentations
User-Mode Linux Ken C.K. Lee
Advertisements

Profiler In software engineering, profiling ("program profiling", "software profiling") is a form of dynamic program analysis that measures, for example,
Gnu Debugger (GDB) Topics Overview Quick Reference Card Readings: Quick Reference Card February 7, 2012 CSCE 212Honors Computer Organization.
Debugging What can debuggers do? Run programs Make the program stops on specified places or on specified conditions Give information about current variables’
© 2003 Xilinx, Inc. All Rights Reserved Debugging.
Presenter : Chien-Hung Chen Tsung-Cheng Lin Kuan-Fu Kuo EICE team Open On-Chip Debugger Ch6. Design and Architecture.
Embedded Systems Programming Introduction to cross development techniques.
1 Real-Time System Design Developing a Cross Compiler and libraries for a target system.
1-1 Embedded Software Development Tools and Processes Hardware & Software Hardware – Host development system Software – Compilers, simulators etc. Target.
This material exempt per Department of Commerce license exception TSU Debugging.
Embedded Systems Programming Introduction to the course.
1 THE ARCHITECTURE FOR THE DIGITAL WORLD TM THE ARCHITECTURE FOR THE DIGITAL WORLD Embedded Linux for ARM Architecture.
Keil Products in a Single Slide
Introduction Purpose Objectives Content Learning Time
CSE598C Virtual Machines and Their Applications Operating System Support for Virtual Machines Coauthored by Samuel T. King, George W. Dunlap and Peter.
MDK-ARM Microcontroller Development Kit MDK: Microcontroller Development Kit.
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.
Embedded Systems Principle of Debugger. Reference Materials kl.de/avr_projects/arm_projects/#winarmhttp://
The 6713 DSP Starter Kit (DSK) is a low-cost platform which lets customers evaluate and develop applications for the Texas Instruments C67X DSP family.
Debugging techniques in Linux Debugging Techniques in Linux Chetan Kumar S Wipro Technologies.
F13 Forensic tool analysis Dr. John P. Abraham Professor UTPA.
Gdb is the GNU debugger on our CS machines. gdb is most effective when it is debugging a program that has debugging symbols linked in to it. With gcc and.
Main sponsor PicassoMonet + RembrandtMatejko + Canaletto How Debuggers Work Karl Rehmer Failures Come in Flavors Michael Nygard REST in Java Stefan Tilkov.
Chocolate Bar! luqili. Milestone 3 Speed 11% of final mark 7%: path quality and speed –Some cleverness required for full marks –Implement some A* techniques.
Debugging Cluster Programs using symbolic debuggers.
NetBurner MOD 5282 Network Development Kit MCF 5282 Integrated ColdFire 32 bit Microcontoller 2 DB-9 connectors for serial I/O supports: RS-232, RS-485,
Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.
Eclipse for remote development Presented by Taye Su.
Slides created by: Professor Ian G. Harris Test and Debugging  Controllability and observability are required Controllability Ability to control sources.
Lecture 8. Profiling - for Performance Analysis - Prof. Taeweon Suh Computer Science Education Korea University COM503 Parallel Computer Architecture &
SEISLOG Linux presented at the WORKSHOP High Quality Seismic Stations and Networks for Small Budgets Volcan, Panama March, 2004 by Terje Utheim,
Programming Tools gcc make utility Open Source code Static and Shared Libraries gdb Memory debugging tools.
Compiling & Debugging Quick tutorial. What is gcc? Gcc is the GNU Project C compiler A command-line program Gcc takes C source files as input Outputs.
Old Chapter 10: Programming Tools A Developer’s Candy Store.
Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.
1 uClinux course Day 4 of 5. 2 Author: D L Johnson CPU Architectures.
NIOS II Ethernet Communication Final Presentation
Debugging and Profiling With some help from Software Carpentry resources.
25 April 2000 SEESCOASEESCOA STWW - Programma Evaluation of on-chip debugging techniques Deliverable D5.1 Michiel Ronsse.
1 SEEM3460 Tutorial Compiling and Debugging C programs.
CSE 351 GDB Introduction. Lab 1 Status? How is Lab 1 going? I’ll be available at the end of class to answer questions There are office hours later today.
Renesas Electronics America Inc. © 2012 Renesas Electronics America Inc. All rights reserved. Class ID: 3L05I Advanced Debugging on the RX600 Fatih Peksenar.
Debugging 1/6/2016. Debugging 1/6/2016 Debugging  Debugging is a methodical process of finding and reducing the number of bugs, or defects, in a program.
Unit - V. Debugging GNU Debugger helps you in getting information about the following: 1.If a core dump happened, then what statement or expression did.
ChibiOS/RT Demo A free embedded RTOS
Ladebug Kernel Debugging Tutorial Bob Lidral. Introduction Kinds of kernel debugging How to use Ladebug for kernel debugging Not how to debug a kernel.
Lab 9 Department of Computer Science and Information Engineering National Taiwan University Lab9 - Debugging I 2014/11/4/ 28 1.
© 2002 IBM Corporation Confidential | Date | Other Information, if necessary Copyright © 2009 Ericsson, Made available under the Eclipse Public License.
C P ROGRAMMING T OOLS. C OMPILING AND R UNNING S INGLE M ODULE P ROGRAM.
HCS12 Technical Training Module 15 – Break Module Slide 1 MOTOROLA and the Stylized M Logo are registered in the US Patent & Trademark Office. All other.
Evaluating the Fault Tolerance Capabilities of Embedded Systems via BDM M. Rebaudengo, M. Sonza Reorda Politecnico di Torino Dipartimento di Automatica.
Embedded Real-Time Systems Introduction to embedded software development Lecturer Department University.
The World Leader in High Performance Signal Processing Solutions Toolchain Basics.
1 © 2007 Mauro Morsiani Laboratorio di Sistemi Operativi Anno Accademico Software Development with uMPS Part 3 Mauro Morsiani Copyright © 2007.
1 © 2007 Mauro Morsiani Laboratorio di Sistemi Operativi Anno Accademico Software Development with uMPS Mauro Morsiani Copyright © 2007 Mauro.
Institute of Radio Physics and Electronics ILug-Cal Introduction to GDB Institute of Radio Physics and Electronics and Indian GNU/Linux Users Group Kolkata.
Exceptional Control Flow
Computer System Laboratory
Chapter 1: A Tour of Computer Systems
Debugging with gdb gdb is the GNU debugger on our CS machines.
Software Development with uMPS
Exceptional Control Flow: System Calls, Page Faults etc.
Chapter 2: The Linux System Part 1
Software Setup & Validation
Lecture9: Embedded Network Operating System: cisco IOS
Debug Tools (GDB+DDD) on Andes platform
Computer System Laboratory
Debugging.
In Today’s Class.. General Kernel Responsibilities Kernel Organization
Lecture9: Embedded Network Operating System: cisco IOS
Presentation transcript:

Spring 2014 SILICON VALLEY UNIVERSITY CONFIDENTIAL 1 Introduction to Embedded Systems Dr. Jerry Shiao, Silicon Valley University

SILICON VALLEY UNIVERSITY CONFIDENTIAL 2 Spring 2014 Section 9 Linux Debugging Tools Trace Code Debugging  printf Inserted at strategic points in the executing code to show the value of local or global variables. Real-time flow of application. Compile time macros to remove printfs in production code.  #ifdef UNIT_TESTING  #define TRACE(flag, format) if(global_debug & flag) printf format  #else  #define TRACE(flag, format)  #endif Many printfs or macros intermixed in code, can document code or confuse code flow.  Add debug printfs means rebuild application.  Slow execution time, affect timing.

SILICON VALLEY UNIVERSITY CONFIDENTIAL 3 Spring 2014 Section 9 Linux Debugging Tools System Tracing  Monitor User Application and Kernel.  Interprocess synchronization problems or time-sensitive issues.  strace: Tracing single process ptrace() system call intercepts all system calls.  Monitoring system or library calls affects performance of process. Option “-c”: Count all calls and signals and create a summary report. Option “-T”: Print time spent in each system call. strace -c find /etc -name xorg.conf /etc/X11/xorg.conf % time seconds usecs/call calls errors syscall execve getdents open close mprotect write [...]

SILICON VALLEY UNIVERSITY CONFIDENTIAL 4 Spring 2014 Section 9 Linux Debugging Tools Performance Analysis  Maximize performance on Operating System. Process Profiling  Compiler Option “ –gp”: Profiling data written to gmon.out upon exit.  Makefile:  $(CC) $(LDFLAGS) -pg -o $(OBJS)  Execute object file (i.e. $(OBJS))  gmon.out: Cross-platform readable.  gprof Utility runs on host Operating System. gprof gmon.out Flat profile: Each sample counts as 0.01 seconds. % cumulative self self total time seconds seconds calls ms/call ms/call name open offtime memccpy write strlen strchr main memcpy print profil report

SILICON VALLEY UNIVERSITY CONFIDENTIAL 5 Spring 2014 Section 9 Linux Debugging Tools GDB – GNU DeBugger  Symbolic debugger, Richard Stallman,  GDB package needs: gdb debugger: Runs on the host. gdbserver: Runs on the target. Executes the commands received from the gdb debugger.  Debugging capabilities: Initialize environment before running application. Stop program execution (breakpoint). Examine memory when program has stopped. Change memory to alter running environment.  GNU General Public License.   ftp://ftp.gnu.org/gnu/gdb

SILICON VALLEY UNIVERSITY CONFIDENTIAL 6 Spring 2014 Section 9 Linux Debugging Tools GDB – GNU DeBugger  Enhanced symbol table. Debugging information for: Associates address of symbol to the source code. Assocates address of machine code to line of source code.  gcc compiler –g option (Symbol Table). gcc –g –o filename filename.c  gcc compiler –o option (Optimization). gcc –g –o0 … or gcc –g –o …  Debugging information does not get loaded into memory unless gdb loads the executable. gdb –q filename NOTE: Performance affected ONLY running within gdb. .gdbinit file executed by GDB ($HOME, current dir). Contains any GDB commands.

SILICON VALLEY UNIVERSITY CONFIDENTIAL 7 Spring 2014 Section 9 Linux Debugging Tools GDB – GNU DeBugger Host  gdb –q filename filename is executable object with enhanced symbol table.  target remote :9004  target remote /dev/ttyUSB0 Target  gdbserver localhost:9004 filename filename is executable object stripped of enhanced symbol table.  gdbserver /dev/tty filename filename is executable object stripped of enhanced symbol table.

SILICON VALLEY UNIVERSITY CONFIDENTIAL Spring 2014 Section 9 Linux Debugging Tools  GDB – GNU DeBugger 1) Image test4 stripped of enhanced symbol table. 2) gdbserver localhost:9004 test4 or gdbserver /dev/tty test4 1) Image test4 with enhanced symbol table. 2) minicom gdb –q test4 target remote :9004 or target remote /dev/ttyUSB0 Switch Host System Target System Serial Port Ethernet Port

SILICON VALLEY UNIVERSITY CONFIDENTIAL 9 Spring 2014 Section 9 Linux Debugging Tools GDB – Software Based Debuggers  Standard interface to target (serial line or Ethernet).  Active program code on the target (i.e. gdbserver) waits for debugging requests and executes the action.  Debug only one process, kernel and other processes in target continues. Inter-process debugging difficult.  Debugger executes as part of the target program, all software restrictions apply. Only view address space of the current running process.

SILICON VALLEY UNIVERSITY CONFIDENTIAL 10 Spring 2014 Section 9 Linux Debugging Tools GDB – Hardware Based Debuggers  Uses special hardware to access target, processor and memory (i.e. JTAG interface).  No active target software (i.e. no gdbserver on target). Allows debugging of system startup.  Hardware breakpoint. Whole target system (i.e. processor) halts. Debug interrupts or inter-process communications.  Debugger access memory physically without restrictions. Access any process data.

SILICON VALLEY UNIVERSITY CONFIDENTIAL 11 Spring 2014 Section 9 Linux Debugging Tools GDB – JTAG  Direct control over hardware for debugging.  Rely on special on-chip debug JTAG functionality embedded in the CPU. Sometimes, specially modified GDB debugger. Require special hardware and software. CPU pins used for communication between on- chip debug system and 3 rd party tools.  Read/write memory.  Read/write CPU register.  Single step and realtime execution.  Hardware breakpoints. Less expensive and complicated than In-Circuit Emulators (ICE).

SILICON VALLEY UNIVERSITY CONFIDENTIAL Spring 2014 Section 9 Linux Debugging Tools  GDB – GNU JTAG DeBugger 12 1)Connecting JTAG debugger to the JTAG pins of the CPU. Control CPU behavior. 2)Require special JTAG hardware and software. Host System Target System Serial Port 1)gdb minicomgdb JTAG Probe JTAG Cable JTAG Port gdbserver.Emulation 1)OpenOCD 2)JTAG Probe USB Port OpenOCD

SILICON VALLEY UNIVERSITY CONFIDENTIAL Spring 2014 Section 9 Linux Debugging Tools  GDB – GNU JTAG DeBugger JTAG Probe Host System Target System Serial Port Ethernet Port JTAG Cable 1)Connecting JTAG debugger to the JTAG pins of the CPU. Control CPU behavior. 2)Require special JTAG hardware and software. JTAG Port 1)gdbserver Emulation 1)gdb

SILICON VALLEY UNIVERSITY CONFIDENTIAL 14 Spring 2014 Section 9 Linux Debugging Tools In-Circuit Debugger (ICD)  Direct control over hardware for debugging.  Rely on special on-chip debug JTAG functionality embedded in the CPU. ICD software installed on host. Configure ICD environment on the host and target configuration. Require special hardware and software. CPU pins used for communication between on- chip debug system.  Read/write memory.  Read/write CPU register.  Single step and realtime execution.  Hardware breakpoints.

SILICON VALLEY UNIVERSITY CONFIDENTIAL Spring 2014 Section 9 Linux Debugging Tools  In-Circuit Debugger 15 JTAG ProbeTarget JTAG Cable Host PC USB Cable 1)ICD Software 1)Connecting JTAG debugger to the JTAG pins of the CPU. Control CPU behavior. 2)Require special JTAG hardware and software. Set-up Debug Environment Establish the communcation between the debugger and the target CPU. Load application for debugging. Select the target CPU.

SILICON VALLEY UNIVERSITY CONFIDENTIAL 16 Spring 2014 Section 9 Linux Debugging Tools In-Circuit Debugger (ICD) Trace32 ICD: Host CPU configuring target CPU.