CAN setup and auto loading


I’m completely new to both Beaglebone and Embedded Linux, but I decided to learn both in order to use Beaglebone Black as a development environment for a project which needs to include Can Bus interface. This forum and Molloy’s book are huge help of course, but some topics do require more info to complete the picture.

In order to enable CanBus on Beaglebone, I did all the steps described in various places including the book –

a) GPIO configuration using BB-CAN1-00A0.dtbo device tree overlay,

b) LKM deployment using modprobe and finally

c) Interface enabling using the ip link set and ifconfig <> up command.

This all makes sense, but I still have a few questions:

a) In order to do these three steps automatically on bootup, it is necessary to edit uBoot.txt (which I did) and that will take care of GPIO configuration. Editing /etc/network/interfaces will take care of interface enabling, but I still don’t understand what is the way to automatically load necessary Kernel modules.

b) Also, my understanding at the moment is that these modules are a part of SocketCan network protocol base driver, but I would appreciate if someone can confirm (or not) this.

c) Right after power-up, lsmod tells me that c_can_platform is loaded, together with it’s dependancies – c_can and can_dev. What is the reason these two were loaded but not the can_raw which is mentioned as required in every tutorial? Loading of can_raw also causes it’s dependency – can module to load. How come this one was not loaded automatically with others?

d) Finally, same as some previous posters I see a problem with pins. After enabling the can0 interface I can see it being loaded using ifconfig command. I can use it in the loopback mode using /can-utils/candump can0 & followed by /can-utils/cansend can0 123#123456.

Howeveer, it can’t be uses for the actual physical connection as all relevant pins are reported as not configured: for pins 19, 20, 24, 26, I get: config-pin -q P9_26 à P9_26 pinmux file not found! And Pin has no cape: P9_26. I do have Waveshare RS485/Can Cape connected to the BBB.

Thanks a lot,