Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
8 years ago

SPI through FPGA not working on Cyclone V SoC Terasic DE1SoC board

Hi,

I have connected the external SPI device through FPGA fabric to GPIO pins on the board. I'm using SPIM0 (0xFFF00000) I have created new preloader, uboot and linux distro, rbf and dtb file, etc..., everything that is needed i guess.

Nevertheless none of the software is able to interface correctly with SPI devices (i.e. AD7791 and generic spidev device in linux).

drivers give timeout exceptions on any write attempt.

manually writing to SPI registers to trigger spi write gives nothing useful, the tx fifo is being filled with data, but nothing happens on output.

for example:# devmem 0xfff00010 w 0xf# devmem 0xfff00010 w 0x0# devmem 0xfff00008 ; spi enabled

0x00000001# devmem 0xfff00010 w 0x4# devmem 0xfff00060 w 234# devmem 0xfff00060 w 234# devmem 0xfff00060 w 234# devmem 0xfff00060 w 234# devmem 0xfff00060 w 234# devmem 0xfff00028 ; tx not empty

0x00000002# devmem 0xfff00020 ; tx fifo fill level 5

0x00000005# devmem 0xfff00060

0x00000000

nothing changes on the pins, that I can scope. no CS toggling no CLK, no data etc.

pin connection to hps is shown in attachment.

pin localization assignments are correct.

I have also checked that the PINMUX register for SPI to FPGA routing is correctly set:# devmem 0xffd08738

0x00000001

any help would be appreciated! even the idea what to check i could forgot...

1 Reply