DOC PREVIEW
UT EE 345M - Embedded Systems: Real-Time Operating Systems

This preview shows page 1-2-3-4 out of 11 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Embedded Systems: Real-Time Operating Systems Lecture 2.1 by Jonathan W. Valvano Debugging Tools I just provedthis algorithmis correct!Good Ben, butshouldn't youactually run it? Software verification is a difficult but important phase. Objectives • Debugging hardware • Stabilization • Minimally intrusive debugging instruments • Profiling • White box versus black box testing Control and observability A logic analyzer is a multiple channel digital storage scope • numerous digital signals at various points in time • attached to strategic I/O signals, real-time measurement • attached to heart beats, profile execution • massive amount of information • triggering to capture data at appropriate times • must interpret the data • nonintrusive • good for real time observation of I/O signalsEmbedded Systems: Real-Time Operating Systems Lecture 2.2 by Jonathan W. Valvano ArmDigitalInterfaceDigitalInterfacePF0PF1Logic Analyzer A logic analyzer and example output. Show the digilentinc analog discovery www.digilentinc.com/Products/Detail.cfm?Prod=ANALOG-DISCOVERY Events that are observable in real time The input and output signals of the system Dumps (record in real time, observe later off line) Extra output pins Software-based debuggers breakpoint by replacing the instruction with a trap can not be performed when the software is in ROM Single step with periodic interrupts Write debugging information into flash so you can analyze systems even if power is lost. Hardware based debuggers (JTag). exists on the microcomputer chip itself communicates with the debugging computer ability to observe software execution in real time, hardware support to set breakpoints, the ability to stop the computer and supports hardware breakpoints. memory and I/O ports are accessible while runningEmbedded Systems: Real-Time Operating Systems Lecture 2.3 by Jonathan W. Valvano Debugging Theory “rough and ready” manual methods desk-checking, dumps, and print statements Debugging instrument software code that is added for the purpose of debugging. stabilize the system creating a test routine that fixes (or stabilizes) all inputs. can reproduce the exact inputs over and over again. modify the program, change in our outputs is a function of modification and not due to a change in the input parameters. non-intrusive/intrusive Intrusiveness is used as a measure of the degree of perturbation caused in program performance by an instrument. Develop your own unique debugging style. • place all print statements in a unique column • specific pattern in their names. • test a run time global flag leaves a copy of the code in the final system simplifies “on-site” customer support. • Use conditional compilation performance and effectiveness.Embedded Systems: Real-Time Operating Systems Lecture 2.4 by Jonathan W. Valvano Black box Just inputs/outputs Know what it does but not how it works Have pin numbers/signal names on the connector White box testing Can probe inside Know both what it does and how it works Have internal schematics Functional debugging verification of input/output parameters a static process where inputs are supplied, the system is run, and the outputs are compared against expected results. Single Stepping or Trace Breakpoints without filtering Instrumentation: print statements difficulty with print statements in embedded systems a standard "printer" may not be available. print statement itself may so slow, intrusive. print hardware used for normal operation If you wish to use printf, you need to create a fputc function like this int fputc(int ch, FILE *f){ Serial_OutChar(ch); return (1); }Embedded Systems: Real-Time Operating Systems Lecture 2.5 by Jonathan W. Valvano int fgetc (FILE *f){ return (Serial_InChar()); } int ferror(FILE *f){ /* Your implementation of ferror */ return EOF; } Appropriate debugging methods Instrumentation: dump into array without filtering a debugger instrument dumps strategic information into an array at run time. observe the contents of the array at a later time. use debugger to visualize when running. long DebugList[100]; unsigned int DebugCnt=0; void RecordIt(long data){ if(DebugCnt==100){ return; } DebugList[DebugCnt]=data; DebugCnt++; } Instrumentation: dump into array with filtering. A filter is a software/hardware condition that must be true in order to place data into the array. if(condition){ RecordIt(MyData); } Monitor using the LED displayEmbedded Systems: Real-Time Operating Systems Lecture 2.6 by Jonathan W. Valvano A monitor is an independent output process executes very fast, so is minimally intrusive small amounts of strategic information Examples LCD display LED's on individual otherwise unused output bits, PF0 #define PF0 (*((volatile unsigned long *)0x40025004)) #define GPIO_PORTF_DATA_R (*((volatile unsigned long *)0x400253FC)) PF0 = 0x01; GPIO_PORTF_DATA_R |= 0x01; PF0 = 0x00; GPIO_PORTF_DATA_R &= ~0x01; Performance Debugging • verification of timing behavior of our system • a dynamic process system is run, and dynamic behavior compared to expected results Instrumentation with independent counter unsigned long Tbuf[100]; unsigned int Tcnt=0; void RecordTime(void){ if(Tcnt==100) return; Tbuf[Tcnt] = NVIC_ST_CURRENT_R; // 24-bit SysTick counter, 20ns Tcnt++; } Instrumentation Output Port.Embedded Systems: Real-Time Operating Systems Lecture 2.7 by Jonathan W. Valvano 4804 LDR r0,[pc,#16] ;r0= 0x400063FC 6800 LDR r0,[r0,#0x00] ;r0=PORTC F0400020 ORR r0,r0,#0x20 ;set bit 5 4903 LDR r1,[pc,#12] ;r1= 0x40006000 F8C103FC STR r0,[r1,#0x3FC];write PORTC GPIO_PORTC_DATA_R |= 0x20; This subroutine is nonreentrant because of the read-modify-write access to a global. Show an example of how this assembly listing is found Run on board or on simulator Discuss compiler optimization #define GPIO_PORTC_DATA_R (*((volatile unsigned long *)0x400063FC)) #define GPIO_PORTC0 (*((volatile unsigned long *)0x40006004)) #define GPIO_PORTC1 (*((volatile unsigned long *)0x40006008)) #define GPIO_PORTC2 (*((volatile unsigned long *)0x40006010)) #define GPIO_PORTC3 (*((volatile


View Full Document

UT EE 345M - Embedded Systems: Real-Time Operating Systems

Download Embedded Systems: Real-Time Operating Systems
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Embedded Systems: Real-Time Operating Systems and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Embedded Systems: Real-Time Operating Systems 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?