BeagleV and SPI

Hello all,
are the SPI-interfaces on the standard Cape design accessible in the out-of-the-box design?
I tried to use spidev from Python but even though I see spi0…3 in /sys/class/spi_master I cannot open these.
Any ideas?

Cheers
Moadl

There is one SPI interface on P9_17/P9_18/P9_21/P9_22

For reference, the default cape gateware IO list can be found here: sources/FPGA-design/script_support/components/CAPE/DEFAULT/Readme.md · main · BeagleV-Fire / Gateware · GitLab

Hi @Vauban,
yes, the SPI-interface is there, however how would i access that from the MSS and its Linux-system?
My issue is that I was trying via Python and the spidev package (spidev · PyPI) which would open SPIs which are located in /dev/spidev.. The Beagle-board has them in /sys/class/spi_master and hence nothing is found when trying to open the interface.

Would there be any reference-example already available that shows how to access the SPI on the on-board ADC? That would be my target to read out.

Cheers
Moadl

Sorry, I do not have a board at hand right now. Could you take a look in /usr/share/microchip on the board? Is there a python script there that exercises the on-board ADC?

Hi @Vauban,
thanks for the pointer, that was the correct place. There is a python-script that reads the ADC and shows how to handle the IF.

Cheers
Moadl

Hi @moadl,
How did you get SPI to work?

Hi @turaib
I went to the directory that Vauban had mentioned (/usr/share/microchip/gateware).
This directory contains a python-script called “mcp356x_read.py” which accesses the on-board ADC via SPI and then prints the read values via lots of puts-commands.

Cheers
Moadl

Hello!
My colleague Csaba H. managed to make SPI available from user space as spidev. Here is a detailed description of it: https://gist.github.com/cshegedus-dsp/e6346426278f7e1aeba785cb6d337dbf