Lab 5: System Initialization
5 - 22 C2000 Microcontroller Workshop - System Initialization
Do not add DefaultIsr_5.c, PieCtrl.c, and PieVect.c. These files will be
added and used with the interrupts in the second part of this lab exercise.
Project Build Options
3. Setup the build options by right-clicking on Lab5 in the Project Explorer window
and select Properties. We need to setup the include search path to include the
peripheral register header files. Under “C2000 Compiler” select “Include
Options”. In the lower box that opens (“Add dir to #include search
path”) click the Add icon (first icon with green plus sign). Then in the “Add directory
path” window type:
${PROJECT_ROOT}/../../F2806x_headers/include
Click OK to include the search path. Finally, click OK to save and close the Properties
window.
Modify Memory Configuration
4. Open and inspect the linker command file Lab_5_6_7.cmd. Notice that the user
defined section “codestart” is being linked to a memory block named BEGIN_M0.
The codestart section contains code that branches to the code entry point of the project.
The bootloader must branch to the codestart section at the end of the boot process. Recall
that the emulation boot mode "M0 SARAM" branches to address 0x000000 upon
bootloader completion.
Modify the linker command file Lab_5_6_7.cmd to create a new memory block
named BEGIN_M0: origin = 0x000000, length = 0x0002, in program memory. You will
also need to modify the existing memory block M0SARAM in data memory to avoid any
overlaps with this new memory block.
5. In the linker command file, notice that RESET in the MEMORY section has been defined
using the “(R)” qualifier. This qualifier indicates read-only memory, and is optional. It
will cause the linker to flag a warning if any uninitialized sections are linked to this
memory. The (R) qualifier can be used with all non-volatile memories (e.g., flash, ROM,
OTP), as you will see in later lab exercises.
Setup System Initialization
6. Modify SysCtrl.c and Watchdog.c to implement the system initialization as
described in the objective for this lab.
7. Open and inspect Gpio.c. Notice that the shared I/O pins have been set to the GPIO
function. Save your work and close the modified files.
Build and Load
8. Click the “Build” button and watch the tools run in the Console window. Check for
errors in the Problems window.