'How to activate can bus support in Yocto/BeagleBoneBlack?

I am trying can bus support for Yocto with beagleboneblack.

I did kernel config by bitbake -c menuconfig virtual/kernel and add following driver to kernel.

  • Raw CAN Protocol
  • Broacast Manager CAN Protocol
  • CAN Gateway/Router
  • Platform CAN drivers with Netlink support
  • Can bit-timing calculation
  • TI High End CAN Controller

And add IMAGE_INSTALL_append = " can-utils iproute2" to local.conf.

When my yocto boot up, serial console seems to show

[    1.239593] can: controller area network core (rev 20170425 abi 9)
[    1.246828] NET: Registered protocol family 29
[    1.251438] can: raw protocol (rev 20170425)
[    1.255758] can: broadcast manager protocol (rev 20170425 t)
[    1.261517] can: netlink gateway (rev 20190810) max_hops=1

So, i think that kernel have can driver and socketcan.

But there is no can device.

root@beaglebone:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 78:a5:04:b4:18:cf brd ff:ff:ff:ff:ff:ff
    inet 192.168.100.19/24 brd 192.168.100.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 240b:251:520:5b00:7aa5:4ff:feb4:18cf/64 scope global dynamic mngtmpaddr
       valid_lft 2591946sec preferred_lft 604746sec
    inet6 fe80::7aa5:4ff:feb4:18cf/64 scope link
       valid_lft forever preferred_lft forever
3: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1000
    link/sit 0.0.0.0 brd 0.0.0.0

Could you tell me how can i find can device in ip a?

BR, Soramame



Solution 1:[1]

AM335X has Bosch C_CAN/D_CAN controller but not TI High End CAN Controller. So i changed kernel config from bitbake -c menuconfig virtual/kernel.

And I modified device tree and rebuild kernel.

Then, I could find can0 and can1.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Soramame