ARM Technical Support Knowledge Articles

How do I use GDB with a RVI unit to debug my standalone application on an ARM target?

Applies to: RealView ICE and Trace (RVI / RVT)

Answer

Important Notes:

GNU Debugger (GDB) is the standard debugger used by the GNU software community. GDB is used for debugging a wide range of systems from standalone embedded applications to applications running under operating systems like Linux.

RealView ICE (RVI) units provide the ability to use GDB with an industry standard JTAG connection. This particular mode of operation allows a GDB client to connect to the target via the RVI unit over Ethernet. The RVI unit is connected to the target using a JTAG connection.

This connection mode is referred to as an RVI-GDB connection. The RVI unit has a built-in GDB protocol interpreter to translate GDB client commands to JTAG signals. This provides the GDB client with Halting debug-mode capability, without requiring any source modification such as adding a debug monitor.

The following subset of GDB commands are provided for convenience and are not intended to be a complete guide to using GDB:

Configuration:

  1. Run the RVConfig utility and configure the RVI unit for your particular ARM target. Save the configuration by specifying an .rvc file, for example, rvi.rvc.

    > rvconfig

  2. Run the RVIGDBConfig utility and point it to the .rvc config file.

    > rvigdbconfig -f rvi.rvc arm-none-eabi-gdb

    Where "arm-none-eabi-gdb" is your ARM ABI compliant version of the GDB client included with the RVI install.

Connection and Image load:

  1. Run the GDB client

    > arm-none-eabi-gdb
  2. Connect to the target (RVI unit via Ethernet)

    (gdb) target remote <IP Address>:4000

    Note that the port number reflects the device number on the JTAG chain or position behind the Coresight Debug Access Port (DAP). The first device on the chain uses port 4000, the second device port 4001 etc. In a Coresight system the DAP is typically the first device and the devices behind the DAP are interpreted as device 2 and 3, matching the order in which they are positioned in the RVConfig utility.
  3. Load the image into target memory (skip this step if you are debugging code in Flash)

    (gdb) load <image.axf>
  4. Load image symbols

    (gdb) file <image.axf>

Generic GDB debug commands:

ARM specific debug commands (using the monitor command):


Coprocessor registers have similar register IDs. For example, coprocessor 15 (CP15) registers start at ID 0xF800. Coprocessor IDs are not described in this document because they depend on the processor implementation.

Please refer to the Remote Device Debug Interface (RDDI) documentation (CP15Regs.html) for information about coprocessor IDs. This documentation is part of the RealView ICE RDDI Package download available in the Utilities section of the ARM Self-Service Portal.

Notes:

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential