AVR® IAR Embedded Workbench® IDE User Guide
Total Page:16
File Type:pdf, Size:1020Kb
AVR® IAR Embedded Workbench® IDE User Guide for Atmel® Corporation’s AVR® Microcontroller UAVR-4 COPYRIGHT NOTICE © Copyright 1996–2006 IAR Systems. All rights reserved. No part of this document may be reproduced without the prior written consent of IAR Systems. 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, From Idea to Target, IAR Embedded Workbench, visualSTATE, IAR MakeApp and C-SPY are trademarks owned by IAR Systems AB. Atmel is a registered trademark of Atmel Corporation. AVR is a registered trademark of Atmel Corporation. Microsoft and Windows are registered trademarks of Microsoft Corporation. Adobe and Acrobat Reader are registered trademarks of Adobe Systems Incorporated. CodeWright is a registered trademark of Starbase Corporation. All other product names are trademarks or registered trademarks of their respective owners. EDITION NOTICE Fourth edition: June 2006 Part number: UAVR-4 This guide describes version 4.x of IAR Embedded Workbench® for Atmel® Corporation’s AVR microcontroller. UAVR-4 Brief contents Tables ................................................................................................................... xxiii Figures ................................................................................................................ xxvii Preface ................................................................................................................ xxxv Part 1. Product overview ............................................................. 1 Product introduction ........................................................................................ 3 Installed files ........................................................................................................ 15 Part 2. Tutorials .................................................................................... 23 Creating an application project ................................................................. 25 Debugging using the IAR C-SPY® Debugger ..................................... 37 Mixing C and assembler modules ............................................................ 49 Using C++ ............................................................................................................ 53 Simulating an interrupt .................................................................................. 59 Working with library modules .................................................................. 69 Part 3. Project management and building ............ 73 The development environment ................................................................. 75 Managing projects ............................................................................................. 81 Building ................................................................................................................... 91 Editing ..................................................................................................................... 97 Part 4. Debugging .............................................................................. 107 The IAR C-SPY® Debugger ..................................................................... 109 iii UAVR-4 Executing your application ......................................................................... 119 Working with variables and expressions ............................................ 125 Using breakpoints ........................................................................................... 133 Monitoring memory and registers ........................................................ 139 Using the C-SPY® macro system .......................................................... 145 Analyzing your application ......................................................................... 153 Part 5. IAR C-SPY Simulator .............................................. 159 Simulator-specific debugging ..................................................................... 161 Simulating interrupts ..................................................................................... 173 Part 6. C-SPY hardware debugger systems ...... 181 Introduction to C-SPY hardware debugger systems ................... 183 Hardware-specific debugging .................................................................... 191 Part 7. Reference information ........................................... 219 IAR Embedded Workbench® IDE reference ................................... 221 C-SPY® Debugger reference ................................................................... 299 General options .............................................................................................. 335 Compiler options ........................................................................................... 345 Assembler options ......................................................................................... 359 Custom build options ................................................................................... 367 Build actions options .................................................................................... 369 Linker options .................................................................................................. 371 Library builder options ................................................................................ 385 AVR® IAR Embedded Workbench® IDE iv User Guide UAVR-4 Brief contents Debugger options ........................................................................................... 387 C-SPY® macros reference ........................................................................ 391 Glossary .............................................................................................................. 415 Index ..................................................................................................................... 429 v UAVR-4 AVR® IAR Embedded Workbench® IDE vi User Guide UAVR-4 Contents Tables ................................................................................................................... xxiii Figures ................................................................................................................ xxvii Preface ................................................................................................................ xxxv Who should read this guide ........................................................... xxxv How to use this guide ....................................................................... xxxv What this guide contains ................................................................xxxvi Other documentation ......................................................................xxxix Document conventions .........................................................................xl Part 1. Product overview ............................................................. 1 Product introduction ........................................................................................ 3 The IAR Embedded Workbench IDE .............................................. 3 An extensible and modular environment ............................................. 4 Features ................................................................................................ 4 Documentation ..................................................................................... 5 IAR C-SPY Debugger .............................................................................. 5 General C-SPY Debugger features ...................................................... 6 RTOS awareness .................................................................................. 8 Documentation ..................................................................................... 8 IAR C-SPY Debugger systems ............................................................ 8 IAR C-SPY Simulator .......................................................................... 9 C-SPY ICE200 driver ......................................................................... 9 C-SPY JTAGICE driver ...................................................................... 9 C-SPY JTAGICE mkII driver ........................................................... 10 C-SPY Crypto Controller ROM-monitor driver ............................... 10 IAR C/C++ Compiler ............................................................................. 11 Features .............................................................................................. 11 Runtime environment ......................................................................... 12 Documentation ................................................................................... 12 vii UAVR-4 IAR Assembler ......................................................................................... 12 Features .............................................................................................