I am sharing what works for me. It may not work for you or it may fail over time. You may suffer data loss or worse. I disclaim all warranties and representations.
- Xilinx Microprocessor Debugger (XMD)
- GDB capable of understanding the target machine
Debugging the Kernel
When developing a device driver, having access to the linux internals using GDB may be the key to meeting that deadline. On the zedboard, debugging the kernel with GDB is actually very easy with the help of the Xilinx Microprocessor Debugger, or XMD for short.
XMD is included with the Vivado Design Suite from Xilinx. In case you are working with the older ISE Design Suite, the included XMD should work as well.
- Connect the JTAG to the zedboard (or a micro usb to the PROG USB port) and boot it.
- Open a shell and run
1 2 3 4 5 6 7
connect arm hw. This will start a GDB server at
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
Open a new shell and go to the directory where the kernel sources are located, the ones you used to build the kernel, and run
In my case I am using
arm-xilinx-eabi-gdbbut any gdb cross-build for arm will do. We are passing
vmlinuxto the debugger, so it can read the kernel symbols.
1 2 3 4 5 6 7 8 9 10
- Then, under the GDB command prompt, enter:
target remote localhost:1234
1 2 3 4 5
- And now GDB is ready for debugging those kernel hangs. Enter
continuein the gdb prompt so linux can continue it’s normal operation. You can come back anytime and stop it in order to debug it.
- Make sure you have enabled the kernel debug symbols in the config file of the
CONFIG_DEBUG_INFOwill do the trick.