logo资料库

IAR IDE用户手册.pdf

第1页 / 共30页
第2页 / 共30页
第3页 / 共30页
第4页 / 共30页
第5页 / 共30页
第6页 / 共30页
第7页 / 共30页
第8页 / 共30页
资料共30页,剩余部分请下载后查看
CC1110/CC2430/CC2510 IAR IDE User Manual Rev. 1.2 SWRU038 Page 1 of 29
CC1110/CC2430/CC2510 Table of contents INTRODUCTION .........................................................................................................................3 1 DEFINITIONS...............................................................................................................................3 2 INSTALLATION...........................................................................................................................4 3 CHIPCON CC1110/ CC2510 EXTENSIONS........................................................................................4 3.1 Configuration Files............................................................................................................................................................... 4 3.1.1 Chipcon Library Files........................................................................................................................................................... 4 3.1.2 CHIPCON CC2430 EXTENSIONS .......................................................................................................5 3.2 Configuration Files............................................................................................................................................................... 5 3.2.1 Chipcon Library Files........................................................................................................................................................... 5 3.2.2 CC1110/ CC2510 LINKER FILE................................................................................................6 4 XDATA RAM ...................................................................................................................................6 4.1 CODE ................................................................................................................................................7 4.2 Create HEX-file..................................................................................................................................................................... 7 4.2.1 CC2430 LINKER FILE ................................................................................................................8 5 XDATA RAM ...................................................................................................................................8 5.1 CODE ................................................................................................................................................9 5.2 Near code model ................................................................................................................................................................. 10 5.2.1 Banked code model ............................................................................................................................................................. 11 5.2.2 Create HEX-file................................................................................................................................................................... 12 5.2.3 DEBUGGER ................................................................................................................................14 6 ABSOLUTE PLACEMENT OF CODE AND VARIABLES.................................................15 7 CODE ..............................................................................................................................................15 7.1 VARIABLES.....................................................................................................................................15 7.2 8 CC2430 IEEE ADDRESS...........................................................................................................16 8.1 WRITE AN ADDRESS........................................................................................................................16 READ AN ADDRESS .........................................................................................................................16 8.2 TUTORIAL..................................................................................................................................18 9 CREATE A NEW PROJECT.................................................................................................................18 9.1 9.2 OPTIONS .........................................................................................................................................19 9.2.1 General Options, Code Model Near (Applies also to CCxx10) ......................................................................................... 20 9.2.2 General Options, Code Model Banked (Does not apply to CCxx10)................................................................................. 23 Linker .................................................................................................................................................................................. 24 9.2.3 9.2.4 Debugger............................................................................................................................................................................. 25 9.3 INCLUDE SOURCE FILES ..................................................................................................................26 9.4 COMPILE AND LINK........................................................................................................................27 DEBUG............................................................................................................................................28 9.5 10 DOCUMENT HISTORY............................................................................................................29 SWRU038 Page 2 of 29
CC1110/CC2430/CC2510 Introduction 1 This manual is written to clarify some aspects that have to be taken into consideration when working with CC2430, CC2510 or CC1110 together with the IAR Workbench. The CC2431 is in most of the aspects described in this manual equal to CC2430, and will not be mentioned explicit. CC2431 is only delivered with a flash size of 128 kB. Every configuration file available for CC2430 is also available for CC2431. 2 Definitions CC2430-F32 CC2430-F64 CC2430-F128 CCxx10 CC2430 with 32KB FLASH CC2430 with 64KB FLASH CC2430 with 128KB FLASH Refers to either CC2510 or the CC1110. SWRU038 Page 3 of 29
CC1110/CC2430/CC2510 Installation 3 Install the IAR Embedded Workbench as described in the IAR User Manual. 3.1 Chipcon CC1110/ CC2510 Extensions 3.1.1 Configuration Files C2510/CC1110 has 4 configuration files associated. For CC2510 these files are installed with IAR Workbench, for CC1110 they can be downloaded from our web site. The configuration files should be located according to Table 2. File name CCxx10.i51 CCxx10.ddf lnk51ew_ccxx10.x cl ioCCxx10.h Location C:\Program Files\IAR Systems\Embedded Workbench 4.05\8051\config\derivatives\chipcon C:\Program Files\IAR Systems\Embedded Workbench 4.05\8051\config\derivatives\chipcon C:\Program Files\IAR Systems\Embedded Workbench 4.05\8051\config C:\Program Files\IAR Systems\Embedded Workbench 4.05\8051\inc Table 1: Configuration files Description Setup some parts of an IAR Project. Describe each register used in the debugger. Set up the linker to reflect CCxx10. Header file for CCxx10. 3.1.2 Chipcon Library Files The files which are described here are part of the Chipcon library and can be downloaded from www.chipcon.com. In the IAR standard library, cexit will by default occupy one of the four hardware breakpoints. To free this breakpoint include the file below in the project. • Chipcon_cexit.s51 Note: Add $TOOLKIT_DIR$\SRC\LIB\ to Options -> Assembler -> Additional include directives. SWRU038 Page 4 of 29
CC1110/CC2430/CC2510 3.2 Chipcon CC2430 Extensions 3.2.1 Configuration Files CC2430 has five configuration files associated. These files are installed with IAR Workbench. The configuration files are located according to Table 2. File name CC2430.i51 CC2430.ddf lnk51ew_cc2430.xcl lnk51ew_cc2430b.xcl ioCC2430.h Location C:\Program Files\IAR Systems\Embedded Workbench 4.05\8051\config\derivatives\chipcon C:\Program Files\IAR Systems\Embedded Workbench 4.05\8051\config\derivatives\chipcon C:\Program Files\IAR Systems\Embedded Workbench 4.05\8051\config C:\Program Files\IAR Systems\Embedded Workbench 4.05\8051\config C:\Program Files\IAR Systems\Embedded Workbench 4.05\8051\inc Table 2: Configuration files Description Setup some parts of an IAR Project. Describe each register used in the debugger. Set up the linker to reflect CC2430. Set up the linker to reflect CC2430 with banked code model. Header file for CC2430. 3.2.2 Chipcon Library Files Some of the functions in the library included with IAR Workbench cannot be used with CC2430. The files which are described here are part of the Chipcon library and can be downloaded from www.chipcon.com. In the IAR standard library, cexit will by default occupy one of the four hardware breakpoints. To free this breakpoint include the file below in the project. • Chipcon_cexit.s51 To use banked code model the following files have to be included in the project, they will overwrite the files that are included by default in the IAR library. • Chipcon_cstartup.s51 • Chipcon_banked_code_support.s51 Note: Add $TOOLKIT_DIR$\SRC\LIB\ to Options -> Assembler -> Additional include directives. SWRU038 Page 5 of 29
CC1110/CC2430/CC2510 4 CC1110/ CC2510 Linker File There is one linker file for the CC2510 and one for CC1110. 4.1 XData RAM The linker files set up 4k of XData RAM. The range from 0xFDAA – 0xFEFF is used to store register values during power mode (PM) 2 and 3. Hence, any data stored here before entering PM 2/3 will be lost. If PM 2/3 is not used, the entire range from 0xF000 – 0xFEFF can be used safely. The XData RAM memory map in Figure 3 is reflected in the linker file. IData Lose data in PM2/3 Retain data in all PM 0xFFFF 0xFF00 0xFEFF 0xFDAA 0xFDA9 0xF000 Figure 1: XData RAM Memory Figure 3 shows how XData is organized. To place variables in the memory space which is not retained will have to be explicitly located in that memory segment (see chapter 7.1). Note: If your application is not using PM2/ PM3 you can change the linker file to use the full XData memory. Change the line below in lnk51ew_cc1110.xcl or lnk51ew_cc2510.xcl: From: -D_IXDATA_END=FDA9 To: -D_IXDATA_END=FEFF SWRU038 Page 6 of 29
CC1110/CC2430/CC2510 4.2 Code The CCxx10 has 32 kB of code memory. This is reflected in the linker file the following way: -D_CODE_START=0x0000 -D_CODE_END=0x7FFF // 32KB code 4.2.1 Create HEX-file To generate a hex-file that can be downloaded to the CCxx10 by the Chipcon Flash Programmer, setup the Project Options as shown in Figure 7. Figure 2: HEX-file generation SWRU038 Page 7 of 29
CC1110/CC2430/CC2510 5 CC2430 Linker File CC2430 is delivered in three different versions CC2430-F32, CC2430-F64 and CC2430- F128. There are two linker files for CC2430, lnk51ew_cc2430.xcl and lnk51ew_cc2430b.xcl. They both reflect the physical aspects of CC2430. Lnk51ew_cc2430b.xcl is for CC2430-F128 and banked code model, lnk51ew_cc2430.xcl is for use with non-banked code, and can be edited to reflect any chip model. 5.1 XData RAM The linker file is by default set up to use 4k of XData RAM. The XData RAM memory map in Figure 3 is reflected in the linker file. Figure 3: XData RAM Memory CC2430 has 8k XData RAM memory, but only 4k is preserved during Power Mode 2 and Power Mode 3. Figure 3 shows how XData is organized. To place variables in the memory space which is not retained will have to be explicitly located in that memory segment (see chapter 7.1). Note: If your application is not using PM2/ PM3 you can change the linker file to use the full XData memory. Change the line below in lnk51ew_cc2430[b].xcl: From: -D_IXDATA_START=F000 // The internal xdata is 4k. To: -D_IXDATA_START=E000 // using low power RAM as normal RAM SWRU038 Page 8 of 29
分享到:
收藏