Using Eclipse/4
From Manuals
(→Debugging the Lincoln 60s Blinky example application) |
(→OpenOCD) |
||
| Line 5: | Line 5: | ||
[[Image:Configuring_OpenOCD.png|center|frame|alt=Configuring OpenOCD|Figure 7 – Configuring OpenOCD as an external tool]] | [[Image:Configuring_OpenOCD.png|center|frame|alt=Configuring OpenOCD|Figure 7 – Configuring OpenOCD as an external tool]] | ||
| - | To run OpenOCD, click the ‘Run Last Tool’ icon and select OpenOCD. This only needs to be done once you | + | To run OpenOCD, click the ‘Run Last Tool’ icon and select OpenOCD. This only needs to be done once you begin a new Eclipse session as OpenOCD will remain running until Eclipse exits. Any output printed by OpenOCD can be viewed in the console tab. |
[[Image:Running_OpenOCD.png|center|frame|alt=Running OpenOCD| Figure 8 - Starting OpenOCD]] | [[Image:Running_OpenOCD.png|center|frame|alt=Running OpenOCD| Figure 8 - Starting OpenOCD]] | ||
Revision as of 19:49, 15 October 2010
Contents |
Debugging using Eclipse
OpenOCD
OpenOCD is open source application designed to assist in the debugging of embedded target devices and will provide a debugging interface to our device by acting as a GDB Server. It is necessary to have OpenOCD running before beginning a debug session. Eclipse can make this easier by configuring it as an external tool. To do this, select ‘Run,’ ‘External Tools,’ ‘External Tools Configurations…’ and double-click on ‘Program’ to create a new program configuration. Specify the name, location, and working directory of your OpenOCD configuration. Advance to the ‘Build’ tab, unselect ‘Build before launch,’ click ‘Apply’ and then ‘Close.’
To run OpenOCD, click the ‘Run Last Tool’ icon and select OpenOCD. This only needs to be done once you begin a new Eclipse session as OpenOCD will remain running until Eclipse exits. Any output printed by OpenOCD can be viewed in the console tab.
Debug Configuration
Before beginning a debug session, a debug configuration must be made describing how Eclipse will handle debugging the application. To do this, right click on the project you wish to debug, select ‘Debug As,’ ‘Debug Configurations,’ and double-click ‘Zylin Embedded debug (Native)’ to create a new configuration. Specify the name for this configuration and browse to the application binary for this project.
Advance to the ‘Debugger’ tab and if necessary, change the GDB debugger to match your toolchain. Advance to the ‘Commands’ tab and enter the following for the initialization commands:
target remote localhost:3333 monitor jtag arp_init monitor reset init b main load
Enter the following for the run commands:
j ResetISR
Click ‘Apply’ and ‘Close’ to complete the debug configuration. Debugging To begin a new debug session, click the arrow next to the Debug icon and select ‘Debug Configurations…’
Click ‘Debug’ and click ‘Yes’ when Eclipse prompts you to move to the debug configuration. Your perspective should look similar to the figure below. The Resume, Suspend, Terminate, Step Into, and Step Over buttons are highlighted in red.
The program should be stopped at the first instruction in main. This is due to specifying the breakpoint main as one of the debug initialization commands. You can view your source code in the center of the screen and navigate through the project in the Outline tab on the right. Details about your current debug configuration can be seen in the Debug tab in the upper left hand corner. Current variables, breakpoints, and register values can be seen in their corresponding tabs in the upper right hand corner. Console output can be viewed in the Console tab at the bottom. To step to the next instruction, click the ‘Step Over’ icon. To step to the next assembly instruction, click the ‘Instruction Stepping Mode’ icon and click the ‘Step Over’ icon. Assembly code can then be viewed on the right next to the Outline tab. To insert a breakpoint, double-click on the bar to the left of the instruction that you wish to break at. To add a breakpoint condition, right click on the breakpoint and select ‘Breakpoint Properties,’ ‘Common,’ and enter the breakpoint condition. To watch an expression, select the variable, right click, and select ‘Add watch expression…’ The expression can then be viewed in the Expressions tab in the upper right hand corner of the screen. The Resume, Suspend, and Terminate buttons can simply be used to continue, break, or end the debugging session.
Debugging the Eagle 50s Blinky example application
Please follow these steps to debug the Eagles blinky example application using open OCD:
- 1.
- 2.
- 3.
Debugging the Lincoln 60s Blinky example application
Please follow these steps to debug the Lincolns blinky example application using open OCD for the first time:
- 1. Open the Eclipse IDE
- 2.
- 3.






