IAR Embedded Workbench®

IAR Embedded Workbench®

IAR Embedded Workbench® IAR C/C++ Development Guide Compiling and Linking for Advanced RISC Machines Ltd’s ARM® Cores DARM-16b COPYRIGHT NOTICE © 1999–2015 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, C-RUN, C-STAT, visualSTATE, Focus on Your Code, IAR KickStart Kit, IAR Experiment!, I-jet, I-jet Trace, I-scope, IAR Academy, IAR, and the logotype of IAR Systems are trademarks or registered trademarks owned by IAR Systems AB. Microsoft and Windows are registered trademarks of Microsoft Corporation. ARM, Thumb, and Cortex are registered trademarks of Advanced RISC Machines Ltd. 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 Sixteenth edition: December 2015 Part number: DARM-16b This guide applies to version 7.50.x of IAR Embedded Workbench® for ARM. Internal reference: M18, csrct2010.1, V_110411, IMAE. IAR C/C++ Development Guide 2 Compiling and Linking for ARM AFE1_AFE2-1:1 Brief contents Tables ...................................................................................................................... 27 Preface .................................................................................................................... 29 Part 1. Using the build tools ................................................... 37 Introduction to the IAR build tools ........................................................ 39 Developing embedded applications ......................................................... 45 Data storage ...................................................................................................... 59 Functions ............................................................................................................... 63 Linking using ILINK ........................................................................................ 75 Linking your application ................................................................................ 93 The DLIB runtime environment ............................................................ 107 Assembler language interface ................................................................. 151 Using C ................................................................................................................ 175 Using C++ .......................................................................................................... 185 Application-related considerations ....................................................... 197 Efficient coding for embedded applications ...................................... 213 Part 2. Reference information ........................................... 233 External interface details ............................................................................ 235 Compiler options ........................................................................................... 245 Linker options .................................................................................................. 289 Data representation ...................................................................................... 319 Extended keywords ....................................................................................... 333 3 AFE1_AFE2-1:1 Pragma directives ............................................................................................ 347 Intrinsic functions ........................................................................................... 371 The preprocessor ........................................................................................... 407 C/C++ standard library functions .......................................................... 415 The linker configuration file ...................................................................... 425 Section reference ............................................................................................ 451 The stack usage control file ...................................................................... 457 IAR utilities ........................................................................................................ 465 Implementation-defined behavior for Standard C ......................... 501 Implementation-defined behavior for C89 ........................................ 517 Index ..................................................................................................................... 529 4 AFE1_AFE2-1:1 Contents Tables ...................................................................................................................... 27 Preface .................................................................................................................... 29 Who should read this guide ............................................................... 29 How to use this guide .......................................................................... 29 What this guide contains ................................................................... 30 Other documentation ........................................................................... 31 Document conventions ........................................................................ 34 Part 1. Using the build tools ................................................... 37 Introduction to the IAR build tools ........................................................ 39 The IAR build tools—an overview ................................................... 39 IAR language overview ......................................................................... 41 Device support ......................................................................................... 41 Special support for embedded systems ........................................ 43 Developing embedded applications ......................................................... 45 Developing embedded software using IAR build tools .......... 45 The build process—an overview ...................................................... 47 Application execution—an overview ............................................. 50 Building applications—an overview ................................................ 54 Basic project configuration ................................................................. 55 Processor configuration ...................................................................... 55 Data storage ...................................................................................................... 59 Introduction ............................................................................................. 59 Storage of auto variables and parameters .................................. 60 Dynamic memory on the heap ........................................................ 61 Functions ............................................................................................................... 63 Function-related extensions .............................................................. 63 ARM and Thumb code ......................................................................... 63 5 AFE1_AFE2-1:1 Execution in RAM ................................................................................... 64 Interrupt functions for Cortex-M devices .................................... 65 Interrupt functions for ARM7/9/11, Cortex-A, and Cortex-R devices ......................................................................................................... 66 Inlining functions ..................................................................................... 71 Linking using ILINK ........................................................................................ 75 Linking—an overview ............................................................................ 75 Modules and sections ............................................................................ 76 The linking process in detail .............................................................. 77 Placing code and data—the linker configuration file .............. 79 Initialization at system startup ......................................................... 82 Stack usage analysis ............................................................................... 85 Introduction to stack usage analysis ................................................... 85 Performing a stack usage analysis ..................................................... 86 Linking your application ................................................................................ 93 Linking considerations .......................................................................... 93 Hints for troubleshooting ................................................................ 103 Checking

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    563 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us