没有合适的资源?快使用搜索试试~ 我知道了~
汽车编程-TASKING VX-toolset for PCP User Guide.pdf
需积分: 0 4 下载量 144 浏览量
2022-07-27
15:25:48
上传
评论
收藏 4.14MB PDF 举报
温馨提示
试读
660页
汽车编程-TASKING VX-toolset for PCP User Guide.pdf
资源详情
资源评论
资源推荐
TASKING VX-toolset for PCP
User Guide
MA161-800 (v6.2r2) March 06, 2018
Copyright © 2018 TASKING BV.
All rights reserved.You are permitted to print this document provided that (1) the use of such is for personal use only
and will not be copied or posted on any network computer or broadcast in any media, and (2) no modifications of the
document is made. Unauthorized duplication, in whole or part, of this document by any means, mechanical or electronic,
including translation into another language, except for brief excerpts in published reviews, is prohibited without the
express written permission of TASKING BV. Unauthorized duplication of this work may also be prohibited by local
statute. Violators may be subject to both criminal and civil penalties, including fines and/or imprisonment. Altium
®
,
TASKING
®
, and their respective logos are registered trademarks of Altium Limited or its subsidiaries. All other registered
or unregistered trademarks referenced herein are the property of their respective owners and no trademark rights to
the same are claimed.
Table of Contents
1. C Language .................................................................................................................. 1
1.1. Data Types ......................................................................................................... 1
1.1.1. Changing the Alignment: __align() ................................................................ 3
1.2. Accessing Memory .............................................................................................. 3
1.2.1. Memory Type Qualifiers .............................................................................. 3
1.2.2. Pointers .................................................................................................. 4
1.2.3. Placing an Object at an Absolute Address: __at() ............................................ 5
1.2.4. Accessing Hardware from C ........................................................................ 6
1.3. Shift JIS Kanji Support ......................................................................................... 7
1.4. Using Assembly in the C Source: __asm() ................................................................ 8
1.5. Attributes ......................................................................................................... 14
1.6. Pragmas to Control the Compiler .......................................................................... 18
1.7. Predefined Preprocessor Macros .......................................................................... 22
1.8. Switch Statement ............................................................................................... 24
1.9. Functions ......................................................................................................... 25
1.9.1. Calling Convention .................................................................................. 25
1.9.2. Register Usage ....................................................................................... 26
1.9.3. Inlining Functions: inline ........................................................................... 26
1.9.4. Interrupt Functions .................................................................................. 28
1.9.5. Intrinsic Functions ................................................................................... 30
1.10. PCP Code Generation ...................................................................................... 37
1.10.1. Non-interruptible Code Generation ............................................................ 38
1.10.2. Interruptible Code Generation .................................................................. 38
1.11. Compiler Generated Sections ............................................................................. 41
1.11.1. Rename Sections .................................................................................. 42
2. Assembly Language ..................................................................................................... 45
2.1. Assembly Syntax ............................................................................................... 45
2.2. Assembler Significant Characters .......................................................................... 46
2.3. Operands of an Assembly Instruction ..................................................................... 47
2.4. Symbol Names .................................................................................................. 47
2.4.1. Predefined Preprocessor Symbols .............................................................. 48
2.5. Registers ......................................................................................................... 48
2.5.1. Special Function Registers ........................................................................ 49
2.6. Assembly Expressions ........................................................................................ 49
2.6.1. Numeric Constants .................................................................................. 50
2.6.2. Strings .................................................................................................. 50
2.6.3. Expression Operators .............................................................................. 51
2.7. Working with Sections ......................................................................................... 52
2.8. Built-in Assembly Functions ................................................................................. 53
2.9. Assembler Directives and Controls ........................................................................ 65
2.9.1. Assembler Directives ............................................................................... 66
2.9.2. Assembler Controls ................................................................................ 113
2.10. Macro Operations ........................................................................................... 125
2.10.1. Defining a Macro ................................................................................. 125
2.10.2. Calling a Macro ................................................................................... 125
2.10.3. Using Operators for Macro Arguments ..................................................... 126
2.11. Generic Instructions ........................................................................................ 130
3. Using the C Compiler .................................................................................................. 133
iii
3.1. Compilation Process ......................................................................................... 133
3.2. Calling the C Compiler ...................................................................................... 134
3.3. The C Startup Code .......................................................................................... 136
3.4. How the Compiler Searches Include Files ............................................................. 137
3.5. Compiling for Debugging ................................................................................... 137
3.6. Compiler Optimizations ..................................................................................... 138
3.6.1. Generic Optimizations (frontend) .............................................................. 139
3.6.2. Core Specific Optimizations (backend) ....................................................... 142
3.6.3. Optimize for Code Size or Execution Speed ................................................ 143
3.6.4. Static Stack Alignment Optimizations ......................................................... 146
3.7. Static Code Analysis ......................................................................................... 147
3.7.1. C Code Checking: CERT C ...................................................................... 148
3.7.2. C Code Checking: MISRA C .................................................................... 150
3.8. C Compiler Error Messages ............................................................................... 151
4. Using the Assembler ................................................................................................... 153
4.1. Assembly Process ............................................................................................ 153
4.2. Calling the Assembler ....................................................................................... 154
4.3. How the Assembler Searches Include Files ........................................................... 155
4.4. Assembler Optimizations ................................................................................... 156
4.5. Generating a List File ........................................................................................ 156
4.6. Assembler Error Messages ................................................................................ 157
5. Using the Linker ......................................................................................................... 159
5.1. Linking Process ............................................................................................... 159
5.1.1. Phase 1: Linking .................................................................................... 161
5.1.2. Phase 2: Locating .................................................................................. 162
5.2. Calling the Linker ............................................................................................. 163
5.3. Linking with Libraries ........................................................................................ 164
5.3.1. How the Linker Searches Libraries ............................................................ 166
5.3.2. How the Linker Extracts Objects from Libraries ............................................ 167
5.4. Incremental Linking .......................................................................................... 167
5.5. Importing Binary Files ....................................................................................... 168
5.6. Linker Optimizations ......................................................................................... 169
5.7. Controlling the Linker with a Script ....................................................................... 170
5.7.1. Purpose of the Linker Script Language ...................................................... 170
5.7.2. Eclipse and LSL .................................................................................... 171
5.7.3. Structure of a Linker Script File ................................................................ 173
5.7.4. The Architecture Definition ...................................................................... 177
5.7.5. The Derivative Definition ......................................................................... 179
5.7.6. The Processor Definition ......................................................................... 182
5.7.7. The Memory Definition ............................................................................ 182
5.7.8. The Section Layout Definition: Locating Sections .......................................... 184
5.8. Linker Labels .................................................................................................. 185
5.9. Generating a Map File ....................................................................................... 188
5.10. Linker Error Messages .................................................................................... 189
6. Using the Utilities ........................................................................................................ 191
6.1. Control Program .............................................................................................. 191
6.2. Make Utility amk .............................................................................................. 193
6.2.1. Makefile Rules ...................................................................................... 193
6.2.2. Makefile Directives ................................................................................. 195
6.2.3. Macro Definitions ................................................................................... 195
iv
TASKING VX-toolset for PCP User Guide
6.2.4. Makefile Functions ................................................................................. 198
6.2.5. Conditional Processing ........................................................................... 198
6.2.6. Makefile Parsing .................................................................................... 199
6.2.7. Makefile Command Processing ................................................................ 200
6.2.8. Calling the amk Make Utility ..................................................................... 201
6.3. Make Utility mkpcp ........................................................................................... 202
6.3.1. Calling the Make Utility ........................................................................... 203
6.3.2. Writing a Makefile .................................................................................. 204
6.4. Archiver ......................................................................................................... 213
6.4.1. Calling the Archiver ................................................................................ 213
6.4.2. Archiver Examples ................................................................................. 215
6.5. Expire Cache Utility .......................................................................................... 217
7. Using the Debugger .................................................................................................... 219
7.1. Reading the Eclipse Documentation .................................................................... 219
7.2. Debugging a PCP Project .................................................................................. 219
7.3. Creating a Customized Debug Configuration ......................................................... 220
7.4. Troubleshooting ............................................................................................... 227
7.5. TASKING Debug Perspective .............................................................................. 227
7.5.1. Debug View .......................................................................................... 228
7.5.2. Breakpoints View ................................................................................... 230
7.5.3. File System Simulation (FSS) View ........................................................... 231
7.5.4. Disassembly View .................................................................................. 232
7.5.5. Expressions View .................................................................................. 232
7.5.6. Memory View ........................................................................................ 233
7.5.7. Compare Application View ....................................................................... 234
7.5.8. Heap View ........................................................................................... 234
7.5.9. Logging View ........................................................................................ 235
7.5.10. RTOS View ......................................................................................... 235
7.5.11. Registers View .................................................................................... 235
7.5.12. Trace View .......................................................................................... 236
7.6. PCP Simulator Configuration .............................................................................. 237
8. Tool Options .............................................................................................................. 239
8.1. Configuring the Command Line Environment ......................................................... 243
8.2. C Compiler Options .......................................................................................... 245
8.3. Assembler Options ........................................................................................... 311
8.4. Linker Options ................................................................................................. 349
8.5. Control Program Options ................................................................................... 393
8.6. Make Utility Options .......................................................................................... 443
8.7. Parallel Make Utility Options ............................................................................... 471
8.8. Archiver Options .............................................................................................. 485
8.9. Expire Cache Utility Options ............................................................................... 500
9. Influencing the Build Time ............................................................................................ 511
9.1. SFR File ......................................................................................................... 511
9.2. MIL Linking ..................................................................................................... 511
9.3. Optimization Options ........................................................................................ 511
9.4. Automatic Inlining ............................................................................................. 512
9.5. Code Compaction ............................................................................................ 512
9.6. Compiler Cache ............................................................................................... 512
9.7. Header Files ................................................................................................... 513
9.8. Parallel Build ................................................................................................... 513
v
TASKING VX-toolset for PCP User Guide
剩余659页未读,继续阅读
klsoft456
- 粉丝: 153
- 资源: 383
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0