Raspberry Pi 4 7i90 on Mojo V3 board

  • rbobey1989
  • rbobey1989's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
18 May 2021 08:22 #209315 by rbobey1989
Raspberry Pi 4 7i90 on Mojo V3 board was created by rbobey1989
hello, I have given myself to the task just to do some research to test linuxcnc on my Raspberry Pi 4 to connect a Mojo V3 development board with the hostmot2 spi firmware, I built the kernel rt using
gnipsel.com/linuxcnc/uspace/
from this all good kernel check rt, uname -a ... 4.19.71-rt24-v7l + # 1 SMP PREEMPT RT ... ok, I built linuxcnc from source master branch 2.9 ok also, no error.
I built hostmot2 firmware using ISE Design Suite 14.7 using TopGCSPIHostMot2.vhd modifying i90_x9card.vhd just a bit:
constant LEDCount: integer: = 2 to value 8;
then the output for:
mesaflash --device 7i90 --spi --addr /dev/spidev0.0 --readhmid
no problem print pin.vhd file to console (port description).
The problem comes when accessing the board from halcmd, to:

halcmd: loadrt hostmot2

Note: Using POSIX realtime
hm2: loading Table HostMot2 driver version 0.15

loadrt

hm2_rpspi: SPI0 / CE0 Invalid cookie, read: 00000000 00000000 00000000, expected: 55aacafe 54534f48 32544f4d
hm2_rpspi: SPI0 / CE0 No drive seen on MISO line (kept at pull-down level). No board connected or bad connection?

I have tried to modify spiclk_rate to lower frequencies according to hm2_rpspi driver doc 30khz the lowest but without luck

So here we find a problem that has not had a solution hehe, if possible someone could shed light on this, sorry for my English, greetings

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

  • BeagleBrainz
  • BeagleBrainz's Avatar
  • Visitor
  • Visitor
18 May 2021 08:54 #209320 by BeagleBrainz
Replied by BeagleBrainz on topic Raspberry Pi 4 7i90 on Mojo V3 board
Might be your version of ISE

Look here for a little more information regarding versions.
github.com/LinuxCNC/hostmot2-firmware

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

  • rbobey1989
  • rbobey1989's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
18 May 2021 09:34 #209323 by rbobey1989
Replied by rbobey1989 on topic Raspberry Pi 4 7i90 on Mojo V3 board
I don't think so because with the spidev0.0 kernel driver and mesaflash I get a response, this means that the hostmot2 firmware in the fpga works, my suspicions are about the spi-bcm2835 driver in the Raspberry and its base address that is hm2_rpspi is not pointed in the right direction?

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

More
18 May 2021 23:59 #209425 by cakeslob
Replied by cakeslob on topic Raspberry Pi 4 7i90 on Mojo V3 board

I don't think so because with the spidev0.0 kernel driver and mesaflash I get a response,


loadrt hm2_spi spidev_path=/dev/spidev0.0

hmm you could try that as your driver, but its been a few years since ive played with mine. Can you post more of your project? I like these mojo boards , the onboard arduino is interesting. but when the cost close to a mesa card, its hard to justify. the china copies are pretty cheap
The following user(s) said Thank You: BeagleBrainz

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

More
19 May 2021 00:26 - 19 May 2021 00:34 #209429 by PCW
Replied by PCW on topic Raspberry Pi 4 7i90 on Mojo V3 board

I don't think so because with the spidev0.0 kernel driver and mesaflash I get a response, this means that the hostmot2 firmware in the fpga works, my suspicions are about the spi-bcm2835 driver in the Raspberry and its base address that is hm2_rpspi is not pointed in the right direction?


Does mesaflash work with the --readhmid option?

I have not heard of any hm2_rpspi addressing issues on the RPI3 or RPI4

On my RPI4 Model B 4G:

halcmd: loadrt hostmot2
Note: Using POSIX realtime
hm2: loading Mesa HostMot2 driver version 0.15
halcmd: loadrt hm2_rpspi
hm2/hm2_7c80.0: Low Level init 0.15
hm2/hm2_7c80.0: Smart Serial Firmware Version 43
Board hm2_7c80.0.7i73.0.0 Hardware Mode 0 = nokeyboardnodisplay
Board hm2_7c80.0.7i73.0.0 Software Mode 0 = inputoutputencoder
Board hm2_7c80.0.7i73.0.0 Software Mode 1 = inputoutputencoderanalog
Board hm2_7c80.0.7i73.0.0 Software Mode 2 = inputoutputencoderanalog
Board hm2_7c80.0.7i73.0.0 Hardware Mode 1 = nokeyboarddisplay
..........................................................................................................................
Last edit: 19 May 2021 00:34 by PCW.

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

  • rbobey1989
  • rbobey1989's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
