AXI SPI python code

Well, I’m a bit late to the party, but, yes, you can. I did exactly that:

  • By default the EMIO pins are routed to the PL.
  • If you enable the spidev node in the devicetree (which requires a DIFFERENT compatible name these days (e.g. “spi-petra”)) (which you can do by dynamically loading and overlay in /sys/kernel/config/device-tree/overlays), the kernel will dynamically load the spidev driver, and as long as you create a bitfile which routes the EMIO pins to the correct outputs, this actually works.

That being said, there was a bug in the v2021 kernel that I ran into, which caused glitches in the driver. It seems to be fixed in the v2022.1 release.

(Obviously using the AXI-SPI block will also work, but then you basically move all the work into userspace – which indeed is the whole point of the pynq I guess – but for stuff that’s already built-in into the PS, there’s no need to reinvent the wheel)

Hope this helps someone,

I am not sure if there is progress of axi spi python code driver available in pynq. I am trying to interface with an AFE chip (Analog Front End) that can go up to 85MSPS. Is there anything available I can use that to interface with type high speed chip? hopefully one I can change the clock rate. I have tried spidev but I get an error that a file does not exits.

Any help is truly appreciated.