Pi5 MESA 7c80: mesaflash can't see the card.

More
1 year 9 months ago - 1 year 9 months ago #318003 by ccatlett1984

If you can reliably access the card on the RPI4, you would

sudo mesaflash --device 7c80 --spi --addr /dev/spidev0.0 --write 7c80d.bit
sudo mesaflash --device 7c80 --spi --addr /dev/spidev0.0 --write 7c80fall.bit --fallback

(7c80d.bit and 7c80fall.bit are in the 7c80.zip file in /configs/hostmot2/)
the zip file is available from the store in the card specification tab

 
From Pi4, dump of mesaflash BEFORE flashing:  pastebin.com/kf8iUXQY
dump of mesaflash AFTER flashing:  pastebin.com/5xm8FHpq

I forced a --reload in between each flash cmd, to validate the card took the firmware before moving on.

If this looks correct, I will proceed to swapping the pi5 back into the machine.

Update: Post flashing, with the Pi5 - halcmd sees the card.
Code:
pi@linuxcnc:/$ sudo mesaflash --device 7c80 --addr /dev/spidev0.0 --spi --readhmid [sudo] password for pi: open: No such file or directory No 7C80 board found in /dev/ only a single spi entry exists "spidev10.0" running mesaflash (using the above spi entry) results in the following
Code:
pi@linuxcnc:/$ sudo mesaflash --device 7c80 --addr /dev/spidev10.0 --spi --readhmid Unexpected cookie at 0100..0110: ffffffff ffffffff ffffffff No 7C80 board found pi@linuxcnc:/$
Last edit: 1 year 9 months ago by ccatlett1984.

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

More
1 year 9 months ago - 1 year 9 months ago #318005 by PCW
You need to enable spidev0.0 by turning SPI on in the boot/broadcom/config.txt file

(I have no idea what pins spidev10.0 connects to)
 
Last edit: 1 year 9 months ago by PCW.

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

More
1 year 9 months ago #318008 by Cant do this anymore bye all
You need to enable the SPI in config.txt and reboot, it is under the boot folder but the folder have slightly different names to a std Raspbian OS.
If the 7c80 is similar to the 7c81 the spi pins are hardwired to the first spi port on the first spi interface.

linuxcnc.org/docs/html/man/man9/hm2_rpspi.9.html

The hm2_spix is pretty much the same. As you can see from the above the SPI signals are hardwired.

If the SPI circuit of the 7c80 is based on the 7c81 design:
Basically without creating a custom cable (which I mentioned previously) the only SPI interface is using the following pins
MOSI=10(19), MISO=9(21), SCLK=11(23), CE0=8(24)

To tell the truth I'm not even sure spidev10.0 is for end user use. I think the only pins exposed on the 40 pin header are for spidev1.xx & spidev0.xx

The reason the card will be seen when using halcmd is that the hm2_spix driver takes full control of the hardware regarding the spi pins. To put it simply it replaces the kernel module that handles spi hardware.

Summarizing:
Mesaflash requires the devnodes for spi to be created by the kernel. Which physically limited to /dev/spidev0.0

hm2_rpspi & hm2_spix don't use the dev nodes as the setup for the GPIO is done by the Linuxcnc driver. Yet phsycially physically limited to the GPIOS associated with /dev/spidev0.0
Without specifying a spi interface it will default to the hardware (GPIO pins) associated with /dev/spidev0.0
An alternate interface can be specified but the physical connections between the RPi and the Mesa board need to be changed to suit. ie CS, CLK,MISO& MOSI will be the same at the mesa end but will need changing at the RPi end.
The following user(s) said Thank You: rdtsc

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

More
1 year 9 months ago #318010 by ccatlett1984

You need to enable spidev0.0 by turning SPI on in the boot/broadcom/config.txt file

(I have no idea what pins spidev10.0 connects to)

 
Thought that would have been already enabled in the downloaded image...
I enabled it in /boot/broadcom/config.txt
here is the output
Code:
pi@linuxcnc:/dev$ ls spi* spidev0.0  spidev0.1  spidev10.0

Here is the mesaflash output.
Code:
pi@linuxcnc:~$ sudo mesaflash --device 7c80 --addr /dev/spidev1.0 --spi --readhmid open: No such file or directory No 7C80 board found pi@linuxcnc:~$ sudo mesaflash --device 7c80 --addr /dev/spidev10.0 --spi --readhmid Unexpected cookie at 0100..0110: ffffffff ffffffff ffffffff No 7C80 board found pi@linuxcnc:~$ sudo mesaflash --device 7c80 --addr /dev/spidev0.0 --spi --readhmid Configuration Name: HOSTMOT2 General configuration information:   BoardName : MESA7C80   FPGA Size: 9 KGates   FPGA Pins: 144   Number of IO Ports: 2   Width of one I/O port: 27   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

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

More
1 year 9 months ago #318012 by Cant do this anymore bye all
No but it has been mentioned multiple times in multiple places (pretty sure I have mentioned it myself in this thread, maybe my posts are too long), why it isn't enabled by default is only something those that produce the images can say. I was a advocate for enabling it by default and disabling BT & sound

Or at least this should be mentioned on the download page, but people being people they can be lazy and only want the goodies or they only follow links to the actual downloads.

As you can see there is only one spi device interface that the 7c80 will respond to without a custom cable.

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

More
1 year 9 months ago #318013 by ccatlett1984

No but it has been mentioned multiple times in multiple places (pretty sure I have mentioned it myself in this thread, maybe my posts are too long), why it isn't enabled by default is only something those that produce the images can say. I was a advocate for enabling it by default and disabling BT & sound

Or at least this should be mentioned on the download page, but people being people they can be lazy and only want the goodies or they only follow links to the actual downloads.

As you can see there is only one spi device interface that the 7c80 will respond to without a custom cable.
On a Pi <5, if you see anything in /dev/ spi*, spi is enabled...
Seeing as how i didn't have another pi5 with it already enabled to compare /dev/spi* to, it is a fair assumption for folks to make.
At the least, this needs a note/callout.

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

Moderators: PCW, jmelson
Time to create page: 0.506 seconds
Powered by Kunena Forum