Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8044

Advanced users • Re: Two CAN one RPi (using SPI)

$
0
0
Hi! first of all thanks for your time to help!

My driver is the mcp251xfd

Code:

cm4-3@raspberrypi:~/Desktop $ dmesg | grep -i mcp[    5.367132] mcp251xfd spi6.0 can0: MCP2518FD rev0.0 (-RX_INT -PLL -MAB_NO_WARN +CRC_REG +CRC_RX +CRC_TX +ECC -HD o:20.00MHz c:20.00MHz m:1.00MHz rs:1.00MHz es:1.00MHz rf:1.00MHz ef:1.00MHz) successfully initialized.
About the dts; I saw that in the examples the spi0.0 and spi0.1 are being disabled, but i gess it's because on spi6, as it's not a default option, it's not needed, is that correct?
Additionally, the dts works correcly, as it reads as expected. It's when i use the comunications with the motor, that that comunication fails, using SPI or USB to get to the CAN.

Hope this helps!
There are two example overlays which you can use for reference:
https://github.com/raspberrypi/linux/bl ... verlay.dts
https://github.com/raspberrypi/linux/bl ... verlay.dts

a driver is here https://github.com/raspberrypi/linux/bl ... /mcp251x.c but that does not have a compatibility string for 2518 - https://github.com/raspberrypi/linux/bl ... C1-L1282C3 - so which driver do you intend to use?

Code:

static const struct of_device_id mcp251x_of_match[] = {{.compatible= "microchip,mcp2510",.data= (void *)CAN_MCP251X_MCP2510,},{.compatible= "microchip,mcp2515",.data= (void *)CAN_MCP251X_MCP2515,},{.compatible= "microchip,mcp25625",.data= (void *)CAN_MCP251X_MCP25625,},{ }};

Statistics: Posted by DeLacorte123 — Mon Nov 25, 2024 4:00 pm



Viewing all articles
Browse latest Browse all 8044

Trending Articles