Ive enable dtoverlay for mcp2515 and spi and it kind of seems to work, except clock setting.
Here's my outputs
/boot/config.txt
Code: Select all
dtparam=spi=on
dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25
#dtoverlay=mcp2515-can1,oscillator=16000000,interrupt=24
dtoverlay=spi-bcm2835
dtdebug=1
enable_uart=0
Code: Select all
root@raspberrypi:~# journalctl | grep CAN
Jan 28 15:49:37 raspberrypi kernel: CAN device driver interface
root@raspberrypi:~# journalctl | grep can
root@raspberrypi:~# journalctl | grep SPI
root@raspberrypi:~# journalctl | grep spi
root@raspberrypi:~#
Code: Select all
root@raspberrypi:~# ip -s -d link show can0
3: can0: <NOARP,ECHO> mtu 16 qdisc noop state DOWN mode DEFAULT group default qlen 10
link/can promiscuity 0
can state STOPPED restart-ms 0
mcp251x: tseg1 3..16 tseg2 2..8 sjw 1..4 brp 1..64 brp-inc 1
clock 8000000
re-started bus-errors arbit-lost error-warn error-pass bus-off
0 0 0 0 0 0
RX: bytes packets errors dropped overrun mcast
0 0 0 0 0 0
TX: bytes packets errors dropped carrier collsns
0 0 0 0 0 0
root@raspberrypi:~#
I have verified the controller to work with arduino. Also tried to compile new dtbo for can0 since i suspected osc value to be hardcoded in dtbo, but no success.
Any ideas ?
Or is there a way to get clock to 16mhz ?