This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED][OP2] SPI device MCP2515 spidev
#1
Hi,
I have make a new thread for this problem:
MCP2515 on CE1 do not work at same time with moitessier hat.
(2.0.21 Pi 4)
I have find out following:
By adding:
dtoverlay=mcp2515-can1,cs=1,oscillator=16000000,interrupt=25
throug the CAN BUS App of openplotter the SPI with CE1 should be load.


Code:
dmesg | grep -i -E "(mcp|spi)"

says:
[    4.689934] mcp251x spi0.1 can0: MCP2515 successfully initialized.

so far all right
but in the devicetree the SPI is called spidev0.0
I think that shoul make problems with Moitessier driver?
Reply
#2
(2020-01-13, 09:59 AM)glowntiger Wrote: Hi,
I have make a new thread for this problem:
MCP2515 on CE1 do not work at same time with moitessier hat.
(2.0.21 Pi 4)
I have find out following:
By adding:
dtoverlay=mcp2515-can1,cs=1,oscillator=16000000,interrupt=25
throug the CAN BUS App of openplotter the SPI with CE1 should be load.


Code:
dmesg | grep -i -E "(mcp|spi)"

says:
[    4.689934] mcp251x spi0.1 can0: MCP2515 successfully initialized.

so far all right
but in the devicetree the SPI is called spidev0.0
I think that shoul make problems with Moitessier driver?

Hi, I can or should do something to correct. If you explain step by step what to do then I am attaching what you need! A pity if it wasn't solved for the next fair there!  Huh Big Grin Angry
Reply
#3
Hi Sailoog,
I´m not realy conform with overlays.... But what do you think:
The original raspberry overlay:
https://github.com/raspberrypi/linux/blo...verlay.dts
Here the SPI is load to 0/1:


Code:
/* the spi config of the can-controller itself binding everything together */
   fragment@4 {
       target = <&spi0>;
       __overlay__ {
           /* needed to avoid dtc warning */
           #address-cells = <1>;
           #size-cells = <0>;
           can1: mcp2515@1 {
               reg = <1>;
               compatible = "microchip,mcp2515";
               pinctrl-names = "default";
               pinctrl-0 = <&can1_pins>;
               spi-max-frequency = <10000000>;
               interrupt-parent = <&gpio>;
               interrupts = <25 0x2>;
               clocks = <&can1_osc>;


And here the moitessier is also load to 0/1:
https://github.com/mr-rooney/moitessier-...8c1f389773

Code:
   moitessier0: moitessier@0{
        compatible = "rooco,moitessier";
        #address-cells = <1>;
        #size-cells = <0>;
What do you think?
Reply
#4
Let's not panic, everything is working right Wink
The only wrong thing here is the way we check if the SPI is enabled. We use lsmod to check if spidev is present in the list but when you enable MCP2515 lsmod no longer returns spidev. Just do not trust the warning messages of SPI being disabled because it is enabled and working.

The solution is to switch to another flag. I have tested spi_bcm2835 and it works for MCP2515 enabled and disabled in my Raspberry 4 but I need to know if this is true for raspberry 3 too. Please could you test in RPi3 typing this in the terminal for both states (with MCP2515 and without)?

Code:
lsmod | grep spi_bcm2835

You should get something like:


Code:
spi_bcm2835            20480  0
Reply
#5
Hi Sailoog,
thanks.. sometimes the solutions are quite easy... Shy  Tongue

This is on my Pi 4
Code:
spi_bcm2835            20480  0

On Pi 3 I check in the evening...
Thanks
Thomas
Reply
#6
(2020-01-15, 10:06 AM)glowntiger Wrote: Hi Sailoog,
thanks.. sometimes the solutions are quite easy... Shy  Tongue

This is on my Pi 4
Code:
spi_bcm2835            20480  0

On Pi 3 I check in the evening...
Thanks
Thomas
Hi Glowntiger, even after the latest kernel update of PI3 and also PI4 (4.19.93), and CAP Moitessier update, everything works fine without your card. As an attack on the PI to the MCS, SPI is disconnected and the serial interfaces do not work. I hope that in the meantime you will be able to have a Moitessier CAP to arrive at a solution. How's your booth going at your BOOT? Good job and good wind!

[img][Image: DB78bZ.png][/img]
Reply
#7
Hi Max,
The fair is going well...
as described above from Sailoog this isn´t a bug of the SPI. It is only a wrong check of the SPI .
Reply
#8
(2020-01-22, 12:58 PM)glowntiger Wrote: Hi Max,
The fair is going well...
as described above from Sailoog this isn´t a bug of the SPI. It is only a wrong check of the SPI .

[img][Image: ikAnXj.png][/img]

Hi, apart from the red writing of the SPI, which is only a warning without consequences, the configuration of the CAN bus that automatically OPs on "Canbus (canboatjs)" (and not Canbus (canboat) seems to work anyway. Not so 'for the serial port configurations, which automatically switch to "ttyAMA0" and there is no way to make them work! Do the tests as soon as you have time and let me know! Good job and good wind always!     Huh    Cool

(2020-01-25, 03:16 PM)Max1947 Wrote:
(2020-01-22, 12:58 PM)glowntiger Wrote: Hi Max,
The fair is going well...
as described above from Sailoog this isn´t a bug of the SPI. It is only a wrong check of the SPI .

[img][Image: ikAnXj.png][/img]

Hi, apart from the red writing of the SPI, which is only a warning without consequences, the configuration of the CAN bus that automatically OPs on "Canbus (canboatjs)" (and not Canbus (canboat) seems to work anyway. Not so 'for the serial port configurations, which automatically switch to "ttyAMA0" and there is no way to make them work! Do the tests as soon as you have time and let me know! Good job and good wind always!     Huh    Cool
Vedi anche:

[img][Image: tyTras.png][/img]

[img][Image: Ub60en.png][/img]
Reply
#9
Hi max,
this is only a problem of the serial APP. You can use the serial ports directly in signal K. Then you must set the connection to ttySC0 - ttySC3. This should work perfectly… ;-)
The ttySC port is always the same after reboot...
Reply
#10
Fixed in openplotter-moitessier - 2.0.4-beta
marking as solved
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)