19 May 2021 08:29 #209458 by rbobey1989
Replied by rbobey1989 on topic Raspberry Pi 4 7i90 on Mojo V3 board
Hello everyone and thanks for your answers, first of all, as I publish at the beginning of this thread, I get output without problems for the command:

mesaflash --device 7i90 --spi --addr /dev/spidev0.0 --readhmid

it prints the entire pin.vhd file to the console, now when I use the hm2_rpspi driver I get the error.

halcmd: loadrt hostmot2 (ok)

halcmd: loardrt hm2_rpspi (error described at the beginning of this thread)

I have been reading the tutorial
gnipsel.com/linuxcnc/uspace/rpi4-rt.html

and they use Raspbian Lite OS, it is not the one I have used, I simply loaded the image recommended with desktop by rpi-imager, although I don't think this is the problem I will start from scratch with Raspbian Lite OS image, I will build SMP RT PREEMT and linuxcnc uspace from the source to see what happens.

I have another question in the hm2_rpspi documentation, I have read that you have to disable the kernel driver or at least I understood that, because hm2_rpspi works with the dedicated controller, to do this just go to:

sudo raspi-config
interfacecing options
disable spi

soon

sudo modprobe spi_bcm2835

lsmod | grep spi (lists the loaded spi modules, i.e.
spi_bcm2835)

and I guess nothing more, if I'm wrong please correct me.

About the project, I'm not a Linuxcnc lover and I think there are very cheap boards on AliExpress for only 9 euros which is very feasible, I had a Mojo V3 lying around at home and I gave myself the task of testing a little on the subject but I never had tried spi and now i have problems hahahaha.

regards

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

  • rbobey1989
  • rbobey1989's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
19 May 2021 09:19 #209465 by rbobey1989
Replied by rbobey1989 on topic Raspberry Pi 4 7i90 on Mojo V3 board
I this google checker really plays tricks, I really meant; I'm a linuxcnc lover haha

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

More
19 May 2021 13:31 #209506 by PCW
Replied by PCW on topic Raspberry Pi 4 7i90 on Mojo V3 board
Might be some kind of issue with the bitfile

Do you have the FPGA clock setup the same? (on board clocks are used for timeouts etc)

What kind of cabling are you using? (it needs to be short and have good ground integrity)

To check the RPSPI driver, can you see if clocks are generated at the interface?

You might also try the kernel hm2 driver driver as suggested by cakeslob
AFAICR it has pretty bad latency but should help debugging

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

  • rbobey1989
  • rbobey1989's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
19 May 2021 21:49 - 19 May 2021 22:08 #209553 by rbobey1989
Replied by rbobey1989 on topic Raspberry Pi 4 7i90 on Mojo V3 board
Well, apparently the hm2_spi driver doesn't work either, I'm definitely doing something wrong:

halcmd: loadrt hostmot2
Note: Using POSIX realtime
hm2: loading Mesa HostMot2 driver version 0.15
loadrt hm2_spi spidev_path=/dev/spidev0.0
halcmd: loadrt hm2/hm2_7i90.0: pin 19 primary tag is 0 (end-of-list sentinel), expected 72 pins!
hm2/hm2_7i90.0:: dlopen: /usr/lib/linuxcnc/modules/hm2/hm2_7i90.0:.so: cannot open shared object file: No such file or directory
<stdin>:2: waitpid failed /usr/bin/rtapi_app hm2/hm2_7i90.0:
<stdin>:2: /usr/bin/rtapi_app exited without becoming ready
<stdin>:2: insmod for hm2/hm2_7i90.0: failed, returned -1

but the weird thing is that mesaflash does work without problems, the truth is very intrigued

sudo mesaflash --device 7i90 --spi --addr /dev/spidev0.0 --readhmid
unable to set bpw32, fallback to bpw8
Configuration Name: HOSTMOT2

General configuration information:

BoardName : MESA7I90
FPGA Size: 9 KGates
FPGA Pins: 144
Number of IO Ports: 3
Width of one I/O port: 24
Clock Low frequency: 100.0000 MHz
Clock High frequency: 200.0000 MHz
IDROM Type: 3
Instance Stride 0: 4
Instance Stride 1: 64
Register Stride 0: 256
Register Stride 1: 256

Modules in configuration:

