Zynq design from scratch. Part 20.
Debugging a software application
When we use SDK to debug applications, the steps are similar to those for running an application, except we create a debug configuration instead of a run configuration. A collection of windows (views) provides a complete debugging environment. This debug perspective should be familiar to those who have used Eclipse-based IDEs, and includes a debug window showing the state of the session with a call stack, source viewers, disassembly, memory, register, other views, and console. We can set breakpoints and control execution with familiar debugger commands.
New in SDK Xilinx introduces System Debugger, based on the Eclipse Target Communications Framework (TCF), System Debugger delivers true multi-processor SoC design and debug. For example, in a Zynq-based design, System Debugger displays both ARM CPUs and multiple MicroBlaze soft-processors, in the same debug session, through a single JTAG cable; for an uprecedented level of insight between the hardened processing system, and any additional processing that we have added to the programmable logic.
- Based on the Eclipse Target Communication Framework (TCF)
- Homogenous and heterogeneous multi-processor support
- New in 2013.3 Linux application debug on the target
- Hierarchical Profiling
- Bare-metal and Linux development
- Supporting both SMP and AMP designs
- Associate hardware and software breakpoints per core
- NEON™ library support
Starting a debug session
To start a debug session right-click the application name in the Project Explorer and select:
Debug As->Debug Configuration
We will change to the debug perspective in Eclipse. Click Yes.This is our first exposure to the debugger. Here we can step through our code, watch variables, set breakpoints and even modify registers and memory. In the Variables window we can see the four variables we created in our application. Keep an eye on these as we step through the code.
1. In the editor window, turn on the line numbers by right-clicking in the light blue space to the right of the pane and select: Show Line Numbers.
2. Set a breakpoint at the print statement that displays the brightness selected. Double-click the space immediately to the left of this line. If set correctly a breakpoint icon will appear on this line as shown here.
3. Start the program. The blue arrow shows where the current program counter is located.
4. Click the Resume button to start program execution.
Resume Terminate Step Over
5. The program will wait for console input and then stop at the breakpoint.
6. Let's take a look a the variables.
7. Run through the loop a few more times by selecting Resume. Experiment with setting breakpoints and looking at variables. When done clear all breakpoints by viewing the breakpoint tab and unchecking any breakpoint we added.
8. Terminate the running process by clicking on the Terminate button.
9. Return to the C/C++ perspective by selecting it from the icon in the upper right corner.
After finishing lab1 and lab2 we now know how to build a processing system including our own hardware blocks. With this knowledge we can start building much more complex systems and writing much smarter application programs. I wish you good luck.
In my next blog session I will return to the processing system and install Linux and run it on the ARM Cortex-A9 processor.
Top Previous Next