FPGA-based Port Expander for Linux


In this work, I wanted to create an infrastructure to be used in future projects. I specifically wanted to set up Raspberry Pi 5 and an Xilinx Spartan-3A that I own for further project ideas. As a first step, I created a simple FPGA-based port expander for Linux. The work I did so far includes;

  • Set up Yocto BSP for Raspberry Pi 5
  • Create custom layer and machine configuration for Raspberry Pi 5 using Yocto Project, in order to tailor several boot elements for boot time optimization.
  • Integrate Qt6 into both image and SDK. Using Qt6 EGLFS platform plugin. Create Qt6 application and SDK for future use. Qt6 application compilable using either Application SDK or Bitbake recipe on demand.
  • Experiment with VHDL in order to port/modify I2C slave state machine for XC3S50A.
  • Create test bench to simulate I2C master.
  • Tailor Raspberry Pi 5 bcm2712 devicetree to integrate I2C slave in i2c1 interface.
  • Create i2c platform driver to communicate with FPGA.
  • Data sent from i2c platform driver to be shown in Xilinx Spartan-3A XC3S50A LED's (As shown in the picture 0x02 is received).
  • Interface a Waveshare 4.3 inch capacitive display using DSI and I2C interfaces. Had to downgrade default kernel version to 6.1 for compatibility.
  • Create several recipes for additional Raspberry Pi tools (vcgencmd, raspinfo) for future use.
  • Customize init scripts, Linux kernel configuration for aforementioned device integration.
  • Integration of XFCE desktop and configuration of Xorg (later removed from project).
  • Simple data frame timing troubleshooting and data format construction based on readings from RIGOL DS1054 scope.

Yocto Layer Adjustments



Overall Architecture



Decode from Logic Analyzer



Experiments & Video


I have also searched how to utilize Raspberry Pi's PCIe interface for faster communication, however unfortunately the Xilinx FPGA I own does not support XDMA interface, therefore for now I am stuck with simpler interfaces.

See More

In order to see more about my work, go back to Work page.