Ashling* RiscFree* Integrated Development Environment (IDE) for Altera® FPGAs User Guide

ID 730783
Date 4/11/2025
Public
Document Table of Contents

3.3.5.1. Downloading and Debugging Nios® V Processor Application

You can download and debug a Nios® V processor software project on the targeted Altera FPGA using the Visual Studio Code.
Follow these steps to download and debug the project,:
  1. Go to ASHLING PROJECT VIEW > app > Debug Configurations. Click the + icon beside Debug Configurations to list down the supported launch configurations.
  2. Click Nios V Hardware Debugging and specify a name for the launch.
    Figure 122. Debug Configurations
    Figure 123. Create Nios V Hardware Debugging
  3. A debug configuration window appears. An .elf file is auto selected from the project in the Main tab. You can select a different .elf by using the Browse feature.
    Figure 124. Debug Configurations for Nios® V Processor — Main Tab
  4. Click Debugger tab, click the drop-down icon to select appropriate debug probe for the debug session.
  5. Under the Debugger tab, set these settings:
    • Debug probe: Agilex SI/SoC Dev Kit (Name of the FPGA board/development kit)
    • Transport type: JTAG.
    • JTAG frequency: 16 MHz.
  6. Click Auto-detect Scan Chain to automatically detect JTAG scan chain information of the target device. Make your selection for Tap selection and Core selection.
    Figure 125. Debug Configurations for Nios V Processor — Debugger Tab
  7. Leave all other settings as they are, including those in the Startup tab, as the sensible defaults have been set.
    Note: If you turn off the Resume feature, you can start debugging from the processor initialization stage.
    Figure 126. Debug Configurations for Nios® V Processor — Turn off Resume

    This example shows that the program counter is at 0x3c0, which is displayed in the disassembly just after the reset vector. The processor jumps to 0x3c0, which is _start (the beginning of the Nios® V processor initialization).

    If you turn on the Resume feature, you can debug from the user application.
    Figure 127. Debug Configurations for Nios® V Processor — Turn on Resume
    This example shows that the program counter is at 0x37c, which is paused at the main function and is shown in the disassembly. The processor then jumps to 0x37c, which is paused at looper().
  8. Click Debug in the top right corner of the launch configuration dialog.
    Figure 128. Debug Configurations for Nios® V Processor — Startup Tab