When debugging under the gdb environment, the debugger needs to know what target to connect to. This target is a tiny server daemon, typically running on the host computer. It is equivalent to a gdbserver, although it does not run on the target hardware. This server is called gdbproxy and is derived from rproxy-0.7.
Here we use the IGLOO as example. IGLOO is connected to host via parallel cable. See the list of JTAG devices for other devices that are known to work.
On the host, we run gdb and gdbproxy. Gdbproxy talks to the JTAG device, sitting between gdb and the target. gdb talks with gdbproxy locally via TCP.
Gdb is used the same way as debugging via Ethernet or serial through gdbserver. So the instructions below only describe how to get and install gdbproxy.
The toolchain release includes binaries in the package called blackfin-jtag-tools. See the installing page for more info
You might also want to review the non root usb setup so you don't need to run these tools as the super user all the time.
This is the procedure you normally start with:
bfin-gdbproxy bfin [other special options],e.g, here we debug a BF537-STAMP board $ bfin-gdbproxy bfin Remote proxy for GDB, v0.7.2, Copyright (C) 1999 Quality Quorum Inc. MSP430 adaption Copyright (C) 2002 Chris Liechti and Steve Underwood Blackfin adaption Copyright (C) 2008 Analog Devices, Inc. GDBproxy comes with ABSOLUTELY NO WARRANTY; for details use `--warranty' option. This is Open Source software. You are welcome to redistribute it under certain conditions. Use the '--copying' option for details. Initializing ADI IGLOO JTAG Cable on parallel port at 0x378 IR length: 5 Chain length: 1 Device Id: 00100010011111001000000011001011 Manufacturer: Analog Devices Part: BF537 Stepping: 2 Filename: /home/adam/workspace/jtag/share/jtag/analog/bf537/bf537 warning: bfin: no board selected, BF537 is detected notice: gdbproxy: waiting on TCP port 2000You can try adding the
-q (quiet) and --reset (reset the processor every time it connects) if you like.(gdb) target remote :2000
Gdbproxy will output message:
notice: gdbproxy: connected
The Blackfin will now halt and you can:
$ bfin-gdbproxy bfin Remote proxy for GDB, v0.7.2, Copyright (C) 1999 Quality Quorum Inc. MSP430 adaption Copyright (C) 2002 Chris Liechti and Steve Underwood Blackfin adaption Copyright (C) 2008 Analog Devices, Inc. GDBproxy comes with ABSOLUTELY NO WARRANTY; for details use `--warranty' option. This is Open Source software. You are welcome to redistribute it under certain conditions. Use the '--copying' option for details. Initializing Macraigor Wiggler JTAG Cable on parallel port at 0x378 IR length: 5 Chain length: 1 Device Id: 227c80cb Active: 0 notice: gdbproxy: waiting on TCP port 2000
Make sure you saw message similar to this, otherwise the gdbproxy may not work. Check your JTAG connection, parallel cable, also the USB power supply to the IGLOO.
$ bfin-elf-gdb vmlinux (gdb) target remote :2000
(gdb) b cpuinfo_open (gdb) c
cat /proc/cpuinfo on the target board, it should stopped at cpuinfo_open ().(gdb) hb *0x1000
stamp> boote
To load an ELF binary into memory and execute
(gdb) load blink.dxe Loading section .text, size 0x1b8 lma 0xffa00000 Start address 0xffa00000, load size 440 Transfer rate: 3520 bits in <1 sec, 440 bytes/write. (gdb) c Continuing.
More commands: see GDB help
Note that the above examples assume, that the peripheral hardware has been properly initialized. GDB does not initialize anything on start, since it has no knowledge about the current state of the system. Before you load a program into the Blackfin, make sure you have done the correct initialization - read more hints below.
For different system configurations, GDB scripts are used. GDB scripting is a very powerful feature and helps to automatize different system configurations.
Starting from 2008R1 release, gdbproxy supports dual core debugging of BF561.
To Be Added.
There may be several cases lead to this error”
bfin-gdbproxy bfin Remote proxy for GDB, v0.7.2, Copyright (C) 1999 Quality Quorum Inc. MSP430 adaption Copyright (C) 2002 Chris Liechti and Steve Underwood Blackfin adaption Copyright (C) 2008 Analog Devices, Inc. GDBproxy comes with ABSOLUTELY NO WARRANTY; for details use `--warranty' option. This is Open Source software. You are welcome to redistribute it under certain conditions. Use the '--copying' option for details. Initializing ADI IGLOO JTAG Cable on parallel port at 0x378 error: bfin: detecting parts failed Segmentation fault
If you got message like this, please check whether your ICE or target board is powered on. IGLOO uses a USB cable for power supply, sometimes the USB port you used may not supply enough power.
If you are using a crossover ethernet cable to connect IGLOO and target board, you will get this error message.
In case your system got a double fault and gdbproxy report an error like ” a double fault has occured EMUPC [0xFFA00A1E]”, please restart gdbproxy. Otherwise, it would be in a unstable state.