PiCAN2 issue with Balena Fin

Hi!

I am trying to use PiCAN2 board with Balena Fin. I have the similar issue as described here: can0 device is not created, kernel message log shows:

[    5.158349] mcp251x spi0.0: MCP251x didn't enter in conf mode after reset
[    5.158393] mcp251x spi0.0: Probe failed, err=16
[    5.158453] mcp251x: probe of spi0.0 failed with error -16

lsmod | grep mcp gives:

mcp251x                20480  0
can_dev                28672  1 mcp251x

Kernel is 5.4

Any suggestions how to solve the problem?

Hi! Thank you for reporting and welcome to the balena forums!

One quick question. Are you using balenaOS or Raspbian?

Hello, if you are using the last kernel update that should solve some voltage issues. On the other hand, did you follow the instructions to change the device tree overlay? https://copperhilltech.com/content/PICAN2_jessie_2016-05-10.pdf

Hi Marc,

thanks for a quick reply :slight_smile:

I am using Raspbian, the most recent kernel: https://github.com/raspberrypi/linux

Added 3 lines to /boot/config.txt as directed:

dtparam=spi=on
dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25
dtoverlay=spi-bcm2835-overlay

Hi,

A colleague noted that he had a user with a similar issue with the balenaFin + pican2 duo, and he produced a balena application for testing that has the Fin writing on a can bus and reading from the other. Here’s the link: https://github.com/balena-io-playground/balena-pican2-testbench.

Let us know if this is something that might work for you.

John

Unfortunately I’ve got only one bus physically and no even can0 device to begin with sending anything…

By the way, I’ve just tried the same hardware on regular Raspberry 3 (same Kernel 5.4) and the driver loads:

[    8.009589] CAN device driver interface
[    8.057974] mcp251x spi0.0 can0: MCP2515 successfully initialized.

Hi,

That’s interesting that it worked on the RPi 3. I’ll share this with our engineers to see if we might have a bug.

John

Thank You very much! I would be glad to provide additional diagnostic data if it helps.

Yes, if you can share the RPi 3 logs along with the separate balenaFin logs, that would be very useful. Thanks for your help and your patience!

John