Low-Level Debugging¶
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.
Open xsdb
prompt¶
Run
C:\Xilinx\Vivado\2017.2\bin\xsdb.bat
Connect to AMDC via xsdb
¶
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
Program AMDC through development environment¶
Load the FPGA bitstream and DSP firmware
Read registers of running program¶
In xsdb
:
targets 2
– connect to the ARM Cortex-A9 core that the code is running onrrd
– prints registers with current values
Read registers of hardware peripherials¶
In xsdb
:
targets 1
– connect to APUrrd
– lists all possible peripherials to read fromExample:
rrd uart0
– read UART0 registers
Read memory address¶
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
Determine why reboot occurs:¶
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/wLook 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
registerForce the reboot to occur by breaking the firmware, etc
rrd slcr
– reread theREBOOT_STATUS
registerLookup bits that have been set: https://www.xilinx.com/support/answers/52030.html