BBB A5A with CAN cape BB-BONE-SERL-01-00A2: firmware loaded but no can device

I found the message on http://www.aero-box.co.uk/beaglebone-black from Owen McAree, in which he describes the pinmux settings:

I added a section to this for the dcan1 pins. The pins happen to be the same as those for UART2 which is convenient because Nick’s guide has already identified the correct offsets (0x180 and 0x184) from the TRM.
[snip]

Pin Slew Rate Input Pull Up Pull Up Mode Mode Mode In Hex
d_can1_tx (0x180) 0 0 1 0 0 1 0 0x12
d_can1_rx (0x184) 0 1 1 0 0 1 0 0x32

Which would lead to a change in the pinmux setup in BB-BONE-SERL-01:

Now it is

fragment@0 {
target = <&am33xx_pinmux>;
overlay {
bone_serl_01_dcan1_pins: bone_serl_01_dcan1_pins {
pinctrl-single,pins = <
0x180 0x02 /* uart1_rxd.d_can1_tx", OUTPUT | MODE2 /
0x184 0x32 /
uart1_txd.d_can1_rx", INPUT_PULLUP | MODE2 */

;
};
};
};

According to Owen this should be:

fragment@0 {
target = <&am33xx_pinmux>;
overlay {
bb_dcan1_pins: pinmux_bb_dcan1_pins {
pinctrl-single,pins = <
0x180 0x12 /* P9.26 uart1_rxd.can1_tx INPUT_PULLUP | MODE2 /
0x184 0x32 /
P9.24 uart1_txd.dcan1_rx RECV_ENABLE | INPUT_PULLUP | MODE2 */

;
};
};
};

The difference is in the INPUT_PULLUP pin. I don’t know if he is correct, but you might try to edit the dts file and use 0x12 instead of 0x02 for P9.26, and see if it makes a difference.

I have made a version that might do the trick. Mind you, I do not have a BB-BONE-SERL-01 CAN cape…

Best Regards, Johan

BB-CANBUS1-00A0.dts (1.32 KB)

There is an error in the file example: you should name the file the same as the definition. So
replace
part-number = “BB-DCAN1”;
with
part-number = “BB-CANBUS1”;

in the file, or rename the file to BB-DCAN1 before compiling and adding to uEnv.txt.

Hello everybody,

I also stumbled about the CAN Cape support in Angstrom. I finally found out that the latest image (2013-06-06) does already include all the cape support we need. But still you need to change a little bit as the BBB may be shipped with a CAN Cape Rev. 00A2 instead of 00A1.

You just need to cp /lib/firmware/BB-BONE-SERL-01-00A1.dts to /lib/firmware/BB-BONE-SERL-01-00A2.dts adapt the part-number in the new dts file to match the files name and compile it on the BBB:
dtc -O dtb -@ /lib/firmware/BB-BONE-SERL-01-00A2.dts > /lib/firmware/BB-BONE-SERL-01-00A2.dtbo

Restart the BBB and now the capemgr should be able to load the correspondig dtbo and adapt the devicetree.

Cheers,
Sebastian

Hello Sebastian,
I have the latest image on my White BeagleBone.
I rename/modfiy the .dts, and compile it to .dtbo.
And it doesn’t change anything, it still requesting to load the correct firmware.
Here is a dmesg | grep cape: http://pastebin.com/shE5uZ8t
And a full dmesg:http://pastebin.com/DSEcirq1
I request for a RMA, and they said that BeagleBone with Kernel 3.8 doesn’t support CAN Bus CAPE, for the moment…

Sebastian: Did you only rename a file and compile it to make it run correctly ?
Best regards

Hello Melvin,

you also need to adapt the revision in the .dts file to match yours Cape revision.

Cheers,
Sebastian

Just checked the dmesg and it looks like the dts was correctly applied but the d_can_platform driver cannot access the CAN controller:

  1. [ 13.830327] CAN device driver interface

  2. [ 14.041655] c_can_platform 481d0000.d_can: invalid resource

  3. [ 14.047679] c_can_platform 481d0000.d_can: control memory is not used for raminit

  4. [ 14.053809] c_can_platform 481d0000.d_can: c_can_platform device registered (regs=fa1d0000, irq=71)

You are using a White BeagleBone, I do not if this stuff is compatible.

Any update on this matter?
I’m on a similar situation.

I got CAN1 working just fine with the original
0x180 0x02 /* uart1_rxd.d_can1_tx", OUTPUT | MODE2 /
0x184 0x32 /
uart1_txd.d_can1_rx", INPUT_PULLUP | MODE2 */

pin-muxes in my .dts. I then loaded it into the slots with “echo my_dts > sudo tee /sys/devices/bone_capemgr.*/slots” and can0 showed up when I do “cat /proc/net/dev”. Then ‘sudo ip link set can0 up type can bitrate 125000’ or whatever works just fine and can0 shows up in ifconfig.

Awesome.

Mine is showing on ifconfig as can0 as well.
I tested with loopback mode and it worked.

Tomorrow I’ll hook up the transceiver and check this up.

Thanks.

Hi,

I have a Rev 00A2 and made the changes as Sebastian suggest below. I have only changed version in the dts file to 00A2 (don’t understand the “adapt the part-number in the new dts file to match the files name”?)
After compiling and rebooting I still get a

[ 60.501650] bone-capemgr bone_capemgr.8: failed to load firmware ‘BB-BONE-SERL-01-00A2.dtbo’

but
echo BB-BONE-SERL-01:00A2 >/sys/devices/bone_capemgr.*/slots

works without problems.
Any idea why I get the “failed to load firmware ‘BB-BONE-SERL-01-00A2.dtbo’”?

/Benny

I don’t know exactly what the the intention is with device tree and capemgr, but I thought creating a new dts file with the correct version and compile it on the BBB should be enough.

Anyway I had to compile the kernel with the new dts file before it would load automatically.
Is that the idea or do I miss a step?
New to device tree so sorry if I ask stupid questions.

/Benny

This link does a pretty good job of describing the device tree if you’re interested. https://docs.google.com/document/d/17P54kZkZO_-JtTjrFuVz-Cp_RMMg7GB_8W9JK9sLKfA/pub

I was able to recompile, but my A2 cape is not recognized and ifconfig reports no can0
any suggestions?

Hi Benny,
I have exact the same issue. What I found is: CAN dtbo load correctly when boot from sd card, but not work when boot from eMMC, that make me think it is a boot order issue. I googled it and according to this post:
https://groups.google.com/forum/#!msg/beagleboard/Iem_mHknIUM/buwAqagYukwJ
the reason is: eMMC is also a cape, it is loaded after CAN cape (my CAN cape is configured at slot 0), so the rootfs is not ready for a dtbo that is not build into kernel.
The solution is here:
https://github.com/pantoniou/linux-bbxm/commit/738e37102bdfbfd065f4f53814df62b896804d90
In case of CAN cape, add
capemgr.enable_partno=BB-BONE-SERL-01:00A2:8
at optargs

I am using ubuntu from armhf with kernel 3.8.13-bone30.

Jun