Building, Downloading, and Debugging Factorial Demo on the Stellaris DK-LM3S9D96 

Version 8

    Introduction

    This document shows the minimum sequence of steps to test that Sourcery CodeBench for Stellaris can debug a Stellaris DK-LM3S9D96 board over the Stellaris USB interface.  You will find much more detail about using the IDE, using other debug probes, libraries, and configuring custom targets in the CodeBench Getting Started Guide, which is available from the CodeBench Help Menu in html format.  It is also provided as a pdf document.

    This exercise also generally confirms the following:

    • Sourcery CodeBench for Stellaris is properly installed
    • Stellaris drivers are installed and functioning
    • Sourcery CodeBench license is setup and working
    • Project build succeeds
    • GDB and Sprite are functioning:  Debug connection can be established, breakpoints can be set, code can be stepped through, registers and memory can be displayed, and so on
    • Default CS3 and runtime is working on the target
    • Hosted mode is built correctly and system is functioning as confirmed by display of Factorial output in Console View.
    NOTE:  Click images below to display clearly.
    Before you begin:

    Ensure that the Debugger back end (sprite) sees the board. If the Stellaris drivers were installed correctly, the sprite should be able to identify the armusb device as shown in this screenshot by running the sprite executable with the -i option.  This is a big step and best verified if you are newly setting up your Stellaris hardware.

    21200946.png

    1. Create Factorial Demo

    1. Right-click in the Project Explorer and select New > C Project to create a new empty workspace with a new factorial demo project:
      21200947.png
    2. In the C Project wizard, enter a Project name, select Executable->Factorial C Project, and ensure that Sourcery CodeBench for Stellaris EABI toolchain is selected.
    3. Click Next.
      21200948.png
    4. On the Select Board page, select TI->Stellaris->Kits->Stellaris DK-LM3S9D96.
    5. Click OK.
      21200949.png

    6. Leave the Settings on the Sourcery CodeBench Configuration page set to the defaults.
    7. Click Finish.
      21200950.pnge.

    2. Build

    1. Right-click on the project and select Build Project.
      21200951.png

    2. Ensure output image is created successfully by checking build console for build finished message and no errors.  You will also be able to see the image in the project under the Binaries node. 21200952.png

    3. Debug Launch

    1. From the Run Menu select Debug Configurations:
      21200953.png

    2. Double-click Sourcery CodeBench Debug to auto-fill main tab with Project and C/C++ Application information.
      21200954.png

    3. Check Debugger Tab settings:

      1. Ensure that ‘Debug interface’ field says Stellaris USB

      2. Ensure that ‘Board’ field says dk-lm3s9d96

      3. Do not modify any other settings as it will not be necessary for this exercise

      4. If there is an error message and Board field is not filled in, press the “Refresh Button”

    4. Press the Debug button
      21200955.png

     

    4. Debug

    1. The Debug perspective will display the call stack at main() and the factorial source file with program counter marked.
      21200956.png

    2. Press the Step Over button to perform a single source line step.
      21200957.png

    3. After stepping, the program counter will advance to the next source line.
      21200958.png

    4. As you continue to step, you will see the factorial demo output displayed in the Console view.
      21200959.png

     

     

     

     

     

    Document generated by Confluence on Jul 26, 2012 14:26