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.
1. Create Factorial Demo
- Right-click in the Project Explorer and select New > C Project to create a new empty workspace with a new factorial demo project:
- 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.
- Click Next.
- On the Select Board page, select TI->Stellaris->Kits->Stellaris DK-LM3S9D96.
- Click OK.
- Leave the Settings on the Sourcery CodeBench Configuration page set to the defaults.
- Click Finish.
Right-click on the project and select Build Project
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.
3. Debug Launch
From the Run Menu select Debug Configurations
Double-click Sourcery CodeBench Debug
to auto-fill main tab with Project and C/C++ Application information.
Check Debugger Tab settings:
Ensure that ‘Debug interface’ field says Stellaris USB
Ensure that ‘Board’ field says dk-lm3s9d96
Do not modify any other settings as it will not be necessary for this exercise
If there is an error message and Board field is not filled in, press the “Refresh Button”
Press the Debug
The Debug perspective will display the call stack at main() and the factorial source file with program counter marked.
Press the Step Over
button to perform a single source line step.
After stepping, the program counter will advance to the next source line.
As you continue to step, you will see the factorial demo output displayed in the Console view.
Document generated by Confluence on Jul 26, 2012 14:26