GR712RC-QSG
November 2018, Version 1.0
7 www.cobham.com/gaisler
3. GRMON hardware debugger
3.1. Overview
GRMON is a debug monitor used to develop and debug GRLIB/LEON systems. The CPU and its peripherals are
accessed on the AMBA bus through a debug-link connected to the PC. GRMON has GDB support which makes
C/C++ level debugging possible by connecting GDB to the GRMON's GDB socket. With GRMON one can for
example:
• Inspect LEON and peripheral registers
• Upload applications and/or program the FLASH
• Control execution flow by starting applications (run), continue execution (cont), single-stepping (step), in-
serting breakpoints/watchpoints (bp) etc.
• Inspect the current CPU state listing the back-trace, instruction trace and disassemble machine code.
The first step is to set up a debug link in order to connect to the board. The following section outlines which
debug interfaces are available and how to use them on the GR712RC Development Board, after that a basic first
inspection of the board is exemplified.
Several of the SoC's peripherals may be clock gated off. GRMON will enable all clocks if started with the flag -
cginit. Within GRMON, the command grcg enable all will have the same effect.
GRMON is described on the homepage [http://www.gaisler.com/index.php/products/debug-tools] and in detail in
[RD-4].
3.2. Debug-link alternatives
3.2.1. Connecting via the FTDI USB/JTAG interface
Please see GRMON User's Manual for how to set up the required FTDI driver software. Then connect the PC
and the board using a standard USB cable into the USB-mini J12 USB-JTAG connector and issue the following
command:
grmon -ftdi
3.2.2. Connecting via SpaceWire RMAP interface
GRMON has support for connecting to boards with SpaceWire interfaces as long as the SpaceWire has RMAP
and automatic link start. An Ethernet to SpaceWire bridge (GRESB) is required to tunnel SpaceWire packets from
the Ethernet network over to SpaceWire.
Please see the [RD-4] for information about connecting through a GRESB and optional parameters. Connect
the GRESB SpW0 connector and the GR712RC-BOARD's J3 (SPW-0) or J4 (SPW-1) connector, then issue the
following command:
grmon -gresb
3.3. First steps
The previous sections have described which debug-links are available and how to start using them with GRMON.
The subsections below assume that GRMON, the host computer and the GR712RC-BOARD board have been set
up so that GRMON can connect to the board.
When connecting to the board for the first time it is recommended to get to know the system by inspecting the
current configuration and hardware present using GRMON. With the info sys command more details about the
system is printed and with info reg the register contents of the I/O registers can be inspected. Below is a list of
items of particular interest:
• AMBA system frequency is printed out at connect, if the frequency is wrong then it might be due to noise
in auto detection (small error). See -freq flag in [RD-4].
• Memory location and size configuration is found from the info sys output. If the board has both SRAM
and SDRAM interfaces, SDRAM can be mapped at the SRAM base address using the -nosram option of
GRMON. See [RD-4] for further details.