Beaglebone black not working with MCP2515 CAN controller

Hi, I am trying to get to BBB to work with MCP2515 CAN controller. I am following this procedure: https://gist.github.com/pdp7/20dddbeffe83082e3c94ab0903563783
I am getting this error after adding .dtbo files into uEnv.txt and rebooting:
beaglebone login: [ 28.092392] pinctrl-single 44e10800.pinmux: pin PIN3 already requested by ocp:P8_06_pinmux; cannot claim for spi0.0
[ 28.402995] pinctrl-single 44e10800.pinmux: pin-3 (spi0.0) status -22
[ 28.596619] pinctrl-single 44e10800.pinmux: could not request pin 3 (PIN3) from group mcp2515_int on device pinctrl-single
[ 28.871192] mcp251x spi0.0: Error applying setting, reverse things back

I tried recompiling mcp2515.dts and changing gpio but the error persisted. Do you guys have any suggestion? What am I doing wrong?

/opt/scripts/tools/version.sh output:
git:/opt/scripts/:[b39ec679648a6be8f25f48bd1c9784c1fc5a0c46]
eeprom:[A335BNLTEIA02118SBB09021]
model:[TI_AM335x_BeagleBone_Black]
dogtag:[BeagleBoard.org Debian Buster IoT Image 2020-04-06]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2019.04-00002-g07d5700e21]:[location: dd MBR]
UBOOT: Booted Device-Tree:[am335x-boneblack-uboot-univ.dts]
UBOOT: Loaded Overlay:[AM335X-PRU-RPROC-4-14-TI-00A0]
UBOOT: Loaded Overlay:[BB-SPIDEV0-00A0]
UBOOT: Loaded Overlay:[MCP2515-SPI0]
kernel:[4.14.232-bone52]
nodejs:[v10.15.2]
/boot/uEnv.txt Settings:
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[uboot_overlay_addr0=/lib/firmware/BB-SPIDEV0-00A0.dtbo]
uboot_overlay_options:[uboot_overlay_addr1=/lib/firmware/MCP2515-SPI0.dtbo]
uboot_overlay_options:[disable_uboot_overlay_emmc=1]
uboot_overlay_options:[disable_uboot_overlay_video=1]
uboot_overlay_options:[disable_uboot_overlay_audio=1]
uboot_overlay_options:[disable_uboot_overlay_wireless=1]
uboot_overlay_options:[disable_uboot_overlay_adc=1]
uboot_overlay_options:[uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-14-TI-00A0.dtbo]
uboot_overlay_options:[enable_uboot_cape_universal=1]
pkg check: to individually upgrade run: [sudo apt install --only-upgrade ]
pkg:[bb-cape-overlays]:[4.14.20210821.0-0~buster+20210821]
pkg:[bb-wl18xx-firmware]:[1.20200322.0-0rcnee0~buster+20200322]
pkg:[kmod]:[26-1]
pkg:[librobotcontrol]:[1.0.4-git20190227.1-0rcnee0~buster+20190327]
pkg:[firmware-ti-connectivity]:[20190717-2rcnee1~buster+20200305]
groups:[debian : debian adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal bluetooth netdev i2c gpio pwm eqep remoteproc admin spi iio docker tisdk weston-launch xenomai cloud9ide]
cmdline:[console=ttyO0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 quiet]
dmesg | grep remote
[ 1.031945] remoteproc remoteproc0: wkup_m3 is available
[ 1.090986] remoteproc remoteproc0: powering up wkup_m3
[ 1.091005] remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf, size 217148
[ 1.094687] remoteproc remoteproc0: remote processor wkup_m3 is now up
dmesg | grep pru
dmesg | grep pinctrl-single
[ 0.753191] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
[ 28.092392] pinctrl-single 44e10800.pinmux: pin PIN3 already requested by ocp:P8_06_pinmux; cannot claim for spi0.0
[ 28.402995] pinctrl-single 44e10800.pinmux: pin-3 (spi0.0) status -22
[ 28.596619] pinctrl-single 44e10800.pinmux: could not request pin 3 (PIN3) from group mcp2515_int on device pinctrl-single
dmesg | grep gpio-of-helper
[ 0.762563] gpio-of-helper ocp:cape-universal: ready
lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
END

Your tripping over that, comment out that in line in /boot/uEnv.txt

Regards,

1 Like

Perhaps things have changed, but my experience has been that the Microchip CAN controllers were terrible chips.

You would be much better off just planting a transceiver directly on the Beaglebone DCAN0/1 lines and using the built-in CAN controller.

See: Adding CAN to the BeagleBone (Black) – Beyondlogic

1 Like