Module: WatchDog
There are 1 of WatchDog in configuration
Version: 0
Registers: 3
BaseAddress: 0C00
ClockFrequency: 100.000 MHz
Register Stride: 256 bytes
Instance Stride: 4 bytes

Module: IOPort
There are 3 of IOPort in configuration
Version: 0
Registers: 5
BaseAddress: 1000
ClockFrequency: 100.000 MHz
Register Stride: 256 bytes
Instance Stride: 4 bytes

Module: QCount
There are 8 of QCount in configuration
Version: 2
Registers: 5
BaseAddress: 3000
ClockFrequency: 100.000 MHz
Register Stride: 256 bytes
Instance Stride: 4 bytes

Module: PWM
There are 8 of PWM in configuration
Version: 0
Registers: 5
BaseAddress: 4100
ClockFrequency: 200.000 MHz
Register Stride: 256 bytes
Instance Stride: 4 bytes

Module: StepGen
There are 4 of StepGen in configuration
Version: 2
Registers: 10
BaseAddress: 2000
ClockFrequency: 100.000 MHz
Register Stride: 256 bytes
Instance Stride: 4 bytes

Module: LED
There are 1 of LED in configuration
Version: 0
Registers: 1
BaseAddress: 0200
ClockFrequency: 100.000 MHz
Register Stride: 256 bytes
Instance Stride: 4 bytes

Configuration pin-out:

IO Connections for P1
Pin# I/O Pri. func Sec. func Chan Pin func Pin Dir

1 0 IOPort QCount 1 Quad-B (In)
3 1 IOPort QCount 1 Quad-A (In)
5 2 IOPort QCount 0 Quad-B (In)
7 3 IOPort QCount 0 Quad-A (In)
9 4 IOPort QCount 1 Quad-IDX (In)
11 5 IOPort QCount 0 Quad-IDX (In)
13 6 IOPort PWM 1 PWM (Out)
15 7 IOPort PWM 0 PWM (Out)
17 8 IOPort PWM 1 Dir (Out)
19 9 IOPort PWM 0 Dir (Out)
21 10 IOPort PWM 1 /Enable (Out)
23 11 IOPort PWM 0 /Enable (Out)
25 12 IOPort QCount 3 Quad-B (In)
27 13 IOPort QCount 3 Quad-A (In)
29 14 IOPort QCount 2 Quad-B (In)
31 15 IOPort QCount 2 Quad-A (In)
33 16 IOPort QCount 3 Quad-IDX (In)
35 17 IOPort QCount 2 Quad-IDX (In)
37 18 IOPort PWM 3 PWM (Out)
39 19 IOPort PWM 2 PWM (Out)
41 20 IOPort PWM 3 Dir (Out)
43 21 IOPort PWM 2 Dir (Out)
45 22 IOPort PWM 3 /Enable (Out)
47 23 IOPort PWM 2 /Enable (Out)

IO Connections for P2
Pin# I/O Pri. func Sec. func Chan Pin func Pin Dir

1 24 IOPort QCount 5 Quad-B (In)
3 25 IOPort QCount 5 Quad-A (In)
5 26 IOPort QCount 4 Quad-B (In)
7 27 IOPort QCount 4 Quad-A (In)
9 28 IOPort QCount 5 Quad-IDX (In)
11 29 IOPort QCount 4 Quad-IDX (In)
13 30 IOPort PWM 5 PWM (Out)
15 31 IOPort PWM 4 PWM (Out)
17 32 IOPort PWM 5 Dir (Out)
19 33 IOPort PWM 4 Dir (Out)
21 34 IOPort PWM 5 /Enable (Out)
23 35 IOPort PWM 4 /Enable (Out)
25 36 IOPort QCount 7 Quad-B (In)
27 37 IOPort QCount 7 Quad-A (In)
29 38 IOPort QCount 6 Quad-B (In)
31 39 IOPort QCount 6 Quad-A (In)
33 40 IOPort QCount 7 Quad-IDX (In)
35 41 IOPort QCount 6 Quad-IDX (In)
37 42 IOPort PWM 7 PWM (Out)
39 43 IOPort PWM 6 PWM (Out)
41 44 IOPort PWM 7 Dir (Out)
43 45 IOPort PWM 6 Dir (Out)
45 46 IOPort PWM 7 /Enable (Out)
47 47 IOPort PWM 6 /Enable (Out)

IO Connections for P3
Pin# I/O Pri. func Sec. func Chan Pin func Pin Dir

