Codewarrior™ Development Studio for Freescale™ 56800/E Digital Signal Controllers: Mc56f8xxx/Dsp5685x Family Targeting Manual
Total Page:16
File Type:pdf, Size:1020Kb
CodeWarrior™ Development Studio for Freescale™ 56800/E Digital Signal Controllers: MC56F8xxx/DSP5685x Family Targeting Manual Revised: 19 June 2006 Freescale, the Freescale logo, and CodeWarrior are trademarks or registered trademarks of Freescale Corporation in the United States and/or other countries. All other trade names and trademarks are the property of their respective owners. Copyright © 2006 by Freescale Semiconductor company. All rights reserved. No portion of this document may be reproduced or transmitted in any form or by any means, electronic or me- chanical, without prior written permission from Freescale. Use of this document and related materials is gov- erned by the license agreement that accompanied the product to which this manual pertains. This document may be printed for non-commercial personal use only in accordance with the aforementioned license agreement. If you do not have a copy of the license agreement, contact your Freescale representative or call 1-800-377-5416 (if outside the U.S., call +1-512-996-5300). Freescale reserves the right to make changes to any product described or referred to in this document without further notice. Freescale makes no warranty, representation or guarantee regarding the merchantability or fitness of its products for any particular purpose, nor does Freescale assume any liability arising out of the application or use of any product described herein and specifically disclaims any and all liability. Freescale software is not authorized for and has not been designed, tested, manufactured, or intended for use in developing applications where the failure, malfunc- tion, or any inaccuracy of the application carries a risk of death, serious bodily injury, or damage to tangible property, including, but not limited to, use in factory control systems, medical devices or facilities, nuclear facil- ities, aircraft navigation or communication, emergency systems, or other applications with a similar degree of potential hazard. How to Contact Freescale Corporate Headquarters Freescale Corporation 7700 West Parmer Lane Austin, TX 78729 U.S.A. World Wide Web http://www.freescale.com/codewarrior Technical Support http://www.freescale.com/support Table of Contents 1 Introduction 13 CodeWarrior IDE . 13 Freescale 56800/E Digital Signal Controllers . 14 References. 16 2 Getting Started 19 System Requirements . 19 Installing and Registering the CodeWarrior IDE . 19 Creating a Project . 24 3 Development Studio Overview 35 CodeWarrior IDE . 35 Development Process . 36 Project Files. 38 Editing Code . 39 Building: Compiling and Linking . 40 Debugging . 42 4 Target Settings 43 Target Settings Overview . 43 Target Setting Panels. 43 Changing Target Settings . 45 Exporting and Importing Panel Options to XML Files. 46 Restoring Target Settings . 47 CodeWarrior IDE Target Settings Panels . 47 DSP56800E-Specific Target Settings Panels . 48 Target Settings. 49 M56800E Target . 50 C/C++ Language (C Only) . 51 C/C++ Preprocessor . 55 C/C++ Warnings . 57 M56800E Assembler. 62 56800/E Digital Signal Controllers: MC56F8xxx/DSP5685x Targeting Manual 3 Table of Contents M56800E Processor. .64 ELF Disassembler . .68 M56800E Linker . .71 Remote Debugging . .76 M56800E Target (Debugging). .77 Remote Debug Options . .82 5 Processor Expert Interface 85 Processor Expert Overview. .85 Processor Expert Code Generation . .86 Processor Expert Beans . .87 Processor Expert Menu . .89 Processor Expert Windows . .93 Bean Selector. .93 Bean Inspector . .94 Target CPU Window . .96 Memory Map Window. .101 CPU Types Overview . .103 Resource Meter . .104 Installed Beans Overview . .104 Peripherals Usage Inspector . .105 Processor Expert Tutorial . .106 6 C for DSP56800E 121 Number Formats . .121 Calling Conventions and Stack Frames. .123 Passing Values to Functions . .123 Returning Values From Functions . .124 Volatile and Non-Volatile Registers. .124 Stack Frame and Alignment . .128 User Stack Allocation . .129 Data Alignment Requirements . .133 Word and Byte Pointers. .134 Reordering Data for Optimal Usage . .135 Variables in Program Memory . .135 4 56800/E Digital Signal Controllers: MC56F8xxx/DSP5685x Targeting Manual Table of Contents Declaring Program Memory Variables . 136 Using Variables in Program Memory . 136 Linking with Variables in Program Memory. 138 Code and Data Storage . 140 Large Data Model Support . 141 Extended Data Addressing Example. 142 Accessing Data Objects Examples . 142 External Library Compatibility . 144 Optimizing Code. 144 Deadstripping and Link Order . 145 Working with Peripheral Module Registers . 146 Compiler Generates Bit Instructions. 146 Explanation of Undesired Behavior . 147 Recommended Programming Style. 148 Generating MAC Instruction Set . 150 7 High-Speed Simultaneous Transfer 151 Host-Side Client Interface . 151 hsst_open. 151 hsst_close . 152 hsst_read . 152 hsst_write . ..