Forum Discussion

AJuba's avatar
AJuba
Icon for New Contributor rankNew Contributor
7 years ago
Solved

Not Able to Detect CAN Bus on my system

Hello support. I am not able to detect my CAN bus on my custom board, this is Cyclone 5 soc device. Please help.
  • FawazJ_Altera's avatar
    7 years ago

    hello AJuba,

    This might fall within 2 reasons:

    1- the CAN bus is not enabled in device tree. to enable this, you need to modify the dts file, it might be something like this:

    can0: can@ffc00000 {

    compatible = "bosch,d_can";

    reg = <0xffc00000 0x1000>;

    interrupts = <0 131 4>, <0 132 4>, <0 133 4>, <0 134 4>;

    clocks = <&can0_clk>;

    status = "disabled";

    };

    can1: can@ffc01000 {

    compatible = "bosch,d_can";

    reg = <0xffc01000 0x1000>;

    interrupts = <0 135 4>, <0 136 4>, <0 137 4>, <0 138 4>;

    clocks = <&can1_clk>;

    status = "disabled";

    };

    both status="disabled" should be enabled if you have 2 CAN buses.

    2- Make sure to enable CAN bus driver in Linux Kernel menuconfig.

    -> Networking Support

    -> <*> CAN Bus Subsystem Support

    -> <*> Raw CAN Protocol

    -> <*> Broadcast Manager CAN Protocol

    -> <*> CAN Gateway/Router

    CAN Device Drivers

    -> <*> Platform CAN drivers with Netlink support

    -> [*] CAN bit-timing calculation

    -> <*> Bosch C_CAN/D_CAN Devices

    -> <*> Generic Platform Bus based C_CAN/D_CAN Driver

    -> [*] CAN devices debugging messages

    Hope this might help.

    Thanks