Mesa 7i90 in SPI mode

14 Mar 2017 12:28 #89579 by PKM
So, mesaflash compiled well, but it can't see 7i90 on my Pi 2.

Another question: what are symptoms of lost connection?
Say, I loaded hm2_rpspi and addf-ed it to a thread, so I can control CR leds. After 3-4 hrs, I can still issue setp and it works. Does it mean that the connection has been stable and never lost?
14 Mar 2017 13:36 #89584 by andypugh
If that is the case then it at least means that the watchdog has never bitten, so there has been no interruption in the read/write sequence.
The following user(s) said Thank You: PKM
20 Mar 2017 17:49 #89957 by sleepybishop
i noticed on my machines that sometimes mesaflash would only work after a fresh boot, if i had started and stopped linuxcnc, eg modules were loaded. then the card wouldnt be detected. what is the output of mesaflash?

you can also try running this tool too see if the card is responding with a "AA AA AA AA" preamble on /dev/spidev0.0

also wrt to kernel build times, i used to have a separate box running distcc to cross compile kernels but it fried, i just compiled 4.9.15 directly on some boards, it took about 4 hours on a pi 3 and 16 hours on a pi zero.
The following user(s) said Thank You: PKM
20 Mar 2017 19:06 #89962 by jtheath
One thing to note, mesaflash and spidev_test both assume the standard spi driver is loaded and available. The hm2_rpspi solution goes directly to the low-level hardware and at least originally required disabling the standard spi driver.
The following user(s) said Thank You: PKM
21 Mar 2017 20:58 #90030 by PKM
Right, I did not enable SPI in config.txt before, thanks for the hint!
Now mesaflash works (at least readhmid is OK).

And yes, loading hm2_spi breaks it. Mesaflash shows something about wrong cookie FFFF FFFF FFFF. Not a big deal, of course.
21 Mar 2017 21:10 #90031 by jtheath
If interested there is an updated hm2_spi.c which allows for 8-bit words here,
21 Mar 2017 21:22 #90032 by PKM
Thanks, I'll try that!
Why wouldn't you send a PR against the main repo?

BTW I noticed that mesaflash says something about 32-bit failing, using 8-bit...
21 Mar 2017 22:13 #90035 by jtheath
Have personally seen a few SPI timeout messages when running. Likely need to update standard RPi spidev driver code to provide better determinism.

Also need to completely comment these changes prior to submission.

The 7i90 expects 32-bit transfers and was originally developed using hardware which provides 32-bit words when using SPI. Thus mesaflash configures the hardware for 32-bit words. The RPi, Pine and others only allow for 8-bit SPI "word" sizes. These SBCs reject the 32-bit request. Instead of failing and exiting mesaflash now sets 8-bit words and orders the bytes for correct transmission.
Moderators: PCWjmelson
Time to create page: 0.330 seconds
Powered by Kunena Forum