2

I would like to run a CAN shield with MCP2515 controller connected to a Raspberry Pi 4 Model B. It already worked under Raspbian but because I need ROS2 I want to run it under Ubuntu (20.04) now. Here it does not work anymore.

What I did was editing /boot/config.txt and adding the following lines:

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

But ifconfig can gives

can: error fetching interface information: Device not found

The problem seems to be very similar to this one: The spi-bcm2835 module is not shown as output of lsmod and dmesg has this entry:

[    1.428843] spi-bcm2835 fe204000.spi: could not get clk: -517

Is this a general problem of Ubuntu on the Raspberry Pi? If so, is there a workaround for this issue?

Jonas
  • 33
  • 1
  • 5

1 Answers1

1

For ubuntu the boot partition is mounted under /boot/firmware with 3 files: config.txt, syscfg.txt, and usercfg.txt. The usercfg.txt is included by config.txt and is recommended to bearing user customized configuration. So saving your lines in usercfg.txt instead should make it works

usercfg.txt

ifconfig

candump by can-utils

Xinjue Zou
  • 26
  • 3
  • Please edit your answer to contain the actual text of the code being posted. [Do not post code using pictures](http://idownvotedbecau.se/imageofcode). – qwerty Aug 29 '21 at 19:31
  • Thank you very much! That was indeed the problem. – Jonas Aug 30 '21 at 11:49