Loading CAN cape on startup

Using the new Debian builds on my beaglebone white, I’m trying to load a device tree overlay for the CAN cape on startup, but it seems to fail to load automatically (but try), however, I can load the device tree overlay manually and it seems to work just fine. What am I doing wrong?

I even tried putting the following entry in uEnv.txt:

optargs=capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN,BB-BONE-EMMC-2G capemgr.enable_partno=BB-BONE-SERL-01

I don’t know of any hardware conflicts, and the same hardware works fine on Angstrom. I really want to migrate to Debian for several reasons.

Here’s the command and successful load manually:

debian@arm:~$ sudo sh -c “echo BB-BONE-SERL-01 > /sys/devices/bone_capemgr.8/slots”
[sudo] password for debian:
[ 99.355373] bone-capemgr bone_capemgr.8: part_number ‘BB-BONE-SERL-01’, version ‘N/A’
[ 99.365522] bone-capemgr bone_capemgr.8: slot #5: generic override
[ 99.372251] bone-capemgr bone_capemgr.8: bone: Using override eeprom data at slot 5
[ 99.380404] bone-capemgr bone_capemgr.8: slot #5: ‘Override Board Name,00A0,Override Manuf,BB-BONE-SERL-01’
[ 99.391261] bone-capemgr bone_capemgr.8: slot #5: Requesting part number/version based 'BB-BONE-SERL-01-00A0.dtbo
[ 99.402199] bone-capemgr bone_capemgr.8: slot #5: Requesting firmware ‘BB-BONE-SERL-01-00A0.dtbo’ for board-name ‘Override Board Name’, version ‘00A0’
[ 99.434783] bone-capemgr bone_capemgr.8: slot #5: dtbo ‘BB-BONE-SERL-01-00A0.dtbo’ loaded; converting to live tree
[ 99.448201] bone-capemgr bone_capemgr.8: slot #5: #2 overlays
[ 99.456729] platform 481d0000.d_can: alias fck already exists
[ 99.468434] bone-capemgr bone_capemgr.8: slot #5: Applied #2 overlays.
debian@arm:~$ [ 99.538154] CAN device driver interface
[ 99.562768] c_can_platform 481d0000.d_can: invalid resource
[ 99.568915] c_can_platform 481d0000.d_can: control memory is not used for raminit
[ 99.580927] c_can_platform 481d0000.d_can: c_can_platform device registered (regs=fa1d0000, irq=71)

debian@arm:~$ cat /sys/devices/bone_capemgr.8/slots
1: 55:PF—
2: 56:PF—
3: 57:PF—
5: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-BONE-SERL-01
debian@arm:~$ sudo ip link set can0 type can bitrate 50000

debian@arm:~$ sudo ifconfig can0 up
[ 248.574278] c_can_platform 481d0000.d_can can0: setting BTR=1c1d BRPE=0000
debian@arm:~$ candump can0

Also, what is getting “overridden” and making the slots claim “Override Board Name,00A0,Override Manuf” etc?

-Andrew

I had a similar experience with the Debian 3.8 kernel. Never figured it out and wrote a simple startup service (systemd) to do the echo... Now I am using 3.13 and using Robert Nelson's excellent ideas (see the thread "Kernel/device tree road-map for the BBB")

Hope this helps,

Dave.

For some reason the "capemgr.enable_partno=" is just not reliable on
the bootargs..

As a workaround I've added an init script workaround by default:

sudo sh -c "echo CAPE=BB-BONE-SERL-01 >> /etc/default/capemgr"

and it'll load pretty early on bootup..

Regards,

Hey Robert,

Its seems I have the same problem for beaglebone wihite with the following specs:

uname -a

Linux air2 3.8.13-bone63 #1 SMP Mon Aug 11 23:03:02 UTC 2014 armv7l armv7l armv7l GNU/Linux

echo $SLOTS

/sys/devices/bone_capemgr.8/slots

cat /boot/uEnv.txt
#Docs: http://elinux.org/Beagleboard:U-boot_partitioning_layout_2.0

uname_r=3.8.13-bone63

#dtb=

uuid=218093a4-e1e1-4e3f-8607-fba670d2a5d8

cmdline=quiet

##Example
#cape_disable=capemgr.disable_partno=
cape_enable=capemgr.enable_partno=AIR-ADC,AIR-GPIO,AIR-UART1,AIR-UART2,AIR-UART4,AIR-UART5

##enable BBB: eMMC Flasher:
##make sure, these tools are installed: dosfstools rsync
#cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v2.sh

How can I add multiple DT’s to /etc/default/capemgr ? (Sytax for CAPE= 1 2 3 …)

Thanks,
Dan.

Just seperate them with ',''s

CAPE=1,2,3,4

https://github.com/RobertCNelson/omap-image-builder/blob/master/target/init_scripts/capemgr-debian.sh#L18

It'll load them in a for loop in that order..

Regards,