GDB on development board!

Jeremy Bennett jeremy.bennett@embecosm.com
Tue Jan 17 12:02:00 GMT 2012


On Mon, 2012-01-16 at 20:19 -0200, Sergio Durigan Junior wrote: 
> On Monday, January 16 2012, mak visp wrote:
> 
> > I am new to the GDB stuff. I am using my ARM based custom board in
> > that I wanted to debug my code on ARM. Can I do it without JTAG only
> > with GDB connected over serial port? Also is it possible to do it
> > without any OS running on board (I am in starting phase, so no OS
> > yet)? I read the user manual, but could not make out. Any pointer to
> > the material is a great help.
> 
> 
> Hello,
> 
> For other ways of using GDB remotely (without JTAG), have you considered
> gdbserver yet?  Take a look at:
> 
> http://sourceware.org/gdb/current/onlinedocs/gdb/Remote-Debugging.html#Remote-Debugging
> 
> and
> 
> http://sourceware.org/gdb/current/onlinedocs/gdb/Server.html#Server
> 
> As for the question regarding running GDB on a system without OS, others
> can correct me if I'm wrong but I don't think it's possible because GDB
> uses many OS-specific features (such as ptrace, and glibc functions).

Hi Sergio, Mak,

You can run GDB from a host workstation into a remote native board over
JTAG using the GDB Remote Serial Protocol (RSP). You will need to write
a RSP server that drives the JTAG interface of your target board. For a
standard ARM board you will likely find a RSP server already exists. It
will be hardware specific.

This approach is used for many targets. If you find you have to write
your own RSP server, an example that you might find useful is the
OpenRISC 1000. Its remote serial protocol server can be downloaded from
the OpenCores website (www.opencores.org) and is an example of a program
that drives JTAG through a FTDI 2232C USB interface.

There are a number of Embecosm application notes that help explain this.
In particular "EAN4: Howto: GDB Remote Serial Protocol: Writing a RSP
Server" (http://www.embecosm.co.uk/download/ean4.html) and "EAN7:
Integrating the GNU Debugger with Cycle Accurate
Models" (http://www.embecosm.co.uk/download/ean7.html) may prove
instructive.

HTH,


Jeremy

-- 
Tel:      +44 (1590) 610184
Cell:     +44 (7970) 676050
SkypeID: jeremybennett
Email:   jeremy.bennett@embecosm.com
Web:     www.embecosm.com



More information about the Gdb mailing list