Orange Pi + SPI

More
10 Jun 2024 11:59 #302750 by Hossein74Majidi
Can anyone help me that how can I establish a SPI connection with FPGA?
Can I use the hm2_spi? or is there any other stuff that works with orangepi?

Please Log in or Create an account to join the conversation.

More
10 Jun 2024 12:08 #302751 by cornholio
Replied by cornholio on topic Orange Pi + SPI
hm2_spi is for mesa based fpga devices.
Here the man page and have a read
linuxcnc.org/docs/html/man/man9/hm2_spi.9.html
The following user(s) said Thank You: Hossein74Majidi

Please Log in or Create an account to join the conversation.

More
10 Jun 2024 12:26 #302754 by Hossein74Majidi
Replied by Hossein74Majidi on topic Orange Pi + SPI
thanks, I've read that already. I just wanna know if it can be used for orange pi too?
cause for raspberry there is another one named hm2_rpspi

Please Log in or Create an account to join the conversation.

More
10 Jun 2024 13:47 #302757 by cornholio
Replied by cornholio on topic Orange Pi + SPI
Did you read the bit about it being for Mesa hardware ? It’s not a generic SPI driver.

And did you read the bit about it not being all that fast ?

I’ve tried it on a RPi 5 and it just doesn’t cut it.
The following user(s) said Thank You: Hossein74Majidi

Please Log in or Create an account to join the conversation.

More
12 Jun 2024 05:46 #302858 by Hossein74Majidi
Replied by Hossein74Majidi on topic Orange Pi + SPI
Actually I did read about it and I know it is not a generic driver.
However I've got a mesa board and I did synthesize on its FPGA.
But the thing is I run linuxcnc on my orange pi 5 plus and I don't know how should I use the HAL SPI component to be compatible with orange pi to communicate via SPI with that mesa board.
can u explain a little more about this?

Please Log in or Create an account to join the conversation.

More
12 Jun 2024 06:40 #302859 by cornholio
Replied by cornholio on topic Orange Pi + SPI
hm2_spi uses the /dev/spixx device. So you have to tell it which spi device to use.

hm2_spi only works with the 7i90HD. So unless you are using this board it won't work out of the box. You would have to modify the driver to suit the board you are using. No that's not something I can do as I have no Orange Pi to test on and I know for a fact that after trying this driver on a RPi5 it is not suitable for running a machine.

All the information needed to load the driver is at the top of the man page. There is no special requirements that I'm aware of.

Here are some parts you need to be aware of:

hm2_spi is a device driver that interfaces Mesa’s SPI based Anything I/O boards (with the HostMot2 firmware) to the LinuxCNC HAL.

The supported boards are: 7I90HD.

The board must have a compatible firmware loaded on the board by the mesaflash(1) program.

hm2_spi is only available when LinuxCNC is configured with "uspace" realtime.

As of kernel 3.8, most or all kernel SPI drivers do not achieve the high realtime response rate required for a typical LinuxCNC configuration. The driver was tested with a modified version of the spi-s3c64xx SPI driver on the Odroid U3 platform. The patched kernel resides on github.


"However I've got a mesa board and I did synthesize on its FPGA."
What mesa board ? The 7i90HD have been out of stock for a while.

Or did you use a spartan-6 dev board and build firmware to suit ? Now this will be tricky if you don't have an RPi4 to test with. There's a few gotchas in rebuilding Mesa firmwares for dev boards, the first being making sure you are using the correct pin for your clock, then making sure the sources have the correct clock setup, unless of course you have a 50MHz clock on the dev board.

But the very first thing I would do is too confirm that you can get SPI working out of the context of Linuxcnc, this will at least confirm that the SPI hardware does work whether this is via C or Python or whatever you fell comfortable with, I'm sure there will be plenty examples of this on the internet.

Just be aware trying to go a cheaper route with hardware that is not very well proven may in fact cost more in the long run. Also it will be far more frustrating. It will also require lots of experimenting and "I wonder if this works" attitude.

It took me a while to work these things out using dev boards to work via EPP on a x86 platform and via SPI on the RPi4, experiments on the RPi5 with SPI proved to be fruitless.

Unfortunately these are the realities of going down the less trodden path. And honestly with out the help on the forum from Pete at Mesa I'd still be trying to get things to work rather than being distracted by other projects.
The following user(s) said Thank You: Hossein74Majidi

Please Log in or Create an account to join the conversation.

Time to create page: 0.161 seconds
Powered by Kunena Forum