This document outlines various helpful commands for debugging the firmware. These will mostly use the Xilinx System Debugger (xsdb
).
This is a command line tool which interacts with the hardware. One can program the FPGA, read memory and registers, etc.
See the official Xilinx documentation for more xsdb
commands. Also, see this helpful guide for debugging Zynq-based projects.
- Run
C:\Xilinx\Vivado\2017.2\bin\xsdb.bat
- Ensure AMDC JTAG is plugged into PC
- Ensure AMDC is powered on and in a reset state
connect
-- should printtcfchan#0
if connectedtargets
-- should print list of targets, 1-4
- Load the FPGA bitstream and DSP firmware
In xsdb
:
targets 2
-- connect to the ARM Cortex-A9 core that the code is running onrrd
-- prints registers with current values
In xsdb
:
targets 1
-- connect to APUrrd
-- lists all possible peripherials to read from- Example:
rrd uart0
-- read UART0 registers
Ensure code if up and running. In xsdb
:
targets 2
-- connect to the running ARM Cortex-A9 coremrd <memory_address>
-- read from hex global memory address
Boot AMDC with your code prior to reboot. Make sure it is running fine.
In xsdb
:
targets 1
-- connect to APIrrd slcr
-- read from slcr h/w- Look for
reboot_status
in left column. This encodes the reason for the last reboot (persisted through POR). Bits should be set to indicate JTAG debug reset... rwr slcr reboot_status 0x0
-- clear theREBOOT_STATUS
register- Force the reboot to occur by breaking the firmware, etc
rrd slcr
-- reread theREBOOT_STATUS
register- Lookup bits that have been set: https://www.xilinx.com/support/answers/52030.html