Lab 5: System Initialization
TMS320F2837xD Microcontroller Workshop - System Initialization 5 - 25
Build and Load
10. Click the “Build” button and watch the tools run in the Console window. Check for
errors in the Problems window.
11. Click the “Debug” button (green bug). A Launching Debug Session window will open.
Select only CPU1 to load the program on (i.e. uncheck CPU2), and then click OK. Then
the CCS Debug perspective view should open, the program will load automatically, and
you should now be at the start of main().
12. After CCS loaded the program in the previous step, it set the program counter (PC) to
point to _c_int00. It then ran through the C-environment initialization routine in the
rts2800_fpu32.lib and stopped at the start of main(). CCS did not do a device reset, and
as a result the bootloader was bypassed.
In the remaining parts of this lab exercise, the device will be undergoing a reset due to
the watchdog timer. Therefore, we must configure the device by loading values into
EMU_KEY and EMU BMODE so the bootloader will jump to “RAMM0” at address
0x000000. Set the bootloader mode using the menu bar by clicking:
Scripts EMU Boot Mode Select EMU_BOOT_SARAM
If the device is power cycled between lab exercises, or within a lab exercise, be sure to
re-configure the boot mode to EMU_BOOT_SARAM.
Run the Code – Watchdog Reset Disabled
13. Place the cursor in the “main loop” section (on the asm(“ NOP”); instruction line) and
right click the mouse key and select Run To Line. This is the same as setting a
breakpoint on the selected line, running to that breakpoint, and then removing the
breakpoint.
14. Place the cursor on the first line of code in main() and set a breakpoint by double clicking
in the line number field to the left of the code line. Notice that line is highlighted with a
blue dot indicating that the breakpoint has been set. (Alternatively, you can set a
breakpoint on the line by right-clicking the mouse and selecting Breakpoint (Code
Composer Studio) Breakpoint). The breakpoint is set to prove that the
watchdog is disabled. If the watchdog causes a reset, code execution will stop at this
breakpoint (or become trapped as explained in the watchdog hardware reset below).
15. Run your code for a few seconds by using the “Resume” button on the toolbar, or by
using Run Resume on the menu bar (or F8 key). After a few seconds halt your code
by using the “Suspend” button on the toolbar, or by using Run Suspend on the
menu bar (or Alt-F8 key). Where did your code stop? Are the results as expected? If
things went as expected, your code should be in the “main loop”.
Run the Code – CCS Issued CPU Reset
16. Perform a CCS CPU reset (soft reset) by clicking on the CPU Reset icon (or by
selecting Run Reset CPU Reset). The program counter should now be at the
entry point of the boot ROM code at 0x3FF16A. To view the boot ROM code click on
View Disassembly…
17. Run your code. Where did your code stop? Are the results as expected? If things went
as expected, your code should have stopped at the breakpoint. What happened is as
follows. The ROM bootloader began execution and since the device is in emulation boot
mode (i.e. the emulator is connected) the bootloader read the EMU_KEY and