IAR Embedded Workbench®
Total Page:16
File Type:pdf, Size:1020Kb
IAR Embedded Workbench® C-SPY® Debugging Guide for Renesas V850 Microcontroller Family UCSV850-1 UCSV850-1 COPYRIGHT NOTICE Copyright © 1998–2011 IAR Systems AB. No part of this document may be reproduced without the prior written consent of IAR Systems AB. The software described in this document is furnished under a license and may only be used or copied in accordance with the terms of such a license. DISCLAIMER The information in this document is subject to change without notice and does not represent a commitment on any part of IAR Systems. While the information contained herein is assumed to be accurate, IAR Systems assumes no responsibility for any errors or omissions. In no event shall IAR Systems, its employees, its contractors, or the authors of this document be liable for special, direct, indirect, or consequential damage, losses, costs, charges, claims, demands, claim for lost profits, fees, or expenses of any nature or kind. TRADEMARKS IAR Systems, IAR Embedded Workbench, C-SPY, visualSTATE, From Idea To Target, IAR KickStart Kit, IAR PowerPac, IAR YellowSuite, IAR Advanced Development Kit, IAR, and the IAR Systems logotype are trademarks or registered trademarks owned by IAR Systems AB. J-Link is a trademark licensed to IAR Systems AB. Microsoft and Windows are registered trademarks of Microsoft Corporation. Renesas is a registered trademark of Renesas Electronics Corporation. Adobe and Acrobat Reader are registered trademarks of Adobe Systems Incorporated. All other product names are trademarks or registered trademarks of their respective owners. EDITION NOTICE First edition: February 2011 Part number: UCSV850-1 The C-SPY® Debugging Guide for V850 replaces all debugging information in the IAR Embedded Workbench IDE User Guide and the hardware debugger guides for V850. This guide applies to version 3.x of IAR Embedded Workbench® for V850. Internal reference: M1, Too6.0, IMAE. UCSV850-1 Brief contents Tables ...................................................................................................................... 15 Figures .................................................................................................................... 17 Preface .................................................................................................................... 21 Who should read this guide ............................................................... 21 How to use this guide ........................................................................... 21 What this guide contains ..................................................................... 22 Other documentation ........................................................................... 23 Document conventions ........................................................................ 24 The IAR C-SPY Debugger ........................................................................... 27 Introduction to C-SPY .......................................................................... 27 Debugger concepts ................................................................................ 30 C-SPY drivers overview ....................................................................... 32 The IAR C-SPY Simulator .................................................................. 34 The C-SPY emulator drivers ............................................................. 34 Getting started using C-SPY ....................................................................... 37 Setting up C-SPY .................................................................................... 37 Starting C-SPY ......................................................................................... 39 Adapting for target hardware ........................................................... 42 Running example projects .................................................................. 43 Reference information on starting C-SPY ................................... 45 Executing your application ........................................................................... 69 Introduction to application execution ........................................... 69 Reference information on application execution ..................... 74 Working with variables and expressions .............................................. 87 Introduction to working with variables and expressions ...... 87 Reference information on working with variables and expressions ................................................................................................ 92 3 UCSV850-1 Using breakpoints ........................................................................................... 103 Introduction to setting and using breakpoints ........................ 103 Procedures for setting breakpoints .............................................. 108 Reference information on breakpoints ....................................... 112 Monitoring memory and registers ........................................................ 127 Introduction to monitoring memory and registers ............... 127 Reference information on memory and registers .................. 131 Collecting and using trace data ............................................................... 155 Introduction to using trace .............................................................. 155 Procedures for using trace ............................................................... 156 Reference information on trace ..................................................... 158 Using the profiler ............................................................................................ 175 Introduction to the profiler .............................................................. 175 Procedures for using the profiler ................................................... 176 Reference information on the profiler ........................................ 177 Code coverage ................................................................................................. 181 Introduction to code coverage ....................................................... 181 Reference information on code coverage .................................. 182 Simulating interrupts ..................................................................................... 187 Introduction to interrupt simulation ........................................... 187 Procedures for simulating interrupts .......................................... 192 Reference information on simulating interrupts .................... 194 Using C-SPY macros ................................................................................... 201 Introduction to C-SPY macros ....................................................... 201 Procedures for using C-SPY macros ............................................ 203 Reference information on the macro language ....................... 209 Reference information on reserved setup macro function names ......................................................................................................... 214 Reference information on C-SPY system macros .................. 215 C-SPY® Debugging Guide 4 for V850 UCSV850-1 Brief contents The C-SPY Command Line Utility—cspybat ................................... 241 Using C-SPY in batch mode ............................................................. 241 C-SPY command line options ......................................................... 243 Reference information on C-SPY command line options ... 244 Debugger options ........................................................................................... 253 Setting debugger options .................................................................. 253 Reference information on debugger options ............................ 254 Additional reference on C-SPY drivers ............................................. 261 Reference information on the C-SPY simulator ..................... 261 Reference information on the C-SPY Emulator drivers ..... 263 Resolving problems .............................................................................. 277 Using the MINICUBE2 emulator ............................................................ 281 Overview .................................................................................................. 281 V850 MINICUBE2 reserved resources ........................................ 282 Further reading ..................................................................................... 285 Index ..................................................................................................................... 287 5 UCSV850-1 C-SPY® Debugging Guide 6 for V850 UCSV850-1 Contents Tables ...................................................................................................................... 15 Figures .................................................................................................................... 17 Preface .................................................................................................................... 21 Who should read this guide ............................................................... 21 How to use this guide ........................................................................... 21 What this guide contains ..................................................................... 22 Other documentation ........................................................................... 23 User and reference guides .................................................................. 23