18.2.3.4. OpenOCD
Nios® V processor supports the Open On-Chip Debugger for debugging. Open On-Chip Debugger(OpenOCD), is an open source GNU Project Debugger(GDB) server implementation that allows a GDB Client to debug embedded target device. In a standard setup, OpenOCD translates debugging Remote Serial Protocol instructions from the GDB client into signals that is understood by the target device, then requests the device to perform the required action and communicate the result back to the GDB client.
Utility path:../<QPDS version>/quartus/bin64/openocd.exe
Synopsis
openocd [OPTIONS] <CONFIGURATION FILE>
Description
To start a OpenOCD client session using desired device configuration file .
Once you have connected to the OpenOCD client (through gdb, tcl or telnet), run the OpenOCD commands to start debugging. For more information about the list of OpenOCD commands, refer to OpenOCD: General Commands or RISC-V Architecture and Core Commands.
Usage
# Ensure Nios V processor is detected in the JTAG scan chain $ jtagconfig -n 1) Agilex 5E065B Premium DK [USB-1] 0364F0DD A5E(C065BB32AR0|D065BB32AR0) Design hash 0E5A4B074FCDE48D4128 + Node 08986E00 Nios V #0 + Node 0C006E00 JTAG UART #0 + Node 0C206E00 JTAG PHY #0 020D10DD VTAP10 # Create OpenOCD configuration file $ openocd-cfg-gen niosv.cfg # Launch and Verify OpenOCD $ openocd -f niosv.cfg Open On-Chip Debugger 0.11.0-R22.4 Licensed under GNU GPL v2 ...[omitted for brevity]... Info : Listening on port 3333 for gdb connections Info : Listening on port 6666 for tcl connections Info : Listening on port 4444 for telnet connections
Connecting to gdb debugger on another terminal (command prompt) # Launch and Verify GDB debugger $ riscv32-unknown-elf-gdb app_hal.elf -ex 'target extended-remote localhost:3333' GNU gdb (GDB) 13.2 Copyright (C) 2023 Free Software Foundation, Inc. ...[omitted for brevity]... Remote debugging using localhost:3333 0x00000004 in ?? () (gdb)
# Launch and Verify Telnet connection $ telnet 127.0.0.1 4444 Open On-Chip Debugger >
Options
Options | Description |
---|---|
-h, --help | Display help menu |
-f, --file | Use configuration file <name> |
-c, --command | Run <command> |
-d or -d<n>, --debug or --debug<n> | Set debug level to <level>, default value = 3 without <n> argument |
-v, --version | Display OpenOCD version |
-s, --search | Search for config files and scripts |
l, --log_output- | Redirect log output to file <name> |