Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 249 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
249
Dung lượng
10,18 MB
Nội dung
Debugging Embedded MicroprocessorSystems Stuart R Ball Newnes An Imprint of Elsevier Boston Oxford Johannesburg Melbourne New Delhi Singapore Debugging Embedded MicroprocessorSystems Stuart R Ball Newnes An Imprint of Elsevier Boston Oxford Johannesburg Melbourne New Delhi Singapore Newnes is an imprint of Elsevier • A member of the Reed Elsevier group 1998 by Butterworth-Heinemann All rights reserved No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of the publisher Permi,,,,um~ ma) h l rom l-I,,c,.lcr'+, Science and Tcchnolog.~ Right,, l)cpartmcnt in ()xlord I.; K Pho,c: (44 ~ I ~65 843t~.t() Fax 144 ~ I $65 N5.1333 c-mall p[...]... is used to determine the type of breakpoint Breakpoints may be set on instruction fetch, writes Tools for Debugging EmbeddedSystems 23 M ~176 i i M 0 t t I11 "~ ~ f.- i! !to MM 9 F- i t b t m J ~ , x t M i J m Z M 0 | I m Figure 1.12 x86 Debugging Registers -O 24 DebuggingEmbeddedMicroprocessorSystems only, or read/write (there is no read-only breakpoint) There are two bits for this purpose in DR7... version otherwise you will throw away a lot of the OTP parts debugging the code Counter~LED Circuit: Figure 1.13 shows a simplified version of a circuit that I like to keep in my toolbox It's a counter driving LEDs, one LED Tools for Debugging EmbeddedSystems b- i Z 1,4 i- Figure 1.13 Counter/LED Circuit | 27 211 DebuggingE m ~ MicroprocessorSystems per counter bit A 74HC14 allows the counter to increment... T~qGs SYSTs 20 De~ggi,.~ EmbeddedMicroprocessorSystems I- Figure 1.1 1 ROM Emulator r~s ~ D~ouggir~EmbeddedS~te~s 21 event, or provide many of the advanced debugging features of sophisticated emulators Some off-the-shelf processor boards come with a debugger installed, and some engineers like to embed a simple debugger in the ROM with the application code When a simple debugger is embedded in the ROM,... also be displayed as individual signals Emulator: A microprocessor emulator replaces the microprocessor chip, plugging into the socket that the processor would otherwise occupy The emulator then operates exactly the same way as the processor (ideally), executing code just as the processor would The emulator adds the 114 DebuggingE m ~ MicroprocessorSystems Ru Current Next Sample Perl00 Semple Perl00... -0001 EA 23 00 00 BO 0 1 1 1 E ms s ,t ~rm e~ 0001 ~ 0003 0004 0005 C7 D4 44 CC F2 1 2 1 1 1 ~s ~S ~S ,~s Figure 1.7 Logic Analyzer Display Showing Two Time-Correlated Virtual Machines 12 DebuggingEmbeddedMicroprocessorSystems is at state 0023 The two data points captured for machine 2 occurred between states 0 and 1 for machine 1 Many logic analyzers permit one virtual machine to capture data in state...D~4~ing EmbeddedM i r Systems said they were pulled off to solve some crisis on another project I'll have to do the firmware, but someone else will do the PC software." "Have you added anything for debugging? " "Like what?" "Test points, diagnostic outputs, anything like that." "I hadn't really thought about debugging the board." Matt nodded again "So you haven't... the pulse, making the variation in this line very small Each new trace paints over the old one, showing the variation in the trailing edge In Figure 1.5, Figure 1.5 DSO Repetitive Trace DebuggingEmbeddedMicroprocessorSystems you can see that the trailing edge of successive traces are mostly grouped together, with one long pulse occurring (trailing edge past the centerline of the display) Math Functions:... sourcelevel debugging However, a debugger can connect to a PC that provides a user interface and can contain the cross-reference table and other information needed for source-level debugging Photo 1.2 shows a screen capture of the VisualProbe debugger from SSI This screen contains windows displaying memory contents, the source code, and CPU registers In a typical Windows-based debugger, 22 Debugging Embedded. .. external clock In a microprocessor system, the clock is usually connected to the system clock, or to the processor read and/or write lines, or to an address-ready signal (-AS on 68000-type processors, ALE on Intel-type processors) In timing mode, the logic analyzer uses an internal clock to capture the data Timing mode analyzers can be further subdivided into con- Tools for Debugging EmbeddedSystems 9 tinuous... capabilities; a random sampling of x86 databooks reveals that the Intel 386EX (a version of the 386 optimized for embedded applications), the AMD 386DE, and the SGS-Thompson 6x86 have debugging registers identical to those of the T1486 BackgroundDebuggingMode:Motorola took a slightly different approach to debugging support with some of their processors The 68332, for example, provides for a 17-bit synchronous ... Stuart R Debugging embedded microprocessor systems / Stuart R Ball p cm Includes index ISBN- 13:978-0-7506-99t~-7 ISBN-10:0-7506-9990-6 Embedded computer systems Debugging in computer science Microprocessors... for Debugging EmbeddedSystems 23 M ~176 i i M t t I11 "~ ~ f.- i! !to MM F- i t b t m J ~ , x t M i J m Z M | I m Figure 1.12 x86 Debugging Registers -O 24 DebuggingEmbeddedMicroprocessorSystems... Action Codes 171 Debugging Tools 171 Debugging in an Embedded PC Environment 177 Advantages to Using a PC Platform 177 Disadvantages to Using a PC Platform 178 PC Debugging Tools 182 Debugging Scenarios