Lab 2a: Linker Command File
Type “&z” into the address field. Note that you must use the ampersand (meaning
"address of") when using a symbol in a memory window address box. Also note that
Code Composer Studio is case sensitive.
Set the properties format to “Hex – TI style.” This will give you more viewable data in
the window.
Click OK to close the window property selection screen. The memory window will now
open. You can change the contents of any address in the memory window by double-
clicking on its value. This is useful during debug.
21. Open the watch window to view the local variables x and y.
Click: View Watch Window on the menu bar.
Click the “Watch Locals” tab and notice that the local variables x and y are already
present. The watch window will always contain the local variables for the code function
currently being executed.
(Note that local variables actually live on the stack. You can also view local variables in
a memory window by setting the address to “SP” after the code function has been
entered).
22. We can also add global variables to the watch window if desired. Let's add the global
variable “z”.
Click the “Watch 1" tab at the bottom of the watch window. In the empty box in the
"Name" column, type “z”. Note that you do not use an ampersand here. The watch
window knows you are specifying a symbol.
Check that the watch window and memory window both report the same value for “z”.
Trying changing the value in one window, and notice that the value also changes in the
other window.
Single-stepping the Code
23. Single-step through main() by using the <F8> key (or you can use the Single
Step button on the vertical toolbar). Check to see if the program is working as
expected. What is the value for “z” when you get to the end of the program?
End of Exercise
2 - 20 C28x - Programming Development Environment