1、Programming Development Environment,Copyright 2009 Texas Instruments. All rights reserved.,Module 2 TMS320C28x MCU Workshop,Learning Objectives,Use Code Composer Studio to: Create a Project Set Build Options Create a user linker command file which: Describes a systems available memory Indicates wher
2、e sections will be placed in memory,Learning Objectives,Use Code Composer Studio to: Create a Project Set Build Options Create a user linker command file which: Describes a systems available memory Indicates where sections will be placed in memory,Code Composer Studio,Code Composer Studio includes:
3、Integrated Edit/Debug GUI Code Generation Tools DSP/BIOS,Asm,Link,Editor,Debug,Compile,Graphs, Profiling,Code Simulator,eZdsp,External Emulator,MCU Board,Libraries,lnk.cmd,Build,Code Composer Studio: IDE,Integrates: edit, code generation, and debug Single-click access using buttons Powerful graphing
4、/profiling tools Automated tasks using GEL scripts and CCS scripting Built-in access to BIOS functions Supports TI and 3rd party plug-ins,The CCS Project,List of files: Source (C, assembly) Libraries DSP/BIOS configuration file Linker command files Project settings: Build options (compiler, Linker,
5、assembler, and DSP/BIOS) Build configurations,Project (.pjt) files contain:,Build Options GUI - Compiler,GUI has 8 pages of categories for code generation tools Controls many aspects of the build process, such as: Optimization level Target device Compiler/assembly/link options,Build Options GUI - Li
6、nker,GUI has 3 categories for linking Specify various link options .Debug means the directory called Debug one level below the .pjt file directory $(Proj_dir)Debug is an equivalent expression,Default Build Configurations,Add/Remove your own custom build configurations using Project Configurations Ed
7、it a configuration: Set it active Modify build options Save project,For new projects, CCS automatically creates two build configurations: Debug (unoptimized) Release (optimized) Use the drop-down menu to quickly select the build configuration,Learning Objectives,Use Code Composer Studio to: Create a
8、 Project Set Build Options Create a user linker command file which: Describes a systems available memory Indicates where sections will be placed in memory,Sections,All code consists of different parts called sections All default section names begin with “.” The compiler has default section names for
9、 initialized and uninitialized sections,Compiler Section Names,Note: During development initialized sections could be linked to RAM since the emulator can be used to load the RAM,Placing Sections in Memory,.ebss,.cinit,.text,Sections,.stack,Linking,Linker,Link.cmd,.map,.obj,.out,Memory descriptionHo
10、w to place s/w into h/w,Linker Command File,MEMORY PAGE 0: /* Program Memory */FLASH: origin = 0x300000, length = 0x40000PAGE 1: /* Data Memory */M0SARAM: origin = 0x000000, length = 0x400M1SARAM: origin = 0x000400, length = 0x400 ,Linker Command File,MEMORY PAGE 0: /* Program Memory */FLASH: origin
11、 = 0x300000, length = 0x40000PAGE 1: /* Data Memory */M0SARAM: origin = 0x000000, length = 0x400M1SARAM: origin = 0x000400, length = 0x400 SECTIONS .text: FLASH PAGE = 0.ebss: M0SARAM PAGE = 1.cinit: FLASH PAGE = 0.stack: M1SARAM PAGE = 1 ,Exercise 2,Generic F28x device,M0SARAM (0x400),M1SARAM (0x40
12、0),L0SARAM (0x1000),L1SARAM (0x1000),0x00 0000,0x00 0400,0x00 8000,0x00 9000,FLASH (0x40000),0x30 0000,MEMORY PAGE_: /* Program Memory */_: origin = _ _, length = _ _: /* Data Memory */_: origin = _ _, length = _: origin = _ _, length = _: origin = _ _, length = _ _: origin = _ _, length = _ _ SECTI
13、ONS .text: FLASH PAGE = 0.ebss: M0SARAM PAGE = 1.cinit: FLASH PAGE = 0.stack: M1SARAM PAGE = 1 ,Exercise 2 - Command File,MEMORY PAGE 0: /* Program Memory */FLASH: origin = 0x300000, length = 0x40000PAGE 1: /* Data Memory */M0SARAM: origin = 0x000000, length = 0x400M1SARAM: origin = 0x000400, length
14、 = 0x400L0SARAM: origin = 0x008000, length = 0x1000L1SARAM: origin = 0x009000, length = 0x1000 SECTIONS .text: FLASH PAGE = 0.ebss: M0SARAM PAGE = 1.cinit: FLASH PAGE = 0.stack: M1SARAM PAGE = 1 ,Exercise 2 - Solution,Linker Command File Summary,Memory Map Description Name Location Size Sections Des
15、cription Directs software sections into named memory regions Allows per-file discrimination Allows separate load/run locations,Lab 2: Linker Command File,System Description:TMS320F28335All internal RAMblocks allocated,Placement of Sections:.text into RAM Block L0123SARAM on PAGE 0 (program memory).c
16、init into RAM Block L0123SARAM on PAGE 0 (program memory).ebss into RAM Block L4SARAM on PAGE 1 (data memory).stack into RAM Block M1SARAM on PAGE 1 (data memory),F28335,Memory,on-chip memory,0x00 8000,L0SARAM (0x1000),0x00 0400,M1SARAM (0x400),0x00 C000,L4SARAM (0x1000),0x00 B000,L3SARAM (0x1000),0
17、x00 0000,M0SARAM (0x400),0x00 9000,L1SARAM (0x1000),0x00 A000,L2SARAM (0x1000),0x00 D000,L5SARAM (0x1000),0x00 E000,L6SARAM (0x1000),0x00 F000,L7SARAM (0x1000),Lab 2: Solution - lab2.cmd,MEMORY PAGE 0: /* Program Memory */L0123SARAM: origin = 0x008000, length = 0x4000PAGE 1: /* Data Memory */M0SARAM
18、: origin = 0x000000, length = 0x0400M1SARAM: origin = 0x000400, length = 0x0400L4SARAM: origin = 0x00C000, length = 0x1000L5SARAM: origin = 0x00D000, length = 0x1000L6SARAM: origin = 0x00E000, length = 0x1000L7SARAM: origin = 0x00F000, length = 0x1000 SECTIONS .text: L0123SARAM PAGE = 0.ebss: L4SARAM PAGE = 1.cinit: L0123SARAM PAGE = 0.stack: M1SARAM PAGE = 1.reset: L0123SARAM PAGE = 0, TYPE = DSECT ,ti,