Converting a 7i76e config to 7c81/7i76 pair

More
29 Aug 2023 20:34 #279314 by PCW

I was under the impression that the hm2-rpspi required a entry in the dev folder for spi and the Hal gpio driver was a different beast.
 

hm2-rpspi does not require the SPI  device driver (or GPIO)
but mesaflash does require the SPI device driver
The following user(s) said Thank You: cornholio

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

More
29 Aug 2023 20:52 #279316 by cornholio
From the info I found, I could be wrong, the mainline kernel doesn’t support device tree overlays, or the mechanism required to get an spi device entry in /dev. It would seem this a patch that the raspbian team applies.
So I’m thinking that until the raspbian team has a kernel for bookworm, the Raspberry Pi will require Bullseye for any board that requires SPI to operate.
Bookworm should, in theory, be fine for Ethernet devices.
Now I could be totally wrong regarding this.

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

More
29 Aug 2023 21:53 #279324 by acondit
Sebastian has hm2_rpspi running under Debian Bookworm. I succeeded in getting spi-bcm2835 to load on boot but I still can't create the /dev/spi0.0 and /dev/spi0.1 devices on Bookworm. The kernel on Bookworm compiles the devices that would normally be loaded in the device tree as kernel modules. So, I am just trying to find out what piece or pieces are either missing or not loaded.
I just think it would be great to be able to run mesaflash on the 7c81 on Bookworm.

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

More
29 Aug 2023 23:42 #279329 by cornholio
The issue is and if you at this post forum.linuxcnc.org/38-general-linuxcnc-q...pair?start=10#279252
it explains why the device tree is not loading. CONFIG_OF_CONFIGFS=y is the important part.
Later in that post I checked the raspbian kernel config from my running RP400 for that option and it is there, but when I downloaded a RT arm64 kernel from debian and run grep on the kernel config it wasn't there. If the option was available it would have an N instead of Y.
Yep I had the kernel modules loading but no /dev entries under bookworm.

This explains the device tree far better than I could
docs.kernel.org/devicetree/overlay-notes.html

What lead me down this hole was when I was messing around with Linuxcnc-RIO which uses an ICE40 fpga and communicates via SPI. It would just not work under Debain Bookworm, but was fine with Bullseye. I don't want to recall how much time I spent.......and I only found out about the info I posted about above yesterday.

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

More
30 Aug 2023 01:49 #279334 by acondit
You seem all worried about not using the device tree. I don't believe the device tree is the only way to solve the problem.
The problem that is my immediate concern load_rt hm2_rpspi is working with spi on Bookworm. I now have a RaspberryPi OS 11 (Bullseye) disk that I can load when I need to run mesaflash.
My lower priority concern is trying to get mesaflash to run on Bookworm without device trees. I found the driver source for spi.c and spidev.c in the Bookworm preempt rt kernel that I am running.

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

More
30 Aug 2023 03:11 #279340 by cornholio
As PCW said
"but mesaflash does require the SPI device driver "

Which you wont have if you can't load the device tree overlay.
Anyways good luck.

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

More
30 Aug 2023 11:02 #279367 by cornholio
Playing around with Bookworm first mesaflash is without a board connected, second is with board connected.

rmurphy@rpi4-20230612:~$ cat /etc/debian_version
12.0
rmurphy@rpi4-20230612:~$ ls /dev/spi*
/dev/spidev0.0 /dev/spidev0.1
rmurphy@rpi4-20230612:~$ sudo mesaflash --device 7c81 --addr /dev/spidev0.0 --spi --readhmid
sudo: unable to resolve host rpi4-20230612: Name or service not known
unable to set bpw32, fallback to bpw8
Unexpected cookie at 0100..0110:
00000000 00000000 00000000
No 7C81 board found
rmurphy@rpi4-20230612:~$ sudo mesaflash --device 7c81 --addr /dev/spidev0.0 --spi --readhmid
sudo: unable to resolve host rpi4-20230612: Name or service not known
unable to set bpw32, fallback to bpw8
Configuration Name: HOSTMOT2

General configuration information:

BoardName : MESA7C81
FPGA Size: 9 KGates
FPGA Pins: 144
Number of IO Ports: 3
Width of one I/O port: 19
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: DPLL
There are 1 of DPLL in configuration
Version: 0
Registers: 7
BaseAddress: 7000
ClockFrequency: 100.000 MHz
Register Stride: 256 bytes
Instance Stride: 4 bytes

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 1 of QCount in configuration
Version: 2
Registers: 5
BaseAddress: 3000
ClockFrequency: 100.000 MHz
Register Stride: 256 bytes
Instance Stride: 4 bytes

Module: SSerial
There are 1 of SSerial in configuration
Version: 0
Registers: 6
BaseAddress: 5B00
ClockFrequency: 100.000 MHz
Register Stride: 256 bytes
Instance Stride: 64 bytes

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

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

Module: InM
There are 2 of InM in configuration
Version: 0
Registers: 5
BaseAddress: 8500
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+Serial -> 7C81_0
Pin# I/O Pri. func Sec. func Chan Sec. Pin func Sec. Pin Dir

