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 |
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…
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.
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.
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
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.
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’”?
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.
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.