This module describes how to create a TI Code Composer Studio v3.3 project and set it up for use with the simulator. This project uses the C6713 Device Cycle Accurate Simulator but the general process can be used for other types of projects. The project is also set up to use DSP/BIOS with the configuration tool.
Introduction
Become familiar with how to create a Code Composer Studio v3.3 project using the simulator and DSP/BIOS.
Reading
SPRU509: Code Composer Studio Getting Started Guide
Description
Before creating a project in Code Composer Studio (CCS), you will need to setup CCS for the board or processor you are going to be using. This module will describe how to make a project using the C6713 simulator.
Run Setup Code Composer Studio. On the right select the C6713 Device Cycle Accurate Simulator and add it to the left. This is the configuration that will be used when CCS is started. Save and quit. Start CCS.
Create a new project in CCS by selecting Project->New... This will bring up a window that will look like Figure 2. Type the name of your project in the Project Name field and it will add a folder with the same name in the Location field. Leave everything else the same. Click Finish and CCS will open your new project. This will look like Figure 3.
After the project is created, make sure the correct processor is chosen in the build option. Select Project->Build Options... and select the processor that applies to the the configuration you set up in the Code Composer Setup tool. Here the C671x is selected to match the C6713 Device Cycle Accurate Simulator.
In order to build a project you must have files in it. To add files you must first create the files and save them. Create a new assembly code file (*.asm), C code file (*.c) or command file (*.cmd) by selecting File->New->Source File. When you save the file give it the correct extension. Add the files to the project by selecting Project->Add Files To Project... and selecting the files. You can see the files in your project by expanding the "+" signs. All projects will need source files and a command file.
For projects that use DSP/BIOS, create a new DSP/BIOS Configuration file for the hardware you are using. Select File->New->DSP/BIOS Configuration ... If you are using the C6713 simulator then select the ti.platforms.sim67xx template.
If you use the template there may be an error in the default settings. If there is no heep set up in any memory bank this must be done first. Click on System->MEM and check the Segment for DSP/BIOS Objects and Segment for malloc()/free(). If they say MEM_NULL you need to set up a memory heep. Go to the SDRAM under MEM, select the properties and check Create a heep in this memory. The size should be 0x00008000. Then go back to System->MEM and change the MEM_NULLs to SDRAM.
Save the file as configuration file test.tcf and add it to your project. Also add the command file test.cmd file to your project.
When developing your main C program for your project it should start with the following code example. Note that the
testcfg.h file is created when the
test.tcf file is compiled. Save the following code in
main.c and add it to your project.
Set up the project for building your
assembly programs by selecting Project->Build Options, clicking on the Linker tab and selecting No Autoinitialization for the Autoinit Model. When you build your
C programs you will want to select Load-time Initialization.
Once you have all your files in your project you can build the project to produce the object file (*.out). Select Project->Build to incrementally build the project or Project->Build All to rebuild all project files. The Project->Build will only perform functions that are needed to bring the project up to date. This option will usually be quicker than the Project->Build All option.
Now that the project has been built you must load the object file onto the target board or simulator. Do this by selecting File->Load Program and selecting the *.out file. The file may be located in a Debug subdirectory.
With the project loaded you can step through the code (Debug->Step Into), view the registers (View->CPU Registers->Core Registers) and debug the results. There are buttons on toolbars that you should become familiar with to aid in the debugging process.
Since you will be often times loading a program immediately after building it you can set up an option so that the load will occur after you build your project. Select Option->Customize... and click on the Program/Project/CIO tab. Make sure the Load Program After Build box is checked.