P1-01/DB25-01 0 IOPort StepGen 0 Step/Table1 (Out)
P1-02/DB25-14 1 IOPort None
P1-03/DB25-02 2 IOPort None
P1-04/DB25-15 3 IOPort None
P1-05/DB25-03 4 IOPort None
P1-06/DB25-16 5 IOPort InM 0 Input0 (In)
P1-07/DB25-04 6 IOPort InM 0 Input1 (In)
P1-08/DB25-17 7 IOPort InM 0 Input2 (In)
P1-09/DB25-05 8 IOPort InM 0 Input3 (In)
P1-11/DB25-06 9 IOPort QCount 0 Quad-A (In)
P1-13/DB25-07 10 IOPort QCount 0 Quad-B (In)
P1-15/DB25-08 11 IOPort QCount 0 Quad-IDX (In)
P1-17/DB25-09 12 IOPort None
P1-19/DB25-10 13 IOPort StepGen 0 Dir/Table2 (Out)
P1-21/DB25-11 14 IOPort None
P1-23/DB25-12 15 IOPort StepGen 2 Step/Table1 (Out)
P1-25/DB25-13 16 IOPort StepGen 2 Dir/Table2 (Out)
P5 3,6 17 IOPort SSerial 0 TXData0 (Out)
P6 3,6 18 IOPort SSerial 0 TXData1 (Out)

IO Connections for P2+Serial -> 7C81_1
Pin# I/O Pri. func Sec. func Chan Sec. Pin func Sec. Pin Dir

P2-01/DB25-01 19 IOPort StepGen 1 Step/Table1 (Out)
P2-02/DB25-14 20 IOPort None
P2-03/DB25-02 21 IOPort None
P2-04/DB25-15 22 IOPort InM 1 Input0 (In)
P2-05/DB25-03 23 IOPort InM 1 Input1 (In)
P2-06/DB25-16 24 IOPort InM 1 Input2 (In)
P2-07/DB25-04 25 IOPort InM 1 Input3 (In)
P2-08/DB25-17 26 IOPort InM 1 Input4 (In)
P2-09/DB25-05 27 IOPort InM 1 Input5 (In)
P2-11/DB25-06 28 IOPort None
P2-13/DB25-07 29 IOPort None
P2-15/DB25-08 30 IOPort None
P2-17/DB25-09 31 IOPort None
P2-19/DB25-10 32 IOPort StepGen 1 Dir/Table2 (Out)
P2-21/DB25-11 33 IOPort None
P2-23/DB25-12 34 IOPort PWM 0 PWM (Out)
P2-25/DB25-13 35 IOPort None
P5 TXEN 36 IOPort SSerial 0 TXEn0 (Out)
P6 TXEN 37 IOPort SSerial 0 TXEn1 (Out)

IO Connections for P7+Serial -> 7C81_2
Pin# I/O Pri. func Sec. func Chan Sec. Pin func Sec. Pin Dir

P7-01/DB25-01 38 IOPort None
P7-02/DB25-14 39 IOPort None
P7-03/DB25-02 40 IOPort None
P7-04/DB25-15 41 IOPort None
P7-05/DB25-03 42 IOPort None
P7-06/DB25-16 43 IOPort None
P7-07/DB25-04 44 IOPort None
P7-08/DB25-17 45 IOPort None
P7-09/DB25-05 46 IOPort None
P7-11/DB25-06 47 IOPort None
P7-13/DB25-07 48 IOPort None
P7-15/DB25-08 49 IOPort None
P7-17/DB25-09 50 IOPort None
P7-19/DB25-10 51 IOPort None
P7-21/DB25-11 52 IOPort None
P7-23/DB25-12 53 IOPort None
P7-25/DB25-13 54 IOPort None
P5 1,2 55 IOPort SSerial 0 RXData0 (In)
P6 1,2 56 IOPort SSerial 0 RXData1 (In)

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

More
20 Aug 2024 01:44 - 20 Aug 2024 01:47 #308181 by acondit
After about a year, I am back to trying to get this to work. I have updated to Bookworm.
I enable spi in config.
I have been able to talk to the 7c81/7i76 with mesaflash.
I edited my 7i76e hal file replacing 7i76e with 7c81.
When I tried to start linuxcnc I got an error associated with this line:
loadrt hm2_eth board_ip="10.10.10.10" config="num_encoders=0 num_pwmgens=0 num_stepgens=3 sserial_port_0=0xxxxx"
I assume I need to replace hm2_eth with hm2_rspi and take out the board_ip="10.10.10.10"
Anything else I need to do?
Thanks in advance,
Alan
Last edit: 20 Aug 2024 01:47 by acondit. Reason: Add a little more info

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

More
20 Aug 2024 02:48 #308185 by PCW
That should about do it as long as you have 7C81+7I76 firmware installed on the 7C81

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

More
20 Aug 2024 14:03 #308215 by acondit
I did:
sudo mesaflash --device 7c81 --spi --addr /dev/spidev0.0 --write 7c81_7i76x2d.bit
and
sudo mesaflash --device 7c81 --spi --addr /dev/spidev0.0 --reload
when I tried to run linuxcnc I got an error about no hm2_rspi.so found.
How do I make sure hm2_rspi is on my system?

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

Time to create page: 0.102 seconds
Powered by Kunena Forum