This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM335x CAN driver reporting Address family not supported by protocol

Other Parts Discussed in Thread: AM3354

On my custom build the CAN driver doesn't work, it seems like it's present and running but perhaps not configured correctly. I can see the drivers in place:

[root /]# lsmod
Module                  Size  Used by
bufferclass_ti          5409  0
omaplfb                11513  1
musb_dsps               6444  0
musb_hdrc              52530  1 musb_dsps
pvrsrvkm              174829  6 bufferclass_ti,omaplfb
c_can_platform          4172  0
c_can                   8180  1 c_can_platform
can_dev                 6951  1 c_can
musb_am335x             1199  0

but when I try to set up the CAN driver it returns an error message:

[root /]# ip link set can0 type can bitrate 125000 triple-sampling on
[root /]# ip link set can0 up
[   61.200946] c_can_platform 481cc000.d_can can0: setting BTR=1c0b BRPE=0000
[root /]# cansend can0 -i 0x10 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88
interface = can0, family = 29, type = 3, proto = 1
socket: Address family not supported by protocol

The only messages I see in the boot log regarding the CAN are:

[    4.129489] CAN device driver interface
[    4.311302] c_can_platform 481cc000.d_can: c_can_platform device registered (regs=fa1cc000, irq=68)

Is there anything obvious I can check with the configuration of the CAN driver that could be causing it to report "Address family not supported by protocol"?



  • Hi Mike,

    Which Linux version are you using?

  • Biser Gatchev-XID said:

    Which Linux version are you using?

    3.12
    Specifically, we took the SDK7 content and update the kernel with our own additions, so the kernel we have is the 3.12 TI version + updates.
  • Is the CAN interface connected to another device or a CAN network?

    This is the CAN driver wiki: http://processors.wiki.ti.com/index.php/Linux_Core_DCAN_User's_Guide

  • Biser Gatchev-XID said:

    Is the CAN interface connected to another device or a CAN network?

    Our AM3354 is setup to use the CAN interface as CAN and the Hardware has it wired to our CAN connectors. Right now I have no CAN cable connected to my ports on the board, I'm just testing out a few steps.

    When I build my kernel content via the TI build system I see a similar start up and lsmod output:

    [    3.567886] CAN device driver interface
    [    3.816845] c_can_platform 481cc000.d_can: c_can_platform device registered (regs=fa1cc000, irq=68)
    ...
    [root /]# lsmod
    Module                  Size  Used by
    musb_dsps               6511  0
    musb_hdrc              52593  1 musb_dsps
    snd_soc_omap            2494  0
    snd_pcm_dmaengine       2997  1 snd_soc_omap
    snd_soc_davinci_mcasp     9484  0
    snd_soc_davinci         5438  1 snd_soc_davinci_mcasp
    snd_soc_core           99221  3 snd_soc_davinci_mcasp,snd_soc_omap,snd_soc_davinci
    regmap_spi              1469  1 snd_soc_core
    c_can_platform          4176  0
    snd_pcm                66734  4 snd_soc_core,snd_soc_omap,snd_soc_davinci,snd_pcm_dmaengine
    c_can                   8182  1 c_can_platform
    can_dev                 6951  1 c_can
    snd_timer              16028  1 snd_pcm
    snd_page_alloc          4843  1 snd_pcm
    snd_compress            7419  1 snd_soc_core
    snd                    45368  4 snd_soc_core,snd_timer,snd_pcm,snd_compress
    ti_am335x_adc           3227  0
    soundcore               4767  1 snd
    industrialio           32701  1 ti_am335x_adc
    musb_am335x             1199  0
    

    But in addition to that, setting up CAN seems to work:

    [root /]# ip link set can0 type can bitrate 125000 triple-sampling on
    [root /]# ip link set can0 up
    [   76.426868] c_can_platform 481cc000.d_can can0: setting BTR=1c0b BRPE=0000
    [root /]# cansend can0 -i 0x10 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88
    interface = can0, family = 29, type = 3, proto = 1
    [   84.663973] can: controller area network core (rev 20120528 abi 9)
    [   84.677888] NET: Registered protocol family 29
    [   84.708682] can: raw protocol (rev 20120528)
    

    But when I build, what should be the same content, via my OpenEmbedded build system, I see the start up messages and the CAN interface in lsmod, but the "cansend" command bombs out with the not supported message I showed before.

    I would like to further understand what causes this message to be sent such that I can isolate whatever the difference may be between these setups and see if I can get the CAN driver correctly configured

  • Mike,

    I asked the factory team to look into this.

  • I finally found the answer, OpenEmbedded seems to have split the CAN drivers into several different packages and each of these has to be installed in my recipe, here's the final list I needed to add to my recipe to get CAN installed and working:

    IMAGE_INSTALL += "kernel-module-c-can-platform"
    IMAGE_INSTALL += "kernel-module-can-dev"
    IMAGE_INSTALL += "kernel-module-c-can"
    IMAGE_INSTALL += "kernel-module-can-bcm"
    IMAGE_INSTALL += "kernel-module-can-gw"
    IMAGE_INSTALL += "kernel-module-can-raw"