Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
spru509f(введение).pdf
Скачиваний:
13
Добавлен:
18.05.2015
Размер:
1.72 Mб
Скачать

www.ti.com

Building Your Program

9.Add main.c, DoLoop.c, and lnk.cmd (this is a linker command file that maps sections to memory) from the folder you created. Browse to the C:\CCStudio_v3.1\c6000\cgtools\lib\ directory and add the rts.lib file for your configured target.

10.You do not need to manually add any include files to your project, because the program finds them automatically when it scans for dependencies as part of the build process. After you build your project, the include files appear in the Project View.

2.3Building Your Program

Now that you have created a functional program, you can build it. Use the Build All function the first time you build the project. An output window will show the build process and status. When the build is finished, the output window will display Build complete 0 errors, 0 warnings.

The Rebuild All command is mainly used to rebuild the project when the project options or any files in the project have changed. For further information, see Section 2.3.

2.4Loading Your Program

After the program has been built successfully, load the program by going to FileLoad Program. By default, Code Composer Studio IDE will create a subdirectory called Debug within your project directory and store the .out file in it. Select practice.out and click Open to load the program.

Note:

Remember to reload the program by choosing FileReload Program if you rebuild the project after making changes.

2.5Basic Debugging

To see Code Composer Studio’s versatile debugger in action, complete the following exercises. For more in-depth information, see Chapter 5.

2.5.1Go to Main

To begin execution of the Main function, select DebugGo main. The execution halts at the Main function and you will notice the program counter (yellow arrow) in the left margin beside the function. This is called the selection margin.

2.5.2Using Breakpoints

To set a breakpoint, place the cursor on the desired line and press F9. In addition, you can set the breakpoint by selecting the Toggle Breakpoint toolbar button. When a breakpoint has been set, a red icon will appear in the selection margin. To remove the breakpoint, simply press F9 or the Toggle Breakpoint toolbar button again.

In main.c, set the breakpoint at the line DoLoop(Input1, Input2, Weights, Output, LOOPCOUNT);As execution was halted at the main function, you can press F5, select DebugRun, or select the Run toolbar button to run the program. Once execution reaches the breakpoint, it halts.

2.5.3Source Stepping

Source stepping is only possible when program execution has been halted. Since you halted at the breakpoint, you can now execute the program line by line using source stepping. Step into the DoLoop function by selecting the Source-Single Step button. Step through a few times to observe the executions. The Step Over and Step Out functions are also available below the Single Step button. Assembly stepping is also available. Whereas source stepping steps through the lines of code, assembly stepping steps through the assembly instructions. For more information on assembly stepping, see Section 5.2.1.

SPRU509F –May 2005

Getting Started Quickly

15

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]