Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| dt_openocd [2014/02/12 21:30] – yusa | dt_openocd [2014/06/27 09:35] (current) – added flyswatter usb configuration beckmanf | ||
|---|---|---|---|
| Line 20: | Line 20: | ||
| < | < | ||
| git clone git:// | git clone git:// | ||
| + | </ | ||
| + | |||
| + | Install the libusb-1.0 package | ||
| + | |||
| + | < | ||
| + | sudo apt-get install libusb-1.0-0-dev | ||
| + | ./bootstrap | ||
| + | ./configure --prefix=$HOME/ | ||
| + | make | ||
| + | make install | ||
| + | </ | ||
| + | |||
| + | Add the file / | ||
| + | |||
| + | < | ||
| + | # Flyswatter JTAG Debugger | ||
| + | SUBSYSTEMS==" | ||
| </ | </ | ||
| Line 153: | Line 170: | ||
| reg [NAME] [VALUE] | reg [NAME] [VALUE] | ||
| </ | </ | ||
| + | |||
| === Debugging with gdb === | === Debugging with gdb === | ||
| - | Follows soon... | + | If you want to debug your hardware more comfortable you are able to use gdb. |
| + | You should use the gdb provided by your Toolchain. For example mipsel-none-elf-gdb for a MIPS architecture. | ||
| + | < | ||
| + | mipsel-none-elf-gdb main.elf | ||
| + | </ | ||
| + | |||
| + | |||
| + | Connect to the gdbserver on the local pc using port 3333. | ||
| + | |||
| + | < | ||
| + | (gdb) target remote localhost: | ||
| + | </ | ||
| + | |||
| + | Send commands to gdbserver using the monitor command | ||
| + | |||
| + | < | ||
| + | (gdb) monitor reset halt | ||
| + | </ | ||
| + | |||
| + | Now the hardware performs a reset and halts directly. You can use gdb as normal: | ||
| + | |||
| + | You can list the source code: | ||
| + | |||
| + | < | ||
| + | (gdb) list | ||
| + | </ | ||
| + | |||
| + | Set breakpoints (e.g. at line 27) | ||
| + | |||
| + | < | ||
| + | (gdb) br 27 | ||
| + | </ | ||
| + | |||
| + | Run the program until the next breakpoint occurs. | ||
| + | |||
| + | < | ||
| + | (gdb) continue | ||
| + | </ | ||
| + | |||
| + | Walk step by step through your source code | ||
| + | |||
| + | < | ||
| + | (gdb) next | ||
| + | </ | ||
| + | |||
| + | or print variable content | ||
| + | |||
| + | < | ||
| + | (gdb) print [var] | ||
| + | </ | ||