1 48 IOPort StepGen 0 Step/Table1 (Out)
3 49 IOPort StepGen 0 Dir/Table2 (Out)
5 50 IOPort StepGen 0 Table3 (Out)
7 51 IOPort StepGen 0 Table4 (Out)
9 52 IOPort StepGen 0 Table5 (Out)
11 53 IOPort StepGen 0 Table6 (Out)
13 54 IOPort StepGen 1 Step/Table1 (Out)
15 55 IOPort StepGen 1 Dir/Table2 (Out)
17 56 IOPort StepGen 1 Table3 (Out)
19 57 IOPort StepGen 1 Table4 (Out)
21 58 IOPort StepGen 1 Table5 (Out)
23 59 IOPort StepGen 1 Table6 (Out)
25 60 IOPort StepGen 2 Step/Table1 (Out)
27 61 IOPort StepGen 2 Dir/Table2 (Out)
29 62 IOPort StepGen 2 Table3 (Out)
31 63 IOPort StepGen 2 Table4 (Out)
33 64 IOPort StepGen 2 Table5 (Out)
35 65 IOPort StepGen 2 Table6 (Out)
37 66 IOPort StepGen 3 Step/Table1 (Out)
39 67 IOPort StepGen 3 Dir/Table2 (Out)
41 68 IOPort StepGen 3 Table3 (Out)
43 69 IOPort StepGen 3 Table4 (Out)
45 70 IOPort StepGen 3 Table5 (Out)
47 71 IOPort StepGen 3 Table6 (Out)
Last edit: 19 May 2021 22:08 by rbobey1989.

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

  • rbobey1989
  • rbobey1989's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
19 May 2021 22:13 - 19 May 2021 22:17 #209557 by rbobey1989
Replied by rbobey1989 on topic Raspberry Pi 4 7i90 on Mojo V3 board
apparently some progress, hm2_spi works in halcmd

