Forum Discussion
Requesting help debugging the PCIe root port example on another board than the devkit
Hello,
I am trying to follow the instruction for the PCIe root port example design https://altera-fpga.github.io/rel-25.1/embedded-designs/agilex-5/e-series/premium/pcie_rp/ug-pcie_rp-agx5e-premium/. Rather than the DK-A5E065BB32AES1 development kit, I am trying to get this example running on a Terasic Comet A65 board.
I have compiled the FPGA design with some modifications to the pins according to the Comet board, and I have been able to configure the FPGA using JTAG. I am booting the HPS first and I successfully am able to load in u-boot and linux kernel. However, the moment I try to write to the HPS2FPGA or LWHPS2FPGA bridges the CPU completely freezes.
Using signal tap I have tried to find if there is any issues with resets or clocks, but so far I have not seen any reset that is still active, and it seems like all the clocks are running. I have implemented some counters and can see that they increment, so the FPGA seems configured. I have not been able to see any traffic on the HPS2FPGA bridges at all.
I don't know what else I could try in order to debug this, is there anyone who might have a suggestion?
1 Reply
- ai_responder
Community Manager
The CPU-freeze symptom on an HPS2FPGA/LWHPS2FPGA access is almost always a stalled AXI transaction — the HPS issues the access and waits indefinitely for a response. The most common causes in a ported design are below.
1. Bridge clock not running in the FPGA fabric (most likely culprit)
The H2F bridge accepts its clock from the FPGA fabric viahps2fpga_axi_clock. HPS-to-FPGA Bridge Similarly, the LWH2F initiator interface operates in thelwhps2fpga_axi_clockclock domain, which is provided by custom logic in the FPGA fabric. Lightweight HPS-to-FPGA Bridge Clocks and Resets If the PCIe example design derives these clocks from a PLL that itself depends on the PCIe reference clock or some other source that isn't yet stable when Linux first touches the bridge, the bridge will never complete the AXI handshake and the CPU stalls. Use Signal Tap to verify bothhps2fpga_axi_clockandlwhps2fpga_axi_clockare actively toggling at the moment you attempt the access — not just that PLLs are locked in a "steady state" test.
2. Reset not wired correctly
Theh2f_resetsignal must be connected tohps2fpga_axi_resetfor proper bridge operation. HPS to FPGA Manager Similarly,h2f_resetmust be connected tolwhps2fpga_axi_resetfor the LWH2F bridge. Lightweight HPS to FPGA Manager In a ported design this connection is easy to accidentally break if you regenerated the Platform Designer system. Confirm both are wired in your.qsys/ Platform Designer view.
3. Bridge not enabled from the HPS software side
The bridges must be explicitly enabled in software. From Linux, read back the bridge manager enable register to confirm the H2F and LWH2F bridges are actually released. A quick sanity check is to confirm withdevmem2that the enable bits are set before the offending access. For full FPGA configuration the documented procedure is to disable and then re-enable the bridge before and after sending the bitstream. Table 2. Configuration versus Partial Configuration — SDM EL3 EL3 HPS EL2 If your u-boot or boot script does not re-enable them after FPGA configuration, the bridges remain gated.
4. No connected subordinate in the FPGA fabric
If the HPS2FPGA or LWHPS2FPGA AXI port in your Platform Designer system is exported (not connected to any subordinate IP), the transaction will hang waiting for a response. Confirm the bridge output is connected to at least one subordinate (even just an on-chip memory or a loopback) in the design you compiled for the Comet board.
5. Address range
The LWHPS2FPGA window base address is0x00_2000_0000, size 512 MB. 10. Address Map > 10.2. Total Address Spaces > 10.2.2. Total Address Map Tabular > Table 311. Tabular Total System Address Maps Example — Hard Processor System Technical Reference Manual The HPS2FPGA window base address is0x00_4000_0000, size 1 GB. 10. Address Map > 10.2. Total Address Spaces > 10.2.2. Total Address Map Tabular > Table 311. Tabular Total System Address Maps Example — Hard Processor System Technical Reference Manual Confirm your Linuxdevmemor driver access targets these ranges, not some other address.
6. NOC privilege enforcement
The LWHPS2FPGA target socket has a default privilege level of Privileged, enforced by the NOC, and the setting is programmable. 13. System Interconnect and Firewalls > 13.4. System Interconnect and Firewalls Functional Description > 13.4.3. Transaction Privilege > Table 373. Target Privilege — Hard Processor System Technical Reference Manual The HPS2FPGA target socket is likewise Privileged and enforced by the NOC. 13. System Interconnect and Firewalls > 13.4. System Interconnect and Firewalls Functional Description > 13.4.3. Transaction Privilege > Table 373. Target Privilege — Hard Processor System Technical Reference Manual If the NOC firewall is misconfigured, the transaction can be blocked silently. Check whether you have any custom firewall or NOC settings in your BSP that differ from the default.
Recommended debug sequence:- Signal Tap: probe
hps2fpga_axi_clockandlwhps2fpga_axi_clockwhile the CPU is frozen — confirm they are toggling. - From Linux, read the bridge manager enable register and confirm both bridges are enabled before attempting the write.
- In Platform Designer, verify
h2f_reset → hps2fpga_axi_resetandh2f_reset → lwhps2fpga_axi_resetare both connected. - Temporarily connect the bridge output to a simple on-chip memory in the FPGA design to rule out a missing subordinate.
- Try a read from a known-safe address in the bridge window (e.g., the base address) first rather than a write, to see whether both directions stall equally.
Note: To continue using AI Responder, please start your next inquiry with ai_responderDisclaimer: AI-generated responses may contain errors or omissions. Please verify technical guidance with official Altera documentation before implementation.
Thank you very much.
- Signal Tap: probe