# AXI SPI python code

**URL:** <https://discuss.pynq.io/t/axi-spi-python-code/250>\
**Category:** Support\
**Created:** [June 25, 2019, 1:04pm UTC](https://discuss.pynq.io/t/axi-spi-python-code/250 "2019-06-25T13:04:33Z")\
**Posts on this page:** 2\
**Page:** 2

<div class="post-metadata">

**Author:** ![arnoutdekimo](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/arnoutdekimo/32/4210_2.png) [@arnoutdekimo](https://discuss.pynq.io/u/arnoutdekimo)\
**Post date:** [January 31, 2023, 4:09pm UTC](https://discuss.pynq.io/t/axi-spi-python-code/250/21 "2023-01-31T16:09:17Z")

</div>

> [@gpcus](#):
>
> I mean: I can’t use [spidev](https://pypi.org/project/spidev/), can I? the IP is in the PL so linux doesn’t know about it until the overlay is loaded…

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,  
Kr,  
Arnout

---

<div class="post-metadata">

**Author:** ![ntahoturi5922](https://avatars.discourse-cdn.com/v4/letter/n/e47774/32.png) [@ntahoturi5922](https://discuss.pynq.io/u/ntahoturi5922)\
**Post date:** [March 17, 2023, 5:55pm UTC](https://discuss.pynq.io/t/axi-spi-python-code/250/22 "2023-03-17T17:55:58Z")

</div>

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.

Regards

[Previous page](https://discuss.pynq.io/t/axi-spi-python-code/250.md?page=1)