halcmd: loadrt hostmot2
Note: Using POSIX realtime
hm2: loading Mesa HostMot2 driver version 0.15
halcmd: loadrt hm2_spi spidev_path=/dev/spidev0.0
probe 24000000
hm2/hm2_7i90.0: Low Level init 0.15
hm2/hm2_7i90.0: 72 I/O Pins used:
hm2/hm2_7i90.0: IO Pin 000 (P1-01): IOPort
hm2/hm2_7i90.0: IO Pin 001 (P1-03): IOPort
hm2/hm2_7i90.0: IO Pin 002 (P1-05): IOPort
hm2/hm2_7i90.0: IO Pin 003 (P1-07): IOPort
hm2/hm2_7i90.0: IO Pin 004 (P1-09): IOPort
hm2/hm2_7i90.0: IO Pin 005 (P1-11): IOPort
hm2/hm2_7i90.0: IO Pin 006 (P1-13): IOPort
hm2/hm2_7i90.0: IO Pin 007 (P1-15): IOPort
hm2/hm2_7i90.0: IO Pin 008 (P1-17): IOPort
hm2/hm2_7i90.0: IO Pin 009 (P1-19): IOPort
hm2/hm2_7i90.0: IO Pin 010 (P1-21): IOPort
hm2/hm2_7i90.0: IO Pin 011 (P1-23): IOPort
hm2/hm2_7i90.0: IO Pin 012 (P1-25): IOPort
hm2/hm2_7i90.0: IO Pin 013 (P1-27): IOPort
hm2/hm2_7i90.0: IO Pin 014 (P1-29): IOPort
hm2/hm2_7i90.0: IO Pin 015 (P1-31): IOPort
hm2/hm2_7i90.0: IO Pin 016 (P1-33): IOPort
hm2/hm2_7i90.0: IO Pin 017 (P1-35): IOPort
hm2/hm2_7i90.0: IO Pin 018 (P1-37): IOPort
hm2/hm2_7i90.0: IO Pin 019 (P1-39): IOPort
hm2/hm2_7i90.0: IO Pin 020 (P1-41): IOPort
hm2/hm2_7i90.0: IO Pin 021 (P1-43): IOPort
hm2/hm2_7i90.0: IO Pin 022 (P1-45): IOPort
hm2/hm2_7i90.0: IO Pin 023 (P1-47): IOPort
hm2/hm2_7i90.0: IO Pin 024 (P2-01): IOPort
hm2/hm2_7i90.0: IO Pin 025 (P2-03): IOPort
hm2/hm2_7i90.0: IO Pin 026 (P2-05): IOPort
hm2/hm2_7i90.0: IO Pin 027 (P2-07): IOPort
hm2/hm2_7i90.0: IO Pin 028 (P2-09): IOPort
hm2/hm2_7i90.0: IO Pin 029 (P2-11): IOPort
hm2/hm2_7i90.0: IO Pin 030 (P2-13): IOPort
hm2/hm2_7i90.0: IO Pin 031 (P2-15): IOPort
hm2/hm2_7i90.0: IO Pin 032 (P2-17): IOPort
hm2/hm2_7i90.0: IO Pin 033 (P2-19): IOPort
hm2/hm2_7i90.0: IO Pin 034 (P2-21): IOPort
hm2/hm2_7i90.0: IO Pin 035 (P2-23): IOPort
hm2/hm2_7i90.0: IO Pin 036 (P2-25): IOPort
hm2/hm2_7i90.0: IO Pin 037 (P2-27): IOPort
hm2/hm2_7i90.0: IO Pin 038 (P2-29): IOPort
hm2/hm2_7i90.0: IO Pin 039 (P2-31): IOPort
hm2/hm2_7i90.0: IO Pin 040 (P2-33): IOPort
hm2/hm2_7i90.0: IO Pin 041 (P2-35): IOPort
hm2/hm2_7i90.0: IO Pin 042 (P2-37): IOPort
hm2/hm2_7i90.0: IO Pin 043 (P2-39): IOPort
hm2/hm2_7i90.0: IO Pin 044 (P2-41): IOPort
hm2/hm2_7i90.0: IO Pin 045 (P2-43): IOPort
hm2/hm2_7i90.0: IO Pin 046 (P2-45): IOPort
hm2/hm2_7i90.0: IO Pin 047 (P2-47): IOPort
hm2/hm2_7i90.0: IO Pin 048 (P3-01): IOPort
hm2/hm2_7i90.0: IO Pin 049 (P3-03): IOPort
hm2/hm2_7i90.0: IO Pin 050 (P3-05): IOPort
hm2/hm2_7i90.0: IO Pin 051 (P3-07): IOPort
hm2/hm2_7i90.0: IO Pin 052 (P3-09): IOPort
hm2/hm2_7i90.0: IO Pin 053 (P3-11): IOPort
hm2/hm2_7i90.0: IO Pin 054 (P3-13): IOPort
hm2/hm2_7i90.0: IO Pin 055 (P3-15): IOPort
hm2/hm2_7i90.0: IO Pin 056 (P3-17): IOPort
hm2/hm2_7i90.0: IO Pin 057 (P3-19): IOPort
hm2/hm2_7i90.0: IO Pin 058 (P3-21): IOPort
hm2/hm2_7i90.0: IO Pin 059 (P3-23): IOPort
hm2/hm2_7i90.0: IO Pin 060 (P3-25): IOPort
hm2/hm2_7i90.0: IO Pin 061 (P3-27): IOPort
hm2/hm2_7i90.0: IO Pin 062 (P3-29): IOPort
hm2/hm2_7i90.0: IO Pin 063 (P3-31): IOPort
hm2/hm2_7i90.0: IO Pin 064 (P3-33): IOPort
hm2/hm2_7i90.0: IO Pin 065 (P3-35): IOPort
hm2/hm2_7i90.0: IO Pin 066 (P3-37): IOPort
hm2/hm2_7i90.0: IO Pin 067 (P3-39): IOPort
hm2/hm2_7i90.0: IO Pin 068 (P3-41): IOPort
hm2/hm2_7i90.0: IO Pin 069 (P3-43): IOPort
hm2/hm2_7i90.0: IO Pin 070 (P3-45): IOPort
hm2/hm2_7i90.0: IO Pin 071 (P3-47): IOPort
hm2/hm2_7i90.0: registered


I had a little problem in the PIN.vhd file, with the number of LEDs declared, but hm2_rpspi with no apparent solution

halcmd: loadrt hm2_rpspi
hm2_rpspi: SPI0/CE0 Invalid cookie, read: 00000000 00000000 00000000, expected: 55aacafe 54534f48 32544f4d
hm2_rpspi: SPI0/CE0 No drive seen on MISO line (kept at pull-down level). No board connected or bad connection?
hm2_rpspi: rtapi_app_main: No such device (-19)
<stdin>:3: waitpid failed /usr/bin/rtapi_app hm2_rpspi
<stdin>:3: /usr/bin/rtapi_app exited without becoming ready
<stdin>:3: insmod for hm2_rpspi failed, returned -1
halcmd: exit
hm2_rpspi: not loaded
<commandline>:0: exit value: 255
<commandline>:0: rmmod failed, returned -1
hm2: unloading
<commandline>:0: unloadrt failed
Last edit: 19 May 2021 22:17 by rbobey1989.

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

Time to create page: 0.077 seconds
Powered by Kunena Forum