Knowledge Base
HOME » KNOWLEDGE BASE » FORUM

SPI communication problem between FPGA and Raspberry Pi

We designed a new LoRaWAN Gateway board based on PCB_E336V02A reference design. But the board cannot communicate with Raspberry Pi. There is no response from FPGA.

All components and their locations are similar to reference design except flash memory. We are using SSTI SST25VF040B(4MB) Flash Memory instead of M25P10-A.
We followed steps that:

- Flash memory was programmed with SPI pins of Raspberry Pi by Flashrom Programmer. Programming was done and there was no problem.
- We connected SPI pins of Raspberry Pi to FPGA_HOST pins on the board. We run test scripts on “libloragw” folder. There wasn’t any response. FPGA doesn’t answer anything.(ERROR Message: “no FPGA detected or version not supported (v255)")
- We changed FPGA, but problem is not fixed.
- We programmed flash memory with Lattice HW-USBN-2B Programming Cable, but again problem was not fixed.
- Lastly we changed SX1301, but this didn't fix the problem.

So, I have some questions.

1- We are using different flash memory from reference design. Could the problem be caused by our flash memory?
2- In this link ( https://github.com/Lora-net/packet_forwarder/wiki/Use-with-Raspberry-Pi ), Raspberry pi 2 is used to test LoRa GW reference design. We are using Raspberry Pi 3 Model B V1.2. Do we have to use Raspberry Pi 2 to communicate this FPGA?
3- HIGH or LOW situation of CDONE pin on FPGA didn’t change the communication problem. Is there any other indication that FPGA is working?
4- What is the purpose of SP_BANK1 port which is connected FPGA?
5- LEDs that connected to SX1301 GPIO pins is lighting up slightly. I measured 1.7V on it. Is it a problem?

Is there anyone who has the same problem? Do you have any suggestions to solve this problem?
Avatar
Dear,

You should be able to use any FPGA version. Is SPI activated with "sudo raspi-config" ?
Could you please check your SPI lines and power supply with an oscilloscope ?
Hi Olivier,

Yes, I activated SPI. Also I checked with oscilloscope and logic analyzer. SPI of Raspberry Pİ works correctly. I can program flash memory with Raspberry Pi. I think if SPI is not working on Raspberry pi side, I shouldn't program flash memory. Verifying of flash memory is always succesful.
Avatar
Once programmed, the right interface to talk to the FPGA should be PC_HOST, and not FPGA_HOST. FPGA_HOST is only used to flash the memory.

Can you check this?

Rgds